/* ============================================================
   KOVERA vMVP — shared stylesheet
   Built 1:1 from the Kovera design-system tokens.
   One navy. One lime accent per surface. Quiet elevation.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Surfaces (navy) */
  --navy-900: #061226;
  --navy-800: #08172C;
  --navy-700: #0C1B30;
  --navy-600: #122844;
  /* Accent — the ONE lime */
  --green:      #9AEC53;
  --green-deep: #75B649;
  /* Text */
  --white:    #FFFFFF;
  --gray-100: #CFD2D8;
  --blue-200: #8FA2BD;
  --blue-400: #596A81;
  /* Warm alternate surface */
  --cream:         #F1ECE2;
  --ink:           #08172C;
  --ink-secondary: #5B5650;
  --ink-tertiary:  #696358;
  /* Hairlines */
  --hair:        rgba(143, 162, 189, 0.16);
  --hair-strong: rgba(143, 162, 189, 0.28);
  /* Accent washes */
  --green-wash:   rgba(154, 236, 83, 0.12);
  --green-ring:   rgba(154, 236, 83, 0.16);
  --green-border: rgba(154, 236, 83, 0.50);
  /* Type */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', monospace;
  --tracking-display: -0.03em;
  --tracking-h1:      -0.02em;
  --tracking-tight:   -0.01em;
  --tracking-eyebrow:  0.34em;
  --tracking-label:    0.06em;
  --tracking-lockup:   0.30em;
  /* Space / radius / motion */
  --r-sm: 8px; --r-md: 14px; --r-lg: 20px; --r-pill: 999px;
  --shadow-card: 0 1px 0 var(--hair-strong) inset, 0 24px 48px -28px rgba(0, 0, 0, 0.7);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 0.15s; --dur: 0.2s;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  margin: 0;
  background: var(--navy-900);
  color: var(--gray-100);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--gray-100); }
a:hover { color: var(--white); }
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* ---- Eyebrow (structural signature) ---- */
.kv-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--blue-200);
  display: flex;
  align-items: center;
  gap: 14px;
}
.kv-eyebrow .num { color: var(--green); }
.kv-eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--hair); }
.kv-eyebrow.tight::after { display: none; }

/* ---- Tabular numerals for data ---- */
.kv-tnum {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-tight);
}

/* ---- Site header ---- */
.site-header {
  display: flex;
  align-items: center;
  padding: 0 32px;
  height: 56px;
  border-bottom: 1px solid var(--hair);
  flex: none;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--white);
}
.brand-mark { width: 19px; height: 19px; object-fit: contain; display: block; }
.brand-word {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: var(--tracking-lockup);
  text-transform: uppercase;
  margin-right: -0.30em;
}

/* ---- Buttons ---- */
.kv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  padding: 12px 26px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.kv-btn--lg { padding: 15px 32px; font-size: 16px; }
.kv-btn--block { width: 100%; }
.kv-btn--primary { background: var(--green); color: var(--ink); }
.kv-btn--primary:hover, .kv-btn--primary:active { background: var(--green-deep); }
.kv-btn--secondary { background: transparent; color: var(--white); border-color: var(--hair-strong); }
.kv-btn--secondary:hover { border-color: rgba(143, 162, 189, 0.5); background: rgba(143, 162, 189, 0.08); }
.kv-btn--ghost { background: transparent; color: var(--blue-200); padding: 12px 14px; }
.kv-btn--ghost:hover { color: var(--white); }
.kv-btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* D7 post-tap confirmed — one-way, reads settled, not pressable */
.kv-btn--confirmed,
.kv-btn--confirmed:disabled {
  background: var(--green-wash);
  border-color: var(--green-border);
  color: var(--green);
  opacity: 1;
  cursor: default;
  pointer-events: none;
}

/* ---- Inputs ---- */
.kv-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--blue-200);
  margin-bottom: 8px;
}
.kv-input {
  width: 100%;
  background: var(--navy-800);
  border: 1px solid var(--hair-strong);
  border-radius: var(--r-sm);
  padding: 13px 15px;
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 15px;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.kv-input--lg { padding: 16px 18px; font-size: 17px; border-radius: 10px; }
.kv-input::placeholder { color: var(--blue-400); }
.kv-input:focus, .kv-input:focus-visible {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-ring);
}
.kv-input:disabled { opacity: 0.5; }
.kv-hint { font-size: 13px; color: var(--blue-200); line-height: 1.5; margin: 10px 0 0; }

