/* ==========================================================================
   Scan-app (S6) — dark, mobile-first, 100dvh, safe areas, big touch targets.
   --------------------------------------------------------------------------
   Boot        .sa-boot
   Login       .lg .lg-inner .lg-top .lg-logo .lg-hero .lg-beam .lg-head .lg-title .lg-sub .lg-form
               .lg-code(.is-invalid|.is-complete) .lg-code-check .lg-submit .lg-foot .lg-secure .lg-alert
   Shell       .scan-app(.tab-scan|list|history) .sa-main  .tb .tb-row .tb-mark .tb-title .tb-entrance
               .tb-device .tb-status(.is-live|sync|offline) .tb-dot .tb-q .tb-event .tb-count .ring
               .ob (offline banner)  .tabbar .tab-item(.is-active) .tab-icon .tab-badge
   Scannen     .sv .sv-video .sv-stage .sv-frame .sv-corner .sv-line .sv-hint .sv-controls .sv-round
               .sv-type .sv-last .sv-na (camera unavailable)
   Result      .ro(.ro-ok|warn|error|neutral) .ro-icon .ro-title .ro-name .ro-chips .ro-code .ro-foot .ro-timer
   Gastenlijst .gl .gl-scroll .gl-head .gl-chips .chip .gl-row .gl-main .gl-side .gl-in .gl-checkin
   Historie    .hi .hi-head .hi-summary .hi-row(.is-ok|warn|error|neutral) .hi-icon .hi-tag
   Sheets      .sheet-root .sheet .sheet-head .sheet-body .sheet-foot  .ts (guest) .cs (code) .ev-* .mn-*
   ========================================================================== */

