/* ============================================================
   Luck Buffer – styles.css
   Aesthetic: Refined financial minimalism
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Mono:wght@400;500&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── Custom Properties ─────────────────────────────────────── */
:root {
  --ink:        #0D1B2A;
  --ink-soft:   #3D4F61;
  --ink-mute:   #7A8E9E;
  --canvas:     #F7F5F0;
  --canvas-alt: #EEEAE2;
  --teal:       #2A9D8F;
  --teal-light: #E8F5F4;
  --teal-dark:  #1E7269;

  /* Runway tier colors */
  --red:        #C0392B;
  --red-bg:     #FAEAE8;
  --amber:      #D4770A;
  --amber-bg:   #FDF3E3;
  --yellow:     #8A7000;
  --yellow-bg:  #FDFAE3;
  --green:      #2D6A4F;
  --green-bg:   #E8F5EE;

  --border:     rgba(13,27,42,0.1);
  --shadow-sm:  0 1px 3px rgba(13,27,42,0.08);
  --shadow-md:  0 4px 16px rgba(13,27,42,0.10);
  --shadow-lg:  0 12px 40px rgba(13,27,42,0.12);

  --radius:     12px;
  --radius-sm:  8px;
  --radius-lg:  20px;

  --ff-display: 'DM Serif Display', Georgia, serif;
  --ff-body:    'DM Sans', system-ui, sans-serif;
  --ff-mono:    'DM Mono', 'Courier New', monospace;

  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  color-scheme: only light;
}

html.dark {
  color-scheme: only dark;
}

body {
  font-family: var(--ff-body);
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Reduced Motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--ff-display); line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }

.mono { font-family: var(--ff-mono); }
.label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ── Layout Primitives ─────────────────────────────────────── */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--wide {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 72px 0;
}

/* ── Progress Bar ───────────────────────────────────────────── */
#progress-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247,245,240,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0;
  display: none;
  transition: background var(--transition), border-color var(--transition);
}

#progress-nav.visible {
  display: block;
}

.progress-track {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 14px 24px;
  max-width: 720px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.progress-track::-webkit-scrollbar { display: none; }

.progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-mute);
  white-space: nowrap;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.progress-step:hover { color: var(--ink); }

.progress-step.active {
  color: var(--teal-dark);
}

.progress-step.done {
  color: var(--teal);
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-family: var(--ff-mono);
  flex-shrink: 0;
  transition: all var(--transition);
}

.progress-step.done .step-num {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
}

.progress-step.active .step-num {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  color: white;
}

.step-divider {
  width: 24px;
  height: 1px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── Hero Section ───────────────────────────────────────────── */
#hero {
  padding: 100px 0 80px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--teal-light);
  color: var(--teal-dark);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 32px;
}

.hero-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--teal);
  border-radius: 50%;
}

#hero h1 {
  max-width: 640px;
  margin: 0 auto 24px;
}

#hero h1 em {
  font-style: italic;
  color: var(--teal-dark);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 480px;
  margin: 0 auto 48px;
  font-weight: 300;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: white;
  font-family: var(--ff-body);
  font-size: 1rem;
  font-weight: 600;
  padding: 16px 36px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 20px rgba(13,27,42,0.2);
  touch-action: manipulation;
}

.cta-button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.cta-button:hover {
  background: var(--teal-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(42,157,143,0.3);
}

.cta-arrow {
  transition: transform var(--transition);
}

.cta-button:hover .cta-arrow {
  transform: translateX(4px);
}

.privacy-chip {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 20px;
  font-size: 0.82rem;
  color: var(--ink-mute);
  line-height: 1.45;
}

.privacy-chip svg {
  opacity: 0.6;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 32px;
}

.card-icon {
  width: 44px;
  height: 44px;
  background: var(--canvas-alt);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}

.card-title-group h2 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.card-title-group p {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ── Form Elements ──────────────────────────────────────────── */
.form-grid {
  display: grid;
  gap: 20px;
}

.form-grid--2 { grid-template-columns: 1fr 1fr; }
.form-grid--3 { grid-template-columns: 1fr 1fr 1fr; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--ink-soft);
}

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

.input-prefix {
  position: absolute;
  left: 14px;
  font-family: var(--ff-mono);
  font-size: 0.9rem;
  color: var(--ink-mute);
  pointer-events: none;
  z-index: 1;
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  font-family: var(--ff-mono);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--canvas);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px 11px 30px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(42,157,143,0.12);
  background: white;
}

input.no-prefix {
  padding-left: 14px;
}

select {
  padding-left: 14px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A8E9E' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.section-divider {
  height: 1px;
  background: var(--canvas-alt);
  margin: 28px 0;
}

