/* EveryRole components. Every color and size comes from tokens.css (see the /design page);
   tests/test_design.py fails on raw values here. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: var(--text-base)/1.5 var(--sans);
       -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }
img, video { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
.mono { font-family: var(--mono); }
/* typed text and code read character by character: no ligatures (JetBrains Mono joins "://" and "=>") */
input, textarea, .mono, code, pre, kbd { font-variant-ligatures: none; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
[id] { scroll-margin-top: calc(var(--header-height) + var(--space-5)); }  /* jumping to a card never hides it under the sticky header */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------------------------------------------------------------- header */
.top { display: flex; align-items: center; gap: var(--space-3-5); padding: 0 var(--space-6); height: var(--header-height); background: var(--surface);
       border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: var(--space-2); text-decoration: none; }
.brand__mark { width: 26px; height: 26px; display: block; flex: none; }  /* static/logo.svg: the account stack */
.brand__mark--dark { display: none; }
.brand__name { font-weight: var(--weight-bold); font-size: var(--text-xl); letter-spacing: -0.015em; }
.top__sep { color: var(--faint); }
.top__project { font-weight: var(--weight-medium); text-decoration: none; }

/* ---------------------------------------------------------------- layout */
.wrap { max-width: 1120px; margin: 0 auto; padding: var(--space-7) var(--space-6) var(--space-30); display: flex; flex-direction: column;
        gap: var(--space-5); }
.wrap--narrow { max-width: 900px; padding-top: var(--space-10); gap: var(--space-6); }
.wrap--list { max-width: 1080px; padding-top: var(--space-10); gap: var(--space-6); }
.wrap--wide { max-width: 1200px; padding-top: var(--space-10); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-end; justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: var(--space-1-5); }
.actions { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

.h1 { font-size: var(--text-5xl); font-weight: var(--weight-heading); letter-spacing: -0.02em; line-height: 1.2; }
.h1--big { font-size: var(--text-5xl); line-height: 1.15; }
.h2 { font-size: var(--text-3xl); font-weight: var(--weight-heading); letter-spacing: -0.01em; }
.h3 { font-size: var(--text-xl); font-weight: var(--weight-semibold); margin-top: var(--space-1-5); }
.lede { color: var(--ink-2); font-size: var(--text-lg); max-width: 680px; text-wrap: pretty; }
.sub { color: var(--muted); font-size: var(--text-md); max-width: 660px; }
.meta { font-size: var(--text-sm); color: var(--muted); display: flex; gap: var(--space-3-5); flex-wrap: wrap; }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: var(--control-md); padding: 0 var(--space-3-5);
       border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--control); font-weight: var(--weight-medium);
       cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--hover); color: var(--ink); }
.btn--primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); padding: 0 var(--space-4); }
.btn--primary:hover { background: var(--brand-hover); color: var(--on-brand); }
.btn--lg { height: var(--control-lg); padding: 0 var(--space-5); }
.btn--xl { height: var(--control-xl); padding: 0 var(--space-5); border-radius: var(--radius-lg); font-size: var(--text-lg); }
.btn--sm { height: var(--control-sm); padding: 0 var(--space-2-5); border-radius: var(--radius-sm); font-size: var(--text-sm); }
.btn--ghost { background: none; border-color: transparent; color: var(--ink-2); }
.btn--danger { color: var(--bad); border-color: var(--bad); background: var(--surface); }
.btn--danger:hover { background: var(--bad-bg); }
.btn--ghost:hover { background: var(--hover); }
.btn--text { background: none; border: 0; padding: 0; height: auto; font-weight: var(--weight-medium); color: var(--ink-2); }
.btn--text:hover { background: none; color: var(--ink); }
.back { align-self: flex-start; color: var(--ink-2); font-size: var(--text-md); text-decoration: none; }
.back:hover { color: var(--ink); }
.input { height: var(--control-input); padding: 0 var(--space-3); border-radius: var(--radius-md); border: 1px solid var(--control); background: var(--surface);
         font-size: var(--text-md); outline: none; width: 100%; }
.input:focus { border-color: var(--ink); box-shadow: var(--focus-ring); }
.input--xl { height: var(--control-xl); padding: 0 var(--space-4); border-radius: var(--radius-lg); border-color: var(--control); font: var(--text-lg) var(--mono); }
.input--password { letter-spacing: 0.1em; }
.input--password:placeholder-shown { letter-spacing: normal; }
.input--title { height: var(--control-title); font-size: var(--text-xl); border-color: var(--ink); }
textarea.input { height: auto; padding: var(--space-2-5) var(--space-3); }
label.field { display: flex; flex-direction: column; gap: var(--space-1-5); font-size: var(--text-md); font-weight: var(--weight-medium); }
label.field > span.hint { font-weight: var(--weight-regular); color: var(--muted); font-size: var(--text-sm); }
.error { padding: var(--space-3) var(--space-3-5); border-radius: var(--radius-lg); background: var(--bad-bg); color: var(--bad-ink); font-weight: var(--weight-medium); }
.inline { display: inline; margin: 0; }

.segmented { display: inline-flex; padding: var(--space-0-5); border-radius: var(--radius-md); background: var(--shade); gap: var(--space-0-5);
             flex-wrap: wrap; }
.segmented a, .segmented button { height: var(--control-sm); padding: 0 var(--space-3); border-radius: var(--radius-sm); border: 0; cursor: pointer;
                                  font-size: var(--text-sm); font-weight: var(--weight-medium); background: transparent; color: var(--muted);
                                  text-decoration: none; display: inline-flex; align-items: center; }
.segmented .is-on { background: var(--surface); color: var(--ink); }

/* ---------------------------------------------------------------- surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); }
.card--pad { padding: var(--space-4); }
.list > * + * { border-top: 1px solid var(--line-2); }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-3-5) var(--space-4);
              border-bottom: 1px solid var(--line-2); font-weight: var(--weight-semibold); }
.link-row { display: flex; justify-content: space-between; gap: var(--space-3); width: 100%; text-align: left; padding: var(--space-3-5) var(--space-4);
            text-decoration: none; color: var(--ink); }
.link-row:hover { background: var(--row-hover); color: var(--ink); }
.note { display: flex; gap: var(--space-3-5); align-items: flex-start; padding: var(--space-3-5) var(--space-4); border-radius: var(--radius-lg);
        background: var(--surface); border: 1px solid var(--line); font-size: var(--text-md); color: var(--ink-2); }
.note strong { color: var(--ink); }
.note__icon { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--ink); display: flex;
              align-items: center; justify-content: center; font-size: var(--text-xs); font-weight: var(--weight-bold); color: var(--ink); }
.banner { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); align-items: center; justify-content: space-between;
          padding: var(--space-4) var(--space-4); border-radius: var(--radius-xl); background: var(--bad-bg); border: 1px solid var(--bad-line); }
.banner__title { font-weight: var(--weight-semibold); color: var(--bad-ink); }
.banner__text { font-size: var(--text-md); color: var(--ink-2); }
.empty { padding: var(--space-7); text-align: center; color: var(--muted); }
.empty .btn { margin-top: var(--space-3-5); }

/* ---------------------------------------------------------------- status pills */
.pill { display: inline-flex; align-items: center; gap: var(--space-1-5); height: var(--pill-height); padding: 0 var(--space-2); border-radius: var(--radius-full);
        font-size: var(--text-xs); font-weight: var(--weight-semibold); white-space: nowrap; border: 1px solid transparent; }
.pill--lg { height: var(--pill-height-lg); padding: 0 var(--space-2-5); font-size: var(--text-sm); }
.pill--pass { color: var(--pass); background: var(--pass-bg); }
.pill--broken { color: var(--bad); background: var(--bad-bg); }
.pill--unsure { color: var(--unsure); background: var(--surface); border: 1px dashed var(--faint); }
.pill--notrun { color: var(--unsure); background: var(--chip); }
.pill--retry { color: var(--amber); background: var(--amber-bg); }
.pill--flaky { color: var(--amber); background: var(--amber-bg); box-shadow: inset 0 0 0 1px var(--amber-line); }
.pill--changed { color: var(--amber); background: var(--amber-bg); box-shadow: inset 0 0 0 1px var(--amber-line); }
.pill--running { color: var(--unsure); background: var(--chip); }
.pill--none { color: var(--muted); background: var(--chip); }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--pass); display: inline-block;
            animation: sqpulse 1.6s infinite; }
.dot-live--off { background: var(--dot-off); animation: none; }
@keyframes sqpulse { 0% { box-shadow: 0 0 0 0 var(--pass-glow); }
                     70% { box-shadow: 0 0 0 7px var(--pass-glow-0); }
                     100% { box-shadow: 0 0 0 0 var(--pass-glow-0); } }
