/* ============================================================
   The Story of Us . Interactive assessment
   Visual design matches the source booklet:
   - Bright teal (#1FAFA0) accent
   - White background, clean black text
   - Sans-serif throughout (Open Sans)
   - Teal rounded-pill banners for section headers
   - ■ + bold caps for subsections
   - Plain bordered tables, no shadows
   - Teal page-number pills
   ============================================================ */

:root {
  --teal:        #1FAFA0;
  --teal-dark:   #138F83;
  --teal-darker: #0E6B62;
  --teal-50:     #ECF8F6;
  --teal-100:    #D6F0EC;
  --teal-200:    #A9E1DA;

  --ink:        #1A1A1A;
  --ink-soft:   #333333;
  --muted:      #6E6E6E;
  --line:       #D8D8D8;
  --line-soft:  #ECECEC;

  --paper:      #FFFFFF;

  --rose-50:    #FBEFE9;
  --rose-200:   #E9C5B5;

  --amber:      #F97316;
  --amber-dark: #C2510C;
  --amber-50:   #FFF4EC;

  --alert-red:  #C82E2E;
  --alert-50:   #FBECEC;

  --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;

  --container:      720px;
  --container-wide: 920px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 220ms;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; color: inherit; }

::selection { background: var(--teal-100); color: var(--ink); }

a { color: var(--teal-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--teal-darker); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--teal-dark); }
.brand-tree, .brand-logo {
  width: 26px; height: 26px;
  flex-shrink: 0;
  object-fit: contain;
}
.brand-text { color: inherit; }
.progress-wrap { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 100px; }
.progress-track {
  flex: 1; height: 3px;
  background: var(--line-soft);
  border-radius: 999px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0;
  background: var(--teal);
  border-radius: 999px;
  transition: width var(--dur) var(--ease);
}
.progress-label { font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 70px; text-align: right; }
.topbar-menu-btn {
  background: var(--teal);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 8px 16px;
  border-radius: 999px;
  text-transform: uppercase;
}
.topbar-menu-btn:hover { background: var(--teal-dark); }

@media (max-width: 640px) {
  .topbar-inner { gap: 10px; padding: 10px 14px; }
  .brand-text { display: none; }
  .progress-label { display: none; }
}

/* ---------- Outline drawer ---------- */
.outline-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(340px, 90vw);
  background: var(--paper);
  box-shadow: -8px 0 28px rgba(0,0,0,0.10);
  z-index: 100;
  overflow-y: auto;
  transform: translateX(0);
  transition: transform var(--dur) var(--ease);
}
.outline-drawer[hidden] { display: block; transform: translateX(100%); visibility: hidden; }
.outline-drawer-inner { padding: 24px 22px; }
.outline-drawer h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 18px;
  padding-left: 18px;
  position: relative;
}
.outline-drawer h3::before {
  content: '';
  position: absolute; left: 0; top: 4px;
  width: 11px; height: 11px;
  background: var(--ink);
}
.outline-list {
  list-style: none;
  padding: 0; margin: 0 0 24px;
}
.outline-list li {
  margin-bottom: 2px;
}
.outline-list li button {
  background: none; border: none; padding: 9px 12px;
  color: var(--ink-soft); width: 100%;
  text-align: left; font-size: 14.5px;
  border-radius: 4px;
  border-left: 3px solid transparent;
}
.outline-list li button:hover {
  background: var(--teal-50);
  color: var(--teal-darker);
}
.outline-list li.is-current button {
  background: var(--teal-50);
  border-left-color: var(--teal);
  color: var(--teal-darker);
  font-weight: 600;
}

