/* The admin home (owner 28.11): /admin and /admin/prepay, grown from the direction mocks. The clinic's admin family:
   Odoo's design language (the brain's layer-5-coding/odoo/design-language.md, § numbers below; spacing from
   previs-polish-rules-2026-11-02.md) with the navy and blue accent the owner kept for the HR admin (28.11).
   Tokens are the HR admin's (surgeon-cv/app/static/admin.css), value for value. */

/* ---- tokens (§2) ---- */
:root {
  --ink: #212529; --body: #495057; --muted: #6c757d; --faint: #adb5bd;
  --ground: #f8f9fa; --surface: #fff; --track: #e9ecef; --line: #dee2e6;
  --accent: #152642; --accent-hover: #0f1d33; --accent-press: #0a1424;
  --accent-50: #f3f6fa; --accent-100: #e9eef5; --accent-300: #aabfd8;
  --link: #3f66ad; --mark: #3f66ad; --mark-soft: #c9d6ea;
  --ok-ink: #0a3622; --ok-bg: #d1e7dd; --ok: #198754;
  --warn-ink: #664d03; --warn-bg: #fff3cd;
  --bad-ink: #58151c; --bad-bg: #f8d7da; --bad: #dc3545;
  --raised: 0 1px 2px rgba(33, 37, 41, .16), 0 0 0 .5px rgba(33, 37, 41, .06);
  --floating: 0 10px 28px rgba(33, 37, 41, .16), 0 0 0 1px rgba(33, 37, 41, .06);
  --ease: cubic-bezier(.3, .7, .2, 1);
  --ctl: 34px; --inset: 16px; --panel: 440px;
}
@media (max-width: 640px) { :root { --ctl: 40px; --inset: 12px; } }

/* ---- base (§3: one font, 14/21 base) ---- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 14px; line-height: 21px;
}
a { color: inherit; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tnum { font-variant-numeric: tabular-nums; }
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }

/* ---- the top strip (§9) ---- */
.strip {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: stretch; gap: 20px; height: 46px;
  padding: 0 max(16px, calc((100% - 1168px) / 2)); background: var(--surface); border-bottom: 1px solid var(--line);
}
.strip-app { display: flex; align-items: center; font-size: 15px; font-weight: 600; text-decoration: none; }
.strip-menu { display: flex; gap: 20px; min-width: 0; }
.strip-menu a {
  display: flex; align-items: center; color: var(--body); font-weight: 500; text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 -2px 0 transparent;
}
.strip-menu a:hover { color: var(--ink); }
.strip-menu a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.strip-icon { align-self: center; margin-left: auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--body); }
.strip-icon:hover { background: var(--track); color: var(--ink); }
.page { max-width: 1200px; margin: 0 auto; padding: 16px 16px 48px; transition: margin .28s var(--ease); }
@media (max-width: 640px) {
  .strip { gap: 16px; padding: 0 12px; }
  .page { padding: 12px 12px 32px; }
}

/* ---- buttons, chips, counts (§6) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--ctl); padding: 0 12px;
  border: 0; border-radius: 8px; background: var(--track); color: var(--ink); font-size: 14px; font-weight: 500;
  text-decoration: none; white-space: nowrap; transition: background .2s;
}
.btn:hover { background: var(--line); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-icon { width: var(--ctl); padding: 0; flex: none; }
.btn-ghost { background: none; color: var(--body); }
.btn-ghost:hover { background: var(--track); color: var(--ink); }
.btn.on { box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-100); }
.link { color: var(--link); text-decoration: none; background: none; border: 0; padding: 0; }
.link:hover { text-decoration: underline; }
.chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px;
  font-size: 13px; line-height: 20px; font-weight: 500; white-space: nowrap; background: var(--track); color: var(--body);
}
.chip-accent { background: var(--accent-100); color: var(--accent-press); }
.chip-success { background: var(--ok-bg); color: var(--ok-ink); }
.chip-warning { background: var(--warn-bg); color: var(--warn-ink); }
.chip-danger { background: var(--bad-bg); color: var(--bad-ink); }
.chip-muted { background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--track); color: var(--body); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.count:empty { display: none; }
.count.bad { background: var(--bad-bg); color: var(--bad-ink); }
.count.zero { color: var(--faint); background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.kicker { font-size: 13px; line-height: 20px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--body); }

/* ---- the control row: the period (§8), then the two filters ---- */
.ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.when { display: flex; align-items: center; gap: 8px; }
.seg {
  position: relative; isolation: isolate; display: inline-grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  height: var(--ctl); padding: 3px; border-radius: 8px; background: var(--track);
}
.seg-thumb {
  position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n));
  border-radius: 6px; background: var(--surface); box-shadow: var(--raised);
  transform: translateX(calc(var(--at, 0) * 100%)); transition: transform .28s var(--ease), opacity .2s;
}
.seg.none .seg-thumb { opacity: 0; }
.seg-btn {
  z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; padding: 0 12px;
  border: 0; border-radius: 6px; background: transparent; color: var(--body); font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: color .28s var(--ease);
}
.seg-btn:hover, .seg-btn.on { color: var(--ink); }
.dp-btn, .sel {
  display: inline-flex; align-items: center; gap: 8px; height: var(--ctl); padding: 0 12px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500; white-space: nowrap;
}
.dp-btn.on, .sel.on { border-color: var(--accent); }
.filters { display: flex; gap: 8px; }
.sel { position: relative; padding: 0; }
.sel select { appearance: none; -webkit-appearance: none; height: 100%; padding: 0 32px 0 12px; border: 0; border-radius: 8px; background: none; font-weight: 500; max-width: 220px; text-overflow: ellipsis; }
.sel svg { position: absolute; right: 10px; pointer-events: none; color: var(--body); }
#filter-toggle { display: none; }
@media (max-width: 640px) {
  .ctl { gap: 8px; margin-bottom: 8px; }
  .when { width: 100%; }
  .when .seg { flex: none; }
  .when .seg-btn { padding: 0 8px; }
  .dp-btn { flex: 1; min-width: 0; justify-content: center; padding: 0 8px; }
  .dp-btn svg { display: none; }           /* §7: the dates button drops its icon first */
  #filter-toggle { display: inline-flex; }
  .filters { display: none; width: 100%; }
  .filters.open { display: grid; grid-template-columns: 1fr 1fr; }
  .sel select { width: 100%; max-width: none; }
}

