:root {
  color-scheme: light;
  --bg: #f5f6f2;
  --panel: #ffffff;
  --ink: #17201a;
  --muted: #667064;
  --line: #dfe4dc;
  --accent: #0d6b57;
  --accent-soft: #e4f3ee;
  --warm: #8a5a18;
  --warm-soft: #fff3dd;
  --shadow: 0 14px 36px rgba(23, 32, 26, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px;
}

.topbar,
.panel,
.question-card,
.report-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.topbar {
  padding: 22px;
}

.topbar h1 {
  font-size: 28px;
  line-height: 1.15;
  margin: 0 0 10px;
}

.topbar p,
.muted {
  color: var(--muted);
}

.topbar p {
  line-height: 1.7;
  margin: 0;
}

.single-flow {
  margin-top: 16px;
}

.flow-main {
  display: grid;
  gap: 16px;
}

.panel,
.question-card,
.report-card {
  padding: 18px;
}

.panel h2,
.report-card h2 {
  margin: 0 0 10px;
}

.section-kicker {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 6px;
}

.question-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.question-card label {
  display: block;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 8px;
}

.helper {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 10px;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.55;
}

.choice-list {
  display: grid;
  gap: 8px;
}

.choice-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
}

.choice-item input {
  width: auto;
}

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 18px;
}

.primary-button,
.ghost-button,
.module-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 700;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.module-button {
  padding: 7px 10px;
  font-size: 13px;
  white-space: nowrap;
}

.module-button.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 11px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
}

.bottom-generate {
  background: #10241e;
  color: #fff;
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.bottom-generate p {
  color: #d7e5df;
  line-height: 1.7;
  margin: 0 0 14px;
}

.bottom-generate .generate-button {
  width: 100%;
  background: #f5f1df;
  border-color: #f5f1df;
  color: #10241e;
  min-height: 48px;
}

.bottom-generate .status-pill {
  margin-top: 12px;
}

.bottom-generate .notification-pill {
  background: rgba(245, 241, 223, 0.16);
  color: #f5f1df;
}

.timeline-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

.cognition-report {
  display: grid;
  gap: 18px;
}

.report-tension {
  background: var(--warm-soft);
  color: var(--warm);
  border: 1px solid #efd4a9;
  border-radius: 8px;
  padding: 12px;
  line-height: 1.6;
  font-weight: 700;
}

.narrative-block,
.validation-card,
.clarification-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.narrative-block h3,
.validation-card h3,
.cognition-report article h3 {
  margin: 0 0 10px;
}

.narrative-block p,
.validation-card p,
.clarification-card p,
.report-intro {
  line-height: 1.75;
  margin: 0;
}

.narrative-block p + p,
.validation-card p + p,
.clarification-card p + p,
.report-intro + .clarification-list {
  margin-top: 10px;
}

.report-intro {
  color: var(--muted);
  margin-bottom: 12px;
}

.clarification-list {
  display: grid;
  gap: 12px;
}

.clarification-card {
  background: #fbfcf8;
}

.clarification-card h4 {
  font-size: 17px;
  line-height: 1.45;
  margin: 0 0 10px;
}

.validation-card {
  background: var(--accent-soft);
  border-color: #bbded3;
}

.validation-question {
  font-size: 18px;
  font-weight: 750;
  line-height: 1.65;
}

.subtle-block {
  background: #fbfcf8;
}

@media (max-width: 520px) {
  .app-shell {
    padding: 12px;
  }

  .topbar,
  .panel,
  .question-card,
  .report-card {
    padding: 15px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .actions {
    grid-template-columns: 1fr;
  }

  .question-card label,
  .validation-question {
    font-size: 16px;
  }
}