/* ---------- Steps ---------- */
.step { display: none; padding: 32px 0 96px; min-height: 70vh; position: relative; }
.step.active { display: block; animation: fadeIn 240ms var(--ease); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.container { max-width: var(--container-wide); margin: 0 auto; padding: 0 28px; position: relative; }
.container.narrow { max-width: var(--container); }

/* ---------- Page header (matches "THE STORY OF US: Presented by Francois Esterhuizen") ---------- */
.page-header {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  margin: 4px 0 28px;
}

/* ---------- Page-number pill (bottom of step) ---------- */
.page-num {
  position: absolute;
  bottom: 24px;
  left: 28px;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}
.page-num.right { left: auto; right: 28px; }

/* ---------- Section banners (teal pill matching the PDF) ---------- */
.section-banner {
  background: var(--teal);
  color: #fff;
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 14px 24px;
  border-radius: 6px;
  margin: 8px 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1.15;
}
.section-banner .section-page {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ---------- Subsection marker (■ + caps) ---------- */
.subsection {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 22px 0 14px;
}
.subsection::before {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  background: var(--ink);
  flex-shrink: 0;
}

/* ---------- Exercise title ---------- */
.exercise-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin: 16px 0 10px;
}
.exercise-title .ex-tag {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ---------- Typography ---------- */
.display {
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--teal);
  margin: 0 0 14px;
  line-height: 1.05;
  text-align: center;
}
.cover-subtitle {
  text-align: center;
  font-size: clamp(17px, 2.4vw, 22px);
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 32px;
}
.lede {
  font-size: 16.5px;
  color: var(--ink-soft);
  margin: 0 0 16px;
  max-width: 64ch;
}
.lede.tight { margin-bottom: 8px; }

/* "Letter from Francois" voice . slightly more intimate */
.letter p {
  margin: 0 0 16px;
  color: var(--ink-soft);
}
.letter .signature {
  margin-top: 22px;
  font-weight: 700;
  color: var(--teal-dark);
}
.letter .signature .who {
  font-weight: 700;
  letter-spacing: 0.02em;
}
.letter em { font-style: italic; }
.letter strong { color: var(--ink); }

.tip {
  background: var(--teal-50);
  border-left: 3px solid var(--teal);
  padding: 12px 16px;
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 8px 0 24px;
}
.tip strong { color: var(--ink); }
.tip-sep { color: var(--teal); margin: 0 4px; }
.tip .arrow-bullet { color: var(--teal); font-weight: 700; }

.link-btn {
  background: none; border: none; padding: 0;
  color: var(--teal-dark);
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { color: var(--teal-darker); }

.arrow-instr {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 14px 0 22px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.arrow-instr::before {
  content: '→';
  color: var(--teal);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
}
.arrow-instr strong { color: var(--ink); font-weight: 700; }
.arrow-instr .ink-teal { color: var(--teal-dark); font-weight: 700; }
.arrow-instr .ink-amber { color: var(--amber-dark); font-weight: 700; }

.instr-block {
  margin: 14px 0 24px;
  padding: 12px 16px;
  background: var(--teal-50);
  border-left: 3px solid var(--teal);
  border-radius: 0 4px 4px 0;
}
.instr-block .arrow-instr {
  margin: 4px 0;
}

/* ---------- Buttons ---------- */
.actions {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 36px; align-items: center;
}
.actions-wide { gap: 14px; }
.btn-primary, .btn-ghost {
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 6px;
  padding: 13px 22px;
  border: 2px solid transparent;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn-primary {
  background: var(--teal);
  color: #fff;
}
.btn-primary:hover { background: var(--teal-dark); }
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--teal-50); border-color: var(--teal); color: var(--teal-dark); }
.arrow { display: inline-block; transition: transform var(--dur) var(--ease); }
.btn-primary:hover .arrow { transform: translateX(3px); }

/* ---------- Three-column table (Exercise A / B / C / D / E / F) ---------- */
.three-col-table {
  border: 1.5px solid var(--ink);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin: 18px 0 10px;
}
.tct-headers {
  display: contents;
}
.tct-head {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 10px 8px;
  border-bottom: 1.5px solid var(--ink);
  border-right: 1.5px solid var(--ink);
}
.tct-head:last-child { border-right: none; }
.tct-cell {
  padding: 12px;
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  min-height: 110px;
  display: flex; flex-direction: column;
}
.tct-cell:nth-child(3n) { border-right: none; } /* but headers count too . handled by display contents */
.tct-cell.bottom { border-bottom: none; }

/* For two-row tables (A, RI) with POSITIVE/NEGATIVE row labels */
.row-label {
  display: flex; align-items: center;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink);
  padding-right: 12px;
}
.three-col-with-rows {
  display: grid;
  grid-template-columns: 86px 1fr 1fr 1fr;
  margin: 18px 0 10px;
}
.three-col-with-rows .tct-head { padding: 10px 8px; }
.three-col-with-rows .tct-head-empty { border-bottom: 1.5px solid var(--ink); }
.three-col-with-rows .row-label {
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  padding: 12px;
  justify-content: flex-start;
}
.three-col-with-rows .tct-cell { border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); padding: 12px; min-height: 130px; }
.three-col-with-rows > :last-child { border-bottom: none; }
.three-col-with-rows > div:nth-last-child(-n+4) { border-bottom: none; }
.three-col-with-rows > div:nth-child(4n) { border-right: none; }
.three-col-with-rows .outer-wrap {
  /* If we render with outer border instead */
}
.three-col-with-rows-outer {
  border: 1.5px solid var(--ink);
}

