/* ─── STYLE.CSS ─── */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;1,400&display=swap');

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
@media(prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;transition-duration:.01ms!important}}

:root {
  --bg: #FFFFFF;
  --fg: #1C1C1C;
  --muted: #666;
  --faint: #999;
  --ghost: #BBB;
  --border: #E0E0E0;
  --surface: #FAFAF8;
  --surface-border: #E8E8E4;
  --pos: #15803D;
  --neg: #B91C1C;
  --accent: #1A56DB;
  --warn-bg: #FEF9C3;
  --warn-border: #FDE68A;
  --warn-text: #713F12;
  --font-body: 'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', Menlo, monospace;
  --font-display: 'Fraunces', Georgia, serif;
  --radius: 6px;
  --radius-sm: 4px;
}

html { font-size: 16px; }
body { font-family: var(--font-body); color: var(--fg); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }

.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }
.mono { font-family: var(--font-mono); }
.hed { font-family: var(--font-display); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.mut { color: #555; }
.mlabel { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); margin-bottom: 2px; font-weight: 500; }

/* ─── Layout ─── */
.site-header { border-bottom: 1.5px solid var(--border); padding: 28px 24px 0; }
.site-header .inner { max-width: 940px; margin: 0 auto; }
.site-main { max-width: 940px; margin: 0 auto; padding: 0 24px 60px; }
.site-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.site-title { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: #0A0A0A; line-height: 1.2; margin-bottom: 4px; }
.site-desc { font-size: 15px; color: var(--muted); max-width: 560px; line-height: 1.55; margin-bottom: 20px; }

/* ─── Tabs ─── */
.tabs { display: flex; gap: 0; border-bottom: none; }
.tab-btn { background: none; border: none; cursor: pointer; font-family: var(--font-body); font-size: 15px; padding: 12px 24px; color: var(--faint); border-bottom: 3px solid transparent; transition: color .12s, border-color .12s; font-weight: 500; }
.tab-btn:hover { color: #444; }
.tab-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 2px; }
.tab-btn[aria-selected="true"] { color: #0A0A0A; border-bottom-color: #0A0A0A; font-weight: 600; }

/* ─── Caveat ─── */
.caveat { margin-top: 12px; padding: 10px 14px; background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: var(--radius-sm); font-size: 13px; color: var(--warn-text); line-height: 1.55; }

/* ─── Sliders ─── */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; background: var(--border); border-radius: 3px; outline: none; }
input[type=range]:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 3px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--fg); cursor: pointer; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--fg); }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--fg); cursor: pointer; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--fg); }

