/* Finance page: research data story, live account calculator, programmes. */

.f-measure { max-width: 760px; }
.f-hero .lead, .f-measure, .stat figcaption span, .insights p, .pick *, .ranking *, .fx * { -webkit-hyphens: manual; hyphens: manual; }
.f-research h2, .f-tool h2, .f-prog h2 { font-size: var(--t-h2); margin: 14px 0 22px; max-width: 900px; }

/* ---------- Hero ---------- */
.f-hero { padding: calc(var(--nav-h) + clamp(64px, 10vw, 128px)) 0 clamp(24px, 4vw, 48px); }
.f-hero h1 { font-size: var(--t-h1); margin: 16px 0 26px; max-width: 980px; }
.f-hero h1 span { display: block; }
.f-hero h1 .soft { color: var(--blue); }
.f-hero .lead { max-width: 700px; }

.chapters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: clamp(40px, 6vw, 64px); max-width: 920px; }
.chapters a { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r-md); background: var(--snow); transition: transform 0.45s var(--spring), background 0.2s; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .chapters a:hover { background: var(--cloud); transform: translateY(-2px); } }
.chapters a:active { transform: scale(0.97); transition-duration: 0.12s; }
.chapters b { display: block; color: var(--ink); font-size: 17px; font-weight: 800; line-height: 1.2; }
.chapters small { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; font-weight: 700; }

.ic { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--sky); color: #fff; }
.ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Research: the numbers ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: clamp(48px, 6vw, 72px); }
.stat { margin: 0; padding: clamp(26px, 3vw, 36px); border-radius: var(--r-xl); background: var(--snow); display: flex; flex-direction: column; gap: 28px; }
.stat .num { display: block; color: var(--ink); font-size: clamp(56px, 5.6vw, 80px); font-weight: 800; line-height: 1; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat figcaption span { display: block; margin-top: 12px; color: var(--text); font-size: 17px; font-weight: 700; line-height: 1.4; max-width: 30ch; }

.waffle { width: min(150px, 46%); height: auto; overflow: visible; }
.w-base circle { fill: var(--mist); }
.w-lit circle { fill: var(--blue); transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform 0.55s var(--spring); transition-delay: calc(var(--i) * 9ms + 120ms); }
.go .w-lit circle, html:not(.js) .w-lit circle { transform: none; }

.stat.big { grid-column: 1 / -1; align-items: center; background: var(--ink); padding: clamp(48px, 8vw, 104px) clamp(28px, 5vw, 64px); text-align: center; }
.stat.big .num { color: #fff; font-size: clamp(76px, 13vw, 184px); letter-spacing: -0.055em; }
.stat.big figcaption span { margin: 18px auto 0; color: var(--mist); font-size: var(--t-lead); max-width: 26ch; }

.source { margin-top: 20px; color: var(--muted); font-size: var(--t-small); font-weight: 600; max-width: 820px; }

.insights { list-style: none; margin: clamp(72px, 9vw, 112px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 4vw, 48px); }
.insights li { padding-top: 22px; border-top: 2px solid var(--line); }
.insights .n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--sky-soft); color: var(--blue); font-size: 16px; font-weight: 900; }
.insights h3 { margin: 18px 0 10px; font-size: var(--t-h3); line-height: 1.15; letter-spacing: -0.03em; }
.insights p { color: var(--muted); font-weight: 600; }

