/* ==========================================================================
   VestMove — Luminous Editorial Fintech Design System (v3.0)
   Principles:
   - Bright, airy daylight canvas with quiet architectural restraint
   - Zero colored border stripes, zero nested box-soup, zero SaaS gradients
   - Editorial medium-weight serif display + crisp sans tabular figures
   - Strict OKLCH tokens in :root, clean 8px/6px geometry, overflow-x: clip
   - Zero desktop table clipping (1240px container + balanced 38/62 split)
   ========================================================================== */

:root {
  /* Luminous Daylight Surfaces (OKLCH) */
  --bg: oklch(0.986 0.002 250);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.968 0.004 250);
  --surface-3: oklch(0.942 0.006 250);

  /* Ink Hierarchy */
  --ink: oklch(0.185 0.014 255);
  --ink-2: oklch(0.365 0.012 255);
  --ink-muted: oklch(0.505 0.010 255);
  --ink-soft: oklch(0.605 0.008 255);
  --ink-inverse: oklch(1 0 0);

  /* Quiet Hairlines */
  --border: oklch(0.912 0.005 250);
  --border-strong: oklch(0.840 0.008 250);
  --border-ink: oklch(0.240 0.012 255);

  /* Restrained Daylight Cobalt Accent */
  --brand: oklch(0.455 0.155 258);
  --brand-hover: oklch(0.385 0.150 258);
  --brand-tint: oklch(0.970 0.014 255);
  --brand-border: oklch(0.865 0.045 256);
  --brand-focus: oklch(0.455 0.155 258 / 0.14);
  --brand-underline: oklch(0.455 0.155 258 / 0.34);

  /* Data Visualization: Warm Terracotta (Origin) vs Calm Teal (Destination) */
  --origin: oklch(0.505 0.145 36);
  --origin-bar: oklch(0.625 0.155 38);
  --origin-bg: oklch(0.976 0.014 45);
  --origin-border: oklch(0.900 0.036 42);

  --dest: oklch(0.445 0.105 198);
  --dest-bar: oklch(0.585 0.115 196);
  --dest-bg: oklch(0.974 0.012 200);
  --dest-border: oklch(0.885 0.030 198);

  /* Semantic States (quiet text emphasis, soft paper tints) */
  --danger: oklch(0.495 0.170 24);
  --danger-bg: oklch(0.978 0.014 22);
  --danger-border: oklch(0.900 0.042 22);

  --success: oklch(0.435 0.120 156);
  --success-bg: oklch(0.974 0.014 156);
  --success-border: oklch(0.880 0.038 156);

  --warn: oklch(0.485 0.110 68);
  --warn-ink: oklch(0.365 0.065 65);
  --warn-bg: oklch(0.980 0.016 82);
  --warn-border: oklch(0.900 0.042 78);

  --split-ink: oklch(0.435 0.115 256);
  --split-bg: oklch(0.966 0.014 255);
  --withheld-bar: oklch(0.730 0.012 252);
  --tick-mark: oklch(1 0 0 / 0.92);

  /* Soft Ambient Elevation (barely-there daylight lift) */
  --shadow-card: 0 1px 2px oklch(0.2 0.01 255 / 0.03), 0 8px 24px -12px oklch(0.2 0.01 255 / 0.06);
  --shadow-float: 0 4px 16px oklch(0.2 0.01 255 / 0.10);
  --shadow-seg: 0 1px 2px oklch(0.2 0.01 255 / 0.08);

  --sticky-bg: oklch(1 0 0 / 0.96);
  --sticky-val: oklch(0.495 0.170 24);
  --sticky-cta-bg: oklch(0.455 0.155 258);
  --sticky-cta-ink: oklch(1 0 0);

  /* Print Tokens */
  --print-bg: oklch(1 0 0);
  --print-ink: oklch(0 0 0);
  --print-rule: oklch(0.65 0 0);
  --print-muted: oklch(0.38 0 0);

  /* Balanced Modern Geometry */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;

  /* Editorial Serif Display + Refined Grotesque UI + Subtle Mono */
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --container: 1240px;
}

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

html {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
}

a {
  color: var(--brand);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

.num,
input[type="number"],
input[type="date"],
table td,
.kpi-value,
.fact-value,
.timeline-stat-value,
.iphone-big-num,
.mobile-sticky-val {
  font-variant-numeric: tabular-nums;
}

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

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

.hidden {
  display: none !important;
}

/* ==========================================================================
   Accessibility & Motion
   ========================================================================== */
.skip-link {
  position: absolute;
  left: 16px;
  top: -56px;
  z-index: 100;
  background: var(--ink);
  color: var(--ink-inverse);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* ==========================================================================
   Header (Whisper-Quiet Bright Bar)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: oklch(1 0 0 / 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.18rem;
  color: var(--ink);
  letter-spacing: -0.015em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--ink-inverse);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-muted);
  padding: 6px 0;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--ink);
  text-decoration: none;
}

