/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'Outfit', sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; }
input, button, select, textarea { font: inherit; }
img { display: block; max-width: 100%; }

/* ── Theme Variables ───────────────────────────────────────────────────── */
:root, [data-theme="dark"] {
  --bg: #060c18;
  --surface: #0a1525;
  --card: #07101f;
  --border: #0e1e35;
  --border-hi: #1a3050;
  --amber: #f5a623;
  --green: #22c55e;
  --red: #f43f5e;
  --blue: #38bdf8;
  --muted: #5a7090;
  --dim: #2a4060;
  --text: #f0f4f8;
  --text-card: #aac0d2;
  --text-body: #7a96b0;
  --purple: #c084fc;
  --orange: #fb923c;
  --teal: #2dd4bf;
  --div-blue: #4f6dde;
  --wages-amber: #d4a04a;
  --slider-green: #22c55e44;
  --slider-blue: #4f6dde44;
  --slider-amber: #d4a04a66;
  --chart-grid: #0d1c30;
  --shadow-glow: rgba(255,255,255,0.13);
  --sidebar-width: 240px;
  --content-max: 860px;
}

[data-theme="light"] {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --card: #ffffff;
  --border: #e2e8f0;
  --border-hi: #cbd5e1;
  --amber: #d4891a;
  --green: #16a34a;
  --red: #dc2626;
  --blue: #0284c7;
  --muted: #64748b;
  --dim: #94a3b8;
  --text: #1e293b;
  --text-card: #1e293b;
  --text-body: #475569;
  --purple: #9333ea;
  --orange: #ea580c;
  --teal: #0d9488;
  --div-blue: #3b5cc6;
  --wages-amber: #b8860b;
  --slider-green: #16a34a44;
  --slider-blue: #3b5cc644;
  --slider-amber: #b8860b66;
  --chart-grid: #e2e8f0;
  --shadow-glow: rgba(0,0,0,0.13);
  --content-max: 860px;
}

body { background: var(--bg); color: var(--text); }

/* ── Layout ────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-width); height: 100vh;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-header { padding: 24px 20px 16px; border-bottom: 1px solid var(--border); }
.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.sidebar-footer { padding: 12px 20px; border-top: 1px solid var(--border); }
.sidebar-copyright { font-size: 11px; color: var(--muted); margin: 4px 0 2px; }
.sidebar-disclaimer { font-size: 10px; color: var(--dim); margin: 0; line-height: 1.4; }
.sidebar-disclaimer a { color: var(--dim); text-decoration: underline; }
.main { margin-left: var(--sidebar-width); min-height: 100vh; }
body.wage-mode .main { height: 100vh; min-height: unset; overflow: hidden; display: flex; flex-direction: column; padding-bottom: 8px; }
body.wage-mode .content { flex: 1; overflow: hidden; padding-bottom: 0; display: flex; flex-direction: column; min-height: 0; }
body.wage-mode .wage-table-box { flex: 1; overflow: hidden; min-height: 0; margin-bottom: 0; display: flex; flex-direction: column; }
body.wage-mode .wage-table-box .wage-table-wrap { flex: 1; min-height: 0; max-height: none; }
body.director-mode .main { height: 100vh; min-height: unset; overflow: hidden; display: flex; flex-direction: column; padding-bottom: 8px; }
body.director-mode .content { flex: 1; overflow: hidden; padding-bottom: 0; display: flex; flex-direction: column; min-height: 0; }
body.compound-mode .main { height: 100vh; min-height: unset; overflow: hidden; display: flex; flex-direction: column; }
body.compound-mode .content { flex: 1; overflow: hidden; padding-bottom: 0; display: flex; flex-direction: column; min-height: 0; }
body.mortgage-mode .main { height: 100vh; min-height: unset; overflow: hidden; display: flex; flex-direction: column; padding-bottom: 8px; }
body.mortgage-mode .content { flex: 1; overflow: hidden; padding-bottom: 0; display: flex; flex-direction: column; min-height: 0; }
.topbar {
  display: none; align-items: center; padding: 12px 20px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.content { width: 100%; padding: 32px 32px 60px; max-width: var(--content-max); margin: 0 auto; }

/* ── Logo ──────────────────────────────────────────────────────────────── */
.logo {
  font-family: 'Cormorant Garamond', serif; font-size: 24px;
  font-weight: 700; color: var(--text); letter-spacing: -0.5px;
}
.logo-accent { color: var(--amber); }
.logo-mobile { display: none; }

/* ── Nav Items ─────────────────────────────────────────────────────────── */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px; color: var(--muted);
  text-decoration: none; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.15s ease;
  border: 1px solid transparent; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: rgba(245, 166, 35, 0.06); color: var(--amber); }
.nav-item.active {
  background: rgba(245, 166, 35, 0.1); color: var(--amber);
  border-color: rgba(245, 166, 35, 0.15);
}
.nav-icon { width: 24px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-icon svg { display: block; }
.nav-section {
  font-size: 9px; color: var(--dim); text-transform: uppercase;
  letter-spacing: 2px; padding: 16px 14px 6px; font-weight: 700;
}

/* ── Hamburger ─────────────────────────────────────────────────────────── */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px; transition: 0.2s;
}

/* ── Overlay ───────────────────────────────────────────────────────────── */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5); z-index: 90;
}
.overlay.active { display: block; }

