/* Shared structure and components. Every colour, radius and font comes from tokens that the three styles set:
   ui-lusail.css (Lusail: the default, quiet, LCSC teal), ui-race.css (Race: dark, bold, motion) and ui-glass.css
   (Glass: minimal, frosted). */
:root {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Geeza Pro", Tahoma, sans-serif;
  --font-display: var(--font);
  --radius: 22px;
  --radius-sm: 14px;
  --gap: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button, select, [role="button"], a { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--accent-text, var(--accent)); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: var(--ic-stroke, 1.8); stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .ic.flip { transform: scaleX(-1); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hide-sm { display: none; }
@media (min-width: 640px) { .hide-sm { display: inline; } }
:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; border-radius: 10px; }

.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--bg); }
.bd { position: absolute; display: none; }

/* ---------- panels ---------- */
.panel, .card {
  position: relative;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}
.stripe { display: none; }
.card h2, .panel h2, .box-head h2 { font-size: 16px; font-weight: 650; font-family: var(--font-display); }
.box-head, .card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; min-height: 26px; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
[dir="rtl"] .eyebrow { letter-spacing: 0; text-transform: none; }
.foot { text-align: center; padding: 22px 0 6px; }

/* ---------- boot + login ---------- */
.boot { display: grid; place-items: center; min-height: 100dvh; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login { display: grid; place-items: center; min-height: 100dvh; padding: 24px 16px; }
.login-card { width: 100%; max-width: 410px; padding: 34px 26px 24px; overflow: hidden; }
.login-title { font-size: 30px; line-height: 1.15; margin: 6px 0 8px; font-weight: 700; font-family: var(--font-display); }
.form { display: grid; gap: 14px; margin-top: 22px; }
.field { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.field input {
  height: 50px; padding: 0 14px; border-radius: var(--radius-input, 14px); border: 1px solid var(--line-2);
  background: var(--input-bg); color: var(--ink); font-size: 16px;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bot-check { min-height: 65px; } /* Cloudflare Turnstile's widget height */
.form-error { color: var(--crit-ink); background: var(--crit-soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.login-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border-radius: var(--radius-btn, 999px); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink);
  font-weight: 650; transition: background .2s, transform .15s, box-shadow .2s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .6; }
.text-btn { background: none; border: 0; padding: 6px 2px; color: var(--accent-text, var(--accent)); font-weight: 650; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--chip-bg); font-size: 14px; font-weight: 600; color: var(--ink-2);
  transition: border-color .2s, color .2s, background .2s;
}
.pill-btn:hover { border-color: var(--line-2); color: var(--ink); }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--seg-bg); border: 1px solid var(--seg-border, transparent); }
.seg button { border: 0; background: transparent; padding: 7px 14px; min-height: 34px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: background .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--seg-on); color: var(--seg-on-ink, var(--ink)); box-shadow: var(--seg-shadow, none); }
.seg.small button { padding: 5px 12px; min-height: 30px; font-size: 13px; }

/* ---------- shell ---------- */
.app { max-width: 1320px; margin: 0 auto; padding: 12px 16px calc(24px + var(--safe-b)); }
.top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0 16px; }
.wordmark { display: flex; flex-direction: column; line-height: 1.15; margin-inline-end: auto; min-width: 0; }
.wm-brand { font-size: 12px; color: var(--muted); letter-spacing: .03em; }
.wm-product { font-size: 18px; font-weight: 700; font-family: var(--font-display); }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--seg-bg); border: 1px solid var(--seg-border, transparent); border-radius: 999px; order: 3; width: 100%; }
.tab {
  flex: 1; position: relative; min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent;
  color: var(--ink-2); font-weight: 650; font-size: 15px; transition: background .2s, color .2s;
}
.tab[aria-selected="true"] { background: var(--seg-on); color: var(--seg-on-ink, var(--ink)); box-shadow: var(--seg-shadow, none); }
.tab-dot { position: absolute; top: 9px; inset-inline-end: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.top .ui-switch { display: none; }
@media (min-width: 560px) { .top .ui-switch { display: inline-flex; } }
@media (min-width: 900px) {
  .top { flex-wrap: nowrap; padding: 10px 0 22px; }
  .tabs { order: 0; width: auto; }
  .tab { flex: none; }
}

/* ---------- talk layout ---------- */
.talk-grid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); grid-template-areas: "call" "live" "transcript"; }
.convo { display: contents; }
.call { grid-area: call; }
.transcript-box { grid-area: transcript; display: flex; flex-direction: column; }
.live { grid-area: live; }
@media (min-width: 1024px) {
  .talk-grid { grid-template-columns: minmax(360px, 440px) minmax(0, 1fr); grid-template-areas: "convo live"; align-items: start; }
  .convo { grid-area: convo; display: flex; flex-direction: column; gap: var(--gap); position: sticky; top: 16px; height: calc(100dvh - 120px); min-height: 600px; }
  .transcript-box { flex: 1; min-height: 0; }
  .transcript { max-height: none; }
}