.doc { display: flex; align-items: center; gap: 20px; margin-top: clamp(56px, 7vw, 88px); padding: 18px 20px 18px 18px; max-width: 560px; border-radius: var(--r-lg); background: var(--snow); transition: transform 0.45s var(--spring), background 0.2s; }
@media (hover: hover) { .doc:hover { background: var(--cloud); transform: translateY(-2px); } }
.doc:active { transform: scale(0.98); transition-duration: 0.12s; }
.doc .page { position: relative; flex: none; width: 48px; height: 62px; padding: 12px 9px 0; border-radius: 8px; background: #fff; box-shadow: var(--shadow-1), 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 5px; }
.doc .page i { display: block; height: 3px; border-radius: 2px; background: var(--mist); }
.doc .page i:nth-child(2) { width: 70%; }
.doc .page i:nth-child(4) { width: 55%; }
.doc .page em { position: absolute; left: -6px; bottom: 8px; padding: 1px 5px; border-radius: 5px; background: var(--red); color: #fff; font-size: 10px; font-weight: 900; font-style: normal; letter-spacing: 0.04em; }
.doc-t { flex: 1; min-width: 0; }
.doc-t b { display: block; color: var(--ink); font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.doc-t small { display: block; color: var(--muted); font-size: 14px; font-weight: 700; }
.doc .btn { pointer-events: none; }

/* ---------- Calculator ---------- */
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; padding: 0; }
.tags li { padding: 7px 14px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px var(--line); color: var(--ink); font-size: 14px; font-weight: 800; }

.calc { display: grid; grid-template-columns: minmax(0, 470px) minmax(0, 1fr); grid-template-areas: 'controls pick' 'controls results'; grid-template-rows: auto 1fr; gap: 16px 28px; margin-top: clamp(48px, 6vw, 72px); }
.controls { grid-area: controls; align-self: start; position: sticky; top: calc(var(--nav-h) + 24px); display: grid; gap: 16px; }
.pick { grid-area: pick; }
.results { grid-area: results; min-width: 0; }

.group { background: #fff; border-radius: 24px; box-shadow: var(--shadow-1); padding: 4px 0; }
.group-h { display: flex; align-items: baseline; gap: 8px; padding: 16px 20px 8px; color: var(--ink); font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.group-h .range { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.cell { display: flex; align-items: center; gap: 12px; padding: 12px 20px; }
.cell + .cell { box-shadow: inset 0 1px 0 var(--line); }
.cell-top { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.cell .ic { width: 30px; height: 30px; border-radius: 8px; }
.cell .ic svg { width: 18px; height: 18px; }
.cell label, .cell .lbl { color: var(--ink); font-size: 17px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
.cell output { margin-left: auto; color: var(--ink); font-size: 22px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

.cell.age { flex-direction: column; align-items: stretch; gap: 6px; padding-bottom: 14px; }
.slider { display: flex; align-items: center; gap: 12px; }
.slider .end { width: 18px; color: var(--muted); font-size: 13px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.slider input { --fill: 40%; flex: 1; min-width: 0; height: 36px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; border-radius: 999px; }
.slider input::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--blue) var(--fill), var(--mist) var(--fill)); }
.slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: #fff; box-shadow: 0 0.5px 4px rgba(0, 0, 0, 0.12), 0 6px 13px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.06); transition: transform 0.3s var(--spring); }
.slider input:active::-webkit-slider-thumb { transform: scale(1.08); }
.slider input::-moz-range-track { height: 6px; border-radius: 3px; background: var(--mist); }
.slider input::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--blue); }
.slider input::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0.5px 4px rgba(0, 0, 0, 0.12), 0 6px 13px rgba(0, 0, 0, 0.12); }
.slider input:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

/* iOS-style segmented control, built on real radio buttons */
.seg { --v: 3; position: relative; flex: none; display: grid; grid-template-columns: repeat(6, 1fr); width: 228px; height: 34px; padding: 2px; border-radius: 10px; background: var(--cloud); isolation: isolate; }
.seg label { position: relative; z-index: 1; display: grid; place-items: center; border-radius: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span { color: var(--muted); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; transition: color 0.2s; }
.seg input:checked + span { color: var(--ink); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--sky); outline-offset: 1px; }
.seg .thumb { position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / 6); border-radius: 8px; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04), 0 0 0 0.5px rgba(0, 0, 0, 0.04); transform: translateX(calc(var(--v) * 100%)); transition: transform 0.42s var(--spring); }
.seg label:active span { transform: scale(0.92); }

/* The recommendation */
.pick { position: relative; padding-top: 64px; }
.peek { position: absolute; z-index: 2; top: -2px; right: 40px; width: 112px; height: auto; pointer-events: none; transform-origin: 50% 100%; }
.pick-card { position: relative; z-index: 1; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 24px 26px 24px; border-radius: 26px; background: #fff; box-shadow: var(--shadow-2); }
.pick-main { min-width: 0; }
.pick small { display: block; color: var(--peri); font-size: 14px; font-weight: 800; }
#r-name { display: block; margin: 4px 0 6px; color: var(--ink); font-size: clamp(28px, 2.8vw, 38px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.08; overflow-wrap: anywhere; }
#r-meta { display: block; color: var(--muted); font-size: 15px; font-weight: 700; }
.pick-score { flex: none; text-align: right; }
#r-score { display: block; color: var(--blue); font-size: clamp(44px, 4.4vw, 60px); font-weight: 800; line-height: 1; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.pick.none #r-score { color: var(--faint); }
.pick.bump #r-name { animation: f-pop 0.5s var(--spring); }
.pick.bump .peek { animation: f-hop 0.7s var(--spring); }
@keyframes f-pop { from { opacity: 0.3; transform: translateY(6px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes f-hop { 0% { transform: none; } 35% { transform: translateY(-12px) rotate(-3deg); } 100% { transform: none; } }

/* Formula bar, like Excel's */
.fx { display: flex; align-items: stretch; min-height: 42px; margin: 16px 0 12px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.fx-name { flex: none; display: flex; align-items: center; max-width: 34%; padding: 0 12px; box-shadow: inset -1px 0 0 var(--line); color: var(--muted); font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-sign { flex: none; display: flex; align-items: center; padding: 0 8px 0 12px; color: var(--peri); font-size: 15px; font-weight: 700; font-style: italic; font-family: Georgia, 'Times New Roman', serif; }
.fx code { flex: 1; min-width: 0; display: flex; align-items: center; padding: 9px 14px 9px 4px; color: var(--ink); font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; font-weight: 500; line-height: 1.45; letter-spacing: 0; }

/* Ranking */
.ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ranking li.up { z-index: 2; }
.ranking li { position: relative; transition: transform 0.55s cubic-bezier(0.2, 0.85, 0.25, 1); will-change: transform; }
.row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: 'rk nm sc' '. bar bar'; align-items: center; gap: 6px 10px; width: 100%; padding: 11px 16px 13px 12px; border: 0; border-radius: 14px; background: #fff; text-align: left; cursor: pointer; transition: background 0.2s, box-shadow 0.2s, transform 0.35s var(--spring); -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .row:hover { background: var(--white); box-shadow: 0 0 0 1px var(--mist), var(--shadow-1); } }
.row:active { transform: scale(0.985); transition-duration: 0.1s; }
.row[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--blue); }
.rk { grid-area: rk; color: var(--peri); font-size: 13px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.nm { grid-area: nm; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; min-width: 0; }
.nm b { color: var(--ink); font-size: 16px; font-weight: 800; letter-spacing: -0.015em; }
.nm small { color: var(--muted); font-size: 13px; font-weight: 700; }
.sc { grid-area: sc; color: var(--ink); font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bar { grid-area: bar; height: 6px; border-radius: 3px; background: var(--cloud); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--sky); transform-origin: 0 50%; transform: scaleX(0); transition: transform 0.55s cubic-bezier(0.2, 0.85, 0.25, 1); }
.top .bar i { background: var(--blue); }
.top .sc { color: var(--blue); }
.off .row { background: var(--snow); box-shadow: inset 0 0 0 1px var(--mist); }
@media (hover: hover) { .off .row:hover { background: var(--cloud); } }
.off .row[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--peri); }
.off .nm b { color: var(--peri); }
.off .nm small { color: var(--peri); }
.off .sc { color: var(--faint); font-size: 14px; }
.off .bar { display: none; }
.off .row { row-gap: 0; padding-bottom: 11px; }

.note { max-width: 760px; margin-top: 28px; color: var(--muted); font-size: 15px; font-weight: 600; }
.note .link { white-space: nowrap; }

/* ---------- Programmes ---------- */
.progs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: clamp(40px, 5vw, 56px); }
.prog { padding: clamp(28px, 3.4vw, 40px); border-radius: var(--r-xl); background: var(--snow); }
.prog-k { display: flex; gap: 6px; margin-bottom: clamp(40px, 6vw, 72px); }
.prog-k span { padding: 5px 12px; border-radius: 999px; background: #fff; color: var(--muted); font-size: 13px; font-weight: 800; }
.prog h3 { font-size: clamp(28px, 3vw, 38px); }
.prog-role { margin: 8px 0 14px; color: var(--blue); font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.prog p:last-child { color: var(--muted); font-weight: 600; max-width: 40ch; }

/* ---------- Next ---------- */
.next { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.talk h2 { font-size: var(--t-h2); margin-bottom: 18px; }
.talk .lead { max-width: 520px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.door { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 28px 16px; padding: clamp(26px, 3vw, 34px); border-radius: var(--r-xl); background: var(--ink); color: #fff; transition: transform 0.45s var(--spring), box-shadow 0.3s; box-shadow: var(--shadow-2); -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .door:hover { transform: translateY(-3px); box-shadow: var(--shadow-3); } }
.door:active { transform: scale(0.98); transition-duration: 0.12s; }
.door .icons { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.door .app-icon { --s: 52px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 18px -8px rgba(0, 0, 0, 0.5); transition: transform 0.5s var(--spring); }
@media (hover: hover) { .door:hover .app-icon { transform: translateY(-3px) rotate(-4deg); } }
@media (hover: hover) { .door:hover .app-icon:nth-child(2) { transition-delay: 0.03s; transform: translateY(-3px) rotate(3deg); } }
@media (hover: hover) { .door:hover .app-icon:nth-child(3) { transition-delay: 0.06s; } }
@media (hover: hover) { .door:hover .app-icon:nth-child(4) { transition-delay: 0.09s; transform: translateY(-3px) rotate(4deg); } }
@media (hover: hover) { .door:hover .app-icon:nth-child(5) { transition-delay: 0.12s; } .door:hover .app-icon:nth-child(6) { transition-delay: 0.15s; transform: translateY(-3px) rotate(-3deg); } }
.door-t b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.door-t small { display: block; margin-top: 2px; color: var(--mist); font-size: 15px; font-weight: 700; }
.door-go { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); font-size: 26px; line-height: 1; padding-bottom: 3px; transition: transform 0.4s var(--spring); }
@media (hover: hover) { .door:hover .door-go { transform: translateX(3px); } }

/* ---------- Tablet and phone ---------- */
@media (max-width: 960px) {
  .calc { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'pick' 'controls' 'results'; grid-template-rows: none; }
  .controls { position: static; }
  .pick { position: sticky; top: calc(var(--nav-h) + 6px); z-index: 5; padding-top: 0; }
  .peek { display: none; }
  .pick-card { padding: 14px 18px; border-radius: 22px; background: rgba(255, 255, 255, 0.96); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); box-shadow: 0 0 0 1px rgba(35, 43, 61, 0.06), 0 14px 30px -16px rgba(35, 43, 61, 0.35); align-items: center; }
  #r-name { font-size: 24px; margin: 1px 0 2px; }
  #r-meta { font-size: 13px; }
  .pick small { font-size: 13px; }
  #r-score { font-size: 38px; }
  .chapters { grid-template-columns: 1fr; max-width: 460px; gap: 8px; }
  .stats { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .stat.big .num { font-size: clamp(56px, 15.5vw, 132px); }
  .stat { flex-direction: row; align-items: center; gap: 22px; }
  .stat .waffle { width: 112px; flex: none; }
  .stat .num { font-size: clamp(48px, 13vw, 64px); }
  .stat figcaption span { margin-top: 8px; font-size: 16px; }
  .stat.big { flex-direction: column; align-items: center; }
  .stat.big figcaption span { margin: 12px auto 0; font-size: 19px; }
  .insights { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .progs { grid-template-columns: minmax(0, 1fr); }
  .next { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .cell { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 16px 14px; }
  .group-h { padding: 14px 16px 6px; }
  .seg { width: 100%; height: 36px; }
  .row { padding: 10px 12px 12px 8px; gap: 5px 8px; }
  .fx-name { display: none; }
  .fx code { font-size: 13px; }
  .stat { padding: 22px; gap: 18px; }
  .stat .waffle { width: 92px; }
  .doc { gap: 14px; padding: 14px; }
  .chapters a { padding: 12px 14px; }
  .doc .btn { display: none; }
  .door .icons { gap: 6px; }
  .door .app-icon { --s: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .w-lit circle, .ranking li, .bar i, .seg .thumb, .row, .chapters a, .doc, .door, .door .app-icon { transition: none !important; }
  .pick.bump #r-name, .pick.bump .peek { animation: none; }
}
@media print {
  .controls, .fx, .peek { display: none; }
  .calc { grid-template-columns: 1fr; grid-template-areas: 'pick' 'results'; }
  .stat.big { background: none; color: #000; box-shadow: inset 0 0 0 1px #ccc; }
  .stat.big .num, .stat.big figcaption span { color: #000; }
}

/* Zero state: nothing is being ranked */
.ranking.none .row { opacity: 0.55; }
.ranking.none .bar { visibility: hidden; }

/* Share the result */
.share { display: flex; justify-content: flex-end; margin-top: 14px; }
.share .btn { background: var(--white); box-shadow: inset 0 0 0 1px var(--line); }
.share .btn.done { background: var(--green); color: #fff; box-shadow: none; }
@media (max-width: 520px) { .share .btn { width: 100%; min-height: 48px; } }

/* Touch screens: the 0–5 segments and the sharing button get full-size targets */
@media (pointer: coarse) {
  .seg, .seg[style] { height: 48px; }
  .slider input { height: 44px; }
  .seg .thumb { border-radius: 9px; }
}
