/* Private Finance — onboarding wizard chrome (v4: no emojis, fixed fullscreen, chip toggles, readability) */

:root {
  --paper:        #FBF9F4;
  --paper-2:      #FFFFFF;
  --paper-3:      #F4F1EA;
  --paper-warm:   #EFEBE1;
  --paper-deep:   #E8E4D8;

  --ink:          #16161A;
  --ink-2:        #2A2A2E;
  --ink-3:        #545459;     /* slightly darker for better legibility */
  --ink-4:        #82828A;     /* slightly darker */
  --ink-5:        #B0AFA8;

  --rule:         #E4E1D8;
  --rule-2:       #EFECE3;
  --rule-strong:  #D2CEC2;
  --hover:        rgba(22, 22, 26, 0.035);

  --accent:       #2C3742;
  --accent-ink:   #1B232C;
  --accent-tint:  rgba(44, 55, 66, 0.08);
  --accent-soft:  rgba(44, 55, 66, 0.04);

  --secure:       #4A7C59;
  --secure-soft:  rgba(74, 124, 89, 0.08);

  --gold:         #B8956A;
  --gold-tint:    rgba(184, 149, 106, 0.10);

  --pos:          #4A7C59;
  --neg:          #8B3A3A;
  --warn:         #B8956A;

  --shadow-card:  0 1px 2px rgba(0, 0, 0, 0.025), 0 0 0 1px var(--rule);
  --shadow-cta:   0 1px 3px rgba(44, 55, 66, 0.18);
  --shadow-deep:  0 4px 24px rgba(22, 22, 26, 0.06), 0 0 0 1px var(--rule);

  --radius:       3px;
  --max-text:     720px;       /* slightly wider for comfortable reading */
  --max-stage:    980px;

  --tap:          56px;
  --tap-sm:       44px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter Tight", system-ui, -apple-system, sans-serif;
  font-feature-settings: "ss01", "cv11", "tnum";
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

body.modal-open { overflow: hidden; }

::selection { background: var(--accent-tint); color: var(--ink); }

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-tint); }
a:hover { border-bottom-color: var(--accent); }

.mono  { font-family: "JetBrains Mono", ui-monospace, monospace; font-feature-settings: "tnum"; }
.serif { font-family: "Newsreader", "Source Serif Pro", Georgia, serif; font-feature-settings: "ss01"; }

/* ─── chrome ───────────────────────────────────────── */
.chrome {
  position: sticky; top: 0; z-index: 20;
  background: rgba(251, 249, 244, 0.96);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.chrome-inner {
  max-width: var(--max-stage);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.chrome .brand {
  display: inline-flex; align-items: baseline; gap: 12px;
  font-family: "Newsreader", serif;
  font-size: 18px; font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.chrome .brand::before {
  content: ""; width: 7px; height: 7px;
  background: var(--accent); border-radius: 50%;
  transform: translateY(-2px);
  display: inline-block;
}
.chrome .brand em {
  font-family: "JetBrains Mono", monospace;
  font-style: normal; font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-4);
}
.chrome .meta {
  display: inline-flex; gap: 14px; align-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em; text-transform: uppercase;
}

.sec-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--secure-soft);
  color: var(--secure);
  border: 1px solid rgba(74, 124, 89, 0.30);
  border-radius: 999px;
  padding: 6px 14px 6px 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer;
  transition: background 150ms, border-color 150ms, box-shadow 150ms;
  min-height: 32px;
  position: relative;
}
.sec-badge::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--secure);
  display: inline-block;
}
.sec-badge::after {
  content: "ⓘ";
  font-family: system-ui, sans-serif;
  font-size: 12px;
  margin-left: 2px;
  opacity: 0.65;
}
.sec-badge:hover {
  background: rgba(74, 124, 89, 0.16);
  border-color: var(--secure);
  box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.08);
}
.sec-badge:hover::after { opacity: 1; }
.sec-badge:focus-visible { outline: 2px solid var(--secure); outline-offset: 2px; }

.saved {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-3);
}
.saved::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--pos);
}
.saved.saving::before { background: var(--warn); }
.saved.error::before { background: var(--neg); }

/* ─── progress ─────────────────────────────────────── */
.progress {
  background: rgba(251, 249, 244, 0.96);
  border-bottom: 1px solid var(--rule);
}
.progress-inner {
  max-width: var(--max-stage);
  margin: 0 auto;
  padding: 14px 24px 18px;
  display: flex; align-items: center; gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.progress-inner::-webkit-scrollbar { display: none; }
.progress-step {
  flex: 1 1 0;
  min-width: 80px;
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer;
  border: 0; background: transparent; padding: 0;
  text-align: left;
  font-family: inherit;
  color: var(--ink-4);
  transition: color 200ms ease-out;
}
.progress-step:hover:not(:disabled) { color: var(--ink-3); }
.progress-step:disabled { cursor: default; }
.progress-step .bar {
  height: 4px; background: var(--rule); border-radius: 2px;
  transition: background 200ms ease-out;
}
.progress-step.done .bar,
.progress-step.current .bar { background: var(--accent); }
.progress-step.current { color: var(--ink); }
.progress-step .label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.progress-step .num { color: var(--ink-5); margin-right: 6px; }
.progress-step.done .num,
.progress-step.current .num { color: var(--accent); }

/* ─── stage container ──────────────────────────────── */
main.stage {
  max-width: var(--max-stage);
  margin: 0 auto;
  padding: 56px 24px 96px;
}

.stage-eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-4);
  margin-bottom: 24px;
  display: flex; align-items: center; gap: 12px;
}
.stage-eyebrow .rule { width: 28px; height: 1px; background: var(--rule-strong); }