@media (prefers-reduced-motion: reduce) { .dot-live { animation: none; } }

/* ---------------------------------------------------------------- bars */
.bar { display: flex; gap: var(--space-0-5); height: 6px; border-radius: var(--radius-2xs); overflow: hidden; background: var(--line-2); }
.bar--lg { height: 8px; border-radius: var(--radius-xs); max-width: 700px; }
.bar__pass { background: var(--pass-bar); }
.bar__broken { background: var(--bad-bar); }
.bar__unsure { background: var(--unsure-bar); }
.bar__retry { background: var(--amber-bar); }
.segs { display: flex; gap: var(--space-0-5); height: 6px; border-radius: var(--radius-2xs); overflow: hidden; min-width: 120px; flex: 0 1 180px; }
.segs > span { flex: 1; }

/* ---------------------------------------------------------------- pictures */
.shot { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-md); background: var(--stripes); overflow: hidden;
        border: 1px solid var(--line); }
.shot > img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.shot__label { position: absolute; left: var(--space-2); bottom: var(--space-2); max-width: calc(100% - 16px); font: var(--text-2xs) var(--mono);
               background: var(--surface); padding: var(--space-0-5) var(--space-1-5); border-radius: var(--radius-xs); color: var(--ink-2); white-space: nowrap;
               overflow: hidden; text-overflow: ellipsis; }
.shot__pill { position: absolute; top: var(--space-2); left: var(--space-2); }
.shot__play { position: absolute; top: var(--space-1-5); right: var(--space-1-5); width: 24px; height: 24px; border-radius: 50%;
              background: var(--ink); color: var(--on-ink); font-size: var(--text-3xs); display: flex; align-items: center;
              justify-content: center; }
.shot--empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: var(--text-sm); }

/* ---------------------------------------------------------------- projects list */
.app-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-7); padding: var(--space-5) var(--space-5); }
.app-row__name { flex: 1 1 220px; min-width: 0; text-decoration: none; }
.app-row__name strong { display: block; font-weight: var(--weight-semibold); font-size: var(--text-xl); }
.app-row__health { flex: 1 1 260px; display: flex; flex-direction: column; gap: var(--space-2); }
.app-row__counts { display: flex; gap: var(--space-3-5); flex-wrap: wrap; font-size: var(--text-md); font-weight: var(--weight-medium); }
.app-row__last { flex: 0 0 130px; font-size: var(--text-md); color: var(--muted); }
.t-pass { color: var(--pass); }
.t-broken { color: var(--bad); }
.t-unsure { color: var(--unsure); }
.t-amber { color: var(--amber); }

/* ---------------------------------------------------------------- first time */
.hero { max-width: 620px; margin: 0 auto; padding: 16vh var(--space-6) var(--space-30); display: flex; flex-direction: column; gap: var(--space-5); }
.hero h1 { font-size: var(--text-7xl); line-height: 1.1; font-weight: var(--weight-heading); letter-spacing: -0.03em; text-wrap: pretty; }
.hero__sub { font-size: var(--text-2xl); color: var(--ink-2); margin-top: calc(-1 * var(--space-2)); }
.hero form { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.hero .input--xl { flex: 1 1 280px; width: auto; }
.hero__note { font-size: var(--text-md); color: var(--muted); }

/* ---------------------------------------------------------------- setup */
.crumbs { display: flex; gap: var(--space-4); flex-wrap: wrap; font-size: var(--text-sm); color: var(--muted); }
.crumbs__done { color: var(--pass); }
.crumbs__now { color: var(--ink); font-weight: var(--weight-semibold); }
.types { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: var(--space-3-5); }
.type { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.type__name { font-weight: var(--weight-semibold); font-size: var(--text-lg); }
.type__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: calc(-1 * var(--space-1-5)); }
.type__label { display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--muted); }
.type__label .muted { font-weight: var(--weight-regular); }
.type__name input { font-weight: var(--weight-semibold); font-size: var(--text-lg); border: 0; border-bottom: 1px dashed var(--control);
                    padding: 0 0 var(--space-0-5); outline: none; width: 100%; background: none; }
.type__name input:focus { border-bottom-color: var(--ink); }
.type__desc { font-size: var(--text-md); color: var(--muted); }
.type__fields { display: flex; flex-direction: column; gap: var(--space-2); }
.type__signed-out { padding: var(--space-3); border-radius: var(--radius-md); background: var(--hover); font-size: var(--text-md); color: var(--ink-2); }
details.more { border-top: 1px solid var(--line); padding-top: var(--space-4); }
details.more > summary { cursor: pointer; font-weight: var(--weight-medium); color: var(--ink-2); }
details.more[open] > summary { margin-bottom: var(--space-3-5); }
.more__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: var(--space-4); }
.footer-actions { display: flex; gap: var(--space-2-5); justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line);
                  padding-top: var(--space-5); }

/* ---------------------------------------------------------------- exploring */
.lanes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: var(--space-4); }
.lane { padding: var(--space-3-5); display: flex; flex-direction: column; gap: var(--space-2-5); }
.lane__head { display: flex; justify-content: space-between; align-items: center; }
.lane__head strong { font-weight: var(--weight-semibold); }
.lane__status { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--muted); }
.lane__status--live { color: var(--ink); }
.lane__status--done { color: var(--pass); }
.lane__status--no { color: var(--bad); }
.lane__action { font-size: var(--text-md); min-height: var(--control-lg); text-wrap: pretty; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-1-5); }
.thumbs .shot { border-radius: var(--radius-xs); }
.thumbs .shot__label { font-size: var(--text-3xs); left: var(--space-0-5); bottom: var(--space-0-5); padding: 0 var(--space-0-5); }
.lane__count { font-size: var(--text-xs); color: var(--muted); }
.progress-log { margin: 0; padding: 0 0 0 var(--space-4); font-size: var(--text-sm); color: var(--muted); }

/* ---------------------------------------------------------------- project header + tabs */
.project-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.project-head__in { max-width: 1120px; margin: 0 auto; padding: var(--space-6) var(--space-6) 0; display: flex; flex-direction: column;
                    gap: var(--space-4); }
.tabs { display: flex; gap: var(--space-1); overflow-x: auto; margin: 0 calc(-1 * var(--space-2)); scrollbar-width: none; }
.tabs a { flex: none; display: flex; align-items: center; gap: var(--space-1-5); height: var(--control-lg); padding: 0 var(--space-2-5); font-weight: var(--weight-medium);
          white-space: nowrap; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.is-on { color: var(--ink); border-bottom-color: var(--brand); }
.tabs a:hover { color: var(--ink); }
.tabs__count { font-size: var(--text-xs); min-width: 20px; height: 20px; padding: 0 var(--space-1-5); border-radius: var(--radius-lg);
               background: var(--line-2); color: var(--ink-2); display: inline-flex; align-items: center;
               justify-content: center; }
.tabs__alert { width: 7px; height: 7px; border-radius: 50%; background: var(--bad-bar); }
.running-bar { display: flex; align-items: center; gap: var(--space-2-5); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg);
               background: var(--surface); border: 1px solid var(--line); font-size: var(--text-md); }

/* ---------------------------------------------------------------- overview (direction B) */
.summary { padding: var(--space-6) var(--space-7); display: flex; flex-direction: column; gap: var(--space-5); border-radius: var(--radius-2xl); }
.summary__when { font-size: var(--text-sm); color: var(--muted); }
.summary__text { font-size: var(--text-4xl); line-height: 1.38; font-weight: var(--weight-medium); letter-spacing: -0.01em; max-width: 840px;
                 text-wrap: pretty; }
.summary__text .tone-broken { color: var(--bad); font-weight: var(--weight-semibold); }
.summary__text .tone-pass { color: var(--pass); font-weight: var(--weight-semibold); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-3);
         border-top: 1px solid var(--line-2); padding-top: var(--space-4); }
