/* RidyCast prototype. Brand green from ridy.club (#4BC451). Flow:
   auth -> setup -> kiosk{ idle media -> shopEntry(2 ways) -> shop(full-screen) -> checkout(QR) }.
   Design tokens are placeholders — backfill exact values from Figma get_variable_defs. */
:root {
  --rc-green:      #4BC451;   /* Ridy brand green */
  --rc-green-dark: #36a63d;
  --rc-grad:       linear-gradient(135deg, #4BC451, #00b87a, #00a8cc); /* RidyFlow brand gradient */
  --rc-bar:        #18221c;
  --rc-bg:         #efefef;
  --rc-card:       #ffffff;
  --rc-ink:        #14181a;
  --rc-muted:      #8b9094;
  --rc-line:       #e6e6e6;
  --rc-radius:     16px;
  --rc-shadow:     0 18px 50px rgba(0,0,0,.35);
  --rc-bar-h:      62px;
  --rc-blue:       #4285F4;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font-family: inherit; font-size: 100%; }   /* Josefin Sans everywhere */
html, body { height: 100%; background: #000; font-family: "Josefin Sans", system-ui, "Segoe UI", Roboto, sans-serif; color: var(--rc-ink); overflow: hidden; }

/* RidyFlow-style animated green→blue gradient background (behind auth/pair/setup/console) */
@keyframes rc-grad { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* Lucide icon sizing (monochromatic, inherit currentColor) */
[data-lucide] { display: inline-block; width: 18px; height: 18px; }
svg.lucide { width: 18px; height: 18px; vertical-align: -0.18em; stroke-width: 2; }
.shop-cta svg.lucide, .shop-cta [data-lucide] { width: 24px; height: 24px; }
.tablet-ill svg.lucide, .tablet-ill [data-lucide] { width: 110px; height: 110px; opacity: .8; }
.pay svg.lucide { width: 16px; height: 16px; }
.auth, .pair, .setup, .admin-center {
  background: linear-gradient(135deg, #4BC451, #00b87a, #00a8cc) !important;
  background-size: 300% 300% !important;
  animation: rc-grad 14s ease infinite;
}
#stage { position: relative; width: 100vw; height: 100vh; overflow: hidden; background: #000; }
/* Centered via absolute + translate(-50%,-50%) so an oversized (scaled-down) box stays perfectly centered. */
#kiosk { position: absolute; left: 50%; top: 50%; width: 1280px; height: 800px; background: #000; overflow: hidden; transform-origin: center; }
.rmark { width: 1em; height: 1em; vertical-align: -0.15em; border-radius: 5px; }
.rmark.big { width: 64px; height: 64px; border-radius: 16px; }

/* top-level state switching */
.state { position: absolute; inset: 0; }
.state[hidden] { display: none; }
#kiosk[data-state="auth"] .state:not(.auth),
#kiosk[data-state="setup"] .state:not(.setup),
#kiosk[data-state="kiosk"] .state:not(.kiosk) { display: none; }

/* wordmark */
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-size: 30px; font-weight: 800; }
.wordmark b { color: var(--rc-green); } .wordmark span { color: #1d2420; }
.wordmark.big { font-size: 52px; gap: 12px; }

/* ---------------- AUTH ---------------- */
.auth { display: grid; place-items: center; background: var(--rc-bg); }
.auth-card { width: 100%; max-width: 440px; background: var(--rc-card); border-radius: 22px; box-shadow: var(--rc-shadow); padding: 36px 34px; text-align: center; }
.auth-sub { color: var(--rc-muted); margin: 6px 0 22px; font-size: 16px; }
.fld { display: block; text-align: left; margin-bottom: 14px; }
.fld span { display: block; font-size: 13px; color: var(--rc-muted); margin-bottom: 6px; }
.fld input { width: 100%; height: 48px; border: 1px solid var(--rc-line); border-radius: 12px; padding: 0 14px; font-size: 16px; }
.btn { width: 100%; height: 50px; border: 0; border-radius: 12px; font-size: 16px; font-weight: 700; cursor: pointer; margin-top: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
/* animated RidyFlow gradient on primary actions (override later solid-green rules) */
.btn.primary, .cart-pill, .shop-cta, .pay-qr, .seg-btn.on, .steps .n {
  background: var(--rc-grad) !important; background-size: 300% 300% !important; color: #fff;
  animation: rc-grad 14s ease infinite;
}
.btn.primary:active, .cart-pill:active, .shop-cta:active { filter: brightness(.94); }
/* token balance chip shown after sign-in */
.token-chip { display: inline-block; margin-top: 8px; padding: 4px 12px; border-radius: 999px; background: rgba(75,196,81,.12); color: var(--rc-green-dark); font-weight: 700; font-size: 13px; }
.btn.google { background: #fff; color: #444; border: 1px solid var(--rc-line); }
.btn.google .g { color: var(--rc-blue); font-weight: 800; }
.btn.ghost { background: transparent; color: var(--rc-muted); height: 42px; }
.btn.big { height: 58px; font-size: 18px; }
.auth-msg { min-height: 18px; margin-top: 10px; font-size: 13px; color: #d23; font-weight: 600; }
.auth-note { margin-top: 10px; font-size: 12px; color: var(--rc-muted); line-height: 1.5; }
.auth-toggle { margin-top: 12px; font-size: 14px; color: var(--rc-muted); }
.auth-toggle a { color: var(--rc-green-dark); text-decoration: none; font-weight: 600; }

/* kiosk lock + PIN overlay */
.bar-btn.lock { background: rgba(255,255,255,.06); }
.pin-row { margin-top: 14px; font-weight: 600; gap: 8px; }
.pin-in { width: 110px; height: 42px; border: 1px solid var(--rc-line); border-radius: 10px; text-align: center; font-size: 22px; font-weight: 800; letter-spacing: 8px; }
.pin-overlay { position: absolute; inset: 0; z-index: 9; background: rgba(0,0,0,.6); display: grid; place-items: center; }
.pin-overlay[hidden] { display: none; }
#pinOverlay, #settings { z-index: 13; }   /* PIN / settings must sit above the driver panel (z-10) and HUD (z-9) */
.pin-card { width: 360px; background: #fff; border-radius: 20px; padding: 26px; text-align: center; box-shadow: var(--rc-shadow); }
.pin-card h3 { font-size: 22px; margin-bottom: 16px; }
.pin-actions { display: flex; gap: 10px; margin-top: 14px; } .pin-actions .btn { margin: 0; }

/* settings & diagnostics */
.settings-card { width: 560px; max-width: 92vw; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: var(--rc-shadow); text-align: left; }
.settings-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--rc-bar); color: #fff; }
.settings-head b { font-size: 17px; }
.diag-sec { padding: 14px 18px; border-bottom: 1px solid var(--rc-line); }
.diag-sec h4 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 6px; }
.diag-pill { font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: #eee; color: #888; margin-left: auto; }
.diag-pill.on { background: rgba(75,196,81,.15); color: var(--rc-green-dark); } .diag-pill.wait { background: rgba(224,163,46,.18); color: #b8801f; }
.diag-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.diag-row select { flex: 1; min-width: 170px; height: 38px; border: 1px solid var(--rc-line); border-radius: 8px; padding: 0 8px; font-family: inherit; }
.diag-preview { display: flex; justify-content: center; margin: 8px 0; }
.diag-canvas { width: 300px; height: 225px; max-width: 100%; background: #000; border-radius: 10px; border: 1px solid #333; }
.diag-status { background: #0c0c0c; color: #9fe2ad; border-radius: 8px; padding: 10px; font-size: 12px; line-height: 1.5; white-space: pre-wrap; margin-top: 6px; }
.btn.mini.danger { color: #c8553d; }

/* ---------------- PAIR (tablet entry) ---------------- */
.pair { display: grid; place-items: center; background: var(--rc-bg); }
.pair .muted { font-size: 14px; margin: -8px 0 14px; }
.pair-input { width: 100%; height: 64px; border: 2px solid var(--rc-line); border-radius: 14px; text-align: center; font-size: 40px; font-weight: 800; letter-spacing: 14px; padding-left: 14px; }
.pair-input:focus { outline: none; border-color: var(--rc-green); }
/* code shown in the driver console */
.pair-code { font-size: 52px; font-weight: 800; letter-spacing: 12px; color: var(--rc-green-dark); margin: 12px 0; }
.pair-card { text-align: center; }

/* ---------------- SETUP ---------------- */
.setup { display: grid; place-items: center; background: var(--rc-bg); }
.setup-card { width: 100%; max-width: 620px; background: var(--rc-card); border-radius: 22px; box-shadow: var(--rc-shadow); padding: 34px 40px; }
.setup-hi { font-style: normal; color: var(--rc-muted); font-weight: 600; font-size: 18px; margin-left: 6px; }
.who { margin: 14px 0 18px; color: var(--rc-muted); }
.steps { list-style: none; display: grid; gap: 14px; margin-bottom: 22px; }
.steps li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; }
.steps .n { width: 36px; height: 36px; border-radius: 50%; background: var(--rc-green); color: #fff; display: grid; place-items: center; font-weight: 800; }
.muted { color: var(--rc-muted); font-size: 14px; }
.boxrow { margin-top: 8px; font-size: 22px; font-weight: 800; }
.boxrow input { width: 140px; height: 42px; border: 1px solid var(--rc-line); border-radius: 10px; font-size: 20px; font-weight: 800; padding: 0 12px; }

/* ================= DRIVER CONSOLE (admin.html) ================= */
body.admin { overflow: auto; background: var(--rc-bg); height: auto; min-height: 100%; }
/* [hidden] must beat .admin-center's display:grid (same fix for both the driver console and ops). */
#adminSignin[hidden], #adminConsole[hidden], #opsSignin[hidden], #opsConsole[hidden] { display: none !important; }
.admin-center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.console-top { position: sticky; top: 0; z-index: 5; background: var(--rc-bar); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 22px; flex-wrap: wrap; }
.console-top .wordmark b { color: var(--rc-green); } .console-top .wordmark span { color: #eaf3ee; }
.console-top .wordmark em { font-style: normal; color: #9fb3a8; font-size: 16px; margin-left: 4px; }
.who2 { display: flex; align-items: center; gap: 12px; font-size: 14px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
/* ghost buttons on the dark bar need light text or they vanish */
.console-top .btn.ghost { color: #d7e6dd; border: 1px solid rgba(255,255,255,.28); }
.console-top .btn.ghost:hover { background: rgba(255,255,255,.10); }
.btn.mini { width: auto; height: 36px; margin: 0; padding: 0 14px; font-size: 14px; }
.console-body { max-width: 760px; margin: 0 auto; padding: 26px 22px 60px; display: grid; gap: 18px; }
.card { background: var(--rc-card); border: 1px solid var(--rc-line); border-radius: 18px; padding: 22px 24px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.card h2 { font-size: 22px; margin-bottom: 6px; }
.card .muted.small { font-size: 12px; margin-top: 10px; }
.card .row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.card .hash { font-size: 24px; font-weight: 800; color: var(--rc-muted); }
.box-in { width: 180px; height: 48px; border: 1px solid var(--rc-line); border-radius: 12px; font-size: 22px; font-weight: 800; padding: 0 14px; }
.saved { color: var(--rc-green-dark); font-weight: 700; }
.region-row { margin: 12px 0 14px; font-weight: 600; }
.region-row select { height: 40px; border-radius: 10px; border: 1px solid var(--rc-line); padding: 0 10px; font-size: 15px; margin-left: 8px; }
.media-add { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.media-add input { flex: 1; min-width: 140px; height: 38px; border: 1px solid var(--rc-line); border-radius: 8px; padding: 0 10px; font-family: inherit; }
.media-add select { height: 38px; border-radius: 8px; border: 1px solid var(--rc-line); padding: 0 8px; font-family: inherit; }
.ad-list { display: grid; gap: 10px; }
/* media preview (advertiser upload + driver browse) */
.ad-preview { margin: 8px 0; }
.ad-preview video, .ad-preview img { width: 100%; max-height: 260px; border-radius: 10px; background: #000; object-fit: contain; display: block; }
/* advertiser performance chart */
.perf-card .mhead { margin-bottom: 8px; }
.perf-totals { display: flex; gap: 16px; font-size: 14px; color: var(--rc-muted); flex-wrap: wrap; }
.perf-totals b { color: var(--rc-ink); font-size: 16px; }
.perf-chart { width: 100%; }
.perf-svg { width: 100%; height: auto; display: block; }
.perf-svg .bar-v { fill: rgba(75,196,81,.55); }
.perf-svg .line-r { stroke: #00a8cc; stroke-width: 2.5; }
.perf-svg .dot-r { fill: #00a8cc; }
.perf-svg .ax { fill: #9aa0a4; font-size: 10px; font-family: inherit; text-anchor: middle; }
.perf-svg text.ax:first-of-type { text-anchor: start; }
.perf-legend { display: flex; gap: 16px; font-size: 12px; color: var(--rc-muted); margin-top: 6px; }
.perf-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.perf-legend .dot.views { background: rgba(75,196,81,.55); }
.perf-legend .dot.rev { background: #00a8cc; border-radius: 50%; }
.upbar { height: 8px; border-radius: 6px; background: rgba(0,0,0,.12); overflow: hidden; margin: 8px 0 4px; }
.upbar[hidden] { display: none !important; }
.upbar-fill { height: 100%; width: 0; background: linear-gradient(90deg, #4BC451, #00b87a); border-radius: 6px; transition: width .15s ease; }
.ad-thumb { width: 72px; height: 54px; border-radius: 6px; object-fit: cover; background: #000; flex: 0 0 auto; }
.ad-stat { gap: 12px; }
.ad-meta { flex: 1; min-width: 0; }
.ad-nums { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; font-size: 13px; color: var(--rc-muted); }
.ad-nums b { color: var(--rc-ink); }
.ad-row { align-items: center; }
.aud-tag { font-size: 12px; color: var(--rc-green-dark); background: rgba(75,196,81,.12); border-radius: 999px; padding: 2px 8px; }
.ad-row { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--rc-line); border-radius: 12px; padding: 10px 14px; }
.ad-name { font-weight: 600; }
.ad-actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.ad-row.paused { opacity: .55; }
.paused-tag { font-size: 11px; font-weight: 700; color: #b8801f; background: rgba(224,163,46,.18); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.card.launch { text-align: center; }
.card.launch .btn.big { max-width: 360px; margin: 12px auto 0; }
.ad-row .ad-thumb { margin-right: 10px; }

/* ---- driver earnings hero ---- */
.earn-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; background: var(--rc-grad); background-size: 300% 300%; animation: rc-grad 14s ease infinite; color: #fff; border-radius: var(--rc-radius); padding: 22px 24px; box-shadow: var(--rc-shadow); }
.earn-label { font-size: 14px; opacity: .9; letter-spacing: .3px; }
.earn-big { font-size: 52px; font-weight: 800; line-height: 1.05; margin: 2px 0; }
.earn-big.sm { font-size: 30px; color: var(--rc-green-dark); }
/* commodity auto-fill card */
.optrow { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: 14px; line-height: 1.35; }
.optrow input { margin-top: 3px; flex: 0 0 auto; width: 18px; height: 18px; }
.earn-est-box { margin-top: 12px; padding: 12px 14px; background: rgba(75,196,81,.08); border: 1px solid rgba(75,196,81,.25); border-radius: 12px; }
.earn-sub .muted { color: rgba(255,255,255,.85) !important; }
.earn-slider { margin-top: 14px; }
.earn-slider .slider-head { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin-bottom: 6px; }
.earn-slider input[type=range] { width: 100%; accent-color: #fff; }
.earn-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: center; }
.estat { background: rgba(255,255,255,.14); border-radius: 12px; padding: 12px 14px; }
.estat b { display: block; font-size: 24px; font-weight: 800; }
.estat span { font-size: 12px; opacity: .9; }

/* ---- campaign marketplace ---- */
.mkt-search { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }
.mkt-q { flex: 1; min-width: 180px; height: 40px; border: 1px solid var(--rc-line); border-radius: 10px; padding: 0 12px; font-family: inherit; }
.mkt-search select { height: 40px; border: 1px solid var(--rc-line); border-radius: 10px; padding: 0 10px; font-family: inherit; }
.mkt-list { display: grid; gap: 12px; }
.mkt-card { display: flex; align-items: center; gap: 14px; border: 1px solid var(--rc-line); border-radius: 14px; padding: 12px 14px; }
.mkt-thumb { width: 104px; height: 64px; border-radius: 10px; object-fit: cover; background: #000; flex: 0 0 auto; }
.mkt-body { flex: 1; min-width: 0; }
.mkt-brand { font-weight: 700; font-size: 16px; }
.mkt-set { font-size: 14px; margin: 1px 0 6px; }
.mkt-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.mkt-pay { font-size: 14px; } .mkt-pay b { font-size: 16px; }
.earn-est { color: var(--rc-green-dark); font-weight: 700; }
.mkt-run { flex: 0 0 auto; align-self: center; }
.mkt-run.done { background: #2ea043 !important; }
.adv-add summary { cursor: pointer; margin-top: 8px; }
@media (max-width: 720px) { .earn-hero { grid-template-columns: 1fr; } }

/* ---------------- KIOSK / scenes ---------------- */
.kiosk { background: #000; }
.scene-host { position: absolute; inset: 0 0 var(--rc-bar-h) 0; background: var(--rc-bg); transition: opacity .45s ease, filter .45s ease; }
/* interrupt: dim + blur the ad roll behind the "want to shop?" popup (roll is also paused in JS) */
#kiosk[data-interrupt="1"] .scene-host { opacity: .25; filter: blur(3px); }
.scene-video { width: 100%; height: 100%; object-fit: cover; display: none; }
.scene-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
/* programmatic (IMA/VAST) ad UI overlay — covers the scene host while a VAST-via-IMA ad plays */
.ad-ui { position: absolute; inset: 0; z-index: 3; background: #000; }
.ad-ui[hidden] { display: none; }
.ad-ui > * { width: 100%; height: 100%; }
/* (retired) overlay banner host — the sponsor ad now plays as the #sceneNetwork slot, so this
   stays hidden. Kept only so legacy references resolve. */
.ad-banner { position: absolute; left: 0; right: 0; bottom: var(--rc-bar-h); z-index: 6; display: none; }
.ad-banner[hidden] { display: none; }
/* Sponsor / network ad scene — its OWN full slot in the rotation: a branded backdrop with the
   sandboxed ad unit centred at its natural size. Shown alone (never over the video). */
#kiosk[data-scene="network"] #sceneNetwork { display: flex; }
.scene-card.network { background: var(--rc-bg); gap: 14px; }
.net-kicker { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); font: 600 12px/1 'Josefin Sans', system-ui, sans-serif; letter-spacing: .18em; text-transform: uppercase; color: rgba(20,32,26,.5); }
.net-slot { display: flex; align-items: center; justify-content: center; max-width: 94%; max-height: 78%; box-shadow: 0 10px 40px rgba(0,0,0,.18); border-radius: 8px; overflow: hidden; }
#kiosk[data-scene="image"] .scene-img { display: block; }
.scene-card { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: #14201a; }
#kiosk[data-scene="video"]   .scene-video { display: block; }
#kiosk[data-scene="weather"] #sceneWeather { display: flex; }
#kiosk[data-scene="news"]    #sceneNews { display: flex; }
/* weather scene */
.weather { background: linear-gradient(160deg,#dff3ff,#eaf7ee); }
.wx-now { display: flex; align-items: center; gap: 14px; }
.wx-ico { font-size: 90px; } .wx-temp { font-size: 100px; font-weight: 800; }
.wx-place { font-size: 24px; color: #4a5a52; }
.wx-forecast { display: flex; gap: 26px; margin-top: 18px; }
.wx-forecast div { display: grid; justify-items: center; gap: 4px; font-size: 22px; }
.wx-forecast i { font-style: normal; color: #6a7a72; font-size: 16px; }
/* news scene — a grid of geo-localized headline boxes (workflow-fed), tap to read */
.news { background: linear-gradient(160deg,#eafaef,#ffffff); padding: 40px 72px 28px; justify-content: flex-start; gap: 22px; }
.news-head { width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.news-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--rc-green); font-weight: 800; font-size: 22px; }
.news-kicker .rmark { width: 26px; height: 26px; }
.news-place { font-size: 18px; color: #6a7a72; font-weight: 600; text-align: right; }
.news-grid { width: 100%; flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-content: stretch; min-height: 0; }
.news-grid[data-n="1"] { grid-template-columns: 1fr; } .news-grid[data-n="2"] { grid-template-columns: repeat(2, 1fr); }
.news-card { position: relative; display: flex; flex-direction: column; gap: 10px; text-align: left;
  background: #fff; border: 1px solid #e3efe6; border-radius: 18px; padding: 22px 22px 18px;
  box-shadow: 0 8px 26px rgba(20,60,38,.07); cursor: pointer; overflow: hidden; transition: transform .12s, box-shadow .12s; }
.news-card:active { transform: scale(.98); box-shadow: 0 4px 14px rgba(20,60,38,.10); }
.news-card::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--rc-green); opacity: .85; z-index: 1; }
.news-card-img { display: block; width: calc(100% + 44px); height: 132px; margin: -22px -22px 14px; object-fit: cover; background: #dfeae2; }
.news-card.has-img::after { top: 132px; }   /* accent bar starts below the photo */
.news-card.scope-national::after { background: var(--rc-blue, #4285F4); }
.news-card-cat { font: 700 12px/1 'Josefin Sans', system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--rc-green); }
.news-card.scope-national .news-card-cat { color: var(--rc-blue, #4285F4); }
.news-card h3 { margin: 0; font-size: 24px; line-height: 1.12; color: #14201a; }
.news-card p { margin: 0; font-size: 16px; line-height: 1.38; color: #51605a; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.news-card-src { margin-top: auto; padding-top: 8px; font-size: 13px; color: #8a978f; font-weight: 600; }
.news-card.house { justify-content: center; }
.news-foot { width: 100%; display: flex; align-items: center; justify-content: space-between; min-height: 18px; }
.news-dots { display: inline-flex; gap: 7px; }
.news-dots i { width: 8px; height: 8px; border-radius: 50%; background: #c7d8cd; transition: background .2s, width .2s; }
.news-dots i.on { width: 22px; border-radius: 4px; background: var(--rc-green); }
.news-hint { font-size: 14px; color: #8a978f; font-weight: 600; }
.news-loading .news-card { opacity: .5; }

/* in-kiosk article reader (iframe + summary fallback) */
.news-reader { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; background: #0f1512; }
.news-reader[hidden] { display: none; }
.news-reader-bar { display: flex; align-items: center; gap: 14px; padding: 12px 18px; background: #14201a; color: #fff; flex: 0 0 auto; }
.news-reader-title { flex: 1; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-reader-btn { appearance: none; border: 0; cursor: pointer; font: 700 16px 'Josefin Sans', system-ui, sans-serif;
  color: #fff; background: rgba(255,255,255,.12); border-radius: 12px; padding: 10px 18px; text-decoration: none; }
.news-reader-btn.open { background: var(--rc-green); color: #06281a; }
.news-reader-body { position: relative; flex: 1; min-height: 0; background: linear-gradient(160deg,#eafaef,#ffffff); overflow-y: auto; }
.news-reader-story { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; padding: 44px 56px; max-width: 1500px; margin: 0 auto; }
.news-reader-main { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; color: #14201a; }
.news-reader-img { width: 100%; max-height: 320px; object-fit: cover; border-radius: 18px; background: #dfeae2; }
.news-reader-img[hidden] { display: none; }
.news-reader-main .news-card-cat { font-size: 14px; }
.news-reader-main h2 { margin: 0; font-size: 40px; line-height: 1.12; }
.news-reader-main p { margin: 0; font-size: 23px; line-height: 1.5; color: #44514a; }
.news-reader-fallback-src { font-size: 16px; color: #8a978f; font-weight: 700; }
/* phone hand-off QR */
.news-reader-qr { flex: 0 0 300px; display: flex; flex-direction: column; align-items: center; gap: 14px;
  background: #fff; border: 1px solid #e3efe6; border-radius: 20px; padding: 26px 24px; box-shadow: 0 10px 30px rgba(20,60,38,.08); }
.news-reader-qr[hidden] { display: none; }
.news-reader-qr-title { font-weight: 800; font-size: 20px; color: #14201a; text-align: center; }
.news-reader-qr-sub { font-size: 15px; color: #6a7a72; text-align: center; line-height: 1.35; }
.news-reader-qr .qr-wrap { width: 240px; height: 240px; margin: 0; overflow: hidden; border-radius: 10px; }
.news-reader-qr #nrfQr canvas, .news-reader-qr #nrfQr img { width: 240px !important; height: 240px !important; }
.news-reader-qr .qr-logo { width: 46px; height: 46px; font-size: 26px; border-radius: 11px; box-shadow: 0 0 0 5px #fff; }

/* standby (no passenger) */
/* screen-off: full black when the camera sees no passenger */
.standby { position: absolute; inset: 0 0 var(--rc-bar-h) 0; z-index: 5; background: #000; color: #1c1c1c; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; transition: opacity .4s; }
.standby[hidden] { display: none; }
.standby .wordmark.big { opacity: .22; }
.standby .wordmark.big b { color: var(--rc-green); } .standby .wordmark.big span { color: #444; }
.standby p { font-size: 18px; color: #2a2a2a; }
.standby-eye { font-size: 13px; color: #333; }

/* Screen-off overlay: covers the whole kiosk (incl. status bar) above panels but below PIN/settings.
   Starts near-black; the hint fades up so a passenger knows it's off, not broken. Tap = turn back on. */
.off-screen { position: absolute; inset: 0; z-index: 11; background: #000; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: #2a2a2a; animation: off-fade .5s ease; }
.off-screen[hidden] { display: none; }
.off-screen [data-lucide] { width: 40px; height: 40px; opacity: .28; }
.off-hint { font-size: 16px; color: #555; opacity: 0; animation: off-hint-in 2.4s ease 1.2s forwards; }
.off-count { font-size: 12px; color: #333; opacity: .5; }
@keyframes off-fade { from { background: rgba(0,0,0,.4); } to { background: #000; } }
@keyframes off-hint-in { to { opacity: 1; } }

/* camera renders at a real size OFF-SCREEN (so frames decode for the model); .show reveals a small preview */
.cam-view { position: absolute; left: -10000px; top: 0; width: 180px; height: 135px; opacity: 0; pointer-events: none; overflow: hidden; z-index: -1; }
.cam-view.show { left: auto; right: 12px; top: 12px; opacity: 1; z-index: 8; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.45); border: 2px solid rgba(255,255,255,.6); }
.cam-view video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.cam-view canvas { display: none; }

/* status-bar indicator: a discreet red "active" dot (no video) */
.cam-chip { font-size: 13px; opacity: .95; display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: 8px; background: rgba(255,255,255,.08); color: #fff; border: 0; cursor: pointer; font-family: inherit; }
.cam-chip:active { background: rgba(255,255,255,.18); }
.cam-chip i { font-style: normal; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #777; display: inline-block; }
.cam-chip.off { background: rgba(224,163,46,.18); } .cam-chip.off .rec-dot { background: #e0a32e; }
.cam-chip.on .rec-dot, .cam-chip.wait .rec-dot { background: #ff3b30; box-shadow: 0 0 7px #ff3b30; animation: rec-pulse 1.4s infinite; }
@keyframes rec-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.cam-chip.on i { color: var(--rc-green); } .cam-chip.off i { color: #aaa; } .cam-chip.wait i { color: #e0a32e; }
.bar-btn.on { color: var(--rc-green); }
.bar-btn.lock.unlocked { color: var(--rc-green); }   /* unlocked driver session */

/* ---------------- verification HUD (PIN-gated diagnostics popup) ---------------- */
.hud { position: absolute; right: 12px; bottom: calc(var(--rc-bar-h) + 12px); width: 264px; z-index: 9;
  background: rgba(12,15,13,.93); color: #cfe9d6; border: 1px solid #234a30; border-radius: 14px; padding: 10px;
  font: 12px/1.45 ui-monospace, "SF Mono", Menlo, monospace; box-shadow: 0 10px 34px rgba(0,0,0,.55); backdrop-filter: blur(5px); }
.hud[hidden] { display: none; }
.hud-head { display: flex; align-items: center; gap: 7px; color: #7CFFA0; margin-bottom: 7px; font-weight: 700; }
.hud-head b { flex: 1; font-weight: 800; }
.hud-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff3b30; box-shadow: 0 0 7px #ff3b30; animation: rec-pulse 1.4s infinite; }
.hud-x { background: transparent; border: 0; color: #9fc7ab; cursor: pointer; font-size: 13px; line-height: 1; padding: 2px 4px; border-radius: 6px; }
.hud-x:hover { background: rgba(255,255,255,.1); color: #fff; }
#hudCanvas { width: 100%; height: auto; display: block; background: #000; border-radius: 9px; border: 1px solid #1f3a28; }
.hud-reco { margin: 7px 0 5px; color: #eafff0; font-weight: 700; min-height: 16px; }
.hud-legend { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.hud-legend .lg { font-size: 10px; padding: 1px 6px; border-radius: 999px; color: #06120b; font-weight: 800; }
.hud-legend .male { background: #3b82f6; color: #fff; } .hud-legend .female { background: #ec4899; color: #fff; }
.hud-legend .calm { background: #37d67a; } .hud-legend .caution { background: #f5c518; } .hud-legend .alert { background: #ff3b30; color: #fff; }
.hud-log { max-height: 116px; overflow: auto; border-top: 1px solid #1f3a28; padding-top: 6px; color: #9fe2ad; white-space: pre-wrap; }

/* ---------------- driver panel (bottom-right avatar) ---------------- */
.avatar { background: transparent; border: 0; color: inherit; cursor: pointer; padding: 4px; display: inline-flex; border-radius: 8px; transition: background .15s; }
.avatar:hover { background: rgba(255,255,255,.12); }
.driver-panel { position: absolute; inset: 0; z-index: 10; background: rgba(0,0,0,.5); display: grid; justify-items: end; align-items: end; padding: 0 14px calc(var(--rc-bar-h) + 12px); animation: dp-fade .2s ease; }
.driver-panel[hidden] { display: none; }
@keyframes dp-fade { from { background: rgba(0,0,0,0); } }
.dp-card { width: 356px; max-height: 82%; overflow-y: auto; background: #fff; color: var(--rc-ink); border-radius: 18px; padding: 18px; box-shadow: 0 24px 64px rgba(0,0,0,.5); position: relative; animation: dp-in .24s cubic-bezier(.2,.8,.2,1); }
@keyframes dp-in { from { transform: translateY(16px) scale(.98); opacity: 0; } }
.dp-card::-webkit-scrollbar { width: 7px; } .dp-card::-webkit-scrollbar-thumb { background: #d8ded9; border-radius: 8px; }
.dp-x { position: absolute; top: 12px; right: 14px; background: transparent; border: 0; font-size: 17px; color: #b3b9b4; cursor: pointer; line-height: 1; transition: color .15s; }
.dp-x:hover { color: #555; }
.dp-id { display: flex; align-items: center; gap: 13px; padding-bottom: 14px; border-bottom: 1px solid var(--rc-line); }
.dp-photo { width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(135deg,#4BC451,#00b87a); color: #fff; display: grid; place-items: center; flex: 0 0 auto; box-shadow: 0 0 0 3px rgba(75,196,81,.18); }
.dp-photo svg { width: 27px; height: 27px; }
.dp-id-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.dp-id-text b { font-size: 17px; line-height: 1.1; }
.dp-stars { font-size: 12.5px; color: #e0a32e; font-weight: 700; }
.dp-lock { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; align-self: flex-start; }
.dp-lock.open { color: var(--rc-green-dark); background: rgba(75,196,81,.14); }
.dp-lock:not(.open) { color: #b8801f; background: rgba(224,163,46,.16); }
.dp-lock svg { width: 13px; height: 13px; }
.dp-locked { padding: 22px 4px 8px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.dp-locked .muted { font-size: 14px; }
.dp-locked[hidden], .dp-tools[hidden], #dpReco[hidden] { display: none; }   /* class display: overrides UA [hidden] — restore it */
.dp-sec { padding: 14px 0; border-bottom: 1px solid var(--rc-line); }
.dp-sec:last-child { border-bottom: 0; padding-bottom: 2px; }
.dp-sec h4 { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 5px; }
.dp-sec h4 svg { width: 16px; height: 16px; color: var(--rc-green); }
.dp-sec .muted.small { line-height: 1.45; }
.dp-pill { margin-left: auto; font-size: 11px; font-weight: 800; background: rgba(75,196,81,.15); color: var(--rc-green-dark); padding: 2px 9px; border-radius: 999px; }
.dp-pill.all { background: var(--rc-green); color: #fff; }
.dp-ads { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.dp-ad { display: flex; align-items: center; gap: 11px; padding: 7px; border: 1px solid var(--rc-line); border-radius: 12px; background: #fafbfa; }
.dp-thumb { width: 58px; height: 40px; border-radius: 8px; overflow: hidden; background: #111613; flex: 0 0 auto; display: grid; place-items: center; }
.dp-thumb img, .dp-thumb video { width: 100%; height: 100%; object-fit: cover; }
.dp-thumb .dp-thumb-ic { color: #5b6660; } .dp-thumb .dp-thumb-ic svg { width: 18px; height: 18px; }
.dp-ad-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dp-ad-meta b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-ad-sub { font-size: 11px; color: var(--rc-muted); }
.dp-dl { font-size: 12px; font-weight: 700; border: 1px solid var(--rc-green); color: var(--rc-green); background: #fff; border-radius: 9px; padding: 6px 11px; cursor: pointer; flex: 0 0 auto; transition: background .15s, color .15s; }
.dp-dl:hover { background: rgba(75,196,81,.1); }
.dp-dl.done { background: rgba(75,196,81,.14); border-color: transparent; color: var(--rc-green-dark); cursor: default; }
.dp-dl:disabled { opacity: .6; cursor: default; }
.dp-act { width: 100%; margin: 8px 0 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.dp-act svg { width: 15px; height: 15px; }
.dp-toggle { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0 4px; padding: 10px; border: 1px solid var(--rc-line); border-radius: 12px; cursor: pointer; }
.dp-toggle input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--rc-green); flex: none; }
.dp-toggle b { font-size: 13px; }
.dp-row2 { display: flex; gap: 8px; margin-top: 4px; }
.dp-row2 .btn.mini { flex: 1; margin: 0; justify-content: center; }
.dp-locked .btn.mini { margin: 0; }

/* ---------------- lock guide (step-by-step) ---------------- */
.lock-guide { position: absolute; inset: 0; z-index: 14; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 12px; }
.lock-guide[hidden] { display: none; }

/* aggressive "tablet isn't locked" nag — blocking, can't be missed; opens lock guide or snoozes 2 min */
.lock-nag { position: absolute; inset: 0; z-index: 12; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(120% 120% at 50% 0%, rgba(200,40,30,.42), rgba(0,0,0,.78)); animation: nag-bg 1.6s ease-in-out infinite; }
.lock-nag[hidden] { display: none; }
@keyframes nag-bg { 0%,100% { background-color: rgba(0,0,0,.6); } 50% { background-color: rgba(120,20,16,.7); } }
.nag-card { width: 460px; max-width: 92vw; background: #fff; color: var(--rc-ink); border-radius: 22px;
  padding: 30px 28px 24px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.6);
  border: 3px solid #ff5a4d; animation: nag-pop .26s cubic-bezier(.2,.9,.2,1); }
@keyframes nag-pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.nag-ic { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%;
  background: rgba(255,90,77,.14); color: #e23b2e; animation: nag-pulse 1.3s ease-in-out infinite; }
.nag-ic svg { width: 38px; height: 38px; stroke-width: 2.2; }
@keyframes nag-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(226,59,46,.45); } 70% { box-shadow: 0 0 0 16px rgba(226,59,46,0); } }
.nag-card h2 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.nag-card p { color: var(--rc-muted); font-size: 15px; line-height: 1.5; margin-bottom: 20px; }
.nag-lock { animation: none !important; }   /* solid green CTA — stands out against the red alarm card */
.nag-lock:active { filter: brightness(.94); }
.nag-snooze { color: var(--rc-muted); }
.nag-help { display: block; margin: 12px auto 0; background: none; border: 0; cursor: pointer; color: var(--rc-muted); font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.lg-card { width: 360px; max-width: 94vw; max-height: 88%; overflow-y: auto; background: #fff; color: var(--rc-ink); border-radius: 18px; padding: 20px; position: relative; box-shadow: 0 24px 64px rgba(0,0,0,.5); animation: dp-in .24s cubic-bezier(.2,.8,.2,1); text-align: left; }
.lg-card::-webkit-scrollbar { width: 7px; } .lg-card::-webkit-scrollbar-thumb { background: #d8ded9; border-radius: 8px; }
.lg-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.lg-ic { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 12px; background: linear-gradient(135deg,#4BC451,#00b87a); color: #fff; display: grid; place-items: center; }
.lg-ic svg { width: 22px; height: 22px; }
.lg-head b { font-size: 17px; } .lg-head p { margin-top: 3px; line-height: 1.4; }
.lg-fs { margin: 0 0 14px; }
.lg-seg { display: flex; gap: 6px; background: #f0f2f0; padding: 4px; border-radius: 11px; margin-bottom: 14px; }
.lg-seg-btn { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 700; color: var(--rc-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.lg-seg-btn svg { width: 14px; height: 14px; }
.lg-seg-btn.on { background: #fff; color: var(--rc-ink); box-shadow: 0 2px 6px rgba(0,0,0,.1); }
.lg-steps { list-style: none; display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; }
.lg-steps[hidden] { display: none; }
.lg-steps li { display: flex; gap: 11px; }
.lg-n { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; background: rgba(75,196,81,.15); color: var(--rc-green-dark); font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.lg-steps b { font-size: 14px; }
.lg-steps .muted.small { line-height: 1.45; margin-top: 2px; }
.lg-foot { display: flex; align-items: center; gap: 7px; margin: 16px 0 12px; font-size: 12.5px; color: var(--rc-green-dark); font-weight: 700; }
.lg-foot svg { width: 16px; height: 16px; flex: 0 0 auto; }
.lg-done { width: 100%; margin: 0; }

/* tap-to-shop */
.shop-cta { position: absolute; left: 50%; bottom: calc(var(--rc-bar-h) + 30px); transform: translateX(-50%); border: 0; cursor: pointer; background: var(--rc-green); color: #fff; font-size: 22px; font-weight: 700; padding: 15px 32px; border-radius: 999px; box-shadow: 0 8px 28px rgba(0,0,0,.4); display: inline-flex; gap: 10px; align-items: center; z-index: 3; }
/* when a persistent bottom banner is shown, lift the shop CTA above it so they never overlap */
#kiosk[data-banner="bottom"] .shop-cta { bottom: calc(var(--rc-bar-h) + var(--rc-banner-h, 0px) + 24px); }
#kiosk[data-mode]:not([data-mode="idle"]) .shop-cta { display: none; }
#kiosk[data-present="0"] .shop-cta { display: none; }   /* no passenger → no shop prompt on the standby screen */

/* periodic prompt */
.ask-shop { position: absolute; inset: 0 0 var(--rc-bar-h) 0; background: rgba(0,0,0,.5); display: grid; place-items: center; z-index: 7; }
.ask-shop[hidden] { display: none; }
.ask-card { width: 460px; background: #fff; border-radius: 22px; padding: 30px; text-align: center; box-shadow: var(--rc-shadow); }
.ask-card h2 { font-size: 30px; margin: 10px 0 6px; } .ask-card p { color: var(--rc-muted); margin-bottom: 18px; }
/* compact interrupt modal (over the dimmed, still-playing ad) */
.ask-card.compact { position: relative; width: 340px; padding: 22px 24px 24px; border-radius: 20px; animation: dp-in .24s cubic-bezier(.2,.8,.2,1); }
.ask-card.compact h3 { font-size: 18px; margin: 12px 0 0; }
.ask-card.compact .qr-wrap { width: 180px; height: 180px; margin: 6px auto 0; }
.ask-card.compact .qr img, .ask-card.compact .qr canvas { width: 180px !important; height: 180px !important; }
.ask-card.compact .qr-logo { width: 40px; height: 40px; font-size: 22px; border-radius: 10px; box-shadow: 0 0 0 5px #fff; }
.ask-card.compact .btn.big { margin-top: 4px; }
.ask-kicker { font-size: 13px; font-weight: 800; color: var(--rc-green-dark); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.ask-count { display: inline-block; font-size: 13px; font-weight: 800; color: var(--rc-green-dark); background: rgba(75,196,81,.13); padding: 4px 12px; border-radius: 999px; min-height: 24px; }
.ask-count:empty { display: none; }
.ask-or { color: var(--rc-muted); font-weight: 800; font-size: 15px; margin: 12px 0; position: relative; }
.ask-or::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--rc-line); }
.ask-or span { position: relative; background: #fff; padding: 0 12px; }
.ask-x { position: absolute; top: 12px; right: 14px; background: transparent; border: 0; font-size: 16px; color: #b3b9b4; cursor: pointer; line-height: 1; }
.ask-x:hover { color: #555; }
.ask-actions { display: flex; gap: 12px; } .ask-actions .btn { margin: 0; }

/* ---------------- panels (full-screen, NOT floating popups) ---------------- */
.panel { position: absolute; inset: 0 0 var(--rc-bar-h) 0; background: var(--rc-bg); display: flex; flex-direction: column; z-index: 5; }
.panel[hidden] { display: none; }
#kiosk[data-mode="idle"] .panel { display: none; }
.panel-head { height: 56px; flex: 0 0 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; background: var(--rc-card); border-bottom: 1px solid var(--rc-line); }
.panel-title { font-weight: 800; font-size: 20px; display: inline-flex; align-items: center; gap: 8px; }
.shopnum { font-style: normal; color: var(--rc-muted); font-weight: 700; font-size: 15px; }
.panel-actions { display: flex; gap: 10px; align-items: center; }
.panel-close { border: 0; cursor: pointer; background: #f0f1f2; height: 40px; padding: 0 16px; border-radius: 10px; font-weight: 800; font-size: 15px; }
.panel-close:active { background: #e2e4e6; }
.pay-qr { width: auto; height: 40px; margin: 0; padding: 0 16px; background: var(--rc-green); color: #fff; font-size: 15px; border-radius: 10px; }
.seg { display: inline-flex; background: #eceef0; border-radius: 10px; padding: 3px; }
.seg-btn { border: 0; cursor: pointer; background: transparent; height: 32px; padding: 0 16px; border-radius: 8px; font-weight: 800; font-size: 13px; color: #6a7075; }
.seg-btn.on { background: var(--rc-green); color: #fff; }

/* shop entry: two ways */
.entry-body { flex: 1; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; padding: 40px; }
.entry-way { display: grid; justify-items: center; gap: 14px; text-align: center; }
.entry-way h3 { font-size: 26px; } .entry-way .muted { max-width: 320px; }
.entry-or { color: var(--rc-muted); font-weight: 800; font-size: 20px; position: relative; }
.entry-or span { background: var(--rc-bg); padding: 8px; }
.tablet-ill { font-size: 120px; }

/* live iframe vs demo grid */
.live-shop { flex: 1; width: 100%; border: 0; background: #fff; }
#kiosk[data-view="live"] .grid { display: none; }
#kiosk[data-view="demo"] .live-shop { display: none; }

/* demo grid + stepper tiles */
.grid { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; gap: 14px; padding: 16px; overflow: auto; }
.tile { background: var(--rc-card); border: 1px solid var(--rc-line); border-radius: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.06); position: relative; display: flex; flex-direction: column; padding: 12px; }
.tile .name { font-weight: 800; font-size: 17px; } .tile .cat { color: var(--rc-muted); font-size: 13px; }
.tile .price { position: absolute; top: 12px; right: 14px; font-weight: 800; font-size: 15px; }
.tile .thumb { flex: 1; display: grid; place-items: center; font-size: 58px; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 10px; height: 40px; }
.stepper button { width: 38px; height: 38px; border: 0; border-radius: 9px; background: #eef0f1; font-size: 22px; font-weight: 800; cursor: pointer; color: #333; }
.stepper .qty { min-width: 38px; height: 38px; padding: 0 8px; border-radius: 9px; background: var(--rc-green); color: #fff; font-weight: 800; display: grid; place-items: center; }
.tile:not(.in-cart) .stepper .minus, .tile:not(.in-cart) .stepper .qty { display: none; }
.tile:not(.in-cart) .stepper .plus { width: auto; padding: 0 18px; font-size: 16px; }
.tile:not(.in-cart) .stepper .plus::after { content: " Add"; }

/* checkout / QR */
.checkout { flex: 1; display: grid; grid-template-columns: 1fr 360px; gap: 24px; padding: 28px 40px; background: var(--rc-bg); }
.cart-lines { list-style: none; align-self: center; overflow: auto; max-height: 100%; }
.cart-lines li { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 16px; padding: 10px 0; }
.cart-lines .ci-emoji { font-size: 42px; text-align: center; }
.cart-lines .ci-name { font-size: 24px; font-weight: 700; } .cart-lines .ci-price { font-size: 24px; font-weight: 800; }
.cart-lines .total-row { border-top: 2px solid #d6d6d6; margin-top: 8px; padding-top: 16px; }
.cart-lines .total-row .ci-price { font-size: 36px; }
.cart-lines .empty { color: var(--rc-muted); font-size: 18px; }
.checkout-right { align-self: center; justify-self: center; text-align: center; }
.qr-wrap { position: relative; width: 280px; height: 280px; margin: 0 auto; background: #fff; display: grid; place-items: center; }
.qr img, .qr canvas { width: 280px !important; height: 280px !important; }
.entry-way .qr-wrap { width: 240px; height: 240px; } .entry-way .qr img, .entry-way .qr canvas { width: 240px !important; height: 240px !important; }
.qr-logo { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 56px; height: 56px; border-radius: 13px; background: var(--rc-green); color: #fff; font-weight: 900; font-size: 32px; display: grid; place-items: center; box-shadow: 0 0 0 6px #fff; }
.pay-icons { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.pay { background: #111; color: #fff; border-radius: 8px; padding: 7px 12px; font-weight: 700; font-size: 15px; }
.qr-hint { margin-top: 12px; color: var(--rc-muted); font-size: 15px; max-width: 320px; }
.qr-link { display: block; margin-top: 8px; font-size: 11px; color: #9aa; word-break: break-all; max-width: 320px; }

/* ---------------- status bar ---------------- */
.statusbar { position: absolute; left: 0; right: 0; bottom: 0; height: var(--rc-bar-h); background: var(--rc-bar); color: #fff; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 16px; z-index: 6; }
.bar-left, .bar-right { display: flex; align-items: center; gap: 12px; } .bar-right { justify-content: flex-end; }
.bar-center { display: flex; align-items: center; gap: 14px; justify-content: center; }
.brand b { color: var(--rc-green); font-size: 22px; }
.brand span { color: #fff; font-size: 22px; font-weight: 800; }   /* "Cast" — light on the dark status bar */
.brand-cast b { font-weight: 800; } .brand-cast span { color: var(--rc-green); font-weight: 800; }
.shop-tab { background: rgba(255,255,255,.1); color: #fff; border: 0; cursor: pointer; height: 38px; padding: 0 14px; border-radius: 10px; font-weight: 700; display: inline-flex; gap: 8px; align-items: center; }
.grid-ico { color: var(--rc-green); }
.bar-btn { background: rgba(255,255,255,.1); color: #fff; border: 0; cursor: pointer; height: 38px; min-width: 42px; border-radius: 10px; font-size: 16px; }

/* volume control: bar button toggles a slide-up popover holding the slider + a mute toggle */
.vol-wrap { position: relative; display: inline-flex; }
.vol-pop {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%) translateY(6px);
  background: rgba(20,22,26,.96); border: 1px solid rgba(255,255,255,.12); border-radius: 12px;
  padding: 14px 10px 10px; box-shadow: 0 10px 28px rgba(0,0,0,.45);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  opacity: 0; pointer-events: none; transition: opacity .14s ease, transform .14s ease; z-index: 40;
}
.vol-wrap.open .vol-pop { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.vol-wrap.open #volBtn { background: rgba(255,255,255,.22); }
.vol-mute {
  background: rgba(255,255,255,.1); color: #fff; border: 0; cursor: pointer;
  height: 34px; width: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
}
.vol-mute.muted { color: #ff6b5e; background: rgba(255,107,94,.16); }
#volSlider {
  -webkit-appearance: none; appearance: none; writing-mode: vertical-lr; direction: rtl;
  width: 8px; height: 110px; border-radius: 999px; cursor: pointer;
  background: linear-gradient(to top, var(--rc-green) var(--vol,100%), rgba(255,255,255,.18) var(--vol,100%));
}
#volSlider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid var(--rc-green); cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
#volSlider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--rc-green); cursor: pointer;
}
.back-btn { background: rgba(255,255,255,.14); color: #fff; border: 0; cursor: pointer; height: 38px; padding: 0 18px; border-radius: 999px; font-weight: 700; }
.clock { display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.clock b { font-variant-numeric: tabular-nums; font-size: 20px; } .clock i { font-style: normal; font-size: 11px; opacity: .8; }
.cart-pill { background: var(--rc-green); color: #fff; border: 0; cursor: pointer; height: 40px; padding: 0 16px; border-radius: 999px; font-weight: 800; font-size: 15px; }
.ico { font-size: 16px; opacity: .9; } .avatar { font-size: 20px; }
#kiosk[data-mode="idle"] .back-btn { display: none; }
#kiosk:not([data-mode="idle"]) .back-btn { display: inline-block; }

/* ---------------- mobile (driver console is phone-first) ---------------- */
body.admin { overflow-x: hidden; }
@media (max-width: 520px) {
  .admin-center { padding: 14px; min-height: 100svh; }
  .auth-card { padding: 26px 20px; border-radius: 18px; }
  .wordmark.big { font-size: 38px; gap: 8px; }
  .wordmark.big .rmark { width: 46px; height: 46px; }
  .console-top { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .console-top .wordmark { font-size: 22px; }
  .who2 { font-size: 12px; gap: 8px; }
  .console-body { padding: 16px 14px 50px; gap: 14px; }
  .card { padding: 18px 16px; border-radius: 14px; }
  .card h2 { font-size: 19px; }
  .row { flex-wrap: wrap; }
  .box-in { width: 100%; }
  .pair-code { font-size: 40px; letter-spacing: 8px; }
  .pin-in { width: 100%; }
  .card.launch .btn.big { max-width: 100%; }
}

/* ===== Advertiser · Campaign Manager ===== */
.adv-name { width: 120px; padding: 6px 10px; border: 1px solid var(--rc-line); border-radius: 8px; font: inherit; }
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 15px; color: var(--rc-muted); margin-bottom: 4px; }
.crumbs a { color: var(--rc-green); font-weight: 700; cursor: pointer; }
.crumbs span { color: var(--rc-ink); font-weight: 700; }
.crumbs svg { width: 15px; height: 15px; opacity: .5; }
.mhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 12px; }
.mhead h2 { margin: 0; font-size: 21px; }
.mhead .btn svg { width: 15px; height: 15px; vertical-align: -2px; }

.grid-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.mtile { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px; background: var(--rc-card, #fff);
  border: 1px solid var(--rc-line); border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.05); cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; font: inherit; }
.mtile:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(75,196,81,.16); border-color: var(--rc-green); }
.tile-ic { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(135deg, #4BC451, #00b87a 55%, #00a8cc); color: #fff; }
.tile-ic svg { width: 22px; height: 22px; }
.tile-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tile-body b { font-size: 16px; }
.tile-go { width: 18px; height: 18px; opacity: .4; flex: 0 0 auto; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(75,196,81,.12); color: #128a3e; font-weight: 700; }

.form-card { display: flex; flex-direction: column; gap: 14px; }
.form-card input[type=text], .form-card input:not([type]), .form-card input[type=number], .form-card input[type=email] { width: 100%; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.slabel { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; color: var(--rc-muted); }
.slabel select { font-weight: 600; }

.slider-row { display: flex; flex-direction: column; gap: 8px; }
.slider-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 700; }
.slider-head span { display: inline-flex; align-items: center; gap: 6px; color: var(--rc-muted); }
.slider-head svg { width: 16px; height: 16px; }
.slider-head b { color: var(--rc-green); font-size: 15px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px;
  background: linear-gradient(90deg, #4BC451, #00b87a); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 3px solid var(--rc-green); box-shadow: 0 2px 6px rgba(0,0,0,.25); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff;
  border: 3px solid var(--rc-green); box-shadow: 0 2px 6px rgba(0,0,0,.25); cursor: pointer; }
.dual { position: relative; height: 22px; }
.dual input[type=range] { position: absolute; top: 8px; left: 0; pointer-events: none; background: var(--rc-line); }
.dual input[type=range]::-webkit-slider-thumb { pointer-events: auto; }
.dual input[type=range]::-moz-range-thumb { pointer-events: auto; }

/* [hidden] must win over the flex/grid display on manager views + forms */
.mview[hidden], .form-card[hidden], .ad-preview[hidden] { display: none !important; }
.btn[hidden], .badge[hidden] { display: none !important; }   /* hidden buttons/badges stay hidden despite inline-flex */

/* ===================== Ops / Platform admin console ===================== */
.ops-tabs { display: flex; gap: 6px; padding: 10px 24px 0; flex-wrap: wrap; border-bottom: 1px solid var(--rc-line); }
.ops-tab { display: inline-flex; align-items: center; gap: 7px; background: transparent; border: 0; border-bottom: 3px solid transparent; color: var(--rc-muted); font: inherit; font-weight: 600; padding: 10px 14px; cursor: pointer; }
.ops-tab .lucide, .ops-tab svg { width: 16px; height: 16px; }
.ops-tab.on { color: var(--rc-green); border-bottom-color: var(--rc-green); }
.ops-tab .badge { background: #e23; color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; font-weight: 700; }
.ops-search { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ops-search input { flex: 1; min-width: 220px; }

.ops-table { display: flex; flex-direction: column; gap: 2px; }
.ops-row { display: grid; grid-template-columns: 2.4fr .9fr .8fr .7fr .6fr .9fr 40px; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 9px; background: #fff; }
.ops-row:nth-child(odd) { background: #f6f8f7; }
.ops-row.ops-head { background: transparent; color: var(--rc-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.ops-row .u-id { display: flex; flex-direction: column; overflow: hidden; }
.ops-row .u-id small { color: var(--rc-muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rolechip { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: #e7ecea; color: #445; text-transform: capitalize; }
.rolechip.r-admin { background: #ffe1e1; color: #b21; } .rolechip.r-adv { background: #e3edff; color: #2256c9; }
.rolechip.r-drv { background: #def5e1; color: #2a8c3a; } .rolechip.r-guest { background: #eee; color: #888; }

.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin: 6px 0 12px; }
.perm-tick { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--rc-line); border-radius: 11px; cursor: pointer; background: #fff; }
.perm-tick input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--rc-green); }
.perm-tick span { display: flex; flex-direction: column; } .perm-tick small { color: var(--rc-muted); font-size: 12px; }

.ad-review { align-items: flex-start; }
.ad-review .ad-thumb { width: 160px; height: 110px; object-fit: cover; border-radius: 10px; background: #000; }
.rolechip.st-approved { background: #def5e1; color: #2a8c3a; } .rolechip.st-pending { background: #fff2d6; color: #a76a00; } .rolechip.st-rejected { background: #ffe1e1; color: #b21; }
.btn.danger { color: #c0392b; }

/* ---- gaze calibration overlay: offline scheme of the device with the target part highlighted ---- */
.gazecal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.82); }
.gazecal[hidden] { display: none; }   /* author display:flex above otherwise beats the [hidden] attribute */
.gazecal-card { background: #15181c; color: #eef; border: 1px solid #2a2f36; border-radius: 16px; padding: 26px 30px; width: min(94vw, 480px); text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.gazecal-card h3 { margin: 0 0 6px; font-size: 22px; }
.gazecal-card .muted { color: #9aa3ad; font-size: 13px; }
.gazecal-device { margin: 20px auto 6px; display: flex; flex-direction: column; align-items: center; }
.gc-screen { width: 230px; height: 64px; border-radius: 10px; background: #222831; border: 2px solid #3a414b; display: flex; align-items: center; justify-content: center; font-size: 14px; letter-spacing: .6px; color: #9aa3ad; }
.gc-arm { width: 6px; height: 18px; background: #3a414b; }
.gc-org { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; padding: 12px; width: 210px; background: #0f5132; border-radius: 12px; }
.gc-cell { height: 50px; border-radius: 8px; background: #14693f; border: 1px solid #1c7a4a; }
.gc-cap { font-size: 11px; color: #6b7680; margin-top: 6px; letter-spacing: .5px; }
.gazecal-device .active { background: #37d67a !important; border-color: #37d67a !important; color: #04210f !important; animation: gcpulse 1s ease-in-out infinite; }
@keyframes gcpulse { 0%,100% { box-shadow: 0 0 0 4px rgba(55,214,122,.30); } 50% { box-shadow: 0 0 0 10px rgba(55,214,122,.10); } }
#gazeCalCam { width: 180px; height: 135px; border-radius: 10px; background: #000; margin: 12px auto 4px; display: block; }
.gazecal-cmd { font-size: 19px; font-weight: 700; color: #eef; margin: 12px 4px 2px; min-height: 26px; }
.gazecal-count { font-size: 44px; font-weight: 800; color: #37d67a; line-height: 1.05; min-height: 50px; }
.gazecal-msg { font-size: 14px; line-height: 1.35; min-height: 20px; margin: 4px 4px 4px; color: #9fb8ac; }
.gazecal-actions { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.gazecal-actions .btn.primary { padding: 11px 20px; font-size: 15px; }