.stage-headline {
  font-family: "Newsreader", serif;
  font-weight: 400;
  font-size: clamp(34px, 5.4vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.018em;
  margin: 0 0 24px;
  color: var(--ink);
  text-wrap: balance;
  max-width: var(--max-text);
}
.stage-headline em { font-style: italic; color: var(--ink-2); }

/* ─── Sable's voice ────────────────────────────────── */
.sable-voice,
.sable-voice-block {
  font-family: "Newsreader", serif;
  font-size: 19px;             /* up from 18, more comfortable */
  font-style: italic;
  line-height: 1.62;
  color: var(--ink-3);
  max-width: var(--max-text);
  margin: 0 0 36px;
  padding-left: 22px;
  border-left: 2px solid var(--accent-tint);
  text-wrap: pretty;
}
.sable-voice-block { padding-top: 4px; padding-bottom: 4px; }
.sable-voice-line { margin: 0 0 12px; }
.sable-voice-line:last-child { margin-bottom: 0; }
.sable-mark,
.sable-mark-block {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.sable-mark { margin-bottom: 4px; }

/* ─── Sable intro: what you get ────────────────────── */
.wyg {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: var(--max-text);
  margin-bottom: 16px;
}
.wyg-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  background: var(--paper-2);
  padding: 20px 24px;
  gap: 28px;
  align-items: baseline;
}
.wyg-k {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-4);
}
.wyg-v {
  font-size: 15.5px; color: var(--ink-2);
  line-height: 1.6; text-wrap: pretty;
}

/* ─── Profile confirm ──────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: var(--max-text);
  margin-bottom: 28px;
}
.profile-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  background: var(--paper-2);
  padding: 18px 24px;
  gap: 28px;
  align-items: baseline;
  transition: background 150ms;
}
.profile-card:hover { background: var(--paper-3); }
.profile-k {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-4);
}
.profile-v {
  font-size: 15.5px;
  color: var(--ink);
  line-height: 1.55;
}
.profile-v.editable {
  cursor: text;
  border-bottom: 1px dashed var(--rule-strong);
  padding: 2px 4px 4px;
  margin-left: -4px;
  border-radius: 2px;
  transition: border-color 150ms, background 150ms;
}
.profile-v.editable:hover { border-bottom-color: var(--ink-4); background: var(--paper); }
.profile-v.editable:focus { outline: none; border-bottom-color: var(--accent); background: var(--paper); }

/* ─── Security ─────────────────────────────────────── */
.security-principle {
  font-size: 22px;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink);
  max-width: var(--max-text);
  margin: 0 0 32px;
  padding: 26px 30px;
  background: var(--paper-2);
  border-left: 3px solid var(--secure);
  border-radius: var(--radius);
  text-wrap: pretty;
}

.pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: var(--max-text);
  margin-bottom: 32px;
}
.pillar {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px 26px;
}
.pillar-title {
  font-family: "Newsreader", serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 10px;
  line-height: 1.3;
}
.pillar-body {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.6;
  text-wrap: pretty;
}

.supporting-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: var(--max-text);
  margin-bottom: 32px;
}
.supporting-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  background: var(--paper-2);
  padding: 16px 24px;
  gap: 28px;
  align-items: baseline;
}
.supporting-k {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-4);
}
.supporting-v {
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.55;
}

.qa-inset {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  max-width: var(--max-text);
  margin-bottom: 32px;
  overflow: hidden;
}
.qa-inset summary {
  padding: 18px 24px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
  display: flex; align-items: center;
  min-height: 48px;
  transition: background 150ms;
}
.qa-inset summary:hover { background: var(--paper-3); }
.qa-inset summary::-webkit-details-marker { display: none; }
.qa-inset summary::after {
  content: "▾  Tap to read";
  color: var(--accent);
  margin-left: auto;
  letter-spacing: 0.06em;
}
.qa-inset[open] summary::after { content: "▴  Tap to close"; }
.qa-count { color: var(--ink-4); margin-left: 4px; }
.qa-body {
  border-top: 1px solid var(--rule);
  padding: 8px 24px 18px;
}
.qa {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule-2);
}
.qa:last-child { border-bottom: 0; }
.qa-q {
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 10px;
  line-height: 1.4;
}
.qa-a {
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.65;
  text-wrap: pretty;
}

/* Pillars layout — first one full width when there are 4 */
@media (min-width: 720px) {
  .pillars-3 { grid-template-columns: 1fr 1fr; }
  .pillars-3 .pillar:first-child { grid-column: 1 / -1; }
  .pillars-4 { grid-template-columns: 1fr 1fr; }
  .pillars-4 .pillar:first-child { grid-column: 1 / -1; }
}
.pillars-stack { grid-template-columns: 1fr !important; }

