/* MemPABench site: shared styles. Academic project page, slightly retro: humanist type, sand-rose accent. */
:root {
  color-scheme: light;
  --bg: #f7f5f0;            /* N1: a less yellow off-white (10-23) */
  --bg-deep: #eeebe4;
  --paper: #fffefb;
  --ink: #22201c;
  --ink-soft: #46423b;
  --muted: #75706a;
  --line: color-mix(in srgb, var(--ink) 15%, var(--bg));
  --line-strong: color-mix(in srgb, var(--ink) 28%, var(--bg));
  /* main colour: a light fill, always drawn with a 1px edge one shade darker */
  --accent: #d2b7b2;        /* sand-rose */
  --accent-edge: #a8756b;
  --accent-soft: color-mix(in srgb, var(--accent) 30%, var(--paper));
  --chip-bg: color-mix(in srgb, var(--accent) 26%, var(--paper));
  --bar: color-mix(in srgb, var(--accent) 40%, var(--paper));
  --bar-edge: color-mix(in srgb, var(--accent-edge) 45%, var(--paper));
  --sage: #6f9f86;
  --butter: #f0c987;
  --butter-soft: #fbedd2;
  --sky: #8fa9d6;
  /* chat bubbles (provisional) */
  --user-bub: #d9e0ec;
  --user-edge: #9fadc6;
  --agent-bub: #e2eadf;
  /* wrong / right marks */
  --wrong: #b2564a;
  --wrong-ink: #9a463b;
  --wrong-soft: #f4e4de;
  --wrong-line: #e0bab2;
  --right: #6b8f78;
  --right-ink: #52735f;
  --right-soft: #e4e9e1;
  --right-line: #c4d1c5;
  --c-ref: #d6d1c8;
  --radius: 12px;           /* cards */
  --radius-sm: 10px;        /* boxes inside cards */
  --r-btn: 10px;
  --r-tag: 8px;
  --shadow: 0 8px 22px -16px rgba(30, 25, 15, .45);
  --shadow-press: inset 0 1px 3px rgba(30, 25, 15, .12);
  --bar-h: 56px;
  --font-display: "Cabin", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Inconsolata", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  padding-top: var(--bar-h);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-line: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent-edge); outline-offset: 2px; border-radius: 8px; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  background: rgba(247, 245, 240, .88);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; flex: none; }
.logo span { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -.01em; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  position: relative; text-decoration: none; font-weight: 500; font-size: 15px; color: var(--ink-soft);
  padding: 6px 13px; border-radius: var(--r-btn);
}
.nav a[aria-current="page"] { color: var(--ink); }
/* current item: a 2px edge-colour underline on the bar's bottom line */
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: calc((36px - var(--bar-h)) / 2 + 1px); height: 2px; background: var(--accent-edge); }

@media (max-width: 760px) {
  :root { --bar-h: 92px; }
  .topbar { flex-wrap: wrap; height: var(--bar-h); padding: 6px 12px 4px; gap: 0; align-content: space-between; }
  .logo span { font-size: 18px; }
  .nav { order: 3; width: 100%; margin: 0; justify-content: space-between; }
  .nav a { padding: 5px 10px; font-size: 14px; }
  .nav a[aria-current="page"]::after { left: 10px; right: 10px; bottom: -4px; }
}