/* ── Burn Rate Display ──────────────────────────────────────── */
.burn-rate-display {
  background: var(--canvas-alt);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.burn-rate-display .label { color: var(--ink-soft); }

.burn-amount {
  font-family: var(--ff-mono);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--ink);
  transition: all var(--transition);
}

/* ── Runway Result ──────────────────────────────────────────── */
.runway-result {
  text-align: center;
  padding: 48px 40px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  transition: all var(--transition);
  background: white;
}

.runway-result.tier-red    { border-color: var(--red);    background: var(--red-bg); }
.runway-result.tier-amber  { border-color: var(--amber);  background: var(--amber-bg); }
.runway-result.tier-yellow { border-color: var(--yellow); background: var(--yellow-bg); }
.runway-result.tier-green  { border-color: var(--green);  background: var(--green-bg); }

.runway-number {
  font-family: var(--ff-mono);
  font-size: clamp(3.5rem, 10vw, 6rem);
  font-weight: 500;
  line-height: 1;
  margin: 8px 0;
  transition: all var(--transition);
}

.runway-result.tier-red    .runway-number { color: var(--red); }
.runway-result.tier-amber  .runway-number { color: var(--amber); }
.runway-result.tier-yellow .runway-number { color: var(--yellow); }
.runway-result.tier-green  .runway-number { color: var(--green); }

.runway-unit {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.runway-depletion {
  font-size: 0.88rem;
  color: var(--ink-mute);
  font-family: var(--ff-mono);
}

.runway-placeholder {
  color: var(--ink-mute);
  font-size: 1.05rem;
}

/* ── Sliders ────────────────────────────────────────────────── */
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slider-header label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.label-hint {
  font-weight: 400;
  color: var(--ink-mute);
  font-size: 0.82rem;
}

/* ── Persona Picker ──────────────────────────────────────────── */
.persona-picker {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.persona-picker-label {
  display: block;
  font-size: 0.75rem;
  font-family: var(--ff-mono);
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
}
.persona-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.persona-btn {
  padding: 5px 13px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-family: var(--ff-body);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.persona-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}
.persona-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.persona-desc {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--ink-mute);
  line-height: 1.5;
  min-height: 1.2em;
}

/* ── Share ───────────────────────────────────────────────────── */
.share-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-family: var(--ff-body);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.share-btn:hover {
  color: var(--teal-dark);
  border-color: var(--teal);
  background: var(--teal-light);
}
.share-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-mute);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.share-copy-btn:hover {
  color: var(--teal-dark);
  border-color: var(--teal);
  background: var(--teal-light);
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: var(--canvas);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: var(--ff-body);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.2s, transform 0.2s;
}
.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Shared Result Card ──────────────────────────────────────── */
#shared-result {
  padding: 56px 0 0;
}

.shared-card {
  border-radius: var(--radius-lg);
  padding: 52px 48px 44px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

/* Subtle radial glow for depth */
.shared-card::before {
  content: '';
  position: absolute;
  inset: -40%;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.12) 0%, transparent 65%);
  pointer-events: none;
}

.shared-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  position: relative;
}

.shared-card-brand {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.6;
}

.shared-card-zone-badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 13px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.shared-card-body {
  margin-bottom: 8px;
  position: relative;
}

.shared-card-eyebrow {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.55;
  margin-bottom: 10px;
}

.shared-card-number {
  font-family: var(--ff-display);
  font-size: clamp(5rem, 18vw, 8.5rem);
  font-weight: 400;
  line-height: 1;
  margin-bottom: 10px;
}

.shared-card-unit {
  font-size: 1.05rem;
  font-weight: 400;
  opacity: 0.82;
  margin-bottom: 14px;
}

.shared-card-desc {
  font-size: 0.88rem;
  opacity: 0.65;
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.6;
}

.shared-card-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
  margin: 36px 0 32px;
  position: relative;
}

.shared-card-footer {
  position: relative;
}

.shared-card-prompt {
  font-size: 1rem;
  margin-bottom: 20px;
  opacity: 0.88;
  line-height: 1.5;
}

.shared-card-prompt em { font-style: italic; }

.shared-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 32px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: inherit;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background var(--transition), border-color var(--transition);
}