/* ─── Sub-sections (Accounts + From here) ──────────── */
.sub-section {
  margin-bottom: 44px;
  max-width: var(--max-text);
}
.sub-section:last-child { margin-bottom: 32px; }
.sub-section-title {
  font-family: "Newsreader", serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.sub-section-help {
  font-size: 14.5px;
  color: var(--ink-3);
  margin: 12px 0 22px;
  line-height: 1.55;
}
.acct-section { margin-bottom: 24px; }
.acct-section-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 10px;
}

/* per-section "Other" input */
.inline-other {
  margin-top: 10px;
  width: 100%;
  border: 1px dashed var(--rule-strong);
  background: transparent;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  -webkit-appearance: none;
  transition: border-color 150ms, background 150ms;
}
.inline-other:focus {
  outline: none;
  border-style: solid;
  border-color: var(--accent);
  background: var(--paper-2);
}
.inline-other::placeholder { color: var(--ink-4); font-style: italic; }

/* ─── Options (radio + checkbox) ───────────────────── */
.opts { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.opts-tight { gap: 8px; }
.opts-compact { gap: 6px; }
.opts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.opt {
  display: block;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
  min-height: var(--tap);
}
.opt-tight { padding: 12px 14px; min-height: var(--tap-sm); }
.opts-grid .opt { padding: 12px 14px; min-height: var(--tap-sm); }
.opt:hover { border-color: var(--rule-strong); background: var(--paper-3); }
.opt:active { background: var(--paper-warm); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.opt:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.opt-row { display: flex; align-items: flex-start; gap: 14px; }
.opt-marker {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border: 1.5px solid var(--ink-4);
  border-radius: 50%;
  margin-top: 1px;
  display: grid; place-items: center;
  transition: border-color 150ms;
}
.opt[data-kind="checkbox"] .opt-marker { border-radius: var(--radius); }
.opt:has(input:checked) .opt-marker { border-color: var(--accent); }
.opt:has(input:checked) .opt-marker::after {
  content: "";
  width: 9px; height: 9px;
  background: var(--accent);
  border-radius: 50%;
}
.opt[data-kind="checkbox"]:has(input:checked) .opt-marker::after { border-radius: 1px; }
.opt-text { flex: 1 1 auto; min-width: 0; }
.opt-label {
  font-size: 15.5px; font-weight: 500;
  color: var(--ink); line-height: 1.4;
}
.opt-sub {
  font-size: 14px; color: var(--ink-2);
  margin-top: 5px; line-height: 1.55;
  text-wrap: pretty;
}

/* ─── Account row (checkbox + count stepper inline) ── */
.acct-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
}
.acct-row .opt-acct { width: 100%; }
.count-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
  overflow: hidden;
  height: 100%;
  min-height: var(--tap-sm);
}
.cs-btn {
  border: 0; background: transparent;
  font-size: 18px; font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  width: 38px; height: 100%;
  display: grid; place-items: center;
  font-family: "JetBrains Mono", monospace;
}
.cs-btn:hover { background: var(--accent-tint); }
.cs-btn:disabled { color: var(--ink-5); cursor: not-allowed; background: transparent; }
.cs-num {
  min-width: 30px;
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: var(--ink);
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  padding: 0 8px;
  display: grid; place-items: center;
  height: 100%;
}

/* ─── Followup textarea ────────────────────────────── */
textarea.free {
  width: 100%;
  min-height: 96px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
  padding: 14px 16px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  resize: vertical;
  transition: border-color 150ms;
  -webkit-appearance: none;
}
textarea.free:focus { outline: none; border-color: var(--accent); }
textarea.free::placeholder { color: var(--ink-4); }
.q-followup { margin-top: 22px; max-width: var(--max-text); }
.q-followup-label {
  display: block;
  font-size: 14.5px; color: var(--ink-3);
  margin-bottom: 8px;
}

/* ─── Chip toggle group (focus areas) ──────────────── */
.chip-row {
  display: flex; flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.chip {
  border: 1px solid var(--rule);
  background: var(--paper-2);
  color: var(--ink-3);
  border-radius: 999px;
  padding: 10px 16px 10px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex; align-items: center;
  gap: 6px;
  transition: background 150ms, border-color 150ms, color 150ms;
  min-height: var(--tap-sm);
}
.chip:hover { border-color: var(--rule-strong); }
.chip-mark {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--paper-3);
  color: var(--ink-4);
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  line-height: 1;
}
.chip.active {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}
.chip.active .chip-mark {
  background: var(--paper);
  color: var(--accent);
}

/* ─── Design pick ──────────────────────────────────── */
.dp {}
.dp-toggle {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 4px;
  margin: 0 0 20px;
  gap: 4px;
}
.dp-toggle-btn {
  border: 0; background: transparent;
  font-family: inherit;
  padding: 14px 18px;
  border-radius: calc(var(--radius) - 1px);
  cursor: pointer;
  text-align: left;
  transition: background 150ms;
  min-height: var(--tap);
}
.dp-toggle-btn:hover { background: rgba(255, 255, 255, 0.5); }
.dp-toggle-btn.active {
  background: var(--paper-2);
  box-shadow: 0 0 0 1px var(--accent);
}
.dp-toggle-label { font-size: 16px; font-weight: 600; color: var(--ink-3); }
.dp-toggle-btn.active .dp-toggle-label { color: var(--ink); }
.dp-toggle-sub {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; color: var(--ink-4);
  letter-spacing: 0.04em;
  margin-top: 3px;
}
.dp-toggle-btn.active .dp-toggle-sub { color: var(--accent); }

