/* ============================================================== *
 *  Philosophical Profile — a personality test from the 100
 *  questions of the 2020 PhilPapers Survey.
 *
 *  Theming: every colour routes through a CSS variable. The light
 *  palette lives in :root; [data-theme="dark"] overrides it. The
 *  category accent colours (set inline from JS) are made theme-aware
 *  in app.js via catColors().
 * ============================================================== */

:root {
  --bg: #faf9f7;
  --bg-glow: #f3f1ff;
  --panel: #ffffff;
  --ink: #1f1e1d;
  --ink-soft: #5b574f;
  --ink-faint: #8a857c;
  --border: #e7e3db;
  --border-strong: #d8d2c6;

  --accent: #534ab7;
  --accent-btn: #534ab7;
  --accent-btn-hover: #463da6;
  --accent-soft: #eeedfe;
  --accent-border: #d9d4f6;
  --accent-ink: #3c3489;
  --good: #0f6e56;
  --friend: #d97a26;

  --code-bg: #f1efe9;
  --opt-bg: #fcfbf9;
  --opt-bg-hover: #fafaff;
  --opt-border-hover: #b9b1f0;
  --opt-key-bg: #efece5;
  --opt-lean-key-bg: #d9d4f6;
  --opt-lean-key-bd: #c3bcef;
  --opt-firm-bg: #e3def9;
  --chip-bg: #f4f2ec;
  --chip-bg-hover: #ece8df;
  --chip-on-bg: #efeae0;
  --track-bg: #ece8e0;
  --topbar-bg: rgba(250, 249, 247, .82);
  --detail-bg: #fbfaf7;
  --arch-grad-a: #ffffff;
  --arch-grad-b: #fbfaff;
  --arch-border: #e2ddf6;
  --muted-tag-bg: #f1efe9;
  --muted-tag-bd: #e0dccf;
  --ghost-bg-hover: #fdfcfa;
  --ghost-border-hover: #c2bbac;

  --shadow: 0 1px 2px rgba(31, 30, 29, .06), 0 6px 24px rgba(31, 30, 29, .06);
  --radius: 14px;
  --font: "Anthropic Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #141312;
  --bg-glow: #211f3a;
  --panel: #1f1d1a;
  --ink: #f2efe9;
  --ink-soft: #bdb6aa;
  --ink-faint: #8b857a;
  --border: #322e28;
  --border-strong: #423d34;

  --accent: #9b93f0;
  --accent-btn: #5b51c4;
  --accent-btn-hover: #6a60d4;
  --accent-soft: #251f3d;
  --accent-border: #3a3463;
  --accent-ink: #cfcaf6;
  --good: #46c79a;
  --friend: #f0a653;

  --code-bg: #211e18;
  --opt-bg: #1b1916;
  --opt-bg-hover: #201d28;
  --opt-border-hover: #5b51c4;
  --opt-key-bg: #2a261f;
  --opt-lean-key-bg: #3a3370;
  --opt-lean-key-bd: #4b4490;
  --opt-firm-bg: #2f2a55;
  --chip-bg: #211e18;
  --chip-bg-hover: #2a261f;
  --chip-on-bg: #2c281f;
  --track-bg: #2a2620;
  --topbar-bg: rgba(20, 19, 18, .82);
  --detail-bg: #1a1814;
  --arch-grad-a: #211d2e;
  --arch-grad-b: #1a1820;
  --arch-border: #34305a;
  --muted-tag-bg: #262219;
  --muted-tag-bd: #3a352c;
  --ghost-bg-hover: #232019;
  --ghost-border-hover: #4a4438;

  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--bg-glow) 0%, transparent 60%),
    var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 28px 20px 80px; }

a { color: var(--accent); }