/* ---------- layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 760px) { .wrap { padding: 0 16px; } }
.block { padding-top: 88px; padding-bottom: 24px; }
@media (max-width: 760px) { .block { padding-top: 60px; padding-bottom: 12px; } }
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-weight: 500; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink);
  margin-bottom: 10px;
}
.block h2 { font-size: clamp(28px, 4.2vw, 42px); max-width: 28ch; }
.lead { font-size: clamp(17px, 2vw, 19px); color: var(--ink-soft); margin-top: 14px; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: var(--r-tag); font-weight: 600; font-size: 14px;
  background: var(--bg-deep); color: var(--ink-soft); white-space: nowrap;
}
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* reveal on scroll (only when JS runs) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; }
}

/* ---------- on-page navigation (Overview, wide screens only) ---------- */
/* numbered sections with their parts underneath; a bar down the left fills to the part being read */
[data-toc] { scroll-margin-top: calc(var(--bar-h) + 20px); }
.toc { display: none; }
@media (min-width: 1420px) {
  .toc { display: flex; flex-direction: column; justify-content: space-between; gap: 4px; position: fixed; z-index: 5;
    left: max(16px, calc((100vw - 1120px) / 2 - 226px)); top: calc(var(--bar-h) + 48px); width: 150px; height: min(640px, calc(100vh - var(--bar-h) - 110px));
    padding-left: 14px; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
  .toc.show { opacity: 1; pointer-events: auto; }
  /* keep the text at least 100 px clear of the navigation: below the hero the sections move right when the margin is narrow */
  body[data-page="overview"] .block.wrap { margin-left: max(242px, calc((100vw - 1120px) / 2)); }
  .toc::before, .toc::after { content: ""; position: absolute; left: 0; top: 0; width: 3px; border-radius: 3px; }
  .toc::before { bottom: 0; background: var(--line); }
  .toc::after { top: var(--toc-top, 0); height: var(--toc-h, 0); background: var(--accent-edge); transition: top .3s ease, height .3s ease; }
  .toc a { display: block; padding: 8px 0 4px; font-family: var(--font-display); font-size: 15.5px; line-height: 1.3; color: var(--muted); text-decoration: none; }
  .toc a.sub { padding: 3px 0 3px 2px; font-family: var(--font-body); font-size: 14px; }
  .toc .n { display: block; font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .06em; color: var(--line-strong); }
  .toc a:hover { color: var(--ink); }
  .toc a.on, .toc a.on .n { color: var(--accent-edge); }
}
@media (prefers-reduced-motion: reduce) { .toc, .toc::after { transition: none; } }

/* ---------- hero ---------- */
.hero { padding-top: 40px; padding-bottom: 8px; }
.hero-head { text-align: center; max-width: 1080px; margin: 0 auto 10px; }
.hero h1 { font-size: clamp(32px, 4.6vw, 58px); }
.hero .sub { font-family: var(--font-display); font-weight: 400; font-size: clamp(18px, 2.4vw, 24px); color: var(--ink-soft); margin-top: 10px; }
.hero .sub b { font-weight: 700; color: var(--ink); }   /* the letters that make the name MemPA */
/* the globe with the four users' crystal balls (../globe-hero/globe.js draws into #globe-hero) */
.globe-hero { position: relative; width: 100%; height: min(72vh, 640px); overflow: hidden; touch-action: pan-y; -webkit-tap-highlight-color: transparent; user-select: none; }
.globe-hero canvas { display: block; width: 100%; height: 100%; }
.globe-label { position: absolute; left: 0; top: 0; pointer-events: none; padding: 3px 12px; border-radius: 999px; background: var(--paper);
  border: 1px solid var(--accent); font-size: 13px; letter-spacing: .02em; white-space: nowrap; opacity: 0; transition: opacity .35s ease; }
.globe-label.is-visible { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .globe-label { transition: none; } }
/* clicking a ball asks before leaving for that user's Demo */
.enter-world { width: min(360px, calc(100vw - 32px)); padding: 22px 20px; color: var(--ink); text-align: center; }
.enter-world[open] { animation: pop .35s ease; }
.enter-world::backdrop { background: rgba(35, 29, 24, .45); }
.enter-world p { font-family: var(--font-display); font-weight: 600; font-size: 21px; margin: 0 0 18px; }
.enter-world-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.enter-world .btn-link { font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; }
.enter-world .go { background: var(--accent); }
@media (max-width: 760px) { .hero { padding-top: 26px; } }

/* ---------- interaction ---------- */
.ix-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 34px; }
@media (max-width: 860px) { .ix-grid { grid-template-columns: 1fr; } }
.ix-panel { padding: 22px; }
.ix-panel h3 { font-size: 20px; margin-bottom: 4px; }
/* the picture carries the settings: notes sit on the scene they describe */
.ix-fig { position: relative; margin: 14px 0 0; border-radius: var(--radius-sm); overflow: hidden; background: #f4efe6; }
.ix-fig img { display: block; width: 100%; height: auto; }
.ix-note { position: absolute; min-width: 30%; max-width: 40%; padding: 6px 10px 8px; border-radius: 12px; background: rgba(255, 253, 248, .92); border: 1px solid var(--line); box-shadow: var(--shadow); }
.ix-note .k { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ix-note b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 17px; line-height: 1.2; }
.ix-note.work { left: 4%; top: 5%; }
.ix-note.home { right: 3%; top: 5%; }
.ix-note.was { left: 4%; top: 36%; min-width: 0; }
.ix-note.was b { text-decoration: line-through; text-decoration-color: #c4554a; text-decoration-thickness: 2px; color: var(--ink-soft); }
.ix-note.now { left: 4%; top: 58%; min-width: 0; }
@media (max-width: 760px) { .ix-note.was { top: 22%; left: 2%; } .ix-note.now { top: 60%; left: 2%; } .ix-note { min-width: 28%; padding: 5px 7px 6px; } .ix-note b { font-size: 15px; } .ix-note .k { font-size: 10.5px; } }
.lines { display: grid; gap: 6px; }
.lines i { display: block; height: 8px; border-radius: 6px; background: var(--line-strong); }
.ctx-cap { margin-top: 14px; font-size: 15px; color: var(--ink-soft); }

.tl-mark { cursor: pointer; }
.tl-mark:focus-visible { outline: none; }
.tl-mark.on rect:first-child { stroke: var(--ink); stroke-width: 2.5; }

/* ---------- same reply, two reactions ---------- */
.react { display: grid; grid-template-columns: 1fr minmax(300px, 380px) 1fr; gap: 26px; align-items: center; margin-top: 38px; }
.task-card { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.task-card svg { width: 18px; height: 18px; }
.phone { padding: 16px; border-radius: 34px; background: #3a332d; box-shadow: var(--shadow); }
.phone-screen { background: var(--paper); border-radius: 22px; padding: 18px 16px 16px; min-height: 250px; display: flex; flex-direction: column; }
.phone-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.phone-head .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--agent-bub); display: grid; place-items: center; }
.phone-head .dot svg { width: 14px; height: 14px; }
.bubble-agent { background: var(--agent-bub); border-radius: 18px 18px 18px 6px; padding: 12px 14px; font-size: 15px; line-height: 1.45; animation: pop .45s cubic-bezier(.2, .9, .3, 1.3); }
.bubble-agent ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.bubble-agent li { background: var(--paper); border-radius: 10px; padding: 6px 10px; }
.bubble-agent li b { font-weight: 700; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.switch { display: flex; margin: 14px auto 0; padding: 4px; border-radius: calc(var(--r-btn) + 4px); background: var(--bg-deep); width: max-content; gap: 4px; }
.switch button { border: 0; background: transparent; border-radius: var(--r-btn); padding: 6px 14px; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--muted); }
.switch button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.reactor { display: flex; flex-direction: column; align-items: center; text-align: center; }
.reactor .face-wrap { position: relative; }
.reactor .face { width: 112px; height: 112px; border-radius: 50%; overflow: hidden; border: 4px solid var(--paper); box-shadow: var(--shadow); background: var(--bg-deep); }
.reactor .face img { width: 100%; height: 100%; object-fit: cover; }
.reactor .who { font-family: var(--font-display); font-weight: 600; font-size: 20px; margin-top: 10px; }
.thought { position: relative; margin-bottom: 30px; padding: 12px 16px; border-radius: 22px; font-weight: 600; font-size: 16px; line-height: 1.35; max-width: 240px; background: var(--paper); border: 2px solid var(--line); animation: pop .45s cubic-bezier(.2, .9, .3, 1.3); }
.thought::after, .thought::before { content: ""; position: absolute; left: 50%; border-radius: 50%; background: inherit; border: inherit; }
.thought::before { width: 14px; height: 14px; bottom: -14px; margin-left: -10px; }
.thought::after { width: 8px; height: 8px; bottom: -24px; margin-left: -2px; }
.thought.good { background: var(--right-soft); border-color: var(--right-line); }
.thought.bad { background: var(--wrong-soft); border-color: var(--wrong-line); }
.mood { position: absolute; right: -2px; bottom: -2px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 3px solid var(--paper); }
.mood svg { width: 18px; height: 18px; }
.mood.good { background: var(--right); color: #fff; }
.mood.bad { background: var(--wrong); color: #fff; }
.reactor .tag { margin-top: 8px; }
@media (max-width: 860px) {
  .react { grid-template-columns: 1fr 1fr; gap: 18px 12px; }
  .react .center { grid-column: 1 / -1; order: -1; }
  .reactor .face { width: 84px; height: 84px; }
  .thought { font-size: 14.5px; padding: 10px 12px; }
}

/* ---------- what an interaction preference is: sub-blocks, closing line ---------- */
.sub-block { margin-top: 64px; }
.sub-block > h3 { font-size: clamp(22px, 2.8vw, 28px); }
.lead.closing { margin-top: 56px; font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--ink); }
@media (max-width: 760px) { .sub-block { margin-top: 44px; } .lead.closing { margin-top: 40px; } }

/* ---------- how we test it ---------- */
.tsteps { list-style: none; padding: 0; margin: 30px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; counter-reset: none; }
.tstep { position: relative; padding: 22px 22px 24px; text-align: left; }
.tstep-n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--butter-soft); border: 1px solid var(--line-strong); font-family: var(--font-display); font-weight: 700; }
.tstep h3 { font-size: 20px; margin-top: 12px; }
.tstep p { margin-top: 8px; color: var(--ink-soft); font-size: 15.5px; }
.tstep:not(:last-child)::after { content: "\2192"; position: absolute; right: -15px; top: 26px; color: var(--muted); font-size: 18px; }
.facts { margin-top: 22px; color: var(--ink-soft); font-size: 15.5px; }
.facts b { color: var(--ink); }
@media (max-width: 860px) { .tsteps { grid-template-columns: 1fr; } .tstep:not(:last-child)::after { content: none; } }

/* ---------- try it ---------- */
.start { margin-top: 24px; padding: 22px; }
.hero-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.start-cmd { margin: 16px 0 10px; padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 14px; overflow-x: auto; white-space: pre; }

/* ---------- findings ---------- */
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: 120px 1fr 54px; align-items: center; gap: 12px; }
.hbar .name { font-weight: 700; font-size: 15px; }
.hbar.ref .name { color: var(--muted); font-weight: 600; }
.track { position: relative; height: 22px; border-radius: 8px; background: var(--bg); }
.fill { position: absolute; inset: 0 auto 0 0; border-radius: 8px; width: 0; transition: width 1.1s cubic-bezier(.2, .8, .2, 1); }
/* bars: the leading row in the accent fill, the others lighter, the reference conditions neutral; each with a 1px edge */
.fill, .lb .swatch { background: var(--bar); box-shadow: inset 0 0 0 1px var(--bar-edge); }
.top .fill, .top .swatch { background: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-edge); }
.ref .fill, .ref .swatch { background: var(--c-ref); box-shadow: inset 0 0 0 1px var(--line-strong); }
.hbar .val { font-family: var(--font-mono); font-weight: 500; font-size: 18px; text-align: right; font-variant-numeric: tabular-nums lining-nums; }
.hbar.ref .val { color: var(--muted); }
.rand { position: absolute; top: -5px; bottom: -5px; width: 0; border-left: 2px dashed var(--ink-soft); opacity: .65; }
.hbars-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; font-size: 14px; color: var(--muted); }
.hbars-foot .rand-key { display: inline-flex; align-items: center; gap: 7px; }
.hbars-foot .rand-key i { width: 0; height: 16px; border-left: 2px dashed var(--ink-soft); }
.btn-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; padding: 7px 16px; border-radius: var(--r-btn); background: transparent; border: 1px solid var(--accent-edge); color: var(--ink); font-size: 15px; }
.metric-sel { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .hbar { grid-template-columns: 86px 1fr 44px; gap: 8px; }
  .hbar .name { font-size: 13px; }
  .hbar .val { font-size: 15px; }
}

.finding-main { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 22px; }
@media (max-width: 860px) { .finding-main { grid-template-columns: 1fr; } }
.finding { padding: 22px; margin-top: 20px; }
.finding h3 { display: flex; align-items: center; gap: 10px; }
.fn { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--butter-soft); border: 1px solid var(--line-strong); font-size: 15px; font-weight: 700; }
.finding .hbars { margin-top: 18px; }
.finding-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.finding-pair .finding { margin-top: 20px; }
.finding h3 { font-size: 22px; }
.finding p { margin-top: 8px; color: var(--ink-soft); }
@media (max-width: 860px) { .finding-pair { grid-template-columns: 1fr; } }
.pair-bars { display: grid; gap: 8px; margin-top: 12px; }
.pair-bars .hbar { grid-template-columns: 170px 1fr 50px; }
@media (max-width: 760px) { .pair-bars .hbar { grid-template-columns: 104px 1fr 44px; } }

