/* ════════════════════════════════════════════════════════════
   Third Rock Wealth · TOOLS PAGE STYLES
   Calculators (SIP / Lumpsum / SIP-vs-Lumpsum) + Fund Overlap Analyser
   Editorial broadsheet × institutional research desk
   Loaded after main.css + funds.css + v8-tokens.css
   ════════════════════════════════════════════════════════════ */

/* ── HERO ─────────────────────────────────────────────────── */
.tools-hero {
  background: var(--paper-warm);
  border-bottom: 1px solid var(--ink);
  padding: clamp(40px, 6vw, 72px) 0 clamp(32px, 4.5vw, 56px);
  position: relative;
  overflow: hidden;
}
.tools-hero::after {
  content: '';
  position: absolute;
  right: -120px; top: -120px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, var(--signal-soft) 0%, transparent 70%);
  pointer-events: none;
}
.tools-hero .eyebrow {
  color: var(--warning);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.tools-hero .eyebrow::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--warning);
}
.tools-hero h1 {
  font-size: clamp(38px, 5.5vw, 64px);
  line-height: 1.0;
  margin: 0 0 18px;
  letter-spacing: -0.025em;
  max-width: 900px;
}
.tools-hero h1 .ital {
  font-style: italic;
  color: var(--warning);
  font-variation-settings: "SOFT" 80, "opsz" 100;
}
.tools-hero .lede {
  font-family: var(--serif);
  font-size: clamp(16px, 1.45vw, 19px);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0;
  font-variation-settings: "SOFT" 60;
}
.tools-hero-tag {
  position: absolute;
  top: 28px;
  right: clamp(20px, 5vw, 64px);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--neutral-grey);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tools-hero-tag::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--signal-light);
  box-shadow: 0 0 0 4px rgba(123, 165, 135, 0.18);
}
@media (max-width: 720px) {
  .tools-hero-tag { display: none; }
}

/* ── CALC SHELL · two-column layout ─────────────────────── */
.calc-shell {
  padding: clamp(32px, 5vw, 56px) 0 clamp(48px, 6vw, 80px);
}
.calc-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
@media (max-width: 920px) {
  .calc-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ── INPUT PANEL ─────────────────────────────────────────── */
.calc-panel {
  background: var(--paper-card);
  border: 1px solid var(--rule-strong);
  padding: clamp(24px, 3vw, 32px);
  position: sticky;
  top: calc(var(--header-h, 64px) + 16px);
}
@media (max-width: 920px) {
  .calc-panel { position: static; }
}
.calc-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--ink);
}
.calc-panel-head h2 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0;
}
.calc-panel-head .meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--neutral-grey);
}

.calc-field {
  margin-bottom: 28px;
}
.calc-field:last-of-type { margin-bottom: 16px; }

.calc-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.calc-label label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}
.calc-value-display {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.01em;
  font-variation-settings: "SOFT" 40, "opsz" 80;
}
.calc-value-display .unit {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--neutral-grey);
  margin-left: 4px;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.calc-input-num {
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
  transition: border-color var(--t-fast, 120ms) ease, background var(--t-fast, 120ms) ease;
}
.calc-input-num:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--paper-card);
}

.calc-select {
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%23283E2D' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5 11 1.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.calc-select:focus { outline: none; border-color: var(--ink); }

/* Custom range slider — branded */
.calc-range-wrap {
  margin-top: 14px;
  padding: 0 2px;
}
.calc-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--rule-strong);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.calc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--paper-card);
  box-shadow: 0 0 0 1px var(--ink), 0 2px 6px rgba(40, 62, 45, 0.25);
  cursor: grab;
  transition: transform 120ms ease;
}
.calc-range::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.15);
}
.calc-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--paper-card);
  box-shadow: 0 0 0 1px var(--ink), 0 2px 6px rgba(40, 62, 45, 0.25);
  cursor: grab;
}
.calc-range:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 5px;
}
.calc-range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 1px var(--ink), 0 0 0 5px var(--signal-soft), 0 2px 6px rgba(40, 62, 45, 0.25);
}
.calc-range:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 1px var(--ink), 0 0 0 5px var(--signal-soft), 0 2px 6px rgba(40, 62, 45, 0.25);
}
.calc-range-bounds {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--neutral-grey);
  margin-top: 8px;
  letter-spacing: 0.08em;
}