/* ---- theme toggle ---- */
.theme-toggle {
  position: fixed; top: 14px; right: 14px; z-index: 20;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  font-size: 18px; line-height: 1;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.theme-toggle:hover { transform: translateY(-1px) rotate(-12deg); border-color: var(--accent); }
.theme-toggle:active { transform: translateY(0); }
.theme-toggle .ti { pointer-events: none; }

/* ---- screens ---- */
.screen { display: none; animation: fade .35s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- intro ---- */
.hero { text-align: center; padding: 26px 0 10px; }
.eyebrow {
  display: inline-block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-border);
  padding: 5px 12px; border-radius: 999px; font-weight: 600; margin-bottom: 18px;
}
h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.08; margin: 0 0 14px; letter-spacing: -.02em; }
.lede { font-size: 17px; color: var(--ink-soft); max-width: 620px; margin: 0 auto 8px; }

.facts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 26px 0 30px; }
.fact {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; min-width: 120px; box-shadow: var(--shadow);
}
.fact b { display: block; font-size: 22px; color: var(--accent-ink); }
.fact span { font-size: 12.5px; color: var(--ink-faint); }

.btn {
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  border-radius: 11px; padding: 12px 22px; border: 1px solid transparent;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent-btn); color: #fff; box-shadow: 0 6px 18px rgba(83, 74, 183, .28); }
.btn-primary:hover { background: var(--accent-btn-hover); }
.btn-ghost { background: var(--panel); color: var(--ink); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--ghost-border-hover); background: var(--ghost-bg-hover); }
.btn-ghost:disabled { opacity: .4; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

.note { font-size: 13px; color: var(--ink-faint); max-width: 640px; margin: 22px auto 0; }
.note code { background: var(--code-bg); padding: 1px 6px; border-radius: 5px; font-size: 12px; }

/* ---- quiz top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px);
  background: var(--topbar-bg); border-bottom: 1px solid var(--border);
  margin: -28px -20px 22px; padding: 12px 20px;
}
.topbar-inner { max-width: 880px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding-right: 50px; }
.progress { flex: 1; height: 8px; background: var(--track-bg); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6a5fe0, #534ab7); border-radius: 999px; transition: width .3s ease; }
.counter { font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.counter b { color: var(--ink); }
.link-btn { background: none; border: none; color: var(--accent); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 6px; border-radius: 7px; }
.link-btn:hover { background: var(--accent-soft); }

/* ---- question card ---- */
.qcard { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 26px 22px; }
.qcat { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; margin-bottom: 16px; }
.qcat i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.qtopic { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); margin-bottom: 6px; }
.qtext { font-size: 22px; line-height: 1.3; margin: 0 0 14px; letter-spacing: -.01em; }
.qdetail {
  font-size: 14.5px; line-height: 1.6; color: var(--ink-soft);
  margin: 0 0 18px; padding: 12px 14px; white-space: pre-line;
  background: var(--detail-bg); border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong); border-radius: 10px;
}
.qhint { font-size: 13px; color: var(--ink-faint); margin: 0 0 18px; }