.nav-link.active {
  color: var(--ink);
  font-weight: 600;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.trust-dot {
  display: none;
}

@media (max-width: 860px) {
  .trust-pill {
    display: none;
  }
}

@media (max-width: 540px) {
  .container {
    padding: 0 16px;
  }
  .header-inner {
    min-height: 52px;
    gap: 12px;
  }
  .brand {
    font-size: 1.05rem;
    flex-shrink: 0;
  }
  .header-nav {
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .header-nav::-webkit-scrollbar {
    display: none;
  }
  .nav-link {
    font-size: 0.82rem;
    white-space: nowrap;
  }
}

/* ==========================================================================
   Hero — Tight, Airy, Calculator Above the Fold
   ========================================================================== */
.hero {
  padding: 28px 0 20px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.breadcrumbs a {
  color: var(--ink-muted);
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

h1 {
  font-family: var(--font-display);
  margin: 0 0 10px;
  font-size: clamp(1.85rem, 3.1vw, 2.55rem);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 780px;
}

.hero-sub {
  margin: 0;
  max-width: 700px;
  font-size: 0.98rem;
  color: var(--ink-2);
  line-height: 1.6;
}

/* Quiet editorial note — no heavy box clutter in hero */
.corridor-banner {
  margin-top: 12px;
  padding: 0;
  background: transparent;
  border: none;
  font-size: 0.86rem;
  color: var(--ink-muted);
  max-width: 760px;
  line-height: 1.55;
}

.corridor-banner strong {
  color: var(--ink-2);
  font-weight: 600;
}

.preset-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}

.preset-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-right: 4px;
}

.preset-chip {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.preset-chip:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
}

.preset-chip.active {
  background: var(--brand-tint);
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}

/* ==========================================================================
   Main Two-Column Calculator Workspace (38% Inputs / 62% Results -> Zero Table Clip)
   ========================================================================== */
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.76fr) minmax(0, 1.24fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 56px;
}

.workspace-grid > *,
.guide-layout > * {
  min-width: 0;
}

@media (max-width: 1020px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

.input-panel {
  min-width: 0;
}

@media (max-width: 540px) {
  .panel {
    padding: 18px 16px;
  }
}

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.panel-step {
  font-size: 0.76rem;
  color: var(--ink-soft);
}

/* Form Controls — Perfect Baseline Alignment & Clean Rhythm */
.field {
  margin-bottom: 16px;
}

.field-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}

.field-grid-2 > .field {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

/* Uniform label block height so 1-line & 2-line labels share the exact same input baseline */
.field-grid-2 > .field > label {
  min-height: 36px;
  align-items: flex-end;
}

.field-grid-move {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  margin-bottom: 16px;
}

.field-row-2col-span {
  grid-column: 1 / -1;
}

.move-arrow {
  display: grid;
  place-items: center;
  height: 40px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.btn-swap {
  appearance: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink-muted);
  font-size: 0.92rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.btn-swap:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--ink);
}

@media (max-width: 540px) {
  .field-grid-2,
  .field-grid-move {
    grid-template-columns: minmax(0, 1fr);
  }
  .move-arrow {
    display: none;
  }
  .btn-swap {
    width: 100%;
    height: 30px;
  }
}

label,
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.label-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.label-tag.origin {
  color: var(--origin);
  background: var(--origin-bg);
}

.label-tag.dest {
  color: var(--dest);
  background: var(--dest-bg);
}

.field-hint {
  display: block;
  font-size: 0.74rem;
  color: var(--ink-soft);
  margin-top: 5px;
  line-height: 1.4;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix,
.input-suffix {
  position: absolute;
  font-size: 0.86rem;
  color: var(--ink-soft);
  pointer-events: none;
}

.input-prefix {
  left: 11px;
}

.input-suffix {
  right: 11px;
}

input[type="number"],
input[type="date"],
input[type="email"],
input[type="text"],
select {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input.has-prefix {
  padding-left: 24px;
}

input.has-suffix {
  padding-right: 34px;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-focus);
}

/* Segmented Control (Crisp Apple-like Elevated White Active Pill on Soft Mist Track) */
.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.seg-btn {
  appearance: none;
  border: none;
  border-radius: 4px;
  background: transparent;
  padding: 7px 6px;
  font-family: var(--font-body);
  font-size: 0.79rem;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
  text-align: center;
}

.seg-btn:hover {
  color: var(--ink);
}

.seg-btn.active,
.seg-btn[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-seg);
}

.checkbox-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.checkbox-card input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  flex-shrink: 0;
}