/* Preset chips for return rate */
.calc-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.calc-preset {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 7px 12px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all var(--t-fast, 120ms) ease;
}
.calc-preset:hover {
  border-color: var(--ink);
  background: var(--paper-card);
}
.calc-preset.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* Rate input — number field + preset chip row */
.calc-rate-input-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  align-items: center;
}
@media (max-width: 480px) {
  .calc-rate-input-row { grid-template-columns: 1fr; }
}
.calc-rate-input {
  font-family: var(--mono);
  font-size: 14px;
  padding: 10px 14px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
}
.calc-rate-input:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--paper-card);
}
.calc-rate-input::-webkit-outer-spin-button,
.calc-rate-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.calc-rate-input { -moz-appearance: textfield; }

.calc-rate-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.calc-rate-chip {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 8px 12px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all var(--t-fast, 120ms) ease;
  flex: 1 0 auto;
  text-align: center;
  min-width: 56px;
}
.calc-rate-chip:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--paper-card);
}
.calc-rate-chip.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.calc-rate-chip .chip-label {
  display: block;
  font-size: 9px;
  font-weight: 400;
  color: inherit;
  opacity: 0.65;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}
.calc-rate-chip.active .chip-label { opacity: 0.7; }
.calc-rate-hint {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--neutral-grey);
  margin-top: 8px;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

/* Footnote in the input panel */
.calc-panel-foot {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.65;
  color: var(--neutral-grey);
  letter-spacing: 0.02em;
}

/* ── RESULTS PANEL ──────────────────────────────────────── */
.calc-results {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.calc-stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 0;
  border: 1px solid var(--ink);
  background: var(--paper-card);
}
@media (max-width: 640px) {
  .calc-stat-row { grid-template-columns: 1fr; }
}

.calc-stat {
  padding: 28px 24px;
  border-right: 1px solid var(--rule-strong);
  position: relative;
}
.calc-stat:last-child { border-right: none; }
@media (max-width: 640px) {
  .calc-stat { border-right: none; border-bottom: 1px solid var(--rule-strong); }
  .calc-stat:last-child { border-bottom: none; }
}

.calc-stat.featured {
  background: var(--ink);
  color: var(--paper);
}
.calc-stat.featured .stat-label { color: rgba(244, 235, 217, 0.74); }
.calc-stat.featured .stat-value { color: var(--paper); }
.calc-stat.featured .stat-multiple { color: var(--signal-light); }

.stat-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--neutral-grey);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat-label::before {
  content: '';
  width: 6px; height: 6px;
  background: currentColor;
  opacity: 0.4;
  display: inline-block;
}
.calc-stat.featured .stat-label::before {
  background: var(--signal-light);
  opacity: 1;
}
.stat-value {
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.018em;
  font-variation-settings: "SOFT" 40, "opsz" 100;
  line-height: 1.05;
  margin: 0;
  font-feature-settings: "tnum";
}
.stat-multiple {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--neutral-grey);
  margin-top: 10px;
  letter-spacing: 0.05em;
  display: block;
}

/* Chart container */
.calc-chart-wrap {
  background: var(--paper-card);
  border: 1px solid var(--rule-strong);
  padding: 28px 24px 20px;
  position: relative;
}
.calc-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.calc-chart-head h3 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink);
  margin: 0;
}
.calc-chart-legend {
  display: flex;
  gap: 18px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  flex-wrap: wrap;
}
.calc-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.calc-chart-legend .swatch {
  width: 10px;
  height: 10px;
  display: inline-block;
}
.calc-chart-legend .swatch.invested { background: var(--rule-strong); }
.calc-chart-legend .swatch.returns  { background: var(--signal); }
.calc-chart-legend .swatch.sip      { background: var(--ink); }
.calc-chart-legend .swatch.lumpsum  { background: var(--warning); }

.calc-chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Insight chip below results */
.calc-insight {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 22px;
  background: var(--signal-soft);
  border: 1px solid rgba(40, 62, 45, 0.18);
}
.calc-insight-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--signal);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  font-weight: 500;
}
.calc-insight-body {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  font-variation-settings: "SOFT" 60;
}
.calc-insight-body strong {
  font-style: normal;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  font-style: normal;
}

/* ── DISCLAIMER STRIP ──────────────────────────────────── */
.tools-disclaimer {
  background: var(--paper);
  border-top: 1px solid var(--rule);
  padding: clamp(32px, 4vw, 48px) 0;
  text-align: center;
}
.tools-disclaimer .eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--neutral-grey);
  margin-bottom: 14px;
}
.tools-disclaimer p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 680px;
  margin: 0 auto;
  font-variation-settings: "SOFT" 60;
}