@media (max-width: 760px) {
  .three-col-table { grid-template-columns: 1fr; }
  .three-col-table .tct-head { border-right: none; border-bottom: 1.5px solid var(--ink); }
  .three-col-table .tct-cell { border-right: none; }
  .three-col-table .tct-cell:last-child { border-bottom: none; }
  .three-col-with-rows { grid-template-columns: 1fr; }
  .three-col-with-rows > div { border-right: none !important; border-bottom: 1.5px solid var(--ink) !important; }
  .three-col-with-rows > div:last-child { border-bottom: none !important; }
  .three-col-with-rows .row-label { background: var(--teal-50); }
}

/* ---------- Inputs ---------- */
.input-area {
  width: 100%;
  background: transparent;
  border: none;
  padding: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  resize: vertical;
  flex: 1;
  min-height: 88px;
  outline: none;
}
.input-area::placeholder { color: #B0B0B0; font-style: italic; }
.input-area:focus { background: var(--teal-50); }

.input-line {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px dotted var(--ink);
  padding: 4px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  outline: none;
}
.input-line:focus { border-bottom-color: var(--teal); background: var(--teal-50); }
.input-line::placeholder { color: #B0B0B0; font-weight: 400; font-style: italic; }

/* ---------- Chips (live-parsed from textarea) ---------- */
.chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  min-height: 8px;
}
.chips:empty { border-top: none; padding-top: 0; }
.chip {
  display: inline-flex;
  align-items: center;
  background: var(--paper);
  border: 1.5px solid var(--line);
  color: var(--ink-soft);
  font-size: 13.5px;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
  font-weight: 500;
}
.chip:hover { border-color: var(--teal); background: var(--teal-50); color: var(--teal-darker); }
.chip.circled {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  font-weight: 700;
}
.chip.underlined {
  background: var(--paper);
  border-color: var(--teal);
  color: var(--teal-darker);
  text-decoration: underline;
  text-decoration-color: var(--teal);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  font-weight: 700;
}
.chip.heavy-underline {
  background: var(--amber);
  border-color: var(--amber);
  color: #fff;
  font-weight: 700;
}
.chip-empty {
  color: var(--muted);
  font-style: italic;
  font-size: 13px;
}

/* ---------- Relationship Image figure (matches PDF) ---------- */
.ri-figure {
  margin: 18px 0 28px;
}
.ri-fill-line {
  font-size: 15px;
  margin: 0 0 18px;
}
.ri-fill-line .ri-blank {
  display: inline-block;
  border: none;
  border-bottom: 1px dotted var(--ink);
  background: transparent;
  padding: 2px 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--teal-darker);
  min-width: 240px;
  outline: none;
}
.ri-fill-line .ri-blank:focus { border-bottom-color: var(--teal); background: var(--teal-50); }
.ri-fill-line strong { font-weight: 700; }

.ri-box-wrap {
  display: grid;
  grid-template-columns: 80px 1fr;
  border: 1.5px solid var(--ink);
}
.ri-row-label {
  display: flex; align-items: center; justify-content: flex-start;
  padding: 12px 14px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink);
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
}
.ri-row-label.last { border-bottom: none; }
.ri-box-cell {
  padding: 16px;
  min-height: 140px;
  border-bottom: 1.5px solid var(--ink);
}
.ri-box-cell.last { border-bottom: none; }

