:root {
  --bg: #0b0c0e; --surface: #17191d; --surface2: #22252b; --text: #f4f4f2; --muted: #9aa0a8;
  --accent: #e2001a; --accentText: #fff; --success: #3ecf8e; --warning: #f5b84b;
  --radius: 18px; --font-heading: "Inter Tight"; --font-body: "Inter"; --heading-weight: 600;
  --line: color-mix(in srgb, var(--text) 12%, transparent);
  --gutter: 2.2rem;
}
/* Scales the whole UI with the (vertical) screen: ~28px on 1080x1920. */
html { font-size: min(1.45dvh, 2.6vw); }
/* The stage is the screen. Its transform makes it the containing block of every position:fixed
   descendant (modals, overlays), and container units (cqw/cqh) refer to it. */
#stage { position: fixed; top: 0; left: 50%; height: 100dvh; width: 100vw; transform: translateX(-50%); overflow: hidden; container-type: size; background: var(--bg); }
/* Landscape or near-square viewport (e.g. a desktop browser): show a 9:16 frame like the kiosk monitor. */
@media (min-aspect-ratio: 3/4) {
  html { font-size: 1.45dvh; }
  :root, :root body { background: #000; } /* :root beats the html/body rule below */
  #stage { width: calc(100dvh * 9 / 16); box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 0 80px rgba(0,0,0,.6); }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; }
body { font-family: var(--font-body), system-ui, sans-serif; line-height: 1.4; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
h1, h2, h3 { font-family: var(--font-heading), var(--font-body), sans-serif; font-weight: var(--heading-weight); margin: 0; letter-spacing: -0.02em; line-height: 1.05; }
/* Per-tag typography: --{tag}-size / -color / -weight come from Admin → Testi (empty = these defaults). */
h1 { font-size: var(--h1-size, 3.1rem); color: var(--h1-color, inherit); font-weight: var(--h1-weight, var(--heading-weight)); }
h2 { font-size: var(--h2-size, 2.2rem); color: var(--h2-color, inherit); font-weight: var(--h2-weight, var(--heading-weight)); }
h3 { font-size: var(--h3-size, 1.25rem); color: var(--h3-color, inherit); font-weight: var(--h3-weight, var(--heading-weight)); letter-spacing: -0.01em; }
p { margin: 0; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
img { display: block; max-width: 100%; }

#app { position: fixed; inset: 0; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; animation: enter .45s cubic-bezier(.2,.7,.2,1) both; }
@keyframes enter { from { opacity: 0; transform: translateY(1.2rem); } to { opacity: 1; transform: none; } }

.kicker { font-size: var(--kicker-size, .78rem); text-transform: uppercase; letter-spacing: .22em; color: var(--kicker-color, var(--muted)); font-weight: var(--kicker-weight, 600); }
.muted { color: var(--muted); }
.lead { font-size: var(--lead-size, 1.15rem); color: var(--lead-color, color-mix(in srgb, var(--text) 82%, transparent)); font-weight: var(--lead-weight, 400); max-width: 34ch; }
/* "p": body copy (privacy text, tips, steps, hints, notices) */
.txt { font-size: var(--p-size, 1.05rem); color: var(--p-color, inherit); font-weight: var(--p-weight, 400); }

.top { padding: 2.4rem var(--gutter) 1.2rem; display: flex; flex-direction: column; gap: .9rem; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 2rem; }
/* Logo: same place on every screen, top right, vertically aligned with the .top-row (dots / status pill). */
#brand-logo { position: absolute; top: 1.6rem; right: var(--gutter); z-index: 15; height: var(--logo-h, 4rem); width: auto; max-width: calc(var(--logo-h, 4rem) * 4.4); object-fit: contain; object-position: right center; pointer-events: none; }
/* Attract screen: logo top centre, over the intro video, 4.5x the pages size. */
#stage[data-screen="attract"] #brand-logo { top: 4rem; left: 50%; right: auto; transform: translateX(-50%); height: calc(var(--logo-h, 4rem) * 4.5); max-width: 90%; object-position: center top; }
.has-logo .top { padding-top: 1.6rem; }
.has-logo .top-row { justify-content: flex-start; flex-wrap: wrap; padding-right: calc(var(--logo-h, 4rem) * 4.4 + 1rem); min-height: var(--logo-h, 4rem); }
.main { flex: 1; overflow-y: auto; padding: 0 var(--gutter) 1.5rem; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.main::-webkit-scrollbar { display: none; }
.bottom { padding: 1.2rem var(--gutter) 2.2rem; display: flex; gap: 1rem; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); }
.bottom .btn { flex: 1; }
.bottom .btn-ghost { flex: 0 0 auto; min-width: 30%; }

/* Buttons: big touch targets */
.btn { min-height: 3.6rem; padding: 0 1.8rem; border-radius: calc(var(--radius) * .75); font-weight: var(--button-weight, 600); font-size: var(--button-size, 1.1rem); display: inline-flex; align-items: center; justify-content: center; gap: .6rem; transition: transform .12s, opacity .2s, background .2s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--button-color, var(--accentText)); }
.btn-secondary { background: var(--surface2); color: var(--text); }
.btn-ghost { border: 1px solid var(--line); }
.btn[disabled] { opacity: .35; pointer-events: none; }
.btn-lg { min-height: 4.4rem; font-size: calc(var(--button-size, 1.1rem) * 1.18); }
.icon { width: 1.2em; height: 1.2em; flex: none; }

/* Attract */
.attract { justify-content: flex-end; align-items: stretch; }
.attract video, .attract .anim { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.attract .shade { position: absolute; inset: 0; background: linear-gradient(to top, color-mix(in srgb, var(--bg) 90%, transparent) 0%, transparent 45%); }
.attract .content { position: relative; padding: 0 var(--gutter) 5rem; display: flex; flex-direction: column; gap: 1.2rem; }
.attract h1 { font-size: calc(var(--h1-size, 3.1rem) * 1.35); max-width: 10ch; }
.touch-cta { margin-top: 2.5rem; display: flex; align-items: center; gap: 1.4rem; font-size: 1.2rem; font-weight: 600; }
.ring { position: relative; width: 4.5rem; height: 4.5rem; flex: none; }
.ring::before, .ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); animation: ripple 2.2s cubic-bezier(.2,.6,.3,1) infinite; }
.ring::after { animation-delay: 1.1s; }
.ring span { position: absolute; inset: 32%; border-radius: 50%; background: var(--accent); animation: tap 2.2s ease-in-out infinite; }
@keyframes ripple { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes tap { 0%, 100% { transform: scale(1); } 12% { transform: scale(.8); } 24% { transform: scale(1); } }

/* Built-in attract animation: night road with light trails */
.anim { overflow: hidden; background: radial-gradient(120% 60% at 50% 30%, #1d2230 0%, var(--bg) 70%); }
.anim .horizon { position: absolute; left: -10%; right: -10%; top: 38%; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 30%, transparent), transparent); }
.anim .road { position: absolute; left: 50%; top: 38%; width: 240%; height: 70%; transform: translateX(-50%) perspective(40rem) rotateX(62deg); transform-origin: top center;
  background: repeating-linear-gradient(to bottom, transparent 0 6%, color-mix(in srgb, var(--text) 55%, transparent) 6% 9%) center / 0.35rem 100% no-repeat; animation: road 1.1s linear infinite; }
@keyframes road { from { background-position-y: 0; } to { background-position-y: 11.1%; } }
.anim .trail { position: absolute; height: .25rem; border-radius: 1rem; filter: blur(1px); opacity: 0; animation: trail 3.2s linear infinite; }
.anim .trail.red { background: linear-gradient(90deg, transparent, var(--accent)); }
.anim .trail.white { background: linear-gradient(90deg, transparent, #fff); }
@keyframes trail { 0% { transform: translateX(-30cqw) scaleX(.3); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateX(130cqw) scaleX(1.2); opacity: 0; } }

/* Privacy */
.privacy-body { font-size: var(--p-size, 1.05rem); color: var(--p-color, color-mix(in srgb, var(--text) 85%, transparent)); }
.privacy-body p { margin: 0 0 1em; }
.check { display: flex; gap: 1rem; align-items: flex-start; text-align: left; width: 100%; margin-top: 2rem; padding: 1.3rem; border-radius: var(--radius); background: var(--surface); font-size: 1.05rem; }
.check .box { flex: none; width: 2.2rem; height: 2.2rem; border-radius: .5rem; border: 2px solid var(--muted); display: grid; place-items: center; transition: .2s; }
.check.on .box { background: var(--accent); border-color: var(--accent); }
.check .box svg { width: 1.3rem; opacity: 0; }
.check.on .box svg { opacity: 1; }

/* Photo intro */
.poses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 2rem 0; }
.pose { background: var(--surface); border-radius: var(--radius); padding: 1.2rem .8rem 1rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.pose svg { width: 70%; height: auto; color: var(--text); }
.pose img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: calc(var(--radius) * .6); display: block; }
.pose b { font-size: 1rem; }
.tips { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.tips li { display: flex; gap: .9rem; align-items: center; font-size: var(--p-size, 1.05rem); color: var(--p-color, inherit); padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: calc(var(--radius) * .7); }
.tips li::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); flex: none; }

/* Capture */
.capture .stage { position: relative; margin: 0 var(--gutter) 1.2rem; flex: 1; min-height: 0; display: grid; place-items: center; }
.viewfinder { position: relative; height: 100%; max-height: 100%; aspect-ratio: 3 / 4; max-width: 100%; border-radius: var(--radius); overflow: hidden; background: #000; }
.viewfinder canvas, .viewfinder img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viewfinder .guide { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; color: #fff; opacity: .55; }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-heading); font-size: 9rem; font-weight: 700; text-shadow: 0 .3rem 2rem rgba(0,0,0,.5); }
.countdown span { animation: count 1s ease-out both; }
@keyframes count { from { transform: scale(1.6); opacity: 0; } 30% { opacity: 1; } to { transform: scale(.9); opacity: .2; } }
.flash { position: absolute; inset: 0; background: #fff; animation: flash .5s ease-out both; pointer-events: none; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
.steps-dots { display: flex; gap: .5rem; }
.steps-dots i { width: 2.2rem; height: .3rem; border-radius: 1rem; background: var(--surface2); }
.steps-dots i.on { background: var(--accent); }
.steps-dots i.done { background: var(--text); }
.cam-error { padding: 2rem; text-align: center; color: var(--muted); }

/* Photo review */
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.review-grid .ph { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3/4; background: var(--surface); }
.review-grid .ph:first-child { grid-column: span 2; aspect-ratio: auto; height: 34cqh; }
.review-grid .ph img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.review-grid .ph .tag { position: absolute; left: .8rem; bottom: .8rem; background: rgba(0,0,0,.6); backdrop-filter: blur(8px); padding: .35rem .8rem; border-radius: 2rem; font-size: .85rem; font-weight: 600; }
.review-grid .ph .redo { position: absolute; right: .8rem; bottom: .8rem; background: rgba(0,0,0,.6); backdrop-filter: blur(8px); padding: .35rem .8rem; border-radius: 2rem; font-size: .85rem; }

/* Creating / chapter pages */
.center-page { justify-content: center; padding: 0 var(--gutter); gap: 1.6rem; }
.center-page > .pill { align-self: flex-start; }
.chapter-num { font-family: var(--font-heading); font-size: 11rem; font-weight: 700; line-height: .8; color: transparent; -webkit-text-stroke: 2px color-mix(in srgb, var(--text) 30%, transparent); }
.chapter h1 { font-size: calc(var(--h1-size, 3.1rem) * 1.42); }
.progress-line { height: .25rem; background: var(--surface2); border-radius: 1rem; overflow: hidden; margin-top: 2rem; }
.progress-line i { display: block; height: 100%; background: var(--accent); width: 0; animation: fill linear forwards; }
@keyframes fill { to { width: 100%; } }
.tap-skip { color: var(--p-color, var(--muted)); font-size: calc(var(--p-size, 1.05rem) * .9); }
.creating-steps { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 1rem; counter-reset: s; }
.creating-steps li { counter-increment: s; display: flex; align-items: center; gap: 1.2rem; font-size: calc(var(--p-size, 1.05rem) * 1.2); color: var(--p-color, inherit); padding: 1.1rem 1.3rem; background: var(--surface); border-radius: var(--radius); opacity: 0; animation: enter .5s both; }
.creating-steps li::before { content: counter(s); font-family: var(--font-heading); font-weight: 700; width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--surface2); }
.scan { position: relative; width: 12rem; height: 12rem; border-radius: 50%; overflow: hidden; border: 2px solid var(--line); }
.scan img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.1); }
.scan::after { content: ""; position: absolute; left: 0; right: 0; height: 30%; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--accent) 60%, transparent), transparent); animation: scan 2.4s ease-in-out infinite; }
@keyframes scan { 0% { top: -30%; } 100% { top: 100%; } }

