:root {
  --bg: #f3f0e7;          /* warm cream */
  --panel: #efebe0;       /* slightly deeper panel */
  --card: #f7f4ec;        /* raised card */
  --ink: #1b1a16;         /* near-black text */
  --ink-soft: #3a3833;
  --muted: #807a6c;       /* muted brown-grey */
  --line: #d8d2c3;        /* hairline */
  --line-strong: #c3bca9;
  --accent: #1b1a16;      /* selected / primary = ink */
  --good: #3f7d4f;
  --bad: #b4543f;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --maxw: 1180px;
  --readw: 720px;   /* shared reading column: methodology, results, hub intro, compare content */
  --wide: 880px;    /* the charts dashboard (Models field + compare card) */
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;   /* sticky footer: main grows, footer pins to bottom */
}

/* Non-Latin scripts: swap to Noto families (loaded on demand by i18n.js) since
   Newsreader/Inter don't cover them. Latin/Cyrillic/Vietnamese/Turkish keep the defaults. */
body.lang-zh { --serif: "Noto Serif SC", "Newsreader", Georgia, serif;
  --sans: "Noto Sans SC", "Inter", -apple-system, "Segoe UI", sans-serif; }
body.lang-ja { --serif: "Noto Serif JP", "Newsreader", Georgia, serif;
  --sans: "Noto Sans JP", "Inter", -apple-system, "Segoe UI", sans-serif; }
body.lang-ko { --serif: "Noto Serif KR", "Newsreader", Georgia, serif;
  --sans: "Noto Sans KR", "Inter", -apple-system, "Segoe UI", sans-serif; }
body.lang-hi { --serif: "Noto Serif Devanagari", "Newsreader", Georgia, serif;
  --sans: "Noto Sans Devanagari", "Inter", -apple-system, "Segoe UI", sans-serif; }
body.lang-ar { --serif: "Noto Naskh Arabic", "Newsreader", Georgia, serif;
  --sans: "Noto Sans Arabic", "Inter", -apple-system, "Segoe UI", sans-serif; }

/* Arabic & Devanagari are cursive/conjunct scripts — letter-spacing breaks them. */
body.lang-ar .eyebrow, body.lang-ar .navlink, body.lang-ar .btn, body.lang-ar .lang-switch,
body.lang-ar .tag, body.lang-ar .why-toggle, body.lang-ar .why-opt, body.lang-ar .mm-meta dt,
body.lang-ar .hero-title, body.lang-ar .dot-count,
body.lang-hi .eyebrow, body.lang-hi .navlink, body.lang-hi .btn, body.lang-hi .lang-switch,
body.lang-hi .tag, body.lang-hi .why-toggle, body.lang-hi .why-opt, body.lang-hi .mm-meta dt {
  letter-spacing: normal;
}

