/* ==========================================================================
   Margin of Safety · Mutual fund overlap
   Companion to the "CHECK" reel. Funds go in on white, the answer comes
   back in the reel's language: near-black, neon yellow, Instrument Serif
   italics over Poppins. Mobile first; side by side from 1100px.
   ========================================================================== */

:root {
  --yellow: #FEF213;
  --olive: #322F1D;
  --black: #0C0C0C;
  --card: #151515;
  --card-2: #1C1C1C;
  --line: #2A2A2A;
  --white: #FFFFFF;
  --text: #F5F5F2;
  --muted: #9A9A94;
  --dim: #6F6F69;

  --ink: #0C0C0C;
  --ink-2: #4A4A47;
  --ink-3: #8A8A85;
  --hair: #E8E8E4;
  --paper: #F6F6F3;

  /* one colour per fund slot */
  --f1: #FEF213;
  --f2: #7CC4FF;
  --f3: #FF8A5B;
  --f4: #5EE0A0;
  --f5: #C9A7FF;

  /* overlap heat, dark to neon */
  --h0: #1C1C1C;
  --h1: #262519;
  --h2: #3A3720;
  --h3: #6B6421;
  --h4: #B5AA16;
  --h5: #FEF213;

  --ease: cubic-bezier(.2, .7, .1, 1);
  --sans: 'Poppins', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', ui-serif, Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ol, ul, blockquote { margin: 0; }
ol, ul { padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.result :focus-visible { outline-color: var(--yellow); }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
.wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: 0 20px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 56px; padding: 0 24px; border-radius: 999px; font-size: 15.5px; font-weight: 600; white-space: nowrap; transition: background .2s, color .2s, transform .2s var(--ease); }
.btn:active { transform: scale(.98); }
.btn-yellow { background: var(--yellow); color: var(--black); }
.btn-yellow:hover { background: var(--white); }

/* ==========================================================================
   1 · ASK (white)
   ========================================================================== */
.ask { padding: 0 0 40px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 13px; letter-spacing: .3em; }
.brand-mark { width: 18px; height: 18px; border-radius: 50% 50% 0 50%; background: var(--ink); box-shadow: inset 0 0 0 4px var(--yellow); }
.tag { font-size: 12px; font-weight: 500; color: var(--ink-3); transition: color .2s; }
.tag:hover { color: var(--ink); }

.ask h1 { margin-top: clamp(28px, 7vh, 72px); font-size: clamp(38px, 10.5vw, 60px); line-height: 1.04; letter-spacing: -.035em; font-weight: 600; }
.ask h1 em { font-size: 1.14em; letter-spacing: -.01em; background: linear-gradient(transparent 62%, var(--yellow) 62%, var(--yellow) 92%, transparent 92%); padding: 0 .06em; }
.lede { margin-top: 14px; font-size: 16px; color: var(--ink-2); max-width: 34ch; }

.builder { margin-top: 32px; min-width: 0; }
.b-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.q { font-size: 14px; font-weight: 600; }
.count { font-size: 13px; color: var(--ink-3); }
.count b { color: var(--ink); font-weight: 600; }

.slots { margin-top: 10px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.slot { min-width: 0; padding: 14px 14px 16px; border-radius: 20px; background: var(--paper); border: 1.5px solid var(--hair); transition: border-color .2s, background .2s, box-shadow .2s; animation: slotIn .45s var(--ease) both; }
.slot:focus-within { border-color: var(--ink); background: var(--white); box-shadow: 0 0 0 4px var(--yellow); }
@keyframes slotIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.slot-top { display: flex; justify-content: space-between; align-items: center; min-height: 32px; margin-bottom: 8px; }
.slot-no { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.slot-no i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; color: var(--black); background: var(--c); box-shadow: inset 0 0 0 1px rgba(12, 12, 12, .08); }
.slot-rm { min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--ink-3); transition: color .2s, background .2s; }
.slot-rm:hover { color: var(--ink); background: var(--hair); }
.slot-pick { min-width: 0; }
.slot-alloc { display: grid; grid-template-columns: auto minmax(0, 1fr) 44px; gap: 12px; align-items: center; margin-top: 12px; }
.slot-alloc span { font-size: 12.5px; color: var(--ink-3); }
.slot-alloc output { text-align: right; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.slot.is-empty .slot-alloc { opacity: .35; pointer-events: none; }

/* range */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--ink) var(--p), #DADAD5 var(--p)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: #DADAD5; }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--ink); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--white); border: 2px solid var(--ink); box-shadow: 0 1px 3px rgba(12, 12, 12, .2); transition: transform .15s; }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--white); border: 2px solid var(--ink); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.15); }

.add { width: 100%; height: 52px; margin-top: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; border: 1.5px dashed #D4D4CF; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: border-color .2s, color .2s; }
.add:hover:not(:disabled) { border-style: solid; border-color: var(--ink); color: var(--ink); }
.add:disabled { opacity: .4; cursor: not-allowed; }

.alloc-foot { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; align-items: center; margin-top: 16px; font-size: 12.5px; color: var(--ink-3); }
.alloc-bar { display: flex; gap: 2px; height: 8px; border-radius: 8px; overflow: hidden; background: var(--paper); }
.alloc-bar i { display: block; height: 100%; transition: flex-grow .4s var(--ease); }
.alloc-note { grid-column: 2; }

.examples { margin-top: 28px; }
.q-sm { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.starters { margin: 10px -20px 0 0; padding-right: 20px; display: grid; grid-auto-flow: column; grid-auto-columns: 78%; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
.starters::-webkit-scrollbar { display: none; }
.starter { scroll-snap-align: start; text-align: left; padding: 12px 16px; border-radius: 16px; border: 1.5px solid var(--hair); transition: border-color .2s, background .2s; }
.starter:hover { border-color: var(--ink); }
.starter b { display: block; font-size: 14px; font-weight: 600; }
.starter span { font-size: 12.5px; color: var(--ink-3); }

.go { width: 100%; margin-top: 28px; height: 60px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--ink); color: var(--yellow); font-size: 16px; font-weight: 600; transition: background .2s, color .2s, transform .2s var(--ease); }
.go svg { transition: transform .3s var(--ease); }
.go:hover:not(:disabled) svg { transform: translateY(3px); }
.go:active:not(:disabled) { transform: scale(.98); }
.go:disabled { background: #EDEDEA; color: #A8A8A3; cursor: not-allowed; }
.status { margin-top: 12px; text-align: center; font-size: 12.5px; color: var(--ink-3); }
.status[data-state="error"] { color: #C2410C; }

/* fund picker (white) */
.fp { position: relative; }
.fp-box { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 6px 0 14px; border-radius: 14px; background: var(--white); border: 1.5px solid var(--hair); transition: border-color .2s; }
.fp:hover .fp-box { border-color: #D4D4CF; }
.fp.is-open .fp-box { border-color: var(--ink); }
.fp-value { display: none; flex: 1; min-width: 0; align-items: center; gap: 10px; padding: 8px 0; text-align: left; }
.fp[data-state="filled"] .fp-value { display: flex; }
.fp[data-state="filled"] .fp-search { position: absolute; width: 1px; opacity: 0; pointer-events: none; }
.fp-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: var(--ink-3); cursor: text; }
.fp-icon { display: grid; }
.fp-input { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; outline: none; font: inherit; font-size: 16px; color: var(--ink); }
.fp-input::placeholder { color: #A8A8A3; }
.fp-clear { flex: none; width: 36px; height: 36px; border-radius: 50%; display: none; place-items: center; color: var(--ink-3); }
.fp-clear:hover { color: var(--ink); background: var(--paper); }
.fp[data-state="filled"] .fp-clear { display: grid; }
.fp-mono { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--paper); color: var(--ink); }
.fp-value .fp-mono { background: var(--ink); color: var(--yellow); }
.fp-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fp-name { font-size: 14px; font-weight: 600; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-meta { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-pop { position: absolute; left: -1px; right: -1px; top: calc(100% + 6px); z-index: 70; background: var(--white); border: 1px solid var(--hair); border-radius: 16px; box-shadow: 0 24px 48px -16px rgba(12, 12, 12, .28); opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .15s, transform .2s var(--ease); }
.fp.is-open .fp-pop { opacity: 1; transform: none; pointer-events: auto; }
.fp-list { max-height: 320px; padding: 6px; overflow: auto; overscroll-behavior: contain; }
.fp-opt { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; cursor: pointer; }
.fp-opt.is-active, .fp-opt:hover { background: var(--paper); }
.fp-opt.is-active .fp-mono { background: var(--ink); color: var(--yellow); }
.fp-ret { font-size: 13px; font-weight: 600; text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fp-ret small { display: block; font-size: 10px; font-weight: 500; color: var(--ink-3); }
.fp-empty { padding: 14px 10px; font-size: 13px; color: var(--ink-2); }
.fp-empty strong, .fp-empty small { display: block; }
.fp-empty small { margin-top: 4px; color: var(--ink-3); }

/* ==========================================================================
   2 · RESULT (dark, reel language)
   ========================================================================== */
.result { position: relative; overflow: hidden; background: var(--black); color: var(--text); padding: 20px 0 80px; }
.result::before { content: ''; position: absolute; inset: 0 0 auto; height: 520px; background: radial-gradient(60% 60% at 50% 0%, rgba(254, 242, 19, .10), transparent 70%); pointer-events: none; }
.result .wrap { position: relative; container-type: inline-size; }

.edit { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--muted); transition: border-color .2s, color .2s; }
.edit b { color: var(--text); font-weight: 600; }
.edit:hover { border-color: var(--muted); color: var(--text); }

.eyebrow { font-size: 13px; font-weight: 500; color: var(--muted); }

/* empty state: shown until two funds are loaded */
.empty { display: none; padding: 40px 0 8px; }
.empty-big { font-size: clamp(30px, 8vw, 44px); font-weight: 600; line-height: 1.1; letter-spacing: -.03em; }
.empty-big em { font-size: 1.15em; color: var(--yellow); }
.empty-note { margin-top: 14px; color: var(--muted); max-width: 36ch; }
.result.is-empty .empty { display: block; }
.result.is-empty .hero, .result.is-empty .stats, .result.is-empty .twist, .result.is-empty .card,
.result.is-empty .quote, .result.is-empty .ctas { display: none; }
.result:not(.is-empty) .hero, .result:not(.is-empty) .stats { animation: rise .6s var(--ease) both; }
.result:not(.is-empty) .stats { animation-delay: .1s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* hero */
.hero { padding: 36px 0 8px; }
.hero .eyebrow { font-size: 14px; }
.big { margin-top: 8px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 14px; line-height: .95; }
.big > span { font-size: clamp(64px, 20vw, 112px); font-weight: 700; letter-spacing: -.045em; color: var(--yellow); font-variant-numeric: tabular-nums; white-space: nowrap; }
.big em { font-size: clamp(36px, 10vw, 60px); color: var(--text); }
.per { margin-top: 12px; font-size: 18px; font-weight: 500; max-width: 30ch; }
.verdict { display: inline-flex; margin-top: 16px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; background: var(--card-2); color: var(--text); }
.verdict[data-level="mid"] { background: var(--olive); color: var(--yellow); }
.verdict[data-level="high"] { background: var(--yellow); color: var(--black); }

/* plain numbers */
.stats { margin-top: 32px; padding: 6px 20px 0; border-radius: 22px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.stats .eyebrow { padding: 16px 0 6px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); font-size: 15px; }
.stats .eyebrow + .row { border-top: 0; }
.row > span { min-width: 0; }
.row small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.row b { font-size: 22px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-hi { margin: 0 -20px; padding: 18px 20px; border-top: 0; background: linear-gradient(160deg, var(--olive) 0%, var(--card) 80%); box-shadow: inset 0 1px 0 rgba(254, 242, 19, .35); }
.row-hi > span { font-weight: 600; }
.row-hi small { font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.row-hi b { color: var(--yellow); font-size: 26px; font-weight: 700; }

/* twist */
.twist { margin-top: 16px; display: flex; gap: 14px; padding: 20px; border-radius: 22px; border: 1px solid var(--line); }
.twist-ic { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); color: var(--black); }
.twist h3 { font-size: 16px; font-weight: 600; }
.twist p { margin-top: 4px; font-size: 14px; color: var(--muted); }

/* cards */
.card { margin-top: 16px; min-width: 0; padding: 20px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); }
.card-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.card-head h3 { margin-top: 4px; font-size: 22px; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; }
.card-head h3 em { font-size: 1.15em; color: var(--yellow); }
.hint { margin-top: 12px; font-size: 12.5px; color: var(--dim); }

.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; }
.h0 { background: var(--h0); } .h1 { background: var(--h1); } .h2 { background: var(--h2); }
.h3 { background: var(--h3); } .h4 { background: var(--h4); } .h5 { background: var(--h5); }
.legend .h0 { box-shadow: inset 0 0 0 1px var(--line); }

/* matrix: compact chips-and-numbers on phones */
.matrix-scroll { margin: 0 -20px; padding: 0 20px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.matrix { width: 100%; border-collapse: separate; border-spacing: 4px; margin: -4px; table-layout: fixed; }
.matrix th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; vertical-align: bottom; }
.matrix thead th { padding: 0 0 6px; }
.matrix thead th:first-child { width: 30px; }
.matrix tbody th { vertical-align: middle; }
.m-col { display: flex; flex-direction: column; gap: 6px; }
.m-chip { display: inline-grid; place-items: center; width: 24px; height: 20px; border-radius: 6px; font-size: 10px; font-weight: 700; color: var(--black); background: var(--c); }
.m-colname, .m-row span:last-child { display: none; }
.m-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.m-cell { position: relative; height: 54px; padding: 0; border-radius: 12px; text-align: left; vertical-align: top; }
.m-cell button { position: absolute; inset: 0; width: 100%; padding: 8px 6px; border-radius: 12px; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: transform .2s var(--ease), box-shadow .2s; }
.m-cell button:hover { transform: translateY(-2px); }
.m-cell b { font-size: 14px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.m-cell b small, .m-cell span { display: none; }
.m-cell.is-sel button { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--text); }
.m-cell.dark-text { color: var(--black); }
.m-diag { padding: 0; border-radius: 12px; background: var(--card-2); font-size: 0; text-align: center; vertical-align: middle; }
.m-diag b { font-size: 11px; font-weight: 600; color: var(--dim); }
.m-empty { padding: 32px 0; text-align: center; color: var(--muted); }

@container (min-width: 600px) {
  .matrix { border-spacing: 6px; margin: -6px; }
  .matrix thead th { padding: 0 6px 8px; }
  .matrix thead th:first-child { width: 180px; }
  .matrix tbody th { padding-right: 10px; }
  .m-colname { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
  .m-row { gap: 10px; }
  .m-row span:last-child { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
  .m-cell { height: 72px; }
  .m-cell button { padding: 12px; justify-content: space-between; align-items: flex-start; }
  .m-cell b { font-size: 20px; letter-spacing: -.03em; }
  .m-cell b small { display: inline; font-size: .6em; font-weight: 600; }
  .m-cell span { display: block; font-size: 11px; opacity: .75; }
  .m-diag { padding: 12px; font-size: 11px; text-align: left; vertical-align: top; color: var(--dim); }
  .m-diag b { display: block; font-size: 14px; color: var(--muted); }
}

/* pair */
.pair { display: grid; gap: 24px; }
.pair-sum { display: flex; flex-direction: column; min-width: 0; }
.pair-funds { display: grid; gap: 8px; margin-top: 14px; }
.pair-fund { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 15px; font-weight: 600; }
.pair-fund i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.pair-fund span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pair-big { margin-top: auto; padding-top: 20px; font-size: clamp(56px, 16vw, 84px); font-weight: 700; line-height: 1; letter-spacing: -.045em; color: var(--yellow); font-variant-numeric: tabular-nums; }
.pair-big small { margin-left: 4px; font-size: .45em; letter-spacing: 0; }
.pair-band { margin-top: 10px; font-family: var(--serif); font-style: italic; font-size: 24px; line-height: 1.1; }
.pair-note { margin-top: 6px; max-width: 40ch; font-size: 13.5px; color: var(--muted); }
.pair-meta { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 18px; font-size: 12px; color: var(--muted); }
.pair-meta b { display: block; font-size: 18px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.pair-list { min-width: 0; }
.pair-list-head, .pair-row { display: grid; grid-template-columns: minmax(0, 1fr) 48px 64px 48px; gap: 8px; }
.pair-list-head { padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.pair-row { align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; font-variant-numeric: tabular-nums; animation: fadeUp .4s var(--ease) both; }
.pair-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.pair-row .v { text-align: right; }
.pair-row .v-b { text-align: left; }
.dual { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; height: 8px; }
.dual i { height: 100%; border-radius: 2px; }
.dual i:first-child { justify-self: end; background: var(--ca); }
.dual i:last-child { justify-self: start; background: var(--cb); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

@container (min-width: 600px) {
  .pair-list-head, .pair-row { grid-template-columns: minmax(0, 1fr) 60px 120px 60px; gap: 12px; font-size: 14px; }
  .pair-list-head { font-size: 11px; }
}
@container (min-width: 760px) {
  .pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 40px; }
}

/* look-through and market cap */
.split { display: grid; grid-template-columns: minmax(0, 1fr); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--card-2); }
.seg button { height: 34px; padding: 0 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: background .2s, color .2s; }
.seg button[aria-selected="true"] { background: var(--yellow); color: var(--black); }

.look { display: grid; }
.look li { display: grid; grid-template-columns: 26px minmax(0, 1fr) 64px; grid-template-rows: auto auto; column-gap: 12px; row-gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); animation: fadeUp .4s var(--ease) both; }
.look .rk { grid-row: span 2; padding-top: 2px; font-size: 12px; font-weight: 600; color: var(--dim); font-variant-numeric: tabular-nums; }
.look .nm { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.look .nm b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.look .nm small { font-size: 12px; color: var(--dim); white-space: nowrap; }
.look .w { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.look .bar { grid-column: 2; display: flex; gap: 2px; height: 8px; }
.look .bar i { height: 100%; border-radius: 2px; transition: width .5s var(--ease); }
.look .holders { grid-column: 3; display: flex; justify-content: flex-end; align-items: center; gap: 3px; }
.look .holders i { width: 7px; height: 7px; border-radius: 50%; }
.look .x2 { margin-left: 4px; font-size: 11px; font-weight: 700; color: var(--yellow); }

.stack { display: flex; gap: 2px; height: 14px; border-radius: 6px; overflow: hidden; }
.stack i { height: 100%; transition: flex-grow .5s var(--ease); }
.sector-list { display: grid; grid-template-columns: minmax(0, 1fr); margin-top: 18px; }
.sector-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.sector-list i { flex: none; width: 8px; height: 8px; border-radius: 2px; }
.sector-list span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sector-list b { font-weight: 600; font-variant-numeric: tabular-nums; }

@container (min-width: 760px) {
  .split { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
}

/* close */
.quote { margin: 52px 0 0; font-size: 30px; font-weight: 500; line-height: 1.15; letter-spacing: -.02em; }
.quote em { font-size: 1.35em; color: var(--yellow); }
.ctas { margin-top: 28px; display: grid; }
.ctas .btn { width: 100%; }

.how { margin-top: 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.how summary { list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 56px; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; }
.how summary::-webkit-details-marker { display: none; }
.how summary::after { content: '+'; font-size: 20px; transition: transform .3s var(--ease); }
.how[open] summary::after { transform: rotate(45deg); }
.how ul { padding: 0 0 18px 18px; list-style: disc; display: grid; gap: 6px; font-size: 13.5px; color: var(--muted); }
.how b { color: var(--text); font-weight: 600; }
.fine { margin-top: 18px; font-size: 12px; color: var(--dim); }
.fine b { color: var(--muted); font-weight: 600; }

/* ---------- larger screens ---------- */
@media (min-width: 640px) {
  .wrap { padding: 0 32px; }
  .result .wrap { max-width: 760px; }
  .starters { margin-right: 0; padding-right: 0; grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; }
  .matrix-scroll { margin: 0 -20px; }
  .quote { font-size: 36px; }
  .ctas { grid-template-columns: minmax(0, 320px); }
}

/* Side by side: funds stay put on the left while the answer updates on the right. */
@media (min-width: 1100px) {
  body { display: grid; grid-template-columns: minmax(440px, 38%) minmax(0, 1fr); }
  .ask { position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .ask .wrap { padding: 0 40px; }
  .ask h1 { margin-top: 40px; font-size: clamp(40px, 3.6vw, 56px); }
  .go, .edit { display: none; }
  .result { min-height: 100vh; padding-top: 48px; }
  .result .wrap { max-width: 920px; padding: 0 48px; }
  .hero { padding-top: 8px; }
  .empty { padding-top: 12vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
