/* Repair Lab — shared stylesheet. System fonts only; no external resources. */

:root {
  --bg: #f3f7f5;
  --surface: #ffffff;
  --surface-2: #e9f2ee;
  --ink: #12302b;
  --ink-2: #3d5a54;
  --muted: #526a64;
  --line: #cfe0d9;
  --line-strong: #9fbcb2;

  --brand: #0f6e66;          /* teal, 5.9:1 on white */
  --brand-strong: #0a524c;
  --brand-soft: #d7efe9;
  --leaf: #2f7d3a;

  --ok: #1d6b34;   --ok-bg: #e2f3e6;
  --warn: #8a4b06; --warn-bg: #fdf0dc;
  --bad: #a11d1d;  --bad-bg: #fbe5e4;
  --info: #1f4fae; --info-bg: #e3ebfb;

  --demo: #6b2c91; --demo-bg: #f3e8fa;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(18, 48, 43, .06), 0 4px 14px rgba(18, 48, 43, .06);
  --focus: 0 0 0 3px #ffffff, 0 0 0 6px #1f4fae;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
}
img, svg { max-width: 100%; }
[hidden] { display: none !important; }

a { color: var(--brand-strong); text-underline-offset: 2px; }
a:hover { color: var(--ink); }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: .5rem; top: -3rem; z-index: 100;
  background: var(--ink); color: #fff; padding: .5rem .75rem; border-radius: 6px;
}
.skip-link:focus { top: .5rem; }

/* ---------- Chrome ---------- */
.demo-banner {
  background: var(--demo); color: #fff; text-align: center;
  font-weight: 700; font-size: .9rem; letter-spacing: .02em;
  padding: .4rem 1rem;
}
.demo-banner strong { background: #fff; color: var(--demo); padding: 0 .4rem; border-radius: 4px; margin-right: .4rem; }

.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line);
}
.wordmark { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--ink); }
.wordmark svg { width: 30px; height: 30px; flex: none; }
.wordmark-text { white-space: nowrap; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.wordmark-text span { color: var(--brand); }
.tag-proto {
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--brand-strong); background: var(--brand-soft); border: 1px solid #a8d8cc;
  padding: .1rem .45rem; border-radius: 999px;
}
.header-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.whoami { font-size: .85rem; color: var(--ink-2); }
@media (max-width: 560px) {
  .whoami { display: none; }
  .site-header { padding: .5rem .75rem; }
  .tag-proto { font-size: .62rem; }
}

main { display: block; max-width: 1100px; margin: 0 auto; padding: 1rem; }
main.narrow { max-width: 720px; }
main.wide { max-width: 1400px; }

.site-footer { max-width: 1100px; margin: 2rem auto 1rem; padding: 0 1rem; color: var(--muted); font-size: .85rem; }

/* ---------- Building blocks ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1rem; box-shadow: var(--shadow); margin-bottom: 1rem;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.grid { display: grid; gap: 1rem; margin-bottom: 1rem; }
.grid > .card { margin-bottom: 0; }
.list.grid { margin-bottom: 0; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.stack > * + * { margin-top: .75rem; }
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); }
.lead { font-size: 1.05rem; color: var(--ink-2); }
.page-title { margin: .25rem 0 1rem; }
.eyebrow { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-strong); margin-bottom: .25rem; }

/* ---------- Buttons ---------- */
.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .55rem 1rem; border-radius: var(--radius);
  font: inherit; font-weight: 650; line-height: 1.2; text-decoration: none; cursor: pointer;
  border: 1px solid var(--brand); background: var(--brand); color: #fff;
}
.btn:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-secondary { background: var(--surface); color: var(--brand-strong); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-2); color: var(--ink); border-color: var(--brand); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #7f1414; border-color: #7f1414; }
.btn-small { min-height: 36px; padding: .35rem .7rem; font-size: .9rem; }
.btn-big { min-height: 56px; font-size: 1.1rem; padding: .75rem 1.4rem; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .85rem; }
.field label, .label { font-weight: 650; font-size: .95rem; }
.hint { font-size: .85rem; color: var(--muted); }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="time"],
input[type="datetime-local"], input[type="search"], select, textarea {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: .55rem .7rem; min-height: 44px; width: 100%;
}
textarea { min-height: 80px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--info); }
input[aria-invalid="true"] { border-color: var(--bad); }
.input-code { font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; font-size: 1.2rem; }
.form-row { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; margin: 0 0 1rem; }
legend { font-weight: 700; padding: 0; float: left; width: 100%; margin-bottom: .5rem; }
legend + * { clear: both; }