.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 13px; text-align: left; width: 100%;
  font-family: inherit; font-size: 16px; color: var(--ink); cursor: pointer;
  background: var(--opt-bg); border: 1.5px solid var(--border-strong); border-radius: 12px;
  padding: 14px 16px; transition: border-color .12s, background .12s, box-shadow .12s;
}
.opt:hover { border-color: var(--opt-border-hover); background: var(--opt-bg-hover); }
.opt .key {
  flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: var(--ink-soft); background: var(--opt-key-bg); border: 1px solid var(--border-strong);
}
.opt .lbl { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.opt .optnote { font-size: 13px; font-weight: 400; color: var(--ink-faint); }
.opt .pick { font-size: 12px; font-weight: 600; color: var(--ink-faint); opacity: 0; transition: opacity .12s; }
.opt:hover .pick { opacity: 1; }

/* selected states encode conviction strength */
.opt.lean { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.opt.lean .key { background: var(--opt-lean-key-bg); color: var(--accent-ink); border-color: var(--opt-lean-key-bd); }
.opt.firm { border-color: var(--accent); background: var(--opt-firm-bg); box-shadow: inset 0 0 0 2px var(--accent); }
.opt.firm .key { background: var(--accent); color: #fff; border-color: var(--accent); }
.opt.lean .pick, .opt.firm .pick { opacity: 1; color: var(--accent-ink); }

.qextra { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border-strong); }
.chip {
  font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  background: var(--chip-bg); border: 1px solid var(--border-strong); color: var(--ink-soft);
  border-radius: 999px; padding: 8px 15px; transition: background .12s, border-color .12s, color .12s;
}
.chip:hover { background: var(--chip-bg-hover); }
.chip.on { background: var(--chip-on-bg); border-color: var(--ink-faint); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink-faint); }
/* "…but" is a modifier, not a stance — set it apart with a dashed outline */
.chip.but { border-style: dashed; font-style: italic; }
.chip.but.on { border-style: solid; background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-border); box-shadow: inset 0 0 0 1.5px var(--accent-border); }
.spacer { flex: 1; }

.navrow { display: flex; gap: 12px; margin-top: 22px; }
.navrow .btn { flex: 1; }

/* ---- results ---- */
.result-head { text-align: center; margin-bottom: 8px; }
.archetype-card {
  background: linear-gradient(180deg, var(--arch-grad-a), var(--arch-grad-b));
  border: 1px solid var(--arch-border); border-radius: 18px; box-shadow: var(--shadow);
  padding: 30px 28px; text-align: center; margin: 6px 0 26px;
}
.archetype-card .kicker { font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.archetype-card h2 { font-size: clamp(26px, 5vw, 38px); margin: 8px 0 12px; letter-spacing: -.02em; }
.archetype-card p { font-size: 16px; color: var(--ink-soft); max-width: 620px; margin: 0 auto; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.tag { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); border: 1px solid var(--accent-border); }
.tag.muted { background: var(--muted-tag-bg); color: var(--ink-soft); border-color: var(--muted-tag-bd); }

/* badges: distinctive single positions that decorate the headline archetype.
 * Rendered as clickable chips that open a shared blurb popover below them. */
.badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-top: 14px; }
.badges-label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-faint); font-weight: 700; }
.badge {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 6px 12px; border-radius: 999px;
  background: var(--muted-tag-bg); color: var(--ink-soft); border: 1px solid var(--muted-tag-bd);
  transition: background .15s, color .15s, border-color .15s;
}
.badge:hover { color: var(--accent-ink); border-color: var(--accent-border); }
.badge[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-border); }
.badge-pop {
  max-width: 620px; margin: 12px auto 0; padding: 12px 16px;
  border-radius: 12px; background: var(--muted-tag-bg); border: 1px solid var(--muted-tag-bd);
  font-size: 14.5px; color: var(--ink-soft); text-align: left;
}
.badge-pop b { color: var(--ink); }

.section-title { font-size: 14px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); font-weight: 700; margin: 36px 0 14px; }

/* axis bars */
.axes { display: grid; gap: 16px; }
.axis { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.axis-ends { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-soft); margin-bottom: 9px; }
.axis-ends b { color: var(--ink); }
.axis-track { position: relative; height: 10px; background: var(--track-bg); border-radius: 999px; }
.axis-track .mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--border-strong); }
.axis-track .fillL, .axis-track .fillR { position: absolute; top: 0; bottom: 0; }
.axis-dot { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; transform: translate(-50%, -50%); border: 3px solid var(--panel); box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.axis-meta { font-size: 12px; color: var(--ink-faint); margin-top: 8px; }

/* svg result holder */
.svg-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 14px; overflow: auto; }
.svg-card svg { display: block; width: 100%; height: auto; }
.svg-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 4px; }