/* ── RELATED TOOLS STRIP ──────────────────────────────── */
.tools-related {
  background: var(--paper-warm);
  border-top: 1px solid var(--rule);
  padding: clamp(48px, 6vw, 80px) 0;
}
.tools-related h3 {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  margin: 0 0 28px;
}
.tools-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--rule-strong);
  border: 1px solid var(--rule-strong);
}
.tools-related-card {
  display: block;
  padding: 28px 26px;
  background: var(--paper-card);
  color: var(--ink);
  text-decoration: none;
  transition: background var(--t-fast, 120ms) ease;
  position: relative;
}
.tools-related-card:not(.current):hover {
  background: var(--paper);
}
.tools-related-card.current,
.tools-related-card.current:hover {
  background: var(--ink);
  color: var(--paper);
  cursor: default;
}
.tools-related-card.current h4,
.tools-related-card.current:hover h4 {
  color: var(--paper);
}
.tools-related-card .meta {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--neutral-grey);
  margin-bottom: 10px;
}
.tools-related-card.current .meta {
  color: var(--signal-light);
}
.tools-related-card h4 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 8px;
  letter-spacing: -0.015em;
  font-variation-settings: "SOFT" 50, "opsz" 80;
}
.tools-related-card p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
  font-variation-settings: "SOFT" 60;
}
.tools-related-card.current p { color: rgba(255, 252, 249, 0.7); }
.tools-related-card .arrow {
  position: absolute;
  bottom: 22px;
  right: 22px;
  font-family: var(--mono);
  font-size: 14px;
  opacity: 0;
  transform: translateX(-6px);
  transition: all var(--t-base, 220ms) var(--ease, ease);
}
.tools-related-card:hover .arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ══════════════════════════════════════════════════════════════
   FUND OVERLAP ANALYZER
   ════════════════════════════════════════════════════════════ */

.oa-shell {
  padding: clamp(32px, 5vw, 56px) 0 clamp(48px, 6vw, 80px);
}

.oa-step-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--neutral-grey);
}
@media (max-width: 720px) { .oa-step-row { grid-template-columns: 1fr; } }
.oa-step {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule-strong);
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.oa-step .num {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
  text-transform: none;
  font-feature-settings: "tnum";
}

.oa-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: clamp(24px, 3.5vw, 48px);
  align-items: start;
}
@media (max-width: 920px) {
  .oa-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* Left: fund selector panel */
.oa-selector {
  background: var(--paper-card);
  border: 1px solid var(--rule-strong);
}
.oa-selector-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--ink);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.oa-selector-head h2 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink);
  margin: 0;
}
.oa-counter {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--neutral-grey);
  font-weight: 500;
  padding: 3px 10px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
}
.oa-counter.full {
  color: var(--warning);
  border-color: var(--warning);
}

.oa-search-wrap {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.oa-search {
  width: 100%;
  font-family: var(--mono);
  font-size: 12px;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink);
  box-sizing: border-box;
  letter-spacing: 0.02em;
}
.oa-search:focus { outline: none; border-color: var(--ink); }
.oa-search-wrap::before {
  content: '';
  position: absolute;
  left: 28px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='%237A7160' stroke-width='1.5'><circle cx='8' cy='8' r='5.5'/><path d='m12 12 4 4'/></svg>");
  background-repeat: no-repeat;
  pointer-events: none;
}

.oa-fund-list {
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
}
.oa-fund-list::-webkit-scrollbar { width: 6px; }
.oa-fund-list::-webkit-scrollbar-thumb { background: var(--rule-strong); }

.oa-category-head {
  padding: 14px 20px 6px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--warning);
  background: var(--paper);
  border-top: 1px solid var(--rule);
}
.oa-category-head:first-child { border-top: none; }

.oa-fund {
  padding: 12px 20px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background var(--t-fast, 120ms) ease;
}
.oa-fund:hover { background: var(--paper); }
.oa-fund.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.oa-fund.disabled:hover { background: transparent; }

.oa-fund input[type="checkbox"] {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--ink);
  cursor: pointer;
}
.oa-fund.disabled input[type="checkbox"] { cursor: not-allowed; }

