/* Copied from demo/static/styles.css, plus the pieces the Django pages add (at the end).
   Tokens: the same validated palette ccbo.viz uses, so the page and the
   library's own figures sit next to each other without clashing. */
:root {
  color-scheme: light;
  --surface: #fcfcfb;
  --plane: #f9f9f7;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --good: #0ca30c;
  --critical: #d03b3b;
  --warning: #fab219;
  --border: rgba(11, 11, 11, 0.10);
  --radius: 10px;
  --ramp-0: #cde2fb; --ramp-1: #9ec5f4; --ramp-2: #6da7ec; --ramp-3: #3987e5;
  --ramp-4: #256abf; --ramp-5: #184f95; --ramp-6: #0d366b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface: #1a1a19;
    --plane: #0d0d0d;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --ink-muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --border: rgba(255, 255, 255, 0.10);
    /* On a dark surface the step nearest the surface is the darkest, so low
       values recede and high values are the bright ones. */
    --ramp-0: #0d366b; --ramp-1: #184f95; --ramp-2: #256abf; --ramp-3: #3987e5;
    --ramp-4: #6da7ec; --ramp-5: #9ec5f4; --ramp-6: #cde2fb;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--plane);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: 3rem;
}

h1 { font-size: 1.15rem; margin: 0; font-weight: 600; }
h2 { font-size: 1.02rem; margin: 0; font-weight: 600; }
h3 { font-size: 0.86rem; margin: 0 0 .5rem; font-weight: 600; color: var(--ink-2); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
.sub { margin: .3rem 0 0; color: var(--ink-2); font-size: .86rem; max-width: 68ch; }
.foot { color: var(--ink-muted); font-size: .8rem; margin: .7rem 0 0; }
.note { color: var(--ink-2); font-size: .82rem; }

.bar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem 16px; border-bottom: 1px solid var(--border); background: var(--surface);
  flex-wrap: wrap;
}
.badge {
  font-size: .78rem; color: var(--ink-2); border: 1px solid var(--border);
  border-radius: 999px; padding: .3rem .7rem; background: var(--plane);
}

main, .tiles, footer { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ---- stat tiles: the number is the chart ---- */
.tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .7rem; margin: 1rem auto;
}
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .7rem .85rem;
}
.tile .value { font-size: 1.35rem; font-weight: 600; letter-spacing: -.01em; }
.tile .name { font-size: .74rem; color: var(--ink-muted); text-transform: uppercase;
  letter-spacing: .04em; }
.tile .hint { font-size: .78rem; color: var(--ink-2); margin-top: .15rem; }