.shared-card-cta:hover {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Tier background colours */
.tier-bg-critical { background: var(--red);   color: #fff; }
.tier-bg-caution  { background: var(--amber); color: #fff; }
.tier-bg-moderate { background: var(--yellow-bg); color: var(--ink); }
.tier-bg-strong   { background: var(--teal);  color: #fff; }

/* Moderate tier — light background needs dark overlays instead of white-transparent */
.tier-bg-moderate .shared-card-zone-badge {
  background: rgba(0, 0, 0, 0.07);
  border-color: rgba(0, 0, 0, 0.1);
}
.tier-bg-moderate .shared-card-divider { background: rgba(0, 0, 0, 0.1); }
.tier-bg-moderate .shared-card-cta {
  background: rgba(0, 0, 0, 0.07);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--ink);
}
.tier-bg-moderate .shared-card-cta:hover {
  background: rgba(0, 0, 0, 0.13);
}
.shared-card.tier-bg-moderate::before { display: none; }

.slider-value {
  font-family: var(--ff-mono);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--teal-dark);
  min-width: 40px;
  text-align: right;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--canvas-alt);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: background var(--transition);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--teal);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(42,157,143,0.4);
  transition: transform var(--transition);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--teal);
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(42,157,143,0.4);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* ── Toggles ─────────────────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.toggle-row:last-child { border-bottom: none; }

.toggle-label {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.toggle-label strong {
  display: block;
  font-size: 0.9rem;
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 2px;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--canvas-alt);
  border-radius: 100px;
  cursor: pointer;
  transition: background var(--transition);
  border: 1.5px solid var(--border);
}

.toggle-track::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}

.toggle-switch input:checked + .toggle-track {
  background: var(--teal);
  border-color: var(--teal);
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(20px);
}

/* ── Gain Badge ─────────────────────────────────────────────── */
.gain-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(45,106,79,0.2);
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 100px;
  margin-top: 16px;
  transition: all var(--transition);
}

/* ── Scenario Comparison ─────────────────────────────────────── */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.comparison-col {
  text-align: center;
  padding: 24px 16px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--canvas);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.comparison-col--optimized {
  border-color: var(--teal);
  background: var(--teal-light);
}

.comparison-col .runway-number {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  margin: 4px 0;
}

.comparison-col.tier-red    .runway-number { color: var(--red); }
.comparison-col.tier-amber  .runway-number { color: var(--amber); }
.comparison-col.tier-yellow .runway-number { color: var(--yellow); }
.comparison-col--optimized  .runway-number { color: var(--teal-dark); }

.comparison-col-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 8px;
}

.comparison-col--optimized .comparison-col-label {
  color: var(--teal-dark);
}

.delta-badge {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 14px;
  font-family: var(--ff-mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--teal-dark);
}

.delta-badge--negative {
  color: var(--red);
}

.print-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-family: var(--ff-body);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.print-btn:hover {
  color: var(--teal-dark);
  border-color: var(--teal);
  background: var(--teal-light);
}

/* ── Side Income Cards ─────────────────────────────────────── */
.target-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.target-btn {
  background: var(--canvas);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  font-family: var(--ff-body);
  color: var(--ink);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  touch-action: manipulation;
}

.target-btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.target-btn:hover {
  border-color: var(--teal);
}

.target-btn.active {
  background: var(--teal-light);
  border-color: var(--teal);
  color: var(--teal-dark);
}

.target-btn .months {
  font-family: var(--ff-mono);
  font-size: 1.6rem;
  font-weight: 500;
  display: block;
  line-height: 1.2;
  color: var(--ink);
}

.target-btn.active .months { color: var(--teal-dark); }

.target-btn .months-label {
  font-size: 0.78rem;
  color: var(--ink-soft);
  display: block;
  margin-top: 2px;
}

.target-btn.active .months-label { color: var(--teal); }

.income-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.income-stat {
  background: var(--canvas-alt);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}

.income-stat .period {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 8px;
}

.income-stat .amount {
  font-family: var(--ff-mono);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--ink);
  transition: all var(--transition);
}

/* ── Income Gap Options ─────────────────────────────────────── */
.income-options-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 24px 0 10px;
}

.income-options-zero {
  font-size: 0.9rem;
  color: var(--teal);
  font-weight: 500;
  text-align: center;
  padding: 16px 0 4px;
}

.income-options-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gig-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--canvas-alt);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.gig-name {
  flex: 1;
  font-weight: 500;
  color: var(--ink);
  min-width: 0;
}