.checkbox-card label {
  margin: 0;
  font-weight: 500;
  font-size: 0.83rem;
  color: var(--ink);
  cursor: pointer;
}

details.advanced-drawer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

details.advanced-drawer summary {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

details.advanced-drawer summary::after {
  content: "+";
  font-size: 1rem;
  color: var(--ink-soft);
}

details.advanced-drawer[open] summary::after {
  content: "−";
  color: var(--brand);
}

details.advanced-drawer[open] summary {
  margin-bottom: 14px;
}

.mode-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.mode-switch button {
  appearance: none;
  border: none;
  border-radius: 4px;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-muted);
  padding: 2px 7px;
  cursor: pointer;
}

.mode-switch button.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-seg);
}

.error-banner,
.calc-errors {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.84rem;
  margin-bottom: 16px;
}

.calc-errors strong {
  display: block;
  margin-bottom: 4px;
}

.calc-errors ul,
.calc-warnings ul {
  margin: 0;
  padding-left: 18px;
}

.calc-warnings {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink-muted);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.78rem;
  margin-bottom: 16px;
}

.is-stale {
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

/* ==========================================================================
   Results Panel — Unified Clean Ledger (Zero Box-Inside-Box Clutter)
   ========================================================================== */
.results-panel {
  position: sticky;
  top: 74px;
  padding: 26px 28px;
}

@media (max-width: 1020px) {
  .results-panel {
    position: static;
  }
}

@media (max-width: 540px) {
  .results-panel {
    padding: 18px 16px;
  }
}

/* Unified 3-Column Metric Bar — Divided by Quiet Hairlines, NO Painted Candy Boxes */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.kpi-card {
  padding: 2px 18px 2px 0;
  border: none;
  background: transparent;
}

.kpi-card + .kpi-card {
  padding-left: 18px;
  border-left: 1px solid var(--border);
}

.kpi-card:last-child {
  padding-right: 0;
}

@media (max-width: 640px) {
  .kpi-strip {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .kpi-card,
  .kpi-card + .kpi-card {
    padding: 0 0 14px;
    border-left: none;
    border-bottom: 1px solid var(--border);
  }
  .kpi-card:last-child {
    padding-bottom: 0;
    border-bottom: none;
  }
}

.kpi-label {
  font-size: 0.79rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.kpi-value {
  font-family: var(--font-body);
  font-size: clamp(1.55rem, 2.3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.18;
  margin: 5px 0 5px;
  color: var(--ink);
}

.kpi-card.is-primary .kpi-value {
  color: var(--danger);
}

.kpi-card.is-primary.is-refund .kpi-value {
  color: var(--success);
}

.kpi-card.is-origin .kpi-value {
  color: var(--origin);
}

.kpi-sub {
  font-size: 0.76rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

/* Seamless Timeline & Stack Section (no nested outer box!) */
.timeline-card,
.stack-card {
  padding: 0 0 22px;
  margin-bottom: 22px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.timeline-head,
.stack-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.timeline-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.timeline-caption {
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.timeline-bar-wrap {
  position: relative;
  padding-top: 26px;
  margin-bottom: 8px;
}

.timeline-track-wrap {
  position: relative;
}

.timeline-pin {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-inverse);
  background: var(--ink);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 2;
}

.timeline-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  width: 1px;
  height: 22px;
  background: var(--ink);
}

.timeline-pin.is-left {
  transform: translateX(-12px);
}

.timeline-pin.is-left::after {
  left: 12px;
}

.timeline-pin.is-right {
  transform: translateX(calc(-100% + 12px));
}

.timeline-pin.is-right::after {
  left: calc(100% - 12px);
}

.timeline-track,
.stack-bar {
  display: flex;
  height: 12px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface-3);
}

.timeline-origin {
  background: var(--origin-bar);
  transition: width 0.2s ease;
}

.timeline-dest {
  background: var(--dest-bar);
  transition: width 0.2s ease;
}

.timeline-ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.timeline-tick {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 1.5px;
  margin-left: -1px;
  background: var(--tick-mark);
  pointer-events: auto;
}

.timeline-tick:last-child {
  margin-left: -2px;
}

.timeline-dates {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--ink-soft);
  margin-top: 7px;
}

.timeline-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}

@media (max-width: 520px) {
  .timeline-legend {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
}

.timeline-stat {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  margin-top: 5px;
  flex-shrink: 0;
}

.swatch.origin {
  background: var(--origin-bar);
}

.swatch.dest {
  background: var(--dest-bar);
}

.stack-seg {
  display: block;
  height: 100%;
  transition: width 0.2s ease;
}

.stack-seg.net,
.swatch.net {
  background: var(--brand);
}

.stack-seg.withheld,
.swatch.withheld {
  background: var(--withheld-bar);
}

.stack-seg.gap,
.swatch.gap {
  background: var(--danger);
}

.stack-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--ink-2);
}

.stack-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.stack-legend .swatch {
  display: inline-block;
  margin-top: 0;
}

.timeline-stat-label {
  font-size: 0.76rem;
  color: var(--ink-muted);
}

.timeline-stat-value {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 1px;
}

/* ==========================================================================
   Clean Financial Tables (Fits 100% on Desktop Without Clipping!)
   ========================================================================== */
.table-section {
  margin-bottom: 22px;
}

.table-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.table-section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 600;
}