.dp-thumbs {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
  margin-bottom: 20px;
}
.dp-thumb {
  border: 1.5px solid var(--rule);
  background: var(--paper-2);
  border-radius: var(--radius);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 150ms;
  font-family: inherit;
  display: flex; flex-direction: column;
  min-height: var(--tap);
}
.dp-thumb:hover { border-color: var(--rule-strong); }
.dp-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.dp-thumb-img {
  flex: 1 1 auto;
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: top center;
  background-color: var(--paper-3);
}
.dp-thumb-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 7px 7px;
  color: var(--ink-3);
  border-top: 1px solid var(--rule-2);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dp-thumb.active .dp-thumb-label { color: var(--ink); }
.dp-thumb-label .num { color: var(--ink-5); margin-right: 4px; }
.dp-thumb.active .dp-thumb-label .num { color: var(--accent); }

.dp-stage {
  position: relative;
  display: flex; align-items: center;
  gap: 12px; margin-bottom: 16px;
}
.dp-nav-prev, .dp-nav-next {
  flex: 0 0 auto;
  width: var(--tap); height: var(--tap);
  border: 1px solid var(--rule);
  background: var(--paper-2);
  color: var(--ink-3);
  font-size: 26px; line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: grid; place-items: center;
  transition: border-color 150ms, color 150ms, background 150ms;
}
.dp-nav-prev:hover:not(:disabled),
.dp-nav-next:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.dp-nav-prev:disabled, .dp-nav-next:disabled { opacity: 0.25; cursor: not-allowed; }

.dp-image-frame {
  flex: 1 1 auto;
  position: relative;
  border: 1px solid var(--rule);
  background: var(--paper-3);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  padding: 0;
  display: block;
  min-height: 280px;
}
.dp-image {
  display: block;
  width: 100%; height: auto;
  background: var(--paper-2);
}
.dp-zoom-hint {
  position: absolute;
  right: 12px; bottom: 12px;
  background: rgba(22, 22, 26, 0.85);
  color: var(--paper);
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 1;  /* always visible — tap affordance */
  display: inline-flex; align-items: center; gap: 6px;
}
.dp-zoom-hint::before {
  content: "⤢";
  font-family: system-ui, sans-serif;
  font-size: 12px;
}

/* Reaction strip — text labels, no emojis */
.dp-react {
  display: flex; flex-direction: column;
  gap: 12px;
  padding: 20px 22px 24px;
  margin: 16px 0 28px;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.dp-react-q {
  font-family: "Newsreader", serif;
  font-size: 16px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.005em;
  margin: 0;
}
.dp-react-controls {
  display: flex; flex-wrap: wrap;
  align-items: center; gap: 12px;
}
.dp-react-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-right: 4px;
}
.dp-react-group {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-2);
}
.dp-react-btn {
  border: 0;
  background: transparent;
  border-right: 1px solid var(--rule);
  padding: 12px 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink-3);
  transition: background 150ms, color 150ms;
  min-height: var(--tap-sm);
  font-weight: 500;
}
.dp-react-btn:last-child { border-right: 0; }
.dp-react-btn:hover { background: var(--paper-3); color: var(--ink); }
.dp-react-btn.active {
  background: var(--accent);
  color: var(--paper);
}
.dp-react-input {
  flex: 1 1 240px;
  min-width: 0;
  border: 0; border-bottom: 1px solid var(--rule-strong);
  background: transparent;
  font-family: inherit; font-size: 14px;
  color: var(--ink);
  padding: 10px 0;
  -webkit-appearance: none;
}
.dp-react-input:focus { outline: none; border-bottom-color: var(--accent); }
.dp-react-input::placeholder { color: var(--ink-4); }

