/* =============================================================================
   FAMILYLAWPATH — COMPONENT LAYER
   Dual mode. Linen light for everything a client touches. Dark for the operator.
   Every value below is a token from tokens.css. There is no raw hex in this file,
   which is what makes one stylesheet serve both modes.

   Shape language is deliberately not RetainerFund and not Remandly:
   generous radii, wide measure, a path spine instead of a ledger register,
   and nothing that reads as urgent. This user is not awake at 2 a.m.
   ============================================================================= */

*, *::before, *::after { box-sizing: border-box; }

/* [hidden] must beat every display rule in this file. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur-slow) var(--ease), color var(--dur-slow) var(--ease);
}

img, svg { display: block; max-width: 100%; }

::selection { background: var(--accent-soft, var(--surface-3)); }

/* -----------------------------------------------------------------------------
   1. LAYOUT
   ----------------------------------------------------------------------------- */

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--space-6); }
.wrap-narrow { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 var(--space-6); }

.band { padding: var(--space-9) 0; }
.band-tight { padding: var(--space-8) 0; }
.band-soft { background: var(--surface-1); }
.band-rule { border-top: 1px solid var(--hairline-soft); }

/* -----------------------------------------------------------------------------
   2. NAV
   ----------------------------------------------------------------------------- */

.nav {
  position: sticky; top: 0; z-index: var(--z-sticky);
  border-bottom: 1px solid var(--hairline-soft);
  /* Light mode puts dark text on a near-white canvas, so anything scrolling
     under a 86% header stayed legible through it. 96% keeps the blur reading
     as glass without letting the page ghost through the logo and controls. */
  background: color-mix(in oklab, var(--canvas) 96%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-5); padding: var(--space-4) var(--space-6);
}
.nav-links { display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; }
.nav-link {
  font-size: var(--fs-14); font-weight: 500; color: var(--text-muted);
  text-decoration: none; transition: color var(--dur-fast) var(--ease);
}
.nav-link:hover { color: var(--text-primary); }
.nav-link[aria-current="page"] { color: var(--text-primary); }

.logo {
  display: inline-flex; align-items: center; gap: var(--space-3);
  text-decoration: none; color: var(--text-primary); flex: none;
}
.logo-word {
  font-family: var(--font-display); font-size: var(--fs-18); font-weight: 600;
  letter-spacing: -0.012em; color: var(--text-primary); white-space: nowrap;
}

/* -----------------------------------------------------------------------------
   3. TYPE
   ----------------------------------------------------------------------------- */

.display {
  font-family: var(--font-display); font-weight: 600; font-size: var(--fs-64);
  line-height: var(--lh-tight); letter-spacing: -0.022em; color: var(--text-primary);
  margin: 0; text-wrap: balance;
}
.h1 { font-size: var(--fs-48); line-height: var(--lh-tight); letter-spacing: -0.018em; font-weight: 600; color: var(--text-primary); margin: 0; }
.h2 { font-size: var(--fs-32); line-height: var(--lh-heading); letter-spacing: -0.012em; font-weight: 600; color: var(--text-primary); margin: 0; }
.h3 { font-size: var(--fs-24); line-height: var(--lh-heading); letter-spacing: -0.008em; font-weight: 600; color: var(--text-primary); margin: 0; }
.h4 { font-size: var(--fs-18); line-height: var(--lh-heading); font-weight: 600; color: var(--text-primary); margin: 0; }
.lede { font-size: var(--fs-18); line-height: var(--lh-relaxed); color: var(--text-body); margin: 0; }
.body { font-size: var(--fs-16); line-height: var(--lh-relaxed); color: var(--text-body); margin: 0; }
.cap { font-size: var(--fs-14); line-height: var(--lh-relaxed); color: var(--text-muted); margin: 0; }
.faint { color: var(--text-faint); }
.tnum { font-variant-numeric: var(--num-tabular); }