/* ---- Cards ---- */
.kv-card {
  background: var(--navy-700);
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
}
.kv-card--elevated { box-shadow: var(--shadow-card); }

/* ---- Badges ---- */
.kv-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  line-height: 1.2;
}
.kv-badge--core { background: var(--green); color: var(--ink); }
.kv-badge--soft { background: var(--green-wash); color: var(--green); }
.kv-badge--outline { border-color: var(--hair-strong); color: var(--blue-200); }

/* ---- Tag chips (bucketed home facts — data, not labels) ---- */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.kv-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--hair-strong);
  border-radius: var(--r-pill);
  font-size: 13px;
  line-height: 1.2;
  color: var(--gray-100);
  white-space: nowrap;
}
.kv-chip .kv-tnum { font-size: 12.5px; }

/* ============================================================
   S1 — LANDING
   ============================================================ */
.landing {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 96px;
  position: relative;
}
/* the one permitted barely-there lime glow */
.landing::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(560px 420px at 50% 26%, rgba(154, 236, 83, 0.07), transparent 70%);
  pointer-events: none;
}
.landing-col {
  width: 100%;
  max-width: 640px;
  text-align: center;
  position: relative;
}
.landing-kicker { justify-content: center; margin-bottom: 26px; }
.landing-h1 {
  margin: 0 0 20px;
  color: var(--white);
  font-size: clamp(38px, 6vw, 56px);
  font-weight: 800;
  letter-spacing: var(--tracking-display);
  line-height: 1.02;
  text-wrap: balance;
}
.landing-sub {
  margin: 0 auto 40px;
  max-width: 520px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--gray-100);
  text-wrap: pretty;
}
.landing-sub strong { color: var(--white); font-weight: 500; }
.landing-form {
  max-width: 480px;
  margin: 0 auto;
  text-align: left;
  display: flex;
  flex-direction: column;
}
.landing-form .kv-btn { margin-top: 24px; }
@media (max-width: 560px) {
  .landing { padding: 32px 20px 72px; align-items: flex-start; padding-top: 9vh; }
  .landing-kicker { margin-bottom: 20px; }
  .landing-sub { font-size: 16px; margin-bottom: 32px; }
}

/* ============================================================
   S5 — RESULTS (map + rail / bottom sheet)
   ============================================================ */
.results-head {
  padding: 20px 32px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 28px;
  flex: none;
}
.results-head h1 {
  margin: 0;
  color: var(--white);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: var(--tracking-h1);
  line-height: 1.1;
}
.results-sub { margin: 7px 0 0; color: var(--blue-200); font-size: 14.5px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  font-size: 13px;
  color: var(--blue-200);
  padding-bottom: 4px;
}
.legend .li { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.lg-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 1.5px var(--navy-900), 0 0 0 3px rgba(154, 236, 83, 0.18);
}
.lg-star svg { width: 16px; height: 16px; fill: var(--green); stroke: var(--navy-900); stroke-width: 1.2px; display: block; }
.lg-origin {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--navy-600);
  border: 1.5px solid rgba(255, 255, 255, 0.72);
}

.results-main {
  flex: 1;
  display: flex;
  gap: 20px;
  padding: 0 32px 24px;
  align-items: stretch;
  min-height: 0;
}
#map {
  position: relative;
  flex: 1;
  min-height: 540px;
  height: calc(100vh - 252px);
  background: var(--navy-800);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.map-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---- Map pins (spec: see rationale.md §pins) ---- */