.ri-postlude {
  margin: 14px 0 6px;
  font-size: 14.5px;
}
.ri-postlude::before {
  content: '→ ';
  color: var(--teal);
  font-weight: 700;
}
.ri-postlude strong { font-weight: 700; }

/* ---------- Sentence blocks (G, H follow-ups) ---------- */
.sentence-block { margin: 18px 0; }
.sentence-prompt {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.sentence-block .input-area {
  border: 1.5px solid var(--ink);
  padding: 10px 12px;
  min-height: 70px;
}

/* ---------- Exercise H blocks ---------- */
.h-block {
  border: 1.5px solid var(--ink);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.h-prompt {
  font-size: 15.5px;
  color: var(--ink);
  margin: 0 0 8px;
}
.h-label {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12.5px;
  color: var(--teal-dark);
  margin-right: 8px;
}
.h-block .input-area { min-height: 60px; }
.divider { border: none; border-top: 1px solid var(--line); margin: 28px 0 22px; }

/* ---------- Summary list (matches "1. My .... was to seek out my caregivers ...") ---------- */
.summary-list {
  list-style: none; padding: 0; margin: 18px 0 0;
  counter-reset: sum;
}
.summary-list li {
  counter-increment: sum;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 6px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.summary-list li:last-child { border-bottom: none; }
.summary-list li::before {
  content: counter(sum) ".";
  font-weight: 700;
  color: var(--ink);
  font-size: 15.5px;
}
.summary-sentence {
  font-size: 15.5px;
  color: var(--ink);
}
.summary-sentence strong { font-weight: 700; }
.sum-blank {
  display: inline-block;
  border: none;
  border-bottom: 1px dotted var(--ink);
  background: transparent;
  padding: 1px 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--teal-darker);
  min-width: 140px;
  outline: none;
}
.sum-blank:focus { border-bottom-color: var(--teal); background: var(--teal-50); }
.sum-fill {
  display: block;
  background: var(--teal-50);
  border-left: 3px solid var(--teal);
  padding: 10px 14px;
  margin-top: 8px;
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.55;
  grid-column: 2;
  min-height: 22px;
}
.sum-fill:empty::before {
  content: "(no items marked yet . go back and tap your answers to mark them)";
  color: var(--muted);
  font-style: italic;
  font-size: 13.5px;
}
.sum-fill .sum-token {
  display: inline-block;
  margin: 2px 5px 2px 0;
  padding: 2px 9px;
  background: var(--paper);
  border: 1px solid var(--teal);
  color: var(--teal-darker);
  border-radius: 3px;
  font-size: 13.5px;
  font-weight: 600;
}

/* ---------- Reference (Development & Dialogues) ---------- */
.dev-stage, .dialogue-item {
  border-left: 3px solid var(--teal);
  padding: 4px 0 4px 18px;
  margin-bottom: 22px;
}
.dev-stage h3, .dialogue-item h3 {
  font-size: 16.5px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--ink);
}
.dev-stage .dev-age {
  font-style: italic;
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 12px;
}
.dev-stage p, .dialogue-item p { margin: 10px 0; color: var(--ink-soft); }
.dialogue-item h4 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 16px 0 6px;
  color: var(--ink);
}
.dialogue-steps {
  padding-left: 22px;
  margin: 10px 0;
}
.dialogue-steps li { margin-bottom: 12px; color: var(--ink-soft); }
.dialogue-prelude {
  font-style: italic;
  color: var(--muted);
  margin: 0 0 12px;
}
.dialogue-swap {
  text-align: left;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink);
  margin: 14px 0 4px;
  font-size: 13.5px;
}

/* ---------- Cover ---------- */
.cover-icons {
  display: flex; justify-content: center; align-items: center;
  gap: 18px;
  margin: 38px 0 42px;
}
.cover-icons svg { width: 44px; height: 44px; color: var(--teal); }
.cover-icons .divider-bar {
  width: 1.5px; height: 38px; background: var(--ink);
}
.cover-presented {
  text-align: center;
  font-size: 13px;
  color: var(--teal-dark);
  letter-spacing: 0.06em;
  margin: 24px 0 14px;
}
.cover-brand {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 15px;
}
.cover-brand svg, .cover-brand .cover-brand-logo { width: 56px; height: 56px; }
.cover-brand .cover-brand-logo { object-fit: contain; }

