/* Shared foundation for admin, kiosk and standalone pages. Admin layouts live in admin-registry.css. */
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/static/fonts/golos-text-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/static/fonts/golos-text-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  color-scheme: light;
  --font: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --canvas: #f4f5f7;
  --surface: #ffffff;
  --inset: #f1f3f6;
  --hover: #f6f8fb;
  --line: #e1e5ea;
  --control-line: #b6bec8;
  --text: #1b2128;
  --muted: #5c6672;
  --accent: #1d5fc2;
  --accent-hover: #174fa3;
  --accent-soft: #e9f1fd;
  --accent-line: #b9cff2;
  --success: #13723a;
  --success-bg: #e2f4e8;
  --success-line: #a9dbb9;
  --warning: #8a5200;
  --warning-bg: #fdf0d8;
  --warning-line: #efcd8c;
  --danger: #b42318;
  --danger-bg: #fdeceb;
  --danger-line: #f1b5af;
  --neutral: #4b5563;
  --neutral-bg: #eef1f4;
  --radius: 6px;
  --panel-radius: 8px;
  --control-height: 38px;
  --duration: 160ms;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  font: 14px/1.5 var(--font);
  color: var(--text);
  background: var(--canvas);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; background: var(--canvas); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, legend { line-height: 1.3; font-weight: 600; }
