:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --panel: #fffdf9;
  --line: #ddd3c6;
  --text: #1f1a14;
  --muted: #6a6257;
  --accent: #0b6e4f;
  --accent-2: #f0a202;
  --error: #b3261e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f6f3ee 0%, #efe7dc 100%);
  color: var(--text);
  font-family: Georgia, "Iowan Old Style", serif;
}

.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.site-header nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.site-header a {
  color: var(--text);
  text-decoration: none;
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
}

.panel {
  background: rgba(255, 253, 249, 0.95);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 12px 30px rgba(31, 26, 20, 0.06);
}

.hero h1,
.panel h1,
.panel h2,
.panel h3 {
  margin-top: 0;
}

.cta-row,
.inline-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.button.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.muted {
  color: var(--muted);
}

.form-hint {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
}

.flash {
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  background: #fff;
}

.flash.success {
  border-color: #9cc7b8;
  background: #edf8f3;
}

.flash.error {
  border-color: #e2b4b0;
  background: #fff2f1;
}

.journal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.journal-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border-radius: 16px;
  background: white;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: white;
  color: var(--text);
  font: inherit;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #fcfaf6;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.result-box,
.success-inline {
  padding: 12px 14px;
  border-radius: 12px;
  background: #edf8f3;
  border: 1px solid #9cc7b8;
}

.resource-chip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff7e8;
  border: 1px solid #ecd1a0;
  margin-bottom: 12px;
}

.resource-chip a {
  color: var(--accent);
}

/* Workflow steps */
.workflow-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  margin-bottom: 12px;
  overflow-x: auto;
}

.wf-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 90px;
  text-align: center;
  opacity: 0.45;
  transition: opacity 0.3s;
}

.wf-step.wf-active {
  opacity: 1;
}

.wf-step.wf-done {
  opacity: 0.7;
}

.wf-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--line);
  font-weight: 700;
  font-size: 0.85rem;
}

.wf-active .wf-num {
  background: var(--accent);
  color: white;
}

.wf-done .wf-num {
  background: #9cc7b8;
  color: white;
}

.wf-label {
  font-weight: 700;
  font-size: 0.8rem;
}

.wf-desc {
  font-size: 0.7rem;
  color: var(--muted);
}

.wf-arrow {
  color: var(--muted);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.wf-pulse {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* AI result badge */
.ai-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  border: 1px solid #81c784;
  font-size: 0.8rem;
  font-weight: 700;
  color: #2e7d32;
  margin-bottom: 12px;
}

.ai-result {
  border-color: #81c784;
  border-width: 2px;
  position: relative;
}

@media (max-width: 768px) {
  .form-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .workflow-steps {
    gap: 4px;
  }

  .wf-step {
    min-width: 60px;
  }

  .wf-desc {
    display: none;
  }
}