/* -----------------------------------------------------------------------------
   4. BUTTONS
   ----------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: inherit; font-size: var(--fs-16); font-weight: 500; line-height: 1;
  padding: 13px var(--space-5); border-radius: var(--radius-full);
  border: 1px solid var(--hairline); background: var(--surface-1); color: var(--text-primary);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-fg); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:active { background: var(--accent-active); border-color: var(--accent-active); }

.btn-ghost { background: transparent; border-color: var(--border-input); color: var(--text-primary); }
.btn-ghost:hover { border-color: var(--text-muted); background: var(--surface-2); }

.btn-quiet {
  background: transparent; border-color: transparent; color: var(--text-muted);
  font-size: var(--fs-14); padding: 8px var(--space-3);
}
.btn-quiet:hover { color: var(--text-primary); background: var(--surface-2); }

.btn-sm { font-size: var(--fs-14); padding: 9px var(--space-4); }
.btn-wide { width: 100%; }

.btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

/* Quiet exit affordance. Present on every client surface, never shouted. */
.btn-exit {
  border-color: var(--border-input); background: var(--surface-1); color: var(--text-body);
  font-size: var(--fs-14); padding: 9px var(--space-4);
}
.btn-exit:hover { border-color: var(--state-danger); color: var(--text-primary); }

/* -----------------------------------------------------------------------------
   5. SURFACES
   ----------------------------------------------------------------------------- */

.card {
  background: var(--surface-1); border: 1px solid var(--hairline);
  border-radius: var(--radius-lg); overflow: hidden;
}
.card-2 { background: var(--surface-2); }
.pad { padding: var(--space-6); }
.pad-lg { padding: var(--space-7); }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); margin-bottom: var(--space-5);
}

.eyebrow-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }

/* -----------------------------------------------------------------------------
   6. THE PATH SPINE — this product's signature component
   A stage completes and light travels 500ms along the line to the next node.
   Stages are typical, never promised, and no dates are attached to them.
   ----------------------------------------------------------------------------- */

.path { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }

.path-node {
  display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: var(--space-5);
  position: relative; padding-bottom: var(--space-6);
}
.path-node:last-child { padding-bottom: 0; }

/* the connecting line */
.path-node::before {
  content: ''; position: absolute; left: 14px; top: 26px; bottom: 0; width: 2px;
  background: var(--hairline); border-radius: 2px;
}
.path-node:last-child::before { display: none; }

/* the travelling light */
.path-node::after {
  content: ''; position: absolute; left: 14px; top: 26px; width: 2px; height: 0;
  background: var(--accent); border-radius: 2px;
  transition: height var(--dur-hero) var(--ease);
}
.path-node.lit::after { height: calc(100% - 26px); }
.path-node:last-child::after { display: none; }

.node-dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; position: relative; z-index: 1;
  border: 2px solid var(--hairline); background: var(--canvas);
  transition: border-color var(--dur-med) var(--ease), background-color var(--dur-med) var(--ease);
}
.node-dot i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--hairline);
  transition: background-color var(--dur-med) var(--ease), transform var(--dur-med) var(--ease-spring);
}
.path-node.done .node-dot { border-color: var(--accent); }
.path-node.done .node-dot i { background: var(--accent); transform: scale(1.15); }
.path-node.now .node-dot { border-color: var(--accent); }
.path-node.now .node-dot i { background: var(--accent); }

.node-body { min-width: 0; padding-top: 3px; }
.node-body h4 { margin: 0 0 var(--space-2); font-size: var(--fs-18); font-weight: 600; color: var(--text-primary); }
.node-body p { margin: 0; font-size: var(--fs-14); line-height: var(--lh-relaxed); color: var(--text-muted); }
.path-node:not(.done):not(.now) .node-body h4 { color: var(--text-muted); }

.node-tag {
  display: inline-block; margin-top: var(--space-3);
  font-family: var(--font-mono); font-size: var(--fs-11); text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow); color: var(--text-faint);
}
.path-node.now .node-tag { color: var(--accent-text); }