h1 { font-size: 26px; margin: 0; letter-spacing: -.01em; }
h2, legend { font-size: 18px; }
h3 { font-size: 16px; }
h4 { font-size: 15px; }
strong { font-weight: 600; }
p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
.muted, small { color: var(--muted); }
small { font-size: 12px; line-height: 1.5; }
code { padding: 2px 4px; border-radius: 4px; background: var(--inset); overflow-wrap: anywhere; }
.secret-link, .one-time-code { overflow-wrap: anywhere; }
.one-time-code { font-size: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
table, .numeric, time { font-variant-numeric: tabular-nums; }

/* One motion for everything that appears: dialogs, menus, disclosures and expanded rows. */
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* Buttons: primary (blue), secondary (white), danger (red); .small for row actions. */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  width: auto; max-width: 100%; min-height: var(--control-height); padding: 7px 16px;
  border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--accent); color: #fff; font: 500 14px/1.4 var(--font);
  text-align: center; text-decoration: none; overflow-wrap: anywhere; cursor: pointer;
  transition: background-color var(--duration) var(--ease), border-color var(--duration) var(--ease), color var(--duration) var(--ease);
}
button:enabled:hover, .button:not(:disabled):hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
button.secondary, .button.secondary, .nav-toggle, .pwa-install { background: var(--surface); color: var(--text); border-color: var(--control-line); }
button.secondary:enabled:hover, .button.secondary:not(:disabled):hover, button.nav-toggle:enabled:hover, button.pwa-install:enabled:hover { background: var(--hover); color: var(--text); border-color: #98a2ae; }
button.danger, .button.danger { color: var(--danger); background: var(--surface); border-color: var(--danger-line); }
button.danger:enabled:hover, .button.danger:not(:disabled):hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
button.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
button.danger-solid:enabled:hover { background: #911c13; border-color: #911c13; color: #fff; }
button.small, .button.small { min-height: 30px; padding: 4px 10px; font-size: 13px; }
button.link-button { min-height: 32px; padding: 4px 0; border: 0; background: transparent; color: var(--muted); font-weight: 500; text-align: left; }
button.link-button:enabled:hover { background: transparent; color: var(--text); border: 0; }
button:disabled, .button:disabled { background: var(--inset); color: #8a939e; border-color: var(--line); cursor: not-allowed; }
button, .button, input, select, textarea, summary { touch-action: manipulation; }
:is(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Fields. */
label { display: flex; flex-direction: column; min-width: 0; gap: 6px; font-weight: 500; font-size: 13px; color: var(--text); }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea {
  width: 100%; min-width: 0; min-height: var(--control-height); padding: 7px 11px;
  border: 1px solid var(--control-line); border-radius: var(--radius); background: var(--surface); color: var(--text); font: 400 14px/1.4 var(--font);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
textarea { resize: vertical; }
input[type=file]::file-selector-button { margin-right: var(--space-2); padding: 3px 8px; border: 1px solid var(--control-line); border-radius: 4px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--hover); }
input::placeholder, textarea::placeholder { color: #8a939e; opacity: 1; }
input:disabled, select:disabled, textarea:disabled { background: var(--inset); color: var(--muted); cursor: not-allowed; }
input.input-invalid, .employee-picker.field-invalid { border-color: var(--danger); background: var(--danger-bg); }
.check-row, label.toggle-row { flex-direction: row; align-items: start; gap: var(--space-2); font-weight: 400; font-size: 14px; overflow-wrap: anywhere; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 18px; flex: 0 0 18px; padding: 0; margin: 1px 0 0; accent-color: var(--accent); }
.button-stack, .compact-form { display: grid; gap: var(--space-3); }
.button-stack > .button, .button-stack > button { width: 100%; }
.compact-form { margin: var(--space-3) 0; }
.inline { display: inline; }

/* Disclosures: every inline expandable block has the same chevron and the same reveal. */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details:not([data-dialog]) > summary { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) 0; color: var(--accent); font-weight: 500; }
details:not([data-dialog]) > summary::before {
  content: ""; flex: 0 0 auto; width: 7px; height: 7px; margin: 0 3px 0 1px;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg);
  transition: transform var(--duration) var(--ease);
}
details:not([data-dialog])[open] > summary::before { transform: rotate(45deg); }
details:not([data-dialog]) > summary:hover { color: var(--accent-hover); }
details[open] > :not(summary) { animation: reveal var(--duration) var(--ease); }
details[open] > summary { margin-bottom: var(--space-2); }
/* Panels that open a dialog use a secondary trigger when no button style is set. */
details[data-dialog] > summary:not(.button) {
  display: inline-flex; align-items: center; justify-content: center; min-height: 30px; padding: 4px 10px;
  border: 1px solid var(--control-line); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500;
  transition: background-color var(--duration) var(--ease);
}
details[data-dialog] > summary:not(.button):hover { background: var(--hover); }

/* Status tags: readable tint, border and first capital letter regardless of label source. */
.status {
  display: inline-block; width: fit-content; max-width: 100%; padding: 2px 8px;
  border: 1px solid var(--line); border-radius: 4px; background: var(--neutral-bg); color: var(--neutral);
  font-size: 12px; font-weight: 600; line-height: 1.5; white-space: normal; overflow-wrap: anywhere;
}
.status::first-letter { text-transform: uppercase; }
.status:is(.ok, .active, .approved, .arrived, .arrived_on_time, .ready, .staged, .verified, .up_to_date) { color: var(--success); background: var(--success-bg); border-color: var(--success-line); }
.status:is(.warning, .late, .check_failed, .stage_failed, .older_manifest) { color: var(--warning); background: var(--warning-bg); border-color: var(--warning-line); }
.status:is(.error, .failed, .rejected, .verification_failed, .no_show, .offline, .revoked) { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }
.status:is(.available, .scheduled, .pending, .unverified) { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }

/* Messages. */
.alert, .warning-box, .form-error, .import-errors, .success-inline, .face-similarity-warning, .info-box {
  padding: var(--space-3) var(--space-4); margin: var(--space-4) 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--inset); color: var(--text); overflow-wrap: anywhere;
}
.warning-box, .face-similarity-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-line); }
.form-error, .import-errors, .alert.error, .error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-line); }
.error { padding: var(--space-3) var(--space-4); border-radius: var(--radius); }
.alert.success, .success-inline, .success-box { background: var(--success-bg); color: var(--success); border-color: var(--success-line); }
.form-error { margin: 0; padding: var(--space-2) var(--space-3); font-size: 13px; }
.face-similarity-warning p { margin: var(--space-2) 0 var(--space-3); }
.import-errors h3, .import-errors p { margin-top: 0; }
.import-errors ul { margin-bottom: 0; padding-left: 20px; }