.year-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.year-pill {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 5px;
  cursor: pointer;
}

.year-pill:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

.year-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ink-inverse);
}

/* Open borderless ledger table — zero double-border noise */
.table-scroll {
  overflow-x: auto;
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  background: transparent;
}

.table-scroll table {
  min-width: 540px;
}

.table-scroll table.table-compact {
  min-width: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

thead th {
  background: transparent;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-muted);
  padding: 9px 5px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

thead th:first-child,
tbody td:first-child,
tfoot td:first-child {
  text-align: left;
  padding-left: 2px;
}

thead th:last-child,
tbody td:last-child,
tfoot td:last-child {
  padding-right: 2px;
}

tbody td {
  font-family: var(--font-body);
  font-size: 0.79rem;
  padding: 8px 5px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  color: var(--ink-2);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--bg);
}

tfoot td {
  font-family: var(--font-body);
  font-size: 0.8rem;
  background: var(--bg);
  font-weight: 700;
  color: var(--ink);
  padding: 9px 5px;
  text-align: right;
  border-top: 1px solid var(--border-strong);
  white-space: nowrap;
}

.cell-main {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.8rem;
}

.cell-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 0.7rem;
  color: var(--ink-soft);
}

.mini-split {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mini-bar {
  display: inline-flex;
  width: 26px;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface-3);
}

.mini-bar-fill {
  background: var(--origin-bar);
  height: 100%;
}

/* Soft, borderless whisper badges inside tables (no frantic red/blue outlines) */
.status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

.status-badge.origin {
  color: var(--origin);
  background: var(--origin-bg);
}

.status-badge.split {
  color: var(--split-ink);
  background: var(--split-bg);
}

.status-badge.dest {
  color: var(--dest);
  background: var(--dest-bg);
}

.val-danger {
  color: var(--danger);
  font-weight: 600;
}

.val-success {
  color: var(--success);
  font-weight: 600;
}

/* ==========================================================================
   Takeaways, Formula Audit Drawer, Actions & Disclaimer
   ========================================================================== */
.insight-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 0.84rem;
  color: var(--ink-2);
  margin-bottom: 16px;
}

.insight-box strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-weight: 600;
}

.insight-box ul {
  margin: 0;
  padding-left: 18px;
}

.insight-box li {
  margin-bottom: 4px;
}

details.formula-audit {
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  padding: 12px 14px;
  font-size: 0.83rem;
}

details.formula-audit summary {
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

details.formula-audit summary::after {
  content: "Show math";
  font-size: 0.76rem;
  color: var(--brand);
}

details.formula-audit[open] summary::after {
  content: "Hide math";
}

details.formula-audit[open] summary {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.formula-steps {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.65;
}

.action-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--ink-muted);
  text-decoration: none;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--ink-inverse);
}

.btn-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: var(--ink-inverse);
}

.btn-dark {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ink-inverse);
}

.btn-dark:hover {
  background: var(--ink-2);
  border-color: var(--ink-2);
  color: var(--ink-inverse);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

@media (max-width: 540px) {
  .action-toolbar .btn {
    flex: 1 1 100%;
  }
}

.action-status {
  min-height: 1.2em;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--success);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.action-status.is-visible {
  opacity: 1;
}

.action-status.is-error {
  color: var(--danger);
}

.disclaimer-box {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.disclaimer-box strong {
  color: var(--ink-muted);
}

/* ==========================================================================
   Waitlist Section — Clean Luminous Editorial Feature Strip
   ========================================================================== */
.waitlist-section {
  margin: 0 0 56px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 36px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.75fr);
  gap: 36px;
  align-items: center;
}

@media (max-width: 820px) {
  .waitlist-section {
    grid-template-columns: minmax(0, 1fr);
    padding: 24px 20px;
    gap: 24px;
  }
}

.waitlist-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 8px;
}