/* -----------------------------------------------------------------------------
   7. PILLS + CHIPS
   ----------------------------------------------------------------------------- */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: var(--radius-full);
  border: 1px solid var(--hairline); background: var(--surface-2);
  font-family: var(--font-mono); font-size: var(--fs-11); text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow); color: var(--text-muted); white-space: nowrap;
}
.pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.pill-live { color: var(--accent-text); border-color: var(--accent); }
.pill-warn { color: var(--state-warn); border-color: var(--state-warn); }
.pill-danger { color: var(--state-danger); border-color: var(--state-danger); }
.pill-calm { color: var(--text-body); }

/* choice chips — the client answers by tapping, never by typing where possible */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.chip {
  font-family: inherit; font-size: var(--fs-16); cursor: pointer;
  padding: 12px var(--space-5); border-radius: var(--radius-full);
  border: 1px solid var(--border-input); background: var(--surface-1); color: var(--text-primary);
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.chip:hover { border-color: var(--accent); background: var(--surface-2); }
.chip:active { transform: scale(0.98); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-fill); color: var(--accent-fg); font-weight: 600; }

/* -----------------------------------------------------------------------------
   8. NOTICES
   ----------------------------------------------------------------------------- */

.notice {
  display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: var(--space-3);
  align-items: start; padding: var(--space-5);
  background: var(--surface-1); border: 1px solid var(--hairline);
  border-radius: var(--radius-md); border-left: 2px solid var(--accent);
}
.notice svg { margin-top: 2px; color: var(--accent-text); }
.notice p { margin: 0; font-size: var(--fs-14); line-height: var(--lh-relaxed); color: var(--text-body); }
.notice b { color: var(--text-primary); font-weight: 600; }
.notice-neutral { border-left-color: var(--state-info); }
.notice-neutral svg { color: var(--state-info); }
.notice-warn { border-left-color: var(--state-warn); }
.notice-warn svg { color: var(--state-warn); }

/* -----------------------------------------------------------------------------
   9. SAFETY SURFACE
   The one flow in this product where removing all delight is the design.
   No accent green, no motion beyond a plain fade, no sound, no celebration.
   ----------------------------------------------------------------------------- */

.safety {
  border: 1px solid var(--state-danger); border-left-width: 2px;
  border-radius: var(--radius-md); background: var(--surface-1);
  padding: var(--space-6); animation: fadeOnly var(--dur-med) var(--ease) both;
}
@keyframes fadeOnly { from { opacity: 0; } to { opacity: 1; } }

.safety h3 { margin: 0 0 var(--space-3); font-size: var(--fs-24); font-weight: 600; color: var(--text-primary); letter-spacing: -0.008em; }
.safety > p { margin: 0 0 var(--space-5); font-size: var(--fs-16); line-height: var(--lh-relaxed); color: var(--text-body); }

.safety-list { display: grid; gap: var(--space-3); margin: 0 0 var(--space-5); padding: 0; list-style: none; }
.safety-list li {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: var(--space-4);
  align-items: center; padding: var(--space-4) var(--space-5);
  background: var(--surface-2); border: 1px solid var(--hairline); border-radius: var(--radius-sm);
}
.safety-list b { display: block; font-size: var(--fs-16); font-weight: 600; color: var(--text-primary); }
.safety-list span { display: block; font-size: var(--fs-14); color: var(--text-muted); margin-top: 2px; }
.safety-list .tel {
  font-family: var(--font-mono); font-size: var(--fs-16); color: var(--text-primary);
  font-variant-numeric: var(--num-tabular); white-space: nowrap; text-decoration: none;
}

.safety-foot { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }

/* -----------------------------------------------------------------------------
   10. HEARD — the reflective acknowledgment, typed in progressively
   Verbatim-faithful. Two lines. No advice, no interpretation, no reassurance.
   ----------------------------------------------------------------------------- */

.heard {
  padding: var(--space-6); border-radius: var(--radius-md);
  background: var(--surface-2); border: 1px solid var(--hairline-soft);
}
.heard .eyebrow { display: block; margin-bottom: var(--space-4); }
.heard p {
  margin: 0; font-family: var(--font-display); font-size: var(--fs-24);
  line-height: var(--lh-heading); color: var(--text-primary); letter-spacing: -0.006em;
  min-height: 2.6em;
}
.heard .caret {
  display: inline-block; width: 2px; height: 1em; vertical-align: -0.12em;
  background: var(--accent); margin-left: 2px;
}