.stat__n { font-size: var(--text-6xl); font-weight: var(--weight-heading); line-height: 1; }
.stat__label { font-size: var(--text-md); color: var(--muted); margin-top: var(--space-1); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: var(--space-4); }
.cards--big { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.cards--small { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: var(--space-3); }
.result { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: var(--space-2);
          display: flex; flex-direction: column; gap: var(--space-2); text-decoration: none; color: var(--ink); }
.result:hover { box-shadow: var(--shadow-hover); color: var(--ink); }
.result--broken { border: 2px solid var(--bad); }
.result--unsure { border: 1.5px dashed var(--faint); }
.result--retry { border-color: var(--amber-line); }
.result--flaky { border-color: var(--amber-line); }
.result--changed { border-color: var(--amber-line); }
.result--small { padding: var(--space-1-5); gap: var(--space-1-5); border-radius: var(--radius-lg); }
.result--small:hover { box-shadow: none; border-color: var(--faint); }
.result__body { padding: 0 var(--space-1) var(--space-1); display: flex; flex-direction: column; gap: var(--space-0-5); }
.result__title { font-weight: var(--weight-semibold); font-size: var(--text-md); line-height: 1.35; }
.result__meta { font-size: var(--text-xs); color: var(--muted); }
.result__reason { font-size: var(--text-sm); color: var(--ink-2); text-wrap: pretty; }
.result--small .result__title { font-size: var(--text-xs); font-weight: var(--weight-regular); }
.result--small .shot { border-radius: var(--radius-sm); }

/* ---------------------------------------------------------------- tables as rows */
.t-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2-5) var(--space-4); padding: var(--space-3-5) var(--space-4); }
.t-row__state { flex: 0 0 160px; display: flex; }
.t-row__main { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-0-5); }
.t-row__main strong { font-weight: var(--weight-medium); }
.t-row__meta { display: flex; gap: var(--space-2-5); flex-wrap: wrap; font-size: var(--text-sm); color: var(--muted); }
.t-row__tools { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.t-row form { margin: 0; }
.rename { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.rename .input { flex: 1 1 260px; height: 34px; border-color: var(--ink); font-size: var(--text-base); }

/* ---------------------------------------------------------------- suggestions */
.suggest { padding: var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-4); }
.suggest--done { opacity: 1; }
.suggest--rejected { opacity: .55; }
.suggest__pic { flex: 1 1 240px; max-width: 320px; }
.suggest__main { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.suggest__tags { display: flex; gap: var(--space-2); flex-wrap: wrap; font-size: var(--text-sm); align-items: center; }
.tag { padding: var(--space-0-5) var(--space-2); border-radius: var(--radius-xs); background: var(--chip); color: var(--ink-2); font-weight: var(--weight-medium); }
.suggest__title { font-size: var(--text-2xl); font-weight: var(--weight-semibold); letter-spacing: -0.01em; line-height: 1.3; text-wrap: pretty; }
.suggest__checks { margin: 0; padding: 0; list-style: none; font-size: var(--text-sm); color: var(--muted);
                   display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); }
.changes { display: flex; flex-direction: column; gap: var(--space-2-5); padding: var(--space-3); border-radius: var(--radius-md); background: var(--panel);
           border: 1px solid var(--panel-line); font-size: var(--text-md); }
.changes__where { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
.suggest__pick { display: inline-flex; align-items: center; gap: var(--space-2); align-self: flex-start;
                 font-size: var(--text-sm); color: var(--ink-2); cursor: pointer; }
.suggest__pick input { width: var(--space-4); height: var(--space-4); margin: 0; accent-color: var(--brand); }
.suggest:has(.suggest__pick input:checked) { border-color: var(--brand-line); }
/* Suggestions: "Add selected as tests" stays in view at the bottom while the cards scroll by */
.bulk { position: sticky; bottom: var(--space-3); z-index: 3; display: flex; flex-wrap: wrap; align-items: center;
        justify-content: space-between; gap: var(--space-2-5) var(--space-4); padding: var(--space-3) var(--space-4);
        background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl);
        box-shadow: var(--shadow-hover); }
.bulk__count { font-size: var(--text-md); color: var(--ink-2); }
.decided { display: flex; gap: var(--space-3); align-items: center; font-size: var(--text-md); }
.decided strong { font-weight: var(--weight-semibold); }
details.dropped { font-size: var(--text-md); color: var(--muted); }
details.dropped summary { cursor: pointer; }
details.dropped ul { margin: var(--space-2-5) 0 0; padding-left: var(--space-4); }

/* ---------------------------------------------------------------- accounts */
.acct { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2-5) var(--space-6); padding: var(--space-4) var(--space-4); }
.acct__who { flex: 1 1 240px; min-width: 0; }
.acct__who strong { font-weight: var(--weight-semibold); display: block; }
.acct__login { flex: 1 1 220px; min-width: 0; font: var(--text-sm) var(--mono); display: flex; flex-direction: column; gap: var(--space-0-5); }
.acct__pass { color: var(--muted); letter-spacing: 0.08em; }
.acct__status { flex: 0 0 190px; font-size: var(--text-sm); }

/* ---------------------------------------------------------------- access grid */
.legend { display: flex; gap: var(--space-4); flex-wrap: wrap; font-size: var(--text-sm); color: var(--ink-2); }
.grid-wrap { overflow-x: auto; }
.grid { min-width: 640px; display: grid; }
.grid__h { padding: var(--space-3); font-size: var(--text-sm); font-weight: var(--weight-semibold); border-bottom: 1px solid var(--line); }
.grid__h--page { padding-left: var(--space-4); color: var(--muted); font-weight: var(--weight-regular); position: sticky; left: 0;
                 background: var(--surface); }
.grid__page { padding: var(--space-2-5) var(--space-4); border-bottom: 1px solid var(--line-2); position: sticky; left: 0;
              background: var(--surface); font: var(--text-sm) var(--mono); display: flex; align-items: center; }
.grid__cell { padding: var(--space-2-5) var(--space-3); border-bottom: 1px solid var(--line-2); display: flex; align-items: center;
              font-size: var(--text-sm); }
.cell--open { font-weight: var(--weight-medium); }
.cell--blocked { background: var(--row-hover); color: var(--muted); }
.cell--problem { background: var(--bad-bg); color: var(--bad); font-weight: var(--weight-bold); }
.cell--unsure { color: var(--unsure); font-style: italic; }
.cell--none { color: var(--faint); }
.cell--expect { color: var(--muted); font-style: italic; }
.cell-edit { cursor: pointer; list-style: none; }
.cell-edit::-webkit-details-marker { display: none; }
.cell-edit:hover { text-decoration: underline; }
.fold > summary { cursor: pointer; }
.fold ul { margin: var(--space-1-5) 0 0; padding-left: var(--space-4); font-size: var(--text-xs); color: var(--muted); }

.access-cards { display: none; flex-direction: column; gap: var(--space-2-5); }
.access-card { padding: var(--space-3) var(--space-3-5); display: flex; flex-direction: column; gap: var(--space-1-5); }
.access-card__page { font: var(--text-sm) var(--mono); font-weight: var(--weight-medium); flex-wrap: nowrap; align-items: flex-start; overflow-wrap: anywhere; }
.access-card__page > .fold { min-width: 0; }
.access-card__row { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--text-sm); }
.access-card__row > span:first-child { color: var(--muted); }
.access-card__row .cell--problem { background: none; padding: 0 var(--space-1-5); border-radius: var(--radius-xs); background: var(--bad-bg); }
@media (max-width: 640px) {
  .access-cards { display: flex; }
  .grid-wrap { display: none; }
}

/* ---------------------------------------------------------------- run history + run */
.run-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-6); padding: var(--space-3-5) var(--space-4);
           text-decoration: none; color: var(--ink); }
.run-row:hover { background: var(--row-hover); color: var(--ink); }
.run-row__id { flex: 0 0 190px; }
.run-row__id strong { font-weight: var(--weight-semibold); display: block; }
.run-row__summary { flex: 1 1 260px; font-size: var(--text-md); font-weight: var(--weight-medium); }
.run-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-4); flex-wrap: wrap; }
.run-head__text { flex: 1 1 420px; display: flex; flex-direction: column; gap: var(--space-1-5); }
.run-head h2 { font-size: var(--text-5xl); line-height: 1.2; font-weight: var(--weight-heading); letter-spacing: -0.02em; text-wrap: pretty; }
.run-head .tone-pass { color: var(--pass); }
.chips { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* ---------------------------------------------------------------- replay */
.replay { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-start; }
.replay__player { flex: 1 1 540px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2-5); }
.replay__screen { position: relative; border-radius: var(--radius-lg); border: 1px solid var(--line); overflow: hidden;
                  background: var(--stripes); aspect-ratio: 16 / 10; }
.replay__screen video, .replay__screen img { width: 100%; height: 100%; object-fit: contain; background: var(--screen); }
.replay__step-no { position: absolute; top: var(--space-2-5); left: var(--space-2-5); font-size: var(--text-xs); font-weight: var(--weight-semibold); background: var(--ink);
                   color: var(--on-ink); padding: var(--space-0-5) var(--space-2); border-radius: var(--radius-xs); }