.waitlist-section h2 {
  font-family: var(--font-display);
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 2.3vw, 1.72rem);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.waitlist-section p {
  margin: 0 0 16px;
  color: var(--ink-2);
  font-size: 0.93rem;
  line-height: 1.62;
}

.waitlist-perks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.waitlist-perks li::before {
  content: "✓ ";
  color: var(--brand);
  font-weight: 700;
}

.waitlist-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 460px;
}

.waitlist-form input[type="email"] {
  flex: 1 1 220px;
  background: var(--bg);
  border-color: var(--border-strong);
  color: var(--ink);
}

.waitlist-msg {
  width: 100%;
  font-size: 0.8rem;
  color: var(--success);
  margin-top: 4px;
}

.waitlist-msg.is-error {
  color: var(--danger);
}

/* Specimen Schedule Card */
.iphone-mock {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.iphone-notch {
  display: none;
}

.iphone-screen {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.iphone-app-title {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.iphone-big-num {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--origin);
  margin: 8px 0 10px;
}

.iphone-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  color: var(--ink-2);
}

.iphone-row strong {
  color: var(--ink);
}

.iphone-pill {
  margin-top: 10px;
  text-align: center;
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--brand-tint);
  color: var(--brand);
  padding: 6px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Corridor Key Facts, Directory, Related Content & FAQ
   ========================================================================== */
.fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}

.fact-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.fact-card.is-origin {
  background: var(--origin-bg);
  border-color: var(--origin-border);
}

.fact-card.is-dest {
  background: var(--dest-bg);
  border-color: var(--dest-border);
}

.fact-label {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.fact-value {
  margin-top: 4px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.fact-note {
  margin-top: 4px;
  font-size: 0.79rem;
  color: var(--ink-soft);
}

.content-section {
  max-width: 780px;
  margin: 0 0 48px;
}

.section-block {
  margin-bottom: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.section-block h2,
.related-links h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
}

.corridor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.corridor-card {
  display: block;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  transition: border-color 0.12s ease, background 0.12s ease;
}

.corridor-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  text-decoration: none;
}

.corridor-card.active {
  border-color: var(--brand);
  background: var(--brand-tint);
}

.corridor-route {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.corridor-meta {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.related-links {
  margin: 0 0 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.related-links h2 {
  margin-bottom: 16px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}

.related-card {
  display: block;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.12s ease, background 0.12s ease;
}

.related-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  text-decoration: none;
}

.related-kicker {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 4px;
}

.related-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.3;
}

.related-desc {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.link-list a {
  font-weight: 500;
}

/* FAQ Clean Rule List */
.faq-list {
  border-top: 1px solid var(--border);
}

.faq-item {
  background: transparent;
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  padding: 16px 2px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.04rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink);
}

.faq-item summary::after {
  content: "+";
  font-size: 1.15rem;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "−";
  color: var(--brand);
}

.faq-answer {
  padding: 0 2px 18px;
  margin: 0;
  font-size: 0.93rem;
  color: var(--ink-2);
  line-height: 1.68;
  max-width: 72ch;
}

/* ==========================================================================
   Editorial Guide Layout (/guides/*)
   ========================================================================== */
.article-header {
  padding: 34px 0 22px;
  max-width: 760px;
  border-bottom: 1px solid var(--border);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 10px;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(0, 300px);
  gap: 44px;
  align-items: start;
  padding: 32px 0 56px;
}

@media (max-width: 960px) {
  .guide-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
}

.prose {
  min-width: 0;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.44rem;
  font-weight: 600;
  margin: 34px 0 12px;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.prose h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 24px 0 8px;
}

.prose p {
  margin: 0 0 16px;
  color: var(--ink-2);
  font-size: 0.97rem;
  line-height: 1.72;
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
  color: var(--ink-2);
}

.prose li {
  margin-bottom: 8px;
  line-height: 1.65;
}

.prose a {
  text-decoration: underline;
  text-decoration-color: var(--brand-underline);
}

.prose a:hover {
  text-decoration-color: var(--brand);
}

.prose blockquote {
  margin: 20px 0;
  padding: 4px 0 4px 16px;
  border-left: 2px solid var(--border-strong);
  color: var(--ink-muted);
  font-style: italic;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
}

.prose table {
  margin: 0 0 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: block;
  overflow-x: auto;
  background: var(--surface);
}

.prose table td,
.prose table th {
  white-space: normal;
}

.prose strong {
  color: var(--ink);
}

.formula-box {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  margin: 22px 0;
  overflow-x: auto;
}

.callout {
  margin: 20px 0;
  padding: 15px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.92rem;
  color: var(--ink-2);
}

.callout.is-warn {
  border-color: var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.callout.is-origin {
  border-color: var(--origin-border);
  background: var(--origin-bg);
}

.callout-title {
  display: block;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.guide-sidebar {
  position: sticky;
  top: 78px;
  display: grid;
  gap: 16px;
}

@media (max-width: 960px) {
  .guide-sidebar {
    position: static;
  }
}

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 0.85rem;
}

.toc-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.toc ol,
.toc ul {
  margin: 0;
  padding-left: 18px;
}

.toc li {
  margin-bottom: 6px;
}

.sidebar-cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.sidebar-cta h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 8px;
  font-size: 1.06rem;
}

.sidebar-cta p {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* ==========================================================================
   Mobile Sticky Bottom Summary Bar
   ========================================================================== */
.mobile-sticky-bar {
  display: none;
}

@media (max-width: 1020px) {
  body.has-calc {
    padding-bottom: 78px;
  }
  .mobile-sticky-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 35;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--sticky-bg);
    color: var(--ink);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-float);
  }
  .mobile-sticky-label {
    font-size: 0.72rem;
    color: var(--ink-muted);
  }
  .mobile-sticky-val {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--sticky-val);
  }
  .mobile-sticky-bar a {
    background: var(--sticky-cta-bg);
    color: var(--sticky-cta-ink);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 36px 0 48px;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin-bottom: 28px;
}