.gig-meta {
  color: var(--ink-mute);
  font-size: 0.8rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.gig-earnings {
  color: var(--ink-mute);
  font-size: 0.8rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.gig-add-btn {
  flex-shrink: 0;
  padding: 4px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--teal);
  background: transparent;
  border: 1.5px solid var(--teal);
  border-radius: 100px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  line-height: 1.6;
}

.gig-add-btn:hover,
.gig-add-btn:focus-visible {
  background: var(--teal);
  color: #fff;
  outline: none;
}

.gig-add-btn.is-added {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.gig-row.is-active {
  border-left: 3px solid var(--teal);
  padding-left: 9px;
  background: color-mix(in srgb, var(--teal) 8%, var(--canvas-alt));
}

.income-selected-note {
  font-size: 0.8rem;
  color: var(--teal);
  font-weight: 500;
  margin: 0 0 10px;
}

@media (max-width: 767px) {
  .gig-earnings { display: none; }
}

@media (max-width: 520px) {
  .gig-row { flex-wrap: wrap; }
  .gig-meta { font-size: 0.75rem; }
}

/* ── Emergency Plan ─────────────────────────────────────────── */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.tier-badge.red    { background: var(--red-bg);    color: var(--red); }
.tier-badge.amber  { background: var(--amber-bg);  color: var(--amber); }
.tier-badge.yellow { background: var(--yellow-bg); color: var(--yellow); }
.tier-badge.green  { background: var(--green-bg);  color: var(--green); }

.plan-section {
  margin-bottom: 28px;
}

.plan-section h4 {
  font-family: var(--ff-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  margin-bottom: 12px;
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.check-item:hover { background: var(--canvas-alt); }

.check-item:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  border-radius: var(--radius-sm);
}

.check-box {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.check-item.checked .check-box {
  background: var(--teal);
  border-color: var(--teal);
}

.check-item.checked .check-box::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translateY(-1px);
}

.check-item.checked span {
  text-decoration: line-through;
  color: var(--ink-mute);
}

.plan-placeholder {
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-mute);
  font-size: 0.95rem;
}

/* ── Email Report Form ──────────────────────────────────────── */
.email-report-form {
  margin-top: 28px;
  padding: 20px 24px;
  background: var(--teal-light);
  border: 1px solid rgba(42, 157, 143, 0.25);
  border-radius: var(--radius-lg);
}

.email-report-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.email-report-icon {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.email-report-title {
  font-family: var(--ff-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.3;
}

.email-report-desc {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 2px;
}

.email-report-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.email-report-input {
  flex: 1;
  min-width: 0;
  padding: 9px 14px;
  font-size: 0.9rem;
  font-family: var(--ff-body);
  background: #fff;
  border: 1px solid rgba(42, 157, 143, 0.35);
  border-radius: var(--radius-sm);
  color: var(--ink);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  touch-action: manipulation;
}

.email-report-input::placeholder { color: var(--ink-mute); }

.email-report-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.15);
}

.email-report-btn {
  padding: 9px 18px;
  font-size: 0.875rem;
  font-family: var(--ff-body);
  font-weight: 600;
  white-space: nowrap;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  touch-action: manipulation;
}

.email-report-btn:hover:not(:disabled) { background: var(--teal-dark); }

.email-report-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.email-report-btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.email-report-privacy {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--ink-mute);
  line-height: 1.4;
}

.email-report-privacy a {
  color: var(--ink-mute);
  text-decoration: underline;
}

.email-report-privacy a:hover { color: var(--teal-dark); }

.email-report-status {
  margin-top: 10px;
  font-size: 0.875rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.email-report-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.email-report-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

@media (max-width: 480px) {
  .email-report-row {
    flex-direction: column;
  }
  .email-report-btn {
    width: 100%;
    text-align: center;
  }
}

/* ── Privacy Section ────────────────────────────────────────── */
#privacy {
  padding: 48px 0;
}

.privacy-box {
  background: var(--teal-light);
  border: 1px solid rgba(42,157,143,0.2);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.privacy-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.privacy-box h3 {
  font-family: var(--ff-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--teal-dark);
  margin-bottom: 8px;
}

.privacy-box p {
  font-size: 0.88rem;
  color: var(--teal-dark);
  opacity: 0.85;
  line-height: 1.6;
}

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  text-align: center;
}

.footer-tagline {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin-bottom: 16px;
  text-wrap: balance;
}
.footer-tagline + .footer-tagline {
  margin-top: 36px;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  font-size: 0.82rem;
  color: var(--ink-mute);
}

.footer-divider { color: var(--border); }

/* ── Monetization CTA ───────────────────────────────────────── */
.cta-card {
  background: var(--ink);
  color: white;
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  margin-top: 48px;
}

.cta-card h3 {
  font-family: var(--ff-body);
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.6;
  margin-bottom: 8px;
}

.cta-card p {
  font-size: 1.15rem;
  margin-bottom: 24px;
  font-weight: 300;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 100px;
  text-decoration: none;
  transition: all var(--transition);
}

.cta-secondary:hover {
  background: var(--teal);
  color: white;
}

.price-chip {
  background: var(--teal);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
}

/* ── Utility ────────────────────────────────────────────────── */
.hidden { display: none !important; }

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.gap-4 { gap: 16px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .card { padding: 24px 20px; }
  .form-grid--2 { grid-template-columns: 1fr; }
  .form-grid--3 { grid-template-columns: 1fr; }
  .income-breakdown { grid-template-columns: 1fr; }
  .target-selector { grid-template-columns: repeat(3, 1fr); }
  .burn-rate-display { flex-direction: column; align-items: flex-start; }
  .privacy-box { flex-direction: column; padding: 24px; }
  section { padding: 48px 0; }
  #shared-result { padding: 32px 0 0; }
  .shared-card { padding: 36px 24px 32px; }
  .shared-card-header { margin-bottom: 28px; }
  .comparison-grid { grid-template-columns: 1fr; }

  /* Footer links wrap on mobile instead of overflowing */
  .footer-links { flex-wrap: wrap; gap: 8px 12px; }

  /* Glossary / calculator pages: collapse 2-column layout */
  .glossary-layout { grid-template-columns: 1fr; gap: 32px; }
  .glossary-sidebar { position: static; top: auto; }
  .glossary-page { padding: 32px 0 56px; }
}

/* ── Clear Storage ───────────────────────────────────────────── */
.clear-storage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--canvas-alt);
  flex-wrap: wrap;
}