.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; margin-bottom: 1rem;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; flex-wrap: wrap; margin-bottom: .9rem;
}
.controls { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

/* ---- controls ---- */
button {
  font: inherit; font-size: .85rem; border-radius: 7px; padding: .4rem .8rem;
  border: 1px solid var(--border); background: var(--plane); color: var(--ink);
  cursor: pointer;
}
button:hover { border-color: var(--axis); }
button.primary { background: var(--series-1); border-color: var(--series-1); color: #fff; }
button.primary:hover { filter: brightness(1.08); }
button.ghost { background: transparent; }
button.danger:hover { border-color: var(--critical); color: var(--critical); }
button[disabled] { opacity: .45; cursor: not-allowed; }

.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 7px;
  overflow: hidden; }
.segmented button { border: 0; border-radius: 0; background: transparent; }
.segmented button.on { background: var(--series-1); color: #fff; }

.field { display: inline-flex; flex-direction: column; gap: .2rem; font-size: .78rem;
  color: var(--ink-muted); }
.field.wide { display: flex; margin-top: .6rem; }
select, textarea, input[type="text"] {
  font: inherit; font-size: .85rem; color: var(--ink); background: var(--plane);
  border: 1px solid var(--border); border-radius: 7px; padding: .35rem .5rem;
}
textarea { width: 100%; resize: vertical; font-family: ui-monospace, Menlo, monospace;
  font-size: .8rem; }
.check { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem;
  color: var(--ink-2); }
input[type="range"] { width: 220px; accent-color: var(--series-1); }
.slider-label { font-size: .85rem; color: var(--ink-2); }
.slider-label output { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---- the surface ---- */
.surfaces { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem; }
.surface h3 { display: flex; justify-content: space-between; }
.surface svg { width: 100%; height: auto; display: block; }
.cell { stroke: none; }
.cell:hover { stroke: var(--ink); stroke-width: 1.5; }
.mark-result { fill: var(--surface); stroke: var(--ink); stroke-width: 1.4; }
.mark-proposal { fill: var(--series-2); stroke: var(--surface); stroke-width: 1.5; }
.mark-picked { fill: none; stroke: var(--series-3); stroke-width: 2.5; }
.axis-text { fill: var(--ink-muted); font-size: 9px; }
.axis-title { fill: var(--ink-2); font-size: 10px; }

.legend-row { display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin-top: .7rem; flex-wrap: wrap; }
.scale { display: flex; align-items: center; gap: .4rem; font-size: .75rem;
  color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.scale .bar-ramp { width: 160px; height: 10px; border-radius: 3px;
  background: linear-gradient(to right, var(--ramp-0), var(--ramp-3), var(--ramp-6)); }
.keys { display: flex; align-items: center; gap: .9rem; font-size: .78rem;
  color: var(--ink-2); flex-wrap: wrap; }
.key { display: inline-flex; align-items: center; gap: .3rem; }
.timing { color: var(--ink-muted); font-size: .74rem; }

/* ---- proposals ---- */
.bands { display: flex; gap: .4rem; margin-bottom: .8rem; flex-wrap: wrap; }
.band { font-size: .76rem; padding: .22rem .6rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--ink-2); cursor: pointer; background: var(--plane); }
.band.on { border-color: var(--series-1); color: var(--series-1); font-weight: 600; }
.proposals { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: .7rem; }
.proposal {
  border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .8rem;
  background: var(--plane);
}
.proposal .label { font-weight: 600; font-size: .95rem; }
.proposal .value { font-size: 1.25rem; font-weight: 600; margin-top: .2rem;
  font-variant-numeric: tabular-nums; }
.proposal .meta { font-size: .78rem; color: var(--ink-2); margin-top: .35rem; }
.pct { display: inline-block; margin-top: .45rem; height: 5px; border-radius: 3px;
  background: var(--series-1); }
.pct-track { background: var(--grid); border-radius: 3px; height: 5px; margin-top: .45rem; }
.warn { color: var(--warning); }

/* ---- commit ---- */
.commit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 760px) { .commit-grid, .split { grid-template-columns: 1fr !important; } }
.slot { border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem;
  background: var(--plane); }
.slot-head { font-size: .8rem; color: var(--ink-2); display: flex; align-items: center;
  gap: .4rem; margin-bottom: .6rem; }
.chip { font-weight: 700; font-size: .7rem; width: 20px; height: 20px; border-radius: 5px;
  display: grid; place-items: center; color: #fff; }
.chip-a { background: var(--series-1); }
.chip-b { background: var(--series-3); }
.pickers { display: flex; gap: .5rem; flex-wrap: wrap; }
.prediction { font-size: .84rem; color: var(--ink-2); margin: .6rem 0 0; }
.empty { color: var(--ink-muted); font-size: .85rem; margin: 0; }
.locked { font-size: .74rem; color: var(--ink-muted); }
.actions { display: flex; align-items: center; gap: .6rem; margin-top: .9rem; flex-wrap: wrap; }

.message { border-radius: 8px; padding: .6rem .8rem; font-size: .84rem; margin-top: .8rem;
  border: 1px solid var(--border); background: var(--plane); }
.message.refused { border-left: 3px solid var(--critical); }
.message.flagged { border-left: 3px solid var(--warning); }
.message.ok { border-left: 3px solid var(--good); }
.message ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.message li { margin: .15rem 0; }

/* ---- results ---- */
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.2rem; }
.stats { display: flex; gap: 1.2rem; margin-bottom: .7rem; flex-wrap: wrap; }
.stats .stat .value { font-size: 1.1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats .stat .name { font-size: .74rem; color: var(--ink-muted); }
.pending { font-size: .82rem; max-height: 260px; overflow: auto; }
.pending div { padding: .3rem 0; border-bottom: 1px solid var(--grid); display: flex;
  justify-content: space-between; gap: .6rem; }
.pending .who { color: var(--ink-muted); }

table.rows { width: 100%; border-collapse: collapse; font-size: .8rem;
  font-variant-numeric: tabular-nums; }
table.rows th { text-align: left; color: var(--ink-muted); font-weight: 500;
  border-bottom: 1px solid var(--axis); padding: .3rem .4rem; }
table.rows td { padding: .3rem .4rem; border-bottom: 1px solid var(--grid); }

/* ---- figure ---- */
#figure { width: 100%; border-radius: 8px; display: block; }

footer { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1rem;
  color: var(--ink-muted); font-size: .78rem; flex-wrap: wrap; }
footer a { color: var(--series-1); }

.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translate(-50%, 2rem);
  background: var(--ink); color: var(--surface); padding: .5rem .9rem; border-radius: 8px;
  font-size: .84rem; opacity: 0; pointer-events: none; transition: all .18s ease;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.tooltip {
  position: fixed; background: var(--ink); color: var(--surface); padding: .35rem .55rem;
  border-radius: 6px; font-size: .76rem; pointer-events: none; opacity: 0;
  transition: opacity .1s; white-space: nowrap; z-index: 10;
  font-variant-numeric: tabular-nums;
}
.tooltip.show { opacity: 1; }

/* ====================================================================== */
/* Django pages                                                            */
/* ====================================================================== */
[hidden] { display: none !important; }
a { color: var(--series-1); }
.home-link { color: inherit; text-decoration: none; }
.crumb { font-weight: 400; color: var(--ink-2); }
.who { display: flex; align-items: center; gap: .5rem; }
.who form { margin: 0; }
a.badge { text-decoration: none; }
.flash-wrap { max-width: 1120px; margin: .8rem auto 0; padding: 0 16px; }
main.narrow { max-width: 760px; margin-top: 1.2rem; }
.center { text-align: center; }
.gap { margin-top: 1.1rem; }
.small { font-size: .78rem; }
.right { text-align: right; white-space: nowrap; }
.strong { font-weight: 600; }
.meta { font-size: .8rem; color: var(--ink-2); margin-top: .25rem; }

input[type="password"] {
  font: inherit; font-size: .85rem; color: var(--ink); background: var(--plane);
  border: 1px solid var(--border); border-radius: 7px; padding: .35rem .5rem;
}
.join { display: flex; gap: .5rem; flex-wrap: wrap; }
.code-input { font-family: ui-monospace, Menlo, monospace; font-size: 1.1rem !important;
  letter-spacing: .2em; text-transform: uppercase; width: 12ch; }
.links { margin: .3rem 0 .6rem; padding-left: 1.1rem; }
.links li { margin: .2rem 0; }
.create, .stack { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.stack { flex-direction: column; align-items: stretch; max-width: 320px; margin-top: .8rem; }

a.button {
  display: inline-block; font-size: .85rem; border-radius: 7px; padding: .4rem .8rem;
  border: 1px solid var(--border); background: var(--plane); color: var(--ink);
  text-decoration: none; line-height: 1.5;
}
a.button.ghost { background: transparent; }
a.button:hover { border-color: var(--axis); }
.controls.tight { margin-bottom: .5rem; }
textarea.prose { font-family: inherit; font-size: .85rem; }

.staff-strip {
  max-width: 1120px; margin: .8rem auto 0; padding: .5rem .8rem; font-size: .84rem;
  border: 1px dashed var(--series-2); border-radius: 8px; color: var(--ink-2);
  box-sizing: border-box; width: calc(100% - 32px);
}

/* ---- where the pair is in the round ---- */
.step p { margin: .7rem 0 0; max-width: 75ch; }
.stepper { display: flex; gap: .4rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap;
  counter-reset: step; }
.stepper li { counter-increment: step; font-size: .8rem; color: var(--ink-muted);
  border: 1px solid var(--border); border-radius: 999px; padding: .25rem .7rem; }
.stepper li::before { content: counter(step) " · "; }
.stepper li.done { color: var(--good); border-color: var(--good); }
.stepper li.now { color: #fff; background: var(--series-1); border-color: var(--series-1);
  font-weight: 600; }
.proposal.issued { border-color: var(--series-1); box-shadow: inset 3px 0 0 var(--series-1); }

.pill { display: inline-block; font-size: .72rem; padding: .1rem .5rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--ink-2); white-space: nowrap; }
.pill.ok { color: var(--good); border-color: var(--good); }
.pill.bad { color: var(--critical); border-color: var(--critical); }
.pill.muted { color: var(--ink-muted); }
.chip { display: inline-grid; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }

/* ---- staff ---- */
.timeline { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .9rem; }
.round-chip { display: flex; flex-direction: column; gap: .1rem; font-size: .76rem;
  color: var(--ink-2); border: 1px solid var(--border); border-radius: 8px; padding: .4rem .6rem;
  background: var(--plane); }
.round-chip.now { border-color: var(--series-1); }
.table-wrap { overflow-x: auto; }
table.rows td { vertical-align: top; }
code.join { font-size: .95rem; letter-spacing: .08em; }
.scatter { width: 100%; height: auto; }
.scatter .axis-title { font-size: 11px; }

/* ====================================================================== */
/* Sidebar layout: one section at a time                                   */
/* ====================================================================== */
.shell {
  max-width: 1320px; margin: 0 auto; padding: 1rem 16px 0;
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.25rem;
}
.shell .content > main, .shell .tiles, .shell footer { max-width: none; margin-left: 0;
  margin-right: 0; padding: 0; }
.shell .tiles { margin: 0 0 1rem; }
.sidebar { position: sticky; top: 1rem; align-self: start; display: flex; flex-direction: column;
  gap: .9rem; }
.side-title { font-weight: 600; font-size: 1rem; }
.sidebar nav { display: flex; flex-direction: column; gap: .15rem; }
.sidebar nav a {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  padding: .5rem .7rem; border-radius: 8px; border: 1px solid transparent;
  color: var(--ink-2); text-decoration: none; font-size: .9rem; white-space: nowrap;
}
.sidebar nav a:hover { background: var(--surface); color: var(--ink); }
.sidebar nav a.on { background: var(--surface); color: var(--ink); border-color: var(--border);
  font-weight: 600; box-shadow: inset 3px 0 0 var(--series-1); }
.count { font-size: .7rem; font-weight: 600; color: var(--ink-2); background: var(--grid);
  border-radius: 999px; padding: .05rem .45rem; font-variant-numeric: tabular-nums; }
.count.action { background: var(--series-1); color: #fff; }
.staff-note { font-size: .8rem; color: var(--ink-2); border: 1px dashed var(--series-2);
  border-radius: 8px; padding: .5rem .6rem; }
.view > .panel:last-child { margin-bottom: 1rem; }

@media (max-width: 820px) {
  /* minmax(0, ...) lets the tab strip scroll inside its row instead of widening the page */
  .shell { grid-template-columns: minmax(0, 1fr); gap: .6rem; padding-top: .5rem; }
  .sidebar, .sidebar nav, .content { min-width: 0; }
  .sidebar { position: sticky; top: 0; z-index: 5; background: var(--plane);
    padding: .4rem 0; margin: 0 -16px; padding-left: 16px; padding-right: 16px;
    border-bottom: 1px solid var(--border); }
  .sidebar .side-meta { display: none; }
  .sidebar nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .sidebar nav a { padding: .4rem .65rem; }
  .sidebar nav a.on { box-shadow: inset 0 -3px 0 var(--series-1); }
}

/* ---- the map ---- */
.surface-one { max-width: 640px; }
.surface-one svg { width: 100%; height: auto; display: block; }
.cell.pickable { cursor: pointer; }
.mark-result.repeat { stroke-width: 2.2; }

/* ---- the experiment ---- */
.factors { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .7rem;
  margin-top: .8rem; }
.factor { border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .8rem;
  background: var(--plane); }
.factor .note { margin: .4rem 0 0; }

/* ---- tables ---- */
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.mine td { background: color-mix(in srgb, var(--series-1) 8%, transparent); }
ul.plain { list-style: none; padding-left: 0; color: var(--ink-2); }
a.button.primary { background: var(--series-1); border-color: var(--series-1); color: #fff; }
.band[disabled] { opacity: .5; cursor: not-allowed; }
/* Markers sit on top of cells; clicks go through to the cell underneath. */
.mark-result, .mark-proposal, .mark-picked, .axis-text, .axis-title { pointer-events: none; }

/* ---- printable join-code slips ---- */
.slips { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0; margin-top: 1rem; }
.slip { border: 1px dashed var(--axis); padding: .9rem 1rem; break-inside: avoid; }
.slip-pair { font-weight: 600; }
.slip-members { font-size: .82rem; color: var(--ink-2); }
.slip-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-muted); margin-top: .5rem; }
.slip-code { font-family: ui-monospace, Menlo, monospace; font-size: 1.6rem; letter-spacing: .18em;
  font-weight: 600; }
.slip-where { font-size: .74rem; color: var(--ink-2); margin-top: .4rem; }
@media print {
  .bar, .no-print, .toast, .tooltip { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  .slip { border-color: #999; }
}

/* ---- model by round ---- */
.round-picker { display: flex; gap: .3rem; flex-wrap: wrap; }
.round-picker button.on { background: var(--series-1); border-color: var(--series-1); color: #fff; }
.delta-pos { color: var(--good); }
.delta-neg { color: var(--critical); }
.history-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: .7rem; }
.history-card { border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .8rem;
  background: var(--plane); font-size: .84rem; }
.history-card h3 { margin: 0 0 .3rem; color: var(--ink); }
.history-card dl { display: grid; grid-template-columns: auto auto; gap: .15rem .6rem; margin: .3rem 0 0; }
.history-card dt { color: var(--ink-muted); }
.history-card dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.ramp-diverging { background: linear-gradient(to right, var(--critical), var(--plane), var(--good)) !important; }

/* a <label> wrapping a hidden file input, styled as a button */
label.button {
  display: inline-block; font-size: .85rem; border-radius: 7px; padding: .4rem .8rem;
  border: 1px solid var(--border); background: var(--plane); color: var(--ink);
  cursor: pointer; line-height: 1.5;
}
label.button.ghost { background: transparent; }
label.button.primary { background: var(--series-1); border-color: var(--series-1); color: #fff; }
label.button:hover { border-color: var(--axis); }
label.button:focus-within { outline: 2px solid var(--series-1); outline-offset: 2px; }
/* hidden from sight, not from the keyboard or a screen reader */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ====================================================================== */
/* Any experiment: pickers, map axes, plain-words legends, small charts    */
/* ====================================================================== */
.when-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .when-dark { display: inline; }
  :root:not([data-theme="light"]) .when-light { display: none; }
}
:root[data-theme="dark"] .when-dark { display: inline; }
:root[data-theme="dark"] .when-light { display: none; }

details.more { margin-top: .6rem; font-size: .82rem; color: var(--ink-2); }
details.more summary { cursor: pointer; color: var(--ink-muted); font-size: .78rem; width: max-content; }
details.more p { margin: .35rem 0 0; max-width: 72ch; }
button.small, .ghost.small { font-size: .74rem; padding: .15rem .5rem; }

/* condition pickers: one per factor, in a responsive grid */
.pickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .55rem .8rem; }
.pickers.many { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .4rem .6rem; }
.picker { min-width: 0; }
.picker-name { font-size: .78rem; color: var(--ink-2); margin-bottom: .15rem; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.picker select { width: 100%; }
.num-stepper { display: flex; align-items: center; gap: .25rem; min-width: 0; }
.num-stepper input[type="range"] { flex: 1 1 auto; min-width: 40px; width: auto; }
.num-stepper output { min-width: 3.2em; text-align: right; font-weight: 600; font-size: .85rem;
  font-variant-numeric: tabular-nums; }
.step-btn { padding: .05rem .45rem; line-height: 1.2; font-size: .9rem; }
.segmented.options { display: flex; flex-wrap: wrap; max-width: 100%; }
.segmented.options button { flex: 1 1 auto; padding: .3rem .55rem; font-size: .8rem; }

/* the map's axis choice and held factors */
.map-axes { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .7rem; margin: 0 0 .6rem;
  font-size: .78rem; color: var(--ink-2); }
.map-axes .held { display: inline-flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center;
  color: var(--ink-muted); }
label.mini { display: inline-flex; align-items: center; gap: .25rem; font-size: .78rem; color: var(--ink-2); }
label.mini select { font-size: .78rem; padding: .15rem .3rem; max-width: 9.5rem; }
.scale { flex-wrap: wrap; }
.scale-say { color: var(--ink-2); }
.tip-note { opacity: .75; }

/* one-factor line */
.surface-one svg .line { fill: none; stroke: var(--series-1); stroke-width: 2; }
.surface-one svg .band { fill: color-mix(in srgb, var(--series-1) 18%, transparent); stroke: none; }
.surface-one svg line.mark-picked { stroke-dasharray: 4 3; }
.cell.col { stroke: none; }
.cell.col:hover { fill: color-mix(in srgb, var(--ink) 6%, transparent); stroke: none; }
.gridline { stroke: var(--grid); stroke-width: 1; }
.swatch { display: inline-block; width: 16px; height: 9px; border-radius: 2px; }
.line-swatch { height: 2px; background: var(--series-1); }
.band-swatch { background: color-mix(in srgb, var(--series-1) 22%, transparent); }

/* play it safe <-> explore */
.explore-slider { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem;
  font-size: .85rem; color: var(--ink-2); }
.explore-slider input[type="range"] { flex: 1 1 160px; max-width: 320px; width: auto; min-width: 120px; }
.kappa-num { font-size: .72rem; color: var(--ink-muted); font-weight: 400; font-variant-numeric: tabular-nums; }
button.primary .kappa-num { color: rgba(255, 255, 255, .8); }
.proposal .pm { font-size: .85rem; font-weight: 400; color: var(--ink-2); }

/* small charts */
.chart { width: 100%; height: auto; display: block; max-width: 640px; }
.dot-all { fill: var(--ink-muted); opacity: .5; }
.dot-mine { fill: var(--series-3); stroke: var(--surface); stroke-width: 1.5; }
.dot-all-key { background: var(--ink-muted); opacity: .6; }
.dot-mine-key { background: var(--series-3); }
.best-line { fill: none; stroke: var(--series-1); stroke-width: 2; }
.best-mark { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.best-tick { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 2 2; }
.value-label { fill: var(--ink); font-size: 11px; font-weight: 600; }
.pred-bars { width: 190px; height: 30px; display: block; }
.bar-pred { fill: color-mix(in srgb, var(--series-1) 45%, transparent); }
.bar-meas { fill: var(--series-1); }
.whisker { stroke: var(--ink-2); stroke-width: 1.2; }
.goal-card { border-color: color-mix(in srgb, var(--series-1) 40%, var(--border)); }

/* experiment builder (home) */
.builder { margin-top: .8rem; }
.builder-table { min-width: 720px; }
.builder-table td { padding: .2rem .2rem; }
.builder-table input[type="text"] { width: 100%; min-width: 4.5rem; padding: .25rem .35rem; font-size: .8rem; }
.builder-table input.num-in { min-width: 3.2rem; width: 4rem; }
.builder-table input.wide-in { min-width: 6rem; }
.builder-table select { font-size: .8rem; padding: .25rem .3rem; }
.builder-table input:disabled { opacity: .35; }
.preview-line { margin: .5rem 0 .2rem; font-size: .9rem; }
.choice { display: flex; gap: .4rem 1rem; flex-wrap: wrap; font-size: .88rem; }
.choice label { display: inline-flex; align-items: center; gap: .3rem; }
.create-grid { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
fieldset.plain { border: 0; padding: 0; margin: .8rem 0 0; min-width: 0; }
fieldset.plain legend { font-size: .78rem; color: var(--ink-muted); padding: 0; margin-bottom: .3rem; }
@media (max-width: 520px) {
  .create-grid .field, .create-grid .field input, .create-grid .field select { width: 100%; }
}
.pct-track .pct { display: block; margin-top: 0; height: 100%; }
main.narrow.home { max-width: 940px; }
.scatter { max-width: 720px; }
@media (max-width: 520px) {
  /* small charts scale down with the screen; keep their words readable */
  .chart .axis-text { font-size: 15px; }
  .chart .axis-title, .chart .value-label { font-size: 16px; }
}

/* "what these mean": definitions under every data panel */
.explain { margin-top: .6rem; }
.glossary { display: grid; grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr);
  gap: .35rem 1rem; margin: .5rem 0 0; font-size: .85rem; }
.glossary dt { font-weight: 600; }
.glossary dd { margin: 0; color: var(--muted, inherit); }
.glossary .unit-note { display: block; font-size: .8rem; opacity: .85; }
@media (max-width: 560px) { .glossary { grid-template-columns: minmax(0, 1fr); }
  .glossary dd { margin-bottom: .4rem; } }
.pending-list { margin: .5rem 0; }