.replay__controls { display: flex; align-items: center; gap: var(--space-3); }
.replay__play { flex: none; width: 38px; height: var(--control-md); border-radius: 50%; background: var(--ink); color: var(--on-ink); border: 0;
                cursor: pointer; font-size: var(--text-sm); }
.replay__clock { font: var(--text-xs) var(--mono); color: var(--ink-2); white-space: nowrap; }
.track { position: relative; flex: 1; height: 6px; border-radius: var(--radius-2xs); background: var(--line); cursor: pointer; }
.track__fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--radius-2xs); background: var(--ink); width: 0; }
.track__mark { position: absolute; top: 50%; width: 12px; height: 12px; margin: calc(-1 * var(--space-1-5)) 0 0 calc(-1 * var(--space-1-5)); border-radius: 50%;
               border: 2px solid var(--surface); background: var(--faint); cursor: pointer; padding: 0; }
.track__mark.is-past { background: var(--ink); }
.track__mark--broken, .track__mark--broken.is-past { background: var(--bad); }
.track__mark--unsure, .track__mark--unsure.is-past { background: var(--dot-off); }
.track__mark--retry, .track__mark--retry.is-past { background: var(--amber-mark); }
.track__mark--flaky, .track__mark--flaky.is-past { background: var(--amber-mark); }
.track__mark--changed, .track__mark--changed.is-past { background: var(--amber-mark); }
.steps { flex: 1 1 300px; min-width: 0; overflow: hidden; }
.step { display: flex; gap: var(--space-3); width: 100%; text-align: left; padding: var(--space-2-5) var(--space-4); border: 0;
        border-bottom: 1px solid var(--line-2); background: var(--surface); cursor: pointer; }
.step.is-now { background: var(--hover); }
.step.is-now .step__text { font-weight: var(--weight-semibold); }
.step__icon { flex: none; width: 20px; height: 20px; margin-top: var(--space-px); border-radius: 50%; display: flex; align-items: center;
              justify-content: center; font-size: var(--text-2xs); font-weight: var(--weight-bold); color: var(--muted); background: var(--chip); }
.step.is-past .step__icon { color: var(--pass); background: var(--pass-bg); }
.step__icon--broken, .step.is-past .step__icon--broken { color: var(--bad); background: var(--bad-bg); }
.step__icon--unsure, .step.is-past .step__icon--unsure { color: var(--unsure); background: var(--surface);
                                                         border: 1px dashed var(--faint); }
.step__icon--retry, .step.is-past .step__icon--retry { color: var(--amber); background: var(--amber-bg); }
.step__icon--flaky, .step.is-past .step__icon--flaky { color: var(--amber); background: var(--amber-bg); }
.step__icon--changed, .step.is-past .step__icon--changed { color: var(--amber); background: var(--amber-bg); }
.step__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-0-5); }
.step__text { font-size: var(--text-md); }
.step__detail { font-size: var(--text-sm); color: var(--ink-2); text-wrap: pretty; }
.step__detail--broken { color: var(--bad); }
.step__t { flex: none; font: var(--text-xs) var(--mono); color: var(--muted); }
.verdict-note { padding: var(--space-3-5) var(--space-4); border-radius: var(--radius-lg); display: flex; flex-direction: column; gap: var(--space-1); }
.verdict-note strong { font-weight: var(--weight-semibold); }
.verdict-note p { font-size: var(--text-md); color: var(--ink-2); text-wrap: pretty; }
.verdict-note--broken { background: var(--bad-bg); }
.verdict-note--broken strong { color: var(--bad); }
.verdict-note--unsure { background: var(--surface); border: 1px dashed var(--faint); }
.verdict-note--retry { background: var(--amber-bg); }
.verdict-note--retry strong { color: var(--amber); }
.verdict-note--flaky { background: var(--amber-bg); }
.verdict-note--flaky strong { color: var(--amber); }
.verdict-note--changed { background: var(--amber-bg); }
.verdict-note--changed strong { color: var(--amber); }
.verdict-note--notrun { background: var(--chip); }

/* ---------------------------------------------------------------- phone */
@media (max-width: 640px) {
  .top { padding: 0 var(--space-4); }
  .wrap, .project-head__in { padding-left: var(--space-4); padding-right: var(--space-4); }
  .h1, .run-head h2 { font-size: var(--text-4xl); }
  .summary { padding: var(--space-5); }
  .summary__text { font-size: var(--text-2xl); }
  .hero h1 { font-size: var(--text-5xl); }
  .t-row__state { flex-basis: 100%; }
  .app-row__last { flex-basis: auto; }
}
.field--error .input { border-color: var(--bad); box-shadow: var(--focus-ring-bad); }
.field--error { color: var(--bad-ink); }
.field--check > span:first-child { display: flex; align-items: center; gap: var(--space-2); }

/* ---------------------------------------------------------------- live browser (signing in by hand) */
.live { overflow: hidden; }
.live__bar { display: flex; align-items: center; gap: var(--space-1-5); padding: var(--space-2) var(--space-2-5); border-bottom: 1px solid var(--line); }
.live__url { flex: 1; min-width: 0; font-size: var(--text-sm); color: var(--ink-2); background: var(--hover); border-radius: var(--radius-sm);
             padding: var(--space-1-5) var(--space-2-5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live__status { font-size: var(--text-xs); color: var(--muted); white-space: nowrap; }
.live__screen { position: relative; background: var(--screen); cursor: pointer; outline: none; }
.live__screen:focus-within { box-shadow: inset 0 0 0 2px var(--ink); }
.live__screen img { width: 100%; height: auto; display: block; min-height: 240px; }
.live__keys { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0;
              resize: none; }
.live__window { padding: var(--space-7); font-size: var(--text-base); color: var(--ink-2); }
.signed-by-you { font-size: var(--text-sm); color: var(--pass); display: flex; gap: var(--space-2-5); align-items: center; flex-wrap: wrap; }
.or-signin { display: flex; align-items: center; gap: var(--space-2-5); font-size: var(--text-sm); color: var(--muted); }

/* ---------------------------------------------------------------- sections and items (ui.section, ui.item) */
.section { display: flex; flex-direction: column; gap: var(--space-3-5); }
.section__head { display: flex; flex-direction: column; gap: var(--space-1); }
.items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1-5); }
.item { display: flex; align-items: center; gap: var(--space-2-5) var(--space-3); flex-wrap: wrap;
        font-size: var(--text-md); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
        background: var(--hover); overflow-wrap: anywhere; }
.item--suggest { background: none; border: 1px dashed var(--control); padding: var(--space-2-5) var(--space-3); }
.item--quiet { background: none; padding: 0; }
.item__main { flex: 1 1 240px; min-width: 0; }
.item__meta { font-size: var(--text-xs); color: var(--muted); }
.inline-form { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.inline-form .input { flex: 1 1 240px; min-width: 0; width: auto; }
.notice { padding: var(--space-3) var(--space-3-5); border-radius: var(--radius-lg); background: var(--panel);
          border: 1px solid var(--panel-line); color: var(--ink-2); font-size: var(--text-md); }
.env { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--space-2-5);
       padding-bottom: var(--space-3); border-bottom: 1px solid var(--line); }
.env .hint { grid-column: 1 / -1; margin: 0; }

/* ---------------------------------------------------------------- the /design reference page */
.ds-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: var(--space-2-5); }
.ds-swatch { display: flex; flex-direction: column; gap: var(--space-1-5); font-size: var(--text-xs); }
.ds-swatch__chip { height: var(--control-lg); border-radius: var(--radius-md); border: 1px solid var(--line); }
.ds-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.ds-scale { display: flex; flex-direction: column; gap: var(--space-2); }
.ds-scale__row { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-xs); }
.ds-scale__name { flex: 0 0 150px; font-family: var(--mono); color: var(--muted); }
.ds-space { height: var(--space-3); background: var(--ink); border-radius: var(--radius-2xs); }

/* ---------------------------------------------------------------- tests grouped by kind of user */
.user-group { gap: var(--space-2); }
.user-group__head { display: flex; align-items: baseline; gap: var(--space-2-5); flex-wrap: wrap; }
.user-group__head .h3 { margin-top: 0; }
.user-group__counts { font-size: var(--text-sm); color: var(--muted); }
.t-row--watch:hover { background: var(--row-hover); }
.t-row__state { text-decoration: none; }
.t-row__title { color: var(--ink); text-decoration: none; display: inline-flex; align-items: baseline;
                gap: var(--space-2); flex-wrap: wrap; }
.t-row__title:hover strong { text-decoration: underline; text-underline-offset: 2px; }
.t-row__play { font-size: var(--text-xs); color: var(--muted); }
.t-row__title:hover .t-row__play { color: var(--ink); }

