/* ============================================================
   InspektLABS — Customer app system (app.css)
   Mobile-first. Sunlight-legible. "Field evidence instrument."
   Signature: the corner-bracket evidence frame (viewfinder marker)
   recurs on the capture screen, scan cards, and the report.
   Depends on: tokens.css, fonts.css
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-body); font-size: var(--t-body);
  line-height: var(--lh); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }
::selection { background: var(--brand-tint); }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }

/* ---------- App shell (the phone column) ---------- */
.app {
  position: relative; width: 100%; max-width: var(--app-w); min-height: 100dvh;
  margin: 0 auto; background: var(--bg); display: flex; flex-direction: column;
  isolation: isolate;
}
.app__body { flex: 1 1 auto; padding: var(--s5) var(--s5) var(--s8); }
.app__body--flush { padding: 0; }
.app__body--pad-cta { padding-bottom: 104px; } /* room for sticky CTA */

/* App bar */
.appbar {
  position: sticky; top: 0; z-index: 30; height: var(--appbar-h);
  display: flex; align-items: center; gap: var(--s3);
  padding: 0 var(--s5); background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--line);
}
.appbar__back {
  width: var(--tap); height: var(--tap); margin-left: calc(var(--s3) * -1);
  display: grid; place-items: center; border-radius: var(--r-pill);
  color: var(--ink); background: transparent; border: 0; cursor: pointer;
}
.appbar__back:hover { background: var(--surface-2); }
.appbar__title { font-family: var(--font-display); font-weight: 600; font-size: var(--t-h2);
  letter-spacing: -0.01em; margin-right: auto; }
.appbar__spacer { margin-left: auto; }

/* Brand lockup */
.brand { display: inline-flex; align-items: center; gap: 9px; user-select: none; }
.brand__mark { width: 22px; height: 22px; flex: none; color: var(--brand); }
.brand__word { font-family: var(--font-display); font-weight: 700; font-size: 16.5px;
  letter-spacing: 0.02em; color: var(--ink); line-height: 1; }
.brand__word b { font-weight: 700; color: var(--brand); }
.brand__word .k { color: var(--ink); }
.brand--sm .brand__word { font-size: 14.5px; }
.brand--lg .brand__mark { width: 30px; height: 30px; }
.brand--lg .brand__word { font-size: 22px; }

/* Sticky bottom action bar (thumb zone) */
.actionbar {
  position: sticky; bottom: 0; z-index: 25; padding: var(--s4) var(--s5)
    calc(var(--s4) + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--surface) 62%, color-mix(in srgb, var(--surface) 0%, transparent));
  border-top: 1px solid var(--line);
}
.actionbar--plain { background: var(--surface); }
.actionbar .btn + .btn { margin-top: var(--s2); }
.actionbar__note { text-align: center; color: var(--ink-3); font-size: var(--t-xs);
  margin-top: var(--s2); }

/* ---------- Typography ---------- */
.display { font-family: var(--font-display); font-weight: 700; font-size: var(--t-display);
  line-height: var(--lh-tight); letter-spacing: -0.02em; color: var(--ink); }
.display--xl { font-size: var(--t-display-xl); }
h1, .h1 { font-family: var(--font-display); font-weight: 600; font-size: var(--t-h1);
  line-height: var(--lh-snug); letter-spacing: -0.01em; }
h2, .h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--t-h2);
  line-height: var(--lh-snug); letter-spacing: -0.005em; }
h3, .h3 { font-weight: 600; font-size: var(--t-h3); line-height: var(--lh-snug); }
.lead { font-size: 16.5px; line-height: 1.46; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.tiny { font-size: var(--t-xs); }
.sm { font-size: var(--t-sm); }
.center { text-align: center; }
.eyebrow { font-family: var(--font-mono); font-size: var(--t-2xs); font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--brand-ink); }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.data { font-family: var(--font-mono); font-size: var(--t-sm); letter-spacing: -0.01em;
  color: var(--ink); word-break: break-all; }

/* stack spacing helper */
.stack > * + * { margin-top: var(--s4); }
.stack-sm > * + * { margin-top: var(--s2); }
.stack-lg > * + * { margin-top: var(--s6); }
.row { display: flex; align-items: center; gap: var(--s3); }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- Buttons ---------- */
.btn {
  --bh: 52px;
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s2); min-height: var(--bh); padding: 0 var(--s5);
  font-family: var(--font-body); font-weight: 600; font-size: 15.5px; letter-spacing: 0.005em;
  border: 1px solid transparent; border-radius: var(--r); cursor: pointer;
  transition: transform var(--dur-1) var(--ease), background var(--dur-1), box-shadow var(--dur-1);
  -webkit-tap-highlight-color: transparent; text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.995); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.btn .ic { width: 19px; height: 19px; }