.clear-storage-hint {
  font-size: 0.8rem;
  color: var(--ink-mute);
}

.clear-storage-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  background: var(--canvas);
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  min-height: 36px;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.clear-storage-btn svg { flex-shrink: 0; opacity: 0.65; transition: opacity var(--transition); }
.clear-storage-btn:hover {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fca5a5;
}
.clear-storage-btn:hover svg { opacity: 1; }
.clear-storage-btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.clear-storage-btn:hover {
  color: var(--red);
  border-color: var(--red);
}

.clear-storage-btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* ── About Tool ─────────────────────────────────────────────── */
#about-tool {
  padding: 48px 0;
  border-bottom: 1px solid var(--canvas-alt);
}

#about-tool h2 {
  font-family: var(--ff-body);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
}

#about-tool p {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.75;
  max-width: 640px;
}

/* ── FAQ ─────────────────────────────────────────────────────── */
#faq h2 {
  margin-bottom: 24px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  border: 1px solid var(--canvas-alt);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

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

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--teal);
  flex-shrink: 0;
  line-height: 1;
}

.faq-item[open] summary {
  background: var(--canvas-alt);
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item p {
  margin: 0;
  padding: 4px 20px 18px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* ── Footer links ────────────────────────────────────────────── */
.footer-link {
  color: var(--ink-mute);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-link:hover {
  color: var(--teal);
}

/* ── Dark Mode (optional toggle) ───────────────────────────── */
.dark {
  --ink:        #E8E4DC;
  --ink-soft:   #A8B8C8;
  --ink-mute:   #687888;
  --canvas:     #0D1B2A;
  --canvas-alt: #152233;
  --teal-light: rgba(42,157,143,0.12);
  --border:     rgba(232,228,220,0.1);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.4);
}

.dark body, .dark .card, .dark input[type="number"],
.dark input[type="text"], .dark select {
  background: var(--canvas);
  color: var(--ink);
}

.dark .card {
  background: var(--canvas-alt);
}

.dark .runway-result {
  background: var(--canvas-alt);
}

/* var(--ink) inverts in dark mode — fix elements that use it as a background */
.dark .cta-button {
  background: var(--teal);
}

.dark .cta-card {
  background: var(--canvas-alt);
  color: var(--ink);
}

.dark .cta-card h3 {
  opacity: 0.75;
}

/* Active target btn: teal-light is nearly invisible on dark canvas; teal-dark is dark on dark */
.dark .target-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
}

.dark .target-btn.active .months-label {
  color: rgba(255, 255, 255, 0.75);
}

/* "Get the Playbook" button: white bg + light ink text both flip in dark mode */
.dark .cta-secondary {
  background: var(--teal);
  color: white;
}

.dark .cta-secondary:hover {
  background: var(--teal-dark);
  color: white;
}

.dark .price-chip {
  background: rgba(255, 255, 255, 0.15);
}

/* Moderate tier shared card: --yellow-bg stays light but --ink becomes cream in dark mode */
.dark .shared-card.tier-bg-moderate {
  background: #2A2410;
  color: #F5EFC8;
  border: none;
}
.dark .shared-card.tier-bg-moderate .shared-card-zone-badge {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}
.dark .shared-card.tier-bg-moderate .shared-card-divider {
  background: rgba(255, 255, 255, 0.12);
}
.dark .shared-card.tier-bg-moderate .shared-card-cta {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  color: #F5EFC8;
}
.dark .shared-card.tier-bg-moderate .shared-card-cta:hover {
  background: rgba(255, 255, 255, 0.2);
}
.dark .shared-card.tier-bg-moderate::before {
  display: block;
}

.dark .comparison-col {
  background: var(--canvas-alt);
}

.dark .comparison-col--optimized {
  background: rgba(42, 157, 143, 0.12);
}

/* ── Dark mode toggle button ────────────────────────────────── */
#dark-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--canvas);
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
  z-index: 200;
}