/* ---- the sheet: one white plane per surface (§6) ---- */
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sheet + .sheet, .qline + .sheet, .sheet + .cols { margin-top: 8px; }
.sheet-head { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 var(--inset); border-bottom: 1px solid var(--line); }
.sheet-head .kicker { flex: 1; min-width: 0; }

/* ---- the send queue, one line (an exception is red, nothing open is quiet) ---- */
.qline {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: var(--ctl); padding: 0 var(--inset); margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--body); text-align: left; font-weight: 500;
}
.qline b { color: var(--ink); font-weight: 600; }
.qline.bad { border-color: transparent; background: var(--bad-bg); color: var(--bad-ink); }
.qline.bad b { color: var(--bad-ink); }
.qline .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.qline.bad .dot { background: var(--bad); }
.qline .go { margin-left: auto; }
.qline:disabled { cursor: default; }

/* ---- people rows (the list of §6: name, one meta line, a chip only where it says something) ---- */
.people li + li, .grp + .grp { border-top: 1px solid var(--line); }
.prow {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 0; align-items: center; width: 100%;
  padding: 8px var(--inset); border: 0; background: none; text-align: left; transition: background .2s;
}
.prow:hover { background: var(--ground); }
.prow.picked { background: var(--accent-50); box-shadow: inset 2px 0 0 var(--accent); }
.prow:focus-visible { outline-offset: -2px; }
.p-name { font-size: 15px; line-height: 22px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-name.anon { font-weight: 400; color: var(--body); }
.p-sub { grid-column: 1; color: var(--body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-when { grid-column: 2; justify-self: end; color: var(--muted); font-size: 13px; line-height: 20px; white-space: nowrap; }
.p-tags { display: flex; gap: 4px; justify-self: end; }
.more { display: block; width: 100%; height: 44px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--link); font-weight: 500; }
.more:hover { background: var(--ground); }
.empty { padding: 32px 24px; text-align: center; color: var(--body); }
.empty b { display: block; font-size: 15px; line-height: 22px; font-weight: 500; color: var(--ink); margin-bottom: 8px; }
.day, .grp-head {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 var(--inset); border: 0; background: var(--ground);
  color: var(--body); font-size: 13px; line-height: 20px; font-weight: 500; text-align: left;
}
.day { border-bottom: 1px solid var(--line); }
li + .day, li + li > .day { border-top: 1px solid var(--line); }
.grp-head { height: 44px; background: var(--surface); font-size: 15px; line-height: 22px; color: var(--ink); }
.grp-head:hover { background: var(--ground); }
.grp-head .g-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-head .g-of { color: var(--muted); font-size: 13px; font-weight: 400; white-space: nowrap; }
.grp-head .g-n { min-width: 32px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.car { color: var(--muted); transition: transform .28s var(--ease); }
[aria-expanded="true"] > .car, [aria-expanded="true"] .car.turn { transform: rotate(180deg); }
.grp-body { border-top: 1px solid var(--line); background: var(--surface); }
.gbar { width: 72px; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; flex: none; }
.gbar i { display: block; height: 100%; border-radius: 3px; background: var(--mark); }

/* ---- the drill-down: a bottom sheet on a phone, a docked side panel on a desktop (§13c: do it from the screen you are on) ---- */
.scrim { position: fixed; inset: 0; z-index: 8; background: rgba(33, 37, 41, .4); opacity: 0; transition: opacity .28s ease-out; }
.scrim.in { opacity: 1; }
.panel {
  position: fixed; z-index: 9; display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--floating);
  right: 0; top: 46px; bottom: 0; width: var(--panel); transform: translateX(24px); opacity: 0;
  transition: transform .28s ease-out, opacity .28s ease-out;
}
.panel.in { transform: none; opacity: 1; }
.panel[hidden], .scrim[hidden] { display: none; }
.panel-grab { display: none; }
.panel-head { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); }
.panel-title { flex: 0 1 auto; min-width: 0; font-size: 18px; line-height: 24px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-head .count { margin-right: auto; }
.panel-head .btn-icon { margin-left: auto; }
.panel-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; --inset: 16px; }
.panel-sub { padding: 8px 16px; border-bottom: 1px solid var(--line); color: var(--body); }
.back { position: relative; flex: none; width: 34px; height: 34px; border: 0; border-radius: 8px; background: var(--track); }
.back:hover { background: var(--line); }
.back::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -2px;
  border-left: 2px solid var(--body); border-bottom: 2px solid var(--body); transform: rotate(45deg);
}
.back[hidden] { display: none; }
@media (min-width: 961px) {
  .scrim { display: none !important; }
  body.has-panel .page { margin-right: var(--panel); max-width: none; }
  body.has-panel .strip { padding-right: calc(var(--panel) + 16px); padding-left: 16px; }
}
@media (max-width: 960px) {
  .panel {
    top: auto; left: 0; right: 0; width: auto; max-height: 86dvh; min-height: 40dvh; border-radius: 12px 12px 0 0;
    transform: translateY(24px);
  }
  .panel-grab { display: block; width: 36px; height: 4px; margin: 8px auto 0; border-radius: 2px; background: var(--line); }
  .panel-head { padding-left: 12px; }
  .panel-body { --inset: 12px; padding-bottom: env(safe-area-inset-bottom); }
  .panel-sub { padding: 8px 12px; }
}

