/* Group Ex Check-In — Direction C "One-Tap Focus" (design/ui-alternatives/c-one-tap-focus.html).
   Sizes are written in mockup pixels times --u, so the layout scales to any screen:
   entrance screens are designed at 1180x820 (iPad), studio screens at 1920x1080 (ELO). */

@font-face { font-family: 'Cachet'; src: url('../assets/fonts/Cachet-Book.ttf') format('truetype'); font-weight: 400; font-display: block; }
@font-face { font-family: 'Cachet'; src: url('../assets/fonts/Cachet-Medium.ttf') format('truetype'); font-weight: 500; font-display: block; }
@font-face { font-family: 'Cachet'; src: url('../assets/fonts/Cachet-Bold.ttf') format('truetype'); font-weight: 700; font-display: block; }

:root {
  --y-blue: #0089d0;
  --y-blue-dark: #0060af;
  --y-orange: #f47920;
  --navy: #0b2340;
  --navy2: #13335a;
  --ink: #fff;
  --dim: rgba(255, 255, 255, 0.74);
  --line: rgba(255, 255, 255, 0.16);
  --ok: #00785c;
  --ok-hi: #7ef0c8;
  --amber: #f5b026;
  --err: #b3141f;
  --slate: #41495a;
  --font: 'Cachet', 'Helvetica Neue', Arial, sans-serif;
  --sys: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --u: min(calc(100vw / 1180), calc(100vh / 820));
}
body.mode-studio { --u: min(calc(100vw / 1920), calc(100vh / 1080)); }

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--navy); color: var(--ink); font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; overscroll-behavior: none;
}
button { font-family: inherit; }
[hidden] { display: none !important; }
svg.i { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

#scan-input { position: fixed; left: -1000px; top: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; }
#settings-hotspot { position: fixed; left: 0; top: 0; width: 90px; height: 90px; z-index: 60; }

.screen {
  position: fixed; inset: 0; display: none; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.screen.active { display: flex; }
.clock { font-size: calc(32 * var(--u)); opacity: .85; white-space: nowrap; }
.logo { width: calc(84 * var(--u)); height: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: calc(72 * var(--u)); padding: 0 1.3em; border-radius: 999px; border: 0; cursor: pointer;
  font: 700 calc(26 * var(--u))/1 var(--font); letter-spacing: .05em; color: var(--navy); background: #fff;
}
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: #fff; border: 3px solid rgba(255, 255, 255, .7); }

/* ---------- attract (entrance scan screen): layout from direction A, brand-blue field ---------- */
.att {
  align-items: center; justify-content: center; text-align: center;
  background: #05060a;
}
/* Backdrop image: Y chevrons, blue family left, purple family right (brand guide pp. 18, 26-27).
   A very slow zoom keeps the screen from looking frozen. */
/* background choice (settings): default = chevron image under the gradient; .bg-blue = the original gradient only */
.att.bg-blue { background: radial-gradient(circle at 50% 38%, rgba(0, 137, 208, .55) 0, rgba(0, 96, 169, 0) 55%), linear-gradient(160deg, #0a6fb8 0%, #0060a9 45%, #0b2340 100%); }
.att.bg-blue .att-bg { display: none; }
.att-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url('../assets/images/attract-chevrons.jpg') center / cover no-repeat;
  animation: drift-zoom 24s ease-in-out infinite alternate; }
/* the original scan-screen gradient laid over the image at partial opacity, so the chevrons
   show through a brand-blue wash */
.att-bg::after {
  content: ""; position: absolute; inset: 0; opacity: .85;
  background:
    radial-gradient(circle at 50% 38%, rgba(0, 137, 208, .55) 0, rgba(0, 96, 169, 0) 55%),
    linear-gradient(160deg, #0a6fb8 0%, #0060a9 45%, #0b2340 100%);
}
@keyframes drift-zoom { from { transform: scale(1); } to { transform: scale(1.05); } }
/* soft dark halo behind the text keeps it readable over the ribbons */
.att::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 46% 40% at 50% 46%, rgba(6, 7, 11, .55) 0%, rgba(6, 7, 11, 0) 100%); }
.att > :not(.att-bg) { position: relative; z-index: 1; }
.att > .att-branch, .att > .att-clock, .att > .ticker { position: absolute; }
/* three bands: empty space / the message / empty space. The message stays centered on screen;
   the scanner chevrons sit centered in the clear band between the label and the bottom strip. */
.screen.att.active { display: grid; grid-template-rows: 1fr auto 1fr; justify-items: center; align-items: center; }
.att-center { grid-row: 2; }
.att-branch { position: absolute; top: calc(26 * var(--u)); left: calc(34 * var(--u)); font-size: calc(18 * var(--u)); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.att-clock { position: absolute; top: calc(22 * var(--u)); right: calc(34 * var(--u)); }
.att-center { display: flex; flex-direction: column; align-items: center; margin-bottom: calc(40 * var(--u)); }
.att .logo { width: calc(150 * var(--u)); margin-bottom: calc(6 * var(--u)); transform-origin: 50% 100%; transform: translateY(calc(-22 * var(--u))) scale(1.5); } /* raised + 150% without moving anything else */
.att h1 { margin: 0; font-weight: 500; font-size: calc(48 * var(--u)); letter-spacing: .06em; opacity: .9; }
.pair .att-bg { animation: none; }
.pair-center { grid-row: 2; }
.pair-code { font-weight: 700; font-size: calc(150 * var(--u)); letter-spacing: .08em; line-height: 1; margin: calc(18 * var(--u)) 0 calc(14 * var(--u));
  padding: calc(14 * var(--u)) calc(40 * var(--u)); border-radius: calc(28 * var(--u)); background: rgba(255, 255, 255, .1); border: 2px solid rgba(255, 255, 255, .25); font-variant-numeric: tabular-nums; }
.pair-steps { font-size: calc(30 * var(--u)); color: var(--dim); max-width: calc(900 * var(--u)); }
.pair-steps b { color: #fff; font-weight: 500; }
.pair-expiry { margin-top: calc(14 * var(--u)); font-size: calc(22 * var(--u)); letter-spacing: .1em; color: var(--dim); text-transform: uppercase; }
.pair-training { margin-top: calc(34 * var(--u)); font: 500 calc(20 * var(--u)) var(--font); color: var(--dim); background: none; border: 0; text-decoration: underline; cursor: pointer; }
.att-big { font-weight: 500; font-size: calc(124 * var(--u)); line-height: 1; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; margin: calc(14 * var(--u)) 0 calc(22 * var(--u)); }
.att-hint { font-size: calc(30 * var(--u)); color: var(--dim); }
.att-pointer { margin-top: calc(34 * var(--u)); display: flex; flex-direction: column; align-items: center; gap: calc(6 * var(--u)); font-size: calc(22 * var(--u)); letter-spacing: .12em; color: var(--dim); }
/* chevrons point down at the scanner: pinned near the bottom edge, above the ticker when it shows */
.chev { grid-row: 3; align-self: center; display: flex; flex-direction: column; align-items: center; margin-top: calc(-40 * var(--u)); }
.att:has(.ticker:not([hidden])) .chev { margin-bottom: calc(60 * var(--u)); } /* stay clear of the "Starting soon" strip */
.chev svg { width: calc(132 * var(--u)); height: calc(50 * var(--u)); margin-top: calc(-16 * var(--u)); fill: none; stroke: #fff; stroke-width: 6.5; stroke-linecap: round; stroke-linejoin: round; opacity: .2; animation: chev 1.3s ease-in-out infinite; }
.chev svg:first-child { margin-top: 0; }
.chev svg:nth-child(2) { animation-delay: .25s; }
@keyframes chev { 30% { opacity: 1; } 70%, 100% { opacity: .18; } }
@keyframes bob { 50% { transform: translateY(8px); } }
.ticker { position: absolute; left: 0; right: 0; bottom: 0; display: flex; background: rgba(5, 12, 24, .55); border-top: 1px solid var(--line); font-size: calc(22 * var(--u)); overflow: hidden; }
.ticker b { background: var(--y-blue-dark); padding: calc(16 * var(--u)) calc(22 * var(--u)); letter-spacing: .08em; font-size: calc(18 * var(--u)); display: flex; align-items: center; flex: none; }
.ticker span { padding: calc(16 * var(--u)) calc(22 * var(--u)); border-right: 1px solid var(--line); white-space: nowrap; }
.ticker em { font-style: normal; color: var(--dim); }

/* ---------- entrance: hero class + tiles ---------- */
.focus { background: var(--navy); }
.top { display: flex; align-items: center; gap: calc(20 * var(--u)); padding: calc(24 * var(--u)) calc(36 * var(--u)) 0; }
.top h2 { margin: 0; font-size: calc(46 * var(--u)); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top h2 span { color: var(--dim); font-weight: 400; }
.top-right { display: flex; align-items: center; gap: calc(14 * var(--u)); }
.list-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(70 * var(--u)); }

.hero {
  margin: calc(20 * var(--u)) calc(36 * var(--u)) 0; border-radius: calc(28 * var(--u)); background: #fff; color: var(--navy);
  display: grid; grid-template-columns: 1fr calc(380 * var(--u)); overflow: hidden; min-height: calc(330 * var(--u)); position: relative;
}
.hero .body { padding: calc(30 * var(--u)) calc(36 * var(--u)); display: flex; flex-direction: column; min-width: 0; }
.hero .why { display: inline-flex; align-items: center; gap: calc(8 * var(--u)); font-weight: 700; font-size: calc(18 * var(--u)); letter-spacing: .1em; color: var(--y-blue-dark); }
.hero .nm { font-size: calc(96 * var(--u)); font-weight: 700; line-height: .95; margin-top: calc(12 * var(--u)); overflow-wrap: anywhere; }
.hero .mt { font-size: calc(32 * var(--u)); margin-top: calc(12 * var(--u)); }
.hero .mt span { color: #5a6475; }
.hero .sp { margin-top: auto; padding-top: calc(12 * var(--u)); font-size: calc(20 * var(--u)); color: #5a6475; }
.hero .fine { font-size: calc(24 * var(--u)); margin-top: auto; padding-top: calc(12 * var(--u)); font-weight: 500; }
.hero .cta {
  border: 0; background: var(--y-blue-dark); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: calc(12 * var(--u)); font: 700 calc(48 * var(--u)) var(--font); letter-spacing: .06em; cursor: pointer;
}
.hero .cta:active:not(:disabled) { filter: brightness(.9); }
.hero .cta svg { font-size: calc(72 * var(--u)); }
.hero .cta small { font-size: calc(18 * var(--u)); font-weight: 400; letter-spacing: .04em; opacity: .85; }
.hero.wait .cta { background: var(--navy2); cursor: default; }
.hero.wait .cta svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ticket = the same card after check-in: notches + perforation make it a pass, not a button */
.hero.ticket { background: var(--ok-hi); }
.hero.ticket .why { color: var(--ok); }
.hero.ticket .stub { background: var(--ok); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(8 * var(--u)); text-align: center; border-left: calc(6 * var(--u)) dotted var(--ok-hi); }
.hero.ticket .stub .ck { width: calc(150 * var(--u)); height: calc(150 * var(--u)); border-radius: 50%; background: #fff; color: var(--ok); display: flex; align-items: center; justify-content: center; font-size: calc(100 * var(--u)); font-weight: 700; }
.hero.ticket.stamp .stub .ck { animation: stamp .45s cubic-bezier(.2, 1.6, .4, 1); }
.hero.ticket .stub .ck svg { stroke-width: 3.4; }
.hero.ticket .stub b { font-size: calc(40 * var(--u)); letter-spacing: .08em; }
.hero.ticket .stub span { font-size: calc(22 * var(--u)); opacity: .9; }
.hero.ticket::before, .hero.ticket::after { content: ""; position: absolute; right: calc(368 * var(--u)); width: calc(44 * var(--u)); height: calc(44 * var(--u)); border-radius: 50%; background: var(--navy); }
.hero.ticket::before { top: calc(-22 * var(--u)); }
.hero.ticket::after { bottom: calc(-22 * var(--u)); }
@keyframes stamp { from { transform: scale(2.2); opacity: 0; } to { transform: none; opacity: 1; } }
.hero.ticket.amber { background: #ffe3a3; }
.hero.ticket.amber .why { color: #7a4300; }
.hero.ticket.amber .stub { background: var(--amber); color: #1a1a1a; border-left-color: #ffe3a3; }
.hero.ticket.amber .stub .ck { background: #1a1a1a; color: var(--amber); }

.others { padding: calc(18 * var(--u)) calc(36 * var(--u)) 0; }
.others h3 { margin: 0 0 calc(12 * var(--u)); font-size: calc(20 * var(--u)); letter-spacing: .14em; color: var(--dim); }
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: calc(12 * var(--u)); }
.tile {
  border-radius: calc(18 * var(--u)); background: var(--navy2); border: 2px solid var(--line); padding: calc(14 * var(--u)) calc(14 * var(--u)) 0;
  display: flex; flex-direction: column; min-height: calc(206 * var(--u)); overflow: hidden; color: #fff; text-align: left; font-family: var(--font);
}
.tile .star { font-size: calc(14 * var(--u)); letter-spacing: .08em; color: #9fd6f5; font-weight: 700; }
.tile .t { font-size: calc(24 * var(--u)); font-weight: 700; }
.tile .n { font-size: calc(24 * var(--u)); font-weight: 700; line-height: 1.05; margin-top: calc(4 * var(--u)); overflow-wrap: anywhere; }
.tile .r { font-size: calc(16 * var(--u)); color: var(--dim); margin-top: calc(4 * var(--u)); }
.tile .f { margin: auto calc(-14 * var(--u)) 0; min-height: calc(64 * var(--u)); display: flex; align-items: center; justify-content: center; gap: calc(8 * var(--u)); font-weight: 700; font-size: calc(19 * var(--u)); letter-spacing: .06em; padding: 0 calc(6 * var(--u)); text-align: center; }
.tile .f svg { font-size: calc(24 * var(--u)); }
.tile .f.go { background: var(--y-blue-dark); color: #fff; border: 0; border-top: 2px solid #2d8fd6; width: calc(100% + 28 * var(--u)); font-family: var(--font); cursor: pointer; }
.tile .f.go:active { filter: brightness(.9); }
.tile .f.lab { border-top: 2px solid var(--line); color: var(--dim); }
.tile .f.ok { background: var(--ok); color: #fff; }
.tile .f.amb { background: var(--amber); color: #1a1a1a; }
.tile.rsv { border-color: #4fb3ec; }
.tile.off { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 10px, transparent 10px 20px), var(--navy); }
.tile.off .n { color: var(--dim); }
.tile.cx .n { text-decoration: line-through; text-decoration-thickness: 2px; }

.skel { border-radius: calc(28 * var(--u)); margin: calc(20 * var(--u)) calc(36 * var(--u)) 0; height: calc(330 * var(--u)); background: linear-gradient(90deg, rgba(255, 255, 255, .07) 0, rgba(255, 255, 255, .16) 40%, rgba(255, 255, 255, .07) 80%) 0 0 / 200% 100%; animation: shimmer 1.4s linear infinite; }
.skel.sm { height: calc(206 * var(--u)); margin: 0; border-radius: calc(18 * var(--u)); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* countdown ring: shows the screen will close by itself */
.ring { position: relative; width: calc(76 * var(--u)); height: calc(76 * var(--u)); flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring .bg { stroke: rgba(255, 255, 255, .2); }
.ring .fg { stroke: #fff; stroke-dasharray: 214; animation: ring var(--ring-ms, 8s) linear forwards; }
@keyframes ring { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 214; } }
.ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: calc(24 * var(--u)); }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; }
.loading { align-items: center; justify-content: center; background: rgba(5, 12, 24, .7); }
.spinner { width: calc(110 * var(--u)); height: calc(110 * var(--u)); border: calc(10 * var(--u)) solid rgba(255, 255, 255, .25); border-top-color: #fff; border-radius: 50%; animation: spin .9s linear infinite; }
.loading-text { margin-top: calc(30 * var(--u)); font-size: calc(40 * var(--u)); font-weight: 500; }
#overlay-result { z-index: 45; }

/* stop screens (problems): one color, one symbol, one instruction */
.stop { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: calc(40 * var(--u)) calc(80 * var(--u)); position: relative; animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
.stop.warn { background: var(--amber); color: #1a1a1a; }
.stop.err { background: var(--err); }
.stop.info { background: var(--slate); }
.stop.ok { background: var(--ok); }
.stop .sym { font-size: calc(150 * var(--u)); line-height: 1; display: flex; }
.stop .sym svg { stroke-width: 2.4; }
.stop .who { font-size: calc(36 * var(--u)); margin-top: calc(10 * var(--u)); font-weight: 500; }
.stop h2 { margin: calc(6 * var(--u)) 0 0; font-size: calc(92 * var(--u)); line-height: .98; }
.stop p { font-size: calc(32 * var(--u)); line-height: 1.28; max-width: calc(880 * var(--u)); margin: calc(20 * var(--u)) 0 0; }
.stop .acts { margin-top: calc(34 * var(--u)); display: flex; gap: calc(16 * var(--u)); }
.stop.warn .btn { background: #1a1a1a; color: #fff; }
.stop .staffline { position: absolute; left: calc(30 * var(--u)); bottom: calc(24 * var(--u)); font: calc(15 * var(--u)) ui-monospace, Menlo, monospace; opacity: .75; }
.stop .ringpos { position: absolute; top: calc(26 * var(--u)); right: calc(30 * var(--u)); }
.stop.warn .ring .bg { stroke: rgba(0, 0, 0, .15); }
.stop.warn .ring .fg { stroke: #1a1a1a; }

/* ---------- studio ---------- */
.st { padding: calc(44 * var(--u)) calc(80 * var(--u)) calc(50 * var(--u)); }
.st.live { background: linear-gradient(160deg, #008a6b, #005a46); }
.st.next { background: linear-gradient(160deg, #6d1d6b, #3b0f3a); }
.st.none { background: #1a1d24; }
.st .hd { display: flex; align-items: center; gap: calc(26 * var(--u)); }
.st .hd .rm { flex: 1; font-size: calc(56 * var(--u)); font-weight: 700; min-width: 0; }
.st .hd .rm span { font-weight: 400; color: var(--dim); font-size: calc(30 * var(--u)); margin-left: calc(16 * var(--u)); letter-spacing: .1em; text-transform: uppercase; }
.st .hd .clock { font-size: calc(56 * var(--u)); }
.st .state { margin-top: calc(60 * var(--u)); display: inline-flex; align-items: center; gap: calc(18 * var(--u)); font-size: calc(44 * var(--u)); font-weight: 700; letter-spacing: .14em; }
.st .state svg { font-size: calc(56 * var(--u)); }
.st .nm { font-size: calc(230 * var(--u)); font-weight: 700; line-height: .9; margin-top: calc(10 * var(--u)); overflow-wrap: anywhere; }
.st .nm.long { font-size: calc(160 * var(--u)); }
.st .mt { font-size: calc(60 * var(--u)); margin-top: calc(20 * var(--u)); }
.st .mt span { color: var(--dim); }
.st .bottom { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: calc(30 * var(--u)); }
.st .scan { display: flex; align-items: center; gap: calc(26 * var(--u)); font-size: calc(66 * var(--u)); font-weight: 700; background: #fff; color: #005a46; border-radius: 999px; padding: calc(24 * var(--u)) calc(50 * var(--u)); }
.st .scan svg { font-size: calc(84 * var(--u)); }
.st .scan .ar { display: flex; animation: bob 1.6s ease-in-out infinite; }
.st .upn { font-size: calc(34 * var(--u)); color: var(--dim); text-align: right; }
.st .upn b { display: block; color: #fff; font-size: calc(44 * var(--u)); }
.st .opens { display: flex; align-items: center; gap: calc(30 * var(--u)); }
.st .opens .big { font-size: calc(120 * var(--u)); font-weight: 700; line-height: 1; }
.st .opens .lbl { font-size: calc(36 * var(--u)); color: var(--dim); line-height: 1.2; }
.st .msg { font-size: calc(40 * var(--u)); color: var(--dim); margin-top: calc(20 * var(--u)); }

/* studio "you're in" */
.member { flex: 1; display: grid; grid-template-columns: 1fr 1fr; background: var(--ok); animation: pop .18s ease-out; }
.member .l { display: flex; flex-direction: column; justify-content: center; padding: 0 calc(90 * var(--u)); min-width: 0; }
.member .l .hi { font-size: calc(60 * var(--u)); font-weight: 500; }
.member .l .nmx { font-size: calc(200 * var(--u)); font-weight: 700; line-height: .9; overflow-wrap: anywhere; }
.member .l p { font-size: calc(48 * var(--u)); margin: calc(30 * var(--u)) 0 0; }
.member .r { display: flex; align-items: center; justify-content: center; }
.member .pass { width: calc(640 * var(--u)); border-radius: calc(40 * var(--u)); background: var(--ok-hi); color: var(--navy); padding: calc(46 * var(--u)); transform: rotate(3deg); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.member .pass .ck { width: calc(180 * var(--u)); height: calc(180 * var(--u)); border-radius: 50%; background: var(--ok); color: #fff; display: flex; align-items: center; justify-content: center; font-size: calc(120 * var(--u)); animation: stamp .45s cubic-bezier(.2, 1.6, .4, 1); }
.member .pass .ck svg { stroke-width: 3.4; }
.member .pass b { display: block; font-size: calc(72 * var(--u)); margin-top: calc(26 * var(--u)); line-height: 1; }
.member .pass span { font-size: calc(36 * var(--u)); color: #335; }
.member .pass .tag { margin-top: calc(26 * var(--u)); font-size: calc(30 * var(--u)); font-weight: 700; letter-spacing: .12em; color: var(--ok); }

/* ---------- screensaver ---------- */
#screensaver { position: fixed; inset: 0; z-index: 80; background: #000; }
.saverlogo { position: absolute; opacity: .12; text-align: center; font-size: calc(40 * var(--u)); }
.saverlogo img { width: calc(150 * var(--u)); display: block; margin: 0 auto calc(10 * var(--u)); }

/* ---------- staff: PIN sheet + dashboard (dark, matches the kiosk navy) ---------- */
.staff {
  --s-bg: #071426;
  --s-panel: rgba(255, 255, 255, .045);
  --s-panel-2: rgba(255, 255, 255, .07);
  --s-line: rgba(255, 255, 255, .1);
  --s-line-2: rgba(255, 255, 255, .18);
  --s-text: #e9eef6;
  --s-dim: #93a3ba;
  --s-faint: #63738b;
  --s-field: #0c1d33;
  --s-accent: #2fa4e7;
  --s-good: #3ddc97;
  --s-warn: #f5b026;
  --s-bad: #ff6b74;
  z-index: 70; font-family: var(--sys); color: var(--s-text); -webkit-user-select: text; user-select: text;
}
.staff h3, .staff h4, .staff .tabs button, .staff .dbtn, .staff .kpi b, .staff .brand b { font-family: var(--font); }
.scrim { position: absolute; inset: 0; background: rgba(3, 9, 18, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* PIN sheet */
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 44px 36px;
  background: linear-gradient(180deg, #10284a 0%, #0a1b33 100%); border-top: 1px solid var(--s-line-2);
  border-radius: 30px 30px 0 0; box-shadow: 0 -24px 70px rgba(0, 0, 0, .55);
}
.sheet.enter { animation: sheet .22s ease-out; }
@keyframes sheet { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet::before { content: ""; position: absolute; top: 10px; left: 50%; width: 54px; height: 5px; margin-left: -27px; border-radius: 99px; background: var(--s-line-2); }
.pinrow { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 48px; align-items: center; max-width: 1100px; margin: 0 auto; }
.pinrow .brand { display: flex; align-items: center; gap: 12px; color: var(--s-dim); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.pinrow .brand img { width: 34px; }
.pinrow h3 { margin: 14px 0 0; font-size: 36px; font-weight: 700; }
.pinrow p { color: var(--s-dim); font-size: 16px; margin: 6px 0 0; }
.pin-error { color: var(--s-bad); font-weight: 600; min-height: 22px; margin-top: 14px; }
.pin-error.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.dots { display: flex; gap: 16px; margin-top: 26px; }
.dots i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--s-line-2); transition: background .12s, border-color .12s, transform .12s; }
.dots i.f { background: var(--s-accent); border-color: var(--s-accent); transform: scale(1.1); box-shadow: 0 0 14px rgba(47, 164, 231, .6); }
.pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pad button {
  height: 84px; border-radius: 18px; border: 1px solid var(--s-line); background: var(--s-panel-2);
  font: 500 34px var(--font); color: var(--s-text); cursor: pointer; transition: background .1s, transform .08s;
}
.pad button:active { background: var(--s-accent); border-color: var(--s-accent); transform: scale(.97); }
.pad button.alt { font: 600 16px var(--sys); color: var(--s-dim); background: transparent; }
.pad button.ok { font: 700 22px var(--font); letter-spacing: .06em; background: linear-gradient(180deg, #1580c9, var(--y-blue-dark)); border-color: transparent; }
.linkbtn { font: 600 15px var(--sys); color: var(--s-accent); background: none; border: 0; padding: 0 0 0 6px; cursor: pointer; text-decoration: underline; }

/* Dashboard */
.dash {
  position: absolute; inset: 0; display: flex; flex-direction: column; color: var(--s-text);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(0, 137, 208, .22), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(146, 39, 143, .14), transparent 60%),
    var(--s-bg);
}
.dash header {
  display: flex; align-items: center; gap: 18px; padding: 18px 28px; flex-wrap: wrap;
  border-bottom: 1px solid var(--s-line); background: rgba(255, 255, 255, .02);
}
.dash .brand { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 260px; }
.dash .brand img { width: 40px; }
.dash .brand b { display: block; font-size: 22px; letter-spacing: .08em; text-transform: uppercase; }
.dash .brand span { display: block; font-size: 13px; color: var(--s-dim); letter-spacing: .12em; text-transform: uppercase; margin-top: 2px; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(0, 0, 0, .3); border: 1px solid var(--s-line); }
.tabs button {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 0; cursor: pointer;
  font-size: 16px; font-weight: 500; letter-spacing: .03em; color: var(--s-dim); background: transparent; transition: color .12s, background .12s;
}
.tabs button svg { font-size: 17px; }
.tabs button:hover { color: var(--s-text); }
.staff button:focus { outline: none; }
.staff button:focus-visible { outline: 2px solid var(--s-accent); outline-offset: 2px; }
.tabs button.on { color: #fff; background: linear-gradient(180deg, #1580c9, var(--y-blue-dark)); box-shadow: 0 4px 14px rgba(0, 96, 169, .45); }
.tabs .badge-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--s-warn); color: #1a1a1a; font: 700 12px/20px var(--sys); }

.dash .dbtn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; cursor: pointer;
  font-size: 16px; font-weight: 700; letter-spacing: .04em; color: #fff; border: 1px solid transparent;
  background: linear-gradient(180deg, #1580c9, var(--y-blue-dark)); box-shadow: 0 6px 18px rgba(0, 96, 169, .35);
}
.dash .dbtn:active { transform: scale(.98); }
.dash .dbtn.sec { background: var(--s-panel-2); border-color: var(--s-line-2); box-shadow: none; color: var(--s-text); }
.dash .dbtn.danger { background: rgba(255, 107, 116, .1); border-color: rgba(255, 107, 116, .4); box-shadow: none; color: var(--s-bad); }
.dash .pane { flex: 1; overflow-y: auto; padding: 24px 28px 40px; min-height: 0; }
.dash .grid { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }

.tilecol { display: flex; flex-direction: column; gap: 12px; }
.kpi {
  position: relative; overflow: hidden; padding: 16px 18px 16px 22px; border-radius: 16px;
  background: var(--s-panel); border: 1px solid var(--s-line); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--s-dim);
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--s-line-2); }
.kpi b { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 28px; font-weight: 700; letter-spacing: .01em; text-transform: none; color: var(--s-text); }
.kpi.good::before { background: var(--s-good); }
.kpi.good b { color: var(--s-good); }
.kpi.warn { background: rgba(245, 176, 38, .08); border-color: rgba(245, 176, 38, .35); }
.kpi.warn::before { background: var(--s-warn); }
.kpi.warn b { color: var(--s-warn); }
.kpi.bad::before { background: var(--s-bad); }
.kpi.bad b { color: var(--s-bad); }
.kpi.blue::before { background: var(--s-accent); }
.kpi .unit { font: 500 14px var(--sys); color: var(--s-dim); letter-spacing: 0; }
.kpi svg { font-size: 22px; }
.kpi .pulse { width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, .55); } 70% { box-shadow: 0 0 0 10px rgba(61, 220, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); } }

.log { border-radius: 16px; overflow: hidden; background: var(--s-panel); border: 1px solid var(--s-line); }
.log h4 { display: flex; justify-content: space-between; align-items: center; margin: 0; padding: 16px 20px; font-size: 15px; font-weight: 700; letter-spacing: .12em; color: var(--s-dim); border-bottom: 1px solid var(--s-line); }
.log h4 span { font: 500 13px var(--sys); letter-spacing: 0; color: var(--s-faint); }
.lr { display: grid; grid-template-columns: 84px 1fr 1.3fr 220px; gap: 12px; align-items: center; padding: 13px 20px; border-bottom: 1px solid rgba(255, 255, 255, .05); font-size: 15px; }
.lr:last-child { border-bottom: 0; }
.lr:hover { background: rgba(255, 255, 255, .025); }
.lr > span:first-child { font-variant-numeric: tabular-nums; color: var(--s-dim); }
.lr b { font-weight: 600; }
.lr > span:nth-child(3) { color: var(--s-dim); }
.lr.hl { background: rgba(245, 176, 38, .07); box-shadow: inset 3px 0 0 var(--s-warn); }
.lr .empty { grid-column: 1 / -1; color: var(--s-faint); padding: 18px 0; text-align: center; }
.s { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-weight: 600; font-size: 13px; justify-self: start; border: 1px solid transparent; }
.s svg { font-size: 15px; }
.s.g { background: rgba(61, 220, 151, .12); border-color: rgba(61, 220, 151, .3); color: var(--s-good); }
.s.a { background: rgba(245, 176, 38, .12); border-color: rgba(245, 176, 38, .35); color: var(--s-warn); }
.s.r { background: rgba(255, 107, 116, .12); border-color: rgba(255, 107, 116, .3); color: var(--s-bad); }
.s.n { background: var(--s-panel-2); color: var(--s-dim); }
.s button { font: 700 12px var(--sys); color: #1a1a1a; background: var(--s-warn); border: 0; border-radius: 999px; padding: 3px 9px; margin-left: 6px; cursor: pointer; }

.form { max-width: 880px; display: flex; flex-direction: column; gap: 16px; }
.group { border-radius: 16px; background: var(--s-panel); border: 1px solid var(--s-line); padding: 6px 22px; }
.group h4 { margin: 14px 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--s-accent); }
.field { display: grid; grid-template-columns: 260px 1fr; align-items: center; gap: 18px; padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); font-size: 16px; }
.field:last-child { border-bottom: 0; }
.field .lbl { font-weight: 600; }
.field .lbl small { display: block; margin-top: 3px; font-weight: 400; font-size: 13px; color: var(--s-dim); line-height: 1.35; }
.field .ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.field input[type=number], .field input[type=time], .field input[type=text], .field input:not([type]), .field select {
  font: 16px var(--sys); padding: 11px 14px; border-radius: 12px; border: 1px solid var(--s-line-2);
  background: var(--s-field); color: var(--s-text); color-scheme: dark; outline: none; transition: border-color .12s, box-shadow .12s;
}
.field input:focus, .field select:focus { border-color: var(--s-accent); box-shadow: 0 0 0 3px rgba(47, 164, 231, .25); }
.field input[type=number] { width: 110px; text-align: center; font-variant-numeric: tabular-nums; }
.field select {
  flex: 1; min-width: 200px; appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393a3ba' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
.field .unit { color: var(--s-dim); font-size: 14px; }

/* toggle switch (styled checkbox) */
.switch { appearance: none; -webkit-appearance: none; position: relative; width: 52px; height: 30px; border-radius: 999px; background: #24354d; border: 1px solid var(--s-line-2); cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #c9d4e3; transition: transform .15s, background .15s; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.switch:checked { background: var(--y-blue); border-color: var(--y-blue); }
.switch:checked::after { transform: translateX(22px); background: #fff; }

.seg { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, .3); border: 1px solid var(--s-line); flex: 1; }
.seg label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--s-dim); font-weight: 600; transition: background .12s, color .12s; }
.seg label svg { font-size: 18px; }
.seg input { display: none; }
.seg label:has(input:checked) { background: var(--s-panel-2); color: #fff; box-shadow: inset 0 0 0 1px var(--s-line-2); }
.hint { color: var(--s-dim); font-size: 14px; line-height: 1.45; }
.note { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 14px 18px; border-radius: 14px; background: rgba(47, 164, 231, .07); border: 1px solid rgba(47, 164, 231, .22); color: var(--s-dim); font-size: 14px; line-height: 1.5; }
.note svg { font-size: 20px; color: var(--s-accent); flex: none; margin-top: 1px; }
.kiosk-url { flex: 1; font: 13px ui-monospace, Menlo, monospace; word-break: break-all; padding: 12px 14px; border-radius: 12px; background: var(--s-field); border: 1px dashed var(--s-line-2); color: #bfe3fb; }
.form-actions {
  position: sticky; bottom: -40px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; max-width: 880px;
  margin-top: 18px; padding: 16px 0; background: linear-gradient(180deg, transparent, var(--s-bg) 35%);
}
@media (max-width: 900px) {
  .dash .grid { grid-template-columns: 1fr; }
  .field { grid-template-columns: 1fr; gap: 8px; }
  .lr { grid-template-columns: 70px 1fr 160px; }
  .lr > span:nth-child(3) { display: none; }
}

/* ---------- status bar ---------- */
#statusbar { position: fixed; right: 16px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 50; display: flex; align-items: center; gap: 10px; font: 600 13px var(--sys); }
#training-tools { display: flex; align-items: center; gap: 6px; }
.badge { background: var(--y-orange); color: #111; padding: 4px 8px; border-radius: 6px; letter-spacing: .06em; }
.sim { font: 600 12px var(--sys); padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(5, 12, 24, .55); color: #fff; cursor: pointer; }
/* connection: hidden while all is well; a clear pill when UPACE can't be reached */
#net-status { display: none; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 999px; background: rgba(179, 20, 31, .92); color: #fff; }
#net-status.offline { display: flex; }
#net-status .dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; }
body.screen-pair-active #net-status { display: none; } /* the setup screen already says it's not set up */
body.screen-home-active:has(#att-ticker:not([hidden])) #statusbar { bottom: calc(70px + env(safe-area-inset-bottom)); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }
@media (orientation: portrait) {
  .hero { grid-template-columns: 1fr; }
  .hero.ticket::before, .hero.ticket::after { display: none; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .member { grid-template-columns: 1fr; }
}

/* ---------- admin portal (/admin) ---------- */
body.admin-page { overflow: auto; }
.staff.admin .dash { position: fixed; }
.admin-actions { display: flex; align-items: center; gap: 10px; }
.admin-actions a.dbtn { text-decoration: none; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kt { display: grid; grid-template-columns: 150px 1.2fr 1.4fr 80px 110px 2.2fr 100px; gap: 12px; align-items: center; padding: 13px 20px; border-bottom: 1px solid rgba(255, 255, 255, .05); font-size: 15px; }
.kt:last-child { border-bottom: 0; }
.kt:hover { background: rgba(255, 255, 255, .025); }
.kt-head { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--s-faint); background: rgba(0, 0, 0, .15); }
.kt-head:hover { background: rgba(0, 0, 0, .15); }
.kt > span:not(.s) { color: var(--s-dim); }
.kt .empty { grid-column: 1 / -1; text-align: center; padding: 18px 0; color: var(--s-faint); }
.staff.admin .note { margin-top: 18px; }
@media (max-width: 1000px) {
  .kt { grid-template-columns: 130px 1fr 1fr; }
  .kt > :nth-child(4), .kt > :nth-child(5), .kt > :nth-child(7) { display: none; }
}
.kt { grid-template-columns: 150px 1.2fr 1.4fr 130px 110px 2.2fr 90px 120px; }
.dash .dbtn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
#panel { position: fixed; inset: 0; z-index: 90; font-family: var(--sys); color: var(--s-text); }
#panel .side { position: absolute; top: 0; right: 0; bottom: 0; width: min(720px, 100%); overflow-y: auto; padding: 0 24px 24px;
  background: linear-gradient(180deg, #0d2140, #071426); border-left: 1px solid var(--s-line-2); box-shadow: -20px 0 60px rgba(0, 0, 0, .5); animation: slidein .2s ease-out; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
#panel .side header { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 0; background: #0d2140; border-bottom: 1px solid var(--s-line); margin-bottom: 16px; }
#panel .side header b { display: block; font: 700 22px var(--font); letter-spacing: .04em; }
#panel .side header span { color: var(--s-dim); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
#panel .field { grid-template-columns: 220px 1fr; }
#panel .form-actions { position: sticky; bottom: -24px; align-items: center; background: linear-gradient(180deg, transparent, #071426 35%); }
#panel .form-actions .hint { flex: 1; }
.kt .kname { display: flex; flex-direction: column; min-width: 0; }
.kt .kname b { color: var(--s-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kt .kname small { color: var(--s-faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#panel .link-result { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 14px; background: rgba(47, 164, 231, .07); border: 1px solid rgba(47, 164, 231, .25); }
#panel .link-result .lbl small { color: var(--s-dim); }