@media (max-width: 820px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.footer-heading {
  display: block;
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
}

.footer-blurb {
  margin: 0 0 12px;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.footer-links a {
  color: var(--ink-muted);
}

.footer-links a:hover {
  color: var(--brand);
}

.footer-promo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin: 0 0 20px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 8px);
  background: var(--surface);
  max-width: 900px;
}

.footer-promo-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.footer-promo-main:hover {
  text-decoration: none;
}

.footer-promo-main:hover strong {
  color: var(--brand);
}

.footer-promo-icon {
  display: block;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.footer-promo-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.footer-promo-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.footer-promo-line {
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ink-2);
}

.footer-promo-line strong {
  color: var(--ink);
  transition: color 0.14s ease;
}

.appstore-badge-link {
  display: block;
  flex-shrink: 0;
  line-height: 0;
  border-radius: 6px;
  transition: opacity 0.14s ease;
}

.appstore-badge-link:hover {
  opacity: 0.85;
  text-decoration: none;
}

.appstore-badge-link img {
  display: block;
  width: 120px;
  height: 35px;
}

@media (max-width: 560px) {
  .footer-promo {
    flex-wrap: wrap;
  }
  .appstore-badge-link {
    margin-left: 52px;
  }
}

.footer-disclaimer {
  margin: 0 0 14px;
  max-width: 900px;
  line-height: 1.6;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.76rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   Print Summary & CPA-Ready Print Working Paper
   ========================================================================== */
.print-only-header,
.print-only,
.print-summary {
  display: none;
}

.print-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 10pt;
  margin-bottom: 6px;
}

.print-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 16px;
  margin: 0 0 6px;
}

.print-summary-grid div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px dotted var(--print-rule);
  padding: 2px 0;
  font-size: 8.5pt;
}

.print-summary-grid dt {
  color: var(--print-muted);
}

.print-summary-grid dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.print-summary-note {
  font-size: 8pt;
  color: var(--print-muted);
  margin: 4px 0 0;
}

