/* Muster
   Layout: phone-first single column for corps members. Admins get a fixed
   sidebar on wide screens and a bottom tab bar on phones. Camera steps run
   on a light stage with a plain panel under the video. */

@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(fonts/barlow-condensed-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(fonts/barlow-condensed-700.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 400; font-display: swap; src: url(fonts/public-sans-400.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 600; font-display: swap; src: url(fonts/public-sans-600.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url(fonts/jetbrains-mono-500.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #eef0ec;
  --line: #d8dcd5;
  --ink: #17211b;
  --ink-2: #44524a;
  --ink-3: #68756c;
  --brand: #1e4a35;
  --brand-hover: #275c43;
  --on-brand: #f3f7f0;
  --brand-soft: #e3ece5;
  --accent: #1e4a35;
  --khaki: #b09c62;
  --ok: #1b6e42;
  --ok-soft: #d2e9d8;
  --warn: #7d5400;
  --warn-soft: #f3e5bd;
  --bad: #9f2d1c;
  --bad-soft: #f4d8d0;
  --shadow: 0 1px 3px rgba(23, 33, 27, .10);
  --glass: #ffffff;
  --font-display: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 6px;
  --radius-sm: 5px;
  --gutter: 18px;
}


* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--font-body);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
svg.icon { width: 1.2em; height: 1.2em; flex: none; vertical-align: -0.2em; stroke-width: 1.9; }

.app { min-height: 100%; display: flex; flex-direction: column; }

/* ------------------------------------------------------------ type */
.display { font-family: var(--font-display); font-weight: 700; letter-spacing: .01em; line-height: 1.02; }
.h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 7vw, 32px); line-height: 1.15; letter-spacing: .01em; }
.h2 { font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 1.25; letter-spacing: 0; }
.h3 { font-weight: 600; font-size: 15px; }
.eyebrow { font-family: var(--font-display); font-weight: 600; font-size: 13px; letter-spacing: 0; color: var(--ink-3); }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.mono { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.lead { font-size: 16px; color: var(--ink-2); max-width: 46ch; }

/* ------------------------------------------------------------ splash */
.splash { margin: auto; text-align: center; padding: 40px var(--gutter); }
.splash-mark { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 6px; background: var(--brand); position: relative; }
.splash-mark::after { content: ""; position: absolute; inset: 15px; border: 3px solid var(--on-brand); border-radius: 4px; border-top-color: transparent; animation: spin 1s linear infinite; }
.splash-name { font-family: var(--font-display); font-weight: 700; font-size: 30px; letter-spacing: 0; }
.splash-note { color: var(--ink-3); font-size: 13px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; text-align: center;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent); padding-inline: 10px; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-lg { min-height: 58px; font-size: 17px; padding-inline: 22px; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 6px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 600; font-size: 13.5px; }
.field .hint { font-size: 12.5px; color: var(--ink-3); }
.input, .select, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.input:focus, .select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.input.mono { text-transform: uppercase; letter-spacing: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.form { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.form-error { color: var(--bad); background: var(--bad-soft); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.switch:first-child { border-top: 0; }
.switch-text { min-width: 0; }
.switch input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 14px; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(18px); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 4px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill svg.icon { width: 14px; height: 14px; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card-flat { background: transparent; border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; }
.notice svg.icon { margin-top: 2px; }
.notice-warn { background: var(--warn-soft); color: var(--warn); }
.notice-bad { background: var(--bad-soft); color: var(--bad); }
.notice-ok { background: var(--ok-soft); color: var(--ok); }

/* ------------------------------------------------------------ corper shell */
.shell { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 480px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top, 0px)) var(--gutter) calc(22px + env(safe-area-inset-bottom, 0px)); gap: 22px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; border-radius: 6px; background: var(--brand); display: grid; place-items: center; color: var(--on-brand); }
.brand-mark svg.icon { width: 18px; height: 18px; stroke-width: 2.4; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: 0; line-height: 1; }
.org { font-size: 12.5px; color: var(--ink-3); }
.shell-foot { margin-top: auto; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.shell-foot a { color: var(--ink-2); }

/* The service card: a corper's identity on this phone, styled after an ID tag. */
.idcard { position: relative; overflow: hidden; background: var(--brand); color: var(--on-brand); border-radius: 6px; padding: 20px 20px 18px; box-shadow: var(--shadow); }
.idcard-label { font-family: var(--font-display); font-weight: 600; letter-spacing: 0; font-size: 12.5px; opacity: .75; margin-top: 6px; }
.idcard-code { font-family: var(--font-mono); font-weight: 500; font-size: clamp(27px, 8.4vw, 36px); letter-spacing: .01em; line-height: 1.15; margin-top: 2px; overflow-wrap: anywhere; }
.idcard-name { font-size: 16px; font-weight: 600; margin-top: 10px; overflow-wrap: anywhere; }
.idcard-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; }
.idcard .pill { background: rgba(243, 247, 240, .16); color: var(--on-brand); }

.steps { display: grid; gap: 12px; counter-reset: step; padding: 0; margin: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.steps li::before { counter-increment: step; content: counter(step); font-family: var(--font-display); font-weight: 700; font-size: 20px; width: 34px; height: 34px; border-radius: 6px; display: grid; place-items: center; background: var(--brand-soft); color: var(--accent); }
.steps b { display: block; font-weight: 600; }
.steps span { color: var(--ink-2); font-size: 14px; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.list-main { min-width: 0; }
.list-title { font-weight: 600; overflow-wrap: anywhere; }
.list-sub { font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }
.empty { text-align: center; padding: 26px 12px; color: var(--ink-3); font-size: 14px; }
.empty svg.icon { width: 28px; height: 28px; display: block; margin: 0 auto 8px; opacity: .7; }

/* ------------------------------------------------------------ camera stage */
.stage { position: fixed; inset: 0; z-index: 30; background: var(--bg); color: var(--ink); display: flex; flex-direction: column; }
.stage-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px; }
.stage-top { background: var(--surface); border-bottom: 1px solid var(--line); }
.stage-top .icon-btn { color: var(--ink); background: var(--surface-2); }
.stage-title { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: 0; }
.progress { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.progress span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 4px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-3); }
.progress span.on { background: var(--brand); color: var(--on-brand); }
.progress span.done { background: var(--ok-soft); color: var(--ok); }
.progress svg.icon { width: 13px; height: 13px; }
.stage-body { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.stage-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--surface-2); }
.stage-video.mirror { transform: scaleX(-1); }
.reticle { position: relative; width: min(68vw, 46vh, 320px); aspect-ratio: 1; border-radius: 6px; box-shadow: 0 0 0 100vmax rgba(244, 245, 242, .55); }
.reticle::before, .reticle::after { content: ""; position: absolute; inset: 0; border-radius: 6px; }
.reticle::before { border: 3px solid var(--brand); }
.reticle::after { inset: 12% 8%; border-top: 2px solid var(--ok); height: 0; animation: sweep 2.2s ease-in-out infinite; border-radius: 0; }
@keyframes sweep { 0%, 100% { top: 12%; } 50% { top: 86%; } }
.oval { position: relative; width: min(62vw, 38vh, 300px); aspect-ratio: 3 / 4; border-radius: 50%; border: 3px solid var(--brand); box-shadow: 0 0 0 100vmax rgba(244, 245, 242, .6); transition: border-color .2s; }
.oval.good { border-color: var(--ok); border-width: 4px; }
.stage-panel { position: relative; z-index: 2; margin: 0 12px calc(14px + env(safe-area-inset-bottom, 0px)); padding: 16px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.stage-panel .prompt { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.25; letter-spacing: .02em; text-wrap: balance; }
.stage-panel .sub { font-size: 14px; color: var(--ink-2); }
.bar { height: 6px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: inherit; transition: width .3s; }
.dots { display: flex; gap: 6px; }
.dots i { width: 26px; height: 5px; border-radius: 4px; background: var(--line); }
.dots i.on { background: var(--brand); }
.stage-center { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 20px var(--gutter); max-width: 420px; }

/* Distance dial: the dot is the phone, the ring is the allowed zone. */
.dial { position: relative; width: min(64vw, 260px); aspect-ratio: 1; border-radius: 50%; border: 1px dashed var(--line); background: var(--surface); display: grid; place-items: center; }
.dial-zone { position: absolute; width: 46%; aspect-ratio: 1; border-radius: 50%; background: var(--ok-soft); border: 2px solid var(--ok); }
.dial-pin { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.dial-me { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 6px rgba(30, 74, 53, .15); transition: transform .5s; }
.dial-me.out { background: var(--bad); box-shadow: 0 0 0 6px rgba(159, 45, 28, .15); }
.dial-read { position: absolute; bottom: 12%; font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); }
.bignum { font-family: var(--font-display); font-weight: 700; font-size: 48px; line-height: 1; letter-spacing: .01em; }

/* result */
.result { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; padding: 30px var(--gutter); }
.seal { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); position: relative; }
.seal svg.icon { width: 56px; height: 56px; stroke-width: 2.4; }
.seal.bad { background: var(--bad-soft); color: var(--bad); }
.seal.live::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 3px solid var(--ok); border-right-color: transparent; border-left-color: transparent; animation: spin 2.4s linear infinite; }
.clock { font-family: var(--font-mono); font-size: 34px; letter-spacing: .02em; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; text-align: left; font-size: 14px; width: 100%; max-width: 340px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ admin */
.admin { flex: 1; display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 0 8px; }
.side-org { padding: 0 8px; font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.on { background: var(--brand-soft); color: var(--accent); }
.nav .count { margin-left: auto; background: var(--warn-soft); color: var(--warn); border-radius: 4px; padding: 0 8px; font-size: 12px; min-width: 22px; text-align: center; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.main { min-width: 0; padding: 30px clamp(18px, 3.4vw, 44px) 60px; display: flex; flex-direction: column; gap: 24px; max-width: 1240px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .h1 { font-size: clamp(26px, 3vw, 30px); }
.tabbar { display: none; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; }
a.tile:hover { border-color: var(--ink-3); }
.tile-num { font-family: var(--font-display); font-weight: 700; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.tile-label { font-size: 13.5px; color: var(--ink-2); }
.tile.attn { background: var(--warn-soft); border-color: transparent; }
.tile.attn .tile-num, .tile.attn .tile-label { color: var(--warn); }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-family: var(--font-display); font-weight: 600; font-size: 12.5px; letter-spacing: 0; color: var(--ink-3); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.tight { white-space: nowrap; width: 1%; }
.table .who { display: flex; align-items: center; gap: 11px; min-width: 190px; }
.avatar { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--surface-2); flex: none; display: grid; place-items: center; color: var(--ink-3); border: 0; padding: 0; overflow: hidden; }
button.avatar { cursor: zoom-in; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.who-name { font-weight: 600; overflow-wrap: anywhere; }
.who-code { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3); }
.flag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 2px 8px; border-radius: 4px; margin: 2px 4px 2px 0; white-space: nowrap; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .input { max-width: 300px; min-height: 40px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 6px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 13px; border-radius: 6px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }

/* QR panel */
.qr-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; }
.qr-box { background: #ffffff; padding: 12px; border-radius: 6px; width: 100%; max-width: 280px; line-height: 0; }
.qr-box canvas { width: 100%; height: auto; image-rendering: pixelated; }
.ring { --p: 1; width: 100%; height: 5px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.ring i { display: block; height: 100%; width: calc(var(--p) * 100%); background: var(--brand); border-radius: inherit; }
.ratio { font-family: var(--font-display); font-weight: 700; font-size: 54px; line-height: 1; font-variant-numeric: tabular-nums; }
.ratio small { font-size: 26px; color: var(--ink-3); font-weight: 600; }

/* Display (projector) mode */
.display-mode { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 60px); padding: clamp(18px, 4vw, 56px); align-items: center; overflow: auto; }
.display-qr { background: var(--glass); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: 6px; padding: clamp(14px, 2.4vw, 30px); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; align-items: center; justify-self: center; width: min(100%, 78vh); }
.display-qr .qr-box { max-width: none; padding: clamp(10px, 2vw, 22px); border-radius: 6px; }
.display-info { display: flex; flex-direction: column; gap: clamp(14px, 2.4vh, 26px); min-width: 0; }
.display-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 4.4vw, 64px); line-height: 1.05; letter-spacing: .01em; overflow-wrap: anywhere; }
.display-count { font-family: var(--font-display); font-weight: 700; font-size: clamp(70px, 11vw, 170px); line-height: .9; font-variant-numeric: tabular-nums; }
.display-count small { font-size: .42em; color: var(--ink-3); font-weight: 600; }
.display-steps { display: flex; flex-direction: column; gap: 8px; font-size: clamp(15px, 1.5vw, 21px); color: var(--ink-2); }
.display-steps b { color: var(--ink); }
.ticker { display: flex; flex-direction: column; gap: 6px; min-height: 4.6em; font-size: clamp(14px, 1.3vw, 19px); }
.ticker div { display: flex; gap: 12px; align-items: baseline; }
.ticker .mono { color: var(--ink-3); font-size: .9em; }
.display-close { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); right: 14px; z-index: 41; display: flex; gap: 6px; }

/* ------------------------------------------------------------ overlays */
#layer { position: relative; z-index: 60; }
.scrim { position: fixed; inset: 0; background: rgba(23, 33, 27, .35); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 60; overflow: auto; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 22px; width: 100%; max-width: 480px; max-height: calc(100vh - 36px); overflow: auto; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; }
.modal-wide { max-width: 720px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.toasts { position: fixed; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 80; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 6px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); max-width: 440px; }
.toast.bad { background: var(--bad); color: #fff; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.compare figure { margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); }
.compare img, .photo-lg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.th-sub { font-family: var(--font-body); font-weight: 400; font-size: 12px; letter-spacing: 0; text-transform: none; max-width: 130px; margin: 2px auto 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.matrix .p { color: var(--ok); font-weight: 600; }
.matrix .m { color: var(--warn); font-weight: 600; }
.matrix .a { color: var(--ink-3); }

/* ------------------------------------------------------------ wide corper layout */
@media (min-width: 940px) {
  .split { flex: 1; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; }
  .split-poster { background: var(--brand); color: var(--on-brand); padding: 56px clamp(32px, 5vw, 80px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; position: relative; overflow: hidden; }
  .split-poster::before { content: none; }
  .split-poster .poster-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 4.8vw, 72px); line-height: 1.05; letter-spacing: .005em; }
  .split-poster .poster-sub { font-size: 18px; max-width: 34ch; opacity: .86; }
  .split-poster .steps li::before { background: rgba(243, 247, 240, .14); color: var(--on-brand); }
  .split-poster .steps span { color: rgba(243, 247, 240, .78); }
  .split-main { display: flex; align-items: stretch; justify-content: center; }
  .split-main .shell { justify-content: center; padding-block: 40px; }
  .only-narrow { display: none !important; }
}
@media (max-width: 939.98px) {
  .split { flex: 1; display: flex; flex-direction: column; }
  .split-poster { display: none; }
  .split-main { flex: 1; display: flex; }
}

/* ------------------------------------------------------------ narrow admin */
@media (max-width: 899.98px) {
  .admin { display: flex; flex-direction: column; }
  .side { display: none; }
  .main { padding: calc(16px + env(safe-area-inset-top, 0px)) var(--gutter) calc(96px + env(safe-area-inset-bottom, 0px)); gap: 18px; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 20; background: var(--glass); border: 1px solid var(--line); border-radius: 6px; padding: 6px; box-shadow: var(--shadow); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px; border-radius: 6px; font-size: 11px; font-weight: 600; color: var(--ink-2); text-decoration: none; position: relative; }
  .tabbar a.on { background: var(--brand-soft); color: var(--accent); }
  .tabbar svg.icon { width: 21px; height: 21px; }
  .tabbar .count { position: absolute; top: 3px; right: 18%; background: var(--warn); color: var(--bg); border-radius: 4px; font-size: 10px; padding: 0 5px; }
  .cols { grid-template-columns: 1fr; }
  .cols > .qr-col { order: -1; }
  .display-mode { grid-template-columns: 1fr; align-content: start; }
  .display-qr { width: min(100%, 62vh); }
  .only-wide { display: none !important; }
  /* register rows become cards on phones */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
  .table-cards tr:last-child { border-bottom: 0; }
  .table.table-cards td { padding: 0; border: 0; width: auto; white-space: normal; }
  .table.table-cards td.wide { grid-column: 1 / -1; }
  .table.table-cards td:last-child { grid-column: 1 / -1; justify-self: end; }
  .table-cards td[data-label]:not(:empty)::before { content: attr(data-label) ": "; color: var(--ink-3); font-size: 12.5px; }
  .table-cards td:empty { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* export card */
#export-card .list-item { flex-wrap: wrap; }
#export-card .list-main { flex: 1 1 280px; }
#export-card .btn-row { gap: 6px; }