#dark-toggle:hover {
  transform: scale(1.1);
}

#dark-toggle:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

input[type="range"]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Glossary ────────────────────────────────────────────────── */
.glossary-breadcrumb {
  padding: 14px 0;
  border-bottom: 1px solid var(--canvas-alt);
  font-size: 0.8rem;
  color: var(--ink-mute);
}

.glossary-breadcrumb nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.glossary-breadcrumb a { color: var(--ink-mute); text-decoration: none; }
.glossary-breadcrumb a:hover { color: var(--teal); }

.glossary-page { padding: 56px 0 80px; }

.glossary-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 56px;
  align-items: start;
}

.glossary-main h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 24px;
}

.glossary-callout {
  background: var(--teal-light);
  border-left: 4px solid var(--teal);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 18px 22px;
  margin-bottom: 36px;
  font-size: 1.02rem;
  color: var(--ink);
  line-height: 1.65;
}

.glossary-callout strong { color: var(--teal-dark); }

.glossary-main h2 {
  font-family: var(--ff-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 32px 0 10px;
}

.glossary-main p {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.8;
  margin-bottom: 14px;
}

.glossary-main ul {
  margin: 0 0 14px 20px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.8;
}

.glossary-example {
  background: var(--canvas-alt);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 28px 0;
}

.glossary-example h3 {
  font-family: var(--ff-body);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-mute);
  margin-bottom: 12px;
}

.glossary-example p {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.75;
  margin-bottom: 0;
}

.glossary-example .example-math {
  font-family: var(--ff-mono);
  font-size: 0.88rem;
  color: var(--teal-dark);
  margin: 10px 0 6px;
}

.glossary-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 80px;
}

.related-terms {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.related-terms h3 {
  font-family: var(--ff-body);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-mute);
  margin-bottom: 14px;
}

.related-terms ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.related-terms li a {
  font-size: 0.9rem;
  color: var(--teal-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition);
}

.related-terms li a::before {
  content: '→';
  font-size: 0.8rem;
  opacity: 0.6;
}

.related-terms li a:hover { color: var(--teal); }

.glossary-cta-box {
  background: var(--ink);
  color: white;
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
}

.glossary-cta-box p {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.55;
  margin-bottom: 8px;
}

.glossary-cta-box h3 {
  font-family: var(--ff-body);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 20px;
  line-height: 1.4;
}

.glossary-cta-box .cta-button {
  width: 100%;
  justify-content: center;
  font-size: 0.9rem;
  padding: 12px 20px;
}

/* Glossary index page */
.glossary-index-intro {
  max-width: 600px;
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.7;
  margin: 16px 0 48px;
}

.glossary-index-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.glossary-index-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.glossary-index-item:hover { background: var(--canvas-alt); }

.glossary-index-item a {
  font-size: 1rem;
  font-weight: 600;
  color: var(--teal-dark);
  text-decoration: none;
  white-space: nowrap;
  min-width: 200px;
  transition: color var(--transition);
}

.glossary-index-item a:hover { color: var(--teal); }

.glossary-index-item .term-def {
  font-size: 0.88rem;
  color: var(--ink-mute);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .glossary-layout { grid-template-columns: 1fr; gap: 40px; }
  .glossary-sidebar { position: static; }
  .glossary-index-item { flex-direction: column; gap: 4px; }
  .glossary-index-item a { min-width: auto; }
}

/* Dark mode — glossary */
.dark .related-terms { background: var(--canvas-alt); }
.dark .glossary-cta-box { background: var(--canvas-alt); border: 1px solid var(--border); }

/* ── Term tooltips (glossary ⓘ icons) ───────────────────────── */
.term-tip {
  display: inline-flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0 0 0 5px;
  color: var(--ink-mute);
  font: inherit;
  line-height: 1;
  vertical-align: middle;
}
.term-tip svg { width: 13px; height: 13px; flex-shrink: 0; }
.term-tip__popup {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 230px;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  text-align: left;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 200;
  white-space: normal;
}
.term-tip:hover .term-tip__popup,
.term-tip:focus-within .term-tip__popup,
.term-tip.is-open .term-tip__popup { opacity: 1; pointer-events: auto; }
.term-tip__name { display: block; font-weight: 600; margin-bottom: 3px; color: var(--ink); }
.term-tip__def { display: block; color: var(--ink-soft); line-height: 1.5; margin-bottom: 6px; }
.term-tip__link { color: var(--teal); }
.dark .term-tip__popup { box-shadow: 0 4px 16px rgba(0,0,0,0.4); }