/* Sheet status pill */
.pill { display: inline-flex; align-items: center; gap: .55rem; padding: .45rem .95rem; border-radius: 2rem; background: var(--surface); font-size: .82rem; font-weight: 600; white-space: nowrap; }
.pill .dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--warning); animation: blink 1.4s infinite; }
.pill.ready .dot { background: var(--success); animation: none; }
.pill.failed .dot { background: var(--accent); animation: none; }
@keyframes blink { 50% { opacity: .25; } }

/* Choice cards */
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border-radius: calc(var(--radius) * .75); padding: .35rem; margin-bottom: 1.2rem; }
.tabs button { min-height: 3.2rem; border-radius: calc(var(--radius) * .6); font-weight: 600; font-size: 1.1rem; color: var(--muted); transition: .2s; }
.tabs button.on { background: var(--surface2); color: var(--text); }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.card { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface); text-align: left; aspect-ratio: 9 / 14; display: flex; flex-direction: column; justify-content: flex-end; outline: 3px solid transparent; outline-offset: -3px; transition: outline-color .2s, transform .15s; animation: enter .45s both; }
.card:active { transform: scale(.98); }
.card .media { position: absolute; inset: 0; }
.card .media img { width: 100%; height: 100%; object-fit: cover; }
.card .info { position: relative; padding: 1.1rem; background: linear-gradient(to top, rgba(0,0,0,.85), transparent); padding-top: 3rem; }
.card .info .kicker { color: rgba(255,255,255,.7); font-size: .68rem; }
.card .info h3 { color: #fff; margin-top: .25rem; }
.card .info .desc { color: rgba(255,255,255,.78); font-size: .82rem; margin-top: .35rem; line-height: 1.3; }
.card.selected { outline-color: var(--accent); }
.card .check-badge { position: absolute; top: .9rem; right: .9rem; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--accent); color: var(--accentText); display: none; place-items: center; }
.card.selected .check-badge { display: grid; }
.card .num { position: absolute; top: .9rem; left: 1rem; font-family: var(--font-heading); font-weight: 700; font-size: 1rem; color: #fff; opacity: .85; }
.cards .card:last-child:nth-child(odd) { grid-column: span 2; aspect-ratio: 16 / 10; }
.placeholder { width: 100%; height: 100%; display: grid; place-items: center; font-family: var(--font-heading); font-size: 5rem; font-weight: 700; color: rgba(255,255,255,.18); }
.hint { margin: 0 0 1rem; color: var(--p-color, var(--muted)); font-size: calc(var(--p-size, 1.05rem) * .9); }

.warning { display: flex; gap: 1rem; padding: 1.1rem 1.2rem; border-radius: var(--radius); background: color-mix(in srgb, var(--warning) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warning) 45%, transparent); margin-bottom: 1.2rem; font-size: 1rem; }
.warning svg { color: var(--warning); flex: none; width: 1.6rem; height: 1.6rem; }
.warning b { display: block; margin-bottom: .2rem; }