/* breakdown */
.cat-block { margin-bottom: 22px; }
.cat-bar { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; padding: 9px 14px; border-radius: 10px; }
.cat-bar i { width: 11px; height: 11px; border-radius: 3px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 10px; }
.cell { border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px; background: var(--panel); }
.cell .t { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); margin-bottom: 3px; }
.cell .v { font-size: 15px; font-weight: 600; }
.cell .s { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-top: 5px; display: inline-block; }
.cell.empty .v { color: var(--ink-faint); font-weight: 400; }

.s-firm { color: var(--good); }
.s-lean { color: var(--accent); }
.s-agno { color: var(--ink-faint); }
.s-nofact { color: var(--ink-faint); font-style: italic; }
.s-other { color: var(--ink-faint); }
.s-but { color: var(--ink-faint); font-weight: 600; font-style: italic; }

/* per-cell survey spread bar */
.spread { margin-top: 9px; }
.spread-bar {
  display: flex; height: 7px; border-radius: 999px; overflow: hidden;
  background: var(--track-bg); gap: 1px;
  width: 100%; padding: 0; border: 0; cursor: pointer; appearance: none;
}
.spread-bar:hover { box-shadow: 0 0 0 2px var(--track-bg), 0 0 0 3px var(--border-strong); }
.spread-bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.spread-bar .seg { display: block; height: 100%; opacity: .9; }
.spread-bar .seg.on { opacity: 1; }
.spread-bar .seg.other { background: var(--border-strong); opacity: .6; }
.spread-cap { font-size: 11px; color: var(--ink-faint); margin-top: 5px; line-height: 1.4; }
.spread-cap b { color: var(--ink-soft); }
.spread-more {
  background: none; border: 0; padding: 0; margin-left: 4px; cursor: pointer;
  font: inherit; font-size: 11px; color: var(--accent); white-space: nowrap;
}
.spread-more:hover { text-decoration: underline; }

/* full per-option breakdown, revealed on click */
.spread-detail {
  display: none; list-style: none; margin: 8px 0 2px; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--track-bg);
}
.spread.show-detail .spread-detail { display: block; }
.spread-detail li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  font-size: 12px; color: var(--ink-faint); padding: 2px 0; line-height: 1.35;
}
.spread-detail li.on { color: var(--ink-soft); font-weight: 600; }
.spread-detail li.other { font-style: italic; }
.spread-detail .sd-pct { font-variant-numeric: tabular-nums; flex: none; }
.spread-detail .sd-you {
  font-size: 10px; font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: .04em; margin-left: 6px;
}

/* "how you compare" summary card */
.compare-card {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.compare-lead { font-size: 16px; line-height: 1.6; margin: 0 0 4px; color: var(--ink-soft); }
.compare-lead b { color: var(--ink); }
.compare-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 16px; }
.compare-col h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint);
  font-weight: 700; margin: 0 0 8px;
}
.compare-col ul { list-style: none; margin: 0; padding: 0; }
.compare-col li {
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  padding: 6px 0; border-bottom: 1px dashed var(--border);
}
.compare-col li:last-child { border-bottom: 0; }
.compare-col .ct { font-weight: 600; font-size: 14px; }
.compare-col .cp { font-size: 12px; color: var(--ink-faint); white-space: nowrap; }
.compare-note { font-size: 12px; color: var(--ink-faint); line-height: 1.6; margin: 16px 0 0; }

/* links back to a question — used in the comparison card and breakdown cells */
.compare-col a.ct, .compare-full a.ct, .cell .t a {
  color: inherit; text-decoration: none;
  border-bottom: 1px dotted var(--border-strong); cursor: pointer;
  transition: color .12s, border-color .12s;
}
.compare-col a.ct:hover, .compare-full a.ct:hover, .cell .t a:hover {
  color: var(--accent); border-bottom-color: var(--accent);
}