/* -----------------------------------------------------------------------------
   11. GHOST FEATURES — everything is pressable, nothing is dead
   ----------------------------------------------------------------------------- */

.ghost-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.ghost {
  font-family: inherit; font-size: var(--fs-14); cursor: pointer;
  padding: 9px var(--space-4); border-radius: var(--radius-full);
  border: 1px dashed var(--border-input); background: transparent; color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.ghost:hover { color: var(--text-primary); border-color: var(--accent); border-style: solid; }

/* -----------------------------------------------------------------------------
   12. MODAL
   ----------------------------------------------------------------------------- */

.scrim {
  position: fixed; inset: 0; z-index: var(--z-modal, 900);
  background: color-mix(in oklab, var(--text-inverse) 62%, transparent);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: var(--space-5);
  animation: fadeOnly var(--dur-fast) var(--ease) both;
}
.scrim[hidden] { display: none; }
.modal {
  width: 100%; max-width: 560px; max-height: 84vh; overflow-y: auto;
  background: var(--surface-1); border: 1px solid var(--hairline);
  border-radius: var(--radius-lg); padding: var(--space-7);
  animation: slideUp var(--dur-med) var(--ease) both;
}
.modal h3 { margin: var(--space-3) 0 var(--space-4); font-size: var(--fs-24); font-weight: 600; color: var(--text-primary); letter-spacing: -0.01em; }
.modal p { margin: 0 0 var(--space-4); font-size: var(--fs-16); line-height: var(--lh-relaxed); color: var(--text-body); }
.modal ul { margin: 0 0 var(--space-4); padding-left: var(--space-5); }
.modal li { font-size: var(--fs-14); line-height: var(--lh-relaxed); color: var(--text-body); margin-bottom: var(--space-2); }
.modal-mock {
  padding: var(--space-5); border-radius: var(--radius-md);
  background: var(--surface-2); border: 1px solid var(--hairline-soft); margin-bottom: var(--space-5);
}
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.phase {
  font-family: var(--font-mono); font-size: var(--fs-11); text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow); color: var(--text-faint);
}

/* -----------------------------------------------------------------------------
   13. OPERATOR — dark only, never rendered in light mode
   ----------------------------------------------------------------------------- */

.console { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }

.rail-nav {
  border-right: 1px solid var(--hairline-soft); background: var(--surface-1);
  padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-6);
}
.rail-group { display: flex; flex-direction: column; gap: 2px; }
.rail-group .eyebrow { margin-bottom: var(--space-2); }
.rail-item {
  font-family: inherit; font-size: var(--fs-14); text-align: left; cursor: pointer;
  padding: 9px var(--space-3); border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--text-muted);
  text-decoration: none; display: block;
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.rail-item:hover { color: var(--text-primary); background: var(--surface-2); }
.rail-item.is-on { color: var(--text-primary); background: var(--surface-3); border-color: var(--hairline); }
.rail-item .dotq {
  float: right; font-variant-numeric: var(--num-tabular);
  font-family: var(--font-mono); font-size: var(--fs-11); color: var(--text-faint);
}
.rail-item.alert { color: var(--state-danger); }

.console-main { min-width: 0; }
.console-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-5); flex-wrap: wrap;
  padding: var(--space-5) var(--space-7); border-bottom: 1px solid var(--hairline-soft);
  background: var(--surface-1);
}

/* -----------------------------------------------------------------------------
   14. QUEUE — operator work list
   ----------------------------------------------------------------------------- */