/* ─── Question + decision block ────────────────────── */
.q {
  border-top: 1px solid var(--rule);
  padding: 36px 0;
  max-width: var(--max-text);
}
.q:first-of-type { border-top: 0; padding-top: 0; }
.q.decision {
  border-top: 1px solid var(--rule);
  margin-top: 24px;
  scroll-margin-top: 90px;
  border-radius: var(--radius);
  padding: 28px 0;
  transition: background 250ms ease-out, box-shadow 250ms ease-out;
}
.q.decision.flash {
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent);
  animation: decisionFlash 1.4s ease-out;
}
@keyframes decisionFlash {
  0%   { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
  60%  { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
  100% { background: transparent; box-shadow: 0 0 0 0 var(--accent); }
}
.q-label {
  font-family: "Newsreader", serif;
  font-size: 23px;
  line-height: 1.3;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 18px;
}

/* ─── Access code gate ─────────────────────────────── */
#app.fade-out, .fade-out { animation: fadeOut 450ms ease-out forwards; }
@keyframes fadeOut { to { opacity: 0; } }

.code-gate {
  position: fixed; inset: 0;
  background: var(--paper);
  display: grid; place-items: center;
  z-index: 200;
  animation: fadeIn 600ms ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.code-gate-inner {
  width: min(420px, 100%);
  padding: 40px 32px;
  text-align: center;
}
.code-brand-mark {
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 50%;
  margin: 0 auto 28px;
  box-shadow: 0 0 0 6px var(--accent-tint);
}
.code-title {
  font-family: "Newsreader", serif;
  font-weight: 400;
  font-size: 36px;
  letter-spacing: -0.018em;
  margin: 0 0 12px;
  color: var(--ink);
}
.code-sub {
  font-size: 15px;
  color: var(--ink-3);
  margin: 0 0 36px;
  line-height: 1.5;
}
.code-cells {
  display: flex; justify-content: center; gap: 12px;
  margin-bottom: 18px;
}
.code-cell {
  width: 56px; height: 64px;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper-2);
  font-family: "Newsreader", serif;
  font-size: 32px;
  color: var(--ink);
  display: grid; place-items: center;
  transition: border-color 200ms, background 200ms;
}
.code-cell.current { border-color: var(--accent); }
.code-cell.filled {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.code-cell.shake { animation: shake 0.4s; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}
.code-status {
  min-height: 22px;
  font-size: 13px; color: var(--neg);
  font-style: italic;
  opacity: 0;
  transition: opacity 200ms;
}
.code-status.show { opacity: 1; }

.code-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 24px;
}
.code-key {
  border: 1px solid var(--rule);
  background: var(--paper-2);
  font-family: "Newsreader", serif;
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
  padding: 18px 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 100ms, border-color 100ms, transform 100ms;
  min-height: 56px;
}
.code-key:hover { background: var(--paper-3); border-color: var(--rule-strong); }
.code-key:active { transform: scale(0.96); background: var(--accent-soft); }
.code-key-empty { visibility: hidden; }
.code-key-back { font-family: system-ui; font-size: 20px; color: var(--ink-3); }

.code-foot {
  margin-top: 32px;
  font-size: 10.5px;
  color: var(--ink-4);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ─── Intro reveal ─────────────────────────────────── */
.reveal-stage {
  position: fixed; inset: 0;
  background: var(--paper);
  display: grid; place-items: center;
  z-index: 200;
  cursor: pointer;
}
.reveal-inner {
  text-align: center;
  padding: 40px;
  width: min(720px, 100%);
}
.reveal-line {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1100ms ease-out, transform 1100ms ease-out;
}
.reveal-line.reveal-in {
  opacity: 1;
  transform: translateY(0);
}
.reveal-brand {
  font-family: "Newsreader", serif;
  font-weight: 400;
  font-size: clamp(48px, 8vw, 84px);
  letter-spacing: -0.022em;
  color: var(--ink);
  line-height: 1.05;
  margin-bottom: 14px;
}
.reveal-subtitle {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 64px;
}
.reveal-sable {
  font-family: "Newsreader", serif;
  font-style: italic;
  font-size: clamp(28px, 4.5vw, 44px);
  color: var(--ink-2);
  margin-bottom: 44px;
  letter-spacing: -0.012em;
}
.reveal-cta {
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 16px 36px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 200ms, color 200ms;
}
.reveal-cta:hover {
  background: var(--accent);
  color: var(--paper);
}

/* ─── Countdown lock ──────────────────────────────── */
.cd-stage {
  position: fixed; inset: 0;
  background: var(--paper);
  display: grid; place-items: center;
  z-index: 100;
  padding: 40px 24px;
  animation: fadeIn 700ms ease-out;
}
.cd-inner {
  width: min(720px, 100%);
  text-align: center;
}
.cd-mark {
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 50%;
  margin: 0 auto 24px;
  box-shadow: 0 0 0 6px var(--accent-tint);
  animation: cdMarkPulse 3s ease-in-out infinite;
}
@keyframes cdMarkPulse {
  0%, 100% { box-shadow: 0 0 0 6px var(--accent-tint); }
  50% { box-shadow: 0 0 0 12px rgba(44,55,66,0.04); }
}
.cd-eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 22px;
}
.cd-headline {
  font-family: "Newsreader", serif;
  font-weight: 400;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.06;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin: 0 0 16px;
  text-wrap: balance;
}
.cd-sable {
  font-family: "Newsreader", serif;
  font-style: italic;
  font-size: 17px;
  color: var(--ink-3);
  max-width: 540px;
  margin: 0 auto 56px;
  line-height: 1.55;
}
.cd-sable-mark {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.cd-clock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
}
.cd-segment {
  display: flex; flex-direction: column;
  align-items: center;
  min-width: 96px;
}
.cd-num {
  font-family: "Newsreader", serif;
  font-weight: 400;
  font-size: clamp(56px, 10vw, 96px);
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.cd-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-top: 8px;
}
.cd-sep {
  font-family: "Newsreader", serif;
  font-size: clamp(48px, 8vw, 80px);
  color: var(--ink-5);
  font-weight: 300;
  margin-top: -12px;
}
.cd-clock.arrived .cd-num { color: var(--secure); }
.cd-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.06em;
  margin-bottom: 24px;
}
.cd-footer {
  font-size: 14px;
  color: var(--ink-3);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.55;
  font-style: italic;
}

@media (max-width: 600px) {
  .cd-clock { gap: 8px; }
  .cd-segment { min-width: 64px; }
  .cd-num { font-size: 48px; }
  .cd-sep { font-size: 36px; margin-top: -8px; }
}

/* ─── Security badge attention treatment ───────────── */
.sec-badge.pulse {
  animation: secBadgePulse 1.4s ease-in-out 3;
  box-shadow: 0 0 0 4px rgba(74, 124, 89, 0.18);
}
@keyframes secBadgePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 4px rgba(74, 124, 89, 0.18); }
  50%      { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(74, 124, 89, 0.10); }
}
.sec-badge-i {
  font-family: system-ui, sans-serif;
  font-size: 12px;
  margin-left: 2px;
  opacity: 0.8;
}
.sec-badge-dot {
  display: none;  /* dot replaced by ⓘ icon via :before in main rule */
}

