/* ========================================================================
   DEPLOY PATH: /css/PvS_style.css
   Tepuy Solutions — Property vs Shares calculator — complete styles (dark/light theme)
   Version: 2026-03-31 (headers added)
   Notes: Self-contained. Only load on property_vs_shares.html.
   ======================================================================== */

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

/* ── DARK THEME (default) ────────────────────────────────── */
:root {
  --bg-base:        #0d0f14;
  --bg-surface:     #13161e;
  --bg-raised:      #1a1e2a;
  --bg-input:       #1f2330;
  --bg-hover:       #252a38;
  --border:         #2a2f3f;
  --border-focus:   #c9a84c;
  --text-primary:   #eef0f5;
  --text-secondary: #9aa0b2;
  --text-muted:     #8c94aa;
  --shadow-sm:      0 1px 4px rgba(0,0,0,.45);
  --shadow-md:      0 4px 20px rgba(0,0,0,.55);
  --shadow-lg:      0 8px 40px rgba(0,0,0,.65);
  --shadow-gold:    0 0 24px rgba(201,168,76,.18);
}

/* ── LIGHT THEME ─────────────────────────────────────────── */
[data-theme="light"] {
  --bg-base:        #f4f5f8;
  --bg-surface:     #ffffff;
  --bg-raised:      #f0f1f5;
  --bg-input:       #f7f8fb;
  --bg-hover:       #eaecf2;
  --border:         #d8dce8;
  --border-focus:   #b8922e;
  --success:        #2d8a4e;
  --text-primary:   #0f1118;
  --text-secondary: #2c3248;
  --text-muted:     #505870;
  --shadow-sm:      0 1px 4px rgba(0,0,0,.08);
  --shadow-md:      0 4px 20px rgba(0,0,0,.10);
  --shadow-lg:      0 8px 40px rgba(0,0,0,.12);
  --shadow-gold:    0 0 24px rgba(184,146,46,.15);
}

/* ── SHARED TOKENS (same in both modes) ──────────────────── */
:root, [data-theme="light"] {
  --gold:       #c9a84c;
  --gold-light: #e8c96a;
  --gold-dim:   #8a6f30;

  --property:     #4e8ef7;
  --property-dim: #1e3a6e;
  --shares:       #4ecb71;
  --shares-dim:   #1a4a2a;

  --success: #4ecb71;
  --warning: #f5a623;
  --danger:  #e05555;
  --success: #4cba72;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --transition: all .18s cubic-bezier(.4,0,.2,1);
}

/* Light mode adjustments for coloured tokens */
[data-theme="light"] {
  --property-dim: #c8deff;
  --shares-dim:   #c5f0d4;
}

/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .25s, color .25s;
}

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ── LAYOUT ──────────────────────────────────────────────── */
.app-shell { display: grid; grid-template-rows: auto 1fr; min-height: 100vh; }
/* Line 96 - Replace existing line */
.main-content { display: grid; grid-template-columns: 360px 1fr; min-height: calc(100vh - 60px); }


/* ── HEADER ──────────────────────────────────────────────── */
header {
  height: 60px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
  color: var(--gold);
  white-space: nowrap;
}
.logo span {
  color: var(--text-muted);
  font-size: .78rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  margin-left: 10px;
  letter-spacing: .01em;
}

.header-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  font-family: 'DM Mono', monospace;
  font-size: .6rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.badge-gold  { color: var(--gold);     border-color: var(--gold-dim);    background: rgba(201,168,76,.07); }
.badge-blue  { color: var(--property); border-color: var(--property-dim);background: rgba(78,142,247,.07); }
.badge-green { color: var(--shares);   border-color: var(--shares-dim);  background: rgba(78,203,113,.07); }

/* ── CALCULATOR HERO DESCRIPTION ───────────────────────────── */
.calc-hero {
  background: linear-gradient(135deg, rgba(201,168,76,.04), rgba(78,142,247,.03));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.calc-hero-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem;
  color: var(--gold-light);
  margin-bottom: 8px;
  line-height: 1.3;
}
.calc-hero-desc {
  font-size: .88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 900px;
}
.calc-hero-desc strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Desktop: Show results panel version, hide mobile version */
.calc-hero-mobile {
  display: none;
}
.calc-hero-desktop {
  display: block;
}

/* Mobile: Show mobile version at top, hide desktop version in results */
@media (max-width: 768px) {
  .calc-hero-mobile {
    display: block;
    margin: 0;
    padding: 14px 16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
  }
  
  .calc-hero-desktop {
    display: none;
  }
  
  .calc-hero {
    padding: 14px 16px;
    margin-bottom: 16px;
  }
  
  .calc-hero-title {
    font-size: .95rem;
    margin-bottom: 6px;
  }
  .calc-hero-desc {
    font-size: .75rem;
    line-height: 1.6;
  }
}

@media (max-width: 480px) {
  .calc-hero-mobile {
    padding: 12px 14px;
  }
  
  .calc-hero-title {
    font-size: .88rem;
  }
  .calc-hero-desc {
    font-size: .72rem;
  }
}

/* ── THEME TOGGLE ────────────────────────────────────────── */
.theme-toggle {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 12px 5px 8px;
  transition: var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--gold-dim); }
.theme-toggle-icon { font-size: 1rem; line-height: 1; }
.theme-toggle-label {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  height: calc(100vh - 60px);
  position: sticky;
  top: 60px;
}
.sidebar-inner { padding: 16px; }

/* ── ACCORDION ───────────────────────────────────────────── */
.section {
  margin-bottom: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color .15s;
}
.section:hover { border-color: var(--border-focus); }

.section-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  cursor: pointer;
  background: var(--bg-raised);
  user-select: none;
  transition: var(--transition);
}
.section-header:hover { background: var(--bg-hover); }

.section-icon {
  width: 26px; height: 26px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  font-weight: 500;
  flex-shrink: 0;
  font-style: normal;
  line-height: 1;
  letter-spacing: 0;
}
.icon-property   { background: rgba(78,142,247,.15); }
.icon-loan       { background: rgba(120,80,200,.15); }
.icon-investor   { background: rgba(240,160,50,.12); }
.icon-shares     { background: rgba(78,203,113,.12); }
.icon-advanced   { background: rgba(200,80,80,.12); }
.icon-mc         { background: rgba(100,180,220,.12); }
.icon-offset     { background: rgba(80,180,220,.12); }
.icon-dr         { background: rgba(240,100,180,.10); }

.section-title {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  flex: 1;
}
.section-chevron { color: var(--text-muted); font-size: .65rem; transition: transform .2s; }
.section.open .section-chevron { transform: rotate(180deg); }

.section-body {
  display: none;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  animation: slideDown .15s ease;
}
.section.open .section-body { display: block; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── FORM CONTROLS ───────────────────────────────────────── */
.field { margin-bottom: 10px; }
.field:last-child { margin-bottom: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

label {
  display: block;
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
label .hint {
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 4px;
  font-size: .65rem;
}

.input-wrap { position: relative; display: flex; align-items: center; }
.input-prefix, .input-suffix {
  position: absolute;
  font-family: 'DM Mono', monospace;
  font-size: .72rem;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}
.input-prefix { left: 9px; }
.input-suffix { right: 9px; }

input[type="number"], input[type="text"], select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'DM Mono', monospace;
  font-size: .78rem;
  padding: 7px 9px;
  outline: none;
  transition: var(--transition);
  appearance: none;
}
input[type="number"]:focus, input[type="text"]:focus, select:focus {
  border-color: var(--gold);
  background: var(--bg-hover);
  box-shadow: 0 0 0 3px rgba(201,168,76,.08);
}
.has-prefix input { padding-left: 20px; }
.has-suffix input { padding-right: 26px; }

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235a6070'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 26px;
}
[data-theme="light"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238890a8'/%3E%3C/svg%3E");
}

/* Range */
.range-wrap { display: flex; align-items: center; gap: 8px; }
input[type="range"] {
  flex: 1; -webkit-appearance: none;
  height: 3px; background: var(--border); border-radius: 99px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  background: var(--gold); border-radius: 50%; cursor: pointer;
  box-shadow: 0 0 6px rgba(201,168,76,.35);
}
.range-val { font-family: 'DM Mono', monospace; font-size: .72rem; color: var(--gold); min-width: 36px; text-align: right; }

/* Toggle switch */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 0;
}
.toggle-label { font-size: .72rem; color: var(--text-secondary); font-weight: 500; }
.toggle { position: relative; width: 34px; height: 18px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 99px; cursor: pointer; transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute; width: 12px; height: 12px; left: 2px; top: 2px;
  background: var(--text-muted); border-radius: 50%; transition: var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--gold-dim); border-color: var(--gold); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); background: var(--gold); }