/* the "show all positions" expander */
.compare-more { margin-top: 16px; }
.compare-toggle { padding-left: 0; }
.compare-full { display: none; margin-top: 10px; border-top: 1px solid var(--border); padding-top: 14px; }
.compare-card.show-all .compare-full { display: block; }
.compare-full h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint);
  font-weight: 700; margin: 0 0 8px;
}
.compare-full ul { list-style: none; margin: 0; padding: 0; }
.compare-full li {
  display: flex; justify-content: space-between; gap: 14px; align-items: baseline;
  padding: 7px 0; border-bottom: 1px dashed var(--border);
}
.compare-full li:last-child { border-bottom: 0; }
.compare-full .ct { font-weight: 600; font-size: 14px; flex: 0 1 auto; }
.compare-full .ca { font-size: 12.5px; color: var(--ink-soft); flex: 1 1 auto; text-align: right; }
.compare-full .cp { font-size: 12px; color: var(--ink-faint); white-space: nowrap; flex: none; min-width: 38px; text-align: right; }
.compare-full li.minority .cp { color: var(--accent); font-weight: 600; }
.compare-hint { font-size: 12px; color: var(--ink-faint); margin: 12px 0 0; }
@media (max-width: 560px) {
  .compare-full li { flex-wrap: wrap; gap: 2px 10px; }
  .compare-full .ca { text-align: left; flex-basis: 100%; }
}

/* ---- compare with a friend ---- */
.friend-card {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.friend-lead { font-size: 16px; line-height: 1.6; margin: 0 0 14px; color: var(--ink-soft); }
.friend-lead b { color: var(--ink); }
.friend-input-row { display: flex; gap: 10px; flex-wrap: wrap; }
.friend-input-row input {
  flex: 1; min-width: 200px; font-family: inherit; font-size: 15px; color: var(--ink);
  background: var(--opt-bg); border: 1.5px solid var(--border-strong); border-radius: 11px; padding: 12px 14px;
  transition: border-color .12s, box-shadow .12s;
}
.friend-input-row input:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.friend-input-row .btn { flex: none; }
.friend-err { color: #c0392b; font-size: 13px; margin-top: 8px; }
[data-theme="dark"] .friend-err { color: #ff8a7a; }

.friend-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 6px 0 16px; }
.friend-legend .link-btn { margin-left: auto; }
.friend-subtitle {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint);
  font-weight: 700; margin: 6px 0 12px;
}

/* the small colour-dot "You" / "Friend" labels reused on legend, axes and diff lines */
.who {
  position: relative; padding-left: 17px; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); white-space: nowrap;
}
.who::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 11px; height: 11px; border-radius: 50%;
}
.who.me::before { background: var(--accent); }
.who.friend::before { background: var(--friend); }
/* view-mode overlay: the viewed result ("Them") is the accent primary, your
 * own answers ("You") are the orange overlay — matches the read-only highlights */
.who.them::before { background: var(--accent); }
.who.you::before { background: var(--friend); }

/* both people's dots share one axis track */
.axis-dot.me { background: var(--accent); }
.axis-dot.friend { background: var(--friend); width: 16px; height: 16px; }
.axis-dot.them { background: var(--accent); }
.axis-dot.you { background: var(--friend); width: 16px; height: 16px; }

.friend-diff {
  display: flex; flex-direction: column; gap: 4px;
  padding: 9px 0; border-bottom: 1px dashed var(--border);
}
.friend-diff:last-child { border-bottom: 0; }
.friend-diff .ct { font-weight: 600; font-size: 14px; }
.friend-diff .fb { font-size: 13px; color: var(--ink-soft); display: flex; gap: 8px; align-items: baseline; }
.friend-diff .fb .who { font-size: 10px; padding-left: 15px; flex: none; }
.friend-diff .fb .who::before { width: 9px; height: 9px; }

@media (max-width: 560px) {
  .compare-cols { grid-template-columns: 1fr; }
}

/* ============================================================ *
 *  READ-ONLY "viewing a shared result" mode
 * ============================================================ */