/* ---- one patient in the panel ---- */
.person { padding: 12px var(--inset) 24px; }
.p-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.p-at { margin-left: 4px; color: var(--muted); font-size: 13px; }
.kv { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; }
.kv div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 8px 12px; }
.kv div + div { border-top: 1px solid var(--line); }
.kv dt { color: var(--body); }
.kv dd { font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
.p-send { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; padding: 12px; border-radius: 8px; background: var(--bad-bg); color: var(--bad-ink); }
.p-send-text { flex: 1 1 200px; display: flex; flex-direction: column; }
.person .kicker { margin: 24px 0 4px; }
.qa li { display: flex; flex-direction: column; padding: 8px 0; }
.qa li + li { border-top: 1px solid var(--line); }
.qa .q { color: var(--body); font-size: 13px; line-height: 20px; }
.qa .a { font-size: 15px; line-height: 22px; }
.qa li.off { opacity: .5; }
.p-full { display: inline-block; margin-top: 16px; font-weight: 500; }

/* ---- the queue in the panel ---- */
.qrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; align-items: center; padding: 8px var(--inset); }
.qrow + .qrow { border-top: 1px solid var(--line); }
.qrow .p-name { cursor: pointer; }
.qrow .q-err { grid-column: 1; color: var(--bad-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow .q-err.wait { color: var(--body); }
.qrow form { grid-column: 2; grid-row: 1 / 3; }
.panel-foot { display: flex; gap: 8px; padding: 12px var(--inset); border-top: 1px solid var(--line); }
.panel-foot .btn { flex: 1; }

/* ---- screens in the panel and on the page («Де відпадають») ---- */
.scr { display: grid; grid-template-columns: 24px minmax(0, 1fr) 72px 40px 16px; column-gap: 8px; align-items: center; width: 100%; min-height: 44px; padding: 4px var(--inset); border: 0; background: none; text-align: left; }
.scr:hover:not(:disabled) { background: var(--ground); }
.scr:disabled { cursor: default; }
.scr + .scr, li + li > .scr { border-top: 1px solid var(--line); }
.scr .s-i { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.scr .s-t { font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
.scr .s-m { display: block; color: var(--muted); font-size: 13px; line-height: 20px; }
.scr .s-n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.scr .s-n.zero { color: var(--faint); font-weight: 400; }
.scr.top .gbar i { background: var(--bad); }

/* =====================================================================================================
   D · Матриця: entries down, steps across; every number opens its people
   ===================================================================================================== */
.mx-head, .mx-nums { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mx-head { padding: 8px 4px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--body); font-size: 13px; line-height: 16px; font-weight: 500; }
.mx-head span { padding: 0 6px; text-align: right; align-self: end; }
.mx-head .c-name { display: none; text-align: left; }
.mx-head .wide, .mx-nums .wide { display: none; }
.mx-row + .mx-row { border-top: 1px solid var(--line); }
.mx-name { display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 4px var(--inset) 0; border: 0; background: none; text-align: left; font-size: 15px; line-height: 22px; font-weight: 600; }
.mx-name .car { margin-left: auto; }
.mx-nums { padding: 0 4px 4px; }
.cell { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 0; min-height: 40px; padding: 4px 6px; border: 0; border-radius: 6px; background: none; font-size: 16px; line-height: 24px; font-variant-numeric: tabular-nums; }
button.cell:hover { background: var(--accent-100); }
.cell.on { background: var(--accent-100); box-shadow: inset 0 0 0 1px var(--accent-300); }
.cell.na { color: var(--faint); }
.cell.zero { color: var(--muted); }
.cell .of { display: none; color: var(--muted); font-size: 13px; line-height: 16px; font-weight: 400; }
.cell .mbar { width: 100%; height: 3px; border-radius: 2px; background: var(--track); overflow: hidden; }
.cell .mbar i { display: block; height: 100%; margin-left: auto; border-radius: 2px; background: var(--mark); }
.cell.key { font-weight: 600; }
.mx-more { border-top: 1px solid var(--line); background: var(--ground); padding: 8px 0 12px; }
.mx-more .kicker { padding: 8px var(--inset) 4px; }
.kvn { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; width: 100%; min-height: 34px; padding: 4px var(--inset); border: 0; background: none; text-align: left; }
button.kvn:hover { background: var(--track); }
.kvn span { color: var(--body); }
.kvn b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kvn b small { margin-left: 8px; color: var(--muted); font-size: 13px; font-weight: 400; }
.mx-more .scr { grid-template-columns: minmax(0, 1fr) 72px 40px 16px; }
.mx-more .scr .s-i { display: none; }
.mx-more .link { margin: 8px var(--inset) 0; font-weight: 500; }
.mx-more .lost { display: block; }
/* the expanded entry (owner 28.11): a strip of what the row does not show, then the funnel by question */
.ms-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0 var(--inset) 8px; border-radius: 8px; overflow: hidden; background: var(--line); box-shadow: 0 0 0 1px var(--line); }
.ms { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: 8px 12px; border: 0; background: var(--surface); text-align: left; }
button.ms:hover { background: var(--track); }
.ms small { color: var(--muted); font-size: 12px; line-height: 16px; }
.ms b { color: var(--ink); font-size: 15px; line-height: 20px; font-weight: 600; }
.qf { margin: 4px 0 0; }
.qf .fn-row { padding-top: 8px; padding-bottom: 8px; }
.qf .fn-bar { height: 14px; margin: 4px 0 6px; }
.qf .fn-l { font-size: 14px; line-height: 20px; }
.qf .qf-t { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.qf .fn-row.info .qf-t, .qf .fn-row.info .fn-n { color: var(--muted); font-weight: 400; }
.qf .fn-row.info .fill { background: var(--mark-soft); }
.qf .fn-n { font-size: 15px; }
.qf-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 8px; }
.qf-legend { padding: 0 var(--inset) 4px; color: var(--muted); font-size: 12px; line-height: 16px; }
.qf-legend span:last-child { text-align: right; }
.qf .fn-row { column-gap: 8px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto 16px; }
.qf .fn-m small { display: none; }
.qf .fn-m b { font-size: 13px; line-height: 18px; font-weight: 400; color: var(--body); }
.qf .fn-row.worst .fn-f b { font-weight: 600; }
@media (min-width: 961px) {
  .mx-head, .mx-row > .mx-line { display: grid; grid-template-columns: minmax(220px, 1.6fr) repeat(9, minmax(0, 1fr)); align-items: center; padding: 0 8px; }
  .mx-head { padding-top: 8px; padding-bottom: 8px; }
  .mx-head .c-name, .mx-head .wide { display: block; }
  .mx-head .c-name { padding: 0 8px; align-self: end; }
  .mx-nums { display: contents; }
  .mx-nums .wide { display: flex; }
  .mx-name { height: auto; min-height: 56px; padding: 0 8px; }
  .mx-name .car { margin-left: 0; order: -1; }
  .cell { min-height: 44px; justify-content: center; font-size: 15px; line-height: 22px; }
  .cell { gap: 0; }
  .cell .of { display: block; }
  .mx-more { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; padding: 8px 16px 16px 32px; }
  .mx-more .only-phone { display: none; }
  .mx-more.mx-detail { display: block; padding: 12px 16px 16px 32px; }
  .ms-strip { display: flex; flex-wrap: wrap; margin: 0 0 12px; }
  .ms { flex: 1 1 140px; }
  .ms.only-phone { display: none; }
  .qf .kicker { padding-left: 0; }
  .qf-legend { display: none; }
  .qf .fn-m b { font-size: 14px; }
  .qf .fn-cols, .qf .fn-row { grid-template-columns: minmax(200px, 1.6fr) minmax(0, 1fr) 64px 88px 112px 128px 16px; padding: 0 8px; }
  .qf .fn-row { height: auto; min-height: 36px; }
  .qf .qf-t { -webkit-line-clamp: 1; }
  .qf .fn-l { flex-direction: row; align-items: baseline; gap: 0 8px; }
  .qf .fn-bar { height: 16px; margin: 0; justify-content: flex-start; }
  body.has-panel .mx-more { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 961px) and (max-width: 1500px) {
  body.has-panel .mx-head .opt, body.has-panel .mx-nums .opt { display: none; }
  body.has-panel .mx-head, body.has-panel .mx-row > .mx-line { grid-template-columns: minmax(160px, 1.4fr) repeat(6, minmax(0, 1fr)); }
}

/* =====================================================================================================
   E · Стрічка: the people are the page; the counts are its views
   ===================================================================================================== */
.e-wrap { display: block; }
.e-entries { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 8px; padding: 0 12px; }
.e-entries::-webkit-scrollbar { display: none; }
.e-rail .kicker { display: none; }
.pick {
  display: inline-flex; align-items: center; gap: 8px; flex: none; height: var(--ctl); padding: 0 12px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--body); font-weight: 500; white-space: nowrap;
}
.pick.on { border-color: var(--accent); background: var(--accent); color: #fff; }
.pick.on .count { background: rgba(255, 255, 255, .18); color: #fff; }
.e-views { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.view {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 0; min-width: 0; padding: 8px 12px; border: 0; background: none; text-align: left;
  box-shadow: inset 0 -2px 0 transparent; transition: background .2s, box-shadow .28s var(--ease);
}
.view:nth-child(n+4) { border-top: 1px solid var(--line); }
.view:not(:nth-child(3n+1)) { border-left: 1px solid var(--line); }
.view:hover { background: var(--ground); }
.view .v-n { font-size: 24px; line-height: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.view .v-l { max-width: 100%; color: var(--body); font-size: 13px; line-height: 16px; font-weight: 500; }
.view.on { background: var(--accent-50); box-shadow: inset 0 -2px 0 var(--accent); }
.view.on .v-l { color: var(--ink); }
.view.bad .v-n { color: var(--bad); }
.view.zero .v-n { color: var(--faint); }
.e-steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 8px 0; border-bottom: 1px solid var(--line); background: var(--ground); }
.e-steps div { display: flex; flex-direction: column; min-width: 0; padding: 0 12px; }
.e-steps div + div { border-left: 1px solid var(--line); }
.e-steps b { font-size: 16px; line-height: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.e-steps span { color: var(--body); font-size: 13px; line-height: 16px; }
.e-tools { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 var(--inset); border-bottom: 1px solid var(--line); }
.e-tools .t { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e-tools .seg { height: 34px; }
@media (min-width: 961px) {
  .e-wrap { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 16px; align-items: start; }
  .e-rail { position: sticky; top: 62px; display: flex; flex-direction: column; gap: 16px; }
  .e-rail .kicker { display: block; padding: 0 12px 4px; }
  .e-entries, .e-views { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; overflow: visible; border: 0; }
  .pick, .view {
    display: flex; flex-direction: row; align-items: center; justify-content: space-between; width: 100%; height: 34px; padding: 0 12px;
    border: 0 !important; border-radius: 8px; background: none; box-shadow: none; color: var(--body); font-size: 14px;
  }
  .pick:hover, .view:hover { background: var(--track); }
  .pick.on, .view.on { background: var(--accent-100); color: var(--ink); box-shadow: none; }
  .pick.on .count { background: var(--surface); color: var(--ink); }
  .view .v-n { order: 2; font-size: 14px; line-height: 21px; font-weight: 500; }
  .view .v-l { font-size: 14px; line-height: 21px; color: inherit; white-space: nowrap; }
  .view.bad .v-l { color: var(--bad-ink); }
}

/* =====================================================================================================
   F · Воронка: one entry, every step from the view to the money, the loss written between the steps
   ===================================================================================================== */
.tabs { display: flex; gap: 4px; margin: 0 -12px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 40px; padding: 0 12px; margin-bottom: -1px; border: 1px solid transparent; border-bottom: 0;
  border-radius: 8px 8px 0 0; background: none; color: var(--body); font-size: 15px; font-weight: 500; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.on { border-color: var(--line); background: var(--surface); color: var(--ink); }
.tabs + .f-top { border: 1px solid var(--line); border-top: 0; background: var(--surface); padding: 8px var(--inset); margin-bottom: 8px; border-radius: 0 0 12px 12px; }
.f-top .qline { margin: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: start; }
.step { display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; column-gap: 8px; align-items: center; width: 100%; padding: 8px var(--inset) 4px; border: 0; background: none; text-align: left; }
button.step:hover { background: var(--ground); }
.step .st-l { font-size: 15px; line-height: 22px; font-weight: 500; }
.step .st-n { font-size: 18px; line-height: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.step .st-n small { margin-right: 8px; color: var(--muted); font-size: 13px; font-weight: 400; }
.step .fbar { grid-column: 1 / -1; height: 8px; margin: 4px 0; border-radius: 4px; background: var(--track); overflow: hidden; }
.step .fbar i { display: block; height: 100%; min-width: 2px; border-radius: 4px; background: var(--mark); }
.step.pay .fbar i { background: var(--accent); }
.step.last .fbar i { background: var(--ok); }
.loss { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 28px; padding: 0 var(--inset) 0 calc(var(--inset) + 12px); border: 0; background: none; color: var(--body); font-size: 13px; line-height: 20px; text-align: left; }
.loss::before { content: ""; align-self: stretch; width: 0; margin-left: -12px; margin-right: 4px; border-left: 2px dotted var(--faint); }
.loss b { color: var(--bad-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.loss .l-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.loss:hover { background: var(--ground); }
.aside { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 4px var(--inset) 4px; padding: 8px 12px; border-radius: 8px; background: var(--ground); color: var(--body); }
.aside b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.f-break { border-top: 1px solid var(--line); margin-top: 8px; }
.src { display: grid; grid-template-columns: minmax(0, 1fr) 72px 56px 56px; column-gap: 8px; align-items: center; width: 100%; min-height: 44px; padding: 0 var(--inset); border: 0; background: none; text-align: left; }
.src + .src { border-top: 1px solid var(--line); }
button.src:hover { background: var(--ground); }
.src.on { background: var(--accent-50); box-shadow: inset 2px 0 0 var(--accent); }
.src.h { min-height: 34px; color: var(--body); font-size: 13px; font-weight: 500; border-bottom: 1px solid var(--line); }
.src .n { text-align: right; font-variant-numeric: tabular-nums; }
.src .s-t { font-size: 15px; }
@media (min-width: 961px) {
  .tabs { margin: 0; padding: 0; overflow: visible; }
  .tab { padding: 0 16px; }
  .cols { grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; }
  body.has-panel .cols { grid-template-columns: minmax(0, 1fr); }
  .step { grid-template-columns: 220px minmax(0, 1fr) 96px 16px; padding: 8px var(--inset); }
  .step .fbar { grid-column: 2; grid-row: 1; margin: 0; height: 12px; }
  .step .st-n { grid-column: 3; text-align: right; }
  .loss { padding-left: calc(var(--inset) + 220px + 8px); }
  .loss::before { display: none; }
  .aside { margin-left: calc(var(--inset) + 220px + 8px); }
}

/* ---- the mock's own label, not part of any direction ---- */
.mock-tag { align-self: center; margin-left: auto; }
.mock-tag + .strip-icon { margin-left: 0; }
.loading { padding: 32px; text-align: center; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- placement the three directions share between a phone and a desktop ---- */
.go { color: var(--muted); }
.e-desk { display: none; }
.day-li + li, li + .day-li { border-top: 0; }
.day-li:not(:first-child) .day { border-top: 1px solid var(--line); }
.step .st-l { grid-column: 1; grid-row: 1; }
.step .st-n { grid-column: 2; grid-row: 1; }
.step .go { grid-column: 3; grid-row: 1; width: 16px; }
.step .fbar { grid-row: 2; }
.f-fall { padding: 4px 0 8px; }
.tabs + .cols > .sheet:first-child { border-top: 0; border-radius: 0 0 12px 12px; }
.f-side { display: grid; gap: 8px; }
.f-allscr { display: none; }
.sheet-head .link { font-weight: 500; }
@media (min-width: 961px) {
  .e-desk { display: block; }
  .e-phone { display: none; }
  .step .fbar { grid-column: 2; grid-row: 1; }
  .step .st-n { grid-column: 3; }
  .step .go { grid-column: 4; }
  .f-side { padding-top: 16px; gap: 16px; }
  .f-top5, .f-all { display: none; }
  .f-allscr { display: block; }
  body.has-panel .f-side { padding-top: 0; }
}
@media (max-width: 640px) { .mock-name { display: none; } }
.cell.zero, .cell.na { font-weight: 400; }
@media (max-width: 640px) { .grp-head .gbar { width: 48px; } }
@media (min-width: 961px) { .f-side > .sheet:last-child { order: -1; } }

/* ---- a 320-360 px phone: the dates take their own row, the matrix keeps four columns ---- */
@media (max-width: 370px) {
  .when { flex-wrap: wrap; }
  .when .seg { flex: 1; }
  .dp-btn { flex: 1 0 calc(100% - 48px); order: 3; }
  #filter-toggle { order: 2; }
  .mx-head, .mx-nums { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mx-head .s360, .mx-nums .s360 { display: none; }
  .mx-head span { padding: 0 2px; letter-spacing: -.02em; }
  .mx-head, .mx-nums { padding-left: 4px !important; padding-right: 4px !important; }
  .cell { padding: 4px 2px; }
  .mx-head, .mx-nums { padding-left: 8px; padding-right: 8px; }
  .src { grid-template-columns: minmax(0, 1fr) 56px 56px; }
  .src .gbar, .src.h span:nth-child(2) { display: none; }
}
.strip-app { white-space: nowrap; }
@media (max-width: 370px) { .mock-tag { display: none; } .strip-icon { margin-left: auto !important; } }
@media (min-width: 371px) and (max-width: 640px) { .mx-head span { padding: 0 2px; } .cell { padding: 4px 2px; } .mx-head, .mx-nums { padding-left: 10px; padding-right: 10px; } }

/* ---- round 2b, after the owner's two reference videos (28.11): colour arrives through small charts, a count
   with a time dimension gets a chart, the quiet actions and the definitions stay out of sight until wanted ---- */
.spark { display: inline-flex; align-items: flex-end; gap: 1px; width: 64px; height: 20px; margin-left: auto; flex: none; border-bottom: 1px solid var(--line); }
.spark i { flex: 1; min-width: 1px; border-radius: 1px 1px 0 0; background: var(--mark); }
.mx-name .spark + .car { margin-left: 8px; }
.mx-head .c-spark { display: none; }
.edot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; }
.pick > span:first-child { display: inline-flex; align-items: center; }
.day { justify-content: space-between; }
.mx-head span[title], .st-l[title] { text-decoration: underline dotted var(--faint); text-underline-offset: 3px; cursor: help; }
.copy { display: inline-grid; place-items: center; width: 28px; height: 28px; margin: -4px 0 -4px 4px; border: 0; border-radius: 6px; background: none; color: var(--muted); vertical-align: middle; opacity: 0; transition: opacity .12s, background .2s; }
.kv div:hover .copy, .copy:focus-visible, .copy.done { opacity: 1; }
.copy:hover { background: var(--track); color: var(--ink); }
.copy.done { color: var(--ok); }
@media (hover: none) { .copy { opacity: 1; } }
.path { margin: 4px 0 0; }
.path li { position: relative; display: flex; justify-content: space-between; gap: 12px; min-height: 28px; padding: 4px 0 4px 20px; }
.path li::before { content: ""; position: absolute; left: 3px; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--mark); }
.path li::after { content: ""; position: absolute; left: 6px; top: 20px; bottom: -8px; width: 2px; background: var(--line); }
.path li.last::after { display: none; }
.path li.last::before { background: var(--mark); }
.path li.ok::before { background: var(--ok); box-shadow: none; }
.path time { color: var(--muted); font-size: 13px; white-space: nowrap; }
.path .pt-l { font-size: 15px; line-height: 20px; }
.daychart { padding: 8px var(--inset) 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.dc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dc-head .seg { height: 34px; }
.dc-head .seg-btn { padding: 0 10px; }
.dc-head .seg-btn:disabled { color: var(--faint); cursor: not-allowed; }
.dc-bars { display: flex; align-items: flex-end; gap: 6px; height: 96px; margin-top: 12px; border-bottom: 1px solid var(--line); }
.dc-bars.dense { gap: 2px; }
.dc-bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; padding: 0; border: 0; background: none; }
.dc-bar i { display: block; border-radius: 4px 4px 0 0; background: var(--mark); transition: background .2s; }
.dc-bars.dense .dc-bar i { border-radius: 2px 2px 0 0; }
button.dc-bar:hover i { background: var(--accent); }
.dc-n { text-align: center; color: var(--body); font-size: 13px; line-height: 20px; }
.dc-bars.dense .dc-n { display: none; }
.dc-x { display: flex; justify-content: space-between; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 20px; }
.src { grid-template-columns: minmax(0, 1fr) 72px 48px 40px 56px; }
.src .pc { color: var(--body); }
@media (min-width: 961px) {
  .mx-head, .mx-row > .mx-line { grid-template-columns: minmax(220px, 1.6fr) repeat(9, minmax(0, 1fr)) 112px; }
  .mx-head .c-spark { display: block; grid-column: 11; grid-row: 1; text-align: right; }
  .mx-line { position: relative; }
  .mx-name .spark { position: absolute; right: 16px; top: 50%; width: 88px; height: 24px; margin-top: -12px; }
}
@media (min-width: 961px) and (max-width: 1500px) {
  body.has-panel .mx-head, body.has-panel .mx-row > .mx-line { grid-template-columns: minmax(216px, 1.6fr) repeat(6, minmax(0, 1fr)) 112px; }
}
@media (max-width: 370px) { .src { grid-template-columns: minmax(0, 1fr) 48px 40px 52px; } .spark { width: 48px; } }
.dc-head .kicker { white-space: nowrap; }
@media (max-width: 640px) { .dc-head .seg-btn { padding: 0 8px; } }
@media (min-width: 961px) { body.has-panel .tabs { overflow-x: auto; } }

/* =====================================================================================================
   Воронка (round 3, owner 28.11: «the main thing for me is to see the funnel»): one entry's steps as a
   centred funnel with the count, the share of the views, the share of the step before and the fall-off;
   the conversions over time under it; D's matrix of every entry below.
   ===================================================================================================== */
body[data-dir="funnel"] .mock-tag, body[data-dir="prepay"] .mock-tag { display: none; }
body[data-dir="funnel"] .strip-icon, body[data-dir="prepay"] .strip-icon { margin-left: auto; }
.fn-picks { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 8px; padding: 0 12px; }
.fn-picks::-webkit-scrollbar { display: none; }
.fn-pick {
  flex: none; height: var(--ctl); padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  color: var(--body); font-weight: 500; white-space: nowrap; transition: background .2s, color .2s;
}
.fn-pick:hover { color: var(--ink); }
.fn-pick.on { border-color: var(--accent); background: var(--accent); color: #fff; }
.fn-when { color: var(--muted); font-size: 13px; white-space: nowrap; }
.fn-cols { display: none; }
.fn-rows { padding: 4px 0 8px; }
.fn-row {
  position: relative; display: grid; grid-template-columns: max-content max-content minmax(0, 1fr) auto 16px; column-gap: 16px;
  grid-template-areas: "l l l n go" "bar bar bar bar bar" "v p f f f"; align-items: center; padding: 10px var(--inset);
}
.fn-hit { position: absolute; inset: 0; z-index: 2; border: 0; padding: 0; background: none; transition: background .2s; }
.fn-hit:hover { background: rgba(21, 38, 66, .04); }
.fn-hit:focus-visible { outline-offset: -2px; }
.fn-row.on { background: var(--accent-50); box-shadow: inset 2px 0 0 var(--accent); }
.fn-l { grid-area: l; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; min-width: 0; font-size: 15px; line-height: 22px; font-weight: 500; }
.fn-l span[title] { text-decoration: underline dotted var(--faint); text-underline-offset: 3px; }
.fn-scr { position: relative; z-index: 3; font-size: 13px; line-height: 20px; font-weight: 500; white-space: nowrap; }
.fn-n { grid-area: n; justify-self: end; font-size: 18px; line-height: 24px; font-weight: 600; }
.fn-row > .go { grid-area: go; margin-left: -8px; }
.fn-bar { grid-area: bar; position: relative; display: flex; justify-content: center; height: 24px; margin: 6px 0 8px; }
.fn-bar .fill { position: relative; z-index: 1; height: 100%; border-radius: 4px; background: var(--mark); }
.fn-bar .fill:not([style="width:0%"]) { min-width: 3px; }
.fn-bar .ghost { position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); border-radius: 4px; background: var(--mark-soft); }
.fn-row.worst .ghost { background: var(--bad-bg); }
.fn-bar .join { display: none; }
.fn-m { display: flex; flex-direction: column; min-width: 0; }
.fn-v { grid-area: v; } .fn-p { grid-area: p; } .fn-f { grid-area: f; align-items: flex-end; text-align: right; }
.fn-m small { color: var(--muted); font-size: 13px; line-height: 16px; white-space: nowrap; }
.fn-m b { font-size: 15px; line-height: 24px; font-weight: 600; white-space: nowrap; }
.fn-f.none b { color: var(--muted); font-weight: 400; }
.fn-row.worst .fn-f small { color: var(--bad-ink); font-weight: 500; }
.fn-row.worst .fn-f b { padding: 0 8px; border-radius: 6px; background: var(--bad-bg); color: var(--bad-ink); }
.fn-row.first { grid-template-areas: "l l l n go" "bar bar bar bar bar"; }
.fn-row.first .fn-m { display: none; }
.fn-all { margin: 24px 4px 8px; }
.fn-in { color: var(--muted); font-size: 13px; line-height: 16px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fn-in[title], .fn-sum[title] { position: relative; z-index: 3; }
.fn-sum { color: var(--accent); font-size: 13px; line-height: 16px; font-weight: 600; white-space: nowrap; }
.fn-note { margin: 0; padding: 10px var(--inset) 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 20px; }
.fn-row.na .fn-bar { border-radius: 4px; background: repeating-linear-gradient(135deg, var(--track) 0 6px, transparent 6px 12px); box-shadow: inset 0 0 0 1px var(--line); }
.fn-row.na .fn-n { color: var(--faint); }
body[data-dir="prepay"] .sel:has(#f-ad) { display: none; }
.mx-row.cur { box-shadow: inset 2px 0 0 var(--accent); }
@media (min-width: 961px) {
  .fn-picks { margin: 0 0 12px; padding: 0; overflow: visible; flex-wrap: wrap; }
  .fn-cols, .fn-row { display: grid; grid-template-columns: 216px minmax(0, 1fr) 80px 104px 128px 168px 16px; column-gap: 12px; align-items: center; padding: 0 var(--inset); }
  .fn-cols { height: 40px; border-bottom: 1px solid var(--line); color: var(--body); font-size: 13px; line-height: 16px; font-weight: 500; }
  .fn-cols .r { text-align: right; }
  .fn-rows { padding: 8px 0; }
  .fn-row, .fn-row.first { grid-template-areas: none; height: 52px; }
  .fn-row > * { grid-area: auto; }
  .fn-row > .go { grid-area: auto; margin: 0; }
  .fn-row.first .fn-m { display: flex; }
  .fn-l { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; gap: 0; }
  .fn-bar { margin: 0; }
  .fn-bar .ghost { display: none; }
  .fn-bar .join { display: block; position: absolute; left: 0; right: 0; top: 100%; height: 28px; background: var(--accent-100); }
  .fn-bar .join.bad { background: var(--bad-bg); }
  .fn-m { align-items: flex-end; text-align: right; }
  .fn-m small { display: none; }
  .fn-row.worst .fn-f small { display: block; }
  .fn-m b { line-height: 22px; }
  .fn-v b, .fn-p b { font-weight: 400; }
  body.has-panel .fn-cols, body.has-panel .fn-row { grid-template-columns: 176px minmax(0, 1fr) 64px 96px 120px 156px 16px; }
}

/* ---- the conversions over time: one % axis, thin lines, recessive grid ---- */
.tr { overflow: visible; }
.tr-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; padding: 10px var(--inset) 0; }
.tr-keys { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.tr-key { display: inline-flex; align-items: center; gap: 6px; color: var(--body); white-space: nowrap; }
.tr-key i, .tt-r i { width: 14px; height: 2px; border-radius: 1px; flex: none; }
.tr-key b { color: var(--ink); font-weight: 600; }
.tr-plot { position: relative; margin: 8px 0 4px; padding: 0; touch-action: pan-y; cursor: crosshair; }
.tr-plot { margin-left: calc(var(--inset) - 12px); margin-right: calc(var(--inset) - 12px); }
.tr-svg { display: block; fill: none; stroke: none; width: 100%; height: auto; }
.tr-svg .grid { stroke: var(--track); stroke-width: 1; }
.tr-svg .cross { stroke: var(--faint); stroke-width: 1; }
.tr-svg .cross[hidden] { display: none; }
.tr-svg .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tr-svg .end { stroke: var(--surface); stroke-width: 2; }
.tr-svg circle { stroke: none; }
.tr-svg circle.low { fill: var(--surface); stroke-width: 1.5; stroke-dasharray: 2 2; opacity: .7; }
.tr-svg .tick { fill: var(--muted); stroke: none; font-size: 13px; font-variant-numeric: tabular-nums; }
.tr-tip { position: absolute; top: 8px; z-index: 2; padding: 8px 12px; border-radius: 6px; background: var(--surface); box-shadow: var(--floating); pointer-events: none; white-space: nowrap; }
.tr-tip[hidden] { display: none; }
.tt-d { color: var(--muted); font-size: 13px; line-height: 20px; font-variant-numeric: tabular-nums; }
.tt-r { display: flex; align-items: center; gap: 6px; color: var(--body); font-size: 13px; line-height: 20px; font-variant-numeric: tabular-nums; }
.tt-r b { color: var(--ink); font-size: 14px; font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 640px) {             /* a phone: the fall-off takes its own line under the two shares */
  .fn-row { grid-template-areas: "l l l n go" "bar bar bar bar bar" "v p p p p" "f f f f f"; }
  .fn-f { flex-direction: row; justify-content: space-between; align-items: center; margin-top: 4px; }
  .sheet-head { height: auto; min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
}
@media (max-width: 960px) {
  .qf .fn-row:not(.first) { grid-template-areas: "l l l n go" "bar bar bar bar bar" "v p f f f"; }
  .qf .fn-f { margin-top: 0; justify-content: flex-end; }
}

/* ---- the real admin (28.11): the dates, the strip on a phone, the devices of the expanded entry ---- */
.ctl { position: relative; }
.dp-pop { position: absolute; z-index: 6; top: calc(var(--ctl) + 8px); left: 0; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; max-width: calc(100vw - 24px); padding: 12px; border-radius: 12px; background: var(--surface); box-shadow: var(--floating); }
.dp-pop[hidden] { display: none; }
.dp-pop label { display: grid; gap: 4px; min-width: 0; color: var(--body); font-size: 13px; line-height: 16px; }
.dp-pop input { min-width: 0; height: var(--ctl); padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
.dp-pop .btn { height: var(--ctl); }
.devs { margin: 0 var(--inset); border-radius: 8px; }
@media (max-width: 640px) {
  .strip-app { display: none; }
  .strip-menu { flex: 1; gap: 16px; overflow-x: auto; scrollbar-width: none; padding-right: 24px;
                -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
                mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
  .strip-menu::-webkit-scrollbar { display: none; }
  .dp-pop { right: 0; }
  .dp-pop label { flex: 1 1 120px; }
  .dp-pop .btn { flex: 1 0 100%; }
}
/* the trend's table for screen readers: an auto-layout table ignores width: 1px and widened a 390 px page */
table.sr { table-layout: fixed; }

/* =====================================================================================================
   Every other admin page (29.11): the funnel home's components on the list, detail, queue, storyboard,
   test, message and login pages. One component for one job; what is here only places them.
   ===================================================================================================== */
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: var(--ctl); margin-bottom: 12px; }
.h-title { font-size: 20px; line-height: 28px; font-weight: 600; }
.h-note { color: var(--muted); font-size: 13px; line-height: 20px; font-weight: 400; overflow-wrap: anywhere; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.sub { margin-bottom: 12px; color: var(--body); }
.notice { margin-bottom: 8px; padding: 8px var(--inset); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--body); }
.narrow { max-width: 640px; margin-left: auto; margin-right: auto; }
a.btn { color: var(--ink); }
a.btn-primary { color: #fff; }
.btn[disabled], .btn.off { opacity: .45; cursor: default; }
.btn-primary[disabled]:hover { background: var(--accent); }
a.fn-pick { display: inline-flex; align-items: center; text-decoration: none; }
a.fn-pick.on:hover { color: #fff; }

/* ---- the filters of a list page: the home's control row, a search box beside the selects ---- */
.ctl-form { display: contents; }
.search { display: inline-flex; align-items: center; gap: 8px; height: var(--ctl); padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.search:focus-within { border-color: var(--accent); }
.search svg { color: var(--muted); }
.search input { width: 240px; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; }
@media (max-width: 640px) {
  .ctl-form > .filters { order: 2; }
  .search { order: 1; width: 100%; }
  .search input { flex: 1; width: auto; font-size: 16px; }   /* 16: iOS does not zoom the page on focus */
}

/* ---- the list: the home's people rows as links; a desktop lays one row on one line ---- */
a.prow { color: inherit; text-decoration: none; }
.list .p-tags, .list .p-when { align-self: center; }
@media (min-width: 961px) {
  .list .prow { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 140px 96px; min-height: 44px; }
  .list .p-name { grid-column: 1; grid-row: 1; }
  .list .p-sub { grid-column: 2; grid-row: 1; }
  .list .p-tags { grid-column: 3; grid-row: 1; justify-self: start; }
  .list .p-when { grid-column: 4; grid-row: 1; }
}
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 16px 0; }

/* ---- one response: the panel's person, given a page ---- */
.page-chips { margin-bottom: 12px; }
.duo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: start; }
.duo > .sheet, .stackv > .sheet { margin-top: 0; }
.stackv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
@media (min-width: 961px) { .duo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; } .stackv { gap: 16px; } }
.qa.wide li { position: relative; padding: 8px var(--inset); }
.qa.wide .secs { position: absolute; right: var(--inset); top: 8px; color: var(--muted); font-size: 13px; line-height: 20px; }
.qa.wide .q { padding-right: 56px; }
.qa.wide .a { overflow-wrap: anywhere; }
.kv.flat { margin: 0; border: 0; border-radius: 0; }
.kv.flat div { padding: 8px var(--inset); }
.kv.raw div { grid-template-columns: 112px minmax(0, 1fr); }
.kv.raw dd { font-size: 13px; line-height: 20px; word-break: break-all; }
.kv.raw dt { font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }
.log li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; padding: 6px var(--inset); }
.log li + li, .kv.flat + .log { border-top: 1px solid var(--line); }
.log time { color: var(--muted); font-size: 13px; }
.log .bad { flex: 1 1 100%; color: var(--bad-ink); overflow-wrap: anywhere; }
.sheet-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px var(--inset); border-top: 1px solid var(--line); }

/* ---- the answers per screen ---- */
.duo.even > .sheet { margin: 0; }
.q-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 12px; padding: 10px var(--inset); border-bottom: 1px solid var(--line); }
.q-head h2 { font-size: 15px; line-height: 22px; font-weight: 600; }
.arow { display: grid; grid-template-columns: minmax(0, 1fr) 72px 40px 52px; column-gap: 8px; align-items: center; min-height: 34px; padding: 4px var(--inset); }
.arow + .arow { border-top: 1px solid var(--line); }
.arow .a-label { overflow-wrap: anywhere; }
.arow b, .arow .a-pct { text-align: right; font-variant-numeric: tabular-nums; }
.arow .a-pct { color: var(--body); }
@media (min-width: 961px) { .arow { grid-template-columns: minmax(0, 1fr) 120px 48px 56px; } }

/* ---- the queue: the panel's rows; the whole row opens the response, its button retries ---- */
.ms-strip.flat { margin: 0 0 8px; }
.ms-strip.flat .ms b { font-size: 20px; line-height: 28px; }
.ms.hot b { color: var(--bad); }
.queue .qrow { position: relative; }
.queue .qrow:hover { background: var(--ground); }
.queue a.p-name { color: inherit; text-decoration: none; }
.queue a.p-name::after { content: ""; position: absolute; inset: 0; }
.queue .q-meta { grid-column: 1; color: var(--muted); font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }
.queue .q-err { white-space: normal; overflow-wrap: anywhere; }
.queue .qrow form { position: relative; z-index: 1; grid-row: 1 / 4; }
.hot { color: var(--bad-ink); font-weight: 500; }

/* ---- messages: an empty page, a not-found, an error ---- */
.empty .h-title { margin-bottom: 8px; color: var(--ink); }
.empty .msg { margin-bottom: 16px; overflow-wrap: anywhere; }
.empty .btn { margin-top: 8px; }

/* ---- the storyboard: the frame around each 390 px screen ---- */
.page:has(.stories) { max-width: 1320px; }                /* three 390 px phones side by side */
.stories { display: grid; grid-template-columns: repeat(auto-fill, minmax(0, 392px)); gap: 24px; justify-content: start; }
.story { min-width: 0; margin: 0; }
.story-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; margin-bottom: 8px; }
.story-label b { font-weight: 600; }
.story-walk { margin-left: auto; font-size: 13px; }
.story-phone { width: 100%; max-width: 392px; min-height: 844px; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--raised); }
.story-frame { display: block; width: 100%; height: 844px; border: 0; }
.story-error { display: flex; flex-direction: column; gap: 8px; margin: 16px; padding: 16px; border-radius: 8px; background: var(--bad-bg); color: var(--bad-ink); overflow-wrap: anywhere; }
@media (max-width: 640px) {             /* a phone: the frame takes the whole width, so the screen inside is the phone's own */
  .stories { grid-template-columns: minmax(0, 1fr); margin: 0 -12px; }
  .story-label { padding: 0 12px; }
  .story-phone { margin: 0 auto; border-width: 1px 0; border-radius: 0; }
}

/* ---- the login ---- */
body.login { display: grid; min-height: 100dvh; align-content: center; }
body.login .page { width: 100%; max-width: 392px; }
.login-card { display: grid; gap: 8px; padding: 24px; }
.login-card .h-title { margin-bottom: 8px; text-align: center; }
.login-card label { color: var(--body); font-size: 13px; line-height: 20px; }
.field-in { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }
.field-in:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.field-in.bad { border-color: var(--bad); }
.login-err { padding: 8px 12px; border-radius: 8px; background: var(--bad-bg); color: var(--bad-ink); }
.login-card .btn { height: 44px; margin-top: 8px; }