/* ---- right-to-left (Arabic) ---- */
html[dir="rtl"] .progress, html[dir="rtl"] .barwrap { transform: scaleX(-1); } /* bars fill from the right */
html[dir="rtl"] .dot-stack .ans-dot:not(:first-child) { margin-left: 0; margin-right: -8px; }
html[dir="rtl"] .opt-dots { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .mm-close { right: auto; left: 14px; }
html[dir="rtl"] .mm-head { padding-right: 0; padding-left: 24px; }
html[dir="rtl"] .qpop { left: auto; right: 0; }
html[dir="rtl"] .qinfo { margin-left: 0; margin-right: 9px; }
html[dir="rtl"] .navlink.active { box-shadow: inset 0 -2px 0 var(--ink); }

/* ---- shared type ---- */
.eyebrow {
  font-family: var(--sans);
  font-size: 11px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.eyebrow.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
em { font-style: italic; }

/* ---- topbar ---- */
.topbar {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 18px clamp(16px, 5vw, 48px);
  border-bottom: 1px solid var(--line);
}
.wordmark { font-family: var(--serif); font-size: 1.05rem; letter-spacing: .01em;
  background: none; border: none; padding: 0; margin: 0; color: var(--ink); cursor: pointer; }
.wordmark:hover { opacity: .7; }
.wordmark em { color: var(--ink); }
.topnav { display: flex; gap: 8px; align-items: center; }
.navlink { background: transparent; border: none; cursor: pointer; font: inherit; font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 6px 10px; border-radius: 4px; }
.navlink:hover { color: var(--ink); }
.navlink.active { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.lang-switch { font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 4px;
  padding: 5px 8px; margin-left: 4px; cursor: pointer; }
.lang-switch:hover { color: var(--ink); border-color: var(--line-strong); }

#app { max-width: var(--maxw); margin: 0 auto; padding: clamp(20px, 4vw, 48px); flex: 1 0 auto; width: 100%; }
.view.hidden, .hidden { display: none !important; }

/* ---- buttons ---- */
.btn { font-family: var(--sans); cursor: pointer; border: 1px solid var(--line-strong); background: transparent; color: var(--ink);
  padding: 11px 20px; border-radius: 4px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; transition: .15s; }
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { background: #000; }
.btn-ghost { background: transparent; }
.btn-text { border: none; padding: 11px 6px; color: var(--muted); }
.btn-text:hover { color: var(--ink); }
.btn-lg { padding: 15px 34px; font-size: 13px; }

/* ---- landing ---- */
.hero { max-width: 680px; margin: clamp(20px, 6vw, 70px) auto; text-align: center; }
.hero-title { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 7vw, 4.6rem); line-height: 1.02; margin: 0 0 22px; letter-spacing: -0.01em; }
.hero-lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 620px; margin: 0 auto 22px; }
.fineprint { color: var(--muted); font-size: .82rem; margin-top: 18px; }
.cat-chips { list-style: none; padding: 0; margin: 18px 0 26px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.cat-chips li { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: .8rem; color: var(--muted); letter-spacing: .02em; }
.resume-row { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 16px 0; flex-wrap: wrap; }

/* ---- quiz two-pane ---- */
.two-pane { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(24px, 5vw, 72px); align-items: start; }
.scenario { min-width: 0; }
.scenario-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.scenario-head .tag { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; border: 1px solid var(--line-strong); padding: 5px 10px; border-radius: 3px; white-space: nowrap; }
.scenario-head .rule { flex: 1; height: 1px; background: var(--line); }
.scenario-head .count { font-size: 12px; color: var(--muted); letter-spacing: .12em; font-variant-numeric: tabular-nums; }

.progress { height: 2px; background: var(--line); margin-bottom: 30px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--ink); transition: width .35s; }

/* five scenarios per page */
.questions { display: flex; flex-direction: column; }
.questions .q { border-top: 1px solid var(--line); padding: 28px 0; }
.questions .q:first-child { border-top: none; padding-top: 4px; }
/* per-option model dots: which models picked this answer (revealed once the user answers) */
.opt-dots { margin-left: auto; display: none; align-items: center; gap: 8px; padding-left: 12px; }
.dot-stack { display: flex; }
.ans-dot { width: 19px; height: 19px; border-radius: 50%; border: 2px solid var(--line-strong);
  background: #fff center / 72% no-repeat; box-shadow: 0 0 0 1px rgba(0,0,0,.08);
  cursor: help; transition: transform .12s; }
.dot-stack .ans-dot:not(:first-child) { margin-left: -8px; } /* half-overlap, single row */
.ans-dot:hover { transform: scale(1.4); position: relative; z-index: 5; }
.dot-count { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.dots-caption { display: none; margin-top: 12px; font-size: .78rem; color: var(--muted); }
/* reveal only after the user has answered this question */
.q.answered .opt-dots { display: flex; }
.q.answered .dots-caption { display: block; }

/* "why each model chose" — collapsible, only after the user has answered */
.why { display: none; margin-top: 14px; }
.q.answered .why { display: block; }
.why-toggle { background: transparent; border: none; cursor: pointer; font: inherit;
  font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); padding: 6px 0; }
.why-toggle:hover { color: var(--ink); }
.why-caret { margin-left: 5px; }
.why-body { display: none; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.why.open .why-body { display: block; }
.why-group { margin-bottom: 16px; }
.why-group:last-child { margin-bottom: 0; }
.why-opt { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 8px; }
.why-opt .why-n { color: var(--muted); font-weight: 600; margin-left: 4px; }
.why-row { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; }
.why-row .chip { width: 24px; height: 24px; border-radius: 6px; flex: none; font-size: 8px; }
.why-text { min-width: 0; }
.why-model { display: block; font-size: .76rem; font-weight: 600; line-height: 1.2; }
.why-reason { display: block; font-size: .86rem; color: var(--ink-soft); line-height: 1.4; }

/* ---- model info: clickable names/icons + modal ---- */
.model-link { cursor: pointer; outline: none; }
.mname.model-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.chip.model-link { transition: transform .12s, box-shadow .12s; }
.chip.model-link:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,.14); }
td.model-link:hover { text-decoration: underline; }
.model-link:focus-visible { box-shadow: 0 0 0 2px var(--ink); border-radius: 4px; }

.model-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; }
.model-modal.hidden { display: none; }
.mm-backdrop { position: absolute; inset: 0; background: rgba(20,18,14,.55); }
.mm-card { position: relative; z-index: 1; background: var(--card); border: 1px solid var(--line-strong);
  border-radius: 14px; max-width: 460px; width: calc(100% - 40px); padding: 26px 28px 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,.28); animation: mm-in .18s cubic-bezier(.2,.8,.3,1); }