html, body { background: #0A0E14; overscroll-behavior: none; }
/* Pinch-zoom stays available (low-vision staff); only the double-tap zoom delay on controls goes. */
html { touch-action: manipulation; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; }

.theme-dark {
  --sa-max: 600px;
  --sa-bg: #0A0E14;
  --sa-glass: rgba(13, 18, 26, .78);
  --sa-line: rgba(255, 255, 255, .07);
  --sa-tab-h: 64px;
  /* Green deep enough for white text: title/name ≥ 3:1, chips (with their dark wash) ≥ 4.5:1. */
  --sa-ok-1: #14A566; --sa-ok-2: #0B7F4A; --sa-ok-3: #065C35;
  /* Secondary text readable on every dark surface of the app (≥ 4.5:1 on #0A0E14 … #151C28). */
  --text-subtle: #7A879B;
  --sa-warn-1: #FFC75A; --sa-warn-2: #F5A524; --sa-warn-3: #D0820B;
  --sa-err-1: #FF6E72; --sa-err-2: #E5484D; --sa-err-3: #A8232A;
}

.truncate { min-width: 0; }
.spinner-dots { display: inline-flex; gap: 4px; margin-right: 8px; }
.spinner-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .35; animation: sa-dots 1s infinite ease-in-out; }
.spinner-dots i:nth-child(2) { animation-delay: .15s; }
.spinner-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes sa-dots { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

/* ---------------------------------------------------------------- boot */
.sa-boot {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: radial-gradient(120% 60% at 50% -10%, rgba(34, 181, 166, .14), transparent 60%), var(--sa-bg);
  color: var(--text-muted);
}
.sa-boot img { height: 26px; width: auto; }

/* ================================================================ LOGIN */
.lg {
  min-height: 100vh; min-height: 100dvh; display: flex; justify-content: center;
  padding: calc(20px + var(--safe-top)) calc(20px + var(--safe-right)) calc(20px + var(--safe-bottom)) calc(20px + var(--safe-left));
  background:
    radial-gradient(110% 55% at 50% -12%, rgba(34, 181, 166, .20), transparent 62%),
    radial-gradient(70% 45% at 110% 105%, rgba(26, 155, 203, .12), transparent 60%),
    radial-gradient(60% 40% at -10% 90%, rgba(54, 212, 139, .07), transparent 60%),
    var(--sa-bg);
}
.lg-inner { width: 100%; max-width: 400px; display: flex; flex-direction: column; }
.lg-top { display: flex; justify-content: center; padding: 6px 0 0; }
.lg-logo { height: 24px; width: auto; opacity: .96; }
.lg-hero { position: relative; width: 132px; height: 92px; margin: clamp(22px, 6vh, 52px) auto clamp(14px, 3vh, 26px); display: grid; place-items: center; }
.lg-hero svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 14px 40px rgba(34, 181, 166, .28)); }
.lg-beam {
  position: absolute; left: 12%; right: 17%; height: 2px; top: 22%; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #36D48B 25%, #7CF2BD 50%, #36D48B 75%, transparent);
  box-shadow: 0 0 16px 3px rgba(54, 212, 139, .5);
  animation: lg-beam 2.4s var(--ease-in-out) infinite alternate;
}
@keyframes lg-beam { from { top: 22%; } to { top: 76%; } }
.lg-head { text-align: center; margin-bottom: 26px; }
.lg-title { font-size: 34px; font-weight: 720; letter-spacing: -0.035em; line-height: 1.05; color: #fff; }
.lg-sub { color: var(--text-muted); font-size: var(--text-md); line-height: 1.55; margin: 10px auto 0; max-width: 320px; }
.lg-alert { margin-bottom: 16px; }
.lg-form { display: flex; flex-direction: column; gap: 18px; }
.lg-form .field-label { font-size: var(--text-sm); color: var(--text-secondary); font-weight: 560; }
.lg-code {
  position: relative; display: flex; align-items: center; height: 72px; border-radius: 16px;
  background: linear-gradient(180deg, #121925, #0F151F); border: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 1px 2px rgba(0, 0, 0, .4);
  transition: border-color var(--dur) ease, box-shadow var(--dur) ease;
}
.lg-code:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring), inset 0 1px 0 rgba(255, 255, 255, .03); }
.lg-code.is-invalid { border-color: var(--danger); }
.lg-code.is-invalid:focus-within { box-shadow: 0 0 0 4px var(--danger-ring); }
.lg-code input {
  width: 100%; height: 100%; border: 0; background: transparent; outline: none; text-align: center;
  font-family: var(--font-mono); font-size: 30px; font-weight: 600; letter-spacing: .16em; text-indent: .16em;
  color: #fff; text-transform: uppercase; caret-color: var(--accent);
}
.lg-code input::placeholder { color: #334055; letter-spacing: .16em; }
.lg-code-check {
  position: absolute; right: 16px; top: 50%; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%;
  display: grid; place-items: center; color: #03201B; background: var(--brand-green);
  transform: scale(.4); opacity: 0; transition: transform 260ms var(--ease-spring), opacity 160ms ease;
}
.lg-code.is-complete:not(.is-invalid) .lg-code-check { transform: scale(1); opacity: 1; }
.lg-form .input-lg { height: 52px; border-radius: 12px; }
.lg-form .input-lg > input { font-size: var(--text-lg); }
.lg-submit { --btn-h: 56px; margin-top: 6px; border-radius: 14px; font-size: var(--text-lg); font-weight: 620; }
.theme-dark .lg-submit.btn-primary {
  background: linear-gradient(120deg, #1FA6C2 0%, #22B5A6 45%, #31CC8E 100%); border-color: transparent; color: #02211C;
  box-shadow: 0 10px 30px -10px rgba(34, 181, 166, .65), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.theme-dark .lg-submit.btn-primary:hover { filter: brightness(1.06); }
.lg-foot { margin-top: auto; padding-top: 32px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-subtle); font-size: var(--text-sm); text-align: center; }
.lg-foot > span { display: inline-flex; align-items: center; gap: 6px; }
.lg-foot > span > span { display: inline; }
.lg-foot strong { color: var(--text-muted); font-weight: 600; }
.lg-secure { color: #5BE39A; font-size: var(--text-xs); }

/* ================================================================ SHELL */
.scan-app {
  position: relative; display: flex; flex-direction: column;
  height: 100vh; height: 100dvh; margin: 0 auto; overflow: hidden;
  background: var(--sa-bg); color: var(--text);
}
@media (min-width: 900px) {
  .scan-app { max-width: var(--sa-max); }
  body.theme-dark { background: radial-gradient(90% 60% at 50% -20%, rgba(34, 181, 166, .10), transparent 60%), #06090E; }
  .scan-app { border-left: 1px solid var(--sa-line); border-right: 1px solid var(--sa-line); box-shadow: 0 0 80px rgba(0, 0, 0, .5); }
}
.sa-main { position: relative; flex: 1; min-height: 0; }

/* ---- top bar */
.tb {
  position: relative; z-index: 5; flex-shrink: 0;
  padding: calc(8px + var(--safe-top)) calc(12px + var(--safe-right)) 10px calc(14px + var(--safe-left));
  background: linear-gradient(180deg, #0E141D 0%, #0C1119 100%);
  border-bottom: 1px solid var(--sa-line);
}
.tb::after { /* hairline of brand gradient */
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 181, 166, .55) 30%, rgba(54, 212, 139, .55) 70%, transparent); opacity: .55;
}
.tb-row { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.tb-row-2 { margin-top: 6px; min-height: 40px; }
.tb-mark {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(180deg, #151D2A, #111822); border: 1px solid var(--border);
}
.tb-mark img { width: 22px; height: auto; }
.tb-title { flex: 1; min-width: 0; line-height: 1.2; }
.tb-entrance { font-size: 16px; font-weight: 650; letter-spacing: -0.015em; color: #fff; }
.tb-device { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.tb-status { /* 44px touch target; the pill inside carries the visuals */
  display: inline-flex; align-items: center; justify-content: center; height: 44px; min-width: 44px; padding: 0 2px;
  flex-shrink: 0; border-radius: 999px; color: var(--text-secondary);
}
.tb-status:focus-visible { outline: none; }
.tb-status:focus-visible .tb-pill { box-shadow: var(--shadow-focus); }
.tb-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px 0 10px; border-radius: 999px;
  font-size: var(--text-xs); font-weight: 600; letter-spacing: .01em;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--border);
}
.tb-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.tb-status.is-live .tb-dot::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--success); opacity: 0;
  animation: sa-pulse 2.4s ease-out infinite;
}
@keyframes sa-pulse { 0% { transform: scale(.5); opacity: .7; } 80%, 100% { transform: scale(1.4); opacity: 0; } }
.tb-status.is-sync .tb-dot { background: var(--info); animation: sa-blink 1s ease-in-out infinite; }
@keyframes sa-blink { 50% { opacity: .3; } }
.tb-status.is-offline { color: var(--warning-text); }
.tb-status.is-offline .tb-pill { border-color: rgba(245, 165, 36, .35); background: rgba(245, 165, 36, .1); }
.tb-status.is-offline .tb-dot { background: var(--warning); }
.tb-q {
  min-width: 18px; height: 18px; padding: 0 5px; margin-right: -4px; border-radius: 999px; display: grid; place-items: center;
  background: var(--warning); color: #231400; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.tb-menu.icon-btn { width: 44px; height: 44px; border-radius: 12px; color: var(--text-secondary); flex-shrink: 0; margin-right: -4px; }
.tb-event {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  border-radius: 12px; color: var(--text-secondary); font-size: var(--text-sm); font-weight: 560; text-align: left;
  background: rgba(255, 255, 255, .035); border: 1px solid var(--border);
}
.tb-event .icon:first-child { color: var(--accent-text); }
.tb-event.is-picker:hover { background: rgba(255, 255, 255, .06); border-color: var(--border-strong); }
.tb-event:disabled { cursor: default; opacity: 1; }
.tb-event > span { flex: 1; }
.tb-chev { color: var(--text-muted); }
.tb-count {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 9px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(180deg, rgba(34, 181, 166, .12), rgba(34, 181, 166, .06)); border: 1px solid rgba(44, 195, 167, .28);
  font-variant-numeric: tabular-nums;
}
.tb-count-num { font-size: var(--text-md); color: var(--text-secondary); letter-spacing: -0.01em; }
.tb-count-num strong { color: #fff; font-weight: 700; }
.tb-sep { color: var(--text-subtle); margin: 0 3px; }
.tb-count-label { font-size: var(--text-xs); color: var(--accent-text); font-weight: 560; }

.ring-track { stroke: rgba(255, 255, 255, .12); }
.ring-bar { stroke: #36D48B; transition: stroke-dasharray 500ms var(--ease-out); }

/* ---- offline banner */
.ob {
  position: relative; z-index: 4; display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  padding: 10px calc(14px + var(--safe-right)) 10px calc(14px + var(--safe-left));
  background: linear-gradient(90deg, rgba(245, 165, 36, .16), rgba(245, 165, 36, .08)); border-bottom: 1px solid rgba(245, 165, 36, .25);
  color: var(--warning-text); animation: sa-drop 220ms var(--ease-out);
}
@keyframes sa-drop { from { transform: translateY(-8px); opacity: 0; } }
.ob-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(245, 165, 36, .18); flex-shrink: 0; }
.ob-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.ob-text strong { font-size: var(--text-sm); color: #FFD27F; }
.ob-text span { font-size: var(--text-xs); color: rgba(251, 191, 85, .86); }
.ob.is-cache { animation: none; }

/* ---- tab bar */
.tabbar {
  position: relative; z-index: 5; flex-shrink: 0; display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 0 calc(6px + var(--safe-right)) var(--safe-bottom) calc(6px + var(--safe-left));
  background: #0C1119; border-top: 1px solid var(--sa-line);
}
.tab-item {
  position: relative; height: var(--sa-tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--text-subtle); font-size: 11.5px; font-weight: 560; letter-spacing: .01em; transition: color var(--dur-fast) ease;
}
.tab-item:hover { color: var(--text-muted); }
.tab-item.is-active { color: #fff; }
.tab-item.is-active::before {
  content: ''; position: absolute; top: -1px; left: 50%; width: 36px; height: 3px; margin-left: -18px; border-radius: 0 0 3px 3px;
  background: var(--brand-gradient); box-shadow: 0 0 14px rgba(54, 212, 139, .5);
}
.tab-item.is-active .tab-icon { color: var(--accent-text); }
.tab-icon { position: relative; display: grid; place-items: center; }
.tab-badge {
  position: absolute; top: -5px; right: -10px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  display: grid; place-items: center; background: var(--warning); color: #231400; font-size: 10px; font-weight: 700;
  border: 2px solid #0C1119;
}

/* ================================================================ SCANNEN */
.sv { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(90% 70% at 50% 40%, #121A26, #06090D); }
.sv-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sv.is-error .sv-video { display: none; }
.sv-stage { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.sv-top { position: absolute; z-index: 2; top: 14px; left: 14px; right: 14px; display: flex; justify-content: center; pointer-events: none; }
.sv-frame {
  --vf: min(72vw, 290px, 44dvh);
  position: relative; width: var(--vf); height: var(--vf); border-radius: 28px; margin-top: -40px;
  box-shadow: 0 0 0 200vmax rgba(4, 7, 11, .58);
  display: grid; place-items: center;
}
.sv-corner { position: absolute; width: 46px; height: 46px; border: 4px solid transparent; transition: border-color 200ms ease, transform 200ms var(--ease-spring); }
.sv-corner.tl { top: -2px; left: -2px; border-top-color: #22B5A6; border-left-color: #1A9BCB; border-top-left-radius: 28px; }
.sv-corner.tr { top: -2px; right: -2px; border-top-color: #36D48B; border-right-color: #2CC79A; border-top-right-radius: 28px; }
.sv-corner.bl { bottom: -2px; left: -2px; border-bottom-color: #1FA7BE; border-left-color: #1A9BCB; border-bottom-left-radius: 28px; }
.sv-corner.br { bottom: -2px; right: -2px; border-bottom-color: #36D48B; border-right-color: #36D48B; border-bottom-right-radius: 28px; }
.sv.is-flash .sv-corner { border-color: #5BF0A6 !important; transform: scale(1.04); }
.sv.is-flash .sv-frame { box-shadow: 0 0 0 200vmax rgba(4, 7, 11, .58), inset 0 0 60px rgba(54, 212, 139, .35); }
.sv-line {
  position: absolute; left: 10%; right: 10%; top: 12%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #36D48B 20%, #9BFFD0 50%, #36D48B 80%, transparent);
  box-shadow: 0 0 18px 4px rgba(54, 212, 139, .45);
  animation: sv-line 2.2s var(--ease-in-out) infinite alternate;
}
@keyframes sv-line { from { top: 12%; } to { top: 87%; } }
.sv-starting { display: inline-flex; align-items: center; color: var(--text-muted); font-size: var(--text-sm); }
.sv-banner {
  position: absolute; z-index: 3; top: 12px; left: 12px; right: 12px; display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px 11px 11px; border-radius: 14px; font-size: var(--text-sm); line-height: 1.45; color: #FFE2A8;
  background: rgba(46, 30, 5, .86); border: 1px solid rgba(245, 165, 36, .35);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); animation: sa-drop 220ms var(--ease-out);
}
.sv-banner strong { color: #FFD27F; font-weight: 650; }
.sv-banner-icon { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; background: rgba(245, 165, 36, .2); color: #FFC75A; }
.sv.has-banner .sv-na { padding-top: 110px; }
.sv-hint {
  margin-top: 26px; padding: 8px 14px; border-radius: 999px; font-size: var(--text-sm); color: rgba(255, 255, 255, .88);
  background: rgba(8, 12, 18, .55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); text-align: center; max-width: 90%;
}
.sv-controls {
  position: absolute; left: 0; right: 0; bottom: 18px; display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 0 16px;
}
.sv-round {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; color: #fff;
  background: var(--sa-glass); border: 1px solid rgba(255, 255, 255, .1);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: background var(--dur-fast) ease, transform 90ms ease;
}
.sv-round:active { transform: scale(.94); }
.sv-round.is-on { background: #FFF6D6; color: #3B2A00; border-color: #FFE7A0; }
.sv-round.is-ghost { visibility: hidden; }
.sv-type {
  height: 56px; padding: 0 22px; border-radius: 999px; display: inline-flex; align-items: center; gap: 10px;
  color: #fff; font-size: var(--text-md); font-weight: 600; letter-spacing: -0.005em;
  background: var(--sa-glass); border: 1px solid rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: transform 90ms ease, background var(--dur-fast) ease;
}
.sv-type:hover { background: rgba(22, 30, 42, .88); }
.sv-type:active { transform: scale(.97); }
.sv-type.is-note { color: var(--text-muted); font-weight: 520; font-size: var(--text-sm); cursor: default; }
.sv-last {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; height: 36px; padding: 0 12px 0 6px; border-radius: 999px;
  background: var(--sa-glass); border: 1px solid rgba(255, 255, 255, .1); font-size: var(--text-sm); color: #fff;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); animation: sa-drop 220ms var(--ease-out);
}
.sv-last-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.sv-last.is-ok .sv-last-icon { background: var(--sa-ok-2); }
.sv-last.is-warn .sv-last-icon { background: var(--sa-warn-2); color: #231400; }
.sv-last.is-error .sv-last-icon { background: var(--sa-err-2); }
.sv-last-name { font-weight: 560; }
.sv-last-time { color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: var(--text-xs); }
.sv-last.is-link { pointer-events: auto; height: 44px; padding-right: 10px; cursor: pointer; transition: background var(--dur-fast) ease; }
.sv-last.is-link:hover { background: rgba(22, 30, 42, .9); }
.sv-last.is-link:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.sv-last-chev { color: var(--text-muted); margin-left: -2px; }

/* camera unavailable */
.sv-na { position: absolute; inset: 0; overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: 20px 18px 28px; }
/* margin:auto centres vertically, yet collapses to 0 when the card is taller than the panel — so the
   top never ends up above the scrollable area (align-items:center would clip it). */
.sv-na-card { width: 100%; max-width: 400px; margin: auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; }
.sv-na-icon {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin-bottom: 18px;
  color: var(--warning-text); background: rgba(245, 165, 36, .1); border: 1px solid rgba(245, 165, 36, .28);
}
.sv-na[data-reason='insecure'] .sv-na-icon { color: var(--accent-text); background: rgba(44, 195, 167, .1); border-color: rgba(44, 195, 167, .3); }
.sv-na-title { font-size: 21px; font-weight: 680; letter-spacing: -0.02em; color: #fff; line-height: 1.25; }
.sv-na-text { color: var(--text-muted); margin-top: 10px; line-height: 1.6; font-size: var(--text-md); }
.sv-na-https { width: 100%; margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.sv-na-https .btn { --btn-h: 52px; border-radius: 14px; }
.sv-na-url {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .04); border: 1px dashed var(--border-strong); color: var(--text-secondary); font-size: var(--text-sm);
  -webkit-user-select: all; user-select: all;
}
.sv-na-note { color: var(--text-subtle); font-size: var(--text-sm); line-height: 1.55; margin-top: 4px; }
.sv-na-note strong { color: var(--text-secondary); }
.sv-na-actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.sv-na-actions .btn { --btn-h: 44px; border-radius: 12px; }

/* ================================================================ RESULT OVERLAY */
.ro {
  position: fixed; inset: 0; z-index: 105; display: flex; flex-direction: column; cursor: pointer; outline: none;
  overflow-y: auto; overscroll-behavior: contain;
  padding: calc(24px + var(--safe-top)) calc(24px + var(--safe-right)) calc(20px + var(--safe-bottom)) calc(24px + var(--safe-left));
  color: #fff; animation: ro-in 200ms var(--ease-out);
  -webkit-user-select: none; user-select: none;
}
.ro.is-leaving { animation: ro-out 160ms ease-in forwards; }
@keyframes ro-in { from { opacity: 0; transform: scale(1.03); } }
@keyframes ro-out { to { opacity: 0; transform: scale(.98); } }
.ro-ok { background: radial-gradient(120% 75% at 50% 18%, var(--sa-ok-1) 0%, var(--sa-ok-2) 48%, var(--sa-ok-3) 100%); }
.ro-warn { background: radial-gradient(120% 75% at 50% 18%, var(--sa-warn-1) 0%, var(--sa-warn-2) 48%, var(--sa-warn-3) 100%); color: #1E1300; }
.ro-error { background: radial-gradient(120% 75% at 50% 18%, var(--sa-err-1) 0%, var(--sa-err-2) 48%, var(--sa-err-3) 100%); }
.ro-neutral { background: radial-gradient(120% 75% at 50% 18%, #3A4658, #1F2733); }
.ro-inner { flex: 1 0 auto; width: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; }
/* Centred while it fits; when it does not (landscape phone) it starts at the top and the card scrolls. */
.ro-inner > :first-child { margin-top: auto; }
.ro-inner > :last-child { margin-bottom: auto; }
.ro-icon {
  width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 26px;
  background: #fff; box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .35), 0 0 0 10px rgba(255, 255, 255, .16);
  animation: ro-pop 420ms var(--ease-spring) both 40ms;
}
.ro-ok .ro-icon { color: var(--sa-ok-2); }
.ro-warn .ro-icon { color: var(--sa-warn-3); background: #1E1300; color: #FFC75A; box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .3), 0 0 0 10px rgba(30, 19, 0, .1); }
.ro-error .ro-icon { color: var(--sa-err-2); }
.ro-neutral .ro-icon { color: #3A4658; }
@keyframes ro-pop { from { transform: scale(.4); opacity: 0; } }
.ro-title { font-size: clamp(32px, 9vw, 44px); font-weight: 760; letter-spacing: -0.035em; line-height: 1.05; color: inherit; animation: ro-up 260ms var(--ease-out) both 80ms; }
.ro-desc { margin-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 12px; animation: ro-up 260ms var(--ease-out) both 120ms; }
@keyframes ro-up { from { transform: translateY(10px); opacity: 0; } }
.ro-when { font-size: var(--text-lg); opacity: .92; }
.ro-when strong { font-weight: 680; }
.ro-name {
  font-size: clamp(22px, 6.4vw, 30px); font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; max-width: 100%;
  overflow-wrap: anywhere; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.ro-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ro-chips { max-width: 100%; }
.ro-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; max-width: 100%; padding: 6px 13px 6px 11px; border-radius: 16px;
  background: rgba(255, 255, 255, .18); font-size: var(--text-sm); font-weight: 600; line-height: 1.3; text-align: left;
}
.ro-chip .icon { flex-shrink: 0; }
.ro-ok .ro-chip { background: rgba(0, 0, 0, .22); }
.ro-warn .ro-chip { background: rgba(30, 19, 0, .12); }
.ro-explain { font-size: var(--text-lg); line-height: 1.5; max-width: 380px; opacity: .95; }
.ro-code {
  font-family: var(--font-mono); font-size: var(--text-lg); font-weight: 600; letter-spacing: .1em;
  padding: 6px 14px; border-radius: 10px; background: rgba(0, 0, 0, .16);
}
.ro-warn .ro-code { background: rgba(30, 19, 0, .1); }
.ro-offline { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); font-weight: 560; padding: 5px 12px; border-radius: 999px; background: rgba(0, 0, 0, .2); }
.ro-warn .ro-offline { background: rgba(30, 19, 0, .1); }
.ro-undo {
  margin-top: 28px; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px;
  color: #fff; font-weight: 600; background: rgba(0, 0, 0, .18); border: 1px solid rgba(255, 255, 255, .28);
}
.ro-undo:hover { background: rgba(0, 0, 0, .26); }
.ro-undo:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.ro-ok .ro-undo { background: rgba(0, 0, 0, .24); }
.ro-foot { position: relative; text-align: center; font-size: var(--text-sm); font-weight: 560; opacity: .82; padding-bottom: 10px; }
.ro-timer {
  position: absolute; left: 50%; bottom: 0; width: 120px; height: 3px; margin-left: -60px; border-radius: 3px;
  background: rgba(255, 255, 255, .85); transform-origin: left center; animation: ro-timer linear forwards;
}
@keyframes ro-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-height: 500px) {
  .ro { padding-top: calc(12px + var(--safe-top)); padding-bottom: calc(8px + var(--safe-bottom)); }
  .ro-icon { width: 64px; height: 64px; margin-bottom: 12px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .35), 0 0 0 6px rgba(255, 255, 255, .16); }
  .ro-icon .icon { width: 34px; height: 34px; }
  .ro-title { font-size: 28px; }
  .ro-desc { margin-top: 8px; gap: 8px; }
  .ro-name { font-size: 21px; }
  .ro-explain { font-size: var(--text-md); }
  .ro-undo { margin-top: 14px; }
  .ro-foot { padding: 8px 0 6px; }
}

/* ================================================================ GASTENLIJST */
.gl { position: absolute; inset: 0; display: flex; flex-direction: column; }
.gl-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.gl-head {
  position: sticky; top: 0; z-index: 3; padding: 12px calc(14px + var(--safe-right)) 10px calc(14px + var(--safe-left));
  background: rgba(10, 14, 20, .92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--sa-line);
}
.gl-search.input { height: 48px; border-radius: 12px; background: #111823; }
.gl-search.input > input { font-size: var(--text-md); }
.gl-search .search-clear.icon-btn { width: 44px; height: 44px; margin-right: 1px; border-radius: 10px; }
.gl-chips {
  display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; margin: 10px calc(-14px - var(--safe-right)) 0 -2px;
  padding: 2px calc(40px + var(--safe-right)) 2px 2px; scroll-padding: 0 48px 0 8px;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
}
.gl-chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 15px; border-radius: 999px; flex-shrink: 0;
  font-size: var(--text-sm); font-weight: 560; color: var(--text-secondary); white-space: nowrap;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--border); transition: all var(--dur-fast) ease;
}
.chip:hover { border-color: var(--border-strong); }
.chip:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.chip-n { font-size: var(--text-xs); color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.chip.is-active { color: #03201B; background: #E9FBF4; border-color: #E9FBF4; }
.chip.is-active .chip-n { color: #0B6F5F; }
.chip.is-bad .chip-n { color: var(--danger-text); }
.chip.is-bad.is-active { color: #fff; background: rgba(229, 72, 77, .9); border-color: transparent; }
.chip.is-bad.is-active .chip-n { color: rgba(255, 255, 255, .85); }
.gl-list { padding: 4px 0 24px; }
.gl-row {
  position: relative; display: flex; align-items: center; min-height: 68px;
  border-bottom: 1px solid rgba(255, 255, 255, .045); transition: background var(--dur-fast) ease;
}
.gl-row:hover { background: rgba(255, 255, 255, .025); }
.gl-row.is-bad { opacity: .62; }
.gl-row.is-skel { gap: 12px; padding: 10px calc(14px + var(--safe-right)) 10px calc(14px + var(--safe-left)); }
/* "Open the guest": the button's ::after stretches over the whole row, "Check in" sits above it. */
.gl-open {
  flex: 1; min-width: 0; align-self: stretch; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px calc(14px + var(--safe-left)); text-align: left; color: inherit; cursor: pointer; outline: none;
}
.gl-open:only-child { padding-right: calc(14px + var(--safe-right)); }
.gl-open::after { content: ''; position: absolute; inset: 0; border-radius: 12px; transition: background var(--dur-fast) ease; }
.gl-open:active::after { background: rgba(255, 255, 255, .04); }
.gl-open:focus-visible::after { box-shadow: inset 0 0 0 2px var(--accent-text); }
.gl-open .gl-side { margin-left: auto; }
.gl-row > .gl-side { position: relative; z-index: 1; padding-right: calc(14px + var(--safe-right)); }
.gl-main { flex: 1; min-width: 0; display: block; }
.gl-name { display: block; font-size: var(--text-md); font-weight: 600; color: #fff; letter-spacing: -0.01em; }
.gl-sub { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: var(--text-xs); color: var(--text-muted); min-width: 0; }
.gl-type { min-width: 0; }
.gl-ev { color: var(--text-subtle); }
.gl-code { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em; color: var(--text-subtle); white-space: nowrap; }
.gl-side { flex-shrink: 0; display: flex; align-items: center; }
.gl-in {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px 0 5px; border-radius: 999px;
  background: rgba(47, 209, 122, .12); color: #7AF0B2; font-size: var(--text-sm); font-weight: 600; font-variant-numeric: tabular-nums;
}
.gl-in-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #1FC474; color: #032515; }
.gl-in.is-pending { background: rgba(245, 165, 36, .12); color: #FBC56A; }
.gl-in.is-pending .gl-in-icon { background: var(--warning); color: #231400; }
.gl-checkin {
  height: 44px; padding: 0 17px; border-radius: 999px; font-size: var(--text-sm); font-weight: 620; color: #7BEBD3;
  background: rgba(44, 195, 167, .1); border: 1px solid rgba(44, 195, 167, .38);
  transition: transform 90ms ease, background var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.gl-checkin:hover, .gl-checkin:focus-visible { background: linear-gradient(120deg, #2CC3A7, #36D48B); color: #03201B; border-color: transparent; }
.gl-checkin:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.gl-checkin:active { transform: scale(.95); }
.gl-checkin:disabled { opacity: .6; }
.gl-checkin[aria-busy='true'] { opacity: 1; cursor: progress; animation: sa-blink 900ms ease-in-out infinite; }
.gl-out { font-size: var(--text-xs); color: var(--text-subtle); }
.gl-bad { font-size: var(--text-xs); font-weight: 600; color: var(--danger-text); background: var(--danger-soft); padding: 5px 9px; border-radius: 999px; }
@media (max-width: 440px) { .gl:not(.is-searching) .gl-row.has-ev .gl-code { display: none; } }
.gl-more { display: flex; justify-content: center; padding: 18px; }
.gl-more .btn, .gl-empty .btn { --btn-h: 44px; border-radius: 12px; }
.gl-end { text-align: center; color: var(--text-subtle); font-size: var(--text-xs); padding: 18px 0 8px; }
.gl-empty { padding: 20px 16px; }

/* ================================================================ HISTORIE */
.hi { position: absolute; inset: 0; display: flex; flex-direction: column; }
.hi-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.hi-head {
  position: sticky; top: 0; z-index: 3; padding: 12px calc(14px + var(--safe-right)) 12px calc(14px + var(--safe-left));
  background: rgba(10, 14, 20, .92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--sa-line);
}
.hi-head .segmented { height: 50px; border-radius: 13px; }
.hi-head .segmented-item { height: 44px; font-size: var(--text-sm); border-radius: 10px; }
.hi-head .segmented-indicator { border-radius: 10px; }
.hi-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.hi-stat {
  display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--border);
}
.hi-stat strong { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hi-stat span { font-size: var(--text-xs); color: var(--text-muted); }
.hi-stat.is-ok strong { color: #5BE39A; }
.hi-stat.is-warn strong { color: #FBBF55; }
.hi-stat.is-error strong { color: #FF8A8E; }
.hi-list { padding: 4px 0 24px; }
.hi-row {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px calc(14px + var(--safe-right)) 10px calc(14px + var(--safe-left));
  border-bottom: 1px solid rgba(255, 255, 255, .045);
}
.hi-row.is-link { cursor: pointer; }
.hi-row.is-link:hover { background: rgba(255, 255, 255, .025); }
.hi-row.is-link:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent-text); border-radius: 12px; }
.hi-row.is-undone { opacity: .55; }
.hi-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.hi-row.is-ok .hi-icon { background: rgba(47, 209, 122, .16); color: #5BE39A; }
.hi-row.is-warn .hi-icon { background: rgba(245, 165, 36, .16); color: #FBBF55; }
.hi-row.is-error .hi-icon { background: rgba(242, 85, 90, .16); color: #FF8A8E; }
.hi-row.is-neutral .hi-icon { background: rgba(148, 163, 184, .14); color: #B4C0CF; }
.hi-main { flex: 1; min-width: 0; }
.hi-title { font-size: var(--text-md); font-weight: 600; color: #fff; }
.hi-sub { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.hi-note { display: flex; align-items: flex-start; gap: 5px; margin-top: 5px; font-size: var(--text-xs); color: #FBBF55; line-height: 1.4; }
.hi-note .icon { margin-top: 2px; }
.hi-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.hi-time { font-size: var(--text-sm); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.hi-tag {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 620; color: var(--text-muted); background: rgba(255, 255, 255, .06);
}
.hi-tag.is-queued { color: #231400; background: var(--warning); }
.hi-tag.is-me { color: var(--accent-text); background: rgba(44, 195, 167, .12); }

/* ================================================================ SHEETS */
.sheet-root { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-overlay { position: absolute; inset: 0; background: rgba(2, 5, 10, .62); opacity: 0; transition: opacity 220ms ease; }
.sheet-root[data-state='open'] .sheet-overlay { opacity: 1; }
.sheet {
  position: relative; width: 100%; max-width: 640px; max-height: min(90dvh, 820px); display: flex; flex-direction: column;
  background: linear-gradient(180deg, #151C28 0%, #111721 40%); border: 1px solid var(--border); border-bottom: 0;
  border-radius: 24px 24px 0 0; box-shadow: 0 -24px 60px -12px rgba(0, 0, 0, .6); outline: none;
  transform: translateY(100%); transition: transform 280ms var(--ease-out);
  padding-bottom: var(--safe-bottom);
}
.sheet-root[data-state='open'] .sheet { transform: translateY(0); }
.sheet-grab { display: flex; justify-content: center; padding: 10px 0 4px; cursor: grab; touch-action: none; flex-shrink: 0; }
.sheet-handle { width: 40px; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .18); }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: 6px 20px 4px; flex-shrink: 0; }
.sheet-heading { flex: 1; min-width: 0; }
.sheet-title { font-size: 20px; font-weight: 680; letter-spacing: -0.02em; color: #fff; }
.sheet-sub { color: var(--text-muted); margin-top: 4px; font-size: var(--text-sm); line-height: 1.5; }
.sheet-close.icon-btn { width: 44px; height: 44px; margin: -8px -10px 0 0; border-radius: 12px; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 20px 20px; overscroll-behavior: contain; }
.sheet-foot {
  display: flex; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid var(--sa-line); flex-shrink: 0;
  background: rgba(10, 14, 20, .5);
}
.sheet-foot .btn { --btn-h: 52px; border-radius: 14px; font-size: var(--text-md); }
@media (min-width: 900px) { .sheet { max-width: var(--sa-max); } }
@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-overlay, .ro, .ro-icon, .ro-title, .ro-desc, .sv-line, .lg-beam, .tb-dot::after { animation: none !important; transition: none !important; }
}
.sheet-foot .btn:focus-visible, .cs-form .btn:focus-visible { box-shadow: var(--shadow-focus); }

/* ---- guest sheet */
.ts-hero { display: flex; align-items: center; gap: 14px; padding-top: 6px; }
.ts-who { min-width: 0; }
.ts-name {
  font-size: 22px; font-weight: 700; letter-spacing: -0.025em; color: #fff; line-height: 1.2;
  overflow-wrap: anywhere; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.ts-email { color: var(--text-muted); font-size: var(--text-sm); margin-top: 3px; -webkit-user-select: text; user-select: text; }
.ts-status { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 12px 14px; border-radius: 14px; border: 1px solid; }
.ts-status > div { display: flex; flex-direction: column; min-width: 0; }
.ts-status strong { font-size: var(--text-md); font-weight: 650; }
.ts-status span:not(.ts-status-icon) { font-size: var(--text-sm); opacity: .85; }
.ts-status-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.ts-status.is-ok { background: rgba(47, 209, 122, .1); border-color: rgba(47, 209, 122, .3); color: #7AF0B2; }
.ts-status.is-ok .ts-status-icon { background: #1FC474; color: #032515; }
.ts-status.is-neutral { background: rgba(255, 255, 255, .03); border-color: var(--border); color: var(--text-secondary); }
.ts-status.is-neutral .ts-status-icon { background: rgba(255, 255, 255, .08); color: var(--text-secondary); }
.ts-status.is-error { background: rgba(242, 85, 90, .1); border-color: rgba(242, 85, 90, .3); color: #FF9A9D; }
.ts-status.is-error .ts-status-icon { background: var(--sa-err-2); color: #fff; }
.ts-dl { margin: 16px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--border); }
.ts-dl > div { background: #121925; padding: 11px 14px; min-width: 0; }
.ts-dl > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.ts-dl dt { font-size: var(--text-xs); color: var(--text-subtle); }
.ts-dl dd { margin: 2px 0 0; font-size: var(--text-md); font-weight: 580; color: #fff; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.ts-dl dd.mono { font-family: var(--font-mono); font-size: var(--text-sm); letter-spacing: .03em; }
.ts-log { margin-top: 20px; }
.ts-log-title { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--text-subtle); font-weight: 650; margin-bottom: 8px; }
.ts-log-list { display: flex; flex-direction: column; gap: 2px; }
.ts-log-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: var(--text-sm); color: var(--text-secondary); }
.ts-log-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.ts-log-row.is-ok .ts-log-icon { background: rgba(47, 209, 122, .18); color: #5BE39A; }
.ts-log-row.is-warn .ts-log-icon { background: rgba(245, 165, 36, .18); color: #FBBF55; }
.ts-log-row.is-error .ts-log-icon { background: rgba(242, 85, 90, .18); color: #FF8A8E; }
.ts-log-row.is-neutral .ts-log-icon { background: rgba(148, 163, 184, .16); color: #B4C0CF; }
.ts-log-text { flex: 1; min-width: 0; }
.ts-log-text strong { color: #fff; font-weight: 600; }
.ts-log-time { color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: var(--text-xs); }
.ts-log-empty { display: flex; align-items: center; gap: 6px; color: var(--text-subtle); font-size: var(--text-sm); }

/* ---- code sheet */
.cs-form { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.cs-input {
  position: relative; height: 76px; border-radius: 16px; display: flex; align-items: center;
  background: #0E141D; border: 1px solid var(--border-strong); transition: border-color var(--dur) ease, box-shadow var(--dur) ease;
}
.cs-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.cs-input.is-invalid { border-color: var(--danger); }
.cs-input.is-complete { border-color: rgba(54, 212, 139, .7); }
.cs-input input {
  width: 100%; height: 100%; border: 0; outline: none; background: transparent; text-align: center; padding: 0 48px;
  font-family: var(--font-mono); font-size: clamp(19px, 6vw, 28px); font-weight: 600; letter-spacing: .08em; color: #fff; caret-color: var(--accent);
}
.cs-input input::placeholder { color: #2E3A4C; }
.cs-count { position: absolute; right: 14px; font-size: var(--text-xs); color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.cs-input.is-complete .cs-count { color: #5BE39A; }
.cs-msg { font-size: var(--text-sm); color: var(--text-muted); min-height: 20px; text-align: center; }
.cs-msg.is-error { color: var(--danger-text); }
.cs-msg.is-warn { color: var(--warning-text); }
.cs-form .btn { --btn-h: 54px; border-radius: 14px; font-size: var(--text-md); margin-top: 4px; }

/* ---- event picker */
.ev-list { display: flex; flex-direction: column; gap: 8px; }
.ev-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 68px; padding: 12px 14px; border-radius: 16px; text-align: left;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--border); transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.ev-opt:hover { background: rgba(255, 255, 255, .05); }
.ev-opt.is-active { border-color: rgba(44, 195, 167, .7); background: rgba(44, 195, 167, .08); box-shadow: inset 0 0 0 1px rgba(44, 195, 167, .35); }
.ev-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ev-name { font-size: var(--text-md); font-weight: 620; color: #fff; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ev-when { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.ev-count { font-size: var(--text-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ev-count strong { color: #fff; }
.ev-check { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #03201B; background: var(--brand-green); opacity: 0; transform: scale(.5); transition: all 200ms var(--ease-spring); }
.ev-opt.is-active .ev-check { opacity: 1; transform: scale(1); }
.ev-opt:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.ev-auto-ic {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  color: var(--accent-text); background: rgba(44, 195, 167, .1); border: 1px solid rgba(44, 195, 167, .3);
}
.ev-note { display: flex; align-items: center; gap: 7px; margin-top: 14px; color: var(--text-muted); font-size: var(--text-sm); }
.ev-note .icon { color: var(--text-subtle); flex-shrink: 0; }

/* ---- menu */
.mn-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .03); border: 1px solid var(--border); }
.mn-mark { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: #0E141D; border: 1px solid var(--border); flex-shrink: 0; }
.mn-card-main { min-width: 0; }
.mn-entrance { font-size: var(--text-lg); font-weight: 680; color: #fff; letter-spacing: -0.015em; }
.mn-meta { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; line-height: 1.45; }
.mn-list { margin-top: 12px; display: flex; flex-direction: column; }
.mn-item {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 8px 4px; text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, .05); color: var(--text); border-radius: 0;
}
.mn-item:last-child { border-bottom: 0; }
button.mn-item:hover .mn-ic { background: rgba(255, 255, 255, .09); }
.mn-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; background: rgba(255, 255, 255, .05); color: var(--text-secondary); transition: background var(--dur-fast) ease; }
.mn-label { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mn-label > span { font-size: var(--text-md); font-weight: 580; }
.mn-label small { font-size: var(--text-xs); color: var(--text-muted); margin-top: 1px; }
.mn-chev { color: var(--text-subtle); }
.mn-item.is-toggle { cursor: pointer; }
.mn-item.is-toggle:hover .mn-ic { background: rgba(255, 255, 255, .09); }
.mn-switch { flex-shrink: 0; align-items: center; margin-right: 4px; }
.mn-switch .toggle-track { margin-top: 0; }
button.mn-item:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent-text); border-radius: 12px; }
.mn-item.is-danger { color: var(--danger-text); }
.mn-item.is-danger .mn-ic { background: rgba(242, 85, 90, .12); color: var(--danger-text); }
.mn-rename { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.mn-rename-actions { display: flex; justify-content: flex-end; gap: 8px; }
.mn-rename-actions .btn { --btn-h: 44px; border-radius: 12px; }
.mn-foot { margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--text-subtle); font-size: var(--text-xs); }
.mn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); }
.mn-dot.is-on { background: var(--success); }

/* ---- kit overrides inside the scan app */
/* Toasts are compact snackbars just above the tab bar (never over the search field or the top bar
   controls). While a bottom sheet is open they move to the top, so they never cover sheet buttons. */
.theme-dark .toast-stack {
  top: auto; bottom: calc(var(--sa-tab-h) + var(--safe-bottom) + 10px); left: 50%; right: auto;
  transform: translateX(-50%); width: min(440px, calc(100vw - 20px));
}
body:not(:has(.tabbar)) .toast-stack { bottom: calc(16px + var(--safe-bottom)); }
body:has(.sheet-root) .toast-stack { top: calc(10px + var(--safe-top)); bottom: auto; }
.theme-dark .toast { border-color: var(--border-strong); box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .75); }
/* 44px targets for the toast's close and action buttons (the toast itself stays compact). */
.theme-dark .toast .toast-close.icon-btn { width: 44px; height: 44px; margin: -12px -10px -10px 0; border-radius: 10px; }
.theme-dark .toast-action .btn { --btn-h: 44px; padding: 0 16px; border-radius: 10px; }
.theme-dark .modal-footer .btn { --btn-h: 44px; }
.theme-dark .segmented { background: #0E141D; }
.theme-dark .alert { border-radius: 14px; }

/* ---- small phones */
@media (max-width: 440px) { .tb-count.is-wide .tb-count-label { display: none; } }
@media (max-width: 360px) {
  .tb-count-label { display: none; }
  .tb-status-text { display: none; }
  .tb-pill { padding: 0 9px; }
  .lg-code input { font-size: 26px; }
}