/* ─── Try Sable reset ──────────────────────────────── */
.try-sable-q-head-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.try-sable-reset {
  border: 1px solid var(--rule);
  background: var(--paper-2);
  color: var(--ink-3);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.try-sable-reset:hover { background: var(--paper-3); color: var(--ink); }

/* ─── Design react screen tag ──────────────────────── */
.dp-react-screen-tag {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-4);
  text-transform: lowercase;
  font-style: normal;
  font-family: "JetBrains Mono", monospace;
  margin-left: 6px;
}
.dp-react-help {
  font-size: 13px;
  color: var(--ink-3);
  margin: 0;
  line-height: 1.5;
  font-style: italic;
}

/* ─── Try Sable (live AI demo) ─────────────────────── */
.try-sable-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  margin-bottom: 24px;
  max-width: var(--max-stage);
}
.try-sable-q-head {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 12px;
}
.try-sable-questions {
  display: flex; flex-direction: column;
  gap: 10px;
}
.try-sable-q {
  border: 1px solid var(--rule);
  background: var(--paper-2);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-align: left;
  cursor: pointer;
  font-family: "Newsreader", serif;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  display: flex; align-items: flex-start;
  gap: 12px;
  transition: border-color 150ms, background 150ms, transform 100ms;
  font-weight: 500;
  min-height: var(--tap);
}
.try-sable-q:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.try-sable-q:active { transform: scale(0.99); }
.try-sable-q.asked {
  border-color: var(--secure);
  background: var(--secure-soft);
}
.try-sable-q.asking {
  border-color: var(--accent);
  background: var(--accent-tint);
  animation: pulseQ 1s ease-in-out infinite;
}
@keyframes pulseQ {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.try-sable-q-mark {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--paper-3);
  color: var(--accent);
  display: grid; place-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 500;
}
.try-sable-q.asked .try-sable-q-mark {
  background: var(--secure);
  color: var(--paper);
}
.try-sable-q-label { flex: 1 1 auto; }

.try-sable-response {
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  min-height: 280px;
  padding: 28px 32px;
  position: relative;
}
.try-sable-empty {
  font-family: "Newsreader", serif;
  font-size: 16px;
  font-style: italic;
  color: var(--ink-4);
  white-space: pre-line;
  text-align: center;
  margin-top: 80px;
  line-height: 1.6;
}

.try-sable-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow-card);
}
.try-sable-card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.try-sable-card-mark {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.try-sable-card-q {
  font-size: 14px;
  font-style: italic;
  color: var(--ink-3);
  text-align: right;
  flex: 1;
}
.try-sable-card-body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  font-feature-settings: "ss01";
}
.try-sable-card-body p {
  margin: 0 0 14px;
  text-wrap: pretty;
}
.try-sable-card-body p:last-child { margin-bottom: 0; }
.try-sable-card-body strong {
  color: var(--accent-ink);
  font-weight: 500;
}
.try-sable-cursor {
  display: inline-block;
  width: 8px; height: 18px;
  background: var(--accent);
  vertical-align: middle;
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}
@keyframes blink {
  50% { opacity: 0; }
}

.try-sable-footnote {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
  line-height: 1.6;
  max-width: var(--max-text);
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
  margin-top: 20px;
}

@media (max-width: 820px) {
  .try-sable-grid { grid-template-columns: 1fr; }
  .try-sable-response { min-height: 200px; padding: 22px 22px; }
}

/* ─── Lukman's personal note ───────────────────────── */
.lukman-note {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 0 0 28px;
  max-width: var(--max-text);
}
.lukman-note-from {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.lukman-note-body {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ─── Preview skeleton (loading state) ─────────────── */
.preview-frame .preview-skeleton {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  background: var(--paper-3);
  z-index: 1;
  transition: opacity 250ms ease-out;
}
.preview-frame.preview-loaded .preview-skeleton {
  opacity: 0;
  pointer-events: none;
}
.preview-skeleton-pulse {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 1; }
}
.preview-frame { position: relative; }

/* ─── Sable capability surface (from-here) ─────────── */
.sable-cap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 8px;
}
.sable-cap-group {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 22px;
}
.sable-cap-group-title {
  font-family: "Newsreader", serif;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 12px;
  letter-spacing: -0.005em;
}
.sable-cap-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.sable-cap-item {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}
.sable-cap-item::before {
  content: "→";
  position: absolute;
  left: 0; top: 0;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  opacity: 0.7;
}