/* ── Theme Toggle ──────────────────────────────────────────────────────── */
.theme-toggle {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; cursor: pointer;
  font-size: 16px; color: var(--text); transition: 0.15s;
}
.theme-toggle:hover { border-color: var(--border-hi); }

/* ── Components ────────────────────────────────────────────────────────── */

/* Box / Card */
.box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; margin-bottom: 16px;
}
.box.no-pad { padding: 16px 0 0; }
.box-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.box.no-pad .box-header { padding: 0 16px; }
.box-title {
  font-size: 10px; color: var(--dim); text-transform: uppercase;
  letter-spacing: 1.5px; font-weight: 700;
}
.box-badge {
  font-size: 9px; background: rgba(245, 166, 35, 0.12); color: var(--amber);
  padding: 3px 8px; border-radius: 20px;
  border: 1px solid rgba(245, 166, 35, 0.2); font-weight: 700;
}

/* ⓘ info toggle in box header */
.box-info-toggle {
  font-size: 13px; background: none; border: none; padding: 0 2px;
  cursor: pointer; color: var(--orange); opacity: 0.65;
  transition: color 0.15s, opacity 0.15s; line-height: 1; flex-shrink: 0;
}
.box-info-toggle:hover { opacity: 1; }
.box-info-toggle.active { opacity: 1; }

/* Scheme pills (PAYE / CIS toggle inside box header) */
.scheme-pills { display: flex; gap: 4px; }
.scheme-pill {
  padding: 3px 10px; font-size: 10px; font-weight: 700;
  font-family: 'Outfit', sans-serif; letter-spacing: 0.5px;
  border: 1px solid var(--border); border-radius: 20px;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: 0.15s;
}
.scheme-pill.active {
  border-color: var(--amber); background: rgba(245, 166, 35, 0.10);
  color: var(--amber);
}
.scheme-divider {
  width: 1px; background: var(--border); margin: 2px 4px;
  align-self: stretch;
}
.corp-pill.active {
  border-color: var(--purple); background: rgba(168, 85, 247, 0.10);
  color: var(--purple);
}

/* Income type pills */
.income-type-wrap {
  display: grid; grid-template-columns: auto 1fr; gap: 16px;
  align-items: start; margin-bottom: 16px;
  height: 68px; overflow: hidden;
}
.income-type-left { display: flex; flex-direction: column; gap: 7px; }
.income-type-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.income-type-pill {
  padding: 6px 14px; font-size: 11px; font-weight: 600;
  font-family: 'Outfit', sans-serif;
  border: 1px solid var(--border); border-radius: 20px;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: 0.15s;
}
.income-type-pill.active {
  border-color: var(--amber); background: rgba(245, 166, 35, 0.10);
  color: var(--amber);
}
.income-type-info {
  font-size: 11px; line-height: 1.45; color: var(--muted);
  padding: 0 14px; border-left: 2px solid var(--border);
  align-self: stretch; display: flex; align-items: center;
  overflow: hidden;
}

/* Split label */
.split-label {
  font-size: 12px; color: var(--text); font-weight: 600;
  font-family: 'JetBrains Mono', monospace; margin-bottom: 6px;
  text-align: center;
}

/* Split row (Income vs Dividend) — 3 boxes + sliders row beneath */
.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px 12px;
  align-items: start;
}
.split-box { display: flex; flex-direction: column; gap: 8px; }
.split-box .field-label { min-height: 32px; display: flex; align-items: flex-end; }
.split-pct {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 400;
  padding: 0 11px; flex-shrink: 0;
  border-left: 1px solid var(--border);
}
.split-pct-green { color: var(--green); }
.split-pct-blue { color: var(--div-blue); }
.split-income-slider {
  grid-column: 1;
  display: flex; align-items: center;
}
.split-slider-wrap {
  grid-column: 2 / 4;
  display: flex; flex-direction: column; gap: 0;
}

/* Colored slider shared sizing */
.slider-green, .slider-blue, .slider-amber, .slider-split {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 3px;
  background: var(--border); outline: none; cursor: pointer;
  margin: 0;
}
.slider-green::-webkit-slider-thumb,
.slider-blue::-webkit-slider-thumb,
.slider-amber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--amber); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.slider-green::-moz-range-thumb,
.slider-blue::-moz-range-thumb,
.slider-amber::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--amber); border: none; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.slider-green::-moz-range-track,
.slider-blue::-moz-range-track,
.slider-amber::-moz-range-track {
  height: 6px; border-radius: 3px; background: var(--border);
}
.slider-split::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--amber); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.slider-split::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--amber); border: none; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.slider-split::-moz-range-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--slider-green) 70%, var(--slider-blue) 70%);
}

/* Both row (Income + Dividend) — 3-col grid matching split-row */
.both-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 8px 12px;
  align-items: start;
}
.both-box { display: flex; flex-direction: column; gap: 8px; }
.both-box .field-label { min-height: 32px; display: flex; align-items: flex-end; }
.both-income-slider { grid-column: 1; display: flex; align-items: center; }
.both-wages-slider  { grid-column: 2; display: flex; align-items: center; }
.both-div-slider    { grid-column: 3; display: flex; align-items: center; }