/* Detail sheet (modal) */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); display: flex; align-items: flex-end; z-index: 20; animation: fade .25s both; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-height: 92%; background: var(--bg); border-radius: calc(var(--radius) * 1.4) calc(var(--radius) * 1.4) 0 0; display: flex; flex-direction: column; animation: up .35s cubic-bezier(.2,.7,.2,1) both; overflow: hidden; }
@keyframes up { from { transform: translateY(40%); opacity: 0; } }
.sheet .media { height: 52cqh; background: var(--surface); }
.sheet .media img { width: 100%; height: 100%; object-fit: contain; background: #000; }
.sheet .body { padding: 1.8rem var(--gutter) 1rem; display: flex; flex-direction: column; gap: .7rem; overflow-y: auto; }
.sheet .bottom { border: 0; }

/* Summary */
.sum-list { display: grid; gap: 1rem; margin-top: 1rem; }
.sum-row { overflow: hidden; display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 1.2rem; align-items: center; padding: .8rem; padding-right: 1.2rem; background: var(--surface); border-radius: var(--radius); }
.sum-row .thumb { width: 6.5rem; height: 8.5rem; border-radius: calc(var(--radius) * .7); overflow: hidden; background: var(--surface2); }
.sum-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.sum-row h3 { font-size: 1.3rem; margin-top: .3rem; }
.sum-row .edit { padding: .8rem 1.1rem; border-radius: 2rem; border: 1px solid var(--line); font-size: .95rem; font-weight: 600; }
.sheet-box { display: flex; align-items: center; gap: 1rem; margin-top: 1.4rem; padding: 1.1rem 1.2rem; border-radius: var(--radius); border: 1px solid var(--line); }
.error-box { padding: 1.3rem; border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); margin-top: 1.4rem; display: grid; gap: 1rem; }