.queue { display: grid; gap: var(--space-3); }
.qrow {
  display: grid; grid-template-columns: 8px minmax(0,1fr) auto; gap: var(--space-4);
  align-items: center; text-align: left; width: 100%;
  padding: var(--space-4) var(--space-5); cursor: pointer;
  background: var(--surface-1); border: 1px solid var(--hairline);
  border-radius: var(--radius-md); font-family: inherit;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.qrow:hover { border-color: var(--text-muted); }
.qrow.sel { background: var(--surface-2); border-color: var(--accent); }
.qrow .bar { width: 4px; height: 34px; border-radius: 2px; background: var(--hairline); }
.qrow.flag .bar { background: var(--state-danger); }
.qrow.warm .bar { background: var(--state-warn); }
.qrow b { display: block; font-size: var(--fs-16); font-weight: 600; color: var(--text-primary); }
.qrow span { display: block; font-size: var(--fs-14); color: var(--text-muted); margin-top: 2px; }
.qrow .meta { text-align: right; font-variant-numeric: var(--num-tabular); }

/* -----------------------------------------------------------------------------
   15. SAFETY FLAG BANNER — the operator centrepiece
   Loud enough to be unmissable, calm enough to not be theatre.
   ----------------------------------------------------------------------------- */

.flagbar {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: var(--space-5);
  align-items: center; padding: var(--space-5) var(--space-6);
  border: 1px solid var(--state-danger); border-left-width: 3px;
  border-radius: var(--radius-md); background: var(--surface-1);
}
.flagbar h3 { margin: 0 0 var(--space-2); font-size: var(--fs-24); font-weight: 600; color: var(--text-primary); letter-spacing: -0.008em; }
.flagbar p { margin: 0; font-size: var(--fs-14); line-height: var(--lh-relaxed); color: var(--text-body); max-width: 64ch; }
.flagbar.cleared { border-color: var(--accent); }

.flag-steps { display: grid; gap: var(--space-3); margin-top: var(--space-5); }
.flag-step {
  display: grid; grid-template-columns: 22px minmax(0,1fr) auto; gap: var(--space-4);
  align-items: center; padding: var(--space-4) var(--space-5);
  background: var(--surface-2); border: 1px solid var(--hairline); border-radius: var(--radius-sm);
}
.flag-step .n {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: var(--fs-11);
  border: 1px solid var(--hairline); color: var(--text-muted);
}
.flag-step.done .n { border-color: var(--accent); color: var(--accent-text); }
.flag-step p { margin: 0; font-size: var(--fs-14); line-height: var(--lh-body); color: var(--text-body); }
.flag-step .when {
  font-family: var(--font-mono); font-size: var(--fs-11); color: var(--text-faint);
  font-variant-numeric: var(--num-tabular); white-space: nowrap;
}

/* -----------------------------------------------------------------------------
   16. KPIs
   ----------------------------------------------------------------------------- */

.kpis {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
  background: var(--hairline); border: 1px solid var(--hairline);
  border-radius: var(--radius-md); overflow: hidden;
}
.kpi { background: var(--surface-1); padding: var(--space-5); min-width: 0; }
.kpi-val {
  display: block; font-size: var(--fs-32); font-weight: 600; color: var(--text-primary);
  font-variant-numeric: var(--num-tabular); letter-spacing: -0.02em; line-height: 1.1;
  margin: var(--space-3) 0 var(--space-2);
}
.kpi-delta { font-size: var(--fs-14); color: var(--text-muted); }

/* -----------------------------------------------------------------------------
   17. FIELDS
   ----------------------------------------------------------------------------- */

.field { display: block; margin-bottom: var(--space-4); }
.field > span { display: block; font-size: var(--fs-14); color: var(--text-muted); margin-bottom: var(--space-2); }
.field textarea { min-height: 120px; resize: vertical; }
.check { display: grid; grid-template-columns: 18px 1fr; gap: var(--space-3); align-items: start; cursor: pointer; }
.check input { margin: 2px 0 0; width: 18px; height: 18px; accent-color: var(--accent); }
.check span { font-size: var(--fs-14); line-height: var(--lh-relaxed); color: var(--text-body); }

/* -----------------------------------------------------------------------------
   18. SKELETON — never a spinner
   ----------------------------------------------------------------------------- */

.skel {
  border-radius: var(--radius-sm); height: 14px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%; animation: skelSlide 1.4s linear infinite;
}
@keyframes skelSlide { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* -----------------------------------------------------------------------------
   19. FOOTER
   ----------------------------------------------------------------------------- */

.foot { border-top: 1px solid var(--hairline-soft); padding: var(--space-7) 0; background: var(--surface-1); }
.foot p { margin: 0 0 var(--space-4); font-size: var(--fs-14); line-height: var(--lh-relaxed); color: var(--text-muted); max-width: 84ch; }
.foot p:last-child { margin-bottom: 0; }

/* -----------------------------------------------------------------------------
   20. FILM MODE + A11Y
   ----------------------------------------------------------------------------- */

body.is-film .film-strip { display: none !important; }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}



/* ============================================================
   STEP FOUR — guided document capture invitation.
   Family-law register: linen, no urgency, no reward language.
   ============================================================ */
.cap-invite {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: var(--space-6);
  align-items: center;
  margin-top: var(--space-6);
  padding: var(--space-6);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
}
.cap-invite-art {
  position: relative;
  height: 116px;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, rgba(16, 185, 129, 0.09), rgba(16, 185, 129, 0.02));
  border: 1px solid var(--hairline-soft);
  overflow: hidden;
}
.cap-sheet {
  position: absolute; left: 50%; top: 52%;
  width: 46px; height: 60px;
  margin: -30px 0 0 -23px;
  background: #FDFCFA;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 2px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  animation: capDrift 7.5s var(--ease-in-out) infinite;
}
.cap-sheet::before, .cap-sheet::after {
  content: ''; position: absolute; left: 7px; right: 7px; height: 2px;
  background: rgba(0, 0, 0, 0.16); border-radius: 1px;
}
.cap-sheet::before { top: 12px; }
.cap-sheet::after  { top: 20px; right: 18px; }
@keyframes capDrift {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50%      { transform: rotate(3.5deg) translateY(-5px); }
}
.cap-lens {
  position: absolute; left: 50%; top: 52%;
  width: 78px; height: 78px; margin: -39px 0 0 -39px;
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  opacity: 0.5;
  animation: capBreathe 3.4s var(--ease-in-out) infinite;
}
@keyframes capBreathe {
  0%, 100% { transform: scale(1);    opacity: 0.34; }
  50%      { transform: scale(0.93); opacity: 0.66; }
}
.cap-invite-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.cap-invite-list li {
  position: relative;
  padding-left: var(--space-5);
  font: 400 var(--fs-16) / var(--lh-body) var(--font-sans);
  color: var(--text-body);
}
.cap-invite-list li::before {
  content: ''; position: absolute; left: 0; top: 0.62em;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
/* the camera is offered, not pushed: outlined so it never competes with the
   one green forward action on the screen */
.cap-snap {
  display: inline-flex; align-items: center; gap: var(--space-3);
  font: 600 var(--fs-16) / 1 var(--font-sans);
  color: var(--accent-text);
  background: var(--canvas);
  border: 1.5px solid var(--accent);
  min-height: 52px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.cap-snap:hover { background: rgba(16, 185, 129, 0.08); }
.cap-snap:active { transform: scale(0.98); }
.cap-snap svg { flex: none; }

.cap-choice {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
}
.cap-trust {
  font: 400 var(--fs-14) / var(--lh-body) var(--font-sans);
  color: var(--text-muted);
  margin: var(--space-4) 0 0;
}
.cap-trust-link {
  font: 400 var(--fs-14) / var(--lh-body) var(--font-sans);
  color: var(--accent-text);
  background: none; border: 0; padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.cap-fallback {
  font: 400 var(--fs-14) / var(--lh-body) var(--font-sans);
  color: var(--text-body);
  margin: var(--space-5) 0 0;
  padding: var(--space-4) var(--space-5);
  background: var(--surface-2);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.paper-chip {
  display: inline-flex; align-items: center; gap: var(--space-3);
  padding: 6px var(--space-4) 6px 6px;
  background: var(--surface-3);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-full);
}
.paper-chip img {
  width: 24px; height: 30px; object-fit: cover;
  border-radius: 3px; display: block;
  border: 1px solid var(--hairline);
}
.paper-chip em {
  font: 500 var(--fs-14) / 1 var(--font-sans);
  font-style: normal;
  color: var(--text-body);
}



/* ============================================================
   PATH ILLUMINATION — a light that actually travels.
   500ms per segment. No celebration, no sound, no confetti;
   this is a family-law flow and the payoff is orientation.
   ============================================================ */
.path-node::after { transition: height 500ms var(--ease); }

.path-node .node-dot {
  transition: border-color 300ms var(--ease), box-shadow 500ms var(--ease);
}
.path-node .node-dot i {
  transition: background 300ms var(--ease), transform 300ms var(--ease-spring);
}
.path-node.lighting .node-dot {
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.16), 0 0 16px rgba(16, 185, 129, 0.42);
}
.path-node.now .node-dot {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.13);
}

/* the travelling spark that rides the connector down */
.path-node .node-spark {
  position: absolute; left: 13px; top: 26px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px 2px rgba(16, 185, 129, 0.6);
  opacity: 0; pointer-events: none;
}
.path-node.lighting .node-spark { animation: pathSpark 500ms var(--ease) forwards; }
@keyframes pathSpark {
  0%   { opacity: 0;    transform: translateY(0)      scale(0.6); }
  18%  { opacity: 1;    transform: translateY(8%)     scale(1); }
  82%  { opacity: 1; }
  100% { opacity: 0;    transform: translateY(var(--spark-end, 60px)) scale(0.6); }
}


/* -----------------------------------------------------------------------------
   DEV CHROME GATE
   Build scaffolding is off by default so a skeptical viewer never sees the
   seams. Append ?dev=1 to any URL to bring it back. ?film=1 still suppresses
   the timing chrome inside the product for recording.
   ----------------------------------------------------------------------------- */
[data-dev] { display: none !important; }
body.is-dev [data-dev] { display: flex !important; }

@media (prefers-reduced-motion: reduce) {
  .path-node.lighting .node-spark { animation: none; opacity: 0; }
  .path-node::after { transition: none; }
}

@media (max-width: 640px) {
  .cap-invite { grid-template-columns: 1fr; gap: var(--space-5); }
  .cap-invite-art { height: 132px; }
  .cap-choice > .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* -----------------------------------------------------------------------------
   21. RESPONSIVE — must remain last in the cascade
   ----------------------------------------------------------------------------- */

@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .console { grid-template-columns: 1fr; }
  .rail-nav { flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--hairline-soft); }
  .rail-nav > * { flex: 1 1 100%; }
  .rail-group { flex: 1 1 44%; }
  .flagbar { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .wrap, .wrap-narrow { padding: 0 var(--space-5); }
  .band { padding: var(--space-7) 0; }
  .band-tight { padding: var(--space-6) 0; }
  .display { font-size: var(--fs-48); }
  .h1 { font-size: var(--fs-32); }
  .h2 { font-size: var(--fs-24); }
  .kpis { grid-template-columns: 1fr; }
  .pad-lg { padding: var(--space-6); }
  .modal { padding: var(--space-6); }
  /* One row, never wrapped. On a phone the only two controls that matter are
     the way forward and the way out, so the section anchors are dropped and
     the exit button keeps its position. A wrapped nav pushed the hero 340px
     down the page at 393 wide, which is unusable. */
  .nav-inner { padding: var(--space-4) var(--space-5); gap: var(--space-4); }
  .nav-links { gap: var(--space-3); flex-wrap: nowrap; }
  .nav-links .nav-link { display: none; }
  /* The nav CTA goes too. The hero carries the same button 200px lower, and the
     exit control must never be pushed off the right edge. */
  .nav-links .btn-primary { display: none; }
  .btn-exit { white-space: nowrap; }
  .console-head { padding: var(--space-5); }
  .safety-list li { grid-template-columns: 1fr; }
  .heard p { font-size: var(--fs-18); }
  .qrow { grid-template-columns: 8px minmax(0,1fr); }
  .qrow .meta { grid-column: 2; text-align: left; }
  .flag-step { grid-template-columns: 22px minmax(0,1fr); }
  .flag-step .when { grid-column: 2; }
}