/* Page Title */
.page-title {
  font-family: 'Cormorant Garamond', serif; font-size: 28px;
  font-weight: 700; color: var(--text); letter-spacing: -0.5px;
  margin-bottom: 4px;
}
.page-subtitle { font-size: 11px; color: var(--muted); margin-bottom: 22px; }

/* Wage calculator — title row with colourize toggle */
.wage-title-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.wage-title-row .page-title { margin-bottom: 0; }
.colorize-btn {
  font-size: 10px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; padding: 3px 11px; border-radius: 20px;
  border: 1px solid var(--border-hi); background: transparent;
  color: var(--muted); cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap; flex-shrink: 0;
}
.colorize-btn:hover { border-color: var(--amber); color: var(--amber); }
.colorize-btn.active {
  border-color: var(--amber); background: rgba(245,166,35,0.08); color: var(--amber);
}

/* Wage calculator — decolorized mode: neutralise input-area colours */
.wage-no-color .num-input-green input,
.wage-no-color .num-input-green .num-input-prefix,
.wage-no-color .num-input-amber input,
.wage-no-color .num-input-amber .num-input-prefix,
.wage-no-color .num-input-blue input,
.wage-no-color .num-input-blue .num-input-prefix { color: var(--text) !important; }
.wage-no-color .split-pct-blue,
.wage-no-color .split-pct-green { color: var(--muted) !important; }

/* Field */
.field { margin-bottom: 16px; }
.field-header {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 7px;
}
.field-label {
  font-size: 10px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 1.5px; font-weight: 700;
}
.field-note { font-size: 10px; color: var(--dim); font-style: italic; }

/* Number Input */
.num-input {
  display: flex; align-items: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.num-input-prefix {
  padding: 0 11px; color: var(--dim);
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  border-right: 1px solid var(--border); flex-shrink: 0;
}
.num-input input {
  background: transparent; border: none; outline: none;
  padding: 10px 12px; color: var(--text);
  font-family: 'JetBrains Mono', monospace; font-size: 15px;
  width: 100%; min-width: 0;
}
.num-input-green input, .num-input-green .num-input-prefix { color: var(--green); }
.num-input-amber input, .num-input-amber .num-input-prefix { color: var(--wages-amber); }
.num-input-blue input, .num-input-blue .num-input-prefix { color: var(--div-blue); }
/* Hide number input spinners */
.num-input input::-webkit-outer-spin-button,
.num-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num-input input[type=number] { -moz-appearance: textfield; }

/* ── Range Slider ─────────────────────────────────────────────────────── */
/* The bordered-track, glow-thumb style is the standard across all calculators. */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  margin-top: 4px;
  background: var(--dim); /* JS overrides with gradient fill */
}
.slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: inherit; /* picks up the JS-set gradient */
  box-shadow: 0 0 0 1px var(--border-hi); /* the subtle border that gives depth */
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--amber);
  cursor: pointer;
  margin-top: -6px;
  box-shadow: 0 0 8px rgba(245,166,35,0.35), 0 1px 3px rgba(0,0,0,.5);
  transition: transform 0.15s;
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.12); }
.slider::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: var(--dim);
  border: 1px solid var(--border-hi);
}
.slider::-moz-range-progress {
  height: 6px;
  border-radius: 3px 0 0 3px;
  background: var(--amber);
}
.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--amber);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(245,166,35,0.35), 0 1px 3px rgba(0,0,0,.5);
}

/* Select */
.select {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; color: var(--text);
  font-family: 'Outfit', sans-serif; font-size: 13px; outline: none; cursor: pointer;
}
.select option { background: var(--surface); color: var(--text); }

/* Grid */
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }

/* Shared wrapper for rate / split / both rows — consistent vertical space */
.input-rows-wrap { height: 110px; margin-bottom: 16px; }

/* Rate row — inline grid for rate + hours + weeks */
.rate-row {
  display: grid; gap: 14px;
  align-items: start;
}
.rate-col { display: flex; flex-direction: column; gap: 8px; }
.rate-col .num-input { margin-top: 0; }
.rate-col .slider { margin-top: 0; }
.rate-row .field-header { margin-bottom: 0; min-height: 32px; align-items: flex-end; }

/* Dropdown label that replaces the pay frequency pills */
.rate-mode-select {
  appearance: none; -webkit-appearance: none;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; outline: none;
  font-size: 11px; color: var(--amber); text-transform: uppercase;
  letter-spacing: 1.2px; font-weight: 700;
  font-family: 'Outfit', sans-serif;
  cursor: pointer; padding: 4px 24px 4px 8px;
  white-space: nowrap;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23f5a623'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  transition: border-color 0.15s;
}
.rate-mode-select:hover { border-color: var(--amber); }
.rate-mode-select option {
  background: var(--surface); color: var(--text);
  font-size: 13px; text-transform: none; letter-spacing: 0;
}

/* Table */
.data-table { width: 100%; border-collapse: collapse; min-width: 400px; }
.data-table th {
  padding: 9px 14px; font-size: 10px; color: var(--dim);
  text-transform: uppercase; letter-spacing: 1.5px;
  font-weight: 700; background: var(--surface);
  position: sticky; top: 0; z-index: 2;
  /* box-shadow replaces border-bottom — borders vanish on sticky with border-collapse */
  box-shadow: 0 1px 0 var(--border);
}
.data-table td { padding: 10px 14px; font-size: 13px; }
.data-table tr { border-bottom: 1px solid var(--bg); }
.data-table thead tr { border-bottom: none; }