/* ---------------------------------------------------------------- moving between pages
   The browser keeps the old page on screen until the new one is ready, then swaps it in one step. No view
   transition: its snapshot of the old page came back over the new one (every page seemed to load twice). A page that
   takes longer than --loader-delay shows the logo loader (app.js). */
.page-loader { position: fixed; inset: 0; z-index: var(--layer-loader); display: grid; place-items: center;
               background: var(--page-veil); opacity: 0; visibility: hidden;
               transition: opacity var(--page-fade), visibility var(--page-fade); }
.page-loader.is-on { opacity: 1; visibility: visible; }
.turbo-progress-bar { display: none; }  /* the logo loader says a page is on its way */
.page-loader:not(.is-on) .logo-loader * { animation: none; }  /* hidden: no work in the background */

/* ---------------------------------------------------------------- the logo as a loader (ui.loader) */
.logo-loader { display: inline-grid; place-items: center; width: var(--loader-md); height: var(--loader-md); }
.logo-loader--sm { width: var(--loader-sm); height: var(--loader-sm); }
.logo-loader--lg { width: var(--loader-lg); height: var(--loader-lg); }
.logo-loader svg { width: 100%; height: 100%; overflow: visible; }
.logo-loader rect { transform-box: fill-box; transform-origin: 50% 100%;
                    animation: logo-stack var(--loader-cycle) ease-in-out infinite both; }
.logo-loader__back { fill: var(--logo-back); }
.logo-loader__mid { fill: var(--logo-mid); animation-delay: calc(var(--loader-cycle) * .1) !important; }
.logo-loader__front { fill: var(--logo-front); animation-delay: calc(var(--loader-cycle) * .2) !important; }
.logo-loader__check { fill: none; stroke: var(--logo-check); stroke-width: 6.5; stroke-linecap: round;
                      stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1;
                      animation: logo-check-loop var(--loader-cycle) ease-in-out infinite both; }
.logo-loader--once rect { animation-iteration-count: 1; }
.logo-loader--once .logo-loader__check { animation-name: logo-check; animation-iteration-count: 1; }
@keyframes logo-stack { 0% { transform: translateY(18%) scale(.9); opacity: 0; } 25%, 100% { transform: none; opacity: 1; } }
@keyframes logo-check { 0%, 35% { stroke-dashoffset: 1; } 60%, 100% { stroke-dashoffset: 0; } }
@keyframes logo-check-loop { 0%, 35% { stroke-dashoffset: 1; } 60%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -1; } }
@media (prefers-reduced-motion: reduce) {
  .logo-loader rect, .logo-loader__check { animation: none !important; }
  .logo-loader__check { stroke-dashoffset: 0; }
}

/* ---------------------------------------------------------------- project shell: sidebar + top bar */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 232px; flex: none; box-sizing: border-box; height: 100vh; position: sticky; top: 0;
           display: flex; flex-direction: column; gap: var(--space-5); padding: var(--space-5) var(--space-3-5);
           background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.sidebar__brand { padding: 0 var(--space-2); }
.sidebar__app { display: flex; flex-direction: column; gap: var(--space-0-5); padding: var(--space-2-5) var(--space-3);
                border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--page);
                text-decoration: none; color: var(--ink); }
.sidebar__app strong { font-weight: var(--weight-semibold); font-size: var(--text-base); overflow-wrap: anywhere; }
.sidebar__app span { font-size: var(--text-xs); color: var(--muted); }
.sidebar__nav, .sidebar__foot { display: flex; flex-direction: column; gap: var(--space-0-5); }
.sidebar__nav a, .sidebar__foot a { display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-2); min-height: var(--control-md); padding: 0 var(--space-3); border-radius: var(--radius-md);
    text-decoration: none; color: var(--ink-2); font-size: var(--text-base); }
.sidebar__nav a:hover, .sidebar__foot a:hover { background: var(--hover); color: var(--ink); }
.sidebar__nav a.is-on, .sidebar__foot a.is-on { background: var(--brand-soft); color: var(--brand);
                                                 font-weight: var(--weight-semibold); }
.sidebar__foot { margin-top: auto; padding-top: var(--space-3-5); border-top: 1px solid var(--line-2); }
.sidebar__foot a { font-size: var(--text-md); min-height: var(--control-sm); }
.sidebar__alert { font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--bad); }
.sidebar__count { min-width: var(--space-5); height: var(--space-5); padding: 0 var(--space-1-5); box-sizing: border-box;
                  border-radius: var(--radius-full); background: var(--ink); color: var(--on-ink);
                  font-size: var(--text-xs); display: inline-flex; align-items: center; justify-content: center; }
.sidebar__quiet { font-size: var(--text-xs); color: var(--muted); }
.shell__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap;
          padding: var(--space-4) var(--page-inline); background: var(--surface); border-bottom: 1px solid var(--line);
          position: sticky; top: 0; z-index: 4; }
.topbar__title { display: flex; flex-direction: column; gap: var(--space-0-5); min-width: 0; }
.topbar__meta { font-size: var(--text-sm); color: var(--muted); overflow-wrap: anywhere; }
.page { width: 100%; max-width: var(--page-max); margin-inline: auto; box-sizing: border-box;
        padding: var(--space-7) var(--space-8) var(--space-30);
        display: flex; flex-direction: column; gap: var(--space-5); }
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; flex-direction: row; align-items: center;
             gap: var(--space-2); padding: var(--space-2-5) var(--page-gutter-phone); overflow-x: auto;
             border-right: 0; border-bottom: 1px solid var(--line); }
  /* every menu item stays reachable: the app switcher, the tabs and the settings links share one scrolling row */
  .sidebar__app, .sidebar__nav, .sidebar__foot { flex: none; }
  .sidebar__nav, .sidebar__foot { flex-direction: row; }
  .sidebar__nav a, .sidebar__foot a { white-space: nowrap; }
  .sidebar__foot { margin-top: 0; padding: 0 0 0 var(--space-2); border-top: 0; border-left: 1px solid var(--line-2); }
  .sidebar__foot a { font-size: var(--text-base); min-height: var(--control-md); }
  .topbar { position: static; padding: var(--space-3) var(--page-gutter-phone); }
  .page { padding: var(--space-5) var(--page-gutter-phone) var(--space-30); }
}

/* ---------------------------------------------------------------- project home */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-6); align-items: start; }
.home__main, .home__side { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
.status { padding: var(--space-6); display: flex; align-items: center; gap: var(--space-7); flex-wrap: wrap;
          border-radius: var(--radius-2xl); }
.status__text { flex: 1 1 320px; display: flex; flex-direction: column; gap: var(--space-1-5); }
.status__sentence { font-size: var(--text-4xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-snug);
                    line-height: var(--leading-snug); text-wrap: pretty; }
.status__sentence .tone-broken { color: var(--bad); }
.status__sentence .tone-pass { color: var(--pass); }
.status__when { font-size: var(--text-sm); color: var(--muted); }
.status__stats { display: flex; gap: var(--space-6); margin: 0; }
.status__stats div { display: flex; flex-direction: column-reverse; }
.status__stats dt { font-size: var(--text-sm); color: var(--muted); }
.status__stats dd { margin: 0; font-size: var(--text-6xl); font-weight: var(--weight-heading); line-height: var(--leading-tight); }
.attn { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3-5) var(--space-4); }
.attn__pic { flex: none; width: 128px; text-decoration: none; }
.attn__pic .shot { border-radius: var(--radius-sm); }
.attn__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.attn__head { display: flex; align-items: center; gap: var(--space-2-5); flex-wrap: wrap; }
.attn__title { font-weight: var(--weight-semibold); color: var(--ink); text-decoration: none; }
.attn__title:hover { text-decoration: underline; text-underline-offset: 2px; }
.attn__meta { font-size: var(--text-sm); color: var(--muted); overflow-wrap: anywhere; }
.attn__reason { font-size: var(--text-sm); color: var(--ink-2); text-wrap: pretty; overflow-wrap: anywhere; }
.attn__reason--broken { color: var(--bad-ink); }
.side-card { display: flex; flex-direction: column; gap: var(--space-3); border-radius: var(--radius-2xl); }
.side-card__title { font-size: var(--text-base); font-weight: var(--weight-semibold); }
.side-card__link { font-size: var(--text-md); color: var(--ink-2); text-decoration: none; }
.side-card__link:hover { color: var(--ink); text-decoration: underline; }
.side-card__addr { font-size: var(--text-sm); overflow-wrap: anywhere; }
.side-card__small { font-size: var(--text-sm); }
.side-card--dark { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.side-card--dark p { font-size: var(--text-md); color: var(--control); }
.usertype { display: flex; flex-direction: column; gap: var(--space-1-5); text-decoration: none; color: var(--ink); }
.usertype__head { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--text-md); }
.usertype__head strong { font-weight: var(--weight-semibold); }
.usertype:hover strong { text-decoration: underline; }
@media (max-width: 900px) {
  .home { grid-template-columns: minmax(0, 1fr); }
  .attn { flex-wrap: wrap; }
  .attn__pic { width: 96px; }
}
@media (max-width: 640px) {
  .attn__pic { display: none; }
  .attn__main { flex-basis: 100%; }
}