.pin {
  position: absolute;
  transform: translate(-50%, -50%);
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  line-height: 0;
  transition: box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), filter var(--dur-fast) var(--ease);
}
.pin-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px var(--navy-900), 0 0 0 6px rgba(154, 236, 83, 0.14);
  z-index: 1;
}
.pin-dot:hover { box-shadow: 0 0 0 2px var(--navy-900), 0 0 0 7px rgba(154, 236, 83, 0.32); }
.pin-dot.selected { box-shadow: 0 0 0 2.5px var(--white), 0 0 0 8px rgba(255, 255, 255, 0.16); }
.pin-star { z-index: 2; }
.pin-star svg {
  width: 27px; height: 27px; display: block;
  fill: var(--green);
  stroke: var(--navy-900);
  stroke-width: 1.4px;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.45));
  transition: filter var(--dur-fast) var(--ease), stroke var(--dur-fast) var(--ease);
}
.pin-star:hover svg { filter: drop-shadow(0 0 7px rgba(154, 236, 83, 0.65)); }
.pin-star.selected svg { stroke: var(--white); filter: drop-shadow(0 0 7px rgba(255, 255, 255, 0.5)); }
.pin-origin {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--navy-600);
  border: 1.5px solid rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  z-index: 3;
}
.pin-origin img { width: 14px; height: 14px; object-fit: contain; }
.pin-origin:hover { border-color: var(--white); }
.pin-origin.selected { border-color: var(--white); box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.16), 0 4px 12px rgba(0, 0, 0, 0.45); }

/* ---- Right rail (desktop) ---- */
.rail {
  width: 400px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: calc(100vh - 252px);
  min-height: 540px;
}
.rail-detail {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: var(--navy-700);
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  scrollbar-width: thin;
  scrollbar-color: var(--navy-600) transparent;
}
.rail-detail::-webkit-scrollbar { width: 8px; }
.rail-detail::-webkit-scrollbar-thumb { background: var(--navy-600); border-radius: 8px; }

/* ---- Home detail (rail + sheet share this) ---- */
.detail-hero { line-height: 0; position: relative; }
.detail-hero img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; cursor: zoom-in; }
.shot-expand-btn {
  position: absolute; right: 6px; bottom: 6px;
  width: 44px; height: 44px;
  padding: 0; border: none; background: none;
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-in;
  opacity: 0;
  transition: opacity 120ms var(--ease);
}
.shot-expand-glyph {
  width: 32px; height: 32px; border-radius: var(--r-pill);
  background: rgba(8, 23, 44, .55);
  backdrop-filter: blur(6px);
  border: 1px solid var(--hair-strong);
  display: flex; align-items: center; justify-content: center;
}
@media (hover: hover) {
  .detail-hero:hover .shot-expand-btn,
  .shot-expand-btn:focus-visible { opacity: 1; }
}
@media (hover: none) {
  .shot-expand-btn { opacity: 1; }
}
.detail-body { padding: 18px; display: flex; flex-direction: column; align-items: flex-start; gap: 13px; }
.detail-addr h2 {
  margin: 0;
  color: var(--white);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: 1.2;
}
.addr-star { width: 16px; height: 16px; fill: var(--green); stroke: var(--navy-900); stroke-width: 1px; display: inline-block; vertical-align: -1.5px; margin-right: 7px; }
.detail-city { color: var(--blue-200); font-size: 14px; margin-top: 3px; }
.detail-body .kv-btn--block { margin-top: 4px; }
.detail-body .kv-btn--confirmed { font-size: 13.5px; padding: 13px 16px; }

/* rail empty state — pre-tap */
.empty-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 32px;
  text-align: center;
}
.empty-state svg { color: var(--blue-400); margin-bottom: 6px; }
.empty-title { color: var(--white); font-weight: 600; font-size: 17px; }
.empty-sub { color: var(--blue-200); font-size: 13.5px; }

/* origin mini detail */
.origin-mini { display: flex; align-items: center; gap: 14px; }
.origin-glyph {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--navy-600);
  border: 1.5px solid rgba(255, 255, 255, 0.72);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.origin-glyph img { width: 20px; height: 20px; object-fit: contain; }