/* Sticky Disposable Income footer */
.data-table tfoot td {
  position: sticky; bottom: 0; z-index: 2;
  background: var(--surface);
  box-shadow: 0 -1px 0 var(--border);
}

/* Scrollable table wrapper (wage calculator) */
.wage-table-wrap {
  overflow-x: auto; overflow-y: auto;
  /* Scroll-shadow technique: local covers hide the scroll shadow when at edge;
     scroll-attachment radial gradients are always visible and revealed on scroll */
  background:
    linear-gradient(var(--surface) 20%, transparent) center top    / 100% 52px no-repeat local,
    linear-gradient(transparent, var(--surface) 80%) center bottom / 100% 52px no-repeat local,
    radial-gradient(farthest-side at 50% 0,    var(--shadow-glow), transparent) center top    / 100% 18px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, var(--shadow-glow), transparent) center bottom / 100% 18px no-repeat scroll;
}
.wage-table-wrap::-webkit-scrollbar { width: 4px; height: 4px; }
.wage-table-wrap::-webkit-scrollbar-track { background: transparent; }
.wage-table-wrap::-webkit-scrollbar-thumb {
  background: var(--border-hi); border-radius: 4px;
}
.wage-table-wrap::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.mono { font-family: 'JetBrains Mono', monospace; }

/* Toggle buttons — pill style, consistent with income-type pills */
.toggle-group { display: flex; gap: 8px; }
.toggle-btn {
  flex: 1; padding: 8px 14px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); border-radius: 20px;
  font-size: 12px; cursor: pointer; font-family: 'Outfit', sans-serif; font-weight: 600;
  transition: 0.15s; letter-spacing: 0.03em;
}
.toggle-btn:hover:not(.active) { border-color: var(--border-hi); color: var(--text); }
.toggle-btn.active {
  border-color: var(--amber); background: rgba(245, 166, 35, 0.08);
  color: var(--amber);
}

/* ── Stat Grid (shared summary component) ──────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.stat-card {
  padding: 12px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 10px;
  position: relative; /* for info badge absolute positioning */
}
.stat-info-btn {
  position: absolute;
  bottom: 7px; right: 8px;
  background: none; border: none;
  color: var(--dim);
  font-size: 11px; cursor: pointer;
  padding: 2px 3px; line-height: 1;
  opacity: 0.65;
  transition: color 0.15s, opacity 0.15s;
}
.stat-info-btn:hover { color: var(--amber); opacity: 1; }
.stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 700;
}
.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}
.stat-sub { font-size: 10px; color: var(--muted); margin-top: 3px; }
.stat-amber { color: var(--amber); }
.stat-green { color: var(--green); }
.stat-red   { color: var(--red); }
.stat-blue  { color: var(--blue); }

/* ── View Tabs (chart / table toggle inside a box) ──────────────────────── */
.view-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin: 0 0 0;
  padding: 0 16px;
}
.view-tab {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: none;
  background: none;
  font-family: 'Outfit', sans-serif;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.view-tab.active { color: var(--amber); border-bottom-color: var(--amber); }
.view-tab:hover:not(.active) { color: var(--text); }

/* ── Utility ────────────────────────────────────────────────────────────── */
.overflow-x { overflow-x: auto; }
.text-right { text-align: right; }
.text-left  { text-align: left; }

/* Pill buttons (chart legend) */
.pill-group { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pill {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; border: 1px solid var(--border);
  background: transparent; border-radius: 20px; cursor: pointer;
  font-family: 'Outfit', sans-serif; font-size: 11px;
  color: var(--dim); font-weight: 500; transition: 0.15s;
}

/* Add Item */
.add-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; background: transparent;
  border: 1px dashed var(--border); border-radius: 10px;
  color: var(--muted); font-size: 12px; cursor: pointer;
  width: 100%; font-family: 'Outfit', sans-serif; margin-top: 6px;
}
.add-form {
  background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: 12px; padding: 12px 14px; margin-top: 6px;
}
.add-form-grid {
  display: grid; grid-template-columns: 1fr 110px;
  gap: 8px; margin-bottom: 8px;
}
.add-form input {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 11px; color: var(--text);
  font-size: 13px; outline: none;
}
.add-form input[type="number"] { font-family: 'JetBrains Mono', monospace; }
.add-form-actions { display: flex; gap: 7px; }

.btn-primary {
  flex: 1; padding: 8px; background: var(--amber); border: none;
  border-radius: 8px; color: #000; font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: 'Outfit', sans-serif;
}
.btn-secondary {
  padding: 8px 14px; background: transparent;
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted); font-size: 12px; cursor: pointer;
  font-family: 'Outfit', sans-serif;
}
.btn-submit {
  width: 100%; padding: 12px; margin-top: 8px;
  border: 1px solid var(--amber); border-radius: 8px;
  background: rgba(245, 166, 35, 0.10); color: var(--amber);
  font-size: 14px; font-weight: 700; cursor: pointer;
  font-family: 'Outfit', sans-serif; transition: background 0.15s;
}
.btn-submit:hover { background: rgba(245, 166, 35, 0.20); }
.btn-submit:disabled { opacity: 0.45; cursor: not-allowed; }