.oa-fund-name {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
  font-variation-settings: "SOFT" 40, "opsz" 80;
}
.oa-fund-amc {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--neutral-grey);
  margin-top: 3px;
}

/* Right: control panel + results */
.oa-control {
  background: var(--paper-card);
  border: 1px solid var(--rule-strong);
  padding: clamp(20px, 2.5vw, 28px);
  margin-bottom: 24px;
}
.oa-control-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.oa-control-head h3 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink);
  margin: 0;
}
.oa-control-status {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--neutral-grey);
  letter-spacing: 0.04em;
}

.oa-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 18px;
}
.oa-chips:empty::before {
  content: 'No funds selected yet — pick from the list to begin.';
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--neutral-grey);
  font-variation-settings: "SOFT" 60;
  padding: 10px 0;
}

.oa-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 14px;
  background: var(--paper);
  border: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.02em;
  transition: background var(--t-fast, 120ms) ease;
}
.oa-chip:hover { background: var(--paper-card); }
.oa-chip-x {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  border-radius: 50%;
  transition: all var(--t-fast, 120ms) ease;
}
.oa-chip-x:hover {
  background: var(--warning);
  color: var(--paper);
}

.oa-run {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: background var(--t-fast, 120ms) ease;
}
.oa-run:hover:not(:disabled) {
  background: var(--signal-deep);
}
.oa-run:disabled {
  background: var(--rule-strong);
  border-color: var(--rule-strong);
  color: var(--neutral-grey);
  cursor: not-allowed;
}
.oa-run .arrow {
  display: inline-block;
  transition: transform var(--t-base, 220ms) ease;
}
.oa-run:hover:not(:disabled) .arrow {
  transform: translateX(3px);
}

.oa-hint {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  font-variation-settings: "SOFT" 60;
}

/* ── Result section ─────────────────────────────────── */
.oa-result {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.oa-result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 8px;
}
.oa-result-head h3 {
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.018em;
  color: var(--ink);
  font-variation-settings: "SOFT" 50, "opsz" 80;
}
.oa-result-head .meta {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--neutral-grey);
}

.oa-matrix-wrap, .oa-holdings-wrap {
  background: var(--paper-card);
  border: 1px solid var(--rule-strong);
  padding: 24px;
}
.oa-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}
.oa-section-head h4 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink);
  margin: 0;
}
.oa-section-head .legend {
  display: flex;
  gap: 14px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--neutral-grey);
  flex-wrap: wrap;
}
.oa-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.oa-legend-item .sw {
  width: 12px; height: 12px;
  display: inline-block;
  border: 1px solid var(--rule-strong);
}

.oa-matrix-scroll, .oa-holdings-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
}
.oa-matrix-scroll::-webkit-scrollbar, .oa-holdings-scroll::-webkit-scrollbar { height: 6px; }
.oa-matrix-scroll::-webkit-scrollbar-thumb, .oa-holdings-scroll::-webkit-scrollbar-thumb { background: var(--rule-strong); }

.oa-matrix-table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--mono);
  font-size: 12px;
  min-width: 480px;
}
.oa-matrix-table th, .oa-matrix-table td {
  padding: 12px 14px;
  text-align: center;
  border: 1px solid var(--rule);
  font-feature-settings: "tnum";
}
.oa-matrix-table th {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  background: var(--paper);
}
.oa-matrix-table td.row-head {
  font-weight: 600;
  text-align: left;
  background: var(--paper);
  color: var(--ink);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.oa-matrix-table td.diag {
  background: repeating-linear-gradient(
    45deg,
    var(--paper) 0,
    var(--paper) 4px,
    var(--rule) 4px,
    var(--rule) 5px
  );
  color: var(--neutral-grey);
  font-size: 10px;
}
.oa-matrix-table td .pct {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}

.oa-holdings-table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--mono);
  font-size: 12px;
  min-width: 520px;
}
.oa-holdings-table th, .oa-holdings-table td {
  padding: 12px 14px;
  text-align: right;
  border-bottom: 1px solid var(--rule);
  font-feature-settings: "tnum";
}
.oa-holdings-table th {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}
.oa-holdings-table th:first-child, .oa-holdings-table td:first-child {
  text-align: left;
}
.oa-holdings-table td.stock {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.01em;
  font-variation-settings: "SOFT" 40, "opsz" 80;
}
.oa-holdings-table tbody tr:hover {
  background: var(--paper);
}
.oa-holdings-table .pct-bar {
  display: inline-block;
  width: 60px;
  height: 6px;
  background: var(--rule);
  position: relative;
  vertical-align: middle;
  margin-right: 8px;
}
.oa-holdings-table .pct-bar > span {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  background: var(--signal);
}