/* Surfaces and offline shell. */
.card { min-width: 0; padding: var(--space-5); margin: 0 0 var(--space-5); border: 1px solid var(--line); border-radius: var(--panel-radius); background: var(--surface); }
.card > :is(h1, h2, h3):first-child { margin-top: 0; }
.empty-state { padding: var(--space-5); color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--panel-radius); }
.offline-banner { padding: var(--space-3) var(--space-4); background: var(--warning-bg); color: var(--warning); text-align: center; }
.login-offline-banner { position: fixed; inset: 0 0 auto; z-index: 4; }
.centered { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; }
.registry-standalone { font-size: 16px; }
.standalone-shell { width: min(480px, 100%); min-width: 0; }
.standalone-brand { margin: 0 0 var(--space-4); color: var(--text); font-size: 15px; font-weight: 600; }
.registry-standalone .login-card, .registry-standalone .device-card { display: grid; gap: .85rem; width: 100%; margin: 0; overflow-wrap: anywhere; }
.registry-standalone :is(.login-card, .device-card) h1 { margin: 0; font-size: 24px; }
.registry-standalone :is(.login-card, .device-card) p { margin: 0; }
.registry-standalone .button-stack { margin-top: var(--space-2); }
.error-code { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .05em; }
.button.messenger-button { gap: var(--space-3); min-height: 52px; font-size: 16px; font-weight: 600; color: #1f2937; }
.button.messenger-button img { width: 28px; height: 28px; flex-shrink: 0; }
/* Light tints keep the coloured logos distinct; hover and press only deepen the tint. */
.button.messenger-button.messenger-telegram { background: #eff8ff; border-color: #0284c7; }
.button.messenger-button.messenger-telegram:hover { background: #e0f2fe; border-color: #0284c7; color: #1f2937; }
.button.messenger-button.messenger-telegram:active { background: #bae6fd; }
.button.messenger-button.messenger-max { background: #f5f0ff; border-color: #7c3aed; }
.button.messenger-button.messenger-max:hover { background: #ede5ff; border-color: #7c3aed; color: #1f2937; }
.button.messenger-button.messenger-max:active { background: #ddd6fe; }

/* Kiosk: a white full-screen device view with one large target per state. The page is exactly
   one visible viewport tall (browser bars and system insets excluded); the camera or QR code
   takes whatever height the text leaves, so instructions and status lines stay on screen. When
   even the minimum camera size does not fit, the panel scrolls instead of clipping content. */
.registry-kiosk {
  --kiosk-stage-min: 168px;
  --kiosk-qr-min: 160px;
  --kiosk-title-size: clamp(22px, min(4vw, 6vh), 44px);
  --kiosk-action-size: clamp(20px, min(2.8vw, 4.2vh), 30px);
  --kiosk-hint-size: clamp(16px, min(2vw, 3.2vh), 20px);
  height: 100vh; height: 100dvh; overflow: hidden;
  display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr);
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: var(--surface);
}
.kiosk-chrome { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 2px 24px; min-width: 0; padding: clamp(6px, 1.4vh, 14px) clamp(16px, 3vw, 40px); border-bottom: 1px solid var(--line); color: var(--muted); font-size: clamp(13px, min(1.5vw, 2.4vh), 16px); overflow-wrap: anywhere; }
.kiosk-chrome strong { color: var(--text); }
.kiosk-clock { color: var(--text); font-size: clamp(15px, min(2.2vw, 3.4vh), 22px); font-weight: 600; }
.kiosk-panel { container-type: inline-size; display: flex; flex-direction: column; width: min(1100px, calc(100% - 32px)); min-width: 0; min-height: 0; margin: 0 auto; padding: clamp(8px, 2vh, 28px) 0; overflow-y: auto; text-align: center; overflow-wrap: anywhere; }
/* A section is exactly as tall as the panel. Content that cannot fit overflows downwards and the
   panel scrolls ("safe" keeps the top reachable); nothing is clipped. */
.kiosk-panel > section:not([hidden]) { flex: 1 1 0; min-height: 0; display: grid; justify-items: center; align-content: safe center; gap: clamp(6px, 1.6vh, 20px); width: 100%; min-width: 0; animation: fade-in 240ms var(--ease); }
.kiosk-panel h1, .kiosk-help.kiosk-bot-qr-dialog h2 { font-size: var(--kiosk-title-size); line-height: 1.18; margin: 0; font-weight: 600; letter-spacing: -.015em; text-wrap: balance; }
/* Media rows grow to the size the width allows and no further, so spare height surrounds the
   whole group instead of separating a picture from its text. */
/* The start screen: two equal ways to mark an arrival, named after what the employee does. */
#kiosk-choice { --kiosk-choice-gap: clamp(10px, 2.4vh, 28px); }
.kiosk-choice-options, .kiosk-choice-actions { display: grid; gap: var(--kiosk-choice-gap); width: min(100%, 960px); }
.kiosk-choice-options { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.kiosk-choice-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kiosk-choice-actions > button { width: min(100%, 220px); min-width: 0; }
.kiosk-choice-actions > :first-child { justify-self: end; }
.kiosk-choice-actions > :last-child { justify-self: start; }
#kiosk-bot-qr-open { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
#kiosk-bot-qr-open svg { flex: none; }
.kiosk-choice-option { display: grid; align-content: start; gap: clamp(6px, 1.2vh, 12px); min-width: 0; padding: clamp(12px, 2.6vh, 28px); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.registry-kiosk .kiosk-choice-option button { width: 100%; min-height: clamp(60px, 11vh, 96px); font-size: var(--kiosk-action-size); font-weight: 600; }
.kiosk-choice-option p { margin: 0; color: var(--muted); font-size: clamp(15px, min(1.8vw, 2.8vh), 18px); line-height: 1.4; text-wrap: balance; }
.kiosk-next-meeting { max-width: 48ch; margin: 0; color: var(--text); font-size: clamp(15px, min(1.8vw, 2.8vh), 18px); line-height: 1.4; text-wrap: balance; }
.kiosk-choice-notice { max-width: 40ch; margin: 0; color: var(--danger); font-size: clamp(15px, min(1.8vw, 2.8vh), 18px); line-height: 1.4; }
.kiosk-screen-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; }
.kiosk-screen-actions p { margin: 0; }
#kiosk-show-qr:not([hidden]) { grid-template-rows: auto minmax(var(--kiosk-qr-min), min(100cqw, 560px)) auto auto auto; }
/* Reading an invitation QR: the same camera, a square target and no face guide. The preview is
   mirrored like the face check; the decoder reads the unmirrored pixels. */
#kiosk-scan:not([hidden]) { --video-aspect: 1.7778; grid-template-rows: auto auto minmax(var(--kiosk-stage-min), calc(100cqw / var(--video-aspect))) auto; }
#scan-video { display: block; width: 100%; height: 100%; object-fit: cover; }
.scan-stage.is-mirrored #scan-video { transform: scaleX(-1); }
.scan-frame { position: absolute; left: 50%; top: 50%; width: min(64cqw, 74cqh); aspect-ratio: 1; border: 4px solid #ffffffd9; border-radius: 16px; box-shadow: 0 0 0 9999px #00000047; transform: translate(-50%, -50%); pointer-events: none; transition: border-color var(--duration) var(--ease); }
.scan-frame[data-state=found] { border-color: #3ccf75; border-width: 6px; }
/* The status is often two lines; its row keeps the full text instead of one hint line. */
#kiosk-scan-status { min-height: auto; }
#kiosk-scan-status[data-kind=error] { color: var(--danger); font-weight: 600; }
.kiosk-qr-area { container-type: size; display: grid; place-items: center; width: 100%; min-height: 0; }
.kiosk-qr { width: min(100cqw, 100cqh, 560px); aspect-ratio: 1; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.kiosk-qr-timer { display: grid; gap: 6px; width: min(100%, 420px); }
.kiosk-qr-progress { height: 6px; overflow: hidden; border-radius: 3px; background: var(--inset); }
.kiosk-qr-progress > span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left center; transition: transform 250ms linear; }
.kiosk-qr-countdown { margin: 0; color: var(--muted); font-size: clamp(15px, min(1.8vw, 2.8vh), 17px); font-variant-numeric: tabular-nums; }
.kiosk-qr-note { margin: 0; color: var(--muted); font-size: clamp(15px, min(1.8vw, 2.8vh), 18px); }
/* One short command, an optional short hint, then the camera sized to the remaining space. */
#kiosk-camera:not([hidden]) { --video-aspect: 1.7778; grid-template-rows: auto auto minmax(var(--kiosk-stage-min), calc(100cqw / var(--video-aspect))) auto; }
#kiosk-instruction { min-height: 1.18em; }
.kiosk-hint { min-height: 1.35em; margin: 0; color: var(--muted); font-size: var(--kiosk-hint-size); line-height: 1.35; text-wrap: balance; }
.kiosk-stage-area { container-type: size; display: grid; place-items: center; width: 100%; min-width: 0; min-height: 0; }
/* The stage takes the stream's own aspect ratio, so the frame, the oval and the arrow sit on
   the real picture without letterbox bars. Only the preview is mirrored; frames are not. */
.camera-stage { container-type: size; position: relative; width: min(100cqw, calc(100cqh * var(--video-aspect))); aspect-ratio: var(--video-aspect); overflow: hidden; border-radius: 12px; background: #000; }
#camera-video { display: block; width: 100%; height: 100%; object-fit: cover; }
.camera-stage.is-mirrored #camera-video { transform: scaleX(-1); }
.face-guide { position: absolute; left: 50%; top: 50%; height: var(--face-guide-height, 56%); aspect-ratio: 3 / 4; max-width: 86%; border: 4px solid #ffffffd9; border-radius: 50%; box-shadow: 0 0 0 9999px #00000047; transform: translate(-50%, -50%); pointer-events: none; transition: border-color var(--duration) var(--ease); }
.face-guide[data-state=adjust] { border-color: #ffc35c; border-style: dashed; }
.face-guide[data-state=ready] { border-color: #3ccf75; border-width: 6px; }
.kiosk-direction { position: absolute; top: 50%; z-index: 1; display: grid; place-items: center; width: clamp(32px, 18cqmin, 120px); aspect-ratio: 1; border-radius: 50%; background: var(--accent); color: #fff; font-size: clamp(20px, 11cqmin, 60px); line-height: 1; transform: translateY(-50%); animation: fade-in var(--duration) var(--ease); }
.kiosk-direction[data-direction=left] { left: 3%; animation: fade-in var(--duration) var(--ease), nudge-left 1.2s var(--ease) 240ms infinite; }
.kiosk-direction[data-direction=right] { right: 3%; animation: fade-in var(--duration) var(--ease), nudge-right 1.2s var(--ease) 240ms infinite; }
@keyframes nudge-left { 50% { transform: translate(-14%, -50%); } }
@keyframes nudge-right { 50% { transform: translate(14%, -50%); } }
.kiosk-timer { position: absolute; left: 50%; bottom: 5%; z-index: 1; max-width: 92%; margin: 0; padding: .3em .95em; border-radius: 999px; background: #000000b8; color: #fff; font-size: clamp(1rem, 6cqmin, 1.6rem); font-weight: 600; font-variant-numeric: tabular-nums; transform: translateX(-50%); }
.kiosk-camera-status { width: min(100%, 900px); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 20px; }
.kiosk-camera-status p { margin: 0; }
.kiosk-steps { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.kiosk-steps li { width: 12px; height: 12px; border: 2px solid var(--accent); border-radius: 50%; }
.kiosk-steps li.is-done, .kiosk-steps li.is-current { background: var(--accent); }
#kiosk-stage-label { font-size: clamp(17px, min(2.2vw, 3.4vh), 22px); font-weight: 600; }
#kiosk-attempt-label { color: var(--muted); font-size: clamp(15px, min(1.9vw, 2.9vh), 19px); }
.result-icon { display: grid; place-items: center; width: clamp(80px, 15vh, 150px); aspect-ratio: 1; border-radius: 50%; background: var(--success); color: #fff; font-size: clamp(2.6rem, 7.5vh, 5rem); font-weight: 600; line-height: 1; }
.result-icon:empty { display: none; }
.result-icon[data-kind=warning] { background: #c27a00; }
.result-icon[data-kind=error], .result-icon.result-icon-muted { background: var(--danger); }
.result-icon[data-kind=info] { background: var(--accent); }
#kiosk-result-text, #kiosk-offline p { max-width: 36ch; margin: 0; color: var(--muted); font-size: clamp(16px, min(2vw, 3.2vh), 20px); line-height: 1.45; text-wrap: balance; }
.kiosk-result-note { margin: 0; color: var(--muted); font-size: clamp(15px, min(1.8vw, 2.8vh), 17px); font-variant-numeric: tabular-nums; }
.registry-kiosk button { min-height: 56px; padding: 12px 28px; border-radius: 10px; font-size: 1.15rem; }
.registry-kiosk button.kiosk-help-button, .registry-kiosk button.kiosk-back-button { min-height: 44px; padding: 8px 18px; font-size: clamp(15px, min(1.8vw, 2.8vh), 17px); }
/* Longer explanations stay out of the capture flow and open on request. */
.kiosk-help { width: min(640px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: clamp(16px, 3vh, 28px); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); overflow-y: auto; text-align: left; }
.kiosk-help[open]:not(.kiosk-bot-qr-dialog) { animation: dialog-in 200ms var(--ease); }
.kiosk-help::backdrop { background: #0f172a80; }
.kiosk-help h2 { margin: 0 0 12px; font-size: clamp(19px, min(2.6vw, 4vh), 24px); }
.kiosk-help ol { display: grid; gap: 8px; margin: 0 0 14px; padding-left: 1.4em; font-size: clamp(16px, min(2vw, 3vh), 18px); line-height: 1.4; }
.kiosk-help p { color: var(--muted); font-size: clamp(15px, min(1.8vw, 2.8vh), 17px); }
.kiosk-bot-qr-dialog {
  --kiosk-bot-qr-size: clamp(144px, calc(100dvh - 230px), 320px);
  inset-block: var(--kiosk-bot-qr-top, 12px) auto;
  width: min(880px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: 0 auto;
  padding: clamp(10px, 2.6vh, 32px) clamp(16px, 4vw, 36px);
  text-align: center;
}
.kiosk-help.kiosk-bot-qr-dialog h2 { margin: 0 32px 10px; }
.kiosk-bot-qr-dialog p { max-width: 52ch; margin: 0 auto; font-size: var(--kiosk-hint-size); text-wrap: balance; }
.kiosk-bot-qr-dialog .kiosk-bot-qr-tip { margin-top: clamp(8px, 2vh, 18px); }
.registry-kiosk .kiosk-bot-qr-close { position: absolute; inset: 4px 4px auto auto; width: 56px; padding: 0; border-color: transparent; font-size: 32px; }
.kiosk-bot-qr-images { display: flex; justify-content: center; gap: clamp(12px, 4vw, 40px); margin-top: clamp(12px, 2.4vh, 24px); }
.kiosk-bot-qr-images figure { width: min(46%, var(--kiosk-bot-qr-size)); margin: 0; font-size: var(--kiosk-action-size); font-weight: 600; }
.kiosk-bot-qr-images figure:only-child { width: min(100%, var(--kiosk-bot-qr-size)); }
.kiosk-bot-qr-frame { margin-bottom: var(--space-2); border: 1px solid #d7dfe9; border-radius: 12px; overflow: hidden; }
.kiosk-bot-qr-frame img { display: block; width: 100%; height: auto; aspect-ratio: 1; }
@media (max-width: 440px) and (orientation: portrait) {
  .kiosk-bot-qr-images { flex-direction: column; align-items: center; }
  .kiosk-bot-qr-images figure { width: min(100%, 220px); }
}
/* Connecting an unregistered kiosk: one large code field, then the tablet details and the label. */
.pairing-form { display: grid; justify-items: stretch; gap: var(--space-3); width: min(100%, 420px); }
.pairing-form label { align-items: center; font-size: clamp(17px, min(2.2vw, 3.4vh), 22px); font-weight: 600; }
.pairing-form #pair-code { min-height: 68px; text-align: center; font-size: clamp(30px, min(6vw, 7vh), 44px); font-weight: 600; letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.pairing-error { width: min(100%, 560px); margin: 0; text-align: center; font-size: clamp(15px, min(1.8vw, 2.8vh), 18px); }
.pairing-details { display: grid; width: min(100%, 560px); margin: 0; text-align: left; font-size: clamp(16px, min(2vw, 3vh), 19px); }
.pairing-details > div { display: grid; grid-template-columns: minmax(9em, auto) minmax(0, 1fr); gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--line); }
.pairing-details dt { color: var(--muted); }
.pairing-details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.pairing-label { margin: 0; font-size: clamp(36px, min(8vw, 9vh), 64px); font-weight: 600; letter-spacing: .2em; font-variant-numeric: tabular-nums; }
.pairing-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); }
#pair-deadline { font-variant-numeric: tabular-nums; }
@media (max-width: 800px) { :root { --control-height: 44px; } }
@media (max-width: 520px) {
  .kiosk-panel { width: calc(100% - 24px); }
  .kiosk-chrome { padding-inline: 12px; }
  .pairing-buttons > button { width: 100%; }
  .pairing-details > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (max-height: 520px) { .registry-kiosk { --kiosk-stage-min: 140px; --kiosk-qr-min: 140px; } }
@media (prefers-reduced-motion: reduce) { .kiosk-direction[data-direction] { animation: none; } }