/* ─── Account → provider mapping ───────────────────── */
.acct-mapping {
  margin-top: 10px;
  padding: 12px 16px 10px 38px;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  display: flex; flex-wrap: wrap;
  align-items: center; gap: 8px;
}
.acct-mapping-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-right: 4px;
}
.mapping-chip {
  border: 1px solid var(--rule-strong);
  background: var(--paper-2);
  color: var(--ink-3);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  transition: border-color 150ms, background 150ms, color 150ms;
}
.mapping-chip:hover { border-color: var(--ink-4); }
.mapping-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

/* ─── Focus more explorer ──────────────────────────── */
.focus-more {
  margin-top: 18px;
  border-top: 1px dashed var(--rule);
  padding-top: 18px;
}
.focus-more-toggle {
  border: 1px solid var(--accent-tint);
  background: var(--paper-2);
  color: var(--accent);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  transition: background 150ms, border-color 150ms;
  min-height: var(--tap-sm);
}
.focus-more-toggle:hover {
  background: var(--accent-tint);
  border-color: var(--accent);
}
.focus-more-arrow {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}
.focus-more-toggle:hover { color: var(--accent-ink); }
.focus-more-body {
  margin-top: 14px;
}
.focus-more-help {
  font-size: 13.5px; color: var(--ink-3);
  margin: 0 0 12px;
  font-style: italic;
  line-height: 1.55;
}

/* ─── Preview frame ────────────────────────────────── */
.preview-frame {
  position: relative;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-3);
  margin-bottom: 24px;
  box-shadow: var(--shadow-deep);
  max-width: var(--max-stage);
}
.preview-iframe {
  display: block;
  width: 100%;
  height: 720px;
  border: 0;
  background: var(--paper);
}
.preview-fullscreen-btn {
  position: absolute;
  right: 16px; top: 16px;
  background: rgba(22, 22, 26, 0.85);
  color: var(--paper);
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 150ms;
  z-index: 2;
}
.preview-fullscreen-btn:hover { background: var(--ink); }
.fs-overlay-preview { padding: 0; }
.fs-preview-iframe {
  width: 100%; height: 100%;
  border: 0;
  background: var(--paper);
}

/* ─── Memo block (voice sample) ────────────────────── */
.memo-block {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-bottom: 24px;
  box-shadow: var(--shadow-deep);
  overflow: hidden;
  max-width: var(--max-stage);
}
.memo-header {
  padding: 16px 30px;
  background: var(--paper-3);
  border-bottom: 1px solid var(--rule);
}
.memo-eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.memo-body {
  padding: 36px 40px;
  font-size: 17.5px;
  line-height: 1.75;
  color: var(--ink);
  font-feature-settings: "ss01";
  letter-spacing: -0.005em;
  cursor: text;
  outline: none;
}
.memo-body.editable:focus { background: rgba(184, 149, 106, 0.03); }
.memo-para { margin: 0 0 18px; text-wrap: pretty; }
.memo-para:first-child { font-style: italic; color: var(--ink); }
.memo-foot {
  padding: 14px 30px;
  background: var(--paper-3);
  border-top: 1px solid var(--rule);
  font-size: 13.5px;
  color: var(--ink-3);
}
.memo-foot-label { font-family: "Inter Tight", sans-serif; }

/* ─── Outro ────────────────────────────────────────── */
.outro-summary {
  margin-top: 24px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
  overflow: hidden;
  max-width: var(--max-stage);
}
.outro-summary-head {
  padding: 16px 24px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--rule);
}
.outro-summary-body { padding: 20px 24px; }
.outro-summary-body dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(160px, max-content) 1fr;
  gap: 14px 28px;
}
.outro-summary-body dt {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
  align-self: start;
}
.outro-summary-body dd {
  margin: 0; color: var(--ink-2);
  font-size: 14.5px; line-height: 1.6;
  word-break: break-word;
}
.outro-summary-body dd em { font-style: italic; color: var(--ink-3); }

.sec-recap {
  padding: 22px 26px;
  background: var(--secure-soft);
  border-left: 3px solid var(--secure);
  border-radius: var(--radius);
  margin: 28px 0;
  max-width: var(--max-stage);
}
.sec-recap-text {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.65;
  text-wrap: pretty;
}

/* ─── Nav ──────────────────────────────────────────── */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  gap: 16px;
}
.nav .left, .nav .right { display: flex; align-items: center; gap: 16px; }
.nav-hint {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.btn {
  font-family: inherit; font-size: 15px; font-weight: 500;
  padding: 14px 28px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 150ms, border-color 150ms, color 150ms;
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid transparent;
  min-height: var(--tap);
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--paper); box-shadow: var(--shadow-cta); }
.btn-primary:hover:not(:disabled) { background: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink-3); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { color: var(--ink); background: var(--hover); }
.btn-ghost.back::before { content: "←"; opacity: 0.6; }
.btn-primary.next::after { content: "→"; opacity: 0.85; }
.nav-nudge {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: background 150ms;
}
.nav-nudge:hover { background: var(--accent-tint); }