.oa-empty {
  padding: 60px 24px;
  text-align: center;
  background: var(--paper-card);
  border: 1px dashed var(--rule-strong);
}
.oa-empty .eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--neutral-grey);
  margin-bottom: 14px;
}
.oa-empty h4 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 10px;
  letter-spacing: -0.015em;
  font-variation-settings: "SOFT" 50, "opsz" 80;
}
.oa-empty p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 380px;
  margin: 0 auto;
  font-variation-settings: "SOFT" 60;
}

.oa-data-note {
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.7;
  color: var(--neutral-grey);
  padding: 16px 20px;
  background: var(--paper);
  border: 1px solid var(--rule);
  letter-spacing: 0.02em;
}
.oa-data-note strong {
  color: var(--ink);
  font-weight: 600;
}

/* ════════════════════════════════════════════════════════════
   FUND-DETAIL EMBEDDED CALCULATOR
   ════════════════════════════════════════════════════════════ */

.fund-calc-embed {
  max-height: 0;
  overflow: hidden;
  transition: max-height 480ms cubic-bezier(0.22, 0.61, 0.36, 1);
  margin: 0;
}
.fund-calc-embed[data-state="open"] {
  max-height: 2400px; /* generous to fit any state */
}

.fund-calc-embed-inner {
  background: var(--paper-card);
  border: 1px solid var(--ink);
  margin: 24px 0 8px;
  padding: 0;
}

.fund-calc-embed-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 24px clamp(20px, 2.5vw, 32px) 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-warm);
}
.fund-calc-embed-head .eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--warning);
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.fund-calc-embed-head .eyebrow::before {
  content: '';
  width: 18px; height: 1px;
  background: var(--warning);
}
.fund-calc-embed-head h2 {
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
  font-variation-settings: "SOFT" 50, "opsz" 80;
}
.fund-calc-embed-head h2 .ital {
  font-style: italic;
  color: var(--warning);
  font-variation-settings: "SOFT" 80, "opsz" 100;
}
.fund-calc-embed-close {
  flex-shrink: 0;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1;
  color: var(--ink-soft);
  transition: all var(--t-fast, 120ms) ease;
}
.fund-calc-embed-close:hover {
  background: var(--warning);
  color: var(--paper);
  border-color: var(--warning);
}

.fund-calc-embed-body {
  padding: clamp(20px, 2.5vw, 32px);
}

/* Mode toggle (SIP / Lumpsum) */
.fund-calc-mode-row {
  display: inline-flex;
  border: 1px solid var(--rule-strong);
  margin-bottom: 24px;
}
.fund-calc-mode {
  background: var(--paper);
  border: none;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  padding: 10px 18px;
  cursor: pointer;
  transition: all var(--t-fast, 120ms) ease;
}
.fund-calc-mode + .fund-calc-mode {
  border-left: 1px solid var(--rule-strong);
}
.fund-calc-mode:hover {
  background: var(--paper-card);
  color: var(--ink);
}
.fund-calc-mode.active {
  background: var(--ink);
  color: var(--paper);
}

/* "Reset to fund CAGR" pill */
.fund-calc-reset-rate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 12px;
  background: var(--signal-soft);
  border: 1px solid var(--signal-deep);
  color: var(--signal-deep);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all var(--t-fast, 120ms) ease;
}
.fund-calc-reset-rate:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.fund-calc-reset-rate.hidden { display: none; }

/* Embedded calc disclaimer note */
.fund-calc-embed-foot {
  border-top: 1px solid var(--rule);
  padding: 14px clamp(20px, 2.5vw, 32px);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.6;
  color: var(--neutral-grey);
  letter-spacing: 0.02em;
}
.fund-calc-embed-foot strong { color: var(--ink); }

/* Chip toggle state on the action row */
.f5-actions-buttons .tool-chip[aria-expanded="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.f5-actions-buttons .tool-chip[aria-expanded="true"] .tool-chip-arrow {
  transform: rotate(90deg);
}

/* ════════════════════════════════════════════════════════════
   GOAL-FIRST CALCULATOR
   ════════════════════════════════════════════════════════════ */