/* Done */
.done { align-items: center; text-align: center; justify-content: center; gap: 1.6rem; padding: 0 var(--gutter); }
.qr { background: #fff; padding: 1.4rem; border-radius: var(--radius); width: 24rem; max-width: 70cqw; }
.qr svg { width: 100%; height: auto; display: block; }
.code { font-family: var(--font-heading); font-size: 2.4rem; font-weight: 700; letter-spacing: .25em; }
.done .lead { margin: 0 auto; }

/* Idle overlay & spinner */
#overlay:empty { display: none; }
.idle { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.82); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem; text-align: center; animation: fade .3s both; }
.idle .big { font-family: var(--font-heading); font-size: 6rem; font-weight: 700; }
.busy { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.75); display: flex; flex-direction: column; gap: 1.5rem; align-items: center; justify-content: center; font-size: 1.2rem; }
.spinner { width: 4rem; height: 4rem; border-radius: 50%; border: .3rem solid var(--surface2); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 8rem; transform: translateX(-50%); background: var(--surface2); padding: 1rem 1.6rem; border-radius: 2rem; z-index: 60; font-size: 1rem; animation: enter .3s both; max-width: 90cqw; text-align: center; }

/* Setup panel (operator) */
#setup-corner { position: fixed; top: 0; left: 0; width: 70px; height: 70px; z-index: 100; }
.setup { position: fixed; inset: 0; z-index: 101; background: var(--bg); padding: 2rem; overflow: auto; font-size: 16px; }
.setup h2 { font-size: 28px; margin-bottom: 20px; }
.setup label { display: block; margin: 18px 0 6px; color: var(--muted); font-size: 14px; }
.setup select, .setup input { width: 100%; font-size: 18px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.setup .row { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.setup .btn { font-size: 16px; min-height: 52px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* DEMO mode */
.demo-badge { position: absolute; top: .9rem; left: 50%; transform: translateX(-50%); z-index: 30; background: var(--warning); color: #000; font-weight: 800; font-size: .75rem; letter-spacing: .2em; padding: .3rem .9rem; border-radius: 2rem; pointer-events: none; }
.demo-note { max-width: 34ch; padding: 1rem 1.2rem; border-radius: var(--radius); border: 1px dashed var(--warning); color: var(--warning); font-size: .95rem; }

/* ---------- gesture control ---------- */
.g-hud { position: absolute; right: var(--gutter); bottom: 8.8rem; z-index: 45; display: flex; align-items: center; gap: .8rem; max-width: 70%; padding: .55rem 1.1rem .55rem .55rem; border-radius: 3rem; background: var(--surface); box-shadow: 0 .4rem 1.6rem rgba(0,0,0,.45); border: 1px solid var(--line); pointer-events: none; opacity: .75; transition: opacity .25s; }
.g-hud.at-top { bottom: auto; top: 1.4rem; }
.g-hud.at-top .g-debug { bottom: auto; top: calc(100% + .6rem); }
.g-hud.has-hand { opacity: 1; border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.g-hud.is-error { opacity: .5; }
.g-hud[hidden] { display: none; }
.g-badge { position: relative; width: 2.8rem; height: 2.8rem; flex: none; display: grid; place-items: center; }
.g-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.g-ring circle { fill: none; stroke-width: 3.5; }
.g-track { stroke: var(--surface2); }
.g-prog { stroke: var(--accent); stroke-dasharray: 1; stroke-dashoffset: 1; stroke-linecap: round; transition: stroke-dashoffset .08s linear; }
.g-icon { font-size: 1.25rem; font-weight: 700; line-height: 1; }
.g-text { display: grid; gap: .1rem; min-width: 0; }
.g-label { font-size: .9rem; }
.g-label:empty { display: none; }
.g-hint { font-size: .78rem; color: var(--muted); line-height: 1.3; }
.g-debug { position: absolute; right: 0; bottom: calc(100% + .6rem); width: 12rem; height: auto; border-radius: .6rem; border: 1px solid var(--line); background: #000; }
.g-hud.fired .g-badge { animation: g-pop .35s ease-out; }
@keyframes g-pop { 50% { transform: scale(1.25); } }

/* element about to be chosen by a held gesture: outline + progress bar */
.g-pending { outline: 3px solid var(--accent) !important; outline-offset: -3px; position: relative; }
.g-pending::after { content: ""; position: absolute; left: 0; bottom: 0; height: .35rem; width: calc(var(--g-progress, 0) * 100%); background: var(--accent); z-index: 3; }
.btn.g-pending { outline-offset: 3px; overflow: hidden; }

/* ---------- voice guide ---------- */
.voice-btn { position: absolute; left: var(--gutter); bottom: 8.8rem; z-index: 44; width: 3.4rem; height: 3.4rem; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--text); box-shadow: 0 .4rem 1.6rem rgba(0,0,0,.4); }
.voice-btn svg { width: 1.5rem; height: 1.5rem; }
.voice-btn.muted { color: var(--muted); }
.center-page .voice-btn, .done .voice-btn { bottom: 2.2rem; }

/* ---------- lock screen (kiosk password) ---------- */
.lock { gap: 1.2rem; align-items: center; text-align: center; }
.lock .lead { margin-inline: auto; }
.lock-form { display: flex; gap: .8rem; width: min(34rem, 92%); }
.lock-input { flex: 1; min-height: 4.4rem; padding: 0 1.2rem; font-size: 1.6rem; letter-spacing: .2em; border-radius: calc(var(--radius) * .75); border: 1px solid var(--line); background: var(--surface2); color: var(--text); }
.lock-msg { min-height: 1.5em; color: var(--warning); }
.lock-kb { display: flex; flex-direction: column; gap: .5rem; align-items: center; user-select: none; width: 100%; }
.lock-kb div { display: flex; gap: .5rem; justify-content: center; }
.lock-kb button { width: min(3.6rem, 8vw); height: min(3.6rem, 8vw); border-radius: .6rem; background: var(--surface2); color: var(--text); font-size: 1.4rem; border: 1px solid var(--line); }
.lock-kb button.wide { width: min(5.4rem, 14vw); font-size: 1.1rem; }
.lock-kb button:active { transform: scale(.94); background: var(--accent); color: var(--accentText); }

/* AI notice after the confirmation (before the QR): the text scrolls if it doesn't fit, the button stays on screen */
.ai-notice { padding: max(1.5rem, env(safe-area-inset-top)) var(--gutter) max(1.5rem, env(safe-area-inset-bottom)); gap: 1.2rem; }
.ai-notice-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; display: flex; flex-direction: column; }
.ai-notice-inner { margin: auto 0; display: grid; gap: 1.4rem; text-align: center; }
.ai-notice-body { display: grid; gap: 1rem; max-width: 52rem; margin: 0 auto; }
.ai-notice-body .lead { margin: 0; }
.ai-notice-foot { flex: none; display: grid; gap: 1rem; }
.ai-notice-foot .progress-line { margin-top: 0; }