/* ─── Modal ────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(22, 22, 26, 0.55);
  display: grid; place-items: center;
  padding: 24px;
  z-index: 100;
  animation: fade 200ms ease-out;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--paper);
  border-radius: var(--radius);
  max-width: 680px;
  width: 100%;
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.modal-close {
  border: 0; background: transparent;
  font-size: 28px; line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
  width: 44px; height: 44px;
  border-radius: 50%;
  transition: background 150ms;
}
.modal-close:hover { background: var(--hover); color: var(--ink); }
.modal-body {
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ─── Fullscreen image overlay (FIXED with flex + min-height:0) ─── */
.fs-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 8, 10, 0.94);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  z-index: 200;
  padding: 24px;
  gap: 16px;
  animation: fade 200ms ease-out;
}
.fs-image-wrap {
  flex: 1 1 0;
  min-height: 0;     /* critical — lets flex item shrink and image fit */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.fs-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  display: block;
  margin: auto;
}
.fs-caption {
  flex: 0 0 auto;
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 230, 225, 0.7);
  padding-top: 4px;
}
.fs-close, .fs-nav-prev, .fs-nav-next {
  position: absolute;
  border: 1px solid rgba(232, 230, 225, 0.18);
  background: rgba(8, 8, 10, 0.85);
  color: rgba(232, 230, 225, 0.9);
  width: 56px; height: 56px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 28px; line-height: 1;
  display: grid; place-items: center;
  transition: background 150ms, color 150ms;
  z-index: 2;
}
.fs-close { top: 24px; right: 24px; font-size: 22px; }
.fs-nav-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.fs-nav-next { right: 24px; top: 50%; transform: translateY(-50%); }
.fs-close:hover, .fs-nav-prev:hover:not(:disabled), .fs-nav-next:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  color: var(--paper);
  border-color: rgba(232, 230, 225, 0.5);
}
.fs-nav-prev:disabled, .fs-nav-next:disabled { opacity: 0.25; cursor: not-allowed; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.stage-panel { display: none; }
.stage-panel.active {
  display: block;
  animation: stage-in 280ms ease-out;
}
@keyframes stage-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive ───────────────────────────────────── */
@media (max-width: 1024px) {
  main.stage { padding: 48px 24px 96px; }
  .stage-headline { font-size: clamp(30px, 5.4vw, 44px); }
}

@media (max-width: 820px) {
  .dp-thumbs { grid-template-columns: repeat(6, 1fr); gap: 6px; }
  .dp-thumb-label { padding: 6px; font-size: 9.5px; }
  .stage-headline { font-size: clamp(28px, 6vw, 38px); }
  .sable-voice, .sable-voice-block { font-size: 17.5px; padding-left: 18px; }
  .memo-body { padding: 28px 28px; font-size: 16.5px; }
  .wyg-row, .profile-card, .supporting-item { grid-template-columns: 140px 1fr; gap: 18px; }
  .opts-grid { grid-template-columns: repeat(2, 1fr); }
  .pillars-3, .pillars-4 { grid-template-columns: 1fr !important; }
  .pillars-3 .pillar:first-child, .pillars-4 .pillar:first-child { grid-column: auto; }
  .sable-cap-grid { grid-template-columns: 1fr; }
  .preview-iframe { height: 600px; }
}

@media (max-width: 640px) {
  .chrome-inner { padding: 12px 16px; }
  .chrome .meta { font-size: 9.5px; gap: 8px; }
  .progress-inner { padding: 10px 16px 14px; gap: 4px; }
  .progress-step { min-width: 60px; }
  .progress-step .label { font-size: 9.5px; letter-spacing: 0.05em; }
  .progress-step .num { display: none; }

  main.stage { padding: 36px 16px 72px; }
  .stage-headline { font-size: clamp(26px, 8vw, 34px); }
  .sable-voice, .sable-voice-block { font-size: 16.5px; }

  .dp-toggle { grid-template-columns: 1fr; }
  .dp-thumbs { grid-template-columns: repeat(3, 1fr); }
  .dp-stage { gap: 6px; }
  .dp-nav-prev, .dp-nav-next { width: 44px; height: 44px; font-size: 22px; }
  .dp-react-group { width: 100%; }
  .dp-react-btn { flex: 1 1 0; padding: 12px 8px; font-size: 13.5px; }

  .wyg-row, .profile-card, .supporting-item { grid-template-columns: 1fr; gap: 4px; padding: 14px 18px; }
  .wyg-k, .profile-k, .supporting-k { padding-bottom: 4px; }

  .nav { flex-wrap: wrap; }
  .nav .right { flex: 1; justify-content: flex-end; }
  .memo-body { padding: 22px 18px; font-size: 15.5px; }

  .fs-overlay { padding: 16px; }
  .fs-close { top: 16px; right: 16px; }
  .fs-nav-prev { left: 8px; }
  .fs-nav-next { right: 8px; }
  .fs-nav-prev, .fs-nav-next { width: 44px; height: 44px; font-size: 22px; }
}

@media (max-width: 480px) {
  .progress-step .label { display: none; }
  .progress-step { min-width: 24px; }
}