/* ---------------------------------------------------------------- tests page: filters, rows, "⋯" menu */
.filters { display: flex; align-items: center; gap: var(--space-2-5); flex-wrap: wrap; }
.filters__search { margin-left: auto; flex: 0 1 240px; }
.filters__search .input { height: var(--control-md); }
.test-row { display: flex; align-items: center; gap: var(--space-3-5); padding: var(--space-2-5) var(--space-3-5); }
.test-row__pic { flex: none; width: 96px; text-decoration: none; }
.test-row__pic .shot { border-radius: var(--radius-xs); }
.test-row__state { flex: none; min-width: 96px; display: flex; }
.test-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-0-5); }
.test-row__title { font-weight: var(--weight-medium); color: var(--ink); text-decoration: none; }
a.test-row__title:hover { text-decoration: underline; text-underline-offset: 2px; }
.test-row__meta { font-size: var(--text-xs); color: var(--muted); overflow-wrap: anywhere; }
.test-row__head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1-5) var(--space-2); min-width: 0; }

/* ---------------------------------------------------------------- importance: critical / important / minor (ui.level) */
.level { display: inline-flex; align-items: center; flex: none; height: var(--pill-height); padding: 0 var(--space-2);
         border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: var(--weight-semibold);
         white-space: nowrap; box-sizing: border-box; margin: 0; vertical-align: middle; }
.level--critical { background: var(--ink); color: var(--on-ink); }
.level--important { background: var(--chip); color: var(--ink-2); }
.level--minor { background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.level-pick { position: relative; padding: 0; }
.level-pick select { appearance: none; -webkit-appearance: none; height: 100%; border: 0; margin: 0; cursor: pointer;
                     padding: 0 var(--space-5) 0 var(--space-2); border-radius: inherit; background: transparent;
                     color: inherit; font: inherit; }
.level-pick select:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.level-pick option { color: var(--ink); background: var(--surface); }
.level-pick__caret { position: absolute; right: var(--space-2); pointer-events: none; font-size: var(--text-2xs); }
.level-pick noscript .btn { margin-left: var(--space-1); }
.level-why { margin: 0; font-size: var(--text-sm); color: var(--muted); text-wrap: pretty; }
.result__meta .level { height: auto; padding: 0 var(--space-1-5); margin-right: var(--space-1); }
.status__levels { margin: 0; font-size: var(--text-md); color: var(--ink-2); font-weight: var(--weight-medium); }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__list { position: absolute; right: 0; top: calc(100% + var(--space-1)); z-index: 3; min-width: 180px;
              display: flex; flex-direction: column; padding: var(--space-1); background: var(--surface);
              border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-hover); }
.menu__list form { margin: 0; }
.menu__item { display: flex; width: 100%; align-items: center; min-height: var(--control-sm); padding: 0 var(--space-2-5);
              border: 0; border-radius: var(--radius-sm); background: none; font-size: var(--text-md); color: var(--ink);
              text-align: left; text-decoration: none; cursor: pointer; box-sizing: border-box; }
.menu__item:hover { background: var(--hover); color: var(--ink); }
.menu__item--bad { color: var(--bad); }
.menu__item:disabled { color: var(--faint); cursor: default; }
@media (max-width: 640px) {
  .test-row { flex-wrap: wrap; gap: var(--space-2-5); }
  .test-row__pic { display: none; }
  .test-row__main { order: -1; flex-basis: 100%; }
  .test-row__state { min-width: 0; margin-right: auto; }
  .filters__search { margin-left: 0; flex-basis: 100%; }
}

/* ---------------------------------------------------------------- first-time setup (onboarding) */
.ob-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap;
          padding: var(--space-3-5) var(--space-10); background: var(--surface); border-bottom: 1px solid var(--line); }
.ob-top__note { font-size: var(--text-md); color: var(--muted); }
.rail { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.rail__step { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-md); color: var(--muted); }
.rail__step + .rail__step::before { content: ""; width: var(--space-8); height: 1px; background: var(--control); }
.rail__step--now { color: var(--ink); font-weight: var(--weight-semibold); }
.rail__step--done { color: var(--pass); }
.rail__step a { color: inherit; }
.rail__dot { flex: none; width: var(--pill-height); height: var(--pill-height); border-radius: var(--radius-full);
             border: 1px solid var(--control); display: inline-flex; align-items: center; justify-content: center;
             font-size: var(--text-xs); color: var(--muted); box-sizing: border-box; }
.rail__step--now .rail__dot, .rail__dot--now { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.rail__step--done .rail__dot, .rail__dot--done { background: var(--pass-bg); border-color: var(--pass-bg); color: var(--pass); }
.ob { max-width: 1200px; margin: 0 auto; box-sizing: border-box; padding: var(--space-12) var(--space-10) var(--space-30);
      display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-12); align-items: start; }
.ob__main { display: flex; flex-direction: column; gap: var(--space-6); max-width: 720px; }
.ob__intro { display: flex; flex-direction: column; gap: var(--space-2-5); }
.ob__step { font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--muted); text-transform: uppercase;
            letter-spacing: 0.04em; }
.ob__title { font-size: var(--text-7xl); line-height: var(--leading-tight); font-weight: var(--weight-heading);
             letter-spacing: var(--tracking-tight); text-wrap: pretty; }
.ob__lede { font-size: var(--text-xl); line-height: var(--leading-body); color: var(--ink-2); text-wrap: pretty; }
.ob__form { display: flex; flex-direction: column; gap: var(--space-2-5); }
.ob__form .input--xl { flex: 1 1 320px; width: auto; }
.ob__label { font-size: var(--text-md); font-weight: var(--weight-semibold); }
.ob__aside { display: flex; flex-direction: column; gap: var(--space-3-5); position: sticky; top: var(--space-6); }
.ob__actions { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.ob__add { margin-top: var(--space-2); }
.promises { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--space-3-5); }
.promise { display: flex; flex-direction: column; gap: var(--space-2); }
.promise strong { font-size: var(--text-base); font-weight: var(--weight-semibold); }
.promise span { font-size: var(--text-md); line-height: var(--leading-body); color: var(--ink-2); }
.guide { display: flex; flex-direction: column; gap: var(--space-2-5); border-radius: var(--radius-2xl); }
.guide p { font-size: var(--text-md); line-height: var(--leading-body); color: var(--ink-2); }
.guide__title { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.guide__steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.guide__steps li { display: flex; gap: var(--space-3); }
.guide__steps li div { display: flex; flex-direction: column; gap: var(--space-0-5); }
.guide__steps strong { font-size: var(--text-md); font-weight: var(--weight-semibold); }
.guide__steps span:not(.rail__dot) { font-size: var(--text-md); color: var(--muted); line-height: var(--leading-snug); }
.guide--quiet { display: block; padding: var(--space-4) var(--space-5); background: var(--chip); font-size: var(--text-md);
                color: var(--ink-2); overflow-wrap: anywhere; }
.looking { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-lg); }
.list__label { padding: var(--space-3-5) var(--space-5); font-size: var(--text-sm); font-weight: var(--weight-semibold);
               color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.found { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5); flex-wrap: wrap; }
.found--signin { border-radius: var(--radius-2xl); }
.found__n, .found__ok { flex: none; width: var(--control-md); height: var(--control-md); border-radius: var(--radius-md);
                        background: var(--chip); display: flex; align-items: center; justify-content: center;
                        font-weight: var(--weight-bold); font-size: var(--text-sm); }
.found__ok { border-radius: var(--radius-full); background: var(--pass-bg); color: var(--pass); }
.found__main { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-0-5); overflow-wrap: anywhere; }
.found__main .mono { font-size: var(--text-base); }
.found__title { font-size: var(--text-base); font-weight: var(--weight-semibold); }
.found__why { font-size: var(--text-md); color: var(--muted); }
.found__tag { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--muted); }
.found__change { flex-basis: 100%; }
.found__change[open] > summary { margin-bottom: var(--space-2); }
.found__change > summary, .ob__actions details > summary { list-style: none; cursor: pointer; }
.who { display: flex; flex-direction: column; gap: var(--space-3-5); border-radius: var(--radius-2xl); }
.who--visitor { flex-direction: row; align-items: center; padding: var(--space-3-5) var(--space-4); }
.who__icon { width: var(--control-md); height: var(--control-md); border-radius: var(--radius-full); background: var(--chip);
             display: flex; align-items: center; justify-content: center; flex: none; }