.goal-templates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--rule-strong);
  border: 1px solid var(--rule-strong);
  margin-bottom: 32px;
}
.goal-template-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--paper-card);
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background var(--t-fast, 120ms) ease;
  font-family: inherit;
  color: var(--ink);
}
.goal-template-chip:hover { background: var(--paper); }
.goal-template-chip.active {
  background: var(--ink);
  color: var(--paper);
}
.goal-template-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  font-weight: 500;
  color: var(--warning);
}
.goal-template-chip.active .goal-template-icon {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}
.goal-template-meta { min-width: 0; flex: 1; }
.goal-template-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1.2;
  margin-bottom: 4px;
}
.goal-template-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.4;
  font-variation-settings: "SOFT" 60;
}
.goal-template-chip.active .goal-template-sub {
  color: rgba(255, 252, 249, 0.7);
}

.goal-heading-row {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}
.goal-heading-row .eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--warning);
  margin-bottom: 8px;
}
.goal-heading-row h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.022em;
  margin: 0 0 8px;
  color: var(--ink);
  font-variation-settings: "SOFT" 50, "opsz" 100;
}
.goal-heading-row p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
  font-variation-settings: "SOFT" 60;
}

/* Inflation toggle */
.goal-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  margin-bottom: 24px;
}
.goal-toggle-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.goal-toggle-row input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--ink);
  cursor: pointer;
}
.goal-toggle-row .toggle-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-soft);
  margin-left: auto;
}

.goal-shortfall {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--signal-deep);
  margin-top: 8px;
  letter-spacing: 0.04em;
}

.goal-real-target {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--neutral-grey);
  margin-top: 4px;
  letter-spacing: 0.04em;
  display: block;
}

/* ════════════════════════════════════════════════════════════
   STEP-UP SIP MODE (sip-calculator.html)
   ════════════════════════════════════════════════════════════ */

.sip-mode-toggle {
  display: inline-flex;
  border: 1px solid var(--rule-strong);
  margin-bottom: 24px;
}
.sip-mode-btn {
  background: var(--paper);
  border: none;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  padding: 9px 16px;
  cursor: pointer;
  transition: all var(--t-fast, 120ms) ease;
}
.sip-mode-btn + .sip-mode-btn { border-left: 1px solid var(--rule-strong); }
.sip-mode-btn:hover {
  background: var(--paper-card);
  color: var(--ink);
}
.sip-mode-btn.active {
  background: var(--ink);
  color: var(--paper);
}

.sip-stepup-field {
  display: none;
}
.sip-mode-stepup .sip-stepup-field {
  display: block;
}

/* Comparison row when in step-up mode */
.sip-comparison-stats {
  display: none;
  margin-top: 8px;
}
.sip-mode-stepup .sip-comparison-stats {
  display: block;
}
.sip-comparison-stats .calc-stat-row {
  border-color: var(--rule-strong);
  background: var(--paper);
}
.sip-comparison-stats .stat-label {
  color: var(--ink-soft);
}
.sip-comparison-stats .stat-label::before {
  background: var(--warning);
  opacity: 0.6;
}
.sip-comparison-stats .stat-value {
  font-size: clamp(22px, 2.5vw, 28px);
}
.sip-comparison-stats .calc-stat-delta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--signal-deep);
  margin-top: 8px;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* ════════════════════════════════════════════════════════════
   STYLE DRIFT DETECTOR (fund-detail component)
   ════════════════════════════════════════════════════════════ */

.style-drift-wrap {
  background: var(--paper-card);
  border: 1px solid var(--rule-strong);
  padding: clamp(22px, 2.6vw, 32px);
  margin: 28px 0;
}

.style-drift-head { margin-bottom: 24px; }
.style-drift-head .eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--warning);
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.style-drift-head .eyebrow::before {
  content: '';
  width: 18px; height: 1px;
  background: var(--warning);
}
.style-drift-head h3 {
  font-family: var(--serif);
  font-size: clamp(22px, 2.3vw, 28px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 6px;
  color: var(--ink);
  font-variation-settings: "SOFT" 50, "opsz" 80;
}
.style-drift-head h3 .meta {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--neutral-grey);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-left: 8px;
}
.style-drift-blurb {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
  font-variation-settings: "SOFT" 60;
}

