:root {
  --purple: #5d0059;
  --purple-dark: #3b073a;
  --coral: #ef492f;
  --ink: #171317;
  --muted: #6f666f;
  --line: #ddd6dd;
  --canvas: #f5f3f5;
  --surface: #fff;
  --success: #137a4d;
  --warning: #a86100;
  --danger: #b42318;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.kiosk-app { min-height: 100svh; }
.kiosk-bar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: max(12px, env(safe-area-inset-top)) clamp(18px, 4vw, 42px) 12px;
  color: #fff;
  background: var(--purple);
}
.kiosk-brand { display: flex; align-items: center; gap: 12px; }
.kiosk-brand img { width: 44px; height: 44px; border-radius: 7px; background: #fff; }
.kiosk-brand span { display: grid; gap: 1px; }
.kiosk-brand small { color: rgba(255,255,255,.72); }
.kiosk-signals { display: flex; align-items: center; gap: clamp(12px, 2vw, 24px); }
.network-signal { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; }
.network-signal i, .display-state i { width: 9px; height: 9px; border-radius: 50%; background: #f5b83d; box-shadow: 0 0 0 3px rgba(255,255,255,.15); }
.network-signal.online i { background: #50d18c; }
.network-signal.offline i { background: #ff826c; }
.kiosk-signals time { min-width: 64px; font-size: 1.12rem; font-weight: 800; text-align: center; }
.bar-button { min-height: 36px; padding: 0 12px; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 5px; background: transparent; font-weight: 800; }

.eyebrow { margin: 0 0 7px; color: var(--purple); font-size: .73rem; font-weight: 850; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 9px; font-size: clamp(1.7rem, 4vw, 2.65rem); line-height: 1.08; letter-spacing: 0; }
h2 { margin-bottom: 0; letter-spacing: 0; }
.setup-view, .locked-view { width: min(1080px, calc(100% - 36px)); display: grid; grid-template-columns: minmax(0, .8fr) minmax(440px, 1.2fr); gap: clamp(28px, 6vw, 76px); align-items: start; margin: 0 auto; padding: clamp(32px, 7vh, 72px) 0; }
.setup-intro { position: sticky; top: 96px; }
.setup-intro > p:last-of-type { color: var(--muted); font-size: 1.02rem; line-height: 1.55; }
.setup-status-list { display: grid; gap: 12px; margin-top: 28px; }
.setup-status-list span { display: flex; align-items: center; gap: 10px; font-weight: 750; }
.setup-status-list b { width: 28px; height: 28px; display: grid; place-items: center; color: #fff; border-radius: 50%; background: var(--purple); font-size: .76rem; }
.setup-form, .reverify-form { display: grid; gap: 16px; padding: clamp(20px, 4vw, 32px); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.form-section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.form-section .eyebrow { grid-column: 1 / -1; margin-bottom: 0; }
label { display: grid; gap: 6px; color: #3e373e; font-size: .8rem; font-weight: 800; }
input, select { width: 100%; min-height: 44px; padding: 0 11px; color: var(--ink); border: 1px solid #cfc6cf; border-radius: 5px; background: #fff; }
input:focus, select:focus { outline: 3px solid rgba(93,0,89,.14); border-color: var(--purple); }
.setup-location { display: grid; grid-template-columns: auto 1fr; gap: 2px 11px; align-items: center; padding: 13px; color: var(--muted); background: #f5f2f5; border-radius: 6px; }
.setup-location span { grid-row: 1 / span 2; width: 11px; height: 11px; border-radius: 50%; background: var(--warning); }
.setup-location.active span { background: var(--purple); animation: pulse 1s infinite alternate; }
.setup-location.complete span { background: var(--success); animation: none; }
.setup-location strong { color: var(--ink); }
.setup-location small { font-size: .78rem; }
.primary-action, .secondary-action { min-height: 48px; padding: 0 18px; border-radius: 6px; font-weight: 850; }
.primary-action { color: #fff; border: 0; background: var(--purple); }
.primary-action:disabled { opacity: .5; cursor: not-allowed; }
.secondary-action { color: var(--purple); border: 1px solid var(--purple); background: #fff; }
.form-status { min-height: 20px; margin: -3px 0 0; color: var(--muted); font-size: .84rem; }
.form-status.error { color: var(--danger); font-weight: 750; }
.form-status.success { color: var(--success); font-weight: 750; }

.display-view { min-height: calc(100svh - 74px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.display-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(18px, 3vh, 30px) clamp(22px, 5vw, 58px); }
.display-heading h1 { margin-bottom: 4px; font-size: clamp(1.4rem, 3vw, 2.15rem); }
.display-heading p:last-child { margin: 0; color: var(--muted); }
.display-state { display: flex; align-items: center; gap: 11px; padding: 10px 14px; color: var(--warning); background: #fff6e5; border-radius: 6px; }
.display-state.ready { color: var(--success); background: #e9f7ef; }
.display-state.ready i { background: var(--success); }
.display-state span { display: grid; }
.display-state small { color: var(--muted); }
.qr-stage { position: relative; min-height: 360px; display: grid; place-items: center; padding: 10px clamp(20px, 5vw, 64px) 24px; background: #fff; }
.qr-code { width: min(58vh, 72vw, 620px); height: min(58vh, 72vw, 620px); display: grid; place-items: center; }
.qr-code img, .qr-code canvas { width: 100% !important; height: 100% !important; image-rendering: pixelated; }
.qr-waiting { display: grid; place-items: center; gap: 8px; color: var(--muted); text-align: center; }
.qr-waiting img { width: 94px; height: 94px; border-radius: 10px; }
.qr-waiting strong { color: var(--ink); font-size: 1.1rem; }
.qr-footer { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); background: var(--purple-dark); color: #fff; }
.qr-footer div { min-height: 72px; display: grid; align-content: center; gap: 3px; padding: 12px clamp(14px, 3vw, 28px); border-right: 1px solid rgba(255,255,255,.14); }
.qr-footer div:last-child { border-right: 0; }
.qr-footer small { color: rgba(255,255,255,.65); }
.qr-footer strong { font-size: 1rem; }

.locked-view { align-items: center; min-height: calc(100svh - 74px); }
.lock-message span { display: inline-block; margin-bottom: 16px; padding: 6px 9px; color: #fff; background: var(--danger); border-radius: 4px; font-size: .75rem; font-weight: 850; text-transform: uppercase; }
.lock-message p { color: var(--muted); font-size: 1.02rem; line-height: 1.55; }
.reverify-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.reverify-form .eyebrow, .reverify-form .primary-action, .reverify-form .form-status { grid-column: 1 / -1; }

.device-dialog { width: min(560px, calc(100% - 24px)); padding: 0; border: 0; border-radius: 8px; box-shadow: 0 24px 80px rgba(0,0,0,.3); }
.device-dialog::backdrop { background: rgba(25,12,24,.62); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dialog-head button { border: 0; color: var(--purple); background: transparent; font-weight: 800; }
.pin-form, .device-details { display: grid; gap: 14px; padding: 20px; }
.device-details dl { display: grid; gap: 0; margin: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.device-details dl div { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.device-details dl div:last-child { border-bottom: 0; }
.device-details dt { color: var(--muted); }
.device-details dd { margin: 0; overflow-wrap: anywhere; font-weight: 750; }
.native-controls { display: grid; gap: 12px; padding-top: 4px; border-top: 1px solid var(--line); }
.native-controls .eyebrow { margin: 2px 0 0; }
.native-controls dl div { grid-template-columns: 120px 1fr; }
.native-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.native-actions button { width: 100%; min-width: 0; }

@keyframes pulse { from { opacity: .45; transform: scale(.8); } to { opacity: 1; transform: scale(1.15); } }

@media (max-width: 760px) {
  .kiosk-bar { min-height: 66px; padding-inline: 14px; }
  .kiosk-brand img { width: 39px; height: 39px; }
  .network-signal b { display: none; }
  .kiosk-signals time { min-width: 52px; font-size: .95rem; }
  .setup-view, .locked-view { width: min(100% - 20px, 1080px); grid-template-columns: 1fr; padding: 26px 0; }
  .setup-intro { position: static; }
  .form-section, .reverify-form { grid-template-columns: 1fr; }
  .reverify-form > * { grid-column: 1 !important; }
  .display-heading { align-items: flex-start; flex-direction: column; gap: 12px; padding: 18px 14px; }
  .display-state { width: 100%; }
  .qr-stage { min-height: 360px; padding-inline: 10px; }
  .qr-code { width: min(82vw, 64vh); height: min(82vw, 64vh); }
  .qr-footer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qr-footer div:nth-child(2) { border-right: 0; }
  .qr-footer div:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.14); }
  .native-actions { grid-template-columns: 1fr; }
}