/* Freq selector */
.freq-group { display: flex; gap: 5px; margin-bottom: 10px; flex-wrap: wrap; }
.freq-btn {
  padding: 4px 10px; border: 1px solid var(--border);
  background: transparent; color: var(--dim); border-radius: 6px;
  font-size: 10px; cursor: pointer; font-family: 'Outfit', sans-serif;
}
.freq-btn.active {
  border-color: var(--amber); background: rgba(245, 166, 35, 0.1);
  color: var(--amber);
}

/* Item list */
.item-row {
  display: grid; grid-template-columns: 1fr auto auto;
  align-items: center; gap: 10px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 12px; margin-bottom: 5px;
}
.item-name { font-size: 12px; color: var(--muted); }
.item-amount { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--dim); }
.item-remove {
  background: transparent; border: none; color: var(--dim);
  cursor: pointer; font-size: 15px; padding: 0 2px; line-height: 1;
}

/* Chart container */
.chart-wrap { position: relative; height: 220px; margin-top: 8px; }
.chart-footer {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
}
.chart-stat-label { font-size: 10px; color: var(--muted); margin-bottom: 2px; }
.chart-stat-value { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 600; }

/* ── Portfolio specific ────────────────────────────────────────────────── */
.etf-filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-btn {
  padding: 5px 12px; border: 1px solid var(--border); background: transparent;
  color: var(--muted); border-radius: 8px; font-size: 11px; cursor: pointer;
  font-family: 'Outfit', sans-serif; transition: 0.15s;
}
.filter-btn.active {
  border-color: var(--amber); background: rgba(245, 166, 35, 0.08);
  color: var(--amber);
}
.etf-table { font-size: 12px; }
.etf-table th { font-size: 9px; }
.etf-table td { padding: 8px 10px; }
.etf-add-btn {
  padding: 4px 10px; background: rgba(245, 166, 35, 0.1);
  border: 1px solid rgba(245, 166, 35, 0.2); border-radius: 6px;
  color: var(--amber); font-size: 10px; cursor: pointer;
  font-family: 'Outfit', sans-serif; font-weight: 600;
}
.portfolio-item {
  display: grid; grid-template-columns: auto 1fr 80px auto;
  align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 9px; margin-bottom: 5px;
}
.weight-input {
  width: 70px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 8px; color: var(--text);
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  text-align: right; outline: none;
}

/* ── Feedback FAB ──────────────────────────────────────────────────────── */
.fab {
  position: fixed; bottom: 24px; right: 24px;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--amber); border: none; color: #000;
  font-size: 20px; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s;
}
.fab:hover { transform: scale(1.1); }

/* ── Blog ──────────────────────────────────────────────────────────────── */
.blog-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; margin-bottom: 14px;
  cursor: pointer; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.blog-card:hover {
  border-color: rgba(245, 166, 35, 0.35);
  background: rgba(245, 166, 35, 0.05);
  box-shadow: 0 4px 18px rgba(0,0,0,0.18);
}
.blog-card:hover .blog-title { color: var(--amber); }
.blog-title { font-size: 16px; font-weight: 600; color: var(--text-card); margin-bottom: 6px; transition: color 0.2s; }
.blog-summary { font-size: 13px; color: var(--muted); line-height: 1.6; }
.blog-meta { font-size: 11px; color: var(--dim); margin-top: 8px; letter-spacing: 0.2px; }
.blog-back-btn {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted); font-size: 13px; padding: 6px 14px; cursor: pointer;
  transition: border-color 0.15s;
}
.blog-back-btn:hover { border-color: var(--border-hi); color: var(--text); }
.blog-content { font-size: 14px; line-height: 1.8; color: var(--text-body); }
.blog-content h1 { font-size: 1.4rem; font-weight: 700; color: var(--text-card); margin: 28px 0 10px; }
.blog-content h2 { font-size: 1.05rem; font-weight: 600; color: var(--text-card); margin: 28px 0 10px; }
.blog-content h3 { font-size: 0.95rem; font-weight: 600; color: var(--text-card); margin: 20px 0 8px; }
.blog-content p { margin: 0 0 14px; }
.blog-content ul, .blog-content ol { padding-left: 20px; margin: 0 0 14px; }
.blog-content li { margin-bottom: 6px; }
.blog-content strong { color: var(--text-card); }
.blog-content em { color: var(--dim); font-style: italic; font-size: 12px; }
.blog-content a { color: var(--amber); text-decoration: none; }
.blog-content a:hover { text-decoration: underline; }
.blog-content hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.blog-content blockquote { border-left: 3px solid var(--border-hi); padding-left: 14px; color: var(--muted); margin: 0 0 14px; }

/* ── Feedback Page ─────────────────────────────────────────────────────── */
.feedback-form { max-width: 500px; }
.feedback-form textarea {
  width: 100%; min-height: 120px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; color: var(--text); font-size: 13px;
  outline: none; resize: vertical; font-family: 'Outfit', sans-serif;
}
.feedback-form textarea:focus { border-color: var(--border-hi); }
.feedback-success {
  background: rgba(34, 197, 94, 0.08); border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 10px; padding: 16px; color: var(--green); text-align: center;
}