/* the persistent banner: sticky strip above everything, below the fixed
 * theme toggle (z 20) but above the quiz topbar (z 5) */
.view-bar {
  position: sticky; top: 0; z-index: 15;
  background: var(--accent-soft); border-bottom: 1px solid var(--accent-border);
  backdrop-filter: blur(8px);
}
.view-bar[hidden] { display: none; }
.view-bar-inner {
  max-width: 880px; margin: 0 auto; padding: 9px 56px 9px 20px;
  display: flex; align-items: center; gap: 9px 16px; flex-wrap: wrap;
}
.vb-label { font-size: 13px; color: var(--accent-ink); font-weight: 600; }
.vb-label b { font-weight: 800; }
.vb-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.vb-primary {
  font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
  background: var(--accent-btn); color: #fff; border: 1px solid transparent;
  border-radius: 9px; padding: 7px 14px; box-shadow: 0 4px 12px rgba(83, 74, 183, .25);
  transition: background .15s ease, transform .08s ease;
}
.vb-primary:hover { background: var(--accent-btn-hover); }
.vb-primary:active { transform: translateY(1px); }
.vb-toggle {
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--panel); color: var(--ink-soft); border: 1px solid var(--border-strong);
  border-radius: 9px; padding: 6px 12px 6px 9px; display: inline-flex; align-items: center; gap: 7px;
}
.vb-toggle i {
  width: 26px; height: 15px; border-radius: 999px; background: var(--border-strong);
  position: relative; transition: background .15s ease; flex: none;
}
.vb-toggle i::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px;
  border-radius: 50%; background: #fff; transition: transform .15s ease;
}
.vb-toggle.on { color: var(--friend); border-color: var(--friend); }
.vb-toggle.on i { background: var(--friend); }
.vb-toggle.on i::after { transform: translateX(11px); }
.vb-adopt {
  font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  background: none; border: none; color: var(--accent-ink);
  text-decoration: underline; text-underline-offset: 2px; padding: 6px 4px;
}
.vb-adopt:hover { color: var(--accent); }
/* push the sticky quiz topbar below the (variable-height) banner */
body.is-viewing .topbar { top: var(--viewbar-h, 0); }
/* the keyboard-shortcut hint under the quiz is meaningless while read-only */
body.is-viewing #screen-quiz > .note { display: none; }

/* quiz: your own pick marked over their (accent) highlight */
.opt.opt-you { outline: 2px dashed var(--friend); outline-offset: -2px; }
.opt.opt-you .pick { opacity: 1; color: var(--friend); }
.qcompare {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 8px;
  font-size: 13.5px; color: var(--ink-soft); margin: 13px 2px 0;
  padding-top: 12px; border-top: 1px dashed var(--border);
}
.qcompare .who { flex: none; }
.qcompare .qcsep { color: var(--ink-faint); }
.qcompare i { color: var(--ink-faint); }

/* results: comparison summary + per-cell "You" line */
.compare-summary {
  font-size: 14px; color: var(--ink-soft); line-height: 1.6;
  background: var(--detail-bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; margin: 0 0 18px;
}
.compare-summary .who { display: inline-flex; vertical-align: baseline; }
.cell-you {
  font-size: 13px; color: var(--ink-soft); margin-top: 7px;
  padding-top: 7px; border-top: 1px dashed var(--border);
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
}
.cell-you .who { flex: none; }
.cell-you i { color: var(--ink-faint); }
.cell-you.agree { border-top-color: var(--good); }
.cell-you.disagree, .cell-you.partial { border-top-color: var(--friend); }

footer.foot { text-align: center; font-size: 12.5px; color: var(--ink-faint); margin-top: 40px; line-height: 1.7; }
footer.foot a { color: var(--ink-soft); }

@media (max-width: 560px) {
  .qtext { font-size: 19px; }
  .opt { font-size: 15px; }
  .navrow { flex-direction: column-reverse; }
}