/* Concentration bars */
.style-drift-concentration {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 20px 22px;
  background: var(--paper);
  border: 1px solid var(--rule);
  margin-bottom: 28px;
}
@media (max-width: 700px) {
  .style-drift-concentration { grid-template-columns: 1fr; gap: 16px; }
}
.concentration-row { display: flex; flex-direction: column; gap: 8px; }
.concentration-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}
.concentration-bars { display: flex; flex-direction: column; gap: 8px; }
.conc-bar {
  display: grid;
  grid-template-columns: 110px 1fr 60px;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
}
.conc-bar-lbl {
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}
.conc-bar-track {
  height: 8px;
  background: var(--rule);
  position: relative;
  overflow: hidden;
}
.conc-bar-fill {
  height: 100%;
  background: var(--ink);
  transition: width 280ms ease;
}
.conc-bar-fill.peer { background: var(--rule-strong); }
.conc-bar-val {
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  font-feature-settings: "tnum";
}

/* Section + table */
.style-drift-section { margin-bottom: 28px; }
.style-drift-section h4,
.style-drift-col h4 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink);
  margin: 0 0 12px;
}
.style-drift-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
}
.style-drift-table th, .style-drift-table td {
  padding: 10px 14px;
  text-align: right;
  border-bottom: 1px solid var(--rule);
  font-feature-settings: "tnum";
}
.style-drift-table th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}
.style-drift-table th:first-child,
.style-drift-table td:first-child { text-align: left; }
.style-drift-table td.stock {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  font-variation-settings: "SOFT" 40, "opsz" 80;
}
.style-drift-table tbody tr:hover { background: var(--paper); }

/* Two-column distinctive/missing */
.style-drift-twocol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
@media (max-width: 720px) {
  .style-drift-twocol { grid-template-columns: 1fr; gap: 20px; }
}
.style-drift-col-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0 0 12px;
  font-variation-settings: "SOFT" 60;
}
.style-drift-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--rule);
  background: var(--paper);
}
.style-drift-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
}
.style-drift-list li:last-child { border-bottom: none; }
.style-drift-list .holdings-stock {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  font-variation-settings: "SOFT" 40, "opsz" 80;
}
.style-drift-list .holdings-pct {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  font-feature-settings: "tnum";
}
.style-drift-list.distinctive {
  border-color: rgba(67, 14, 19, 0.42);
}
.style-drift-list.missing {
  border-color: var(--rule-strong);
  opacity: 0.95;
}
.style-drift-list.distinctive .holdings-pct { color: var(--warning); font-weight: 600; }

/* ════════════════════════════════════════════════════════════
   DRAWDOWN STRESS TEST (fund-detail Risk section)
   ════════════════════════════════════════════════════════════ */

.drawdown-stress-wrap {
  background: var(--paper-card);
  border: 1px solid var(--rule-strong);
  padding: clamp(22px, 2.6vw, 32px);
  margin: 24px 0;
}
.drawdown-stress-head { margin-bottom: 20px; }
.drawdown-stress-head .eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--warning);
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.drawdown-stress-head .eyebrow::before {
  content: '';
  width: 18px; height: 1px;
  background: var(--warning);
}
.drawdown-stress-head h3 {
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.018em;
  margin: 0 0 8px;
  color: var(--ink);
  font-variation-settings: "SOFT" 50, "opsz" 80;
}
.drawdown-stress-blurb {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
  font-variation-settings: "SOFT" 60;
}

.drawdown-stress-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--rule);
  margin-bottom: 20px;
}
@media (max-width: 640px) {
  .drawdown-stress-stats { grid-template-columns: 1fr; }
}
.drawdown-stat {
  padding: 18px 20px;
  border-right: 1px solid var(--rule);
}
.drawdown-stat:last-child { border-right: none; }
.drawdown-stat .stat-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--neutral-grey);
  margin: 0 0 8px;
}
.drawdown-stat .stat-value {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0;
  font-feature-settings: "tnum";
  font-variation-settings: "SOFT" 50, "opsz" 100;
}
.drawdown-stat.warning .stat-value { color: var(--warning); }
.drawdown-stat.neutral .stat-value { color: var(--ink); }

.drawdown-chart-wrap {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 16px;
  margin-bottom: 16px;
}
.drawdown-chart svg { display: block; width: 100%; height: auto; }

.drawdown-stress-caption {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
  padding: 14px 18px;
  background: var(--warning-faint, rgba(67, 14, 19, 0.06));
  border: 1px solid rgba(67, 14, 19, 0.18);
  margin: 0;
  font-variation-settings: "SOFT" 60;
}