/* ---------- call card ---------- */
.call { text-align: center; padding: 28px 20px 22px; overflow: hidden; }
.call-title { font-size: 24px; line-height: 1.2; font-weight: 700; font-family: var(--font-display); margin-top: 6px; }
.call-sub { margin: 8px auto 0; max-width: 36ch; font-size: 15px; color: var(--ink-2); }
.call-main { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 24px; }
.call-info { min-height: 50px; }
.call-state { font-size: 17px; font-weight: 650; font-family: var(--font-display); }
.call-timer { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 21px; }
@media (min-width: 560px) { .ui-switch-m { display: none; } }

.orb { --lvl: 0; position: relative; width: 156px; height: 156px; border: 0; padding: 0; background: none; border-radius: 50%; -webkit-tap-highlight-color: transparent; }
.orb-core {
  position: absolute; inset: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--orb-core); color: var(--orb-ink, #fff); box-shadow: var(--orb-shadow, none);
  transition: transform .18s var(--ease), background .3s;
}
.orb:active .orb-core { transform: scale(.97); }
.orb-ic { width: 40px; height: 40px; stroke-width: 1.7; }
.orb-glow { position: absolute; inset: 22px; border-radius: 50%; background: var(--orb-glow, var(--accent)); opacity: .18; transform: scale(calc(1 + var(--lvl) * .5)); transition: transform .12s linear, background .3s; }
.orb-ring { position: absolute; border-radius: 50%; border: 1.5px solid var(--orb-ring, var(--accent)); opacity: 0; }
.orb-ring.r1 { inset: 12px; } .orb-ring.r2 { inset: 4px; } .orb-ring.r3 { inset: -4px; }
.orb-spin { position: absolute; inset: 6px; border-radius: 50%; border: 3px solid transparent; }
[data-state="idle"] .orb-glow, [data-state="ended"] .orb-glow { animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .14; } 50% { transform: scale(1.14); opacity: .24; } }
[data-state="mic"] .orb-spin, [data-state="connecting"] .orb-spin { border-top-color: var(--accent); animation: spin 1s linear infinite; }
[data-state="listening"] .orb-ring, [data-state="speaking"] .orb-ring { opacity: calc(.15 + var(--lvl) * .7); transform: scale(calc(1 + var(--lvl) * .08)); transition: opacity .12s, transform .12s; }
[data-state="speaking"] .orb-core { background: var(--orb-core-speak, var(--speak)); }
[data-state="speaking"] .orb-glow { background: var(--speak); }
[data-state="speaking"] .orb-ring { border-color: var(--speak); }
[data-state="muted"] .orb-core { background: var(--surface-3); color: var(--ink-2); box-shadow: none; }
.call[data-live] .orb { cursor: default; }
.call[data-live] .call-hero { display: none; }
.call[data-live] .call-main { margin-top: 0; }