/* ---------- Email-collection card ---------- */
.email-card {
  border: 1.5px solid var(--ink);
  padding: 24px 26px;
  margin: 26px 0;
}
.email-card h3 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.email-card label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin: 14px 0 4px;
}
.email-card .input-email {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  font-size: 15px;
  outline: none;
}
.email-card .input-email:focus { border-color: var(--teal); background: var(--teal-50); }
.email-card .hint {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 0;
  font-style: italic;
}
.email-card .alert-important {
  margin-top: 18px;
  padding: 12px 14px;
  background: var(--alert-50);
  border: 1.5px solid var(--alert-red);
  border-left-width: 4px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--alert-red);
}
.email-card .alert-important strong { color: var(--alert-red); font-weight: 700; }
.email-card .alert-important em { font-style: italic; color: var(--alert-red); font-weight: 600; }

.email-card .quiet-note {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--teal-50);
  border-left: 3px solid var(--teal-200);
  font-size: 13.5px;
  color: var(--ink-soft);
  font-style: italic;
}

/* ---------- Footer ---------- */
.step-footer {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.step-footer .footer-name {
  color: var(--ink);
  font-weight: 700;
}
.step-footer a { color: var(--teal-dark); }

/* ---------- Concept input (Imago / unconscious agenda blanks) ---------- */
.concept-input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: baseline;
}
.concept-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--teal);
  background: var(--teal-50);
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  padding: 0;
}
.concept-info:hover { background: var(--teal); color: #fff; }
.concept-info:focus { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ---------- Help & Example disclosures ---------- */
.help-disclosure, .example-disclosure {
  margin: 18px 0;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  overflow: hidden;
}
.help-disclosure { border-color: var(--teal-200); }
.example-disclosure { border-color: var(--line); }
.help-disclosure[open], .example-disclosure[open] { box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.help-disclosure > summary, .example-disclosure > summary {
  cursor: pointer;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--teal-darker);
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  transition: background var(--dur) var(--ease);
}
.help-disclosure > summary { background: var(--teal-50); }
.example-disclosure > summary { background: var(--paper); color: var(--ink-soft); }
.help-disclosure > summary:hover { background: var(--teal-100); }
.example-disclosure > summary:hover { background: var(--teal-50); color: var(--teal-darker); }
.help-disclosure > summary::-webkit-details-marker,
.example-disclosure > summary::-webkit-details-marker { display: none; }
.help-disclosure > summary::after,
.example-disclosure > summary::after {
  content: '+';
  font-size: 20px;
  font-weight: 400;
  color: var(--teal);
  transition: transform var(--dur) var(--ease);
}
.help-disclosure[open] > summary::after,
.example-disclosure[open] > summary::after {
  content: '−';
}
.disclosure-body {
  padding: 16px 22px 18px;
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.6;
  border-top: 1px solid var(--line-soft);
}
.disclosure-body p { margin: 8px 0; }
.disclosure-body em { font-style: italic; }
.disclosure-body strong { color: var(--ink); }

.example-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 14px;
}
.example-table th, .example-table td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.example-table th {
  background: var(--teal-50);
  color: var(--ink);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}
.example-table td:first-child {
  background: #FAFAFA;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  white-space: nowrap;
}
.example-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 10px 0; }
@media (max-width: 720px) { .example-cols { grid-template-columns: 1fr; } }
.example-col h5 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-darker);
}
.example-col p { margin: 0; font-size: 14px; color: var(--ink-soft); }