/* ---- Save bar (cream — the warm beat; E3 is its one accent) ---- */
.savebar {
  background: var(--cream);
  border-radius: var(--r-md);
  padding: 20px;
  flex: none;
}
.savebar h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
}
.savebar p { margin: 0 0 16px; color: var(--ink-secondary); font-size: 13.5px; line-height: 1.55; }
.savebar .kv-label { color: var(--ink-tertiary); }
.savebar .kv-input {
  background: #FFFFFF;
  border-color: rgba(8, 23, 44, 0.16);
  color: var(--ink);
}
.savebar .kv-input::placeholder { color: #9A948A; }
.savebar .kv-input:focus { border-color: var(--green-deep); box-shadow: 0 0 0 3px rgba(117, 182, 73, 0.22); }
.savebar .kv-btn { margin-top: 12px; }
.savebar .kv-btn--primary:disabled { opacity: 0.55; }

/* ---- Mobile bottom sheet ---- */
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  background: var(--navy-700);
  border: 1px solid var(--hair);
  border-bottom: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.55);
  transform: translateY(104%);
  transition: transform 0.28s var(--ease);
  max-height: 74vh;
  display: none;
  flex-direction: column;
}
.sheet.open { transform: translateY(0); }
.sheet.dragging { transition: none; }
.sheet-handle {
  padding: 12px 0 8px;
  display: flex;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  flex: none;
}
.sheet-handle::before {
  content: "";
  width: 44px; height: 4px;
  border-radius: var(--r-pill);
  background: var(--hair-strong);
}
.sheet-body { overflow-y: auto; min-height: 0; }
.sheet .detail-hero img { aspect-ratio: 16 / 8.5; }

.savebar-mobile-slot { display: none; padding: 16px 16px 0; }

/* ---- Compliance footer (F) ---- */
.compliance {
  border-top: 1px solid var(--hair);
  padding: 16px 32px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--blue-200);
  flex: none;
}
.compliance .sep { color: var(--blue-400); padding: 0 4px; }
.compliance a {
  color: var(--gray-100);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--hair-strong);
}
.compliance a:hover { color: var(--white); }

/* ---- Results responsive ---- */
@media (max-width: 960px) {
  .site-header { padding: 0 18px; }
  .results-head { padding: 18px 18px 12px; }
  .results-head h1 { font-size: 24px; }
  .results-main { flex-direction: column; padding: 0 16px; }
  #map { height: 56vh; min-height: 380px; border-radius: var(--r-md); }
  .rail { display: none; }
  .sheet { display: flex; }
  .savebar-mobile-slot { display: block; }
  .compliance { padding: 16px 18px 22px; margin-top: 20px; }
}

/* ---- Shot viewer (S5 hero pop-out) --------------------------------------
   Single-shot mode only -- a results home has at most one render, so no
   dots/counter/prev-next here (contrast the post-auth board's multi-shot
   carousel viewer). Badge + honesty caption live ONLY inside this overlay,
   never on the small .detail-hero thumbnail -- pre-auth thumbnails stay
   badge-less, the viewer always badges (every render here is AI-imagined,
   never a real photo, so it's unconditional). Reuses the same /render URL
   the card already loads; no viewer-specific asset exists. */
.shot-viewer { position: fixed; inset: 0; z-index: 70; display: none; }
.shot-viewer.open { display: block; }
.shot-viewer-scrim {
  position: absolute; inset: 0;
  background: rgba(6, 18, 38, .72);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: shotViewerScrimIn 200ms var(--ease);
}
.shot-viewer.closing .shot-viewer-scrim { animation: shotViewerScrimOut 160ms var(--ease) forwards; }
.shot-viewer-stage {
  position: relative;
  width: min(86vw, 128vh); /* 128vh = 80vh * (16/10) */
  aspect-ratio: 16 / 10;
  max-height: 80vh;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  cursor: zoom-in;
  touch-action: none;
  animation: shotViewerStageIn 240ms var(--ease);
}
.shot-viewer.closing .shot-viewer-stage { animation: none; }
.shot-viewer-stage::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 110px;
  background: linear-gradient(0deg, rgba(6, 18, 38, .66), transparent);
  pointer-events: none;
}
.shot-viewer-imgwrap { position: absolute; inset: 0; overflow: hidden; }
.shot-viewer-imgwrap img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  user-select: none; -webkit-user-drag: none;
  transform-origin: center center;
  transition: transform 220ms var(--ease);
}
.shot-viewer-imgwrap.dragging img { transition: none; }
.shot-viewer-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: rgba(8, 23, 44, .55);
  backdrop-filter: blur(6px);
}
.shot-viewer-caption { position: absolute; left: 16px; bottom: 14px; z-index: 2; pointer-events: none; }
.shot-viewer-addr { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: var(--tracking-tight); color: var(--white); }
.shot-viewer-sub { margin: 3px 0 0; font-size: 11.5px; color: rgba(207, 210, 216, .9); }
.shot-viewer-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 40px; height: 40px; border-radius: var(--r-pill);
  background: rgba(8, 23, 44, .55);
  backdrop-filter: blur(6px);
  border: 1px solid var(--hair-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-100);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.shot-viewer-close:hover { color: var(--white); border-color: rgba(143, 162, 189, .5); }