@keyframes mm-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.mm-close { position: absolute; top: 10px; right: 14px; background: none; border: none;
  font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; }
.mm-close:hover { color: var(--ink); }
.mm-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding-right: 24px; }
.mm-head .chip { width: 44px; height: 44px; border-radius: 11px; flex: none; }
.mm-name { font-family: var(--serif); font-weight: 500; font-size: 1.4rem; margin: 0; }
.mm-summary { color: var(--ink-soft); font-size: .95rem; line-height: 1.55; margin: 0 0 18px; }
.mm-meta { display: flex; gap: 30px; margin: 0 0 20px; }
.mm-meta dt { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.mm-meta dd { margin: 0; font-size: .92rem; font-weight: 500; }
.mm-site { display: inline-block; text-decoration: none; font-size: 11px; }
@media (prefers-reduced-motion: reduce) { .mm-card { animation: none; } }

/* dots stack in quickly from the side, one after another (delay set inline per dot).
   `backwards` keeps them hidden during their stagger delay, then drops the fill so
   the resting transform is clear and :hover scaling still works. */
@keyframes dot-stack-in {
  from { opacity: 0; transform: translateX(-14px) scale(.5); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
.q.answered .ans-dot { animation: dot-stack-in .26s cubic-bezier(.2,.85,.3,1.2) backwards; }
.q.answered .dot-count { animation: dot-count-in .3s ease both; }
@keyframes dot-count-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .q.answered .ans-dot, .q.answered .dot-count { animation: none; }
}

/* methodology */
.method { max-width: var(--wide); margin: 10px auto 0; }   /* matches the Models tab width, left-aligned */
.method-title { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.08; margin: 0 0 18px; text-align: center; }
.method-lead { font-size: 1.08rem; color: var(--ink-soft); margin: 0 0 34px; }
.method h3 { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; margin: 30px 0 8px; }
.method p { color: var(--ink-soft); margin: 0 0 12px; }
.method-foot { color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 34px; }
.method-start { margin-top: 22px; }
#method-start { margin-top: 6px; }
/* global site footer (byline) — deliberately low-contrast */
.site-footer { flex-shrink: 0; margin-top: 40px;
  padding: 20px clamp(16px, 5vw, 48px); text-align: center; }
.site-footer p { margin: 0; color: #bcb6a6; font-size: .8rem; letter-spacing: .01em; }
.site-footer a { color: #aaa393; text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--muted); }
.q-prompt { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; line-height: 1.25; margin-bottom: 18px; color: var(--ink); }
.q-prompt .qn { color: var(--muted); margin-right: 8px; font-variant-numeric: tabular-nums; }

/* info tooltip (historical questions) */
.qinfo { position: relative; display: inline-flex; vertical-align: middle; margin-left: 9px; }
.qmark { width: 19px; height: 19px; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--muted);
  font-family: var(--sans); font-size: 11px; font-weight: 700; display: grid; place-items: center; cursor: help; }
.qmark:hover, .qmark:focus { border-color: var(--ink); color: var(--ink); outline: none; }
.qpop {
  position: absolute; left: 0; top: 150%; width: 290px; max-width: 74vw;
  background: var(--ink); color: var(--bg); font-family: var(--sans); font-weight: 400;
  font-size: .8rem; line-height: 1.45; letter-spacing: .01em; text-transform: none;
  padding: 13px 15px; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.22);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: .16s; z-index: 30;
}
.qinfo:hover .qpop, .qmark:focus + .qpop { opacity: 1; visibility: visible; transform: translateY(0); }
.qpop a { color: #9bd0ff; display: inline-block; margin-top: 8px; font-weight: 600; text-decoration: underline; }

.opts { display: flex; flex-direction: column; gap: 12px; }
.opts.binary { flex-direction: row; }
.opt {
  display: flex; align-items: center; gap: 16px; text-align: left;
  background: var(--card); border: 1px solid var(--line); color: var(--ink);
  border-radius: 8px; padding: 16px 18px; cursor: pointer; font: inherit; transition: .14s; width: 100%;
}
.opt:hover { border-color: var(--line-strong); background: #faf7f0; }
.opt .optkey {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-strong);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); transition: .14s;
}
.opt .optlabel { font-weight: 600; font-size: 1rem; letter-spacing: .01em; }
.opt.selected { border-color: var(--ink); background: #f0ece1; }
.opt.selected .optkey { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.opts.binary .opt { flex: 1; padding: 18px 20px; }
.opts.binary .opt .optlabel { text-transform: uppercase; letter-spacing: .08em; font-size: .95rem; }
.opts.binary .opt .optkey { display: none; }

.quiz-nav { display: flex; justify-content: space-between; align-items: center; margin: 34px 0 30px; }
.nav-right { display: flex; gap: 14px; align-items: center; }

/* ---- live pane ---- */
.live { border: 1px solid var(--line); border-radius: 12px; padding: 24px; background: var(--panel); position: sticky; top: 20px; overflow: hidden; }
.live.locked { max-height: 440px; } /* keep the blurred teaser + reveal button compact */
.live-inner { transition: filter .4s; }
.live.locked .live-inner { filter: blur(9px); pointer-events: none; user-select: none; }
.live.locked .live-inner::after { content: ""; }
.live-gate {
  position: absolute; inset: 0; display: none; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 14px;
  padding: 28px; background: linear-gradient(180deg, rgba(239,235,224,.72), rgba(239,235,224,.92));
}
.live.locked .live-gate { display: flex; }
.live-gate .gate-lead { color: var(--ink-soft); font-size: .92rem; max-width: 300px; margin: 0; }
.live-gate .gate-hint { color: var(--muted); font-size: .78rem; letter-spacing: .04em; margin: 0; }
.live-gate .btn[disabled] { opacity: .45; cursor: not-allowed; }
.live-gate .btn:not([disabled]) { box-shadow: 0 6px 20px rgba(27,26,22,.18); }
.live-title { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; margin: 0 0 8px; }
.live-note { color: var(--muted); font-size: .85rem; margin: 0 0 22px; }
.live-sub { margin-top: 22px; }
.live-cats { display: flex; flex-direction: column; gap: 9px; }
.lc-row { display: grid; grid-template-columns: 84px 1fr 38px; gap: 10px; align-items: center; font-size: .82rem; }
.lc-row .lc-name { color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-row .lc-bar { height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; }
.lc-row .lc-fill { height: 100%; background: var(--ink); border-radius: 999px; }
.lc-row .lc-pct { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.live-models { display: flex; flex-direction: column; gap: 10px; }

/* ---- model rows (live + leaderboard) ---- */
.mrow { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; }
.chip { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center;
  background: #fff; border: 2px solid var(--line-strong); overflow: hidden;
  color: var(--ink); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.chip img { width: 72%; height: 72%; object-fit: contain; display: block; }
.mrow .mbody { min-width: 0; }
.mrow .mname { font-size: .9rem; font-weight: 500; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow .barwrap { height: 5px; background: var(--line); border-radius: 999px; overflow: hidden; }
.mrow .bar { height: 100%; border-radius: 999px; transition: width .45s cubic-bezier(.2,.8,.3,1); }
.mrow .pct { font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mrow .pct .lbl { color: var(--muted); font-weight: 400; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; margin-left: 4px; }
.mrow.top .pct { color: var(--ink); }

/* ---- results ---- */
.headline { text-align: center; margin: 6px 0 26px; }
.headline .big { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.05; display: block; margin: 6px 0; }
.headline .muted { font-size: .92rem; }
.continue-row { text-align: center; margin: 0 auto 26px; max-width: 460px; }
.continue-row .btn-lg { margin-bottom: 8px; }
.tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 26px; }
.tab { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); border-radius: 999px; padding: 8px 20px; cursor: pointer; font: inherit; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.tab.active { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.panel { max-width: var(--readw); margin: 0 auto; }
.panel .eyebrow { margin-top: 34px; }
.leaderboard { display: flex; flex-direction: column; gap: 12px; }

/* category table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.cat { border-collapse: collapse; width: 100%; font-size: .85rem; }
table.cat th, table.cat td { padding: 9px 12px; text-align: center; border-bottom: 1px solid var(--line); }
table.cat tbody tr:last-child td { border-bottom: none; }
table.cat th:first-child, table.cat td:first-child { text-align: left; white-space: nowrap; position: sticky; left: 0; background: var(--bg); font-weight: 500; }
table.cat thead th { color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
table.cat td.cell { font-variant-numeric: tabular-nums; }

/* radar */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.pill { border: 1px solid var(--line-strong); background: transparent; color: var(--muted); border-radius: 999px; padding: 6px 13px; cursor: pointer; font: inherit; font-size: .82rem; display: inline-flex; align-items: center; gap: 8px; }
.pill .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; opacity: .3; }
.pill.on { color: var(--ink); border-color: currentColor; }
.pill.on .dot { opacity: 1; }
.radar-wrap { display: flex; justify-content: center; padding: 10px; }
.radar-wrap svg { max-width: 100%; height: auto; }

/* drilldown */
.drilldown { display: flex; flex-direction: column; gap: 8px; max-width: var(--readw); margin: 0 auto; }
details.cat-d { border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px; background: var(--card); }
details.cat-d summary { cursor: pointer; padding: 12px 0; font-weight: 600; display: flex; justify-content: space-between; font-size: .95rem; }
details.cat-d summary::-webkit-details-marker { display: none; }
details.cat-d summary .s-pct { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.dq { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); font-size: .88rem; }
.dq .you, .dq .them { padding: 3px 9px; border-radius: 5px; font-size: .8rem; white-space: nowrap; }
.dq .you { background: var(--panel); }
.dq .them.agree { background: rgba(63,125,79,.14); color: var(--good); }
.dq .them.diff { background: rgba(180,84,63,.14); color: var(--bad); }

/* share */
.share { max-width: var(--readw); margin: 30px auto 0; }
.share textarea { width: 100%; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font: inherit; resize: vertical; }
.share-actions { display: flex; gap: 12px; margin-top: 12px; }

/* tablet: stack the two panes, live results drop below the questions */
@media (max-width: 880px) {
  .two-pane { grid-template-columns: 1fr; gap: 32px; }
  /* relative (not sticky, not static) so the absolute reveal-gate stays contained */
  .live { position: relative; top: auto; max-height: none; }
  .live.locked { max-height: 400px; }
}

/* phone */
@media (max-width: 600px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 18px; padding: 16px 16px; }
  .topnav { width: 100%; }
  #app { padding: 18px 16px; }

  .hero { margin: 14px auto 8px; }
  .hero-lead { font-size: 1rem; }
  .cat-chips { gap: 6px; }
  .cat-chips li { font-size: .72rem; padding: 5px 11px; }

  /* keep Resume + Start over on one row; "N answers saved" sits on its own line above */
  .resume-row { gap: 10px; }
  #resume-text { flex-basis: 100%; text-align: center; }

  .scenario-head { gap: 10px; }
  .q-prompt { font-size: 1.18rem; }
  .questions .q { padding: 22px 0; }

  /* options: let the model dots wrap onto their own line so nothing is cramped */
  .opt { flex-wrap: wrap; gap: 12px; padding: 14px 16px; }
  .opt .optlabel { font-size: .98rem; }
  .opts.binary { flex-direction: row; }
  .q.answered .opt-dots { flex-basis: 100%; margin-left: 0; margin-top: 6px;
    padding-left: 42px; justify-content: flex-start; }
  /* binary buttons keep a fixed height; dots tuck in near the bottom, no expanding */
  .opts.binary .opt { min-height: 78px; padding: 14px 16px; gap: 6px; align-content: space-between; }
  .opts.binary .opt-dots { flex-basis: 100%; padding-left: 0; margin-top: 0; }

  .nav-hint { display: none; }
  .quiz-nav { margin: 26px 0; }

  .live { padding: 18px; }
  .live-gate { padding: 20px; }

  /* info tooltip: anchor to the right edge so it doesn't run off-screen */
  .qpop { left: auto; right: 0; width: 84vw; max-width: 320px; }

  .headline .big { font-size: 1.9rem; }
  .continue-row .btn-lg, .btn-lg { padding: 13px 22px; font-size: 12px; }
  .panel .eyebrow { margin-top: 26px; }
}

@media (max-width: 380px) {
  .wordmark { font-size: .98rem; }
  .q-prompt { font-size: 1.1rem; }
  .mrow { grid-template-columns: 32px 1fr auto; gap: 10px; }
  .chip { width: 32px; height: 32px; }
}

/* =====================================================================
   Psychometric profiles / self-test (English-only section)
   ===================================================================== */
.xsmall { font-size: .74rem; }
.btn-sm { padding: 7px 13px; font-size: 10px; }
.mm-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---- models hub ---- */
#models-hub { max-width: var(--wide); margin: 0 auto; }  /* left-aligned column; text + charts both fill it */
.hub-title { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.08; margin: 4px 0 16px; text-align: center; }
.hub-lead { margin: 0 0 16px; font-size: 1.08rem; color: var(--ink-soft); }
.hub-lead:last-of-type { margin-bottom: 30px; }
.hub-foot { max-width: 720px; margin: 26px auto 0; text-align: center; }
.hub-method { max-width: 680px; margin: 0 auto 26px; }
.hub-method summary { cursor: pointer; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-align: center; }
.hub-method summary:hover { color: var(--ink); }
.hub-method p { margin: 12px 0 0; }

/* ---- the field: all models on one chart per test ---- */
.field { max-width: var(--wide); margin: 0 auto 40px; }
.field-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field-panel.span2 { grid-column: 1 / -1; }
.field-lead { text-align: center; max-width: 620px; margin: 0 auto 18px; }
.field-legend { display: flex; flex-wrap: wrap; gap: 4px 8px; justify-content: flex-start; margin: 0 0 24px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: none; cursor: pointer; font: inherit; padding: 3px 6px; border-radius: 6px; color: var(--ink-soft); transition: opacity .12s; }
.legend-item:hover { background: var(--card); }
.legend-chip { width: 18px; height: 18px; border-radius: 5px; flex: none; }
.legend-name { font-size: .76rem; }
.field-panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 12px; }
.field-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.field-title { font-family: var(--serif); font-weight: 500; font-size: 1.15rem; margin: 0; }
.field-chart { margin-top: 6px; }
.chart-radar { display: block; height: auto; }   /* responsive height from the padded viewBox */
.field-chart .chart-radar { max-width: 520px; margin: 0 auto; }
.field-compass { max-width: 400px; margin: 0 auto 6px; }
.x-dot, .x-line { cursor: pointer; transition: opacity .12s; }
/* hover a model anywhere -> dim the rest, highlight it across every chart */
.field.hovering .x-dot, .field.hovering .x-line, .field.hovering .legend-item, .field.hovering .tg-logo { opacity: .14; }
.field.hovering .x-dot.hl, .field.hovering .x-line.hl, .field.hovering .legend-item.hl, .field.hovering .tg-logo.hl { opacity: 1; }
.field.hovering .x-dot.hl circle { stroke-width: 3.5; }
.field.hovering .x-line.hl { stroke-width: 3; fill-opacity: .16; }
/* radar axis captions link to the top-scoring model on that trait */
.radar-axis[data-model] { cursor: pointer; }
.radar-axis[data-model]:hover, .field.hovering .radar-axis.hl { fill: var(--ink); font-weight: 600; }
.x-name { pointer-events: none; }
.x-name.hoveronly { opacity: 0; transition: opacity .12s; }       /* dense charts: name on hover */
.field.hovering .x-dot.hl .x-name.hoveronly { opacity: 1; }
@media (max-width: 680px) { .field-panels { grid-template-columns: 1fr; } }

.chart-typegrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tg-cell { border: 1px solid var(--line); border-radius: 8px; padding: 7px; min-height: 52px; background: var(--bg); }
.tg-cell.occ { border-color: var(--line-strong); background: var(--panel); }
.tg-type { font-size: .68rem; font-weight: 700; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; }
.tg-logos { display: flex; flex-wrap: wrap; gap: 4px; }
.tg-logo { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid; overflow: hidden; display: grid; place-items: center; cursor: pointer; background: var(--card); font-size: 6px; font-weight: 700; transition: opacity .12s; }
.tg-logo img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 520px) { .chart-typegrid { grid-template-columns: repeat(2, 1fr); } }

.compare-panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px; max-width: var(--wide); margin: 0 0 36px; } /* matches the charts width */
.compare-inner { max-width: none; margin: 0; }
.test-list { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 8px; }
.test-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.test-row:last-child { border-bottom: none; }
.test-row-lab { flex: 1; display: flex; flex-direction: column; }
.test-row-name { font-weight: 600; }
.test-done { color: var(--good); font-size: .8rem; font-weight: 600; }
.rank-eyebrow { margin-top: 22px; }
.rank-list { display: flex; flex-direction: column; gap: 6px; }
.rank-row { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; cursor: pointer; padding: 4px; border-radius: 8px; }
.rank-row:hover { background: var(--card); }
.rank-row.top .rank-name { font-weight: 700; }
.rank-body { min-width: 0; }
.rank-name { font-size: .9rem; margin-bottom: 4px; }
.rank-barwrap { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.rank-bar { height: 100%; border-radius: 3px; transition: width .5s; }
.rank-pct { font-variant-numeric: tabular-nums; font-weight: 700; font-size: .92rem; }

/* ---- single profile ---- */
#model-profile { max-width: var(--wide); margin: 0 auto; }
.profile-back { padding-left: 0; }
.profile-head { display: flex; gap: 18px; align-items: flex-start; margin: 8px 0 10px; }
.profile-chip { width: 56px; height: 56px; border-radius: 14px; flex: none; }
.profile-name { font-family: var(--serif); font-weight: 500; font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 4px; }
.profile-meta { font-size: .85rem; letter-spacing: .04em; }
.profile-summary { color: var(--ink-soft); margin: 10px 0 8px; max-width: 640px; }
.model-link-out { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; color: var(--ink); }
.profile-caveat { max-width: var(--readw); margin: 6px 0 24px; border-left: 2px solid var(--line-strong); padding-left: 12px; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.icard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.icard-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.icard-title { font-family: var(--serif); font-weight: 500; font-size: 1.15rem; margin: 0; }
.icard-blurb { margin: 6px 0 10px; }
.icard-chart { margin: 6px 0; }
.icard-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.icard-caveat { margin: 8px 0 0; }
.icard-flat { margin: 0 0 10px; font-size: .8rem; color: var(--bad); background: rgba(180,84,63,.08);
  border: 1px solid rgba(180,84,63,.25); border-radius: 8px; padding: 8px 10px; line-height: 1.4; }
.ichart-match { margin-top: 10px; font-size: .9rem; }
.ichart-match strong { font-size: 1.05rem; }
.ichart-foot { margin: 8px 0 0; }

/* ---- per-test answer report (expandable + downloadable) ---- */
.icard-answers { margin-top: 12px; }
.answers > summary { cursor: pointer; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 6px 0; }
.answers > summary:hover { color: var(--ink); }
.answers-note { margin: 2px 0 10px; }
.answers-table { max-height: 280px; overflow-y: auto; border-top: 1px solid var(--line); }
.arow { display: grid; grid-template-columns: 1fr 34px 46px; align-items: center; gap: 10px; padding: 6px 2px; border-bottom: 1px solid var(--line); font-size: .82rem; }
.a-item { color: var(--ink-soft); line-height: 1.35; }
.rev-tag { display: inline-block; font-size: .58rem; font-weight: 700; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 3px; vertical-align: middle; }
.a-mean { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.dbars { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.dbar { width: 5px; background: var(--line-strong); border-radius: 1px; display: block; }
.answers-dl { display: flex; gap: 8px; margin-top: 12px; }

/* ---- chart: radar legend ---- */
.ichart-legend { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.lg { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; color: var(--muted); }
.lg-sw { width: 12px; height: 12px; border-radius: 3px; border: 2px solid; display: inline-block; }

/* ---- chart: horizontal bars (Big/HEXACO/Schwartz) ---- */
.chart-bars { display: flex; flex-direction: column; gap: 7px; }
.ibar { display: grid; grid-template-columns: 96px 1fr 42px; align-items: center; gap: 10px; }
.ibar-label { font-size: .82rem; color: var(--ink-soft); }
.ibar-track { position: relative; height: 9px; background: var(--line); border-radius: 5px; }
.ibar-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 5px; transition: width .5s; }
.ibar-tick { position: absolute; top: -2px; width: 2px; height: 13px; background: var(--ink-soft); opacity: .5; }
.ibar-you { position: absolute; top: -3px; width: 0; height: 15px; border-left: 2px dashed; border-color: #7a3f9e; }
.ibar-val { font-variant-numeric: tabular-nums; font-size: .8rem; text-align: right; color: var(--muted); }

/* ---- chart: opposed axes (8values) ---- */
.chart-axes { display: flex; flex-direction: column; gap: 12px; }
.axrow-head { display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted); margin-bottom: 4px; }
.ax-name { font-weight: 600; color: var(--ink-soft); }
.ax-track { position: relative; height: 10px; background: var(--line); border-radius: 5px; }
.ax-mid { position: absolute; left: 50%; top: -2px; width: 1px; height: 14px; background: var(--line-strong); }
.ax-fill { position: absolute; top: 0; height: 100%; border-radius: 5px; transition: width .5s, left .5s; }
.ax-you { position: absolute; top: -3px; width: 0; height: 16px; border-left: 2px dashed #7a3f9e; }
.compass-wrap { max-width: 300px; margin: 14px auto 0; }

/* ---- chart: type badge (OEJTS) ---- */
.chart-type { text-align: center; }
.type-badge { font-family: var(--serif); font-weight: 600; font-size: 2.6rem; letter-spacing: .14em; margin: 4px 0 14px; }
.type-dims { display: flex; flex-direction: column; gap: 9px; }
.tdim { display: grid; grid-template-columns: 78px 1fr 78px; align-items: center; gap: 8px; }
.tdim-l { text-align: right; } .tdim-r { text-align: left; }
.tdim-l, .tdim-r { font-size: .78rem; color: var(--muted); }
.tdim-l.on, .tdim-r.on { color: var(--ink); font-weight: 700; }
.tdim-track { position: relative; height: 8px; background: var(--line); border-radius: 4px; }
.tdim-mid { position: absolute; left: 50%; top: -2px; width: 1px; height: 12px; background: var(--line-strong); }
.tdim-fill { position: absolute; top: 0; height: 100%; border-radius: 4px; transition: width .5s, left .5s; }
.tdim-you { position: absolute; top: -3px; width: 0; height: 14px; border-left: 2px dashed #7a3f9e; }

/* ---- self-test runner ---- */
#test-runner { max-width: var(--readw); margin: 0 auto; }
.test-title { font-family: var(--serif); font-weight: 500; font-size: 1.7rem; margin: 4px 0 8px; }
.test-instr { margin: 0 0 6px; }
.test-anchors { margin: 0 0 18px; }
.test-form { display: flex; flex-direction: column; gap: 4px; }
.test-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.test-q { margin-bottom: 9px; font-size: 1rem; }
.test-n { color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; }
.test-bipolar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; }
.bp-l { text-align: right; } .bp-l, .bp-r { font-size: .9rem; color: var(--ink-soft); }
.scale { display: flex; gap: 6px; justify-content: center; }
.scale-btn { width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--card); color: var(--ink-soft); cursor: pointer; font: inherit; font-weight: 600; transition: .12s; }
.scale-btn:hover { border-color: var(--ink); }
.scale-btn.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.test-actions { display: flex; align-items: center; gap: 14px; justify-content: flex-end; margin: 20px 0 12px; position: sticky; bottom: 0;
  background: linear-gradient(transparent, var(--bg) 30%); padding: 14px 0; }
.test-status { margin-right: auto; }

@media (max-width: 720px) {
  .profile-grid { grid-template-columns: 1fr; }
  .test-bipolar { grid-template-columns: 1fr; gap: 6px; text-align: center; }
  .bp-l { text-align: center; }
  .scale-btn { width: 44px; height: 40px; }
  .ibar { grid-template-columns: 84px 1fr 36px; }
}