/* ---------- Required-field validation ---------- */
.action-error {
  background: var(--alert-50);
  border-left: 3px solid var(--alert-red);
  padding: 10px 14px;
  border-radius: 0 4px 4px 0;
  color: var(--alert-red);
  font-size: 14px;
  margin: 14px 0;
}
.action-error ul { margin: 6px 0 0; padding-left: 20px; }
.action-error li { margin-bottom: 4px; }
.btn-primary[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- Concept modal (long-form prose) ---------- */
.modal-prose {
  padding: 18px 24px 22px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.modal-prose p { margin: 0 0 12px; }
.modal-prose p:last-child { margin-bottom: 0; }
.modal-prose em { font-style: italic; color: var(--teal-darker); font-weight: 500; }
.modal-prose strong { color: var(--ink); font-weight: 700; }

/* ---------- Modal (word picker) ---------- */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.4);
}
.modal-card {
  position: relative;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  width: min(640px, 100%);
  max-height: 82vh;
  display: flex; flex-direction: column;
  border-radius: 4px;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px;
  background: var(--teal);
  color: #fff;
}
.modal-head h3 {
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  margin: 0;
}
.modal-close {
  background: transparent; border: none; color: #fff;
  font-size: 28px; line-height: 1; padding: 0 4px;
}
.modal-search {
  margin: 14px 22px 0;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  font-size: 14.5px;
  outline: none;
}
.modal-search:focus { border-color: var(--teal); }
.modal-body { padding: 14px 22px; overflow-y: auto; flex: 1; }
.word-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.word-grid button {
  background: var(--paper);
  border: 1.5px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 3px;
  cursor: pointer;
}
.word-grid button:hover { background: var(--teal-50); border-color: var(--teal); color: var(--teal-darker); }
.word-grid button.added { background: var(--teal); border-color: var(--teal); color: #fff; }
.modal-foot {
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.modal-hint { margin: 0; font-size: 12.5px; color: var(--muted); font-style: italic; }

/* ---------- PDF render target ---------- */
.pdf-root { position: absolute; left: -10000px; top: 0; width: 800px; }
.pdf-doc {
  background: #fff;
  color: #1a1a1a;
  font-family: 'Open Sans', Arial, sans-serif;
  padding: 38px 48px;
  font-size: 13px;
  line-height: 1.55;
}
.pdf-doc .pdf-cover-title {
  font-size: 28px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.02em; color: #1FAFA0; margin: 0 0 4px; text-align: center;
}
.pdf-doc .pdf-cover-sub {
  text-align: center; font-size: 14px; margin: 0 0 18px; color: #1a1a1a;
}
.pdf-doc .pdf-meta { color: #6E6E6E; font-style: italic; font-size: 12px; text-align: center; margin: 0 0 22px; }
.pdf-doc .pdf-banner {
  background: #1FAFA0; color: #fff; padding: 9px 14px; border-radius: 4px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
  font-size: 14px; margin: 26px 0 12px;
}
.pdf-doc h3 {
  font-size: 13.5px; font-weight: 700;
  margin: 16px 0 6px;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: #1a1a1a; padding-left: 18px; position: relative;
}
.pdf-doc h3::before {
  content: ''; position: absolute; left: 0; top: 3px;
  width: 11px; height: 11px; background: #1a1a1a;
}
.pdf-doc .pdf-three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin: 8px 0; }
.pdf-doc .pdf-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: #1a1a1a; margin: 0 0 6px; font-weight: 700; text-align: center; padding: 6px; background: #ECF8F6; }
.pdf-doc .pdf-col .pdf-pair { font-size: 12px; margin: 4px 0; }
.pdf-doc .pdf-pair strong { color: #138F83; font-weight: 700; }
.pdf-doc ol { padding-left: 22px; }
.pdf-doc ol li { margin-bottom: 12px; }
.pdf-doc .pdf-sentence { display: block; font-size: 12.5px; margin-bottom: 4px; }
.pdf-doc .pdf-answer {
  display: block;
  background: #ECF8F6;
  border-left: 3px solid #1FAFA0;
  padding: 7px 10px;
  margin: 4px 0 0;
  font-size: 12px;
  color: #333;
}
.pdf-doc .pdf-answer:empty::before { content: "."; color: #B0B0B0; }
.pdf-doc .pdf-footer {
  margin-top: 26px; padding-top: 12px; border-top: 1px solid #ECECEC;
  font-size: 11px; color: #6E6E6E; text-align: center;
}

/* ---------- Print ---------- */
@media print {
  .topbar, .actions, .outline-drawer, .topbar-menu-btn, .modal { display: none !important; }
  body { background: #fff; }
  .step { display: block !important; padding: 8px 0; page-break-after: always; }
  .step.reference { page-break-after: avoid; }
  .container { max-width: 100%; }
}