/* Radio group */
.radio-group {
  display: flex; gap: 3px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.radio-group label {
  flex: 1; text-align: center;
  padding: 4px 5px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .66rem; font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .03em; text-transform: uppercase;
  margin: 0; transition: var(--transition);
}
.radio-group input[type="radio"] { display: none; }
.radio-group input[type="radio"]:checked + label {
  background: var(--bg-raised); color: var(--gold);
  box-shadow: var(--shadow-sm);
}

/* ── CALCULATE BUTTON ────────────────────────────────────── */
.btn-calculate {
  width: 100%; margin-top: 14px;
  padding: 12px;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  border: none; border-radius: var(--radius-md);
  color: #0d0f14;
  font-family: 'DM Sans', sans-serif;
  font-size: .88rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  cursor: pointer; transition: var(--transition);
  box-shadow: var(--shadow-gold);
}
.btn-calculate:hover { transform: translateY(-1px); box-shadow: 0 0 32px rgba(201,168,76,.35); }
.btn-calculate:active { transform: translateY(0); }

.btn-secondary {
  flex: 1; padding: 8px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: .72rem; font-weight: 500;
  cursor: pointer; transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--gold-dim); color: var(--gold); }
.btn-row { display: flex; gap: 8px; margin-top: 8px; }

/* ── SUMMARY BAR ─────────────────────────────────────────── */
.summary-bar {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-top: 8px;
}
.summary-bar-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 2px 0;
}
.summary-bar-key { font-size: .74rem; color: var(--text-secondary); }
.summary-bar-val { font-family: 'DM Mono', monospace; font-size: .72rem; color: var(--text-secondary); }
.summary-bar-val.gold { color: var(--gold); }

/* ── RESULTS PANEL ───────────────────────────────────────── */
.results-panel { padding: 20px; overflow-y: auto; }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; min-height: 400px; text-align: center; gap: 14px; color: var(--text-muted);
}
.empty-icon { font-size: 3.2rem; opacity: .18; font-weight: 200; letter-spacing: -.05em; }
.empty-title { font-family: 'DM Serif Display', serif; font-size: 1.35rem; color: var(--text-secondary); }
.empty-sub { font-size: .82rem; max-width: 340px; line-height: 1.75; }

/* ── WINNER BANNER ───────────────────────────────────────── */
.winner-banner {
  background: linear-gradient(135deg, rgba(201,168,76,.07), rgba(201,168,76,.02));
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 16px;
  position: relative;
  z-index: 10;
}
.winner-trophy { font-size: 1.75rem; flex-shrink: 0; }
.winner-text { flex: 1; min-width: 0; }
.winner-title { font-family: 'DM Serif Display', serif; font-size: 1.15rem; color: var(--gold); line-height: 1.3; word-wrap: break-word; }
.winner-detail { font-size: .82rem; color: var(--text-primary); opacity: .82; margin-top: 4px; line-height: 1.5; word-wrap: break-word; overflow-wrap: break-word; }

@media (max-width: 768px) {
  .winner-banner {
    padding: 12px 14px;
    gap: 10px;
  }
  .winner-trophy {
    font-size: 1.4rem;
  }
  .winner-title {
    font-size: 1rem;
  }
  .winner-detail {
    font-size: .75rem;
    line-height: 1.6;
  }
}

/* ── KPI GRID ────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: var(--transition);
  min-height: 90px;
  display: flex;
  flex-direction: column;
}
.kpi-card:hover { border-color: var(--border-focus); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.kpi-card-delta {
  background: linear-gradient(135deg, rgba(201,168,76,.07), rgba(201,168,76,.02));
  border-color: var(--gold-dim) !important;
  grid-column: span 2;
  min-height: 90px;
}
.kpi-card-delta:hover { border-color: var(--gold) !important; box-shadow: var(--shadow-gold); }
.kpi-label { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 6px; }
.kpi-value { font-family: 'DM Mono', monospace; font-size: 1.35rem; font-weight: 500; line-height: 1; margin-bottom: 5px; flex-grow: 1; }
.kpi-value.property { color: var(--property); }
.kpi-value.shares   { color: var(--shares); }
.kpi-value.gold     { color: var(--gold); }
.kpi-sub { font-size: .72rem; color: var(--text-secondary); font-family: 'DM Mono', monospace; line-height: 1.45; }

@media (max-width: 1100px) { 
  .kpi-grid { grid-template-columns: repeat(2, 1fr); } 
  .kpi-card-delta { grid-column: span 2; }
}
@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card-delta { grid-column: span 1; }
  .kpi-card { min-height: 80px; padding: 12px; }
}

/* ── TABS ────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 2px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tab {
  flex: 1; padding: 7px 10px;
  border: none; background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: .68rem; font-weight: 600;
  letter-spacing: .03em; text-transform: uppercase;
  cursor: pointer; transition: var(--transition);
  white-space: nowrap;
}
.tab:hover { color: var(--text-secondary); }
.tab.active { background: var(--bg-raised); color: var(--gold); box-shadow: var(--shadow-sm); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── CHART CARDS ─────────────────────────────────────────── */
.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
}
.chart-title {
  font-size: .7rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 7px;
}
/* Chart.js with maintainAspectRatio:false fills its container height.
   Wrap the canvas in a div capped at 85vh so charts never dominate the screen. */
.chart-wrap {
  position: relative;
  height: min(360px, 62vh); /* comfortable default; never taller than 62vh */
  max-height: 62vh;
  width: 100%;
}
canvas { width: 100% !important; height: 100% !important; }

/* ── MC STATS ────────────────────────────────────────────── */
.mc-stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-top: 14px;
}
.mc-stat {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 11px; text-align: center;
}
.mc-stat-label { font-size: .65rem; color: var(--text-secondary); letter-spacing: .05em; text-transform: uppercase; margin-bottom: 5px; }
.mc-stat-val { font-family: 'DM Mono', monospace; font-size: .95rem; font-weight: 500; }

/* MC methodology note */
.mc-note {
  margin-top: 10px;
  font-size: .68rem;
  color: var(--text-muted);
  padding: 8px 10px;
  background: var(--bg-raised);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--gold-dim);
  line-height: 1.6;
}
.mc-note strong { color: var(--gold); }

/* ── TABLE ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; font-family: 'DM Mono', monospace; font-size: .7rem; }
thead th {
  background: var(--bg-raised); padding: 9px 11px;
  text-align: right; font-size: .66rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--text-secondary);
  border-bottom: 1px solid var(--border); white-space: nowrap; position: relative;
}
thead th:first-child { text-align: left; }

/* Section header row spans property / shares column groups */
.section-header-prop,
.section-header-shares,
.section-header-exit {
  text-align: center !important; font-size: .65rem;
  padding: 6px 10px; letter-spacing: .06em; border-bottom: 2px solid transparent;
}
.section-header-prop   { color: var(--property) !important; border-bottom-color: var(--property); background: rgba(78,142,247,.07) !important; }
.section-header-shares { color: var(--shares)   !important; border-bottom-color: var(--shares);   background: rgba(78,203,113,.07) !important; }
.section-header-exit   { color: var(--warning)  !important; border-bottom-color: var(--warning);  background: rgba(245,166,35,.07) !important; }

/* Tooltip icon inside column header */
.th-tip { display: inline-block; font-size: .55rem; opacity: .5; cursor: help; vertical-align: super; margin-left: 2px; font-style: normal; transition: opacity .15s; }
thead th[title]:hover .th-tip { opacity: 1; }
thead th[title]:hover { background: var(--bg-hover) !important; color: var(--text-primary) !important; cursor: help; }

tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-raised); }
tbody td { padding: 7px 11px; text-align: right; color: var(--text-secondary); }
tbody td:first-child { text-align: left; color: var(--text-secondary); }
.td-property { color: var(--property) !important; }
.td-shares   { color: var(--shares) !important; }
.td-exit     { color: var(--warning) !important; opacity: 0.85; }
.td-exit-highlight { color: var(--warning) !important; font-weight: 600; background: rgba(245,166,35,.08) !important; }
.td-pos      { color: var(--success) !important; }
.td-neg      { color: var(--danger) !important; }
.td-gold     { color: var(--gold) !important; }
.row-highlight td { background: rgba(201,168,76,.04); }
.yr-age { color: var(--text-muted); font-size: .6rem; margin-left: 4px; }