@keyframes shotViewerScrimIn { from { opacity: 0; } }
@keyframes shotViewerScrimOut { to { opacity: 0; } }
@keyframes shotViewerStageIn { from { opacity: 0; transform: scale(.985); } }
@media (max-width: 960px) {
  .shot-viewer-scrim { background: var(--navy-900); backdrop-filter: none; padding: 0; }
  .shot-viewer-stage {
    width: 100%; height: 100%; max-height: none; aspect-ratio: auto;
    border-radius: 0; box-shadow: none;
  }
}

/* ============================================================
   S2–S4 — flow screens (single centered stack)
   ============================================================ */
.stack-page { flex: 1; display: flex; justify-content: center; padding: 64px 24px 96px; }
.stack-col { width: 100%; max-width: 520px; }
.stack-col--wide { max-width: 880px; }
.stack-h1 {
  margin: 0 0 10px;
  color: var(--white);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: var(--tracking-h1);
  line-height: 1.1;
  text-align: center;
  text-wrap: balance;
}
.stack-sub {
  margin: 0 auto;
  max-width: 460px;
  color: var(--gray-100);
  font-size: 16px;
  text-align: center;
  text-wrap: pretty;
}
@media (max-width: 560px) {
  .stack-page { padding: 36px 20px 72px; }
  .stack-h1 { font-size: 28px; }
}

/* ---- S2a candidate cards ---- */
.cand-list { display: flex; flex-direction: column; gap: 10px; margin-top: 30px; }
.cand-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--navy-700);
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  padding: 17px 20px;
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.cand-card:hover { border-color: rgba(143, 162, 189, 0.5); background: rgba(143, 162, 189, 0.07); }
.cand-addr { display: block; color: var(--white); font-size: 16px; font-weight: 600; letter-spacing: var(--tracking-tight); }
.cand-city { display: block; color: var(--blue-200); font-size: 13.5px; margin-top: 2px; }
.cand-chev { color: var(--blue-400); flex: none; transition: color var(--dur-fast) var(--ease); }
.cand-card:hover .cand-chev { color: var(--white); }
.escape-row { display: flex; justify-content: center; margin-top: 22px; }

/* ---- S3 confirm card + action stack ---- */
.confirm-card { overflow: hidden; margin-top: 30px; }
.confirm-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.confirm-body { padding: 18px 20px 20px; }
.confirm-addr {
  margin: 0 0 13px;
  color: var(--white);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: 1.25;
}
.confirm-city { color: var(--blue-200); font-weight: 400; }
.confirm-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.confirm-actions .kv-btn--ghost { align-self: center; }

/* ---- S4 game ---- */
.game-head { text-align: center; }
.game-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
  color: var(--blue-200);
  font-size: 13px;
}
.game-progress .kv-tnum { white-space: nowrap; flex: none; }
.segs { display: flex; gap: 6px; width: 200px; }
.seg { height: 3px; flex: 1; border-radius: var(--r-pill); background: var(--hair); transition: background var(--dur) var(--ease); }
.seg.done { background: var(--blue-400); }
.choice-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 26px;
}
.choice-card {
  min-height: 216px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 30px;
  background: var(--navy-700);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.choice-card:hover { border-color: rgba(143, 162, 189, 0.5); background: rgba(143, 162, 189, 0.07); }
.choice-card:active, .choice-card.picked { border-color: var(--green-border); background: rgba(154, 236, 83, 0.08); }
.build-state {
  grid-column: 1 / -1;
  min-height: 216px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
}
.game-error {
  grid-column: 1 / -1;
  min-height: 216px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  color: var(--gray-100);
  font-size: 16px;
}
@media (max-width: 720px) {
  .choice-pair { grid-template-columns: 1fr; }
  .choice-card { min-height: 130px; font-size: 18px; padding: 26px 22px; }
}