.check, .radio {
  display: flex; align-items: flex-start; gap: .6rem; padding: .55rem .65rem;
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .45rem; cursor: pointer; background: #fff;
}
.check:hover, .radio:hover { border-color: var(--brand); }
.check input, .radio input { width: 20px; height: 20px; margin: .1rem 0 0; flex: none; accent-color: var(--brand); }
.radio:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

/* switch */
.switch { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; font-size: .9rem; }
.switch input {
  -webkit-appearance: none; appearance: none; width: 42px; height: 24px; border-radius: 999px;
  background: #b7c8c2; position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s;
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { box-shadow: var(--focus); }

/* ---------- Messages ---------- */
.msg { border-radius: var(--radius); padding: .7rem .9rem; margin: .5rem 0 1rem; border: 1px solid; }
.msg:empty { display: none; }
.msg-ok { background: var(--ok-bg); border-color: #a9d6b5; color: var(--ok); }
.msg-bad { background: var(--bad-bg); border-color: #efb1ad; color: var(--bad); }
.msg-warn { background: var(--warn-bg); border-color: #efcf9d; color: var(--warn); }
.msg-info { background: var(--info-bg); border-color: #b4c7f0; color: var(--info); }
.msg strong { color: inherit; }
.msg ul { margin: .3rem 0 0; padding-left: 1.2rem; }

.chip {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 700;
  padding: .15rem .55rem; border-radius: 999px; border: 1px solid; white-space: nowrap;
}
.chip-ok { color: var(--ok); background: var(--ok-bg); border-color: #a9d6b5; }
.chip-warn { color: var(--warn); background: var(--warn-bg); border-color: #efcf9d; }
.chip-bad { color: var(--bad); background: var(--bad-bg); border-color: #efb1ad; }
.chip-info { color: var(--info); background: var(--info-bg); border-color: #b4c7f0; }
.chip-neutral { color: var(--ink-2); background: var(--surface-2); border-color: var(--line); }
.chip-demo { color: var(--demo); background: var(--demo-bg); border-color: #d4b3e8; }

.empty { text-align: center; color: var(--muted); padding: 1.25rem .5rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.loading { color: var(--muted); padding: .75rem 0; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: thin;
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: .25rem .75rem 0; position: sticky; top: 0; z-index: 15;
}
.tab {
  -webkit-appearance: none; appearance: none; font: inherit; font-weight: 650; color: var(--ink-2);
  background: transparent; border: 0; border-bottom: 3px solid transparent; cursor: pointer;
  padding: .7rem .85rem; white-space: nowrap; min-height: 44px; border-radius: 6px 6px 0 0;
}
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab[aria-selected="true"] { color: var(--brand-strong); border-bottom-color: var(--brand); }
.tab-panel:focus-visible { box-shadow: none; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--surface-2); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
caption { text-align: left; padding: .5rem .7rem; font-weight: 700; }

/* ---------- Progress (verified vs pending) ---------- */
.hours-bar {
  position: relative; height: 22px; border-radius: 999px; background: #dfe9e5; overflow: hidden;
  display: flex; gap: 2px; border: 1px solid var(--line);
}
.hours-bar .seg { height: 100%; width: calc(var(--pct, 0) * 1%); min-width: 0; }
.hours-bar .seg-verified { background: var(--brand); }
.hours-bar .seg-pending {
  background: repeating-linear-gradient(45deg, #d48a1a 0 6px, #e7a640 6px 12px);
}
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--ink-2); margin-top: .5rem; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.sw-verified { background: var(--brand); }
.sw-pending { background: repeating-linear-gradient(45deg, #d48a1a 0 3px, #e7a640 3px 6px); }
.sw-left { background: #dfe9e5; border: 1px solid var(--line); }
.sw-target { background: var(--ink); width: 3px !important; }

.big-number { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.big-number small { font-size: 1rem; font-weight: 600; color: var(--muted); }

/* ---------- Checklist ---------- */
.gates { list-style: none; padding: 0; margin: 0; }
.gates li { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.gates li:last-child { border-bottom: 0; }
.gate-icon { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-weight: 800; font-size: .9rem; }
.gate-icon.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #a9d6b5; }
.gate-icon.no { background: var(--warn-bg); color: var(--warn); border: 1px solid #efcf9d; }

/* ---------- Lists of sessions / entries ---------- */
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.item-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem;
  display: grid; gap: .5rem;
}
.item-card.is-mine { border-color: var(--brand); box-shadow: inset 4px 0 0 var(--brand); }
.item-title { font-weight: 750; font-size: 1.02rem; }
.seats { font-size: .9rem; color: var(--ink-2); }
.seat-meter { height: 8px; background: #dfe9e5; border-radius: 999px; overflow: hidden; }
.seat-meter span { display: block; height: 100%; width: calc(var(--pct, 0) * 1%); background: var(--leaf); border-radius: 999px; }

/* ---------- Home hero ---------- */
.hero {
  background: linear-gradient(135deg, #0f6e66 0%, #145c4f 60%, #1d4d3c 100%); color: #fff;
  border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.hero h1, .hero h2 { color: #fff; }
.hero .muted { color: #cfe9e2; }
.hero a { color: #fff; }
.level-pill { display: inline-block; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.4); padding: .15rem .6rem; border-radius: 999px; font-weight: 700; font-size: .85rem; }

/* ---------- Role chooser (index) ---------- */
.roles { display: grid; gap: .75rem; grid-template-columns: 1fr; margin: 1rem 0; }
@media (min-width: 640px) { .roles { grid-template-columns: repeat(3, 1fr); } }
.role-btn {
  -webkit-appearance: none; appearance: none; font: inherit; text-align: left; cursor: pointer;
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius-lg); padding: 1rem;
  display: grid; gap: .25rem; color: var(--ink); min-height: 44px;
}
.role-btn:hover { border-color: var(--brand); }
.role-btn[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.role-btn .role-name { font-weight: 800; font-size: 1.1rem; }
.role-btn .role-desc { font-size: .88rem; color: var(--ink-2); }
.demo-box { border: 2px dashed var(--demo); background: var(--demo-bg); border-radius: var(--radius-lg); padding: 1rem; margin-top: 1rem; }
.demo-box h2 { color: var(--demo); font-size: 1.05rem; }
.demo-box dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem .9rem; margin: .5rem 0 0; font-size: .92rem; }
.demo-box dt { font-weight: 700; }
.demo-box dd { margin: 0; }
.demo-box code { font-family: var(--mono); background: #fff; padding: .05rem .35rem; border-radius: 4px; border: 1px solid #d4b3e8; }
.demo-fill { -webkit-appearance: none; appearance: none; font: inherit; font-family: var(--mono); background: #fff; color: var(--demo); border: 1px solid #b98bd6; border-radius: 6px; padding: .1rem .45rem; cursor: pointer; font-size: .88rem; }
.demo-fill:hover { background: var(--demo); color: #fff; }

/* ---------- Quiz ---------- */
.quiz-q { margin-bottom: 1.1rem; }
.quiz-q legend { font-weight: 700; font-size: 1.02rem; padding: 0; margin-bottom: .5rem; }
.quiz-q .topic { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-strong); font-weight: 700; margin-bottom: .2rem; }
.quiz-q.missing { border-color: var(--bad); }
.review-item { border-left: 4px solid var(--line); padding: .5rem .75rem; margin-bottom: .6rem; background: #fff; border-radius: 0 var(--radius) var(--radius) 0; }
.review-item.right { border-left-color: var(--ok); }
.review-item.wrong { border-left-color: var(--bad); }
.score-ring { font-size: 2.5rem; font-weight: 800; }

.orientation-section { margin-bottom: 1rem; }
.orientation-section ul { padding-left: 1.2rem; margin: .25rem 0 0; }
.key-points { background: var(--surface-2); border-radius: var(--radius); padding: .65rem .9rem; margin-top: .5rem; }
.key-points h4 { margin: 0 0 .25rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-strong); }

/* ---------- Badge ---------- */
.badge-screen {
  background: #fff; color: #000; border-radius: var(--radius-lg); padding: 1.25rem; text-align: center;
  border: 1px solid var(--line); box-shadow: var(--shadow); max-width: 460px; margin: 0 auto;
}
.badge-screen .qr { width: min(80vw, 340px); height: auto; display: block; margin: .5rem auto; }
.badge-code { font-family: var(--mono); font-size: 2rem; font-weight: 800; letter-spacing: .18em; margin: .25rem 0; }
.badge-name { font-weight: 700; font-size: 1.15rem; }
.badge-screen:fullscreen { max-width: none; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 0; }
.badge-screen:fullscreen .qr { width: min(80vmin, 640px); }

/* ---------- Kiosk ---------- */
.kiosk-body { background: #eaf2ef; }
.kiosk-top { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; justify-content: space-between; margin-bottom: 1rem; }
.kiosk-top .field { margin: 0; min-width: 240px; flex: 1; }
.kiosk-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 980px) { .kiosk-grid { grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); } }
.scan-area {
  background: var(--surface); border: 3px solid var(--brand); border-radius: var(--radius-lg);
  padding: 1rem; box-shadow: var(--shadow);
}
.scan-input { font-family: var(--mono); font-size: 2rem; text-transform: uppercase; letter-spacing: .15em; text-align: center; min-height: 72px; border-width: 2px; }
.scan-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px #9bd5c9; }
.camera-box { position: relative; background: #0d1f1c; border-radius: var(--radius); overflow: hidden; min-height: 90px; display: grid; place-items: center; margin-bottom: .75rem; }
.camera-box.is-on { aspect-ratio: 4 / 3; max-height: 60vh; }
.scan-area h2 { margin-top: 1.25rem; }
.camera-box video { width: 100%; height: 100%; object-fit: cover; }
.camera-box .camera-off { color: #d4e7e2; padding: 1rem; text-align: center; }
.camera-frame { position: absolute; inset: 15%; border: 3px solid rgba(255,255,255,.85); border-radius: 14px; pointer-events: none; }
.scan-banner {
  min-height: 112px; border-radius: var(--radius-lg); padding: 1rem 1.25rem; margin-bottom: 1rem;
  display: flex; align-items: center; gap: 1rem; font-size: 1.15rem; border: 2px solid var(--line);
  background: var(--surface); color: var(--ink-2);
}
.scan-banner .sb-icon { font-size: 2.6rem; line-height: 1; flex: none; width: 3rem; text-align: center; font-weight: 800; }
.scan-banner .sb-title { font-size: 1.7rem; font-weight: 800; line-height: 1.15; }
.scan-banner .sb-detail { font-size: 1.1rem; }
.scan-banner.is-in { background: #17672f; border-color: #17672f; color: #fff; }
.scan-banner.is-out { background: #1d43a0; border-color: #1d43a0; color: #fff; }
.scan-banner.is-error { background: #9d1c1c; border-color: #9d1c1c; color: #fff; }
.scan-banner.is-busy { background: var(--surface-2); }
.roster-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .75rem; }
.count-tile { border-radius: var(--radius); padding: .5rem; text-align: center; border: 1px solid var(--line); background: #fff; }
.count-tile b { display: block; font-size: 1.6rem; line-height: 1.1; }
.count-tile.in { border-color: #a9d6b5; background: var(--ok-bg); color: var(--ok); }
.count-tile.out { border-color: #b4c7f0; background: var(--info-bg); color: var(--info); }
.count-tile.na { color: var(--ink-2); }
.roster-list { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow: auto; }
.roster-list li { display: flex; justify-content: space-between; gap: .5rem; align-items: center; padding: .45rem .25rem; border-bottom: 1px solid var(--line); font-size: .95rem; }
.roster-group-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: .75rem 0 .25rem; font-weight: 700; }

/* ---------- Metrics ---------- */
.metric-card { display: grid; gap: .5rem; align-content: start; }
.metric-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.metric-value { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.metric-value small { font-size: .95rem; font-weight: 600; color: var(--muted); }
.target-bar { position: relative; height: 14px; background: #dfe9e5; border-radius: 999px; margin: .4rem 0 1.1rem; }
.target-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(min(var(--pct, 0), 100) * 1%); background: var(--brand); border-radius: 999px; }
.target-bar .mark { position: absolute; top: -5px; bottom: -5px; width: 3px; background: var(--ink); left: calc(min(var(--tpct, 100), 100) * 1% - 1.5px); border-radius: 2px; }
.target-bar .mark-label { position: absolute; top: 18px; font-size: .75rem; color: var(--ink-2); transform: translateX(-50%); left: calc(min(var(--tpct, 100), 100) * 1%); white-space: nowrap; }
.mini-chart { width: 100%; height: auto; display: block; }
.mini-chart .bar { fill: var(--brand); }
.mini-chart .bar:hover { fill: var(--brand-strong); }
.mini-chart .axis { stroke: #9fbcb2; stroke-width: 1; }
.mini-chart .target { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 5 4; }
.mini-chart text { font-family: var(--font); font-size: 11px; fill: var(--ink-2); }
.mini-chart .val { fill: var(--ink); font-weight: 700; }
.definition { font-size: .88rem; color: var(--ink-2); background: var(--surface-2); padding: .5rem .7rem; border-radius: var(--radius); }

/* ---------- Dialog ---------- */
dialog {
  border: 0; border-radius: var(--radius-lg); padding: 0; width: min(520px, calc(100vw - 2rem));
  box-shadow: 0 20px 60px rgba(0,0,0,.3); color: var(--ink);
}
dialog::backdrop { background: rgba(12, 30, 27, .55); }
.dialog-body { padding: 1.25rem; }
.dialog-actions { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; padding: 0 1.25rem 1.25rem; }

/* ---------- One-time code reveal ---------- */
.code-reveal { border: 2px solid var(--brand); background: var(--brand-soft); border-radius: var(--radius-lg); padding: 1rem; display: grid; gap: .5rem; justify-items: start; }
.code-reveal .badge-code { font-size: 1.8rem; }

/* ---------- Public record / verify ---------- */
.notice {
  border: 2px solid var(--warn); background: var(--warn-bg); color: #5f3404; border-radius: var(--radius);
  padding: .75rem 1rem; font-weight: 650;
}
.verified-stamp { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; color: var(--ok); background: var(--ok-bg); border: 2px solid #a9d6b5; padding: .3rem .8rem; border-radius: 999px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.kv dt { font-weight: 700; color: var(--ink-2); }
.kv dd { margin: 0; }

.record-sheet { background: #fff; color: #111; max-width: 800px; margin: 0 auto; padding: 2rem; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.record-sheet h1 { font-size: 1.5rem; }
.record-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid #111; padding-bottom: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.record-total { font-size: 1.3rem; font-weight: 800; }
.sign-block { display: grid; grid-template-columns: 1fr auto; gap: 1rem; margin-top: 1.5rem; align-items: end; }
.sign-line { border-bottom: 1px solid #111; height: 2.5rem; }
.record-qr { width: 120px; height: 120px; }

/* ---------- Badge sheet ---------- */
.badge-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.badge-card {
  background: #fff; color: #000; border: 1px dashed #777; border-radius: 10px; padding: .9rem; text-align: center;
  display: grid; justify-items: center; gap: .25rem; break-inside: avoid;
}
.badge-card .bc-org { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-strong); }
.badge-card .qr { width: 150px; height: 150px; }
.badge-card .bc-name { font-weight: 700; }
.badge-card .bc-code { font-family: var(--mono); font-size: 1.3rem; font-weight: 800; letter-spacing: .15em; }
.badge-card .bc-demo { font-size: .7rem; color: var(--demo); font-weight: 700; }
.page-break { display: none; }

/* ---------- Print ---------- */
@page { size: auto; margin: 14mm; }
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .no-print, .site-header, .tabs, .site-footer, .skip-link { display: none !important; }
  .demo-banner { background: #fff !important; color: #000 !important; border: 2px solid #000; }
  main, main.narrow, main.wide { max-width: none; padding: 0; }
  .record-sheet { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  a { color: #000; text-decoration: none; }
  .notice { color: #000; background: #fff; border-color: #000; }
  .badge-sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; }
  .badge-card { height: 80mm; border: 1px dashed #555; align-content: center; }
  .page-break { display: block; grid-column: 1 / -1; break-after: page; height: 0; }
  table { font-size: 10pt; }
  th { background: #eee !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.record-sheet h2 { margin-top: 1.25rem; }
.record-sheet tfoot th, .record-sheet tfoot td { border-top: 2px solid #111; background: #fff; }
.card h3.page-title { margin-top: 1.25rem; }
.badge-screen + .row { margin-top: 1rem; justify-content: center; }
.tab-panel .card, .tab-panel .msg { scroll-margin-top: 72px; }
tbody th { text-transform: none; letter-spacing: 0; font-size: .95rem; background: transparent; color: var(--ink); font-weight: 650; }
.item-card details > summary { cursor: pointer; }
.item-card form.card { margin: .25rem 0 0; box-shadow: none; background: var(--surface-2); }
.kiosk-grid > * { align-self: start; }

/* ---------- Long, unbroken names (60 chars, no spaces) must wrap, not scroll ---------- */
.grid > *, .row > *, .row-between > *, .metric-head > *, .header-actions > *, .kiosk-grid > *, .form-row > * { min-width: 0; }
.site-header, .header-actions, .row-between, .metric-head, .item-card, .card, .badge-card, .review-item { min-width: 0; }
.item-title, .whoami, .badge-name, .badge-card .bc-name, .hero h1, .msg, .review-item, .definition,
.metric-head h2, .gates li, .small { overflow-wrap: anywhere; word-break: normal; }
/* Table cells: "anywhere" on every cell would shrink all columns to one letter
   on a phone, so only the first (name) column may break anywhere, with a floor. */
td, th { overflow-wrap: break-word; }
td:first-child, th:first-child { overflow-wrap: anywhere; min-width: 8rem; }
.badge-card { overflow: hidden; }
.metric-head h2 { flex: 1 1 auto; }
.metric-head .chip { flex: 0 0 auto; }

/* ---------- Units back toward sale ---------- */
.unit-counts { display: grid; gap: .35rem; margin: .5rem 0 1rem; }
.unit-counts > div { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.unit-counts dt { color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.unit-counts dd { margin: 0; font-weight: 750; font-variant-numeric: tabular-nums; }