.call-controls { display: flex; gap: 12px; justify-content: center; }
.ctl {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--chip-bg); font-weight: 650; font-size: 15px;
}
.ctl[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.ctl.danger { background: var(--crit); border-color: var(--crit); color: #fff; }
.call-msg { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); font-size: 14px; text-align: start; }
.call-msg.error { background: var(--crit-soft); color: var(--crit-ink); }
.call-msg.ok { background: var(--good-soft); color: var(--good-ink); }

@media (max-width: 1023px) {
  .call[data-live] { padding: 12px 14px; text-align: start; position: sticky; top: 8px; z-index: 6; }
  .call[data-live] .call-hero { display: none; }
  .call[data-live] .call-main { flex-direction: row; margin-top: 0; gap: 12px; }
  .call[data-live] .orb { width: 64px; height: 64px; }
  .call[data-live] .orb-core, .call[data-live] .orb-glow { inset: 8px; }
  .call[data-live] .orb-ring.r1 { inset: 4px; } .call[data-live] .orb-ring.r2 { inset: 1px; } .call[data-live] .orb-ring.r3 { inset: -2px; }
  .call[data-live] .orb-spin { inset: 2px; }
  .call[data-live] .orb-ic { width: 24px; height: 24px; }
  .call[data-live] .call-info { flex: 1; min-width: 0; min-height: 0; }
  .call[data-live] .call-state { font-size: 16px; }
  .call[data-live] .ctl { min-height: 44px; padding: 0 13px; }
  .call[data-live] .ctl span { display: none; }
  .call[data-live] .call-msg { margin-top: 10px; }
}

/* ---------- transcript ---------- */
.rec-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--crit-ink); background: var(--crit-soft); padding: 3px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.rec-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--crit); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }
.transcript { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; min-height: 200px; max-height: 56dvh; padding: 2px 2px 8px; overscroll-behavior: contain; }
.transcript-empty { margin: auto; display: grid; justify-items: center; gap: 10px; color: var(--muted); text-align: center; max-width: 30ch; padding: 26px 0; font-size: 15px; }
.transcript-empty .ic { width: 28px; height: 28px; }
.msg { max-width: 88%; display: grid; gap: 3px; animation: rise .25s var(--ease) both; }
.msg.user { align-self: flex-end; justify-items: end; }
.msg.agent { align-self: flex-start; }
.msg-who { font-size: 12px; color: var(--muted); padding: 0 6px; display: flex; gap: 6px; align-items: center; }
.msg-text { padding: 10px 14px; border-radius: 18px; font-size: 15.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user .msg-text { background: var(--bubble-user); color: var(--bubble-user-ink); border-end-end-radius: 6px; }
.msg.agent .msg-text { background: var(--bubble-agent); color: var(--ink); border-end-start-radius: 6px; }
.msg.agent.open .msg-text::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-inline-start: 6px; border-radius: 50%; background: currentColor; opacity: .45; animation: blink 1s ease-in-out infinite; vertical-align: middle; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); }
.tag.flag { background: var(--warn-soft); color: var(--warn-ink); }
.event { align-self: stretch; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); padding: 8px 12px; border-radius: 14px; border: 1px dashed var(--line-2); animation: rise .25s var(--ease) both; }
.event .ic { width: 18px; height: 18px; margin-top: 2px; color: var(--muted); }
.event-body { display: grid; gap: 6px; min-width: 0; flex: 1; }
.event-title { font-weight: 650; color: var(--ink); }
.event-note { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.event.link, .event.handover { border-style: solid; background: var(--surface-2); }
.event.link a { font-weight: 650; overflow-wrap: anywhere; }
.event.security { border: 0; background: var(--warn-soft); color: var(--warn-ink); }
.event.security .ic { color: var(--warn-ink); }
.event.notice, .event.tap { border: 0; background: var(--surface-2); }
.event.tap { align-self: flex-end; max-width: 88%; }
.mini-list { display: grid; gap: 6px; margin: 2px 0 0; padding: 0; list-style: none; }
.mini-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; background: var(--surface-2); border-radius: 10px; color: var(--ink); }
.mini-list .sub { color: var(--muted); font-size: 13px; }
.mini-list .num { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: end; }
.composer { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 6px; }
.composer input { flex: 1; min-width: 0; min-height: 48px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--input-bg); font-size: 16px; }
.composer input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.icon-btn { width: 48px; padding: 0; flex: none; }