/* ── Legal ─────────────────────────────────────────────────────────────── */
.legal-tab-bar {
  display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap;
}
.legal-tab {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 14px; background: var(--card);
  border: 1px solid var(--border); border-radius: 24px;
  color: var(--muted); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.legal-tab:hover { border-color: var(--border-hi); color: var(--text); }
.legal-tab.active {
  background: rgba(245, 166, 35, 0.08);
  border-color: rgba(245, 166, 35, 0.25); color: var(--amber);
}
.legal-tab-icon { display: flex; align-items: center; flex-shrink: 0; }
.legal-panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 32px; color: var(--text-body);
  line-height: 1.7;
}
.legal-panel h1 {
  font-family: 'Cormorant Garamond', serif; font-size: 26px;
  font-weight: 700; color: var(--text-card);
  border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 6px;
}
.legal-panel h2 {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--muted); margin: 28px 0 8px;
}
.legal-panel p { margin-bottom: 10px; font-size: 14px; }
.legal-panel ul { padding-left: 20px; margin-bottom: 10px; }
.legal-panel li { font-size: 14px; margin-bottom: 4px; }
.legal-panel a { color: var(--blue); }
.legal-panel .updated { color: var(--muted); font-size: 12px; margin-bottom: 20px; display: block; }
.legal-panel .notice {
  background: rgba(245, 166, 35, 0.06); border-left: 3px solid var(--amber);
  padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 16px 0; font-size: 13px;
}
.legal-panel table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13px; }
.legal-panel th {
  background: var(--surface); text-align: left; padding: 8px 12px;
  border: 1px solid var(--border); color: var(--muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700;
}
.legal-panel td { padding: 8px 12px; border: 1px solid var(--border); vertical-align: top; }
.legal-loading { color: var(--muted); font-size: 14px; text-align: center; padding: 40px 0; }

/* ── Sidebar copyright ─────────────────────────────────────────────────── */
.sidebar-copyright {
  font-size: 10px; color: var(--dim); text-align: center;
  margin-top: 10px; letter-spacing: 0.3px; user-select: none;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar { display: flex; }
  .hamburger { display: flex; }
  .logo-mobile {
    display: block; flex: 1; text-align: center;
    font-family: 'Cormorant Garamond', serif; font-size: 20px;
    font-weight: 700; color: var(--text);
  }
  .content { padding: 24px 20px 60px; }
  /* Wage mode: release fixed-height lock so page scrolls normally on mobile */
  body.wage-mode .main { height: auto; overflow: auto; }
  body.wage-mode .content { flex: none; overflow: auto; }
  body.wage-mode .wage-table-box { flex: none; }
  body.wage-mode .wage-table-box .wage-table-wrap { max-height: 420px; }
  /* Director mode: release fixed-height lock on mobile */
  body.director-mode .main { height: auto; overflow: auto; }
  body.director-mode .content { flex: none; overflow: auto; }
  /* Compound mode: release fixed-height lock on mobile */
  body.compound-mode .main { height: auto; overflow: auto; }
  body.compound-mode .content { flex: none; overflow: auto; }
  /* Mortgage mode: release fixed-height lock on mobile */
  body.mortgage-mode .main { height: auto; overflow: auto; }
  body.mortgage-mode .content { flex: none; overflow: auto; }
  .mortgage-results { flex: none; overflow: visible; }
  .director-results { flex: none; overflow: visible; max-height: none; }
}

@media (max-width: 767px) {
  .row-2 { grid-template-columns: 1fr; }
  .chart-footer { grid-template-columns: 1fr; }
  .content { padding: 16px 14px 60px; }
  .page-title { font-size: 24px; }
  .add-form-grid { grid-template-columns: 1fr; }
  .inline-form-grid { grid-template-columns: 1fr; }
  .portfolio-item { grid-template-columns: auto 1fr auto; }
  .mort-ctrl { grid-template-columns: 1fr; gap: 6px 0; padding: 10px 0; }
}

@media (max-width: 480px) {
  /* Wage split/both rows: stack to single column on small phones */
  .split-row {
    grid-template-columns: 1fr;
  }
  .split-income-slider { grid-column: auto; }
  .split-slider-wrap { grid-column: auto; }
  .both-row {
    grid-template-columns: 1fr;
  }
  .both-income-slider { grid-column: auto; }
  .both-wages-slider  { grid-column: auto; }
  .both-div-slider    { grid-column: auto; }
  /* Income type wrap: switch to column so pills can wrap freely */
  .income-type-wrap {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .income-type-info {
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 8px 0 0;
  }
}

/* ── Mortgage compact controls ─────────────────────────────────────────── */
.mort-ctrl {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 0 16px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.mort-ctrl:last-child { border-bottom: none; }
.mort-ctrl-label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 1.2px;
  font-weight: 700; color: var(--dim); line-height: 1.3;
}
.mort-ctrl-val {
  display: block; font-family: 'JetBrains Mono', monospace;
  font-size: 13px; color: var(--text); margin-top: 2px;
}
.mort-ctrl .slider { margin-top: 0; }

/* Mort chart info panel line items — two column: title | description */
.mort-info-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0 16px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px; line-height: 1.6;
}
.mort-info-row:last-child { border-bottom: none; padding-bottom: 0; }
.mort-info-title {
  display: flex; align-items: center; gap: 7px;
  font-weight: 600; color: var(--text); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.mort-info-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.mort-info-desc { color: var(--muted); font-size: 12px; }

/* Summary row info toggle & expandable explanation */
.sum-row-info { cursor: pointer; }
.sum-info-btn {
  background: none; border: none; padding: 0 0 0 5px;
  font-size: 11px; color: var(--orange); opacity: 0.65;
  cursor: pointer; vertical-align: middle;
  transition: opacity 0.15s;
}
.sum-info-btn:hover, .sum-info-btn.active { opacity: 1; }
.sum-info-expand {
  display: none; font-size: 11px; color: var(--muted);
  line-height: 1.6; padding: 4px 0 6px; font-style: italic;
}
.sum-info-expand.show { display: block; }

/* ── Utility ───────────────────────────────────────────────────────────── */
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.overflow-x { overflow-x: auto; }
.dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; margin-right: 8px; vertical-align: middle;
}
.mb-16 { margin-bottom: 16px; }
.mt-8 { margin-top: 8px; }

/* ── Info Badge / Tooltip ──────────────────────────────────────────────── */
.info-label {
  cursor: pointer; transition: color 0.15s;
  position: relative;
}
.info-label:hover, .info-label.active { color: var(--orange); }
.info-label .info-icon {
  display: inline-block; font-size: 10px; margin-left: 4px;
  opacity: 0; transition: opacity 0.15s;
}
.info-label:hover .info-icon, .info-label.active .info-icon { opacity: 1; }

.info-popup {
  display: none; position: fixed; z-index: 10000;
  background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: 12px; padding: 14px 16px;
  min-width: 260px; max-width: 340px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  pointer-events: auto;
}
.info-popup.show { display: block; }
.info-popup-title {
  font-size: 12px; font-weight: 700; color: var(--amber);
  margin-bottom: 6px; text-transform: none; letter-spacing: 0;
}
.info-popup-text {
  font-size: 12px; color: var(--muted); line-height: 1.7;
  text-transform: none; letter-spacing: 0; font-weight: 400;
  white-space: pre-line;
}

/* ── Expandable Section ────────────────────────────────────────────────── */
.expandable { margin-top: 2px; }
.expandable-toggle {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; color: var(--muted);
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; cursor: pointer; padding: 8px 14px;
  width: 100%; text-align: left; transition: color 0.15s;
  font-family: 'Outfit', sans-serif;
}
.expandable-toggle:hover { color: var(--amber); }
.expandable-chevron {
  display: inline-block; transition: transform 0.2s;
  font-size: 9px;
}
.expandable.open .expandable-chevron { transform: rotate(90deg); }
.expandable-body {
  display: none; padding: 4px 0 12px; overflow-x: auto;
}
.expandable.open .expandable-body { display: block; }

/* Breakdown mini-table inside expandable */
.breakdown-table { width: 100%; border-collapse: collapse; min-width: 500px; }
.breakdown-table th {
  padding: 5px 8px; font-size: 9px; color: var(--dim);
  text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700;
}
.breakdown-table td {
  padding: 5px 8px; font-size: 11px; color: var(--muted);
}
.breakdown-table td.mono, .breakdown-table th.text-right {
  text-align: right; font-family: 'JetBrains Mono', monospace;
}
.breakdown-table tr.subtotal td {
  border-top: 1px solid var(--border); padding-top: 8px;
  font-weight: 700; color: var(--text);
}

/* ── Unified Table (inline expand, outgoings, sub-rows) ────────────── */
.unified-table { min-width: 520px; }

.row-label-wrap {
  display: flex; align-items: center; gap: 6px;
}
.row-chevron {
  width: 14px; text-align: center; flex-shrink: 0;
  font-size: 9px; color: var(--dim); transition: transform 0.2s;
  display: inline-block;
}
.row-chevron.open { transform: rotate(90deg); }
.row-chevron-spacer { width: 14px; flex-shrink: 0; }

/* Expandable row hover */
.expandable-row:hover { background: rgba(245, 166, 35, 0.04); }

/* Sub-rows (breakdown bands) */
.sub-row td {
  font-size: 11px; color: var(--muted);
  padding-top: 3px; padding-bottom: 3px;
}
.sub-indent { padding-left: 24px; }
.sub-total td {
  border-top: 1px solid var(--border);
  font-weight: 700; color: var(--text);
  padding-top: 6px;
}

/* Section divider */
.section-divider td {
  padding: 16px 14px 6px;
  font-size: 9px; font-weight: 700; color: var(--dim);
  text-transform: uppercase; letter-spacing: 1.5px;
  border-top: 1px solid var(--border);
}
.section-divider-first td { border-top: none; padding-top: 6px; }

/* Outgoing rows */
.outgoing-row:hover { background: rgba(244, 63, 94, 0.04); }
.row-remove-btn {
  margin-left: auto; cursor: pointer; color: var(--dim);
  font-size: 14px; opacity: 0; transition: opacity 0.15s;
}
.outgoing-row:hover .row-remove-btn { opacity: 1; }

/* Row info button (ⓘ) */
.row-info-btn {
  font-size: 10px; cursor: pointer; color: var(--orange);
  opacity: 0.55; transition: opacity 0.15s; margin-left: 4px;
  flex-shrink: 0;
}
tr:hover .row-info-btn { opacity: 0.85; }
.row-info-btn:hover { opacity: 1; }

/* Table header ⓘ hint */
.th-info-hint {
  font-size: 9px; font-weight: 400; color: var(--muted);
  display: inline-flex; align-items: center; gap: 2px;
  letter-spacing: 0.03em; text-transform: none;
}
.th-info-icon {
  color: var(--orange); font-size: 10px; line-height: 1;
}

/* Rule top separator (e.g. Net Pay) */
.rule-top td { border-top: 1px solid var(--border); }

/* Inline add button (inside table) */
.inline-add-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; background: transparent;
  border: 1px dashed var(--border); border-radius: 8px;
  color: var(--muted); font-size: 11px; cursor: pointer;
  font-family: 'Outfit', sans-serif; width: 100%; margin: 4px 0;
}
.inline-add-btn:hover { color: var(--amber); border-color: var(--amber); }