/* ── ASSUMPTIONS ─────────────────────────────────────────── */
.assumptions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.assumption-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px;
}
.assumption-card h4 {
  font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 10px;
  padding-bottom: 7px; border-bottom: 1px solid var(--border);
}
.assumption-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; }
.assumption-key { font-size: .68rem; color: var(--text-secondary); }
.assumption-val { font-family: 'DM Mono', monospace; font-size: .68rem; color: var(--gold); }

/* ── SENSITIVITY TABLE ───────────────────────────────────── */
.sensitivity-grid table th, .sensitivity-grid table td { text-align: center; }
.cell-green { background: rgba(78,203,113,.10); color: var(--shares) !important; }
.cell-red   { background: rgba(224,85,85,.08);  color: var(--danger) !important; }

/* ── EXPORT BAR ──────────────────────────────────────────── */
.export-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.btn-export {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 12px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: .68rem; font-weight: 600;
  letter-spacing: .03em; text-transform: uppercase;
  cursor: pointer; transition: var(--transition);
}
.btn-export:hover { border-color: var(--gold-dim); color: var(--gold); }

/* ── SECTION INTRO ───────────────────────────────────────── */
.section-intro {
  font-size: .74rem; color: var(--text-secondary);
  margin-bottom: 10px; line-height: 1.65;
  padding: 7px 9px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--gold-dim);
}

/* ── DR BADGE ────────────────────────────────────────────── */
.dr-badge {
  display: inline-block;
  background: rgba(240,100,180,.08);
  border: 1px solid rgba(240,100,180,.22);
  border-radius: 99px; padding: 1px 7px;
  font-size: .58rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  color: #f064b4; margin-left: 5px;
}

/* ── LOADING OVERLAY ─────────────────────────────────────── */
.loading-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(13,15,20,.75);
  z-index: 999; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
[data-theme="light"] .loading-overlay { background: rgba(244,245,248,.75); }
.loading-overlay.visible { display: flex; }
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
.loading-label {
  color: var(--text-secondary);
  font-size: .8rem; margin-top: 14px; text-align: center;
}
.loading-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── DIVIDER ─────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 10px 0; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1200px) {
  .main-content { grid-template-columns: 320px 1fr; }
}
@media (max-width: 900px) {
  .main-content { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: static; }
  .header-badges { display: none; }
}
@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .assumptions-grid { grid-template-columns: 1fr; }
  .mc-stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ── PRINT ───────────────────────────────────────────────── */
@media print {
  .sidebar, header, .export-bar, .loading-overlay { display: none !important; }
  .main-content { grid-template-columns: 1fr; }
  .results-panel { padding: 0; }
  .chart-card { break-inside: avoid; }
}

/* ─── v5 ADDITIONS ────────────────────────────────────────────── */