@media print {
  @page {
    size: letter;
    margin: 0.55in;
  }

  html,
  body {
    background: var(--print-bg) !important;
    color: var(--print-ink) !important;
    font-size: 10pt;
    padding: 0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .site-header,
  .preset-strip,
  .action-toolbar,
  .waitlist-section,
  .section-block,
  .mobile-sticky-bar,
  details.advanced-drawer,
  .no-print,
  .input-panel,
  .breadcrumbs,
  .hero-eyebrow,
  .hero-sub,
  .related-links,
  .fact-grid,
  .content-section,
  .guide-sidebar,
  .footer-grid,
  .footer-promo,
  .footer-meta,
  .skip-link,
  .btn-swap,
  .action-status,
  .calc-warnings,
  .corridor-banner {
    display: none !important;
  }

  .print-only-header {
    display: block;
    border-bottom: 2px solid var(--print-ink);
    padding-bottom: 8px;
    margin-bottom: 14px;
  }

  .print-only {
    display: block !important;
  }

  .print-summary {
    display: block !important;
    border: 1px solid var(--print-rule);
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 12px;
    break-inside: avoid;
  }

  .hidden {
    display: none !important;
  }

  .container {
    max-width: none;
    padding: 0;
  }

  .hero {
    padding: 0 0 6px;
  }

  h1 {
    font-size: 16pt;
    margin-bottom: 4px;
  }

  .workspace-grid {
    display: block;
  }

  .results-panel,
  .workspace-grid > .panel {
    position: static !important;
    break-inside: auto !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px;
    margin-bottom: 10px;
  }

  .kpi-card {
    padding: 4px 10px 4px 0;
    break-inside: avoid;
  }

  .kpi-value {
    font-size: 13pt;
  }

  .timeline-card,
  .stack-card {
    padding: 0 0 10px;
    margin-bottom: 10px;
    break-inside: avoid;
  }

  .timeline-legend {
    grid-template-columns: 1fr 1fr !important;
  }

  .table-scroll {
    overflow: visible !important;
  }

  .table-scroll table {
    min-width: 0;
  }

  table {
    font-size: 8pt;
  }

  thead {
    display: table-header-group;
  }

  tfoot {
    display: table-row-group;
  }

  thead th,
  tbody td,
  tfoot td {
    padding: 4px 6px;
  }

  tr {
    break-inside: avoid;
  }

  tbody tr:hover {
    background: transparent;
  }

  .insight-box {
    background: var(--print-bg) !important;
    border: 1px solid var(--print-rule) !important;
    color: var(--print-ink);
    font-size: 8.5pt;
    break-inside: avoid;
  }

  .disclaimer-box,
  .footer-disclaimer {
    display: block !important;
    font-size: 8pt;
    color: var(--print-ink);
    border-top: none;
    padding-top: 6px;
  }

  .site-footer {
    border-top: 1px solid var(--print-ink);
    padding: 8px 0 0;
    background: var(--print-bg);
  }

  a {
    color: var(--print-ink);
    text-decoration: none;
  }

  .prose a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: var(--print-muted);
  }
}

/* ==========================================================================
   SEO/GEO INTEGRATION (appended 2026-12-04; additive only)
   Rate tables generated from src/engine/rate-sources.mjs (/methodology/,
   /rsu-withholding-calculator/) and corridor answer / worked-example blocks.
   ========================================================================== */
.table-scroll table.rate-table {
  min-width: 720px;
}

.table-scroll table.rate-table-compact {
  min-width: 560px;
}

.prose table.rate-table {
  display: table;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.rate-table-wrap {
  margin: 0 0 22px;
}

.rate-table caption {
  caption-side: top;
  text-align: left;
  font-size: 0.78rem;
  color: var(--ink-muted);
  padding: 10px 10px 8px;
}

.rate-table thead th,
.rate-table tbody th,
.rate-table tbody td {
  text-align: left;
  vertical-align: top;
  white-space: normal;
}

.rate-table tbody th {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
}

.rate-table tbody td {
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1.45;
}

.rate-table tbody td:first-child {
  border: 0;
  border-bottom: 1px solid var(--border);
}

.rate-table .rate-num {
  font-family: var(--font-mono);
  white-space: nowrap;
}

.rate-table .rate-note {
  display: block;
  margin-top: 4px;
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.answer-block .answer-lede {
  font-size: 1.02rem;
  line-height: 1.6;
}

.answer-block .answer-meta {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* ==========================================================================
   AI-4 QA FIX: in-page anchors (/methodology/#rate-table etc.)
   - The sticky .site-header covered the target heading after a #fragment jump.
   - html{scroll-behavior:smooth} also animated the *initial* fragment scroll on page load
     (a multi-thousand-pixel animation that any input interrupts). Keep smooth scrolling for
     in-page clicks only: a clicked link has focus, a fresh page load does not.
   ========================================================================== */
html {
  scroll-behavior: auto;
}
html:focus-within {
  scroll-behavior: smooth;
}
:where([id]) {
  scroll-margin-top: 88px;
}
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }
}

/* ==========================================================================
   SALE CALCULATOR + STAY-VS-MOVE (appended 2026-12-04; additive only)
   sale-app.js (/rsu-sale-after-moving-calculator/) and move-compare.js
   (#stay-vs-move > #moveCompare on "/" and corridor pages).
   ========================================================================== */
.move-compare-section {
  margin: 0 0 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.move-compare-section > h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.move-compare-section > p {
  max-width: 780px;
  color: var(--ink-2);
}

.move-compare {
  min-width: 0;
}

.mc-lede {
  max-width: 780px;
  color: var(--ink-2);
  font-size: 0.92rem;
  margin: 0 0 16px;
}

.mc-empty {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 16px 18px;
  color: var(--ink-2);
  font-size: 0.9rem;
}

.mc-empty p {
  margin: 4px 0 0;
}

.mc-empty.is-error {
  border-style: solid;
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

.mc-empty ul {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 0.82rem;
}

.mc-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}

.mc-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
}

.mc-card.is-diff {
  background: var(--bg);
}

.mc-label {
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.mc-value {
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin: 4px 0 2px;
  color: var(--ink);
}

.mc-sub {
  font-size: 0.76rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.mc-card.is-diff .mc-sub strong {
  color: var(--ink-2);
}

.mc-lines {
  margin: 10px 0 0;
  display: grid;
  gap: 4px;
  font-size: 0.8rem;
}

.mc-lines > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 4px;
}

.mc-lines dt {
  color: var(--ink-muted);
  min-width: 0;
}

.mc-lines dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}

.mc-caveats {
  margin: 0 0 20px;
  padding: 10px 14px 10px 30px;
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.5;
}

.mc-caveats li + li {
  margin-top: 3px;
}

.mc-block {
  margin: 0 0 22px;
}

.mc-h3,
.sale-h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--ink);
}