.btn--block { display: flex; width: 100%; }
.btn--lg { --bh: 56px; font-size: 16.5px; }
.btn--sm { --bh: 40px; padding: 0 var(--s4); font-size: 14px; border-radius: var(--r-sm); }

.btn--primary { background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-1); }
.btn--primary:hover { background: #1b232c; }
[data-theme="admin"] .btn--primary { background: var(--ink); color: var(--on-ink); }

.btn--brand { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(12,107,116,.25); }
.btn--brand:hover { background: var(--brand-strong); }

.btn--rec { background: var(--rec); color: #fff; }
.btn--rec:hover { background: #d33b40; }

.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { background: var(--surface-2); }

.btn--quiet { background: transparent; color: var(--ink-2); min-height: 44px; }
.btn--quiet:hover { background: var(--surface-2); color: var(--ink); }

.btn--link { background: transparent; color: var(--brand); min-height: 44px; padding: 0 var(--s2); }
.btn--link:hover { background: var(--brand-tint); text-decoration: none; }

.btn--danger { background: var(--rec-tint); color: var(--rec-ink); border-color: var(--warn-line);
  border-color: color-mix(in srgb, var(--rec) 30%, transparent); }

/* ---------- Surfaces / cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.card__body { padding: var(--s5); }
.card__head { padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--s3); }
.card__head h2, .card__head h3 { margin: 0; }
.card--flat { box-shadow: none; }
.card--quiet { background: var(--surface-2); border-color: transparent; }
.card--brand { background: var(--brand-tint); border-color: color-mix(in srgb, var(--brand) 20%, transparent); }
.card--pad { padding: var(--s5); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); }

.inset { background: var(--surface-2); border-radius: var(--r); padding: var(--s4); }
.divider { height: 1px; background: var(--line); margin: var(--s4) 0; }

/* ---------- Chips / badges / status ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.01em;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip--ok { background: var(--ok-tint); color: var(--ok-ink); border-color: transparent; }
.chip--warn { background: var(--warn-tint); color: var(--warn-ink); border-color: var(--warn-line); }
.chip--rec { background: var(--rec-tint); color: var(--rec-ink); border-color: transparent; }
.chip--brand { background: var(--brand-tint); color: var(--brand-ink); border-color: transparent; }
.chip--neutral { background: var(--surface-3); color: var(--ink-2); }
.chip--mono { font-family: var(--font-mono); font-weight: 500; }

.statusdot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent); }
.statusdot--ok { color: var(--ok); background: var(--ok); }
.statusdot--warn { color: var(--warn-ink); background: var(--warn-ink); }
.statusdot--rec { color: var(--rec); background: var(--rec); }
.statusdot--idle { color: var(--ink-3); background: var(--ink-3); }

/* secured readout: the "instrument" trust signal */
.secured {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--ok-tint); border: 1px solid color-mix(in srgb, var(--ok) 22%, transparent);
  border-radius: var(--r); color: var(--ok-ink);
}
.secured .ic { width: 18px; height: 18px; flex: none; }
.secured small { display: block; font-family: var(--font-mono); font-size: var(--t-2xs);
  letter-spacing: 0.04em; opacity: 0.8; }
.secured b { font-weight: 600; font-size: var(--t-sm); }

/* ---------- Signature: the evidence frame (corner brackets) ---------- */
.frame { position: relative; }
.frame::before, .frame::after {
  content: ""; position: absolute; width: 18px; height: 18px; pointer-events: none;
  border: 2px solid var(--brand); border-radius: 2px;
}
.frame::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.frame::after { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
/* full 4-corner variant via inner spans */
.frame--4 > .corner { position: absolute; width: 16px; height: 16px; border: 2px solid var(--brand); }
.frame--4 > .corner.tl { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.frame--4 > .corner.tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.frame--4 > .corner.bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; }
.frame--4 > .corner.br { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.frame--tight::before, .frame--tight::after { width: 12px; height: 12px; }

/* ---------- Hero (landing) ---------- */
.hero {
  position: relative; overflow: hidden; padding: var(--s7) var(--s5) var(--s6);
  background:
    radial-gradient(120% 80% at 78% -10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 60%),
    linear-gradient(180deg, var(--surface), var(--bg));
  border-bottom: 1px solid var(--line);
}
.hero__grid { position: absolute; inset: 0; opacity: 0.5; pointer-events: none;
  background-image:
    linear-gradient(color-mix(in srgb, var(--brand) 8%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--brand) 8%, transparent) 1px, transparent 1px);
  background-size: 28px 28px; -webkit-mask-image: radial-gradient(120% 90% at 80% 0%, #000, transparent 70%);
          mask-image: radial-gradient(120% 90% at 80% 0%, #000, transparent 70%); }
.hero > * { position: relative; }
.hero .display { margin-top: var(--s3); }
.hero .lead { margin-top: var(--s3); max-width: 30ch; }

/* device "viewfinder" preview used in hero / vault */
.scanframe {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden;
  background: linear-gradient(135deg, #10242a, #16323a 60%, #0f2329);
  display: grid; place-items: center;
}
.scanframe img { width: 100%; height: 100%; object-fit: cover; opacity: 0.92; }
.scanframe__overlay { position: absolute; inset: 0; }
.scanframe__tag { position: absolute; left: 12px; top: 12px; }
.scanframe__angle { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center;
  color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 18px;
  text-shadow: 0 1px 6px rgba(0,0,0,.5); letter-spacing: 0.01em; }

/* ---------- Numbered steps (how it works) ---------- */
.steps { counter-reset: step; }
.steps .step { display: flex; gap: var(--s4); padding: var(--s3) 0; }
.steps .step__num {
  counter-increment: step; flex: none; width: 30px; height: 30px; border-radius: var(--r-sm);
  display: grid; place-items: center; font-family: var(--font-mono); font-weight: 600; font-size: 13px;
  background: var(--ink); color: var(--on-ink);
}
.steps .step__num::before { content: counter(step, decimal-leading-zero); }
.steps .step h3 { margin-bottom: 2px; }
.steps .step p { color: var(--ink-2); font-size: var(--t-sm); }
.steps--brand .step__num { background: var(--brand); color: #fff; }

/* feature/value list with check ticks */
.ticks li { display: flex; gap: 10px; padding: 7px 0; align-items: flex-start; }
.ticks li .ic { width: 18px; height: 18px; flex: none; color: var(--brand); margin-top: 2px; }

/* ---------- Scan status rows (dashboard / vault) ---------- */
.scanrow {
  display: flex; align-items: center; gap: var(--s4); width: 100%; text-align: left;
  padding: var(--s4); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); cursor: pointer; transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.scanrow:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.scanrow__ic {
  flex: none; width: 44px; height: 44px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-2); position: relative;
}
.scanrow__ic .ic { width: 22px; height: 22px; }
.scanrow--done .scanrow__ic { background: var(--ok-tint); color: var(--ok-ink); }
.scanrow--todo .scanrow__ic { background: var(--brand-tint); color: var(--brand-ink); }
.scanrow--warn .scanrow__ic { background: var(--warn-tint); color: var(--warn-ink); }
.scanrow--lock .scanrow__ic { background: var(--surface-3); color: var(--ink-3); }
.scanrow__main { flex: 1; min-width: 0; }
.scanrow__main h3 { font-size: 15px; }
.scanrow__main p { font-size: var(--t-sm); color: var(--ink-2); margin-top: 1px; }
.scanrow__end { display: flex; align-items: center; gap: var(--s3); color: var(--ink-3); }
.scanrow__chev { width: 20px; height: 20px; flex: none; }
.scanrow[disabled] { cursor: default; opacity: 0.7; }
.scanrow[disabled]:hover { border-color: var(--line); box-shadow: none; }

/* numbered timeline of evidence facts */
.factlist { display: grid; gap: 0; }
.factlist .fact { display: flex; justify-content: space-between; gap: var(--s4);
  padding: 11px 0; border-bottom: 1px dashed var(--line); }
.factlist .fact:last-child { border-bottom: 0; }
.factlist .fact dt { color: var(--ink-2); font-size: var(--t-sm); }
.factlist .fact dd { margin: 0; text-align: right; font-weight: 500; font-size: var(--t-sm); }
.factlist .fact dd.mono { font-family: var(--font-mono); font-weight: 500; }

/* ---------- Forms ---------- */
.field { display: block; }
.field + .field { margin-top: var(--s4); }
.field__label { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px;
  font-weight: 600; font-size: var(--t-sm); }
.field__label .opt { font-weight: 500; color: var(--ink-3); font-size: var(--t-xs); }
.field__hint { margin-top: 6px; color: var(--ink-3); font-size: var(--t-xs); }
.field__err { margin-top: 6px; color: var(--rec-ink); font-size: var(--t-xs); display: flex; gap: 5px; }

.input, .select, .textarea {
  width: 100%; min-height: var(--tap); padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-sm); font-size: 16px; /* 16px = no iOS zoom */
  color: var(--ink); transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--focus); box-shadow: var(--ring); outline: none; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2358626E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
.input--invalid, .textarea--invalid { border-color: var(--rec); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }

/* segmented control */
.seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-pill); }
.seg button { border: 0; background: transparent; min-height: 38px; padding: 0 16px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* toggle switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 44px; height: 26px; border-radius: var(--r-pill); background: var(--line-2);
  position: relative; transition: background var(--dur-1); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform var(--dur-1); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

/* checkbox / radio (consent) */
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: var(--t-sm); }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--brand); }

/* ---------- Accordion (FAQ) ---------- */
.accordion .acc { border-bottom: 1px solid var(--line); }
.accordion .acc__q { display: flex; justify-content: space-between; align-items: center; gap: var(--s4);
  width: 100%; padding: var(--s4) 0; background: transparent; border: 0; cursor: pointer;
  text-align: left; font-weight: 600; font-size: 15px; color: var(--ink); }
.accordion .acc__q .ic { width: 20px; height: 20px; flex: none; color: var(--ink-3);
  transition: transform var(--dur-2) var(--ease); }
.accordion .acc[open] .acc__q .ic { transform: rotate(45deg); }
.accordion .acc__a { padding: 0 0 var(--s4); color: var(--ink-2); font-size: var(--t-sm); line-height: 1.55; }

/* ---------- Disclaimer ---------- */
.disclaimer { display: flex; gap: 10px; padding: 12px 14px; background: var(--surface-2);
  border-radius: var(--r-sm); color: var(--ink-2); font-size: var(--t-xs); line-height: 1.5; }
.disclaimer .ic { width: 16px; height: 16px; flex: none; color: var(--ink-3); margin-top: 1px; }

/* ---------- Empty / state / processing ---------- */
.state { text-align: center; padding: var(--s7) var(--s4); }
.state__icon { width: 64px; height: 64px; margin: 0 auto var(--s4); border-radius: var(--r-lg);
  display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.state__icon .ic { width: 30px; height: 30px; }
.state__icon--ok { background: var(--ok-tint); color: var(--ok-ink); }
.state__icon--rec { background: var(--rec-tint); color: var(--rec-ink); }
.state__icon--brand { background: var(--brand-tint); color: var(--brand-ink); }
.state__icon--warn { background: var(--warn-tint); color: var(--warn-ink); }
.state h1 { margin-bottom: var(--s2); }
.state p { color: var(--ink-2); max-width: 34ch; margin: 0 auto; }

/* big success seal with frame brackets */
.seal { position: relative; width: 120px; height: 120px; margin: 0 auto var(--s5); }
.seal__disc { position: absolute; inset: 14px; border-radius: 50%; background: var(--ok-tint);
  display: grid; place-items: center; color: var(--ok-ink); }
.seal__disc .ic { width: 52px; height: 52px; }
.seal .corner { position: absolute; width: 22px; height: 22px; border: 2.5px solid var(--ok); border-radius: 3px; }
.seal .corner.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.seal .corner.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.seal .corner.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.seal .corner.br { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* ---------- Checklist with live states (processing/permissions) ---------- */
.checklist { display: grid; gap: 2px; }
.checkline { display: flex; align-items: center; gap: var(--s3); padding: 11px 12px; border-radius: var(--r-sm); }
.checkline__ic { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 50%; }
.checkline__ic .ic { width: 15px; height: 15px; }
.checkline span { font-size: var(--t-sm); font-weight: 500; }
.checkline--done .checkline__ic { background: var(--ok); color: #fff; }
.checkline--done span { color: var(--ink); }
.checkline--active { background: var(--brand-tint); }
.checkline--active .checkline__ic { background: var(--brand); color: #fff; }
.checkline--active span { color: var(--brand-ink); font-weight: 600; }
.checkline--pending .checkline__ic { background: var(--surface-3); color: var(--ink-3); }
.checkline--pending span { color: var(--ink-3); }

/* spinner */
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--brand) 25%, transparent);
  border-top-color: var(--brand); animation: spin 0.8s linear infinite; }
.spinner--lg { width: 40px; height: 40px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.pulse { animation: pulse 1.4s var(--ease) infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ---------- Progress ---------- */
.progress { height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.progress__fill { height: 100%; border-radius: inherit; background: var(--brand);
  transition: width var(--dur-3) var(--ease); }
.progress__fill--rec { background: var(--rec); }

/* circular ring (upload / capture) */
.ring { --p: 0; --size: 132px; width: var(--size); height: var(--size); border-radius: 50%;
  display: grid; place-items: center; margin: 0 auto;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--surface-3) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--surface); }
.ring__label { position: relative; text-align: center; }
.ring__label b { font-family: var(--font-display); font-size: 26px; font-weight: 700; display: block; }
.ring__label small { color: var(--ink-3); font-size: var(--t-xs); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: 88px; display: flex; justify-content: center;
  pointer-events: none; z-index: 60; padding: 0 var(--s5); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: var(--app-w);
  padding: 12px 16px; background: var(--ink); color: var(--on-ink); border-radius: var(--r-pill);
  box-shadow: var(--shadow-3); font-size: var(--t-sm); font-weight: 500;
  animation: toast-in var(--dur-2) var(--ease-out); }
.toast .ic { width: 18px; height: 18px; color: var(--brand-strong); }
[data-theme="admin"] .toast { background: var(--surface-3); color: var(--ink); }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }

/* ---------- Document upload slots (dispute / support) ---------- */
.slot { display: flex; align-items: center; gap: var(--s4); padding: var(--s4); border: 1px dashed var(--line-2);
  border-radius: var(--r); background: var(--surface); cursor: pointer; }
.slot:hover { border-color: var(--brand); background: var(--brand-tint); }
.slot__ic { width: 40px; height: 40px; flex: none; border-radius: var(--r-sm); display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-2); }
.slot__main { flex: 1; min-width: 0; }
.slot__main h3 { font-size: 14.5px; }
.slot__main p { font-size: var(--t-xs); color: var(--ink-3); margin-top: 1px; }
.slot--filled { border-style: solid; border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: var(--ok-tint); }
.slot--filled .slot__ic { background: #fff; color: var(--ok-ink); }
.slot__add { color: var(--brand); font-weight: 600; font-size: var(--t-sm); }

/* photo-mode grid */
.photogrid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.photocell { aspect-ratio: 1; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2);
  display: grid; place-items: center; position: relative; overflow: hidden; }
.photocell__n { position: absolute; top: 6px; left: 6px; font-family: var(--font-mono); font-size: 11px;
  background: rgba(0,0,0,.55); color: #fff; border-radius: var(--r-xs); padding: 1px 5px; }
.photocell--done { border-color: var(--ok); }
.photocell--done .photocell__n { background: var(--ok); }
.photocell .lbl { font-size: var(--t-xs); color: var(--ink-3); }

/* ---------- Report (web preview) ---------- */
.report { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; }
.report__cover { padding: var(--s5); background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border-bottom: 1px solid var(--line); }
.report__id { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-3); }
.report__sec { padding: var(--s5); border-bottom: 1px solid var(--line); }
.report__sec:last-child { border-bottom: 0; }
.report__sec h3 { font-family: var(--font-mono); font-size: var(--t-2xs); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--s3); }
.frames { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.frames .fr { aspect-ratio: 4/3; border-radius: var(--r-xs); overflow: hidden; position: relative;
  background: #16323a; }
.frames .fr img { width: 100%; height: 100%; object-fit: cover; }
.frames .fr small { position: absolute; bottom: 3px; left: 3px; font-family: var(--font-mono);
  font-size: 9px; color: #fff; background: rgba(0,0,0,.5); padding: 0 4px; border-radius: 3px; }
.hashtable { font-family: var(--font-mono); font-size: var(--t-2xs); }
.hashtable div { display: flex; justify-content: space-between; gap: var(--s3); padding: 6px 0;
  border-bottom: 1px dashed var(--line); }
.hashtable div:last-child { border-bottom: 0; }
.hashtable .k { color: var(--ink-3); }
.hashtable .v { color: var(--ink); word-break: break-all; text-align: right; }

/* QR placeholder (verification) */
.qr { width: 92px; height: 92px; flex: none; border-radius: var(--r-sm); background:
  repeating-conic-gradient(var(--ink) 0% 25%, var(--surface) 0% 50%) 50% / 12px 12px; border: 4px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }

/* ---------- helpers ---------- */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.notice { padding: 12px 14px; border-radius: var(--r-sm); font-size: var(--t-sm); line-height: 1.5; }
.notice--warn { background: var(--warn-tint); border: 1px solid var(--warn-line); color: var(--warn-ink); }
.notice--rec { background: var(--rec-tint); color: var(--rec-ink); }
.notice--brand { background: var(--brand-tint); color: var(--brand-ink); }
.hide { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0; }
.link-quiet { color: var(--ink-2); }

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

/* slightly larger column on bigger phones / desktop preview */
@media (min-width: 480px) {
  .app__body { padding-left: var(--s6); padding-right: var(--s6); }
}