/* ── Calculator Pages ───────────────────────────────────────── */
.calc-benchmark {
  margin: 20px 0 28px;
  overflow-x: auto;
}

.calc-benchmark table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.calc-benchmark th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--border);
}

.calc-benchmark td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-soft);
  vertical-align: middle;
}

.benchmark-row:last-child td {
  border-bottom: none;
}

.benchmark-median td {
  color: var(--ink);
  background: var(--canvas-alt);
}

.benchmark-months {
  font-family: var(--ff-mono);
  font-weight: 500;
  white-space: nowrap;
}

.benchmark-median .benchmark-months {
  color: var(--teal-dark);
}

.calc-benchmark-source {
  font-size: 0.75rem;
  color: var(--ink-mute);
  margin-top: 8px;
  padding-left: 2px;
}

.calc-listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.calc-listing-card {
  display: flex;
  flex-direction: column;
  background: var(--canvas-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.calc-listing-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--teal);
}

.calc-listing-amount {
  font-family: var(--ff-mono);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
}

.calc-listing-months {
  font-size: 0.8rem;
  color: var(--ink-mute);
}

/* ── Print ───────────────────────────────────────────────────── */
@media print {
  #progress-nav, .hero-wrapper, #hero, #about-tool,
  #snapshot, #side-income, #plan, #faq,
  footer, #dark-toggle, #shared-result { display: none !important; }

  body, html { background: white !important; color: black !important; }

  .card { box-shadow: none !important; }

  /* Hide simulator controls — print only shows the comparison result */
  .slider-group, .toggle-row, .section-divider { display: none !important; }

  /* Force two columns even if mobile viewport */
  .comparison-grid { grid-template-columns: 1fr 1fr !important; }

  .comparison-col { background: white !important; }
  .comparison-col--optimized { background: #E8F5F4 !important; border-color: #2A9D8F !important; }

  /* Hide interactive elements; keep comparison content visible */
  .share-row { display: none !important; }
}

/* ── F2: Timeline Visualization ──────────────────────────────── */
.timeline-wrap {
  margin: 20px 0 4px;
  animation: timeline-fade-in 0.4s ease-out;
}

@keyframes timeline-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.timeline-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  margin-bottom: 6px;
}

.timeline-svg {
  width: 100%;
  display: block;
  overflow: visible;
}

.timeline-area {
  opacity: 1;
}

.timeline-area--ghost {
  opacity: 0.5;
}

.timeline-line {
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.timeline-line--ghost {
  stroke: var(--ink-mute);
  stroke-width: 1.2;
  stroke-dasharray: 4 3;
}

.timeline-threshold {
  stroke: var(--ink-mute);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: 0.45;
}

.timeline-threshold-lbl {
  font-size: 9px;
  fill: var(--ink-mute);
  text-anchor: end;
  font-family: var(--ff-mono);
}

.timeline-axis {
  stroke: var(--border);
  stroke-width: 1;
}

.timeline-tick {
  stroke: var(--border);
  stroke-width: 1;
}

.timeline-tick-lbl {
  font-size: 10px;
  fill: var(--ink-mute);
  text-anchor: middle;
  font-family: var(--ff-mono);
}

.timeline-y-lbl {
  font-size: 9px;
  fill: var(--ink-mute);
  text-anchor: end;
  font-family: var(--ff-mono);
}

.timeline-hit {
  cursor: default;
}

/* ── Blog / Guides Content Hub ───────────────────────────────── */

/* Hub listing cards (blog.html) */
.blog-index-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 36px;
}

.blog-card {
  display: block;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}

.blog-card:first-child { border-top: 1px solid var(--border); }

.blog-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
  line-height: 1.4;
  transition: color 0.15s;
}

.blog-card:hover .blog-card-title { color: var(--teal); }

.blog-meta {
  font-size: 0.78rem;
  color: var(--ink-mute);
  font-family: var(--ff-mono);
  margin-bottom: 6px;
}

.blog-excerpt {
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0;
}

.blog-tier-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--teal);
  border: 1px solid var(--teal);
  border-radius: 4px;
  padding: 1px 6px;
  margin-bottom: 6px;
}

/* Article typography override */
.blog-main {
  font-size: 1rem;
  line-height: 1.8;
}