.slider-box { padding: 20px 24px; background: var(--surface); border: 1.5px solid var(--surface-border); border-radius: var(--radius); }
.slider-label { display: block; font-size: 13px; font-weight: 600; color: #555; margin-bottom: 4px; }
.slider-val { font-family: var(--font-mono); font-size: 24px; font-weight: 500; color: #0A0A0A; margin-bottom: 10px; }
.slider-range { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; color: var(--ghost); margin-top: 4px; }

/* ─── Sort bar ─── */
.sort-bar { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.sort-label { font-size: 13px; color: var(--faint); font-weight: 500; }
.sbtn { background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; font-size: 13px; padding: 4px 2px; color: var(--muted); font-family: var(--font-body); transition: color .1s; }
.sbtn:hover { color: var(--fg); }
.sbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.sbtn[aria-pressed="true"] { color: var(--fg); border-bottom-color: var(--fg); font-weight: 600; }
.tbtn { background: #F5F5F3; border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; padding: 6px 14px; color: #555; font-family: var(--font-body); transition: all .1s; }
.tbtn:hover { background: #EBEBEB; }
.tbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tbtn[aria-pressed="true"] { background: var(--fg); color: #fff; border-color: var(--fg); }

/* ─── Cards ─── */
.pcard { border: 1.5px solid var(--border); border-radius: var(--radius); transition: border-color .12s, background .12s; background: #fff; padding: 14px 20px; cursor: pointer; }
.pcard:hover { border-color: #B0B0B0; background: #FCFCFC; }
.pcard:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pcard[aria-expanded="true"] { border-color: var(--fg); background: var(--surface); }
.card-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }

/* ─── Risk badges ─── */
.badge { font-size: 11px; padding: 1px 8px; border-radius: 3px; font-weight: 500; display: inline-block; }
.badge-0 { background: #DCFCE7; color: #14532D; }
.badge-1 { background: #DBEAFE; color: #1E3A5F; }
.badge-2 { background: #FEF9C3; color: #713F12; }
.badge-3 { background: #FEE2E2; color: #7F1D1D; }

/* ─── Value bar ─── */
.value-bar { margin-top: 12px; height: 4px; background: #F0F0EE; border-radius: 2px; overflow: hidden; }
.value-bar-fill { height: 100%; border-radius: 2px; transition: width .3s ease; }

/* ─── Detail panel ─── */
.detail-panel { margin-top: 20px; padding-top: 20px; border-top: 1.5px solid var(--surface-border); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.scenario-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.scenario-box { padding: 10px 12px; border-radius: var(--radius-sm); }
.info-box { font-size: 13px; color: #555; background: #F5F5F3; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--surface-border); line-height: 1.5; }
.pension-note { margin-top: 10px; font-size: 12px; color: var(--pos); background: #F0FDF4; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid #BBF7D0; line-height: 1.5; }

/* ─── Evidence panel ─── */
.evidence-btn { background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; padding: 7px 14px; font-size: 13px; font-weight: 600; color: #555; font-family: var(--font-body); display: flex; align-items: center; gap: 6px; margin-top: 16px; }
.evidence-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.evidence-btn[aria-expanded="true"] { background: #F5F5F3; }
.evidence-panel { margin-top: 10px; border: 1.5px solid var(--surface-border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.evidence-cat { padding: 12px 16px; }
.evidence-cat + .evidence-cat { border-top: 1px solid var(--surface-border); }
.evidence-cat h4 { font-size: 12px; font-weight: 600; color: #444; margin-bottom: 6px; }
.evidence-item { font-size: 12.5px; line-height: 1.55; color: #555; display: flex; gap: 6px; align-items: baseline; margin-bottom: 4px; }
.evidence-dot { color: #CCC; flex-shrink: 0; font-size: 8px; margin-top: 4px; }
.evidence-source { color: var(--faint); font-size: 11px; margin-left: 4px; font-style: italic; }
.evidence-date { color: var(--ghost); font-size: 10px; }

/* ─── Counter-evidence ─── */
.counter-evidence { margin-top: 12px; padding: 10px 14px; background: #FEF2F2; border: 1px solid #FECACA; border-radius: var(--radius-sm); }
.counter-evidence h4 { font-size: 11px; font-weight: 600; color: #991B1B; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.counter-evidence li { font-size: 12.5px; line-height: 1.55; color: #7F1D1D; margin-bottom: 3px; padding-left: 12px; position: relative; }
.counter-evidence li::before { content: "–"; position: absolute; left: 0; color: #DC2626; }

/* ─── Sustainability bar ─── */
.sus-bar { display: flex; gap: 2px; }
.sus-bar .dot { width: 10px; height: 10px; border-radius: 2px; background: var(--surface-border); }
.sus-bar .dot.on-high { background: #22C55E; }
.sus-bar .dot.on-mid { background: #EAB308; }
.sus-bar .dot.on-low { background: #EF4444; }

/* ─── Roadmap ─── */
.roadmap-phase { border: 1px solid var(--surface-border); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 12px; }
.phase-tag { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 3px; letter-spacing: .03em; display: inline-block; }
.phase-1 { background: #DBEAFE; color: #1E3A5F; }
.phase-2 { background: #FEF9C3; color: #713F12; }
.phase-3 { background: #DCFCE7; color: #14532D; }

/* ─── Positioning ─── */
.pos-grid { display: grid; grid-template-columns: 1fr 24px 1fr; gap: 8px; align-items: start; margin-bottom: 20px; }
.pos-before { padding: 12px 16px; background: #F5F5F3; border-radius: var(--radius-sm); border: 1px solid var(--surface-border); }
.pos-after { padding: 12px 16px; background: #F0FDF4; border-radius: var(--radius-sm); border: 1px solid #BBF7D0; }
.pos-arrow { display: flex; align-items: center; justify-content: center; color: #CCC; font-size: 18px; padding-top: 16px; }

/* ─── Personalisation ─── */
.filters { padding: 16px 20px; background: var(--surface); border: 1.5px solid var(--surface-border); border-radius: var(--radius); margin-bottom: 20px; }
.filters h3 { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin-bottom: 10px; }
.filter-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 5px 12px; border: 1.5px solid var(--border); border-radius: 20px; cursor: pointer; background: #fff; color: var(--muted); transition: all .12s; user-select: none; }
.filter-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.filter-chip:hover { border-color: #B0B0B0; }
.filter-chip.active { background: #0A0A0A; color: #fff; border-color: #0A0A0A; }
.filter-chip input { display: none; }
.filter-chip .check { width: 14px; height: 14px; border: 1.5px solid currentColor; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 10px; flex-shrink: 0; }
.filter-chip.active .check { background: #fff; color: #0A0A0A; }

/* ─── Checklist ─── */
.checklist-step { display: flex; gap: 8px; align-items: baseline; font-size: 13px; line-height: 1.6; color: #444; margin-bottom: 4px; }
.checklist-step.done { color: var(--ghost); text-decoration: line-through; }
.step-check { width: 16px; height: 16px; border: 1.5px solid var(--border); border-radius: 3px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: transparent; background: #fff; margin-top: 3px; transition: all .12s; }
.step-check:hover { border-color: #999; }
.step-check.checked { background: var(--pos); border-color: var(--pos); color: #fff; }
.progress-bar { height: 4px; background: #F0F0EE; border-radius: 2px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: var(--pos); border-radius: 2px; transition: width .3s ease; }

/* ─── Comparison ─── */
.compare-badge { position: absolute; top: 8px; right: 8px; font-size: 10px; padding: 2px 8px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 600; }

/* ─── Tables ─── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: right; padding: 5px 0; border-bottom: 1.5px solid var(--border); font-size: 11px; color: var(--faint); font-weight: 600; }
.data-table th:first-child { text-align: left; }
.data-table td { padding: 6px 0; border-bottom: 1px solid #F0F0EE; text-align: right; }
.data-table td:first-child { text-align: left; color: var(--faint); }

/* ─── Footer ─── */
.site-footer { margin-top: 20px; padding: 14px 20px; background: var(--surface); border: 1.5px solid var(--surface-border); border-radius: var(--radius); }
.methodology summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); padding: 8px 0; font-family: var(--font-body); }

/* ─── Responsive ─── */
@media (max-width: 740px) {
  .detail-grid, .scenario-grid, .pos-grid, .filter-grid { grid-template-columns: 1fr !important; }
  .card-metrics { grid-template-columns: 1fr 1fr !important; }
  .card-layout { grid-template-columns: 1fr !important; }
  .slider-pair { grid-template-columns: 1fr !important; }
  .tabs { flex-direction: column; }
  .tab-btn { text-align: left; }
}

/* ─── Print ─── */
@media print {
  body { font-size: 11pt; color: #000; }
  .site-header { padding: 10px 0; border-bottom: 1px solid #000; }
  .tabs, .sort-bar, .tbtn, .filter-grid, .evidence-btn, .step-check, input[type=range] { display: none !important; }
  .pcard { border: 1px solid #999; break-inside: avoid; page-break-inside: avoid; }
  .pcard[aria-expanded="true"] { background: #fff; }
  .detail-panel { border-top: 1px solid #999; }
  .caveat { background: #f5f5f5; border: 1px solid #999; }
  .evidence-panel { border: 1px solid #999; }
  a { color: #000; text-decoration: underline; }
  .site-main { max-width: 100%; padding: 0; }
}