/* ---------- live panel ---------- */
.live { padding: 20px; }
.live-body { display: grid; gap: 18px; min-width: 0; }
.live-sec { display: grid; gap: 10px; min-width: 0; }
.live-sec > .sec-title { margin-bottom: 0; }
.bk-grid, .bk-main, .bk-side { display: grid; gap: 18px; min-width: 0; align-content: start; }
@media (min-width: 1200px) { .bk-grid.two { grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr); } }
.ev[aria-pressed="true"] { border-color: var(--ev-tone, var(--accent)); }
.tk:disabled { cursor: default; }
.pass-body dl { margin: 0; }
.hold { font-size: 13px; font-weight: 650; padding: 4px 11px; border-radius: 999px; background: var(--warn-soft); color: var(--warn-ink); font-variant-numeric: tabular-nums; }
.sec-title { font-size: 13px; font-weight: 650; color: var(--muted); margin-bottom: 10px; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.sec-title .note { font-weight: 500; font-size: 12px; }
.fade-in { animation: rise .3s var(--ease) both; }

.events { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 620px) { .events { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ev {
  position: relative; display: grid; gap: 8px; text-align: start; padding: 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--tile-bg); color: var(--ink); overflow: hidden;
  transition: transform .2s var(--ease), border-color .2s, background .2s;
}
.ev:hover { transform: translateY(-2px); border-color: var(--ev-tone, var(--accent)); }
.ev-tag { justify-self: start; font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 3px 9px; border-radius: 999px; background: var(--ev-tone-soft, var(--accent-soft)); color: var(--ev-tone-ink, var(--accent-text, var(--accent))); }
.ev-date { display: flex; align-items: baseline; gap: 8px; }
.ev-day { font-family: var(--font-display); font-size: 34px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.ev-mon { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.ev-name { font-weight: 650; font-size: 15px; line-height: 1.3; }
.ev-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 2px; }
.ev-go { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--ev-tone-ink, var(--accent-text, var(--accent))); }
.ev-go .ic { width: 16px; height: 16px; }
.hint { font-size: 13px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--chip-bg); border-radius: 999px; padding: 8px 14px;
  font-size: 14px; line-height: 1.35; text-align: start; color: var(--ink); transition: border-color .2s, background .2s;
}
.chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.ask-group { margin-top: 12px; }
.ask-group h3 { font-size: 12px; font-weight: 650; color: var(--muted); margin-bottom: 8px; }

/* circuit map: real layout; labels grow when the map is drawn small */
.map-wrap { container-type: inline-size; border-radius: var(--radius-sm); background: var(--map-bg); border: 1px solid var(--line); padding: 10px 10px 8px; }
.circuit { display: block; width: 100%; height: auto; direction: ltr; } /* a map: label anchors stay physical in Arabic */
.circuit .fan { fill: var(--fan); }
.circuit .arena { fill: var(--fan); stroke: var(--fan-edge); stroke-width: 1; }
.circuit .bldg { fill: var(--bldg); }
.circuit .paddock { fill: var(--hosp); opacity: .55; }
.circuit .pitlane { fill: none; stroke: var(--track); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; opacity: .75; }
.circuit .edge { fill: none; stroke: var(--track-edge); stroke-width: 12; stroke-linejoin: round; }
.circuit .asphalt { fill: none; stroke: var(--track); stroke-width: 8; stroke-linejoin: round; }
.circuit .centre { fill: none; stroke: var(--track-line); stroke-width: .8; stroke-dasharray: 4 6; }
.circuit .startline { stroke: #fff; stroke-width: 3.2; }
.circuit .startline.chk { stroke: #111; stroke-dasharray: 1.6 1.6; }
.circuit .dir { fill: none; stroke: var(--track-line-strong, #fff); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.circuit text { font: 600 15px var(--font); fill: var(--ink-2); }
.circuit .lbl { fill: var(--muted); }
.circuit .stand { cursor: pointer; outline: none; }
.circuit .stand .hit { fill: transparent; stroke: transparent; stroke-width: 22; stroke-linejoin: round; pointer-events: all; }
.circuit .stand .shape { transition: fill .2s, filter .2s; }
.circuit .stand.kind-gs .shape { fill: var(--stand); }
.circuit .stand.kind-hosp .shape { fill: var(--hosp); }
.circuit .stand.kind-area .shape { fill: var(--hill); }
.circuit .stand:hover .shape, .circuit .stand:focus-visible .shape { filter: brightness(1.3); }
.circuit .stand:focus-visible .shape { stroke: var(--focus, var(--accent)); stroke-width: 2; }
.circuit .stand.off { cursor: default; }
.circuit .stand.off .shape { opacity: .4; }
.circuit .stand.off text { opacity: .6; }
.circuit .stand.on .shape { fill: var(--accent); animation: glow 1.6s ease-in-out infinite; }
.circuit .stand.on text { fill: var(--ink); font-weight: 750; }
.circuit .zl circle { fill: var(--stand); r: 6.5px; }
.circuit .zl text { font: 700 8.5px var(--font); fill: var(--zl-ink); }
@container (max-width: 700px) {
  .circuit text { font-size: 19px; }
  .circuit .zl circle { r: 8.5px; }
  .circuit .zl text { font-size: 11px; }
}
@container (max-width: 520px) {
  .circuit text { font-size: 28px; }
  .circuit .l-champions, .circuit .l-premiere, .circuit .l-lounge, .circuit .l-paddock, .circuit .l-arena, .circuit .zl { display: none; }
}
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { width: 14px; height: 8px; border-radius: 2px; display: inline-block; }
.map-legend .lg-gs { background: var(--stand); }
.map-legend .lg-hosp { background: var(--hosp); }
.map-legend .lg-fan { background: var(--fan-solid); }
.map-legend .lg-start { width: 4px; height: 12px; border-radius: 1px; background: repeating-linear-gradient(#fff 0 3px, #111 3px 6px); }
.map-credit { font-size: 11px; line-height: 1.4; color: var(--muted); margin-top: 6px; }
@keyframes glow { 50% { opacity: .65; } }

/* stepper */
.steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.steps li { flex: 1; min-width: 64px; display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.steps li::before { content: ""; height: 4px; border-radius: 999px; background: var(--line-2); transition: background .3s; }
.steps li.done { color: var(--ink-2); }
.steps li.done::before { background: var(--accent); }
.steps li.now { color: var(--ink); }
.steps li.now::before { background: linear-gradient(90deg, var(--accent), var(--speak)); }
@media (max-width: 559px) {
  .steps { overflow: visible; gap: 4px; }
  .steps li { min-width: 0; white-space: nowrap; }
  .steps li:not(.now) { color: transparent; }
  .steps li.now { flex: 2.4; }
}

.ev-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.ev-head b { font-family: var(--font-display); font-size: 18px; }
.ev-head span { font-size: 13px; color: var(--muted); }

/* ticket options */
.tickets { display: grid; gap: 8px; }
.tk {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; text-align: start; width: 100%;
  padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--tile-bg); color: var(--ink);
  transition: border-color .2s, background .2s, transform .2s var(--ease);
}
.tk:hover { border-color: var(--accent); }
.tk.on { border-color: var(--accent); background: var(--accent-soft); }
.tk-name { font-weight: 650; font-size: 15px; }
.tk-kind { font-size: 12px; color: var(--muted); }
.tk-price { font-family: var(--font-display); font-weight: 700; font-size: 18px; text-align: end; white-space: nowrap; grid-row: span 2; }

/* seat map */
.seatmap { display: grid; gap: 12px; }
.gs-strip { direction: ltr; display: grid; gap: 6px; }
.gs-track { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 700; color: var(--muted); padding: 5px 10px; border-radius: 999px; background: var(--track-band); text-transform: uppercase; letter-spacing: .06em; }
[dir="rtl"] .gs-track { letter-spacing: 0; text-transform: none; }
.gs-sales { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.gs-sale { display: grid; gap: 5px; align-content: start; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--tile-bg); min-width: 0; }
.gs-sale.on { border-color: var(--accent); }
.gs-head { display: flex; justify-content: space-between; align-items: baseline; gap: 2px 6px; flex-wrap: wrap; font-size: 11.5px; }
.gs-head b { font-weight: 700; white-space: nowrap; }
.gs-head span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.gs-sale.sold .gs-head span { color: var(--crit-ink); font-weight: 650; }
.gs-zones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.gs-zone { display: grid; gap: 3px; min-width: 0; }
.gs-secs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
.gs-sec {
  position: relative; height: 30px; min-width: 0; border: 0; padding: 0; border-radius: 4px; font-size: 10px; font-weight: 700; color: var(--ink);
  background: linear-gradient(to top, var(--seat-free) calc(var(--free) * 100%), var(--seat-taken) 0);
}
.gs-sec span { position: relative; }
.gs-sec.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.gs-sec.mine::after { content: ""; position: absolute; top: 3px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.gs-letter { text-align: center; font-size: 11px; font-weight: 700; color: var(--ink-2); }
.sm-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; }
.sm-head span { color: var(--muted); font-size: 13px; }
.sm-track { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 6px; border-radius: 999px; background: var(--track-band); }
[dir="rtl"] .sm-track { letter-spacing: 0; }
.sm-grid { display: grid; gap: 2px; direction: ltr; width: 100%; max-width: 640px; margin-inline: auto; }
.sm-row { display: grid; grid-template-columns: 18px repeat(var(--cols, 24), minmax(0, 1fr)) 18px; gap: 2px; align-items: center; }
.sm-row > i { font-style: normal; font-size: 10px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.seat {
  aspect-ratio: 1; min-width: 0; padding: 0; border: 0; border-radius: 4px 4px 2px 2px; background: var(--seat-free);
  box-shadow: inset 0 0 0 1px var(--seat-free-edge); transition: transform .12s, background .2s;
}
.seat:hover:not(:disabled) { transform: scale(1.25); background: var(--good); }
.seat.t { background: var(--seat-taken); box-shadow: none; }
.seat.m { background: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), 0 0 12px var(--accent); animation: seatpulse 1.8s ease-in-out infinite; }
.seat:disabled { cursor: not-allowed; }
@keyframes seatpulse { 50% { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 4px var(--accent); } }
.sm-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); }
.sm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sm-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sm-legend .lf { background: var(--seat-free); box-shadow: inset 0 0 0 1px var(--seat-free-edge); }
.sm-legend .lt { background: var(--seat-taken); }
.sm-legend .lm { background: var(--accent); }
.sm-pick { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-soft-ink); font-weight: 650; font-size: 14px; }
.sm-pick .ic { color: var(--accent-text, var(--accent)); }

/* summary */
.cart { display: grid; gap: 10px; padding: 16px; border-radius: var(--radius-sm); background: var(--tile-bg); border: 1px solid var(--line); }
.cart-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14.5px; }
.cart-row .k { color: var(--ink-2); }
.cart-row .v { font-variant-numeric: tabular-nums; text-align: end; font-weight: 600; }
.cart-sep { height: 1px; background: var(--line); margin: 2px 0; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cart-total .k { font-weight: 700; }
.cart-total .v { font-family: var(--font-display); font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stepper { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: var(--ink); display: grid; place-items: center; }
.stepper button:hover:not(:disabled) { background: var(--surface-3); }
.stepper button:disabled { opacity: .35; }
.stepper b { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }

/* booking pass */
.pass { position: relative; border-radius: var(--radius-sm); overflow: hidden; background: var(--pass-bg); color: var(--pass-ink); border: 1px solid var(--pass-border, transparent); }
.pass-top { padding: 18px 18px 14px; display: grid; gap: 4px; }
.pass-label { font-size: 12px; opacity: .8; letter-spacing: .06em; text-transform: uppercase; font-weight: 650; }
[dir="rtl"] .pass-label { letter-spacing: 0; }
.pass-ref { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: .04em; direction: ltr; text-align: start; }
.pass-cut { height: 0; border-top: 2px dashed var(--pass-cut, rgba(255, 255, 255, .35)); margin: 0 14px; position: relative; }
.pass-cut::before, .pass-cut::after { content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--panel-solid, var(--bg)); }
.pass-cut::before { left: -24px; } .pass-cut::after { right: -24px; }
.pass-body { padding: 14px 18px 18px; display: grid; gap: 10px; font-size: 14px; }
.pass-body .row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pass-body dt { font-size: 11.5px; opacity: .75; }
.pass-body dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.pass-pay { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border-radius: 999px; background: var(--pass-btn); color: var(--pass-btn-ink); font-weight: 700; text-decoration: none; margin-top: 4px; }
.pass-note { font-size: 12px; opacity: .85; }

/* ---------- admin (shared) ---------- */
.adm-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.subnav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; padding-bottom: 2px; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { flex: none; text-decoration: none; color: var(--ink-2); font-weight: 650; font-size: 14px; padding: 8px 14px; border-radius: 999px; border: 1px solid transparent; }
.subnav a:hover { background: var(--surface-2); }
.subnav a[aria-current="page"] { background: var(--seg-on); border-color: var(--line); color: var(--seg-on-ink, var(--ink)); box-shadow: var(--seg-shadow, none); }
.live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; color: var(--good-ink); background: var(--good-soft); padding: 5px 12px; border-radius: 999px; }
.live-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.fchip { border: 1px solid var(--line); background: var(--chip-bg); border-radius: 999px; padding: 7px 13px; min-height: 36px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.fchip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.search { flex: 1 1 220px; min-width: 0; height: 40px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--input-bg); padding: 0 16px; font-size: 15px; }
.search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .kpis { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.kpi { padding: 16px 18px; }
.kpi-label { font-size: 13px; color: var(--ink-2); }
.kpi-value { font-size: 28px; font-weight: 700; line-height: 1.2; margin-top: 6px; font-family: var(--font-display); }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.loading { opacity: .55; transition: opacity .2s; }
.charts { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .charts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .chart.wide { grid-column: 1 / -1; } }
.chart .card-head { margin-bottom: 14px; }
.chart-toggle { border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 650; padding: 4px 6px; }
.chart-toggle:hover { color: var(--ink); }
.chart-empty { color: var(--muted); font-size: 14px; padding: 24px 0; text-align: center; }
.cols { position: relative; height: 190px; margin-inline-start: 34px; }
.cols-grid { position: absolute; inset: 0 0 24px 0; }
.gl { position: absolute; inset-inline: 0; bottom: calc(var(--p) * 100%); border-top: 1px solid var(--grid-line, var(--line)); }
.gl.base { border-top-color: var(--line-2); }
.gl-l { position: absolute; inset-inline-end: calc(100% + 8px); top: -9px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cols-bars { position: absolute; inset: 0; display: flex; }
.col { flex: 1; position: relative; min-width: 0; outline: none; }
.col-area { position: absolute; inset: 0 0 24px 0; display: flex; justify-content: center; align-items: flex-end; }
.col-bar { width: min(24px, 64%); height: calc(var(--h) * 100%); background: var(--series); border-radius: 4px 4px 0 0; transition: filter .12s; }
.col-bar.zero { height: 0; }
.col:hover .col-bar, .col:focus-visible .col-bar { filter: brightness(1.15); }
.col:focus-visible { background: var(--surface-2); border-radius: 6px; }
.col-v { position: absolute; bottom: calc(var(--h) * (100% - 24px) + 28px); inset-inline: -10px; text-align: center; font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.col-x { position: absolute; bottom: 0; inset-inline: -14px; text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; }
.hbars { display: grid; gap: 12px; }
.hb { display: grid; gap: 5px; outline: none; }
.hb-top { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.hb-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-val { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.hb-bar { height: 10px; width: calc(var(--w) * 100%); min-width: 2px; background: var(--series); border-start-end-radius: 4px; border-end-end-radius: 4px; }
.hb:hover .hb-bar, .hb:focus-visible .hb-bar { filter: brightness(1.15); }
.segbar { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; }
.segbar > span { flex: var(--w) 1 0%; min-width: 2px; background: var(--c); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.legend b { font-weight: 650; font-variant-numeric: tabular-nums; }
.tip {
  position: fixed; z-index: 50; left: var(--x); top: var(--y); transform: translate(-50%, calc(-100% - 10px));
  background: var(--tip-bg); color: var(--tip-ink); border-radius: 10px; padding: 8px 10px; font-size: 13px; line-height: 1.4;
  pointer-events: none; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); max-width: 260px;
}
.tip strong { display: block; font-size: 15px; }
.tip span { display: block; opacity: .8; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: start; font-weight: 650; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data td.num { font-variant-numeric: tabular-nums; text-align: end; }
table.data tr:last-child td { border-bottom: 0; }
.rows { display: grid; gap: 10px; }
.row { display: grid; gap: 6px 14px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--tile-bg); text-align: start; width: 100%; color: inherit; text-decoration: none; }
a.row:hover { border-color: var(--line-2); background: var(--surface-2); }
.row-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.row-title { font-weight: 650; min-width: 0; }
.row-meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; font-variant-numeric: tabular-nums; }
.row-sum { font-size: 14px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge .ic { width: 14px; height: 14px; }
.badge.good { background: var(--good-soft); color: var(--good-ink); }
.badge.warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge.crit { background: var(--crit-soft); color: var(--crit-ink); }
.badge.accent { background: var(--accent-soft); color: var(--accent-soft-ink); }
.more { margin-top: 14px; display: flex; justify-content: center; }
.sec-explain { display: grid; gap: 10px; margin-bottom: 14px; }
.sec-explain ol { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; color: var(--ink-2); font-size: 14px; }
.quote { font-size: 14px; color: var(--ink); background: var(--surface-2); padding: 8px 12px; border-radius: 10px; overflow-wrap: anywhere; }
.logs { font-size: 13px; }
.log { display: grid; grid-template-columns: auto auto 1fr; gap: 4px 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); align-items: baseline; }
.log time { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.log .ev { font-weight: 650; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.log .msgt { grid-column: 1 / -1; color: var(--ink-2); overflow-wrap: anywhere; }
@media (min-width: 760px) { .log { grid-template-columns: 70px 64px 190px 1fr; } .log .msgt { grid-column: auto; } }
.log details { grid-column: 1 / -1; }
.log summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.log pre { margin: 6px 0 0; padding: 10px; background: var(--surface-2); border-radius: 10px; overflow-x: auto; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.lv { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; justify-self: start; background: var(--surface-2); color: var(--ink-2); }
.lv.warn { background: var(--warn-soft); color: var(--warn-ink); }
.lv.error { background: var(--crit-soft); color: var(--crit-ink); }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.drawer-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 40; }
.drawer {
  position: fixed; z-index: 41; inset-block: 0; inset-inline-end: 0; width: min(660px, 100%); background: var(--drawer-bg);
  overflow-y: auto; padding: 16px 16px calc(32px + var(--safe-b)); box-shadow: -10px 0 40px rgba(0, 0, 0, .25); overscroll-behavior: contain;
}
.drawer-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; position: sticky; top: -16px; background: var(--drawer-bg); padding: 10px 0; z-index: 2; }
.drawer-top h2 { font-size: 18px; flex: 1; font-family: var(--font-display); }
.dsec { margin-bottom: 12px; }
.dsec h3 { font-size: 14px; font-weight: 650; margin-bottom: 10px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; font-size: 14px; margin: 0; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
audio { width: 100%; height: 44px; }
.turns { display: flex; flex-direction: column; gap: 10px; }
.kv { display: grid; gap: 8px; font-size: 14px; }
.kv .item { padding: 10px 12px; background: var(--surface-2); border-radius: 12px; display: grid; gap: 4px; }
.kv .item .sub { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