.sale-h3-sub {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-muted);
  margin-left: 6px;
}

.mc-note,
.sale-note {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin: 8px 0 0;
  max-width: 780px;
}

.mc-details {
  margin-top: 12px;
  font-size: 0.82rem;
}

.mc-details summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 600;
  margin-bottom: 8px;
}

.mc-year-table tbody td:last-child {
  font-weight: 600;
  color: var(--ink);
}

.mc-model-notes {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.mc-model-notes ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

@media (max-width: 760px) {
  .mc-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Sale calculator ---------------------------------------------------- */
.sale-hold {
  margin: 0 0 22px;
}

.sale-hold-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.sale-hold-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.sale-hold-track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.sale-hold-fill {
  height: 100%;
  background: var(--origin-bar);
}

.sale-hold-fill.is-long {
  background: var(--dest-bar);
}

.sale-hold-dates {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.sale-hold-verdict {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--ink-2);
}

.sale-hold-note {
  margin: 4px 0 0;
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.sale-detail {
  margin: 0 0 22px;
  font-size: 0.88rem;
  color: var(--ink-2);
}

.sale-detail p {
  margin: 0 0 10px;
}

table.sale-kv tbody th {
  text-align: left;
  font-weight: 500;
  font-size: 0.79rem;
  color: var(--ink-2);
  padding: 8px 8px 8px 2px;
  border-bottom: 1px solid var(--border);
  white-space: normal;
}

table.sale-kv tbody td {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

table.sale-kv tr.is-total th,
table.sale-kv tr.is-total td {
  font-weight: 700;
  color: var(--ink);
}

.sale-compare {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.sale-compare .mc-caveats {
  margin-bottom: 0;
}

details.sale-assumptions {
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  padding: 12px 14px;
  font-size: 0.82rem;
}

details.sale-assumptions summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-2);
}

details.sale-assumptions ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

@media print {
  .move-compare-section {
    display: none !important;
  }
  .sale-detail,
  .sale-hold,
  details.sale-assumptions {
    break-inside: avoid;
  }
  details.sale-assumptions > *:not(summary) {
    display: block !important;
  }
  .mc-caveats {
    background: none !important;
  }
}

/* ==========================================================================
   ENGINE-FIX ALIGNMENT (front end): optional engine inputs created by JS inside
   .advanced-drawer, "Unknown" withholding segment, no-result state, model notes.
   ========================================================================== */
.extra-fields {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.extra-fields-title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.extra-fields .field.hidden,
.extra-field-note.hidden {
  display: none;
}

.extra-field-note {
  display: block;
  margin-top: 4px;
}

.stack-seg.unknown,
.swatch.unknown {
  background: repeating-linear-gradient(45deg, var(--border), var(--border) 3px, transparent 3px, transparent 6px);
}

.kpi-strip .result-empty {
  grid-column: 1 / -1;
}

details.engine-notes.hidden {
  display: none;
}

details.engine-notes .engine-notes-head {
  margin: 10px 0 0;
  font-weight: 600;
  color: var(--ink-2);
}

@media print {
  details.engine-notes.hidden {
    display: none !important;
  }
}

/* ==========================================================================
   INTEGRATION: sample app preview label (audit E04), sources block in guides
   ========================================================================== */
.iphone-sample-tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 8px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.iphone-big-label {
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--ink-muted);
}

.iphone-big-label + .iphone-big-num {
  margin-top: 2px;
}

.prose #sources-verified {
  margin-top: 32px;
}

.prose #sources-verified .link-list li,
#sources-verified .link-list li {
  overflow-wrap: anywhere;
}