.who__main { flex: 1; display: flex; flex-direction: column; }
.who__main span { font-size: var(--text-md); color: var(--muted); }
.who__ready { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.who__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.who__name { flex: 1; }
.who__name input { font-size: var(--text-xl); font-weight: var(--weight-semibold); border: 0;
                   border-bottom: 1px dashed var(--control); padding: 0 0 var(--space-0-5); outline: none; background: none;
                   width: 100%; }
.who__name input:focus { border-bottom-color: var(--ink); }
.who__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--space-3); }
.who__alt { font-size: var(--text-sm); color: var(--muted); }
.who__add { align-items: center; }
.chip-add { display: inline-flex; align-items: center; height: var(--control-md); padding: 0 var(--space-3-5);
            border-radius: var(--radius-full); border: 1px dashed var(--faint); background: var(--surface);
            color: var(--ink); text-decoration: none; font-size: var(--text-md); }
.chip-add:hover { border-color: var(--ink); color: var(--ink); }
.check { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3) var(--space-3-5);
         border-radius: var(--radius-lg); background: var(--hover); font-size: var(--text-md); }
.check__text { flex: 1 1 240px; overflow-wrap: anywhere; }
.check--ok { background: var(--pass-bg); color: var(--ink); }
.check--ok > span:first-child { color: var(--pass); font-weight: var(--weight-bold); }
.check--bad { background: var(--bad-bg); color: var(--bad-ink); }
.check--busy { color: var(--ink-2); }
.stages { list-style: none; margin: 0; display: flex; align-items: flex-start; gap: var(--space-6); flex-wrap: wrap; }
.stages__item { display: flex; gap: var(--space-2-5); align-items: flex-start; }
.stages__item div { display: flex; flex-direction: column; gap: var(--space-0-5); }
.stages__item strong { font-size: var(--text-md); font-weight: var(--weight-semibold); }
.stages__item span:not(.rail__dot) { font-size: var(--text-sm); color: var(--muted); }
.stages__item--next strong { color: var(--muted); }
.stages__next { margin-left: auto; align-self: center; font-size: var(--text-md); color: var(--ink-2); }
@media (max-width: 900px) {
  .ob { grid-template-columns: minmax(0, 1fr); padding: var(--space-6) var(--page-gutter-phone) var(--space-30);
        gap: var(--space-6); }
  .ob__aside { position: static; }
  .ob-top { padding: var(--space-3) var(--page-gutter-phone); }
  .rail__step + .rail__step::before { width: var(--space-3); }
  .ob__title { font-size: var(--text-5xl); }
  .stages__next { margin-left: 0; }
}

/* ---------------------------------------------------------------- app logos and the apps page */
.logo { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center;
        width: var(--control-md); height: var(--control-md); border-radius: var(--radius-md); background: var(--ink);
        color: var(--on-ink); font-weight: var(--weight-bold); font-size: var(--text-base); overflow: hidden; }
.logo img:not(.is-ready) { visibility: hidden; }  /* no broken-image flash while it loads (app.js) */
.logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--surface);
            box-sizing: border-box; padding: var(--space-1); }
.logo--sm { width: var(--space-6); height: var(--space-6); border-radius: var(--radius-sm); font-size: var(--text-xs); }
.logo--sm img { padding: var(--space-0-5); }
.logo--lg { width: var(--space-12); height: var(--space-12); border-radius: var(--radius-xl); font-size: var(--text-3xl); }
.logo--lg img { padding: var(--space-1-5); border: 1px solid var(--line); border-radius: var(--radius-xl); }
.sidebar__app { flex-direction: row; align-items: center; gap: var(--space-2-5); }
.sidebar__app-name { display: flex; flex-direction: column; gap: var(--space-0-5); min-width: 0; }
.sidebar__section { display: flex; flex-direction: column; gap: var(--space-1-5); }
.sidebar__heading { padding: 0 var(--space-3); font-size: var(--text-xs); font-weight: var(--weight-semibold);
                    color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.sidebar__nav a.sidebar__applink { justify-content: flex-start; gap: var(--space-2-5); }
.sidebar__applabel { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {  /* the app switcher in the phone menu row: one line, name first */
  .sidebar__app { padding: var(--space-1-5) var(--space-2-5); gap: var(--space-2); }
  .sidebar__app-name { flex-direction: row; align-items: baseline; gap: var(--space-1-5); white-space: nowrap; }
  .sidebar__app strong { overflow-wrap: normal; }
}
.dot { flex: none; width: var(--space-2); height: var(--space-2); border-radius: var(--radius-full); }
.dot--pass { background: var(--pass-bar); }
.dot--broken { background: var(--bad-bar); }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--space-4); }
.app-card { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5);
            border-radius: var(--radius-2xl); }
.app-card--broken { border-color: var(--bad-line); }
.app-card__head { display: flex; align-items: center; gap: var(--space-3-5); text-decoration: none; color: var(--ink); }
.app-card__name { display: flex; flex-direction: column; gap: var(--space-0-5); min-width: 0; }
.app-card__name strong { font-size: var(--text-xl); font-weight: var(--weight-semibold); }
.app-card__head:hover strong { text-decoration: underline; text-underline-offset: 2px; }
.app-card__name .mono { font-size: var(--text-sm); color: var(--muted); overflow-wrap: anywhere; }
.app-card__health { display: flex; flex-direction: column; gap: var(--space-2); min-height: var(--control-md); }
.app-card__counts { display: flex; gap: var(--space-3-5); flex-wrap: wrap; font-size: var(--text-md);
                    font-weight: var(--weight-medium); }
.app-card__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
                  flex-wrap: wrap; margin-top: auto; padding-top: var(--space-3-5); border-top: 1px solid var(--line-2);
                  font-size: var(--text-md); }
.app-card--add { align-items: center; justify-content: center; text-align: center; gap: var(--space-2);
                 border: 1.5px dashed var(--control); background: none; color: var(--ink); text-decoration: none;
                 min-height: 200px; }
.app-card--add:hover { border-color: var(--ink); color: var(--ink); background: var(--surface); }
.app-card__plus { width: var(--space-10); height: var(--space-10); border-radius: var(--radius-full);
                  background: var(--chip); display: flex; align-items: center; justify-content: center;
                  font-size: var(--text-3xl); }

/* ---------------------------------------------------------------- a run, live */
.live-hero { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-5);
             border-radius: var(--radius-2xl); }
.live-hero--done { border-color: var(--pass-bar); }
.live-hero--broken { border-color: var(--bad-line); }
.live-hero__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-5); flex-wrap: wrap; }
.live-hero__text { display: flex; flex-direction: column; gap: var(--space-1-5); min-width: 0; }
.live-hero__eyebrow { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm);
                      font-weight: var(--weight-semibold); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.live-hero__headline { font-size: var(--text-5xl); line-height: var(--leading-tight); font-weight: var(--weight-heading);
                       letter-spacing: var(--tracking-tight); text-wrap: pretty; }
.live-hero--broken .live-hero__headline { color: var(--bad); }
.live-hero--done:not(.live-hero--broken) .live-hero__headline { color: var(--pass); }
.live-hero__clock { display: flex; flex-direction: column; align-items: flex-end; font-size: var(--text-sm); color: var(--muted); }
.live-hero__clock span:first-child { font-family: var(--mono); font-size: var(--text-4xl); color: var(--ink);
                                     font-variant-numeric: tabular-nums; }
.live-bar { display: flex; gap: var(--space-0-5); height: var(--space-2-5); border-radius: var(--radius-full); overflow: hidden; }
.live-bar__seg { flex: 1; background: var(--line-2); transition: background-color .4s ease; }
.live-bar__seg--running { background: var(--ink); animation: live-pulse 1.2s ease-in-out infinite; }
.live-bar__seg--passed { background: var(--pass-bar); }
.live-bar__seg--retry { background: var(--amber-bar); }
.live-bar__seg--changed { background: var(--amber-bar); }
.live-bar__seg--failed { background: var(--bad-bar); }
.live-bar__seg--not_checked, .live-bar__seg--not_run { background: var(--unsure-bar); }
.live-counts { display: flex; gap: var(--space-8); flex-wrap: wrap; margin: 0; }
.live-counts div { display: flex; flex-direction: column-reverse; }
.live-counts dt { font-size: var(--text-sm); color: var(--muted); }
.live-counts dd { margin: 0; font-size: var(--text-6xl); font-weight: var(--weight-heading); line-height: var(--leading-tight);
                  font-variant-numeric: tabular-nums; }