/* Info tip tooltip */
.info-tip {
  display: inline-block;
  width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  border-radius: 50%;
  font-size: .65rem;
  background: rgba(201,168,76,.15);
  color: var(--gold);
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-left: 2px;
}
.info-tip:hover::after {
  content: attr(title);
  position: absolute;
  left: 20px;
  top: -6px;
  width: 260px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: .69rem;
  line-height: 1.6;
  color: var(--text-secondary);
  z-index: 200;
  box-shadow: var(--shadow-lg);
  white-space: normal;
  pointer-events: none;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
/* table header tooltip — needs higher z and wider */
thead th[title]:hover::after {
  content: attr(title);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  max-width: 300px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: .68rem;
  line-height: 1.6;
  color: var(--text-secondary);
  z-index: 300;
  box-shadow: var(--shadow-lg);
  white-space: normal;
  pointer-events: none;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
thead th[title] { position: relative; }

/* PPOR note */
.ppor-note {
  background: rgba(201,168,76,.10);
  border: 1px solid rgba(201,168,76,.25);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: .71rem;
  color: var(--gold-light);
  margin: 4px 0 8px;
  line-height: 1.5;
}

/* ── EDUCATIONAL SECTION ─────────────────────────────────────────── */
.edu-section {
  grid-column: 1 / -1;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 24px 32px 32px;
}
.edu-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.edu-header-icon { font-size: 1.1rem; }
.edu-header-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: .02em;
}

/* Edu tabs */
.edu-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.edu-tab {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 5px 14px;
  font-size: .72rem;
  font-family: 'DM Mono', monospace;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.edu-tab:hover { border-color: var(--gold-dim); color: var(--gold); }
.edu-tab.active { border-color: var(--gold); background: rgba(201,168,76,.1); color: var(--gold-light); }

/* Edu panels */
.edu-panel { display: none; }
.edu-panel.active { display: block; }

.edu-panel h4 {
  font-size: .82rem;
  font-weight: 600;
  color: var(--gold-light);
  margin: 16px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.edu-panel h4:first-child { margin-top: 0; }
.edu-panel p {
  font-size: .76rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.edu-panel ol, .edu-panel ul.edu-list {
  padding-left: 20px;
  margin: 0 0 10px;
}
.edu-panel ol li, .edu-panel ul.edu-list li {
  font-size: .75rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.edu-panel ol li strong, .edu-panel ul.edu-list li strong {
  color: var(--text-primary);
}
.edu-panel code {
  font-family: 'DM Mono', monospace;
  font-size: .69rem;
  background: var(--bg-raised);
  color: var(--gold-light);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Edu table */
.edu-table { width: auto; border-collapse: collapse; font-size: .74rem; }
.edu-table td { padding: 4px 12px 4px 0; color: var(--text-secondary); vertical-align: top; }
.edu-table td:first-child { color: var(--text-primary); font-weight: 500; min-width: 180px; }

/* Glossary */
.edu-glossary {
  column-count: 2;
  column-gap: 32px;
}
@media (max-width: 700px) { .edu-glossary { column-count: 1; } }
.edu-glossary dt {
  font-weight: 600;
  font-size: .74rem;
  color: var(--gold);
  margin-top: 10px;
}
.edu-glossary dd {
  font-size: .71rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 6px 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

/* FAQ accordion */
.edu-faq-item {
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}
.edu-faq-item summary {
  font-size: .76rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  padding: 2px 0;
}
.edu-faq-item summary::-webkit-details-marker { display: none; }
.edu-faq-item summary::before { content: '▶ '; font-size: .6rem; color: var(--gold); margin-right: 4px; }
.edu-faq-item[open] summary::before { content: '▼ '; }
.edu-faq-item p {
  margin: 8px 0 4px 14px;
  font-size: .73rem;
}

/* Resources */
.edu-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 700px) { .edu-links-grid { grid-template-columns: 1fr; } }
.edu-link-list {
  list-style: none;
  padding: 0;
  margin: 6px 0;
}
.edu-link-list li {
  font-size: .73rem;
  color: var(--text-secondary);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}
.edu-link-list a {
  color: var(--gold);
  text-decoration: none;
}
.edu-link-list a:hover { text-decoration: underline; color: var(--gold-light); }

/* Edu section layout adjustment for main grid */
.main-content + .edu-section { /* immediately after .main-content */ }
.app-shell > .edu-section {
  /* full width below the sidebar+main grid */
}

/* ─── v5.1 ADDITIONS ──────────────────────────────────────────── */

/* PDF button */
.btn-pdf {
  width: 100%;
  padding: 9px 14px;
  background: linear-gradient(135deg, var(--gold), #b8922e);
  color: #0f1118;
  font-weight: 700;
  font-size: .78rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(201,168,76,.3);
}
.btn-pdf:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 4px 16px rgba(201,168,76,.45);
  transform: translateY(-1px);
}

/* Insights bar */
.insights-bar {
  background: rgba(201,168,76,.07);
  border: 1px solid rgba(201,168,76,.2);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 16px;
  position: relative;
  z-index: 10;
}
.insights-title {
  font-size: .76rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}
.insights-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.insights-list li {
  font-size: .8rem;
  color: var(--text-primary);
  opacity: .88;
  padding: 4px 0;
  border-bottom: 1px solid rgba(201,168,76,.1);
  line-height: 1.6;
}
.insights-list li:last-child { border-bottom: none; }
.insights-list li::before { content: '• '; color: var(--gold); }

/* Light mode stronger text in inputs */
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
  color: #0f1118;
}
[data-theme="light"] .section-title { color: #0f1118; }
[data-theme="light"] label { color: #2c3248; }
[data-theme="light"] .hint { color: #505870; }

/* Better mobile layout */
@media (max-width: 768px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  .sidebar {
    max-height: none;
    position: relative;
  }
  .results-panel {
    padding: 12px;
    margin-top: 40px; /* More space to prevent overlap with sidebar buttons */
  }
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  /* Ensure winner banner and insights don't overlap buttons */
  .winner-banner {
    margin-top: 30px;
  }
}
@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .header-badges { display: none; }
  header { padding: 0 12px; }
  .edu-tabs .edu-tab { font-size: .65rem; padding: 4px 8px; }
}

/* ═══════════════════════════════════════════════════════════════
   TEPUY NAVBAR — styled to match site design system
   ═══════════════════════════════════════════════════════════════ */

/* Reset any inherited header styles that conflict */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  height: 60px;
  display: flex;
  align-items: center;
}

.navbar-inner {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 24px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  height: 60px;
}

/* Brand / Logo */
.logo-title {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem;
  letter-spacing: .02em;
  flex-shrink: 0;
  transition: opacity .15s;
}
.logo-title:hover { opacity: .85; }
.logo-title .logo {
  height: 32px;
  width: auto;
  border-radius: 4px;
}

/* Nav links container */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 28px;
  flex: 1;
}

.nav-links > a,
.nav-links .has-sub > .sub-toggle {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  border: none;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  font-family: 'DM Sans', sans-serif;
}

.nav-links > a:hover,
.nav-links .has-sub > .sub-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-links > a.active,
.nav-links > a[aria-current="page"] {
  color: var(--gold);
  background: rgba(201,168,76,.1);
}

/* Auth link area */
#navAuthLink {
  display: flex;
  align-items: center;
}
#navAuthLink > a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}
#navAuthLink > a:hover {
  color: var(--gold);
  background: rgba(201,168,76,.1);
}

/* Dropdown sub-menus */
.has-sub {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.sub-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 200;
  flex-direction: column;
}

.has-sub.open .sub-menu,
.has-sub:focus-within .sub-menu {
  display: flex;
}

.sub-menu a,
.sub-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .8rem;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: var(--transition);
}

.sub-menu a:hover,
.sub-menu button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sub-menu a:first-child,
.sub-menu button:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.sub-menu a:last-child,
.sub-menu button:last-child { border-radius: 0 0 var(--radius-md) var(--radius-md); }

/* Plan badge */
.plan-badge {
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.plan-pro {
  background: rgba(201,168,76,.2);
  color: var(--gold-light);
  border: 1px solid rgba(201,168,76,.35);
}

/* CTA Button */
.cta-button {
  margin-left: auto;
  padding: 7px 18px;
  background: linear-gradient(135deg, var(--gold), #a87828);
  color: #0f1118;
  font-weight: 700;
  font-size: .78rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition);
  box-shadow: 0 2px 10px rgba(201,168,76,.3);
  flex-shrink: 0;
}
.cta-button:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 4px 16px rgba(201,168,76,.45);
  transform: translateY(-1px);
}

/* Hamburger (mobile) */
.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  cursor: pointer;
  margin-left: 12px;
  transition: var(--transition);
}
.hamburger:hover { background: var(--bg-hover); }

/* Light mode navbar adjustments */
[data-theme="light"] .navbar {
  background: #ffffff;
  box-shadow: 0 1px 8px rgba(0,0,0,.08);
}
[data-theme="light"] .nav-links > a,
[data-theme="light"] .nav-links .has-sub > .sub-toggle,
[data-theme="light"] #navAuthLink > a {
  color: #2c3248;
}
[data-theme="light"] .nav-links > a:hover,
[data-theme="light"] .nav-links .has-sub > .sub-toggle:hover {
  color: #0f1118;
  background: #eaecf2;
}
[data-theme="light"] .sub-menu {
  background: #ffffff;
  border-color: #d8dce8;
}
[data-theme="light"] .sub-menu a,
[data-theme="light"] .sub-menu button { color: #2c3248; }
[data-theme="light"] .sub-menu a:hover { background: #f0f1f5; color: #0f1118; }

@media (max-width: 900px) {
  /* Show hamburger, hide desktop CTA */
  .hamburger { display: block; flex-shrink: 0; }
  .cta-button { display: none; }

  /* Navbar: force GPU compositing layer — fixes iOS sticky glitches */
  .navbar {
    position: -webkit-sticky;
    position: sticky;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
    /* Respect iPhone notch */
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }

  /* Nav-links: use fixed instead of absolute — avoids iOS scroll/sticky parent bugs */
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    /* Extend to bottom edge, accounting for home indicator */
    max-height: calc(100vh - 60px);
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 12px 14px max(20px, env(safe-area-inset-bottom, 20px));
    gap: 3px;
    z-index: 999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 8px 32px rgba(0,0,0,.35);
  }
  .nav-links.show {
    display: flex !important;
    -webkit-animation: mobileNavIn .18s ease;
    animation: mobileNavIn .18s ease;
  }
  @-webkit-keyframes mobileNavIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes mobileNavIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Full-width links with generous touch targets (Apple recommends 44px min) */
  .nav-links > a,
  .has-sub > .sub-toggle {
    width: 100%;
    padding: 13px 14px !important;
    font-size: .95rem !important;
    border-radius: var(--radius-md);
    min-height: 48px;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
  }

  /* Sub-menu: inline accordion, not floating */
  .sub-menu {
    position: static !important;
    -webkit-transform: none !important;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    background: var(--bg-raised);
    border-radius: var(--radius-md);
    margin: 3px 0 3px 14px;
    padding: 4px;
  }
  .sub-menu a, .sub-menu button {
    font-size: .9rem !important;
    padding: 11px 14px !important;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .has-sub.open .sub-menu { display: flex; }

  /* Login button styled consistently in mobile menu */
  .nav-login-btn {
    width: 100%;
    padding: 13px 14px !important;
    font-size: .95rem !important;
    min-height: 48px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   EDU PANEL — FIX "Behind the Math" readability
   Code blocks: dark bg with light text, NOT yellow-on-dark
   ═══════════════════════════════════════════════════════════════ */

/* Override edu panel background — remove the coloured sub-bg */
.edu-section { background: var(--bg-surface) !important; }

/* Fix code blocks: use a neutral dark bg, white text, NOT gold */
.edu-panel code {
  background: rgba(0,0,0,.25) !important;
  color: #e8f0fe !important;
  font-family: 'DM Mono', 'Courier New', monospace !important;
  font-size: .68rem !important;
  padding: 2px 6px !important;
  border-radius: 3px !important;
}

/* Light mode code blocks */
[data-theme="light"] .edu-panel code {
  background: #e8eaf0 !important;
  color: #1a237e !important;
}

/* Edu panel h4 — remove yellow bg, use cleaner styling */
.edu-panel h4 {
  font-size: .82rem !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  margin: 18px 0 8px !important;
  padding: 6px 10px !important;
  border-left: 3px solid var(--gold) !important;
  border-bottom: none !important;
  background: rgba(201,168,76,.06) !important;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
}
.edu-panel h4:first-child { margin-top: 0 !important; }

/* Edu panel text — use text-primary instead of gold-derived muted */
.edu-panel p, .edu-panel ol li, .edu-panel ul.edu-list li {
  color: var(--text-secondary) !important;
}

[data-theme="light"] .edu-panel p,
[data-theme="light"] .edu-panel ol li,
[data-theme="light"] .edu-panel ul.edu-list li {
  color: #2c3248 !important;
}

[data-theme="light"] .edu-panel h4 {
  color: #0f1118 !important;
  background: rgba(184,146,46,.08) !important;
}

/* ═══════════════════════════════════════════════════════════════
   LIGHT MODE — stronger text throughout
   ═══════════════════════════════════════════════════════════════ */

[data-theme="light"] .section-title { color: #0f1118 !important; font-weight: 600; }
[data-theme="light"] .field label { color: #1a2030 !important; font-weight: 500; }
[data-theme="light"] .hint, [data-theme="light"] .range-val { color: #4a5068 !important; }
[data-theme="light"] .kpi-label { color: #1a2030 !important; }
[data-theme="light"] .kpi-value { color: #0f1118 !important; }
[data-theme="light"] .tab { color: #2c3248 !important; }
[data-theme="light"] .tab.active { color: #0f1118 !important; font-weight: 700; }
[data-theme="light"] table th { color: #0f1118 !important; }
[data-theme="light"] table td { color: #1a2030 !important; }
[data-theme="light"] .winner-banner .winner-title { color: #0f1118 !important; }
[data-theme="light"] .winner-banner .winner-detail { color: #2c3248 !important; }
[data-theme="light"] .edu-header-title { color: #a87828 !important; }
[data-theme="light"] .edu-tab { color: #2c3248 !important; }
[data-theme="light"] .edu-tab.active { color: #a87828 !important; }
[data-theme="light"] .edu-glossary dt { color: #a87828 !important; }
[data-theme="light"] .edu-glossary dd { color: #2c3248 !important; }
[data-theme="light"] .insights-title { color: #a87828 !important; }
[data-theme="light"] .insights-list li { color: #1a2030 !important; }

/* Pro gate notice */
/* .pro-gate-notice removed — no pro gating */

/* ═══════════════════════════════════════════════════════════════
   CALCULATOR SUB-HEADER (below navbar)
   ═══════════════════════════════════════════════════════════════ */
.calc-header {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 52px;
  padding: 0 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}
.calc-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.calc-header-icon { font-size: 1.3rem; }
.calc-header-title {
  font-family: 'DM Serif Display', serif;
  font-size: .9rem;
  color: var(--text-primary);
  line-height: 1.2;
}
.calc-header-sub {
  font-size: .6rem;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.calc-header .header-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
}
.calc-header .theme-toggle {
  margin-left: auto;
  flex-shrink: 0;
}
[data-theme="light"] .calc-header { background: #fafbfc; }
[data-theme="light"] .calc-header-title { color: #0f1118; }
@media (max-width: 768px) {
  .calc-header .header-badges { display: none; }
  .calc-header-sub { display: none; }
}


/* ═══════════════════════════════════════════════════════════════
   DISCLAIMER FOOTER
   ═══════════════════════════════════════════════════════════════ */
.disclaimer-footer {
  background: rgba(180,40,40,.07);
  border-top: 1px solid rgba(180,40,40,.2);
  padding: 10px 24px;
  position: sticky;
  bottom: 0;
  z-index: 80;
  backdrop-filter: blur(8px);
}
.disclaimer-inner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 1400px;
  margin: 0 auto;
  font-size: .71rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.disclaimer-icon { font-size: .9rem; flex-shrink: 0; margin-top: 1px; }
.disclaimer-inner strong { color: var(--text-primary); }
.disclaimer-inner a { color: var(--gold); text-decoration: underline; }

[data-theme="light"] .disclaimer-footer {
  background: rgba(180,40,40,.05);
}
[data-theme="light"] .disclaimer-inner { color: #505870; }
[data-theme="light"] .disclaimer-inner strong { color: #0f1118; }

/* field-note utility */
.field-note {
  font-size: .65rem;
  line-height: 1.5;
  margin-top: 4px;
}



/* ═══════════════════════════════════════════════════════════════
   LOGO FIX — hard cap so the image can never overflow header
   ═══════════════════════════════════════════════════════════════ */
/* .calc-header-logo removed — logo only in top navbar */

/* ═══════════════════════════════════════════════════════════════
   BASIC / ADVANCED MODE TOGGLE BAR
   ═══════════════════════════════════════════════════════════════ */
.mode-toggle-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.mode-toggle-label {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
}

.mode-toggle-group {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.mode-btn {
  padding: 4px 12px;
  border: none;
  border-radius: calc(var(--radius-sm) - 1px);
  font-size: .68rem;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  background: transparent;
  color: var(--text-muted);
  letter-spacing: .02em;
  white-space: nowrap;
}

.mode-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.mode-btn.active {
  background: var(--gold);
  color: #0d0f14;
  box-shadow: 0 1px 4px rgba(201,168,76,.30);
}

[data-theme="light"] .mode-btn.active {
  color: #ffffff;
}

.mode-hint {
  font-size: .62rem;
  color: var(--text-muted);
  font-style: italic;
  margin-left: auto;
  white-space: nowrap;
}



/* ═══════════════════════════════════════════════════════════════
   SCENARIO SAVE / LOAD BUTTONS & DROPDOWN
   ═══════════════════════════════════════════════════════════════ */
.btn-scenario {
  font-size: .68rem;
  border-color: var(--border-focus);
  color: var(--gold);
}
.btn-scenario:hover {
  background: rgba(201,168,76,.08);
  border-color: var(--gold);
  color: var(--gold-light);
}

.scenario-auth-hint {
  font-size: .66rem;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  margin-top: 4px;
  line-height: 1.5;
  animation: fadeIn .2s ease;
}

.scenario-load-dropdown {
  background: var(--bg-surface);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.sld-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sld-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .75rem;
  padding: 0 4px;
}
.sld-close:hover { color: var(--danger); }
.sld-list {
  list-style: none;
  padding: 4px 0;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
}
.sld-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 7px 14px;
  font-size: .74rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-family: 'DM Sans', sans-serif;
}
.sld-item:hover {
  background: var(--bg-hover);
  color: var(--gold);
}

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

/* Better winner star */
.winner-trophy {
  font-size: 1.75rem;
  font-weight: 100;
  color: var(--gold);
  letter-spacing: -.02em;
  line-height: 1;
}

/* Section icon font rendering (symbol icons) */
.section-icon {
  font-family: 'DM Serif Display', system-ui, serif;
}

/* Login/Signup button in navbar (triggers Auth0 directly) */
.nav-login-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: .82rem;
  font-weight: 500;
  padding: 6px 12px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.nav-login-btn:hover {
  color: var(--gold);
  border-color: var(--gold-dim);
  background: rgba(201,168,76,.07);
}
[data-theme="light"] .nav-login-btn { color: #2c3248; }
[data-theme="light"] .nav-login-btn:hover { color: #0f1118; background: #eaecf2; border-color: #b8922e; }

/* Assumption card heading: brighter */
.assumption-card h4 {
  font-size: .67rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-secondary); margin-bottom: 10px;
  padding-bottom: 7px; border-bottom: 1px solid var(--border);
}





/* ============================================================================
   v6 Cashflow Neutrality UI
============================================================================ */

.icon-cashflow {
  background: rgba(255,255,255,0.08);
}

.cashflow-verification .chart-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cfv-status {
  font-size: 0.95rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
}

.cfv-status.ok {
  border-color: rgba(60, 220, 150, 0.35);
  background: rgba(60, 220, 150, 0.12);
}

.cfv-status.bad {
  border-color: rgba(255, 120, 120, 0.35);
  background: rgba(255, 120, 120, 0.12);
}

.cfv-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 10px 14px 0;
}

.cfv-meta .k {
  display: inline-block;
  min-width: 84px;
  opacity: 0.8;
}

.cfv-meta .v {
  font-weight: 600;
}

.cfv-table table {
  width: 100%;
}

.cfv-table tbody tr.ok td {
  opacity: 0.92;
}

.cfv-table tbody tr.bad td {
  opacity: 0.92;
}

.cfv-table tbody tr.bad td:last-child {
  font-weight: 700;
}





/* ============================================================
   ADDITIONS — extracted from inline HTML styles + new features
   Organised: Share buttons → DSC → Share Card → MC note →
              Shared banner → Light-mode contrast → Font floor
   ============================================================ */


    /* ── Share button variants ─────────────────────────── */
    .btn-share {
      border-color: var(--gold-dim, #8a6d28) !important;
      color: var(--gold, #c9a84c) !important;
    }
    .btn-share:hover {
      background: rgba(201,168,76,0.08) !important;
      border-color: var(--gold, #c9a84c) !important;
    }
    .btn-share-export {
      border-color: var(--gold-dim, #8a6d28) !important;
      color: var(--gold, #c9a84c) !important;
    }
    .btn-share-export:hover {
      background: rgba(201,168,76,0.08) !important;
      border-color: var(--gold, #c9a84c) !important;
    }
    /* ═══════════════════════════════════════════════════════════════════
       DECISION SUMMARY CARD — shareable, narrative output layer
       Sits between insights-bar and kpi-grid.
    ═══════════════════════════════════════════════════════════════════ */
    #decision_summary_card {
      display: none;
      background: linear-gradient(135deg,
        rgba(0,139,149,0.07) 0%,
        rgba(15,35,60,0.10) 100%);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 22px 24px 18px;
      margin: 16px 0 10px;
      position: relative;
      overflow: hidden;
    }
    #decision_summary_card::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0;
      height: 3px;
      background: linear-gradient(90deg, #008b95, var(--gold, #c9a84c));
      border-radius: 14px 14px 0 0;
    }
    #decision_summary_card.visible { display: block; }

    /* ── Headline ── */
    .dsc-headline {
      font-size: 1.05rem;
      font-weight: 700;
      color: var(--text-primary);
      line-height: 1.4;
      margin-bottom: 14px;
      padding-right: 8px;
    }
    .dsc-headline .dsc-winner-label {
      display: inline-block;
      font-size: 0.68rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      padding: 2px 8px;
      border-radius: 4px;
      margin-right: 8px;
      vertical-align: middle;
      position: relative;
      top: -1px;
    }
    /* Dark mode badge colours */
    .dsc-winner-label.property { background: rgba(0,139,149,0.22); color: #3dd4dc; }
    .dsc-winner-label.shares   { background: rgba(201,168,76,0.22); color: var(--gold, #c9a84c); }

    /* ── Insight tiles ── */
    .dsc-insights {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 10px;
      margin-bottom: 16px;
    }
    .dsc-insight-item {
      background: var(--bg-raised);
      border: 1px solid var(--border);
      border-radius: 9px;
      padding: 10px 12px;
    }
    .dsc-insight-label {
      font-size: 0.62rem;
      font-weight: 600;
      letter-spacing: 0.07em;
      text-transform: uppercase;
      color: var(--text-muted);
      margin-bottom: 3px;
    }
    .dsc-insight-value {
      font-size: 0.88rem;
      font-weight: 600;
      color: var(--text-primary);
      line-height: 1.35;
    }
    /* Dark mode value colours — bright enough on dark tiles */
    .dsc-insight-value.teal { color: #3dd4dc; }
    .dsc-insight-value.gold { color: var(--gold, #c9a84c); }
    .dsc-insight-value.warn { color: #f09050; }

    /* ── Assumption strip ── */
    .dsc-assumption-strip {
      display: flex;
      flex-wrap: wrap;
      gap: 6px 16px;
      font-size: 0.71rem;
      color: var(--text-muted);
      margin-bottom: 14px;
      padding: 8px 10px;
      background: var(--bg-base, rgba(0,0,0,0.15));
      border-radius: 7px;
    }
    .dsc-assumption-strip strong { color: var(--text-secondary); }

    /* ── Footer ── */
    .dsc-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 8px;
    }
    .dsc-legal {
      font-size: 0.62rem;
      color: var(--text-muted);
      line-height: 1.5;
      flex: 1;
      min-width: 160px;
    }
    .dsc-share-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.75rem;
      font-weight: 600;
      padding: 7px 14px;
      border-radius: 7px;
      border: 1px solid var(--gold-dim, #8a6d28);
      color: var(--gold, #c9a84c);
      background: transparent;
      cursor: pointer;
      transition: background 0.15s, border-color 0.15s;
      white-space: nowrap;
      font-family: inherit;
    }
    .dsc-share-btn:hover {
      background: rgba(201,168,76,0.10);
      border-color: var(--gold, #c9a84c);
    }
    .dsc-share-btn .dsc-copy-tick { display: none; color: #4caf82; }
    .dsc-share-btn.copied .dsc-copy-label { display: none; }
    .dsc-share-btn.copied .dsc-copy-tick { display: inline; }

    /* ══ LIGHT MODE OVERRIDES ══════════════════════════════════════════
       Everything that was designed for dark tiles needs explicit
       high-contrast replacements when data-theme="light" is set.
    ═════════════════════════════════════════════════════════════════ */
    [data-theme="light"] #decision_summary_card {
      background: linear-gradient(135deg, rgba(0,139,149,0.05) 0%, rgba(15,35,60,0.03) 100%);
      border-color: rgba(0,0,0,0.10);
    }

    /* Badge: dark text on a slightly tinted background */
    [data-theme="light"] .dsc-winner-label.property {
      background: rgba(0,139,149,0.12);
      color: #006b72;   /* darker teal — WCAG AA on light bg */
    }
    [data-theme="light"] .dsc-winner-label.shares {
      background: rgba(160,110,20,0.12);
      color: #7a5200;   /* dark amber — WCAG AA on light bg */
    }

    /* Headline text */
    [data-theme="light"] .dsc-headline { color: #0f1118; }

    /* Tiles: white card on light grey background */
    [data-theme="light"] .dsc-insight-item {
      background: #ffffff;
      border-color: rgba(0,0,0,0.09);
      box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    }

    /* Tile label: medium-dark grey */
    [data-theme="light"] .dsc-insight-label { color: #5a6070; }

    /* Tile value: near-black for readability */
    [data-theme="light"] .dsc-insight-value        { color: #1a1d26; }
    [data-theme="light"] .dsc-insight-value.teal   { color: #006b72; }  /* WCAG AA */
    [data-theme="light"] .dsc-insight-value.gold   { color: #7a5200; }  /* WCAG AA */
    [data-theme="light"] .dsc-insight-value.warn   { color: #8b3a00; }  /* WCAG AA */

    /* Assumption strip */
    [data-theme="light"] .dsc-assumption-strip {
      background: rgba(0,0,0,0.04);
      color: #4a5068;
    }
    [data-theme="light"] .dsc-assumption-strip strong { color: #1a1d26; }

    /* Legal text */
    [data-theme="light"] .dsc-legal { color: #6a7080; }

    /* Share button */
    [data-theme="light"] .dsc-share-btn {
      border-color: #a07830;
      color: #7a5200;
    }
    [data-theme="light"] .dsc-share-btn:hover {
      background: rgba(160,110,20,0.08);
      border-color: #7a5200;
    }

    @media (max-width: 600px) {
      .dsc-insights { grid-template-columns: 1fr 1fr; }
      .dsc-headline { font-size: 0.95rem; }
    }


    /* ── Shared-scenario banner (shown when URL params present) ── */
    #pvs_shared_banner {
      display: none;
      background: linear-gradient(135deg, rgba(201,168,76,0.12), rgba(201,168,76,0.05));
      border: 1px solid var(--gold-dim, #8a6d28);
      border-radius: 8px;
      padding: 10px 16px;
      margin: 0 0 16px 0;
      font-size: 0.82rem;
      color: var(--gold, #c9a84c);
      align-items: center;
      gap: 8px;
      line-height: 1.4;
    }
    #pvs_shared_banner.visible { display: flex; }
    #pvs_shared_banner strong { color: var(--text-primary, #e8e0d0); }
  


/* ══ SHARE CARD OVERLAY ═══════════════════════════════════════════════════════
   A full-screen modal containing an isolated, screenshot-ready result card.
   Fixed 600px wide, always dark, designed to be captured by html2canvas.
═══════════════════════════════════════════════════════════════════════════ */
#share_card_overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  backdrop-filter: blur(4px);
}
#share_card_overlay.visible { display: flex; }

#share_card_outer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 640px;
}

/* The card itself — always dark, fixed width, screenshot target */
#share_card {
  width: 600px;
  max-width: 100%;
  background: #111520;           /* slightly lighter than pure black — tiles now visible */
  border-radius: 18px;
  padding: 28px 28px 22px;
  position: relative;
  overflow: hidden;
  font-family: 'DM Sans', sans-serif;
  box-shadow: 0 24px 80px rgba(0,0,0,0.9);
}

/* Accent bar top */
#share_card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4e8ef7 0%, #c9a84c 50%, #4ecb71 100%);
}

/* Subtle grid — reduced opacity so it doesn't muddy contrast */
#share_card::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Header row: winner badge + Tepuy brand */
.sc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}
.sc-brand {
  font-family: 'DM Serif Display', serif;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.50);   /* was 0.28 — much more readable */
  text-align: right;
  line-height: 1.4;
  flex-shrink: 0;
}
.sc-brand span {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;              /* was 0.60 */
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.35);   /* was 0.18 */
  margin-top: 2px;
}

.sc-winner-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;              /* was 0.65 */
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 6px;
}
.sc-winner-badge.property {
  background: rgba(78,142,247,0.22);
  color: #93c0ff;                  /* brighter — was #7ab3ff */
  border: 1px solid rgba(78,142,247,0.45);
}
.sc-winner-badge.shares {
  background: rgba(78,203,113,0.22);
  color: #80e89a;                  /* brighter — was #6dd98a */
  border: 1px solid rgba(78,203,113,0.45);
}

/* Main headline */
.sc-headline {
  font-family: 'DM Serif Display', serif;
  font-size: 1.32rem;
  line-height: 1.42;
  color: #dde2ee;                  /* slightly softer than pure white for long text */
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}
.sc-headline strong {
  color: #ffffff;
}

/* 2×2 stat grid */
.sc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.sc-stat {
  background: #1c2133;             /* was rgba(255,255,255,0.04) ≈ invisible — now a real surface */
  border: 1px solid #2e3550;       /* was rgba(255,255,255,0.07) — now clearly visible */
  border-radius: 10px;
  padding: 14px 16px;              /* slightly more padding */
}
.sc-stat-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.70rem;              /* was 0.58 — now readable */
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);   /* was 0.35 */
  margin-bottom: 7px;
}
.sc-stat-value {
  font-size: 0.96rem;              /* was 0.88 */
  font-weight: 600;
  line-height: 1.35;
  color: #eef0f5;
}
.sc-stat-value.blue  { color: #93c0ff; }   /* brighter for dark bg */
.sc-stat-value.green { color: #80e89a; }
.sc-stat-value.gold  { color: #e0c070; }
.sc-stat-value.warn  { color: #ffaa60; }

/* Divider */
.sc-divider {
  height: 1px;
  background: rgba(255,255,255,0.10);  /* was 0.07 */
  margin: 0 0 14px;
}

/* Assumptions strip */
.sc-assumptions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 16px;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;              /* was 0.62 */
  color: rgba(255,255,255,0.50);   /* was 0.30 */
  margin-bottom: 16px;
}
.sc-assumptions strong {
  color: rgba(255,255,255,0.80);   /* was 0.55 */
}

/* Footer: disclaimer + URL */
.sc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sc-disclaimer {
  font-size: 0.70rem;              /* was 0.60 */
  color: rgba(255,255,255,0.38);   /* was 0.20 */
  line-height: 1.55;
  flex: 1;
}
.sc-url {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;              /* was 0.62 */
  color: rgba(201,168,76,0.80);    /* was 0.55 — gold URL now visible */
  white-space: nowrap;
  flex-shrink: 0;
}

/* Action buttons row (outside the card, not captured) */
.sc-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.sc-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.sc-action-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.sc-action-btn.primary {
  background: linear-gradient(135deg, #4e8ef7, #2d6fd4);
  color: #ffffff;
}
.sc-action-btn.secondary {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
  border: 1px solid rgba(255,255,255,0.12);
}
.sc-action-btn.close-btn {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.45);
  border: 1px solid rgba(255,255,255,0.08);
}
.sc-hint {
  font-size: 0.70rem;
  color: rgba(255,255,255,0.28);
  text-align: center;
  font-family: 'DM Mono', monospace;
}


/* ══ LIGHT MODE — COMPREHENSIVE CONTRAST FIX v2 ══════════════════════════════
   Every component that was unreadable in day mode.
   All colours WCAG AA verified against their backgrounds.
══════════════════════════════════════════════════════════════════════════════ */

/* ── Global ── */
[data-theme="light"] body { color: #1a1d26; }
html { font-size: 15.5px; }

/* ── Chart cards & titles ── */
[data-theme="light"] .chart-card {
  background: #ffffff;
  border: 1px solid #d0d4e0;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
[data-theme="light"] .chart-title { color: #0f1118 !important; font-weight: 700; }

/* ── KPI cards ── */
[data-theme="light"] .kpi-card {
  background: #ffffff;
  border: 1px solid #d0d4e0;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
[data-theme="light"] .kpi-sub { color: #374060 !important; }

/* ── Section intro / hint ── */
[data-theme="light"] .section-intro { color: #374060 !important; }
[data-theme="light"] .chart-card .hint { color: #505870 !important; }

/* ── Sidebar sections ── */
[data-theme="light"] .section { background: #ffffff; border: 1px solid #d8dce8; }
[data-theme="light"] .section-header { background: #f7f8fb; }
[data-theme="light"] .section-icon { color: #374060 !important; }
[data-theme="light"] .section-body { background: #ffffff; }

/* ── Tabs ── */
[data-theme="light"] .tabs { border-bottom-color: #d0d4e0; }
[data-theme="light"] .tab:not(.active) { color: #374060 !important; }
[data-theme="light"] .tab:not(.active):hover { background: #eaecf2; color: #0f1118 !important; }

/* ── Winner banner ── */
[data-theme="light"] .winner-banner {
  background: linear-gradient(135deg, rgba(201,168,76,.10), rgba(201,168,76,.04));
  border-color: rgba(184,146,46,.35);
}

/* ── Insights bar ── */
[data-theme="light"] .insights-bar {
  background: rgba(184,146,46,.08);
  border-color: rgba(184,146,46,.30);
}
[data-theme="light"] .insights-list li { color: #1a2030 !important; font-size: .82rem; }

/* ── Decision Summary Card (inline version) ── */
[data-theme="light"] #decision_summary_card {
  background: #ffffff;
  border-color: #d0d4e0;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
}
[data-theme="light"] .dsc-headline { color: #0f1118 !important; }
[data-theme="light"] .dsc-insight-item { background: #f7f8fb; border-color: #d0d4e0; }
[data-theme="light"] .dsc-insight-label { color: #505870 !important; }
[data-theme="light"] .dsc-insight-value { color: #0f1118 !important; }
[data-theme="light"] .dsc-insight-value.teal { color: #006b72 !important; }
[data-theme="light"] .dsc-insight-value.gold { color: #7a5200 !important; }
[data-theme="light"] .dsc-insight-value.warn { color: #8b3a00 !important; }
[data-theme="light"] .dsc-assumption-strip { background: #eef0f5; color: #374060; }
[data-theme="light"] .dsc-assumption-strip strong { color: #0f1118; }
[data-theme="light"] .dsc-legal { color: #505870; }
[data-theme="light"] .dsc-winner-label.property { background: rgba(78,142,247,.12); color: #1a4a9a; }
[data-theme="light"] .dsc-winner-label.shares   { background: rgba(78,203,113,.12); color: #1a6a35; }
[data-theme="light"] .dsc-share-btn { border-color: #a07830; color: #7a5200; }
[data-theme="light"] .dsc-share-btn:hover { background: rgba(160,110,20,.08); border-color: #7a5200; }

/* ── Monte Carlo stats ── */
[data-theme="light"] .mc-stat { background: #ffffff; border: 1px solid #d0d4e0; }
[data-theme="light"] .mc-stat-label { color: #374060 !important; }
[data-theme="light"] .mc-stat-val { color: #0f1118 !important; }
[data-theme="light"] .mc-note { color: #505870 !important; }

/* ── MC transparency note ── */
[data-theme="light"] .mc-transparency-note {
  background: rgba(184,146,46,.06) !important;
  border-color: rgba(184,146,46,.25) !important;
  color: #374060 !important;
}
[data-theme="light"] .mc-transparency-note strong { color: #7a5200 !important; }
[data-theme="light"] .mc-transparency-note li { color: #374060 !important; }

/* ── Sensitivity grid ── */
[data-theme="light"] .sensitivity-grid td { color: #0f1118 !important; }
[data-theme="light"] .sensitivity-grid th { color: #374060 !important; }

/* ── Assumptions grid ── */
[data-theme="light"] .assumption-card { background: #ffffff; border: 1px solid #d0d4e0; }
[data-theme="light"] .assumption-key { color: #374060 !important; }
[data-theme="light"] .assumption-val { color: #0f1118 !important; }

/* ── Cashflow verification ── */
[data-theme="light"] .cashflow-verification { background: #ffffff; border: 1px solid #d0d4e0; }
[data-theme="light"] .cfv-meta .k { color: #505870 !important; }
[data-theme="light"] .cfv-meta .v { color: #0f1118 !important; }

/* ── Header badges ── */
[data-theme="light"] .badge {
  background: rgba(0,0,0,.06) !important;
  color: #2c3248 !important;
  border-color: rgba(0,0,0,.10) !important;
}

/* ── Empty state ── */
[data-theme="light"] .empty-icon { color: #c0c4d0; }
[data-theme="light"] .empty-title { color: #0f1118 !important; }
[data-theme="light"] .empty-sub { color: #374060 !important; }

/* ── Calc hero ── */
[data-theme="light"] .calc-hero-desc { color: #374060 !important; }
[data-theme="light"] .calc-hero-title { color: #0f1118 !important; }

/* ── Sidebar controls ── */
[data-theme="light"] .mode-toggle-bar { color: #374060; }
[data-theme="light"] .mode-btn:not(.active) { color: #374060 !important; }
[data-theme="light"] .range-val { color: #374060 !important; }
[data-theme="light"] .toggle-label { color: #2c3248 !important; }

/* ── Edu panel ── */
[data-theme="light"] .edu-faq-item summary { color: #1a2030 !important; }
[data-theme="light"] .edu-faq-item p { color: #374060 !important; }
[data-theme="light"] .edu-table td { color: #1a2030 !important; }

/* ── Share card light-mode variant ── */
#share_card.light-mode {
  background: #f8f9fc;
  box-shadow: 0 24px 80px rgba(0,0,0,.25);
}
/* Remove grid watermark in light mode — causes checkered artifact in html2canvas */
#share_card.light-mode::after {
  display: none;
}
#share_card.light-mode::after {
  background-image:
    linear-gradient(rgba(0,0,0,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,.025) 1px, transparent 1px);
}
#share_card.light-mode .sc-headline { color: #0f1118; }
#share_card.light-mode .sc-headline strong { color: #000; }
#share_card.light-mode .sc-brand { color: rgba(0,0,0,.35); }
#share_card.light-mode .sc-brand span { color: rgba(0,0,0,.22); }
#share_card.light-mode .sc-winner-badge.property { background: rgba(78,142,247,.12); color: #1a4a9a; border-color: rgba(78,142,247,.25); }
#share_card.light-mode .sc-winner-badge.shares   { background: rgba(78,203,113,.12); color: #1a6a35; border-color: rgba(78,203,113,.25); }
#share_card.light-mode .sc-stat { background: #ffffff; border-color: #d4d8e8; }
#share_card.light-mode .sc-stat-label { color: #505870; }
#share_card.light-mode .sc-stat-value { color: #0f1118; }
#share_card.light-mode .sc-stat-value.blue  { color: #1a4a9a; }
#share_card.light-mode .sc-stat-value.green { color: #1a6a35; }
#share_card.light-mode .sc-stat-value.gold  { color: #7a5200; }
#share_card.light-mode .sc-stat-value.warn  { color: #8b3a00; }
#share_card.light-mode .sc-divider { background: rgba(0,0,0,.10); }
#share_card.light-mode .sc-assumptions { color: rgba(0,0,0,.40); }
#share_card.light-mode .sc-assumptions strong { color: rgba(0,0,0,.65); }
#share_card.light-mode .sc-disclaimer { color: rgba(0,0,0,.30); }
#share_card.light-mode .sc-url { color: rgba(120,80,0,.55); }

/* ── Global font-size minimums — raise tiny labels to readable floor ── */
.badge,
.sc-stat-label,
.dsc-insight-label,
.kpi-label,
.mc-stat-label,
.section-intro,
.assumption-key,
.cfv-meta .k,
.edu-tab,
.hint {
  font-size: max(.73rem, 0.73rem); /* floor ~11px at 15px base */
}


/* ════════════════════════════════════════════════════════════
   SEO CONTENT SECTIONS
   Styles for seo-intent, seo-longform, seo-faq, related-tools
   Added to support SEO scaffolding without bloating above fold
   ════════════════════════════════════════════════════════════ */

/* ── SEO INTENT BANNER (compact above-fold, replaces wall of text) ── */
.seo-intent {
  max-width: 900px;
  margin: 0 auto 20px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(201,168,76,.05), rgba(78,142,247,.03));
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-lg);
}

.seo-intent__h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
  line-height: 1.35;
}

.seo-intent__lead {
  font-size: .83rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0 0 12px;
}

.seo-intent__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seo-chip {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(201,168,76,.08);
  border: 1px solid rgba(201,168,76,.2);
  border-radius: 99px;
  font-size: .72rem;
  color: var(--gold);
  font-weight: 500;
  letter-spacing: .01em;
  white-space: nowrap;
}

/* Light theme */
[data-theme="light"] .seo-intent {
  background: rgba(31,76,59,.04);
  border-color: #d0dfe0;
  border-left-color: #c9a84c;
}
[data-theme="light"] .seo-intent__h1 { color: #0f1118; }
[data-theme="light"] .seo-intent__lead { color: #374060; }
[data-theme="light"] .seo-chip {
  background: rgba(201,168,76,.1);
  border-color: rgba(201,168,76,.3);
  color: #7a5200;
}

/* ── SEO LONGFORM (post-calculator article content) ── */
.seo-longform,
.seo-faq,
.related-tools {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 24px;
}

.seo-longform {
  margin-top: 52px;
  margin-bottom: 0;
}

.seo-longform p,
.seo-faq p {
  font-size: .88rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0 0 14px;
}

.seo-longform h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 28px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.seo-section__h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 20px;
  letter-spacing: -.01em;
}

.seo-section__h2--sm {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

[data-theme="light"] .seo-longform p,
[data-theme="light"] .seo-faq p { color: #374060; }
[data-theme="light"] .seo-longform h3 { color: #0f1118; border-color: #d0dfe0; }
[data-theme="light"] .seo-section__h2 { color: #0f1118; }

/* ── SEO FAQ (People Also Ask accordion) ── */
.seo-faq {
  margin-top: 40px;
  margin-bottom: 48px;
}

.seo-faq__title {
  /* inherits .seo-section__h2 */
}

.seo-faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color .15s;
}

.seo-faq-item:hover,
.seo-faq-item[open] {
  border-color: rgba(201,168,76,.35);
}

.seo-faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 18px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  transition: background .12s;
}

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

.seo-faq-item summary::before {
  content: '▶';
  font-size: .6rem;
  color: var(--gold);
  flex-shrink: 0;
  transition: transform .2s;
}

.seo-faq-item[open] summary::before {
  transform: rotate(90deg);
}

.seo-faq-item summary:hover {
  background: rgba(255,255,255,.03);
}

.seo-faq-item p {
  margin: 0;
  padding: 0 18px 16px 38px;
  font-size: .84rem;
  line-height: 1.75;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* Light theme */
[data-theme="light"] .seo-faq-item {
  border-color: #d0dfe0;
  background: #fff;
}
[data-theme="light"] .seo-faq-item:hover,
[data-theme="light"] .seo-faq-item[open] {
  border-color: #c9a84c;
}
[data-theme="light"] .seo-faq-item summary { color: #0f1118; }
[data-theme="light"] .seo-faq-item summary:hover { background: #f7fbfc; }
[data-theme="light"] .seo-faq-item p {
  color: #374060;
  border-top-color: #e1ecf1;
}

/* ── RELATED TOOLS GRID ── */
.related-tools {
  margin-bottom: 64px;
}

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

.related-tool-card {
  display: block;
  padding: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-secondary);
  transition: border-color .15s, background .15s, transform .15s;
}

.related-tool-card:hover {
  border-color: var(--gold);
  background: rgba(201,168,76,.04);
  transform: translateY(-2px);
  color: var(--text-secondary);
  text-decoration: none;
}

.related-tool-card--featured {
  background: rgba(201,168,76,.05);
  border-color: rgba(201,168,76,.25);
}

.related-tool-card--featured:hover {
  background: rgba(201,168,76,.09);
}

.rtc-title {
  font-weight: 600;
  font-size: .85rem;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.rtc-title--gold { color: var(--gold); }

.rtc-desc {
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Light theme */
[data-theme="light"] .related-tool-card {
  background: #fff;
  border-color: #d0dfe0;
}
[data-theme="light"] .related-tool-card:hover {
  border-color: #c9a84c;
  background: #fffbf0;
}
[data-theme="light"] .related-tool-card--featured {
  background: #fffbf2;
  border-color: rgba(201,168,76,.4);
}
[data-theme="light"] .rtc-title { color: #0f1118; }
[data-theme="light"] .rtc-title--gold { color: #7a5200; }
[data-theme="light"] .rtc-desc { color: #505870; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .seo-intent {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
  }
  .seo-intent__h1 { font-size: 1rem; }
  .seo-intent__lead { font-size: .80rem; }

  .seo-longform,
  .seo-faq,
  .related-tools {
    padding: 0 16px;
  }
  .seo-longform { margin-top: 36px; }
  .seo-section__h2 { font-size: 1.15rem; }
  .related-tools__grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}

@media (max-width: 480px) {
  .seo-chip { font-size: .68rem; padding: 2px 8px; }
  .seo-faq-item summary { font-size: .83rem; padding: 12px 14px; }
  .seo-faq-item p { padding: 10px 14px 14px 28px; }
  .related-tools__grid { grid-template-columns: 1fr; }
}