/* ════════════════════════════════════════════════════════════
   COST-OF-DELAY VISUALISER (sip-calculator.html)
   ════════════════════════════════════════════════════════════ */

.cost-of-delay-wrap {
  background: var(--paper-card);
  border: 1px solid var(--rule-strong);
  padding: clamp(22px, 2.6vw, 30px);
  margin-top: 28px;
}
.cost-of-delay-head { margin-bottom: 20px; }
.cost-of-delay-head .eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--warning);
  margin-bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.cost-of-delay-head .eyebrow::before {
  content: '';
  width: 18px; height: 1px;
  background: var(--warning);
}
.cost-of-delay-head h3 {
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 500;
  margin: 0 0 6px;
  color: var(--ink);
  letter-spacing: -0.018em;
  font-variation-settings: "SOFT" 50, "opsz" 80;
}
.cost-of-delay-blurb {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
  font-variation-settings: "SOFT" 60;
}

.cost-of-delay-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--rule);
  margin-bottom: 16px;
}
@media (max-width: 640px) { .cost-of-delay-grid { grid-template-columns: 1fr; } }
.cost-of-delay-card {
  padding: 20px 18px;
  border-right: 1px solid var(--rule);
  background: var(--paper);
}
.cost-of-delay-card:last-child { border-right: none; }
.cost-of-delay-card.baseline {
  background: var(--ink);
  color: var(--paper);
}
.cost-of-delay-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--neutral-grey);
  margin: 0 0 10px;
}
.cost-of-delay-card.baseline .cost-of-delay-label {
  color: rgba(244, 235, 217, 0.74);
}
.cost-of-delay-value {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.018em;
  margin: 0 0 6px;
  color: var(--ink);
  font-feature-settings: "tnum";
  font-variation-settings: "SOFT" 50, "opsz" 100;
}
.cost-of-delay-card.baseline .cost-of-delay-value { color: var(--paper); }
.cost-of-delay-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  margin: 0 0 8px;
  letter-spacing: 0.04em;
}
.cost-of-delay-card.baseline .cost-of-delay-sub { color: rgba(255, 252, 249, 0.65); }
.cost-of-delay-delta {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--warning);
  margin: 0;
  letter-spacing: 0.04em;
}

.cost-of-delay-headline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  padding: 14px 18px;
  background: var(--signal-soft);
  border: 1px solid rgba(40, 62, 45, 0.18);
  margin: 0;
  font-variation-settings: "SOFT" 60;
}
.cost-of-delay-headline strong {
  font-style: normal;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--warning);
  letter-spacing: 0.02em;
}

/* ════════════════════════════════════════════════════════════
   TIME MACHINE PAGE
   ════════════════════════════════════════════════════════════ */

.tm-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: clamp(24px, 3.5vw, 48px);
  align-items: start;
}
@media (max-width: 920px) {
  .tm-grid { grid-template-columns: 1fr; gap: 28px; }
}

.tm-selector { /* re-uses oa-selector pattern */ }
.tm-amount-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.tm-window-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.tm-window-chip {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 8px 14px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: all var(--t-fast, 120ms) ease;
}
.tm-window-chip:hover {
  border-color: var(--ink);
  background: var(--paper-card);
  color: var(--ink);
}
.tm-window-chip.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ════════════════════════════════════════════════════════════
   REDUCED MOTION — honour the OS preference across all tools
   ════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .calc-input-num, .calc-select, .calc-rate-input, .calc-preset, .calc-rate-chip,
  .calc-range::-webkit-slider-thumb, .tools-related-card, .tools-related-card .arrow,
  .oa-search, .oa-fund, .oa-chip, .oa-chip-x, .oa-run, .oa-run .arrow,
  .sip-mode-btn, .fund-calc-mode, .fund-calc-reset-rate, .fund-calc-embed-close,
  .fund-calc-embed, .goal-template-chip, .conc-bar-fill, .tm-window-chip {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ════════════════════════════════════════════════════════════
   MOBILE — input font-size floor to prevent iOS auto-zoom on focus.
   iOS Safari zooms the viewport whenever a focused input has
   font-size < 16px. The calculator design uses smaller mono inputs
   on desktop for compactness; on phones we lift to 16px so the
   page never auto-zooms when the user taps a field.
   ════════════════════════════════════════════════════════════ */
@media (max-width: 720px) {
  .calc-input-num,
  .calc-select,
  .calc-rate-input,
  .oa-search {
    font-size: 16px;
  }
}