/* ---------- dimensions ---------- */
/* the 14 attributes as one list: a card with two columns; Disclosure and Information Flow start on the same line */
.dims { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "d0 d2" "d1 d3"; gap: 6px 48px; align-items: start; margin-top: 30px; padding: 24px 30px 8px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.dgroup { min-width: 0; margin-bottom: 20px; }
.dgroup:nth-child(1) { grid-area: d0; } .dgroup:nth-child(2) { grid-area: d1; } .dgroup:nth-child(3) { grid-area: d2; } .dgroup:nth-child(4) { grid-area: d3; }
.dgroup h3 { display: flex; align-items: center; gap: 12px; margin: 0 0 4px; padding-bottom: 8px; border-bottom: 3px solid var(--dimc); font-size: 18px; }
.dgroup h3 img { width: 52px; height: 52px; flex: none; border-radius: 12px; mix-blend-mode: multiply; }
.dgroup h3 span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.dgroup h3 small { font-family: var(--font-body); font-weight: 400; font-size: 13px; color: var(--muted); }
.drow { display: flex; align-items: baseline; gap: 12px; width: 100%; padding: 10px 6px; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.dgroup .drow:last-child { border-bottom: 0; }
.drow b { font-family: var(--font-display); font-weight: 600; font-size: 16px; white-space: nowrap; }
.drow span { margin-left: auto; text-align: right; font-size: 13px; color: var(--ink-soft); }
.drow span i { font-style: normal; white-space: nowrap; }
.drow:hover b, .drow:focus-visible b { text-decoration: underline; text-decoration-color: var(--dimc); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.drow[aria-pressed="true"] { background: color-mix(in srgb, var(--dimc) 22%, var(--paper)); border-radius: var(--radius-sm); }
@media (max-width: 860px) {
  .dims { grid-template-columns: 1fr; grid-template-areas: "d0" "d1" "d2" "d3"; padding: 18px 16px 4px; }
  .drow { flex-wrap: wrap; gap: 2px 12px; }
  .drow span { margin-left: 0; text-align: left; }
}
.dim-detail { margin-top: 16px; padding: 22px; display: none; border-top: 6px solid var(--dimc); }
.dim-detail.open { display: block; animation: pop .4s ease; }
.dim-detail { position: relative; }
.dim-x { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); font-size: 22px; line-height: 1; color: var(--ink-soft); cursor: pointer; }
.dim-x:hover { border-color: var(--line-strong); color: var(--ink); }
.attr-kicker { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.attr-name { margin: 4px 0 0; font-family: var(--font-display); font-weight: 600; font-size: 24px; }
.attr-q { font-family: var(--font-display); font-weight: 500; font-size: 20px; margin: 18px 0 14px; max-width: 60ch; }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.setting-card { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line); }
.setting-card b { font-family: var(--font-display); font-weight: 600; font-size: 18px; display: block; margin-bottom: 4px; }
.setting-card p { font-size: 15px; color: var(--ink-soft); line-height: 1.45; }
/* the example: User A's request above the cards, the agent's reply under each setting */
.example { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line-strong); }
.ex-req { margin: 0 0 12px; font-size: 16px; }
.ex-tag { display: inline-block; margin-right: 8px; padding: 1px 9px; border-radius: 999px; background: var(--butter-soft); border: 1px solid var(--line-strong); font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px; }
.ex-rows { padding: 0 2px; }
.ex-row { display: grid; grid-template-columns: 170px 1fr; gap: 16px; padding: 12px 0; }
.ex-row + .ex-row { border-top: 1px solid var(--line); }
.ex-row b { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.ex-row p { margin: 0; font-size: 15.5px; line-height: 1.5; white-space: pre-line; }
@media (max-width: 640px) { .ex-row { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- citation ---------- */
.cite { margin-top: 24px; position: relative; }
.cite pre { margin: 0; padding: 22px; font-family: var(--font-mono); font-size: 14px; line-height: 1.6; overflow-x: auto; white-space: pre; }
.copy { position: absolute; top: 12px; right: 12px; }
.copy button { border: 1px solid var(--line); background: var(--bg); border-radius: var(--r-btn); padding: 5px 12px; font-weight: 700; font-size: 13px; cursor: pointer; }

.foot { margin-top: 90px; padding-top: 26px; padding-bottom: 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* ---------- leaderboard page ---------- */
.lb-head { padding-top: 44px; padding-bottom: 6px; }
.lb-head h1 { font-size: clamp(34px, 5vw, 52px); }
.lb-controls { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line); background: var(--bg); border-radius: var(--r-btn); padding: 7px 15px; font-weight: 700; font-size: 14.5px; cursor: pointer; color: var(--ink-soft); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--ink); border-color: var(--accent-edge); }
/* the five metric cards under the table */
.mcards { margin-top: 56px; }
.mcards h2 { font-size: clamp(24px, 3vw, 30px); margin-bottom: 16px; }
.mcards-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.mcard { display: flex; flex-direction: column; justify-content: flex-start; width: 100%; padding: 14px 14px 18px; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.mcard:hover, .mcard:focus-visible { border-color: var(--line-strong); }
.mcard[aria-expanded="true"] { border-color: var(--accent-edge); background: var(--accent-soft); }
.mcard-more { display: block; margin-top: auto; padding-top: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.mcard-more::after { content: " \25BE"; }
.mcard[aria-expanded="true"] .mcard-more::after { content: " \25B4"; }
.mex { margin-top: 14px; padding: 18px 22px; }
.mex h3 { font-size: 18px; }
.mex p { margin-top: 8px; font-size: 15.5px; color: var(--ink-soft); line-height: 1.5; max-width: 820px; }
.mex .mex-calc { font-family: var(--font-mono); font-size: 16px; color: var(--ink); }
.mcard img { display: block; width: 100%; aspect-ratio: 1; border-radius: 10px; mix-blend-mode: multiply; }
.mcard h3 { font-size: 18px; margin-top: 10px; }
.mcard p { font-size: 14.5px; color: var(--ink-soft); margin-top: 8px; line-height: 1.45; }
@media (max-width: 1100px) { .mcards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .mcards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.compare { margin-top: 18px; padding: 18px 20px; display: none; }
.compare.show { display: block; animation: pop .35s ease; }
.compare-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.compare-head h3 { font-size: 19px; }
.compare-head button { border: 1px solid var(--line); background: var(--bg); border-radius: var(--r-btn); padding: 4px 12px; font-weight: 700; font-size: 13px; cursor: pointer; }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px 22px; }
.compare-grid h4 { margin: 0 0 6px; font-size: 14px; font-weight: 700; }
.cbar { display: grid; grid-template-columns: 1fr 44px; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.cbar .lbl { grid-column: 1 / -1; font-weight: 600; color: var(--ink-soft); line-height: 1.2; margin-bottom: -3px; }
.cbar .track { height: 12px; border-radius: 5px; }
.cbar .fill { border-radius: 5px; }
.cbar .v { text-align: right; font-family: var(--font-mono); font-weight: 600; font-variant-numeric: tabular-nums lining-nums; }

.lb { margin-top: 18px; padding: 8px 0; overflow: hidden; }
.lb table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.lb th { font-family: var(--font-mono); font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: left; padding: 10px 10px 8px; }
.lb th.m { cursor: pointer; position: relative; text-decoration: underline dotted var(--line-strong); text-underline-offset: 4px; }
.lb th.m .tip { display: none; position: absolute; top: calc(100% - 2px); left: 4px; z-index: 5; width: min(300px, 70vw); padding: 10px 13px;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  font-family: var(--font-body); font-size: 14px; font-weight: 400; line-height: 1.45; letter-spacing: 0; text-transform: none; color: var(--ink-soft); white-space: normal; }
.lb th.m .tip b { display: block; margin-bottom: 6px; text-align: center; color: var(--ink); font-weight: 700; }
.lb th.m .tip > span { display: block; }
.lb th.m:nth-last-child(-n+2) .tip { left: auto; right: 4px; }
.lb th.m:hover .tip, .lb th.m:focus .tip { display: block; width: min(300px, 80vw); }
.lb th.m .tip img { display: block; width: 180px; height: 180px; margin: 0 auto 10px; border-radius: 8px; mix-blend-mode: multiply; }
.lb th.m.sel { color: var(--ink); }
.lb th.m.sel::after { content: " \2193"; }
.lb th.pin-col, .lb td.pin-col { width: 46px; padding-left: 12px; }
.lb th.name-col { width: 30%; }
.lb td { padding: 9px 10px; vertical-align: middle; border-top: 1px solid var(--line); }
.lb tr.sys { cursor: pointer; }
.lb tr.sys td.name { font-weight: 700; font-size: 16.5px; }
.lb tr.sys td.name .chev { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 4px; vertical-align: -3px; transition: transform .25s; color: var(--muted); }
.lb tr.sys td.name .chev svg { width: 12px; height: 12px; }
.lb tr.sys[aria-expanded="true"] td.name .chev { transform: rotate(180deg); }
.lb tr.sys.top td { background: color-mix(in srgb, var(--accent) 20%, var(--paper)); }
.lb tr.sys .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 8px; vertical-align: 0; }
.lb tr.model td { border-top: 1px dashed var(--line); background: rgba(241, 234, 220, .35); font-size: 15px; }
.lb tr.model td.name { padding-left: 32px; color: var(--ink-soft); font-weight: 600; }
.lb tr.ref td { color: var(--muted); }
.lb tr.ref td.name { font-weight: 600; }
.lb tr.ref-sep td { padding: 16px 10px 4px; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-top: 2px solid var(--line); }
.lb .cell { display: grid; gap: 3px; }
.lb .cell .num { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums lining-nums; font-size: 17px; line-height: 1.1; }
.lb tr.model .cell .num { font-size: 15px; }
.lb .cell .track { height: 7px; border-radius: 4px; }
.lb .cell .fill { border-radius: 4px; }
.lb td.sel .num { color: var(--ink); }
.lb td.dimmed { opacity: .55; }
.pin { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.pin svg { width: 15px; height: 15px; }
.pin[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.lb-notes { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--muted); }
.lb-notes .rand-key { display: inline-flex; align-items: center; gap: 7px; }
.lb-notes .rand-key i { width: 0; height: 14px; border-left: 2px dashed var(--ink-soft); }
@media (max-width: 760px) {
  .lb th { font-size: 11px; padding: 8px 4px 6px; letter-spacing: .02em; }
  .lb td { padding: 8px 4px; }
  .lb th.pin-col, .lb td.pin-col { width: 34px; padding-left: 6px; }
  .lb th.name-col { width: 31%; }
  .lb tr.sys td.name { font-size: 13.5px; }
  .lb tr.sys .swatch { display: none; }
  .lb tr.model td.name { padding-left: 8px; font-size: 12.5px; }
  .lb .cell .num { font-size: 14px; }
  .lb tr.model .cell .num { font-size: 13px; }
  .pin { width: 26px; height: 26px; }
  .pin svg { width: 13px; height: 13px; }
}
/* "By user" view: one column per user and the four-user average; each column's best memory system is highlighted */
.seg[hidden] { display: none; }
.bu-name { align-self: center; margin-left: 6px; font-size: 14px; color: var(--muted); }
.lb th.u a { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.lb th.u a:hover span { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.lb th.u img { flex: none; width: 28px; height: 28px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line-strong); }
.lb th.avg, .lb td.avg { border-left: 1px solid var(--line); }
.lb tr.bu td.name { font-size: 16.5px; }
.lb tr.bu:not(.ref) td.name { font-weight: 700; }
.lb td.best { background: color-mix(in srgb, var(--accent) 22%, var(--paper)); }
.lb td.best .num { font-weight: 700; }
.lb td.best .fill { background: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-edge); }
@media (max-width: 760px) {
  .lb th.u a { flex-direction: column; gap: 3px; }
  .lb th.u img { width: 24px; height: 24px; }
  .lb tr.bu td.name { font-size: 13.5px; }
  .bu-name { flex-basis: 100%; margin: 2px 0 0; font-size: 13px; }
}

/* ---------- demo ---------- */
/* demo.js sets --accent / --accent-edge to the user's pair on these; the shades made from them are re-derived here,
   since :root's were computed from the site's own accent */
.demo, .demo-tl, .modal { --accent-soft: color-mix(in srgb, var(--accent) 30%, var(--paper));
  --chip-bg: color-mix(in srgb, var(--accent) 26%, var(--paper)); --bar: color-mix(in srgb, var(--accent) 40%, var(--paper));
  --bar-edge: color-mix(in srgb, var(--accent-edge) 45%, var(--paper)); }
.demo { max-width: 1600px; padding-left: 120px; padding-right: 40px;
  /* a landscape stage: about 1.45 wide to 1 tall, never taller than the window allows (352px = left column + gap) */
  --stage-w: calc(min(100vw, 1600px) - 160px - 352px);
  --stage-h: clamp(520px, min(calc(100vh - var(--bar-h) - 60px), calc(var(--stage-w) / 1.45)), 760px);
  display: grid; grid-template-columns: 330px 1fr; gap: 22px; padding-top: 26px; padding-bottom: 20px; }
@media (max-width: 1300px) { .demo { padding-left: 24px; padding-right: 24px; --stage-w: calc(100vw - 48px - 352px); } }
/* the left column is as tall as the stage: who he is scrolls, his interaction preferences stay pinned below */
.demo-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; height: var(--stage-h); }
.side-scroll { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding: 0 4px 4px 0; scrollbar-width: thin; }
.demo-side { position: relative; }
/* the user switcher: a pill hanging in the left gutter; avatars only, the name shows beside the one under the pointer */
.ulist { position: absolute; z-index: 6; right: calc(100% + 26px); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 9px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); }
.ulist .u { position: relative; display: block; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; }
.ulist .avatar { display: block; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; background: var(--bg-deep); opacity: .55; filter: grayscale(.4); transition: opacity .2s, filter .2s; }
.ulist .u[aria-current] .avatar { width: 46px; height: 46px; opacity: 1; filter: none; box-shadow: 0 0 0 2.5px var(--accent-edge); }
.ulist .avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.ulist .tip { position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); white-space: nowrap; padding: 4px 9px; border-radius: var(--r-tag); background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .15s; }
.ulist .u:hover .tip, .ulist .u:focus-visible .tip { opacity: 1; }
.ulist .u:hover .avatar { opacity: .85; }
.ulist .label { font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); writing-mode: vertical-rl; transform: rotate(180deg); margin-top: 2px; }
@media (max-width: 1300px) {
  .ulist { position: static; transform: none; flex-direction: row; align-self: flex-start; padding: 6px 12px 6px 8px; gap: 8px; }
  .ulist .avatar { width: 30px; height: 30px; }
  .ulist .u[aria-current] .avatar { width: 34px; height: 34px; }
  .ulist .label { writing-mode: horizontal-tb; transform: none; margin: 0 0 0 4px; order: -1; margin-right: 4px; }
  .ulist .tip { left: 50%; top: auto; bottom: calc(100% + 10px); transform: translateX(-50%); }
}
.profile { display: flex; flex-direction: column; gap: 10px; }
.grp { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); padding: 10px 12px 8px; }
.grp h4 { margin: 0 0 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.grp ul { margin: 0; padding: 0; list-style: none; font-size: 13.5px; line-height: 1.4; }
.grp li { display: flex; gap: 8px; align-items: baseline; }
.grp li + li { margin-top: 5px; }
.grp li b { font-weight: 600; }
.grp li .rest, .grp li.extra { display: none; }
.grp.open li.extra { display: flex; }
.grp.open li .rest { display: inline; color: var(--muted); }
.grp.open { border-color: var(--line-strong); background: #fff; }
.grp .emo { flex: none; width: 20px; text-align: center; font-size: 15px; }
.grp .more { display: flex; align-items: center; gap: 3px; margin: 4px 0 0 auto; border: 0; background: none; font: inherit; font-size: 12px; font-weight: 700; color: var(--ink); cursor: pointer; padding: 0; }
.grp .more svg { width: 13px; height: 13px; transition: transform .2s; }
.grp.open .more svg { transform: rotate(180deg); }
.grp .sub.first { margin-top: 0; }
.grp .sub { margin: 10px 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.circ { display: block; width: 100%; height: auto; }
.circ-wrap { position: relative; }
.circ .who-n { cursor: pointer; outline: none; }
.circ .who-n.on .nd { stroke: var(--accent-edge); stroke-width: 2; }
.circ-tip { position: absolute; left: 6px; right: 6px; z-index: 3; padding: 9px 11px; border-radius: var(--radius-sm); background: var(--ink); color: var(--paper); font-size: 13px; line-height: 1.35; box-shadow: var(--shadow); pointer-events: none; }
.circ-tip span { color: color-mix(in srgb, var(--paper) 65%, var(--ink)); }
.circ-tip p { margin: 4px 0 0; }
.circ-tip i { display: block; font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.circ-tip[hidden] { display: none; }
/* the landscape ID card at the top of the left column */
.idcard { flex: none; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); overflow: hidden; }
.id-band { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 14px; background: var(--accent); }
.id-band b { font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; }
.id-band span { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.id-main { display: flex; align-items: center; gap: 12px; padding: 12px 14px 4px; }
.id-photo { flex: none; width: 62px; height: 74px; border-radius: 10px; overflow: hidden; background: var(--bg-deep); border: 1px solid var(--line); }
.id-photo img, .id-photo svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.id-role { display: block; font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 1.15; }
.id-work { display: block; margin-top: 3px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.3; }
.id-f { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 0; padding: 8px 14px 13px; font-size: 13.5px; line-height: 1.3; }
.id-f dt { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.id-f dd { margin: 0; }
.circ .ring { fill: var(--accent-soft); fill-opacity: .55; stroke: var(--accent-edge); stroke-width: 1.2; stroke-dasharray: 4 4; }
.circ .ln line { stroke: var(--line-strong); stroke-width: 1; }
.circ .nd { fill: #fff; stroke: var(--line-strong); }
.circ .me { fill: none; stroke: var(--accent-edge); stroke-width: 2; }
.circ text { text-anchor: middle; paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.circ .em { font-size: 17px; }
.circ .nm { font-size: 11.5px; font-weight: 700; fill: var(--ink); font-family: var(--font-body); }
.circ .rl { font-size: 10.5px; fill: var(--muted); font-family: var(--font-body); }
.places { display: flex; flex-wrap: wrap; gap: 5px; }
.place { font-size: 12.5px; font-weight: 600; padding: 2px 8px; border: 1px solid var(--line); border-radius: var(--r-tag); background: #fff; }
/* interaction preferences: pinned, in the accent so it reads as the part the scene turns on */
.grp.ipg { flex: none; background: var(--accent-soft); border: 1.5px solid var(--accent-edge); box-shadow: var(--shadow); padding: 10px 12px; }
.grp.ipg:empty { display: none; }
.grp.ipg h4 { color: var(--ink); font-size: 12px; }
.ip-car { position: relative; }
.ip-track { display: flex; align-items: flex-start; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; transition: height .3s ease; }
.ip-track::-webkit-scrollbar { display: none; }
.ip-page { flex: 0 0 100%; scroll-snap-align: start; padding: 0 5px 3px 7px; }
.ip-dim { text-align: center; margin: 0 0 4px; line-height: 26px; font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.ip-arr { position: absolute; top: 0; z-index: 2; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; color: var(--ink); }
.ip-arr svg { width: 14px; height: 14px; }
.ip-arr.l { left: 0; } .ip-arr.r { right: 0; }
.ip.tested { border: 1.5px solid var(--accent-edge); box-shadow: 0 0 0 3px var(--accent-soft); }
.ip.tested::after { content: "Tested here"; position: absolute; right: 8px; top: -8px; padding: 0 6px; border-radius: 6px; background: var(--accent-edge); color: var(--paper); font-size: 10px; font-weight: 700; letter-spacing: .04em; line-height: 15px; }
.ip { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); margin-top: 5px; }
.ip .attr { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.ip .pill { font-size: 12.5px; padding: 1px 9px; flex: none; }
.ip.inscene::before { content: ""; position: absolute; left: -5px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--accent-edge); }
.ip .hitmark { display: none; }
.ip.hit { padding-right: 34px; animation: pop .45s ease; }
.ip.hit .hitmark { display: grid; place-items: center; position: absolute; right: 7px; width: 20px; height: 20px; border-radius: 50%; color: #fff; }
.ip.hit .hitmark svg { width: 11px; height: 11px; }
.ip.hit.bad { background: var(--wrong-soft); border-color: var(--wrong); box-shadow: 0 0 0 3px rgba(178, 86, 74, .16); }
.ip.hit.bad .attr { color: var(--wrong-ink); }
.ip.hit.bad .hitmark { background: var(--wrong); }
.ip.hit.good { background: var(--right-soft); border-color: var(--right); box-shadow: 0 0 0 3px rgba(107, 143, 120, .2); }
.ip.hit.good .attr { color: var(--right-ink); }
.ip.hit.good .hitmark { background: var(--right); }
.ip-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.ip-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: var(--accent-edge); opacity: .4; cursor: pointer; transition: width .2s; }
.ip-dots button.on { width: 18px; border-radius: 4px; background: var(--ink); opacity: 1; }

.stage { position: relative; overflow: hidden; isolation: isolate; border-radius: var(--radius); background: var(--bg-deep); border: 1px solid var(--line); box-shadow: inset 0 2px 10px rgba(30, 25, 15, .08);
  height: var(--stage-h); }
.room { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border: 0; display: block; pointer-events: none; transition: height .9s cubic-bezier(.2, .8, .2, 1); }
/* the three interactions: tabs over the top of the stage, Next at the bottom right once one has played */
.segs { position: absolute; top: 14px; left: 14px; right: 70px; z-index: 9; display: flex; flex-wrap: wrap; gap: 6px; }
.segs button { display: flex; align-items: center; gap: 7px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 253, 248, .92); color: var(--ink-soft); font: 600 13.5px var(--font-body); cursor: pointer; box-shadow: var(--shadow); }
.segs button i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-deep); font-style: normal; font-size: 12px; }
.segs button.seen i { background: var(--accent-soft); }
.segs button:hover { color: var(--ink); }
.segs button[aria-current] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.segs button[aria-current] i { background: var(--accent); color: var(--ink); }
.next-btn { position: absolute; right: 14px; bottom: 14px; z-index: 9; display: flex; align-items: center; gap: 8px; padding: 10px 16px 10px 18px; border-radius: var(--r-btn); border: 1px solid var(--accent-edge); background: var(--accent); color: var(--ink); font: 600 15px var(--font-body); cursor: pointer; box-shadow: var(--shadow); }
.next-btn svg { width: 16px; height: 16px; }
.next-btn[hidden] { display: none; }
.cover { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; background: rgba(247, 245, 240, .38);
  backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1); transition: opacity .7s ease, backdrop-filter .7s ease; }
.cover.gone { opacity: 0; pointer-events: none; }
.enter { border: 1px solid var(--accent-edge); cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: clamp(19px, 2.4vw, 24px); color: var(--ink); background: var(--accent);
  padding: 14px 30px 15px; border-radius: var(--r-btn); box-shadow: var(--shadow); transition: transform .2s; }
.enter:hover:not(:disabled) { transform: translateY(-2px); }
.enter:disabled { opacity: .55; cursor: progress; }
.title-card { position: absolute; left: 6%; bottom: 12%; z-index: 4; margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(34px, 5.4vw, 68px); line-height: 1.05; color: var(--paper);
  text-shadow: 0 4px 30px rgba(40, 25, 15, .55); letter-spacing: .02em; opacity: 0; transform: translateY(14px); transition: opacity 1s ease, transform 1.4s cubic-bezier(.2, .8, .2, 1), letter-spacing 2.4s ease; pointer-events: none; }
.title-card.show { opacity: 1; transform: none; letter-spacing: .05em; }
.title-card small { display: block; margin-bottom: 8px; font-family: var(--font-body); font-size: clamp(12px, 1.3vw, 16px); font-weight: 600; letter-spacing: .24em; text-transform: uppercase; }
.dimmer { position: absolute; inset: 0; z-index: 5; background: #231d18; opacity: 0; pointer-events: none; transition: opacity .9s ease; }
.dimmer.dim { opacity: .62; }
.dimmer.black { opacity: 1; transition-duration: .6s; }
.recap { position: absolute; left: 50%; bottom: 14%; z-index: 6; width: min(640px, calc(100% - 48px)); margin: 0; transform: translate(-50%, 12px); text-align: center;
  font-family: var(--font-display); font-weight: 500; font-size: clamp(19px, 2.3vw, 25px); line-height: 1.4; color: var(--paper); text-shadow: 0 2px 18px rgba(20, 12, 8, .6); opacity: 0; transition: opacity 1s ease, transform 1s ease; pointer-events: none; }
.recap.show { opacity: 1; transform: translate(-50%, 0); }

.bubble { position: absolute; z-index: 3; display: flex; gap: 10px; padding: 14px 18px; border-radius: 30px; background: var(--paper); border: 2px solid var(--line);
  box-shadow: var(--shadow); transform: translate(-50%, calc(-100% - 46px)) scale(.6); opacity: 0; transition: opacity .4s ease, transform .5s cubic-bezier(.2, .9, .3, 1.3); pointer-events: none; }
.bubble.show { opacity: 1; transform: translate(-50%, calc(-100% - 46px)) scale(1); }
.bubble svg { width: 58px; height: 58px; }
.bubble::before, .bubble::after { content: ""; position: absolute; left: 50%; border-radius: 50%; background: var(--paper); border: 2px solid var(--line); }
.bubble::before { width: 18px; height: 18px; bottom: -24px; margin-left: -14px; }
.bubble::after { width: 10px; height: 10px; bottom: -40px; margin-left: -4px; }

.phone-wrap { position: absolute; right: 22px; bottom: 18px; z-index: 4; width: min(360px, 44%); height: calc(100% - 78px); transform: translateY(115%); transition: transform .9s cubic-bezier(.2, .9, .25, 1.05); }
.phone-up .phone-wrap { transform: none; }
.phone-wrap .phone { height: 100%; padding: 12px; border-radius: 38px; }
.phone-wrap .phone-screen { height: 100%; min-height: 0; padding: 14px 0 0; border-radius: 28px; overflow: hidden; }
.phone-wrap .phone-head { padding: 0 16px; margin-bottom: 8px; }
.chat { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 12px 16px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; }
.msg { display: flex; flex-direction: column; gap: 6px; max-width: 88%; animation: pop .4s cubic-bezier(.2, .9, .3, 1.2); }
.msg.agent { align-self: flex-start; align-items: flex-start; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.bub { padding: 10px 13px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.msg.agent .bub { background: var(--agent-bub); border-radius: 18px 18px 18px 6px; }
.msg.user .bub { background: var(--user-bub); color: var(--ink); border-radius: 18px 18px 6px 18px; }
.bub p + p, .bub p + ul, .bub p + ol, .bub ul + p, .bub ol + p, .bub blockquote, .bub .tbl, .bub pre, .bub hr { margin-top: 7px; }
.bub ul, .bub ol { margin: 4px 0 0; padding-left: 18px; }
.bub li + li { margin-top: 3px; }
.bub .h { font-weight: 700; }
.bub blockquote { margin: 7px 0 0; padding: 4px 0 4px 10px; border-left: 3px solid rgba(34, 32, 28, .2); }
.bub code { font-family: var(--font-mono); font-size: 12px; background: rgba(255, 255, 255, .55); padding: 0 4px; border-radius: 4px; }
.bub pre { white-space: pre-wrap; font-size: 12px; margin: 0; }
.bub hr { border: 0; border-top: 1px solid rgba(34, 32, 28, .18); margin: 8px 0; }
.bub .tbl { overflow-x: auto; }
.bub table { border-collapse: collapse; font-size: 12.5px; }
.bub th, .bub td { border: 1px solid rgba(34, 32, 28, .15); padding: 3px 6px; text-align: left; vertical-align: top; }
.calls { display: flex; flex-wrap: wrap; gap: 4px; }
.calls:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: var(--r-tag); font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--ink);
  background: var(--chip-bg); border: 1px solid color-mix(in srgb, var(--accent-edge) 35%, var(--paper)); animation: pop .3s ease; line-height: 1.5; }
.chip small { font-size: 11px; color: var(--ink); font-weight: 600; }
.chip svg { width: 11px; height: 11px; flex: none; }
.chip.err { color: var(--muted); border-style: dashed; background: var(--paper); }
.chip.stuck { color: #fff; background: var(--wrong); border-color: var(--wrong); padding: 3px 11px; font-size: 12px; box-shadow: 0 0 0 3px rgba(178, 86, 74, .2); }
.chip.stuck svg { width: 13px; height: 13px; }
.typing { display: inline-flex; gap: 4px; padding: 11px 13px; border-radius: 18px 18px 18px 6px; background: var(--agent-bub); }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
.paused *, .paused *::before, .paused *::after { animation-play-state: paused !important; }

/* story beats (demo_story.json): his ask, a line he said before, the agent's answer with its fault marked, the outcome */
.full-conv { margin-left: auto; border: 0; background: none; padding: 2px 0; font-weight: 600; font-size: 12px; color: var(--muted); cursor: pointer;
  color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.full-conv:hover { color: var(--ink-soft); }
.msg.beat .bub { font-size: 14.5px; }
/* a story row carries who is speaking: his face on the right, the agent's icon on the left */
.msg.beat { flex-direction: row; align-items: flex-end; gap: 7px; max-width: 94%; }
.msg.beat.user { flex-direction: row-reverse; }
.msg.beat .col { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.chat .who { width: 30px; height: 30px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center; box-shadow: 0 0 0 1px var(--line); }
.chat .who img { width: 100%; height: 100%; object-fit: cover; }
.chat .who.agent { background: var(--agent-bub); color: var(--ink); }
.chat .who.agent svg { width: 19px; height: 19px; }
.ln { display: flex; align-items: flex-start; gap: 7px; }
.ln + .ln { margin-top: 5px; }
.ln .pic { width: 26px; height: 26px; flex: none; display: inline-grid; padding: 2px; border-radius: 8px; background: var(--paper); margin-top: -1px; }
.ln .pic svg { width: 100%; height: 100%; }
.ln .tx { flex: 1; min-width: 0; }
.ln .t { border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; text-decoration: underline wavy transparent; text-underline-offset: 4px;
  transition: background-color .4s ease, text-decoration-color .4s ease; }
.ln .tag { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; vertical-align: 1px; white-space: nowrap; font-style: normal; font-size: 11px; font-weight: 700; line-height: 1.5;
  padding: 0 8px; border-radius: var(--r-tag); color: #fff; opacity: 0; transform: scale(.6); transition: opacity .35s ease, transform .4s cubic-bezier(.2, .9, .3, 1.4); }
.ln .tag svg { width: 11px; height: 11px; }
.ln.wrong .tag { background: var(--wrong); }
.ln.right .tag { background: var(--right); }
.marked .ln.wrong .t { text-decoration-color: var(--wrong); background: rgba(178, 86, 74, .16); }
.marked .ln.right .t { background: rgba(107, 143, 120, .24); }
.marked .ln .tag { opacity: 1; transform: none; }
/* the earlier session: a small phone of its own over the room, outside today's phone */
.past { position: absolute; z-index: 4; top: 62px; left: 22px; width: min(250px, 28%); opacity: 0; transform: translateX(-10px); pointer-events: none; transition: opacity .5s ease, transform .5s ease; }
.past.show { opacity: 1; transform: none; }
.past-cap { display: inline-block; margin: 0 0 6px; padding: 3px 9px; border-radius: var(--r-tag); background: var(--ink); color: var(--paper); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.past-phone { display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 12px; border: 6px solid #3a332e; border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); }
.past-date { display: flex; align-items: center; justify-content: center; gap: 5px; margin: 0 0 2px; font-size: 11px; font-weight: 700; color: var(--muted); }
.past-date svg { width: 12px; height: 12px; }
.pm { max-width: 88%; padding: 6px 9px; font-size: 12.5px; line-height: 1.35; }
.pm .ln { margin: 0; }
.pm.user { align-self: flex-end; background: var(--user-bub); border-radius: 13px 13px 4px 13px; }
.pm.agent { align-self: flex-start; background: var(--agent-bub); border-radius: 13px 13px 13px 4px; }
.pm.said { font-style: italic; box-shadow: 0 0 0 2px var(--accent-edge); }
/* today's date on the main phone, against the earlier one */
.phone-now { display: flex; align-items: center; justify-content: center; gap: 5px; margin: -8px 0 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.phone-now svg { width: 12px; height: 12px; }
.phone-now:empty { display: none; }
.past-link { position: absolute; left: 100%; top: 50%; width: var(--reach, 40px); border-top: 2px dashed var(--accent-edge); }
.past-link::after { content: ""; position: absolute; right: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-edge); }
.vs { align-self: stretch; display: grid; gap: 8px; padding: 10px 12px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  animation: pop .45s cubic-bezier(.2, .9, .3, 1.2); }
.vs-row { position: relative; display: grid; gap: 5px; }
.vs-k { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); line-height: 1.3; padding-right: 30px; }
.vs-k b { margin-left: 3px; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink); }
.vs-steps { display: flex; align-items: flex-start; gap: 4px; }
.step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; text-align: center; }
.step .pic { width: 34px; height: 34px; display: block; }
.step .pic svg { width: 100%; height: 100%; display: block; }
.step small { font-size: 10.5px; font-weight: 700; line-height: 1.15; color: var(--ink-soft); max-width: 82px; }
.arr { width: 16px; height: 16px; flex: none; margin-top: 9px; color: var(--muted); }
.arr svg { width: 100%; height: 100%; display: block; }
.bundle { display: flex; gap: 2px; padding: 3px 7px; border-radius: var(--r-tag); border: 2px solid var(--wrong); background: var(--wrong-soft); }
.bundle .step .pic { width: 28px; height: 28px; }
.step.struck .pic { opacity: .4; }
.step.struck::after { content: ""; position: absolute; left: 50%; top: 15px; width: 40px; height: 3px; margin-left: -20px; border-radius: 2px; background: var(--wrong); transform: rotate(-20deg); }
.step.struck small { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--wrong); text-decoration-thickness: 2px; }
.vs-row.got { padding-top: 8px; border-top: 1px dashed var(--line); opacity: 0; transform: translateY(6px); transition: opacity .4s ease, transform .45s cubic-bezier(.2, .9, .3, 1.3); }
.vs.show-got .vs-row.got { opacity: 1; transform: none; }
.vs-mark { position: absolute; right: 0; top: 8px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.vs-mark svg { width: 15px; height: 15px; }
.vs.bad .vs-mark { background: var(--wrong); }
.vs.good .vs-mark { background: var(--right); }
.vs.bad .got .vs-k b { color: var(--wrong-ink); }
.vs.good .got .vs-k b { color: var(--right-ink); }
.verdict { align-self: center; display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 7px 14px; border-radius: var(--r-btn); font-weight: 700; font-size: 13.5px; line-height: 1.3; color: #fff;
  animation: pop .45s cubic-bezier(.2, .9, .3, 1.3); }
.verdict svg { width: 15px; height: 15px; flex: none; }
.verdict.bad { background: var(--wrong); }
.verdict.good { background: var(--right); }

.stage-btn { position: absolute; z-index: 7; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 253, 248, .9); color: var(--ink); cursor: pointer;
  display: grid; place-items: center; box-shadow: var(--shadow); }
.stage-btn svg { width: 18px; height: 18px; }
.stage-btn[hidden] { display: none; }
.stage-btn.play { top: 14px; right: 14px; }
.stage-btn.replay { left: 14px; bottom: 14px; }
.stage-btn.replay.lit { background: var(--accent); color: var(--ink); border-color: var(--accent-edge); }
.stage-error { position: absolute; left: 16px; right: 16px; top: 16px; z-index: 10; margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--wrong-soft); border: 1px solid var(--wrong-line); color: #8d3524; font-weight: 600; font-size: 15px; }
.modal-chat .stage-error { position: static; }
.stage-error[hidden] { display: none; }

/* full timeline: two lanes (work, personal) on a date axis; final probes gather at the right end */
.demo-tl { position: relative; max-width: 1600px; padding-left: 120px; padding-right: 40px; padding-top: 34px; padding-bottom: 60px; }
@media (max-width: 1300px) { .demo-tl { padding-left: 24px; padding-right: 24px; } }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.demo-tl h2 { margin: 0; font-size: clamp(24px, 3.2vw, 32px); }
.demo-tl .tl-legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 0 auto; font-size: 13px; color: var(--muted); }
.demo-tl .tl-legend span { display: flex; align-items: center; gap: 6px; }
.k-s, .k-c, .k-p, .k-f { display: inline-block; }
.k-s { width: 3px; height: 12px; border-radius: 2px; background: #c9c2b6; }
.k-c { width: 9px; height: 9px; transform: rotate(45deg); background: var(--accent-edge); border-radius: 1.5px; }
.k-p { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.k-f { width: 6px; height: 6px; border-radius: 50%; border: 1.8px solid var(--wrong); }
.tl-scroll { overflow-x: auto; margin-top: 18px; scrollbar-width: thin; }
/* --l / --r: room for the lane names and the final-probe cluster; a mark sits at fraction --f of the date axis */
.tl-chart { --l: 70px; --r: 140px; position: relative; height: 128px; min-width: 760px; }
.tl-lane { position: absolute; left: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.tl-base { position: absolute; left: var(--l); right: var(--r); border-top: 1px solid var(--line); }
.tl-month, .tl-m, .tl-num { position: absolute; left: calc(var(--l) + 8px + (100% - var(--l) - var(--r) - 16px) * var(--f) + var(--dx, 0px)); }
.tl-month { bottom: 0; font-size: 12px; color: var(--muted); }
.tl-month::before { content: ""; position: absolute; left: 0; top: -8px; height: 5px; border-left: 1px solid var(--line-strong); }
.tl-m { padding: 0; border: 0; cursor: pointer; }
.tl-m.s { width: 3px; height: 14px; margin: -7px 0 0 -1.5px; border-radius: 2px; background: #cdc6ba; }
.tl-m.s:hover, .tl-m.s:focus-visible, .tl-m.s.on { background: var(--ink-soft); }
.tl-m.off { background: var(--line); cursor: default; }
.tl-m.c { z-index: 2; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; transform: rotate(45deg); background: var(--accent-edge); border-radius: 1.5px; box-shadow: 0 0 0 2.5px var(--bg); }
.tl-m.p { z-index: 2; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2.5px var(--bg); }
.tl-m.p.fail { width: 9px; height: 9px; background: var(--bg); box-shadow: inset 0 0 0 1.8px var(--wrong), 0 0 0 2.5px var(--bg); }
.tl-m.c.on, .tl-m.p.on, .tl-m.c:focus-visible, .tl-m.p:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.tl-m.fin { left: calc(100% - var(--r) + 26px + var(--col) * 12px); }
.tl-num { z-index: 3; width: 17px; height: 17px; margin: -25px 0 0 -8.5px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 11px; font-weight: 700; display: grid; place-items: center; pointer-events: none; }
.tl-num.fin { left: calc(100% - var(--r) + 8px); margin-top: -8.5px; }
.tl-end { position: absolute; right: 0; top: 0; bottom: 0; width: calc(var(--r) - 20px); font-size: 12px; color: var(--muted); }
.tl-end b { display: block; font-weight: 600; }
.tl-end small { position: absolute; bottom: 0; font-size: 12px; }
.tl-story { margin-top: 26px; }
.tl-story h3 { margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--muted); }
.tl-story h3 b { color: var(--ink); }
.tl-steps { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 0; list-style: none; border-top: 1.5px solid var(--line); }
.tl-step { position: relative; padding: 16px 18px 0 0; font-size: 15px; line-height: 1.35; }
.tl-step .tl-num { top: -9px; left: 0; margin: 0; }
.tl-step .when { margin: -12px 0 10px 24px; font-size: 13px; font-weight: 600; color: var(--muted); }
.tl-step p { margin: 0; }
.tl-chip { padding: 1px 8px; border-radius: var(--r-tag); font-weight: 600; font-size: 13.5px; background: var(--chip-bg); white-space: nowrap; }
.tl-chip.ok { background: var(--right-soft); color: var(--right-ink); }
.tl-chip.bad { background: var(--wrong-soft); color: var(--wrong-ink); }
.tl-link { display: inline-block; margin-top: 8px; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; cursor: pointer; }
.tl-step .tl-link { color: var(--muted); font-weight: 400; text-decoration-color: var(--line-strong); }
/* how each memory did with this user: the heading on the left, PSA bars on the right (stacked on phones) */
.mem-card { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 8px 36px; align-items: start; margin-top: 40px; padding: 18px 22px; }
.mem-head { grid-row: span 2; }
.mem-head h3 { margin: 0; font-size: 18px; }
.mem-head p { margin: 6px 0 0; font-size: 14px; color: var(--muted); line-height: 1.4; }
.mem-card .hbars { grid-column: 2; gap: 6px; }
.mem-card .hbars + .hbars { padding-top: 8px; border-top: 1px dashed var(--line); }
.mem-card .hbar { grid-template-columns: 110px 1fr 46px; gap: 10px; }
.mem-card .hbar .name { font-size: 14px; }
.mem-card .hbar .val { font-size: 15px; }
.mem-card .track { height: 12px; border-radius: 5px; }
.mem-card .fill { border-radius: 5px; }
@media (max-width: 760px) {
  .mem-card { grid-template-columns: 1fr; gap: 12px; margin-top: 32px; padding: 16px; }
  .mem-head { grid-row: auto; }
  .mem-card .hbars { grid-column: auto; }
  .mem-card .hbar { grid-template-columns: 92px 1fr 42px; gap: 8px; }
}
.tl-pop { position: absolute; z-index: 5; width: min(320px, calc(100% - 32px)); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px 14px; box-shadow: var(--shadow); font-size: 14.5px; line-height: 1.4; }
.tl-pop[hidden] { display: none; }
.tl-pop::before { content: ""; position: absolute; left: var(--tip, 50%); top: -6px; width: 10px; height: 10px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); background: var(--paper); transform: rotate(45deg); }
.tl-pop .when { font-size: 13px; font-weight: 600; color: var(--muted); }
.tl-pop p { margin: 6px 0 8px; }

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(35, 29, 24, .45); }
.modal[hidden] { display: none; }
.modal-card { width: min(520px, 100%); height: min(720px, calc(100vh - 32px)); display: flex; flex-direction: column; overflow: hidden; animation: pop .35s ease; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.modal-head .avatar { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex: none; }
.modal-head .avatar img { width: 100%; height: 100%; object-fit: cover; }
.modal-head b { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.modal-x { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); font-size: 22px; line-height: 1; cursor: pointer; }
.modal-chat { padding: 14px; }

@media (max-width: 760px) {
  .demo { grid-template-columns: 1fr; gap: 12px; padding-top: 14px; }
  .demo-side { gap: 10px; height: auto; }
  .side-scroll { max-height: 300px; }
  .stage { height: 640px; }
  .phone-up .room { height: 40%; }
  .phone-wrap { left: 8px; right: 8px; bottom: 8px; width: auto; height: calc(60% - 14px); }
  .past { top: 52px; left: 10px; right: 10px; width: auto; }
  .pm { font-size: 12px; }
  .segs { flex-wrap: nowrap; }
  .segs b { display: none; }
  .segs button:not([aria-current]) { padding-right: 4px; }
  .segs button[aria-current] b { display: inline; }
  .past-link { left: 50%; top: 100%; width: 0; height: var(--reach, 20px); border-top: 0; border-left: 2px dashed var(--accent-edge); }
  .past-link::after { right: auto; left: -5px; top: auto; bottom: -4px; }
  .phone-wrap .phone { padding: 8px; border-radius: 28px; }
  .phone-wrap .phone-screen { border-radius: 22px; padding-top: 10px; }
  .bubble { padding: 10px 12px; gap: 6px; }
  .bubble svg { width: 40px; height: 40px; }
  .recap { bottom: 10%; }
  .stage-btn { width: 36px; height: 36px; }
  .demo-tl { padding-left: 16px; padding-right: 16px; }
  .demo-tl .tl-legend { margin-left: 0; }
  .tl-steps { grid-template-columns: 1fr 1fr; row-gap: 22px; }
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pair-note { font-size: 13.5px; }
.hbars-foot .ref-keys { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; }
.case { margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--bg); }
.case-head { margin: 0 !important; color: var(--ink) !important; }
.case-head .ex-tag { margin-right: 8px; }
@media (max-width: 760px) {
          }
.stack-lead { margin-top: 18px !important; }
.stacks { display: grid; gap: 7px; margin-top: 10px; }
.stack-row { display: grid; grid-template-columns: 100px 1fr 104px 104px; gap: 12px; align-items: center; font-size: 14px; color: var(--muted); }
.stack-row > b { color: var(--ink); }
.stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--bg-deep); }
.stack .k-pref { background: var(--accent-edge); }
.stack .k-rest { background: var(--bg-deep); }
.stack .k-event { background: color-mix(in srgb, var(--ink) 18%, var(--bg)); }
.stack-v { font-size: 13.5px; white-space: nowrap; }
.stack-v b { font: 600 15px var(--font-mono); color: var(--ink-soft); }
.stack-row.top .stack-v b { color: var(--accent-edge); }
@media (max-width: 760px) {
  .stack-row { grid-template-columns: 1fr auto auto; gap: 4px 10px; }
  .stack-row .stack { grid-column: 1 / -1; grid-row: 2; }
}
.f3-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: center; margin-top: 14px; }
.f3-grid .case { margin-top: 0; }
.cx-note { font-size: 13.5px; margin-top: 12px !important; }
.scatter { margin: 0; }
.scatter svg { display: block; width: 100%; height: auto; }
.scatter .g { stroke: var(--line); }
.scatter .t { font: 500 11.5px var(--font-mono); fill: var(--muted); }
.scatter .ax { font: 600 12.5px var(--font-body); fill: var(--ink-soft); }
.scatter .cl { fill: color-mix(in srgb, var(--ink) 6%, transparent); }
.scatter .d { fill: var(--bar); stroke: var(--bar-edge); }
.scatter .d.ref { fill: var(--bg-deep); stroke: var(--line-strong); }
.scatter .d.top { fill: var(--accent); stroke: var(--accent-edge); stroke-width: 1.5; }
.scatter .lb { font: 600 12.5px var(--font-body); fill: var(--muted); }
.scatter .lb.top { font-size: 14px; fill: var(--accent-edge); }
.scatter figcaption { font-size: 13.5px; color: var(--ink-soft); margin-top: 4px; }
@media (max-width: 860px) { .f3-grid { grid-template-columns: 1fr; } }
.tl-story h3 label { font-weight: 600; }
.tl-pick-wrap { position: relative; display: inline-block; }
.tl-pick-wrap::after { content: ""; position: absolute; right: 11px; top: 50%; width: 6px; height: 6px; border-right: 1.8px solid var(--ink-soft); border-bottom: 1.8px solid var(--ink-soft); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
#tl-pick { appearance: none; -webkit-appearance: none; font: 700 14px var(--font-body); color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--r-btn); padding: 5px 30px 5px 11px; cursor: pointer; max-width: 100%; }
#tl-pick:focus-visible { outline: 2px solid var(--accent-edge); outline-offset: 2px; }
.cs-steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 0; }
.cs-steps li { position: relative; padding: 0 0 14px 22px; border-left: 2px solid var(--line-strong); margin-left: 6px; }
.cs-steps li:last-child { padding-bottom: 2px; border-left-color: transparent; }
.cs-steps li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent-edge); }
.cs-steps li.bad::before { border-color: #c4554a; background: #c4554a; }
.cs-when { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cs-steps p { margin: 6px 0 0 !important; }
.cs-say { font-size: 15px; color: var(--ink) !important; }
.cs-say b { margin-right: 4px; }
.cs-memo { padding: 8px 11px; border-radius: 9px; background: var(--paper); border: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.cs-memo mark { background: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--ink); border-radius: 3px; padding: 0 2px; }
.cs-aside { display: block; font-size: 13.5px; color: var(--muted); }
.cs-say .cs-aside { margin-top: 2px; }
.cs-pick { font-weight: 600; color: #b0493f; }
.cs-key { color: var(--ink-soft) !important; }
.cs-key u { text-decoration: underline; text-decoration-color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 4px; color: var(--ink); font-weight: 600; }
@media (max-width: 760px) {
    }
.cs-record { display: block; width: 100%; height: auto; margin-top: 8px; border-radius: 12px; box-shadow: var(--shadow); }
.cs-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; margin-top: 8px; }
.cs-pair .cs-record { margin-top: 0; }
@media (max-width: 760px) { .cs-pair { grid-template-columns: 1fr; } }
.cs-out { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 10px; }
.cs-phone { margin: 0; display: flex; align-items: center; gap: 14px; }
.cs-phone .scr { width: 86px; height: 132px; flex: none; box-sizing: border-box; border: 3px solid var(--ink); border-radius: 16px; background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px; }
.cs-phone.ok .scr { color: var(--muted); font-size: 11.5px; }
.cs-phone.ok .scr svg { width: 22px; height: 22px; }
.cs-phone .note { align-self: stretch; padding: 6px 7px; border-radius: 8px; background: color-mix(in srgb, #c4554a 14%, var(--paper)); border: 1px solid color-mix(in srgb, #c4554a 40%, var(--line)); font-size: 10.5px; line-height: 1.3; color: var(--ink-soft); }
.cs-phone .note b { display: block; font-size: 10px; color: var(--ink); }
.cs-phone figcaption { font-size: 15px; font-weight: 600; color: var(--right-ink); }
.cs-phone.bad figcaption { color: #b0493f; }
.cs-phone figcaption b { display: block; color: var(--ink); font-weight: 700; }
.cs-phone.bad .scr { justify-content: flex-start; padding-top: 12px; }
.cs-say u { text-decoration: underline; text-decoration-color: currentColor; text-decoration-thickness: 2px; text-underline-offset: 4px; }
/* cases start folded: the head line is the toggle */
summary.case-head { position: relative; padding-right: 64px; cursor: pointer; list-style: none; }
summary.case-head::-webkit-details-marker { display: none; }
summary.case-head::after { content: "Show \25BE"; position: absolute; right: 0; top: 1px; font: 600 13px var(--font-body); color: var(--muted); }
.case[open] > summary.case-head::after { content: "Hide \25B4"; }
summary.case-head:hover::after, summary.case-head:focus-visible::after { color: var(--ink); }
.f3-grid:has(> .case:not([open])) { grid-template-columns: 1fr; }
.f3-grid:has(> .case:not([open])) .scatter { width: 100%; max-width: 560px; margin-inline: auto; }
/* narrow screens: the header tooltip spans the table instead of hanging off its column */
@media (max-width: 640px) {
  .lb { position: relative; }
  .lb th.m { position: static; }
  .lb th.m .tip, .lb th.m:nth-last-child(-n+2) .tip { left: 8px; right: 8px; top: 44px; }
  .lb th.m:hover .tip, .lb th.m:focus .tip { width: auto; }
  .lb th.m .tip img { width: 150px; height: 150px; }
}
/* an event in the Demo chat: what arrives when nobody has asked anything */
.ev { align-self: center; max-width: 92%; padding: 8px 12px; border-radius: 12px; background: var(--paper); border: 1px dashed var(--line-strong); font-size: 13.5px; color: var(--ink-soft); animation: pop .4s cubic-bezier(.2, .9, .3, 1.2); }