.live-counts dd.is-bumped { animation: live-bump .5s ease; }
.live-phases { list-style: none; margin: 0; padding: var(--space-4) 0 0; border-top: 1px solid var(--line-2);
               display: flex; gap: var(--space-6); flex-wrap: wrap; }
.live-phases__step { display: flex; align-items: center; gap: var(--space-2-5); font-size: var(--text-md);
                     font-weight: var(--weight-semibold); }
.live-phases__step--next { color: var(--muted); font-weight: var(--weight-regular); }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: var(--space-4); }
.live-tile { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-xl);
             transition: border-color .3s ease, box-shadow .3s ease, opacity .3s ease; }
.live-tile--queued { opacity: .6; }
.live-tile--running { border-color: var(--ink); box-shadow: var(--focus-ring); }
.live-tile--passed, .live-tile--retry { border-color: var(--pass-bar); }
.live-tile--failed { border: 2px solid var(--bad); }
.live-tile--not_checked, .live-tile--not_run { border-style: dashed; border-color: var(--faint); }
.live-tile.is-flipped { animation: live-flip .6s ease; }
.live-tile__screen { position: relative; display: block; aspect-ratio: 16 / 10; background: var(--stripes);
                     border-bottom: 1px solid var(--line); overflow: hidden; }
.live-tile__screen img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.live-tile__pill { position: absolute; top: var(--space-2); left: var(--space-2); }
.live-tile--running .live-tile__screen::after { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(180deg, transparent 0 40%, var(--pass-glow-0) 40%, var(--pass-glow) 50%, var(--pass-glow-0) 60%, transparent 60%);
    background-size: 100% 300%; animation: live-scan 2.4s linear infinite; }
.live-tile__body { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) var(--space-3-5); }
.live-tile__body strong { font-size: var(--text-md); font-weight: var(--weight-semibold); line-height: var(--leading-snug); }
.live-tile__meta { font-size: var(--text-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.live-tile__detail { font-size: var(--text-xs); color: var(--bad-ink); text-wrap: pretty; }
.live-tile__detail:empty { display: none; }
.live-access { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3) var(--space-4);
               font-size: var(--text-md); }
.live-access strong { font-weight: var(--weight-semibold); }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes live-bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes live-flip { 0% { transform: scale(.97); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
@keyframes live-scan { from { background-position: 0 100%; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .live-bar__seg--running, .live-counts dd.is-bumped, .live-tile.is-flipped,
  .live-tile--running .live-tile__screen::after { animation: none; }
}

/* ---------------------------------------------------------------- tabs per kind of user (ui.user_tabs) */
.utabs { display: flex; gap: var(--space-1); overflow-x: auto; border-bottom: 1px solid var(--line);
         scrollbar-width: none; }
.utabs__tab { flex: none; display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--control-lg);
              padding: 0 var(--space-3-5); margin-bottom: -1px; border-bottom: 2px solid transparent;
              color: var(--muted); text-decoration: none; font-size: var(--text-base); font-weight: var(--weight-medium); }
.utabs__tab:hover { color: var(--ink); }
.utabs__tab.is-on { color: var(--ink); border-bottom-color: var(--brand); font-weight: var(--weight-semibold); }
.utabs__count { min-width: var(--space-5); height: var(--space-5); padding: 0 var(--space-1-5); box-sizing: border-box;
                border-radius: var(--radius-full); background: var(--chip); color: var(--ink-2); font-size: var(--text-xs);
                display: inline-flex; align-items: center; justify-content: center; }
.utabs__tab.is-on .utabs__count { background: var(--brand); color: var(--on-brand); }
.utabs__count--attention, .utabs__tab.is-on .utabs__count--attention { background: var(--amber-bg); color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber-line); }

/* ---------------------------------------------------------------- a finished test pops up during a run (Tests page) */
.toasts { position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: var(--layer-toast);
          display: flex; flex-direction: column-reverse; gap: var(--space-2); width: min(var(--toast-width), calc(100vw - 2 * var(--space-4))); }
.toast { display: grid; grid-template-columns: var(--toast-shot) 1fr auto; gap: var(--space-3); align-items: center;
         padding: var(--space-2-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
         box-shadow: var(--toast-shadow); animation: toast-in .25s ease-out; }
.toast--broken { border-color: var(--bad); }
.toast__shot { width: var(--toast-shot); aspect-ratio: 16 / 10; border-radius: var(--radius-sm); background: var(--chip);
               object-fit: cover; object-position: top; }
.toast__body { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.toast__title { font-weight: var(--weight-semibold); color: var(--ink); text-decoration: none; overflow: hidden;
                text-overflow: ellipsis; white-space: nowrap; }
.toast__title:hover { text-decoration: underline; }
.toast__meta { color: var(--muted); font-size: var(--text-xs); }
.toast__close { align-self: start; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: var(--text-base); }
.toast__close:hover { color: var(--ink); }
.test-row.is-updated { animation: row-flash 1.2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(var(--space-2)); } to { opacity: 1; transform: none; } }
@keyframes row-flash { from { background: var(--chip); } to { background: transparent; } }

/* ---------------------------------------------------------------- the way back, top of every page (ui.back) */
.topbar__title { display: flex; flex-direction: column; gap: var(--space-0-5); }
.topbar__back:empty { display: none; }
.topbar__back .back { font-size: var(--text-sm); }

/* ---------------------------------------------------------------- a replay in a pop-up over the run report */
.modal { width: min(var(--modal-width), calc(100vw - 2 * var(--space-4))); max-height: calc(100vh - 2 * var(--space-4));
         padding: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--page);
         box-shadow: var(--toast-shadow); overflow: auto; }
.modal::backdrop { background: var(--backdrop); }
.modal[open] { display: flex; flex-direction: column; gap: var(--space-4); }
.modal__head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.modal__close { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: var(--text-lg); }
.modal__close:hover { color: var(--ink); }
.modal__shot { width: 100%; height: auto; max-height: calc(100vh - 12rem); object-fit: contain; object-position: top center;
               border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--stripes); }
.shot-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; text-align: left; }

/* ---------------------------------------------------------------- onboarding: previous and next together */
.ob__nav { display: inline-flex; gap: var(--space-2); flex-wrap: wrap; }

/* ---------------------------------------------------------------- usage & credits */
.tallies { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--stat-min), 1fr)); gap: var(--space-3-5); }
.tally { display: flex; flex-direction: column; gap: var(--space-1); }
.tally__label { color: var(--muted); font-size: var(--text-sm); }
.tally__value { font-size: var(--text-4xl); font-weight: var(--weight-semibold); color: var(--ink); line-height: 1.1; }
.tally__sub { color: var(--muted); font-size: var(--text-sm); }
.tally__list { display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--text-sm); }
.tally__list > span, .tally__list > a { display: flex; justify-content: space-between; gap: var(--space-3); }
.tally__list > a { color: inherit; }
.tally__list > a:hover { text-decoration: underline; }
.ledger__row { display: grid; grid-template-columns: var(--ledger-when) 1fr var(--ledger-num) var(--ledger-tokens) var(--ledger-num) var(--ledger-credits); gap: var(--space-3);
               align-items: center; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--line);
               font-size: var(--text-sm); }
.ledger__row:first-child { border-top: 0; }
.ledger--kinds .ledger__row, .ledger--jobs .ledger__row { grid-template-columns: var(--ledger-columns); }
.ledger--grants .ledger__row { grid-template-columns: var(--ledger-when) 1fr var(--ledger-credits); }
.ledger__row--head { color: var(--muted); font-size: var(--text-xs); }
.ledger__what { display: flex; flex-direction: column; gap: var(--space-0-5); min-width: 0; }
@media (max-width: 900px) {
  .ledger__row { grid-template-columns: 1fr auto; }
  .ledger__row > :nth-child(3), .ledger__row > :nth-child(4), .ledger__row > :nth-child(5) { display: none; }
  .ledger__row > :first-child { grid-column: 1 / -1; color: var(--muted); }
}

/* ---------------------------------------------------------------- passwords shown after a password-change test (_who.html) */
.reveal { display: grid; gap: var(--space-2); padding: var(--space-3); border: 1px dashed var(--amber-line);
          border-radius: var(--radius-md); background: var(--amber-bg); }
.reveal .row { display: flex; gap: var(--space-2); }
.reveal .input { flex: 1; min-width: 0; }