/* Inline form (inside table row) */
.inline-form { padding: 10px 4px; }
.inline-form-grid {
  display: grid; grid-template-columns: 1fr 110px;
  gap: 8px; margin-bottom: 8px;
}
.inline-form input {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; color: var(--text);
  font-size: 12px; outline: none;
}
.inline-form input[type="number"] { font-family: 'JetBrains Mono', monospace; }
.inline-form-actions { display: flex; gap: 7px; }

/* ── Scheme Info (inside table box) ─────────────────────────────────── */
.scheme-info {
  font-size: 11px; color: var(--muted); line-height: 1.6;
  padding: 8px 16px 12px; margin: 0;
  min-height: 72px;
}
.scheme-info-corp {
  min-height: 0; padding-top: 10px; margin-top: 0;
  border-top: 1px solid var(--border);
}

/* ── Mortgage Calculator (dashboard mode) ─────────────────────────────── */
.mortgage-inputs {
  flex-shrink: 0; padding-bottom: 4px;
  border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.mortgage-results {
  flex: 1; overflow-y: auto; min-height: 0; padding-bottom: 24px;
  display: flex; flex-direction: column; gap: 16px;
  background:
    linear-gradient(var(--bg) 20%, transparent)    center top    / 100% 40px no-repeat local,
    linear-gradient(transparent, var(--bg) 80%)    center bottom / 100% 40px no-repeat local,
    radial-gradient(farthest-side at 50% 0,    var(--shadow-glow), transparent) center top    / 100% 16px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, var(--shadow-glow), transparent) center bottom / 100% 16px no-repeat scroll;
}
.mortgage-results::-webkit-scrollbar { width: 4px; }
.mortgage-results::-webkit-scrollbar-track { background: transparent; }
.mortgage-results::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 4px; }
.mortgage-results::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Ltd Company Calculator (Director mode) ───────────────────────────── */
/* No per-page max-width override — all pages share var(--content-max) */
.director-inputs { flex-shrink: 0; padding-bottom: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.director-results {
  flex: 1; overflow-y: auto; min-height: 0; padding-bottom: 24px;
  display: flex; flex-direction: column; gap: 16px;
  /* Scroll-shadow: local covers hide the glow at the edges; radial glows reveal on scroll */
  background:
    linear-gradient(var(--bg) 20%, transparent)    center top    / 100% 40px no-repeat local,
    linear-gradient(transparent, var(--bg) 80%)    center bottom / 100% 40px no-repeat local,
    radial-gradient(farthest-side at 50% 0,    var(--shadow-glow), transparent) center top    / 100% 16px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, var(--shadow-glow), transparent) center bottom / 100% 16px no-repeat scroll;
}
.director-results::-webkit-scrollbar { width: 4px; }
.director-results::-webkit-scrollbar-track { background: transparent; }
.director-results::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 4px; }
.director-results::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.director-table-wrap { overflow-x: auto; }