.blog-main h1 {
  font-family: var(--ff-display);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  line-height: 1.2;
  margin-bottom: 12px;
}

.blog-main h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 36px 0 12px;
  color: var(--ink);
}

.blog-main h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 24px 0 8px;
  color: var(--ink);
}

.blog-main p { margin-bottom: 16px; }

.blog-main ul,
.blog-main ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

.blog-main li { margin-bottom: 6px; line-height: 1.7; }

.blog-main a { color: var(--teal); text-decoration: underline; text-underline-offset: 2px; }

/* Inline CTA box within article body */
.article-cta-box {
  background: var(--canvas-alt);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 28px 0;
}

.article-cta-box p {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--teal);
  margin: 0 0 4px;
}

.article-cta-box h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--ink);
}

.article-cta-box .cta-button {
  display: inline-block;
  background: var(--teal);
  color: #fff;
  padding: 9px 20px;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}

.article-cta-box .cta-button:hover { background: var(--teal-dark); }

/* ── F14c: Playbook CTA ──────────────────────────────────────── */
.playbook-cta {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--canvas-alt);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 24px 0;
}
.playbook-cta-text { flex: 1; }
.playbook-cta-headline {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
}
.playbook-cta-sub {
  font-size: 0.875rem;
  color: var(--ink-mute);
  margin: 0;
  line-height: 1.5;
}
.playbook-cta-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.playbook-cta-trust {
  font-size: 0.75rem;
  color: var(--ink-mute);
  margin: 0;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .playbook-cta { flex-direction: column; align-items: flex-start; }
  .playbook-cta-action { align-items: stretch; width: 100%; }
  .playbook-buy-btn { width: 100%; text-align: center; }
}

/* Related articles section */
.related-articles {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.related-articles h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--ink-mute);
  margin-bottom: 12px;
}

.related-articles ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.related-articles li a {
  color: var(--teal);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.related-articles li a:hover { text-decoration: underline; }

/* ── Extra-small screens: progress nav ──────────────────────── */
/* On phones <520px the 4-step nav overflows even with overflow-x:auto.
   Hide text labels so all 4 numbered circles + dividers fit (~240px). */
@media (max-width: 520px) {
  .progress-step span { display: none; }
  .progress-track { justify-content: center; }
  .share-label { display: none; }
}

/* ── F18: Job Search Duration Integrator ────────────────────── */
.js-search-section {
  margin-top: 4px;
}
.js-search-header { margin-bottom: 16px; }
.js-search-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.js-optional-badge {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-mute);
  background: var(--canvas-alt);
  border-radius: 99px;
  padding: 1px 8px;
  letter-spacing: 0.01em;
}
.js-search-desc {
  font-size: 0.82rem;
  color: var(--ink-mute);
  margin: 0;
}

/* select input */
#job-field {
  font-family: var(--ff-body);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--canvas-alt);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  width: 100%;
  cursor: pointer;
  transition: border-color var(--transition);
}
#job-field:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-color: var(--teal);
}

/* result block */
.js-result {
  background: var(--teal-light);
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 16px;
}
.js-summary {
  font-size: 0.875rem;
  color: var(--ink);
  margin: 0 0 14px;
  line-height: 1.5;
}

/* horizontal bar comparison */
.js-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.js-bar-row {
  display: grid;
  grid-template-columns: 88px 1fr 36px;
  align-items: center;
  gap: 8px;
}
.js-bar-label {
  font-size: 0.75rem;
  color: var(--ink-mute);
  white-space: nowrap;
}
.js-bar-track {
  background: rgba(0,0,0,0.07);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}
.js-bar {
  height: 100%;
  border-radius: 99px;
  transition: width 0.35s ease;
}
.js-bar--runway  { background: var(--teal); }
.js-bar--median  { background: #f59e0b; }
.js-bar--p75     { background: #f87171; }
.js-bar-val {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-mute);
  text-align: right;
}

/* verdict */
.js-verdict {
  font-size: 0.82rem;
  font-weight: 500;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  line-height: 1.45;
}
.js-verdict--ok   { background: var(--green-bg); color: var(--green); }
.js-verdict--warn { background: #fff8e6; color: #92400e; }
.js-verdict--alert { background: #fde8e8; color: #b91c1c; }

/* timeline job search marker */
.js-marker { pointer-events: none; }
.js-range   { pointer-events: none; }

/* ── Safe-area insets (notched phones) ───────────────────────── */
@supports (padding: env(safe-area-inset-left)) {
  .container,
  .container--wide {
    padding-left:  max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
  }
  footer {
    padding-bottom: max(48px, calc(48px + env(safe-area-inset-bottom)));
  }
}