/* Director input rows */
.dir-top-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px;
  margin-bottom: 14px;
}
.dir-top-box { display: flex; flex-direction: column; gap: 8px; }
.dir-split-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px;
}
.dir-split-box { display: flex; flex-direction: column; gap: 8px; }
.dir-split-box .field-label { min-height: 28px; display: flex; align-items: flex-end; }
.dir-split-slider-wrap { grid-column: 1 / -1; display: flex; align-items: center; }

/* Director tables: fixed layout so columns align identically across all three sections */
.director-data-table { table-layout: fixed; }
.director-data-table col.dir-col-item { width: auto; }
.director-data-table col.dir-col-val  { width: 120px; }

/* Row ⓘ info badge */
.row-info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; background: none; border: none; padding: 0 3px;
  cursor: pointer; color: var(--orange); opacity: 0.45;
  transition: opacity 0.15s; vertical-align: middle; line-height: 1;
  font-family: inherit;
}
.row-info-btn:hover, .row-info-btn.active { opacity: 1; }

/* Expandable info panel inside director boxes */
.box-info-panel {
  display: none; padding: 10px 16px 14px;
  font-size: 12px; color: var(--muted); line-height: 1.75;
  border-bottom: 1px solid var(--border);
}
.box-info-panel.show { display: block; }
.box-info-panel strong {
  display: block; margin-bottom: 5px;
  font-size: 10px; font-weight: 700; color: var(--amber);
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* ── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hi); }
