:root {
  --ink: #0a1128; --surface: #0f1936; --raised: #162247; --line: #25335f;
  --text: #eef1fa; --muted: #93a0c4; --accent: #f2553f; --accent-text: #ff7a63; --accent-ink: #0a1128;
  --ok: #4ade80; --bad: #f87171; --pass: #7dd3fc; --gold: #fbbf24;
  --header-bg: rgba(10,17,40,.85); --glow: transparent; --shadow: rgba(0,0,0,.9); --hl: rgba(255,255,255,.03);
  --r-xs: 4px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --radius: var(--r-md);
  color-scheme: dark;
}
html[data-theme="light"] {
  --ink: #f7f8fb; --surface: #ffffff; --raised: #eef0f6; --line: #dde1ec;
  --text: #0a1128; --muted: #5b6682; --accent: #f2553f; --accent-text: #c5371f; --accent-ink: #0a1128;
  --ok: #14773a; --bad: #c81e1e; --pass: #0369a1; --gold: #a16207;
  --header-bg: rgba(247,248,251,.9); --glow: transparent; --shadow: rgba(10,17,40,.25); --hl: rgba(0,0,0,.02);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    --ink: #f7f8fb; --surface: #ffffff; --raised: #eef0f6; --line: #dde1ec;
    --text: #0a1128; --muted: #5b6682; --accent: #f2553f; --accent-text: #c5371f; --accent-ink: #0a1128;
    --ok: #14773a; --bad: #c81e1e; --pass: #0369a1; --gold: #a16207;
    --header-bg: rgba(247,248,251,.9); --glow: transparent; --shadow: rgba(10,17,40,.25); --hl: rgba(0,0,0,.02);
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ink); color: var(--text);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh; display: flex; flex-direction: column;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 8px; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); }
h2 { font-size: 1.2rem; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }

.top {
  position: sticky; top: 0; z-index: 20; background: var(--header-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  flex-wrap: wrap;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); }
.brand:hover { text-decoration: none; }
.mark { width: 34px; height: 34px; display: block; }
nav { display: flex; align-items: center; gap: 16px; font-size: 0.95rem; }
nav a { color: var(--text); opacity: 1; transition: opacity .12s, color .12s; }
nav a:hover { opacity: 1; color: var(--accent-text); text-decoration: none; }
nav form { margin: 0; }
.linkbtn { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; }

main { width: 100%; max-width: 620px; margin: 0 auto; padding: 24px 16px 40px; flex: 1; }
main.wide { max-width: 920px; }
footer { display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; color: var(--muted); font-size: 0.8rem; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }

.hero { margin-bottom: 22px; }
.hero p { color: var(--muted); max-width: 46ch; }

.events { display: grid; gap: 12px; }
.event {
  display: flex; gap: 14px; align-items: center; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--text);
  transition: border-color .15s;
}
.event:hover { text-decoration: none; border-color: color-mix(in srgb, var(--text) 28%, var(--line)); }
.event h2 { margin: 0 0 2px; font-size: 1.08rem; }
.event p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.date {
  flex: 0 0 58px; height: 62px; border-radius: var(--r-md); background: var(--raised);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
  background: linear-gradient(180deg, var(--raised), var(--surface)); border: 1px solid var(--line);
}
.date span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-text); font-weight: 700; }
.date strong { font-size: 1.5rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px !important; }
.tag {
  display: inline-block; font-size: 0.74rem; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: var(--raised); color: var(--muted); border: 1px solid var(--line); text-transform: capitalize;
}
.tag.recurring { color: var(--pass); border-color: color-mix(in srgb, var(--pass) 40%, transparent); }
.tag.single { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.tag.full, .tag.st-cancelled { color: var(--bad); }
.tag.st-active { color: var(--ok); }
.tag.st-used { color: var(--muted); }

.back { display: inline-block; margin-bottom: 16px; color: var(--muted); }
.detail { margin-bottom: 20px; }
.detail .tags { margin: 0 0 10px !important; }
.when { color: var(--accent-text); font-weight: 600; }
.desc { color: var(--muted); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; margin-bottom: 20px; }
.panel.narrow { max-width: 420px; margin: 24px auto; }
label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 14px; }
.opt { font-weight: 400; color: var(--muted); }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 12px; font: inherit; font-size: 16px;
  color: var(--text); background: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm);
}
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check input { width: auto; margin: 0; }
.hp { position: absolute; left: -9999px; }
.btn {
  display: inline-block; width: 100%; padding: 14px 18px; border: 0; border-radius: var(--r-sm); cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; text-align: center;
  transition: filter .12s, background .12s;
}
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn:active { filter: brightness(.95); }
.btn.ghost { box-shadow: none; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.small { width: auto; padding: 8px 14px; font-size: 0.9rem; border-radius: var(--r-sm); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.inline { display: inline-block; margin-top: 12px; }
.error, .notice { padding: 10px 12px; border-radius: var(--r-sm); font-size: 0.92rem; }
.error, .notice.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: color-mix(in srgb, var(--bad) 70%, var(--text)); }
.notice.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: color-mix(in srgb, var(--ok) 70%, var(--text)); }

/* ticket */
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: 20px; }
.ticket .stub { padding: 22px 22px 18px; border-bottom: 2px dashed var(--line); position: relative; }
.ticket .stub::before, .ticket .stub::after {
  content: ""; position: absolute; bottom: -12px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); border: 1px solid var(--line);
}
.ticket .stub::before { left: -12px; } .ticket .stub::after { right: -12px; }
.ticket .tags { margin: 0 0 10px !important; }
.ticket h1 { font-size: 1.5rem; }
.holder { font-size: 1.1rem; font-weight: 700; margin: 10px 0 0; }
.qr { padding: 22px; display: flex; justify-content: center; }
.qr svg { width: min(260px, 70vw); height: auto; background: #fff; border-radius: 0; padding: 10px; }
.ticket.used .qr svg, .ticket.cancelled .qr svg { opacity: .35; }
.fine { text-align: center; color: var(--muted); font-size: 0.88rem; padding: 0 22px 20px; margin: 0; }

.log { list-style: none; margin: 12px 0 0; padding: 0; font-size: 0.9rem; }
.log li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.log .admitted span:last-child, tr.admitted td:last-child { color: var(--ok); }
.log .denied span:last-child, tr.denied td:last-child { color: var(--bad); }

/* scanner */
.viewport { position: relative; aspect-ratio: 1; background: #000; border-radius: 0; overflow: hidden; border: 1px solid var(--line); }
.viewport video { width: 100%; height: 100%; object-fit: cover; }
.reticle { position: absolute; inset: 16%; border: 3px solid rgba(255,255,255,.85); border-radius: 0; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
.cammsg { position: absolute; inset: auto 0 12px; text-align: center; margin: 0; font-size: 0.9rem; text-shadow: 0 1px 4px #000; padding: 0 12px; }
.result { margin-top: 14px; padding: 18px; border-radius: 0; border: 2px solid; }
.result.admitted { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.result.denied { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.result .verdict { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.result.admitted .verdict { color: var(--ok); } .result.denied .verdict { color: var(--bad); }
.result .who { font-size: 1.15rem; font-weight: 700; margin: 6px 0 2px; }
.result p { margin: 0 0 4px; }
.result .btn { margin-top: 12px; }
.manual { margin-top: 18px; }

/* admin */
.headrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.headrow h1 { margin: 0; }
.search { display: flex; gap: 8px; flex: 1 1 260px; max-width: 420px; }
.search input { margin: 0; padding: 8px 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; }
.stats strong { display: block; font-size: 1.7rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stats span { color: var(--muted); font-size: 0.82rem; }
.status { font-size: 0.88rem; color: var(--muted); margin-bottom: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--muted); }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); margin-top: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 480px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.07em; background: var(--surface); }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.sub { margin: 26px 0 10px; }
.tcard { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; margin-bottom: 10px; }
.actions { display: flex; gap: 8px; }
.actions form { margin: 0; }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- v1.2: tiers, perks, staff ---------- */
.small { font-size: 0.85rem; }
.tag.vip { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 50%, transparent); }
.tag.comp { color: var(--pass); border-color: color-mix(in srgb, var(--pass) 40%, transparent); }
.ticket.vip { border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); }
fieldset.tiers { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
fieldset.tiers legend { font-weight: 600; margin-bottom: 8px; }
.tierpick { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; cursor: pointer; font-weight: 400; }
.tierpick input { width: auto; margin: 4px 0 0; grid-row: span 2; }
.tierpick:has(input:checked) { border-color: var(--accent-text); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.tierpick.vip:has(input:checked) { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, transparent); }
.tierpick.out { opacity: .5; cursor: not-allowed; }
.tname { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.tprice { color: var(--muted); font-weight: 600; }
.tperks { color: var(--muted); font-size: 0.88rem; }
.perks { list-style: none; margin: 0 22px 14px; padding: 0; font-size: 0.92rem; }
.perks li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.perks li span:last-child { color: var(--muted); }
.perkbtns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.perkbtns form { margin: 0; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.modes a { text-align: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.modes a.on { border-color: var(--accent-text); color: var(--text); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.modes a:hover { text-decoration: none; }
.modehead { font-size: 1.2rem; margin: 0 0 12px; }
.tierrow { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 12px 4px; margin-bottom: 10px; }
.staffpick { display: grid; gap: 6px; margin-bottom: 14px; }
.inlineform { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0; }
.inlineform select, .inlineform input { width: auto; margin: 0; padding: 7px 10px; }
tr.inactive td { opacity: .55; }
.rolehelp { font-size: 0.9rem; padding-left: 18px; margin: 0 0 16px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

/* backup ticket code + flashlight */
.tcode { text-align: center; margin: 0 22px 16px; padding: 12px; border: 1px dashed var(--line); border-radius: var(--r-md); }
.tcode span { display: block; color: var(--muted); font-size: 0.8rem; }
.tcode strong { display: block; font: 800 2rem/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.18em; margin: 4px 0; }
.codein { font: 700 1.4rem ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.15em; text-transform: uppercase; text-align: center; }
.torch { position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,.6); color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 0; padding: 8px 14px; font: 600 0.85rem system-ui, sans-serif; cursor: pointer; }
.torch[aria-pressed="true"] { background: var(--gold); color: #16161d; }

/* perk redemption rows on the scanner */
.perkhead { margin: 12px 0 4px !important; font-weight: 700; }
.perkrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.perkrow strong { display: block; }
.perkrow .muted { font-size: 0.85rem; }
.perkrow .perkbtns { margin: 0; }
.perkrow .btn.small { min-width: 92px; padding: 10px 14px; }

.check.consent { align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.check.consent input { margin-top: 3px; }
.check.consent .opt { flex-basis: 100%; font-size: 0.8rem; padding-left: 24px; }

/* settings page */
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 0.82rem; margin-top: -6px; margin-bottom: 8px; }
.mini { font-size: 0.95rem; margin: 16px 0 8px; color: var(--muted); }
.testrow { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.testrow input { flex: 1 1 220px; margin: 0; }
details.help { margin: 0 0 14px; font-size: 0.9rem; }
details.help summary { cursor: pointer; color: var(--accent-text); }
details.help ol { padding-left: 20px; color: var(--muted); }
.check.small { font-size: 0.82rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.check.small input { width: auto; margin: 0; }

.dot.warn { background: var(--gold); }

/* beta.2: share kit, door counter */
.sharerow { display: flex; gap: 8px; flex-wrap: wrap; }
.sharerow input { flex: 1 1 260px; margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9rem; }
.actionsrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
.doorstats { display: grid; gap: 6px; margin-bottom: 10px; }
.doorstats .ds { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-size: 0.92rem; }
.doorstats .ds strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.doorstats .ds.near strong { color: var(--gold); } .doorstats .ds.full strong { color: var(--bad); }
.doorstats .bar { height: 4px; border-radius: 999px; background: var(--line); margin-top: 6px; overflow: hidden; }
.doorstats .bar i { display: block; height: 100%; background: var(--ok); }
.doorstats .ds.near .bar i { background: var(--gold); } .doorstats .ds.full .bar i { background: var(--bad); }

/* guest sign-in */
.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px 16px; background: #fff; color: #1f1f1f; border-radius: var(--r-sm); font-weight: 600; text-decoration: none; margin: 10px 0; }
.gbtn:hover { text-decoration: none; filter: brightness(.96); }
.gmark { flex: none; }
.quick { padding: 14px 20px; }
.quick .btn { margin-top: 4px; }
.quick .signedin { margin: 0 0 4px; }
.center { text-align: center; margin: 4px 0; }
.mylist { display: grid; gap: 12px; margin: 16px 0; }
.mycard { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; color: var(--text); text-decoration: none; }
.mycard:hover { border-color: var(--accent-text); text-decoration: none; }
.mytitle { font-weight: 700; font-size: 1.1rem; }
input[readonly] { opacity: .7; }

/* Mobile menu: CSS-only hamburger (no scripts; the site's security policy forbids inline JS) */
.navt { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.burger { display: none; width: 44px; height: 44px; flex-direction: column; justify-content: center; align-items: center; gap: 5px; cursor: pointer; border-radius: var(--r-sm); }
.burger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: var(--r-sm); transition: transform .2s, opacity .2s; }
.navt:focus-visible + .burger { outline: 2px solid var(--text); outline-offset: 2px; }
@media (max-width: 760px) {
  .burger { display: flex; }
  .top > nav { display: none; flex-basis: 100%; order: 5; flex-direction: column; align-items: stretch; gap: 0; padding-top: 8px; font-size: 1.05rem; }
  .navt:checked ~ nav { display: flex; }
  .top > nav a, .top > nav .linkbtn { display: block; width: 100%; text-align: left; padding: 14px 4px; border-top: 1px solid var(--line); min-height: 44px; }
  .top > nav form { width: 100%; }
  .navt:checked + .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .navt:checked + .burger span:nth-child(2) { opacity: 0; }
  .navt:checked + .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  main, main.wide { padding-left: 14px; padding-right: 14px; }
  .tablewrap { border: 0; border-radius: var(--r-md); overflow: visible; margin-top: 10px; }
  table, tbody { display: block; min-width: 0; width: 100%; }
  thead { display: none; }
  tr { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px 14px; margin-bottom: 10px; }
  td, tr:last-child td { display: flex; justify-content: space-between; gap: 14px; text-align: right; padding: 8px 0; border-bottom: 1px solid var(--line); word-break: break-word; }
  td:last-child { border-bottom: 0; }
  td[data-label]::before { content: attr(data-label); flex: 0 0 38%; text-align: left; color: var(--muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.07em; padding-top: 2px; }
  td[colspan] { display: block; text-align: left; border-bottom: 0; }
  td .actions, td form { justify-content: flex-end; }
  .stats { grid-template-columns: 1fr 1fr; }
  .row { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
  img, pre, code { max-width: 100%; }
  pre { overflow-x: auto; }
  input, select, textarea, button { font-size: 16px; }
}

footer img { width: 16px; height: 16px; opacity: .9; }
footer strong { color: var(--text); font-weight: 700; letter-spacing: -0.01em; }

/* Theme toggle (sun / moon) in the header */
.themetoggle { margin: 0; order: 2; }
.themetoggle button { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; transition: background .15s, border-color .15s; }
.themetoggle button:hover { background: var(--raised); border-color: var(--accent); }
.themetoggle button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* dark theme (default and Auto at night): offer the sun */
.themetoggle .to-light { display: inline-flex; }
html[data-theme="light"] .themetoggle .to-light { display: none; }
html[data-theme="light"] .themetoggle .to-dark { display: inline-flex; }
@media (prefers-color-scheme: light) {
  html[data-theme="system"] .themetoggle .to-light { display: none; }
  html[data-theme="system"] .themetoggle .to-dark { display: inline-flex; }
}
.top > .brand { order: 0; }
.top > nav { order: 1; margin-left: auto; }
.burger { order: 3; }
.powered { display: flex; align-items: center; justify-content: center; gap: 8px; }
@media (max-width: 760px) {
  .themetoggle { margin-left: auto; }
  .top > nav { order: 5; margin-left: 0; }
  .themetoggle button { width: 44px; height: 44px; font-size: 16px; }
}

.wordmark { font: 650 1.18rem/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: -0.03em; }
.wordmark em { font-style: normal; font-weight: 450; color: var(--muted); }
.brand .wm { height: 21px; width: auto; display: block; overflow: visible; }
.okmark .d { fill: currentColor; }

/* ---------- v1.1 mobile polish: spacing, collapsible events, header alignment ---------- */
/* Header: theme toggle and hamburger are the same 44px box on one baseline.
   The burger is a <label>, so it must drop the form-label margin. */
.burger { margin: 0; padding: 0; font-weight: 400; }
.themetoggle, .burger { align-self: center; flex: none; }
.themetoggle button { width: 44px; height: 44px; }
.top { row-gap: 0; }

/* Breathing room between sections */
main { padding-top: 28px; padding-bottom: 56px; }
.headrow { margin-bottom: 20px; }
.hero { margin-bottom: 28px; }
.panel { padding: 22px 20px; margin-bottom: 24px; }
.panel h2, .panel > summary h2 { margin-bottom: 12px; }
.sub { margin: 32px 0 12px; }
.stats { gap: 12px; margin-bottom: 20px; }
.stats div { padding: 16px; }
.stats span { display: block; margin-top: 4px; line-height: 1.3; }
.events, .mylist { gap: 14px; }
.event { padding: 16px; }
.tcard { padding: 16px; margin-bottom: 12px; }
.tierrow { padding: 14px 14px 6px; margin-bottom: 12px; }
.actionsrow { gap: 10px; }
.back { margin-bottom: 20px; }
.notice, .error { margin-bottom: 16px; }

/* Shared look for every collapsible section */
details > summary { list-style: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
details > summary::-webkit-details-marker { display: none; }
details.fold > summary::after, details.foldpanel > summary::after, details.syscheck > summary::after, details.ecard > summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-left: auto;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  margin-right: 4px; transform: translateY(-2px) rotate(45deg); transition: transform .15s;
}
details[open] > summary::after { transform: translateY(2px) rotate(225deg); }
.count { display: inline-block; min-width: 22px; padding: 1px 8px; margin-left: 6px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); color: var(--muted); font-size: 0.75rem; font-weight: 700; text-align: center; vertical-align: middle; letter-spacing: 0; }

/* Admin event list: collapsible cards */
.ecards { display: grid; gap: 12px; }
.ecard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; transition: border-color .15s; }
.ecard[open] { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.ecard > summary { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 64px; }
.ecard > summary .date { flex: 0 0 52px; height: 56px; }
.ecard-main { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.ecard-main strong { font-size: 1.02rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ecard-main .muted { font-size: 0.85rem; }
.ecard > summary .tag { flex: none; }
.ecard-body { padding: 4px 16px 18px; border-top: 1px solid var(--line); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 6px; }
.kv div { background: var(--ink); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; }
.kv dt { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; }
.kv dd { margin: 2px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }

/* System status block on the Events page */
.syscheck { border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 16px; margin-bottom: 8px; background: var(--surface); }
.syscheck > summary { display: flex; align-items: center; padding: 14px 0; font-weight: 600; font-size: 0.92rem; }
.syscheck[open] { padding-bottom: 8px; }
.syscheck .status { margin-bottom: 10px; line-height: 1.4; }

/* Collapsible sections inside the event editor */
.fold { border-top: 1px solid var(--line); margin: 20px 0 0; }
.fold > summary { display: flex; align-items: center; padding: 16px 0; font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
.fold[open] { padding-bottom: 8px; }
.fold + .btn, .fold ~ .btn { margin-top: 20px; }
.foldpanel > summary { display: flex; align-items: center; }
.foldpanel > summary h2 { margin: 0; }
.foldpanel[open] > summary { margin-bottom: 14px; }
.foldpanel .tablewrap { margin-top: 0; }
.foldall { margin: 0 0 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.foldpanel > form > :first-child, .foldpanel > .status:first-of-type { margin-top: 0; }

/* Footer: "Powered by [logo] DoorPass" */
.powered { gap: 6px; }
.dpname { display: inline-flex; align-items: center; gap: 6px; }
.dpname strong { font-weight: 650; letter-spacing: -0.02em; font-size: 17px; line-height: 1; }
.dpmark { display: block; }
.dpwm { height: 15px; width: auto; display: block; color: var(--text); overflow: visible; }

@media (max-width: 760px) {
  main, main.wide { padding: 22px 16px 48px; }
  .top { padding-left: 16px; padding-right: 12px; gap: 8px; }
  .themetoggle { margin-left: auto; }
  .panel { padding: 18px 16px; border-radius: var(--r-md); }
  .headrow h1 { font-size: 1.6rem; }
  label { margin-bottom: 16px; }
  .hint { margin-top: -8px; margin-bottom: 12px; }
  tr { padding: 8px 14px; margin-bottom: 12px; }
  td, tr:last-child td { padding: 10px 0; }
  .ecard-body .actionsrow .btn { flex: 1 1 auto; }
  .kv { grid-template-columns: 1fr 1fr; }
  .tcode strong { font-size: 1.6rem; letter-spacing: 0.12em; }
  .ticket .stub { padding: 20px 18px 16px; }
  .qr { padding: 20px 16px; }
}

/* ---------- v1.2 spacing rhythm: text never sits tight against a button ---------- */
/* Buttons: one comfortable tap size */
.btn.small { min-height: 42px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1.2; }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 55%, transparent); box-shadow: none; }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); box-shadow: none; filter: none; }
button.btn.danger:not(.small) { background: var(--bad); color: #fff; border: 0; }

/* A button that follows text or a field gets clear air above it */
form > .btn, form > button.btn, .panel > .btn, .panel > a.btn, details > .btn, details > a.btn,
p + .btn, p + a.btn, ul + .btn, .hint + .btn, label + .btn, label + button, .check + .btn, .staffpick + .btn, .fold + .btn { margin-top: 10px; }
.btn + .inline, .btn + a.muted { display: block; margin-top: 16px; text-align: center; }

/* Every group of buttons: same gap, wraps cleanly */
.btnrow, .actionsrow, .sharerow, .testrow, .perkbtns, .actions, .inlineform { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btnrow { margin-top: 16px; }
.actionsrow { margin: 14px 0 0; }
.sharerow { margin-bottom: 4px; }
.testrow { margin-top: 18px; padding-top: 18px; gap: 10px; }
.testrow .btn, .sharerow .btn { flex: none; }

/* Hint text sits under its field, not on top of it */
.hint { margin: 8px 0 0; line-height: 1.45; }
label .check.small { margin-top: 10px; }
label:has(.hint) { margin-bottom: 20px; }

/* Text blocks breathe before whatever comes next */
.panel > p, .panel > form > p, details > p { line-height: 1.55; }
.panel > p + form, .panel > p + .row, .panel > p + label { margin-top: 14px; }
.panel h2 + p, .foldpanel > summary + p { margin-top: 0; }
details.help { margin: 2px 0 18px; }
details.help summary { padding: 4px 0; }
.mini { margin: 22px 0 10px; }
.status { line-height: 1.45; }
.rolehelp { line-height: 1.6; margin: 4px 0 24px; }
.rolehelp li + li { margin-top: 6px; }
.empty { padding: 24px 12px; line-height: 1.5; }

/* System status: "sign out other devices" as a proper row */
.revoke { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; padding-top: 14px; border-top: 1px solid var(--line); }

/* Event list: live list, then hidden/ended in their own fold */
.ecard-body .btnrow { margin-top: 14px; }
.tag.st-hidden { color: var(--muted); }
.tag.st-ended { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.ecard.hidden, .ecard.ended { background: color-mix(in srgb, var(--surface) 70%, var(--ink)); }
.ecard.hidden .ecard-main strong, .ecard.ended .ecard-main strong { color: var(--muted); }
.offlist { margin-top: 28px; border: 1px dashed var(--line); border-radius: var(--r-md); padding: 0 14px; }
.offlist > summary { display: flex; align-items: center; gap: 10px; padding: 16px 2px; }
.offhead { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.offhead strong { font-size: 1.05rem; }
.offhead .muted { font-size: 0.85rem; }
.offlist > summary::after { content: ""; flex: none; width: 9px; height: 9px; margin-left: auto; margin-right: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.offlist[open] { padding-bottom: 14px; }
.offlist > .ecards { margin-top: 2px; }

/* Delete page and the editor's delete section */
.dangerzone { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.dangerzone > summary h2 { color: var(--bad); }
.dangerpanel { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.delname { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; margin: 6px 0 18px; border-radius: var(--r-md); background: var(--ink); border: 1px solid var(--line); }
.dellist { margin: 0 0 16px; padding-left: 20px; line-height: 1.6; }
.dellist li + li { margin-top: 4px; }
.btnrow.stack { margin-top: 18px; }

@media (max-width: 760px) {
  .ecard-body .btnrow { gap: 8px; }
  .ecard-body .btnrow > .btn { flex: 1 1 auto; white-space: nowrap; padding-left: 12px; padding-right: 12px; }
  .actionsrow > .btn, .btnrow.stack > .btn { flex: 1 1 100%; }
  .sharerow > input, .testrow > input { flex: 1 1 100%; }
  .sharerow > .btn, .testrow > .btn { flex: 1 1 100%; }
  .revoke .btn { flex: 1 1 100%; }
  .panel > .btn.small, form > .btn.small, details > .btn.small, details > a.btn.small { width: 100%; }
  .offlist { padding: 0 10px; }
}

/* ---------- group tickets and checkout ---------- */
.qtys { gap: 10px; }
.qtyrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; }
.qtyrow.picked { border-color: var(--accent-text); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.qtyrow.vip.picked { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, transparent); }
.qtyrow.out { opacity: .5; }
.qinfo { display: grid; gap: 2px; min-width: 0; }
.qinfo .tname { font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 6px; flex: none; }
.stepper input { width: 3.2em; text-align: center; margin: 0; padding: 8px 4px; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step { width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--raised); color: var(--text); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.step:disabled { opacity: .4; cursor: not-allowed; }
.carttotal { font-weight: 700; margin: 0 0 18px; min-height: 1.4em; }
.formsub { font-size: 1rem; margin: 6px 0 10px; }
.testmode { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--text); border: 1px dashed var(--gold); border-radius: var(--r-sm); padding: 10px 12px; font-size: .9rem; margin: 0 0 16px; }
.testmode code { font-weight: 700; white-space: nowrap; }
.summary { margin: 14px 0 10px; }
.summary > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.summary dt, .summary dd { margin: 0; } .summary dd { font-variant-numeric: tabular-nums; white-space: nowrap; }
.summary > div.total { font-weight: 800; border-bottom: 0; border-top: 2px solid var(--text); margin-top: -1px; }
.guestrow { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.gnum { font-weight: 700; margin: 0 0 6px; }
.orderlist { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.ticket.mini { margin: 0; padding-bottom: 14px; }
.ticket.mini .qr svg { max-width: 220px; }
.ticket.mini .tcode strong { font-size: 1.4rem; }
.sendfold { margin: 10px 16px 0; }
.sendfold summary { cursor: pointer; font-weight: 600; color: var(--accent-text); }


/* ---------- member photos and front desk ---------- */
.member { display: flex; gap: 14px; align-items: center; margin: 10px 0 6px; }
.mphoto { width: 84px; height: 84px; border-radius: var(--r-md); overflow: hidden; flex: none; background: var(--raised); border: 1px solid var(--line); display: grid; place-items: center; }
.mphoto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mphoto span { font-size: 1.6rem; font-weight: 800; color: var(--muted); }
.mphoto.big, .member.big .mphoto { width: 150px; height: 150px; border-radius: var(--r-md); }
.member.big .mphoto span, .mphoto.big span { font-size: 2.6rem; }
.member .btn { margin-top: 6px; }
.profilehead { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.profilehead > div:last-child { flex: 1; min-width: 220px; }
.profilehead h1 { margin-top: 0; }
.photodlg { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text); padding: 20px; width: min(420px, 94vw); }
.photodlg::backdrop { background: rgba(0,0,0,.6); }
.photodlg h2 { margin: 0 0 4px; }
.photostage { position: relative; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: #000; margin: 12px 0; }
.photostage video, .photostage img { width: 100%; height: 100%; object-fit: cover; display: block; transform: none; }
.photostage video { transform: scaleX(-1); } /* mirror like a selfie camera */
.photostage .cammsg { position: absolute; inset: auto 0 12px; text-align: center; color: #fff; }
.filebtn { cursor: pointer; }
.photodlg .linkbtn { margin-top: 10px; }

/* ---------- branding: footer wordmark and printing ---------- */
.dpname em { font-style: normal; font-weight: 650; color: #f2553f; }
.printlogo { display: none; }
.printrow { text-align: center; margin: 4px 0 24px; }
/* Printing a ticket (or "Save as PDF"): clean white page, logo on top, nothing else. */
@media print {
  :root, html[data-theme] { --ink: #fff; --surface: #fff; --raised: #fff; --line: #d6d2cb; --text: #0a1128; --muted: #555; --accent: #f2553f; --accent-text: #c5371f; --gold: #a16207; --ok: #14773a; --bad: #dc2626; --pass: #0369a1; }
  body { background: #fff !important; color: #0a1128; }
  header.top, nav, .notice, .printrow, .staff, .back, .themetoggle { display: none !important; }
  main { padding: 0 !important; max-width: none !important; }
  .printlogo { display: block; height: 40px; margin: 0 auto 18px; }
  .ticket { box-shadow: none !important; border: 1.5px solid #d6d2cb !important; background: #fff !important; break-inside: avoid; max-width: 440px; margin: 0 auto; }
  .ticket::before, .ticket::after { display: none !important; }
  .ticket .qr svg { width: 260px !important; height: auto !important; }
  footer { border: 0 !important; margin-top: 18px !important; padding: 0 !important; }
  .ticket * { color-adjust: exact; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  @page { margin: 14mm; }
}

/* ---------- scanner (redesign): one thumb, readable in the dark, a result you see from across the room ----------
   Result colours are fixed on purpose (never the venue accent) so staff learn them once. */
.scanpage { --go: #16a34a; --stop: #dc2626; --wait: #f59e0b; }
.scanpage footer { padding: 10px 16px; font-size: .75rem; }
.scanpage main.wide { max-width: 1120px; padding-top: 8px; }
.scanner { max-width: 1120px; margin: 0 auto; }
.scanbar { display: grid; gap: 8px; margin-bottom: 10px; }
.scanner .modes { grid-template-columns: repeat(3, 1fr); margin: 0; }
.scanner .modes a { padding: 12px 6px; min-height: 48px; display: grid; place-items: center; }
.scanner .modehead { margin: 0; flex: 1 1 auto; min-width: 0; font-size: 1.35rem; line-height: 1.1; }
.scanbar:has(.modehead) { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: nowrap; }
.scanbar:has(.modehead) .barrow { flex: 0 1 auto; justify-content: flex-end; flex-wrap: nowrap; }
.scanbar:has(.modehead) .barrow .doorstats:not([hidden]) { flex: 0 1 auto; }
.barrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.doorstats { flex: 1 1 220px; display: grid; gap: 4px; margin: 0; }
.doorstats .ds { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-size: .88rem; }
.doorstats .dstitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doorstats .dsn { font: 700 1.05rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doorstats .bar { grid-column: 1 / -1; height: 3px; margin: 2px 0 0; }
.net { font: 700 .78rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.net::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 999px; margin-right: 6px; background: currentColor; vertical-align: 1px; }
.net.ready { color: var(--ok); } .net.warn { color: var(--wait); border-color: color-mix(in srgb, var(--wait) 50%, transparent); }
.net.off { color: #111; background: var(--wait); border-color: var(--wait); }
.net a { color: inherit; text-decoration: underline; }
.iconbtn { width: 48px; height: 48px; flex: none; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.iconbtn .off, .iconbtn.muted .on { display: none; } .iconbtn.muted .off { display: block; } .iconbtn.muted { color: var(--muted); }

.scangrid { display: grid; gap: 12px; }
.scanside { display: grid; gap: 10px; align-content: start; }
.scanner .viewport { width: 100%; aspect-ratio: auto; height: min(62dvh, 560px); min-height: 240px; border-radius: 0; }
.scanner .reticle { position: absolute; inset: 45% auto auto 50%; height: min(62%, 300px); width: auto; aspect-ratio: 1; transform: translate(-50%, -50%); border: 0; border-radius: 0; box-shadow: 0 0 0 100vmax rgba(0,0,0,.32); }
.reticle i { position: absolute; width: 22%; height: 22%; border: 5px solid #fff; border-radius: 0; }
.reticle i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 0; }
.reticle i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 0; }
.reticle i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 0; }
.reticle i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 0; }
.scanner.live .reticle { animation: dp-pulse 1.6s ease-in-out infinite; }
@keyframes dp-pulse { 50% { transform: translate(-50%, -50%) scale(1.04); opacity: .75; } }
.outmode .reticle i { border-color: var(--wait); }
.outbar { position: absolute; top: 10px; left: 10px; right: 10px; margin: 0; padding: 8px 12px; border-radius: 0; background: var(--wait); color: #111; font-weight: 700; font-size: .9rem; text-align: center; }
.cammsg { bottom: 14px; }

/* Bottom tray: big targets in the bottom third of the screen. */
.tray { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.traybtn { min-height: 64px; display: grid; place-items: center; align-content: center; gap: 4px; padding: 8px 4px; border-radius: 0; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 700 .82rem system-ui, sans-serif; cursor: pointer; }
.traybtn:disabled { opacity: .35; cursor: not-allowed; }
.traybtn[aria-pressed="true"] { background: var(--wait); color: #111; border-color: var(--wait); }
.traybtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.traybtn[hidden] { display: none; }

/* Type code / Search name panel */
.panel { display: grid; gap: 10px; padding: 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--raised); }
.pform { display: grid; gap: 10px; margin: 0; }
.pform label { font-weight: 700; margin: 0; }
.pform input { margin: 0; min-height: 56px; font-size: 1.15rem; }
.pform .btn { min-height: 56px; }
.panelclose { min-height: 48px; }
.hits { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 46dvh; overflow-y: auto; }
.hits li.muted { padding: 10px 4px; }
.hit { width: 100%; display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; min-height: 64px; text-align: left; border-radius: 0; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.hpic { width: 48px; height: 48px; border-radius: var(--r-md); overflow: hidden; display: grid; place-items: center; background: var(--raised); font-weight: 800; color: var(--muted); }
.hpic img { width: 100%; height: 100%; object-fit: cover; }
.htxt { display: grid; min-width: 0; } .htxt strong, .htxt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .htxt span { font-size: .85rem; }
.hst { font: 700 .8rem system-ui, sans-serif; color: var(--ok); } .hst.in { color: var(--wait); } .hst.bad { color: var(--stop); }

/* Idle + result card */
.resultside { min-width: 0; }
.idle { display: grid; place-items: center; text-align: center; gap: 2px; padding: 28px 16px; border: 1px dashed var(--line); border-radius: 0; color: var(--muted); }
.idle p { margin: 0; } .idle .idlemark { margin: 0 auto 6px; display: block; }
.scanner .result { margin: 0; padding: 0; border: 0; border-radius: 0; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; box-shadow: 0 20px 60px -20px rgba(0,0,0,.8); }
.result .band { display: flex; align-items: center; gap: 12px; padding: 16px 20px; color: #fff; }
.result.v-ok .band { background: var(--go); } .result.v-denied .band { background: var(--stop); } .result.v-check .band { background: var(--wait); color: #111; }
.result .band .verdict { font: 800 1.9rem/1.05 system-ui, sans-serif; letter-spacing: .02em; text-transform: uppercase; color: inherit; margin: 0; flex: 1; }
.result .vicon { width: 40px; height: 40px; border-radius: 0; display: grid; place-items: center; background: rgba(0,0,0,.18); font: 900 1.4rem system-ui, sans-serif; }
.result .okmark { color: #fff; flex: none; animation: dp-ok .36s cubic-bezier(.2,1.6,.4,1); }
@keyframes dp-ok { from { transform: scale(.4) rotate(-18deg); opacity: 0; } to { transform: none; opacity: 1; } }
.offtag { background: rgba(0,0,0,.25); color: inherit; border-color: transparent; }
.rbody { padding: 16px 20px 8px; display: grid; gap: 6px; }
.rbody p { margin: 0; }
.rbody .reason { font-size: 1.15rem; font-weight: 700; line-height: 1.35; }
.v-check .reason { color: var(--wait); } .v-denied .reason { color: var(--bad); }
.who { display: flex; gap: 14px; align-items: center; margin: 4px 0; }
.who .mphoto { width: 96px; height: 96px; }
.names { min-width: 0; display: grid; gap: 4px; justify-items: start; }
.names .first { font: 800 clamp(2rem, 9vw, 2.8rem)/1 system-ui, sans-serif; letter-spacing: -.02em; overflow-wrap: anywhere; }
.names .last { font: 700 1.35rem/1.1 system-ui, sans-serif; color: var(--text); overflow-wrap: anywhere; }
.desk .who .mphoto, [data-mode="desk"] .who .mphoto { width: 140px; height: 140px; border-radius: var(--r-md); }
.rlinks { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.rlinks .btn { margin: 0; }
.rfoot { padding: 12px 20px 16px; margin-top: auto; }
.result .scannext { width: 100%; min-height: 64px; font-size: 1.25rem; margin: 0; }
.signedas { margin-top: 14px; }
.idle[hidden], .result[hidden], .panel[hidden], .pform[hidden] { display: none !important; }

/* Full-screen colour */
.flash { position: fixed; inset: 0; pointer-events: none; z-index: 40; opacity: 0; }
.flash.ok { background: var(--go); } .flash.check { background: var(--wait); } .flash.denied { background: var(--stop); }
.flash.go { animation: dp-flash .7s ease-out forwards; }
@keyframes dp-flash { 0% { opacity: .95; } 100% { opacity: 0; } }
.toast { position: fixed; left: 12px; right: 12px; top: 12px; z-index: 90; padding: 14px 16px; border-radius: var(--r-sm); background: var(--wait); color: #111; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: 560px; margin: 0 auto; }

@media (min-width: 860px) {
  .scangrid { grid-template-columns: minmax(300px, 320px) minmax(0, 1fr); align-items: start; }
  .scanner .viewport { height: auto; aspect-ratio: 1; }
  .idle { min-height: 320px; }
  .resultside { max-height: calc(100dvh - 190px); overflow-y: auto; border-radius: 0; }
  .scangrid .panel { grid-column: 1; }
}
@media (max-width: 859px) {
  /* Phone: camera fills the screen, tray along the bottom; after a scan the result slides up over ~70%
     of the screen and the colour stays on behind it until Scan next. */
  /* "Powered by DoorPass" is always the very last thing on screen: a fixed strip under the tray (--foot tall). */
  .scanpage { --foot: calc(34px + env(safe-area-inset-bottom)); }
  .scanpage main.wide { padding: 6px 10px calc(var(--foot) + 12px); }
  .scanpage main.wide:has(.tray) { padding-bottom: calc(var(--foot) + 96px); }
  .scanpage footer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; box-sizing: border-box; height: var(--foot); padding: 0 16px env(safe-area-inset-bottom); border-top: 0; background: var(--ink); }
  .scanner .viewport { height: calc((100dvh - 286px) * .55); min-height: 190px; }
  .barrow { flex-wrap: nowrap; } .doorstats { min-width: 0; }
  .doorstats .ds:nth-child(n+2) { display: none; }
  .doorstats .ds { padding: 6px 10px; } .doorstats .dsn { font-size: .95rem; }
  .net { padding: 8px 10px; font-size: .72rem; }
  .tray { position: fixed; left: 0; right: 0; bottom: var(--foot); z-index: 30; padding: 10px; background: color-mix(in srgb, var(--ink) 92%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  /* Menu open: it scrolls inside the screen, and the tray and footer step aside so no menu item is covered. */
  .scanpage header.top:has(.navt:checked) { max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .scanpage:has(.navt:checked) .tray, .scanpage:has(.navt:checked) footer { display: none; }
  .idle { display: none !important; }
  .scanpage .panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; border-radius: 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -20px 60px rgba(0,0,0,.6); }
  .scanner .result { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: 72dvh; border-radius: 0; transform: translateY(100%); transition: transform .2s ease-out; }
  .scanner .result.in { transform: none; }
  .rbody { overflow-y: auto; flex: 1; min-height: 0; }
  .rfoot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  body.res-ok::after, body.res-check::after, body.res-denied::after { content: ""; position: fixed; inset: 0; z-index: 45; opacity: .9; pointer-events: none; }
  body.res-ok::after { background: var(--go); } body.res-check::after { background: var(--wait); } body.res-denied::after { background: var(--stop); }
  .signedas { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .scanner.live .reticle, .result .okmark, .flash.go { animation: none; }
  .scanner .result { transition: none; }
}

/* Settings → Website embed */
.snippet{white-space:pre-wrap;word-break:break-all;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;padding:12px 14px;border-radius: var(--r-sm);background:color-mix(in srgb,currentColor 6%,transparent);user-select:all;margin:6px 0 10px}
.embedpreview{padding:16px;border-radius: var(--r-md);border:1px dashed color-mix(in srgb,currentColor 25%,transparent);margin:6px 0 10px}

/* ---------- print / Save as PDF: always one page (Letter or A4) ----------
   Sizes are in millimetres so the result is the same on every browser and paper size.
   Printable area at 10 mm margins: Letter 196 x 259 mm, A4 190 x 277 mm. Layouts stay inside 186 x 250 mm. */
@media print {
  @page { margin: 10mm; }
  html, body { font-size: 10.5pt; }
  .printlogo { height: 9mm !important; margin: 0 auto 5mm !important; }
  .orderlist + p { display: none !important; }
  footer { margin-top: 4mm !important; padding: 0 !important; font-size: 7.5pt; }
  html, body, main { min-height: 0 !important; height: auto !important; }
  body:has(.orderlist.c4, .orderlist.c5) footer { display: none !important; }

  /* one ticket */
  .ticket:not(.mini) { width: 110mm; max-width: 110mm !important; border-radius: var(--r-md); }
  .ticket:not(.mini) .stub { padding: 5mm 6mm 4mm; }
  .ticket:not(.mini) h1 { font-size: 15pt; margin: 0 0 1mm; }
  .ticket:not(.mini) .when { font-size: 9.5pt; margin: 0; }
  .ticket:not(.mini) .holder { font-size: 12pt; margin-top: 2mm; }
  .ticket:not(.mini) .qr { padding: 4mm 0 2mm; text-align: center; }
  .ticket:not(.mini) .qr svg { width: 72mm !important; height: auto !important; }
  .ticket:not(.mini) .tcode { margin: 0 6mm 3mm; padding: 2mm; }
  .ticket:not(.mini) .tcode strong { font-size: 18pt; margin: 0; }
  .ticket:not(.mini) .perks { margin: 0 6mm 3mm; font-size: 9pt; }
  .ticket:not(.mini) .perks li { padding: 1.2mm 0; }
  .ticket:not(.mini) .fine { font-size: 8.5pt; padding: 0 6mm 4mm; }

  /* an order: summary on top, every ticket on the same page (up to 20) */
  .orderpanel { box-shadow: none !important; border: 0 !important; padding: 0 !important; margin: 0 0 4mm !important; background: #fff !important; }
  .orderpanel h1 { font-size: 15pt; margin: 0 0 1mm; }
  .orderpanel .when { font-size: 9.5pt; margin: 0 0 2mm; }
  .orderpanel .summary { margin: 2mm 0; font-size: 9.5pt; }
  .orderpanel .summary > div { padding: 1mm 0; }
  .orderpanel p { margin: 1mm 0; }
  .sendfold, .orderlist .center { display: none !important; }
  .orderlist { display: grid !important; gap: 3mm !important; grid-template-columns: repeat(var(--cols, 3), 1fr) !important; }
  .orderlist.c2 { --cols: 2; --qr: 62mm; } .orderlist.c3 { --cols: 3; --qr: 44mm; }
  .orderlist.c4 { --cols: 4; --qr: 34mm; } .orderlist.c5 { --cols: 5; --qr: 28mm; }
  .ticket.mini { border-radius: var(--r-md); padding: 0 0 2mm !important; break-inside: avoid; margin: 0 !important; }
  .ticket.mini .stub { padding: 2mm 3mm; border-bottom-width: 1px; }
  .ticket.mini .stub::before, .ticket.mini .stub::after { display: none; }
  .ticket.mini .tags { margin: 0 0 1mm !important; } .ticket.mini .tag { font-size: 7pt; padding: 0 1.5mm; }
  .ticket.mini .holder { font-size: 9pt; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ticket.mini .qr { padding: 2mm 0 1mm; text-align: center; }
  .ticket.mini .qr svg { width: var(--qr, 44mm) !important; height: auto !important; max-width: none !important; }
  .ticket.mini .tcode { margin: 0 2mm; padding: 1mm; border: 0; }
  .ticket.mini .tcode span { display: none; }
  .ticket.mini .tcode strong { font-size: 11pt; letter-spacing: .1em; margin: 0; }
  .ticket.mini > p.muted { font-size: 8pt; padding: 0 3mm; }
  .orderlist.c4 .tags, .orderlist.c5 .tags { display: none; }
  .orderlist.c4 .holder, .orderlist.c5 .holder { font-size: 8pt; }
  .orderlist.c4 .tcode strong, .orderlist.c5 .tcode strong { font-size: 9.5pt; }
  .orderlist.c5 .qr { padding: 1.5mm 0 .5mm; }
}

/* ---------- event posts (public) ---------- */
.event.hascover { padding: 0 14px 0 0; overflow: hidden; }
.event .thumb { width: 116px; min-height: 96px; align-self: stretch; object-fit: cover; object-position: center; flex: none; border-right: 1px solid var(--line); }
.event.hascover .date { display: none; }
.event .tagline { color: var(--text); opacity: .85; margin: 2px 0 4px !important; }
.post { margin-bottom: 18px; }
.post .cover { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 70vh; overflow: hidden; border-radius: var(--r-md); border: 1px solid var(--line); margin-bottom: 18px; background: var(--raised); }
.post .cover img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.post .cover .coverbg { object-fit: cover; filter: blur(22px) brightness(.7); transform: scale(1.15); }
.post .cover .coverfg { object-fit: contain; }
@media (min-width: 880px) { .post .cover { aspect-ratio: 16 / 8; } }
.posthead h1 { margin: 6px 0 4px; font-size: clamp(1.8rem, 4.5vw, 2.8rem); line-height: 1.08; }
.posthead .tagline { font-size: 1.12rem; color: var(--muted); margin: 0 0 8px; }
.posthead .jump { margin-top: 6px; }
.postgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.postbody, .postside { min-width: 0; }
.postbody:empty { display: none; }
.postside .panel:first-child { margin-top: 0; }
@media (min-width: 880px) {
  .postgrid { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .postbody:empty + .postside { grid-column: 1 / -1; max-width: 620px; }
  .postside { position: sticky; top: 16px; }
  .posthead .jump { display: none; }
}
.postbody .bh { font-size: 1.4rem; margin: 28px 0 10px; }
.postbody > :first-child { margin-top: 0; }
.btext { font-size: 1.04rem; line-height: 1.65; }
.btext p { margin: 0 0 14px; }
.btext ul { margin: 0 0 14px; padding-left: 1.3em; }
.bimg { margin: 20px 0; }
.bimg img { width: 100%; border-radius: var(--r-md); border: 1px solid var(--line); display: block; }
.bimg figcaption { color: var(--muted); font-size: .88rem; margin-top: 6px; text-align: center; }
.bdiv { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }
.bbtn { margin: 18px 0; }
.bbtn .btn { width: auto; }
.lineup { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin: 18px 0; }
.lineup.solo { grid-template-columns: 1fr; }
.artist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; display: flex; flex-direction: column; }
.lineup.solo .artist { flex-direction: row; }
.aphoto { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; display: block; background: var(--raised); }
.lineup.solo .aphoto { width: 180px; flex: none; }
.aphoto.blank { display: grid; place-items: center; font-size: 2.4rem; font-weight: 800; color: var(--accent-text); background: linear-gradient(135deg, var(--raised), var(--surface)); }
.abody { padding: 14px 16px; }
.abody h3 { margin: 0; font-size: 1.12rem; }
.arole { margin: 2px 0 0; color: var(--accent-text); font-weight: 600; font-size: .86rem; text-transform: uppercase; letter-spacing: .05em; }
.abio { color: var(--muted); font-size: .94rem; line-height: 1.55; margin-top: 8px; }
.abio p { margin: 0 0 8px; }
.alinks { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.alinks a { font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); color: var(--text); }
.alinks a:hover { border-color: var(--accent-text); text-decoration: none; }
@media (max-width: 520px) { .lineup.solo .artist { flex-direction: column; } .lineup.solo .aphoto { width: 100%; } .lineup { grid-template-columns: repeat(2, 1fr); } }

/* ---------- event editor ---------- */
.eventeditor .formsub { margin: 26px 0 12px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 1rem; }
.eventeditor .formsub:first-of-type { border-top: 0; padding-top: 0; margin-top: 8px; }
.eventeditor .formsub .opt { font-size: .85rem; margin-left: 4px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { font: inherit; font-size: .88rem; font-weight: 600; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); color: var(--text); cursor: pointer; }
.chip:hover { border-color: var(--accent-text); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.wpchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.wpgrid { display: grid; gap: 16px; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); align-items: start; }
@media (max-width: 640px) { .wpgrid { grid-template-columns: 1fr; } }
.wpcal { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; }
.wphead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.wpnav { font: inherit; font-size: 1.3rem; width: 38px; height: 38px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--text); cursor: pointer; }
.wpnav:hover { background: var(--surface); }
.wpdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.wpdow { font-size: .72rem; color: var(--muted); padding: 4px 0; text-transform: uppercase; }
.wpday { font: inherit; font-size: .92rem; aspect-ratio: 1; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text); cursor: pointer; min-height: 36px; }
.wpday:hover { background: var(--surface); }
.wpday.today { box-shadow: inset 0 0 0 1px var(--accent-text); }
.wpday.past { color: var(--muted); text-decoration: line-through; }
.wpday.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; opacity: 1; }
.wpdate { font-size: 1.15rem; font-weight: 700; margin: 4px 0 12px; }
.wpsum { color: var(--accent-text); font-weight: 600; margin: 0; }
.wpsum.bad { color: #e5484d; }
.coverpick .coverprev { border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 12px; margin-bottom: 10px; min-height: 64px; display: grid; place-items: center; text-align: center; }
.coverpick .coverprev img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; border-radius: var(--r-sm); }
.blocks { display: grid; gap: 12px; margin-bottom: 18px; }
.bempty { margin: 0; }
.bcard { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px 2px; background: var(--raised); }
.bhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.bhead strong { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-text); }
.btools { display: flex; gap: 4px; }
.icon { font: inherit; width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.icon:disabled { opacity: .35; cursor: default; }
.b-divider { padding-bottom: 10px; }
.b-divider .bfields p { margin: 0; }
.fmtbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; font-weight: 400; }
.fmt { font: inherit; font-size: .85rem; padding: 4px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.fmt.bold { font-weight: 800; } .fmt.ital { font-style: italic; }
.imgslot { margin-bottom: 14px; }
.imgprev { border: 1px dashed var(--line); border-radius: var(--r-sm); min-height: 60px; display: grid; place-items: center; margin-bottom: 8px; overflow: hidden; background: var(--surface); }
.imgprev img { width: 100%; max-height: 260px; object-fit: cover; display: block; }
.imgslot.square .imgprev { aspect-ratio: 1; }
.imgslot.square .imgprev img { height: 100%; max-height: none; }
.artistedit { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 14px; }
@media (max-width: 560px) { .artistedit { grid-template-columns: 1fr; } .imgslot.square { max-width: 200px; } }
.links { margin-bottom: 12px; }
.links summary { cursor: pointer; font-weight: 600; font-size: .9rem; margin-bottom: 10px; }
.linkgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 12px; }
.addbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; border: 1px dashed var(--line); border-radius: var(--r-sm); }
.wpcustom[hidden] { display: none; }
.imgslot .btnrow, .coverpick .btnrow { margin-top: 0; }

/* Mobile: event rows with a cover show it as a full-width banner (date is in the text below) */
@media (max-width: 560px) {
  .event.hascover { flex-direction: column; align-items: stretch; padding: 0 0 14px; }
  .event.hascover .thumb { width: 100%; height: auto; min-height: 0; aspect-ratio: 16 / 9; border-right: 0; border-bottom: 1px solid var(--line); }
  .event.hascover .info { padding: 12px 14px 0; }
}

/* Long code snippets (embed code, keys) never push the page sideways on phones */
code { overflow-wrap: anywhere; }
pre { max-width: 100%; overflow-x: auto; }
.legendhint { display: block; font-size: .85rem; margin-top: 2px; }

.capnote { font-weight: 600; margin: 6px 0 0; }
.undobtn { margin-top: 8px; }

/* Text over the camera is always white, in light and dark mode. */
.viewport .cammsg, .photostage .cammsg { color: #fff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 0 12px rgba(0,0,0,.7); }
.viewport .cammsg a { color: #fff; text-decoration: underline; }
.cardbrand{display:block;min-height:1.2em;margin-top:4px}

/* ---------- staff tables on phones: each cell stacks full width, forms fill the card ---------- */
@media (max-width: 760px) {
  .stackcells td, .stackcells tr:last-child td { display: block; text-align: left; }
  .stackcells td.inlineform, .stackcells td.inlineform:last-child { display: flex; flex-wrap: wrap; gap: 8px; }
  .stackcells td.inlineform > form { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .stackcells td.inlineform .btn, .stackcells form.inlineform .btn { width: 100%; }
  .stackcells form.inlineform { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
  .stackcells form.inlineform select, .stackcells form.inlineform input { width: 100%; min-width: 0; padding: 11px 12px; }
  .stackcells .btn.small { min-height: 44px; }
  .stackcells td strong, .stackcells td .muted { overflow-wrap: anywhere; }
}

/* Confirmed / approved state (photo saved) */
.btn.good, .btn.good:disabled { background: #15803d; border: 1px solid #15803d; color: #fff; box-shadow: none; opacity: 1; }

/* People and other tables on phones: label left, value right, long text wraps inside the card */
@media (max-width: 760px) {
  td > .cv { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
  .headrow { flex-direction: column; align-items: stretch; gap: 12px; }
  .headrow .search { flex: 1 1 auto; max-width: none; width: 100%; }
  .headrow .search input { flex: 1 1 auto; min-width: 0; width: auto; padding: 12px; }
  .headrow .search .btn { flex: 0 0 auto; min-height: 44px; }
}
@media (max-width: 760px) { .headrow .search > .btn.small { width: auto; flex: 0 0 auto; } }
/* Long emails and names wrap instead of pushing the page wider than the screen */
main { overflow-wrap: break-word; }
.profilehead, .profilehead *, .tcard, .tcard * { overflow-wrap: anywhere; min-width: 0; }

/* ---------- feedback button and popup (staff only) ---------- */
.fb-btn { position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 40; background: var(--surface); color: var(--text); border: 1px solid var(--line); padding: 9px 14px; font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.fb-btn:hover { border-color: var(--accent); }
.fb-btn.onscan { bottom: auto; top: calc(78px + env(safe-area-inset-top)); padding: 6px 10px; font-size: 0.75rem; opacity: .8; }
.fb-modal { position: fixed; top: 0; left: 0; right: 0; height: 100vh; height: 100dvh; z-index: 60; background: rgba(5,9,22,.72); display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 16px; }
.fb-modal[hidden], .fb-btn[hidden], .fb-dock[hidden] { display: none; }
.fb-modal.away { display: none; }
.fb-card { background: var(--surface); border: 1px solid var(--line); width: 100%; max-width: 760px; padding: 16px; display: grid; gap: 12px; margin: auto 0; max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; box-sizing: border-box; }
.fb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fb-x { background: none; border: 0; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.fb-tools, .fb-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-tools .btn, .fb-actions .btn { width: auto; margin: 0; }
.fb-stage { border: 1px dashed var(--line); min-height: 120px; display: flex; align-items: center; justify-content: center; background: var(--ink); }
.fb-hint { color: var(--muted); font-size: 0.9rem; text-align: center; padding: 20px; margin: 0; width: 100%; box-sizing: border-box; }
.fb-canvas[hidden] { display: none; }
.fb-canvas { display: block; max-width: 100%; max-height: 52vh; height: auto; width: auto; touch-action: none; cursor: crosshair; }
.fb-meta { color: var(--muted); font-size: 0.8rem; margin: 0; }
.fb-status { min-height: 1.2em; margin: 0; font-size: 0.9rem; }
.fb-status.bad { color: var(--accent-text); }
.fb-card textarea { width: 100%; box-sizing: border-box; }
body.fb-open { overflow: hidden; }
.fbshot { max-width: 100%; height: auto; border: 1px solid var(--line); display: block; margin: 12px 0; }
.fbtext { width: 100%; box-sizing: border-box; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.8rem; }
@media print { .fb-btn, .fb-dock, .fb-modal { display: none !important; } }
.fb-tools input[hidden] { display: none; }
.fb-cats { display: flex; gap: 8px; margin: 0 0 10px; }
.fb-cat { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; min-height: 64px; background: var(--surface); color: var(--muted); border: 2px solid var(--line); font: inherit; cursor: pointer; transition: transform .12s ease, border-color .12s ease, color .12s ease; }
.fb-cat:hover { border-color: var(--accent); color: var(--text); }
.fb-cat:active { transform: scale(.96); }
.fb-cat.on { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 1px var(--accent) inset; }
.fb-cat-icon { font-size: 1.6rem; line-height: 1.1; }
.fb-cat-label { font-size: 0.75rem; font-weight: 600; }
.fb-cat.on .fb-cat-icon { transform: scale(1.15); }
.fbfilter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.fbfilter .btn { width: auto; margin: 0; }
@media (prefers-reduced-motion: reduce) { .fb-cat, .fb-cat.on .fb-cat-icon { transition: none; transform: none; } }
.fb-actions { position: sticky; bottom: -16px; background: var(--surface); padding: 10px 0 calc(8px + env(safe-area-inset-bottom)); margin-bottom: -16px; z-index: 1; }
@media (max-width: 600px) { .fb-canvas { max-height: 34vh; } .fb-modal { padding: 8px; } .fb-card { padding: 12px; } }

/* ---------- venue logo in the header bar: one fixed slot, any logo fits ---------- */
.brandlogo { display: block; height: 36px; width: auto; max-width: 160px; object-fit: contain; object-position: left center; }
.logoslot { display: inline-flex; align-items: center; padding: 10px 14px; margin: 4px 8px 4px 0; border: 1px solid var(--line); }
.logoslot.light { background: #f7f8fb; }
.logoslot.dark { background: #0a1128; }
@media (max-width: 600px) { .brandlogo { height: 30px; max-width: 120px; } }

/* Tap targets and text size (from feedback #3): every control at least 40px tall, no text under 12px. */
.chip, .wpnav { min-height: 40px; }
.wpday { aspect-ratio: auto; height: 40px; min-width: 0; }
.wpnav { width: 40px; height: 40px; }
.wpdow { font-size: .75rem; }
th { font-size: .75rem; }
.check, .check.small { min-height: 40px; }
details > summary { min-height: 40px; display: flex; align-items: center; }
.back { display: inline-flex; align-items: center; min-height: 40px; margin-bottom: 8px; }
a.inline, .muted.inline { display: inline-flex; align-items: center; min-height: 40px; margin-top: 4px; }
@media (min-width: 860px) {
  header.top nav a, header.top nav button.linkbtn { display: inline-flex; align-items: center; min-height: 40px; }
}
.check input[type=checkbox], .check input[type=radio] { width: 20px; height: 20px; flex: none; }

/* Recent scans under the camera */
.scanside { min-width: 0; }
.recent { margin-top: 10px; min-height: 0; min-width: 0; }
.recent h2 { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; font-weight: 700; }
.recent ul { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: calc(100dvh - 548px); min-height: 80px; border: 1px solid var(--line); background: var(--surface); }
.rc { display: flex; align-items: center; gap: 10px; padding: 0 12px; min-height: 40px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.rc:last-child { border-bottom: 0; }
.rcdot { flex: none; width: 10px; height: 10px; background: var(--go); }
.rc-check .rcdot { background: var(--wait); } .rc-denied .rcdot { background: var(--stop); }
.rcname { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rctag { flex: none; color: var(--muted); font-size: .8rem; }
.rctime { flex: none; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.recent-empty { padding: 12px; color: var(--muted); font-size: .85rem; }
@media (min-width: 860px) { .recent ul { max-height: 200px; } }

/* ticket type editor + table rows */
[data-tierrow] [hidden] { display: none !important; }
.qtyrow.table .tprice { font-weight: 700; }

/* Table picker chips on the event page */
.tablepick { border: 0; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tablepick legend { font-size: .85rem; color: var(--muted); padding: 0; margin-bottom: 4px; }
.tchip { position: relative; }
.tchip input { position: absolute; opacity: 0; inset: 0; }
.tchip span { display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px; padding: 0 12px; text-align: center; border: 1px solid var(--line); cursor: pointer; }
.tchip input:checked + span { border-color: var(--accent-text); background: color-mix(in srgb, var(--accent) 18%, transparent); font-weight: 600; }
.tchip input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.tchip.taken span { opacity: .45; text-decoration: line-through; cursor: not-allowed; }

/* New event: preset picker and templates */
.presetgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 12px 0 20px; }
.presetcard { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); text-decoration: none; color: inherit; min-height: 44px; }
.presetcard:hover, .presetcard:focus-visible { border-color: var(--accent-text); }
.tpllist { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tpllist li { display: flex; align-items: center; gap: 6px; }

/* Custom questions */
.questions { border: 1px solid var(--line); padding: 12px; margin: 12px 0; }
.questions legend { padding: 0 6px; }
.qset + .qset { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.qrow { border: 1px solid var(--line); padding: 10px; margin: 8px 0; }
dl.answers { margin: 12px 0; display: grid; gap: 6px; }
dl.answers dt { font-size: .8rem; color: var(--muted); }
dl.answers dd { margin: 0; }

/* Attention pulse on the main ticket buttons (#CTA). A soft ring, once every ~7s,
   4 times only, then it rests. Uses box-shadow so nothing moves or reflows (safe on phones).
   Stops on hover/focus/press and for anyone who asked their device to reduce motion. */
@keyframes dpPulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 65%, transparent); }
  16% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent) 0%, transparent); }
}
.posthead .jump, #cartBtn:not(:disabled), #payBtn:not(:disabled) {
  animation: dpPulse 7s ease-out 2.5s 4;
}
.posthead .jump:hover, #cartBtn:hover, #payBtn:hover,
.posthead .jump:focus-visible, #cartBtn:focus-visible, #payBtn:focus-visible,
.posthead .jump:active, #cartBtn:active, #payBtn:active { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .posthead .jump, #cartBtn, #payBtn { animation: none; }
}

/* Phone-only sticky ticket bar (event page). Hidden on wide screens, where the ticket box is already beside the page. */
.stickybar { display: none; }
@media (max-width: 879px) {
  .stickybar:not([hidden]) {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(8px);
  }
  .stickybar .btn { min-height: 48px; display: flex; align-items: center; justify-content: center; }
  body:has(.stickybar:not([hidden])) { padding-bottom: 76px; }
}

/* Long names, usernames and notices must wrap, never push the page sideways on a phone (feedback #8). */
.notice, .rolehelp li, .stackcells td, .delname { overflow-wrap: anywhere; }

/* Who is here (event roster) */
.kv dd a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.rostertabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.rostertabs a { padding: 9px 14px; border: 1px solid var(--line); color: var(--text); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.rostertabs a.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Venue street address + map link */
.posthead .where, .ticket .where, .where { margin: 2px 0 8px; color: var(--muted); overflow-wrap: anywhere; }
.maplink { margin-left: 8px; white-space: nowrap; font-weight: 600; }

/* Time slots (tee times, tours) */
.slots .slotday { margin: 10px 0 6px; font-weight: 600; font-size: .9rem; }
.slotgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.slotpick { position: relative; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); padding: 10px 10px 10px 34px; cursor: pointer; min-height: 48px; }
.slotpick input { position: absolute; left: 10px; top: 12px; margin: 0; }
.slotpick:has(input:checked) { border-color: var(--accent-text); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.slotpick.full { opacity: .5; cursor: not-allowed; }
.slotpick .stime { font-weight: 600; }
.slotpick .slabel, .slotpick .sleft { font-size: .8rem; color: var(--muted); }
.slotedit .row { align-items: end; }

/* Drink credits quick-pick buttons on the event page */
.creditpick { font: inherit; font-size: .85em; padding: .1em .6em; margin-right: .25em; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; cursor: pointer; }
.creditpick:hover, .creditpick:focus-visible { background: rgba(127, 127, 127, .18); }

/* Guest drink credit wallet */
.walletcard { text-align: center; }
.walletbal { font-size: 1.6rem; margin: .2em 0 .6em; }
.walletqr { max-width: 280px; margin: 0 auto; }
.walletqr svg { width: 100%; height: auto; display: block; }

/* Drink credits card in the perks scanner */
.scanner .walletbal { font-size: 1.8rem; margin: .1em 0 .4em; }
.scanner .walletamt { width: 5.5em; font-size: 1.1rem; padding: .5em; text-align: center; }
.scanner .walletevent { width: 100%; font-size: 1rem; padding: .6em; margin: .3em 0 .6em; }

/* drink menu (credits) */
.menutable td { padding: 8px 6px; }
.menurow { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 0 0 6px; }
.menurow label { margin: 0; }
.menurow input { min-width: 0; }
.menumargin { min-width: 150px; padding-bottom: 8px; }
.lowmargin { background: color-mix(in srgb, var(--bad, #c0392b) 10%, transparent); }
.tag { display: inline-block; font-size: .75rem; padding: 1px 6px; border: 1px solid var(--line); }
.tag.bad { border-color: var(--bad, #c0392b); }
.drinkmenu { margin: 10px 0; }
.drinkmenu summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }

/* first-run checklist */
.getstarted .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.getstarted .steps li { min-height: 44px; display: flex; align-items: center; gap: 8px; }
.getstarted .steps li.done a { color: var(--muted, inherit); text-decoration: line-through; }
/* ---------- beta: three floating feedback icons on every staff page (remove with the FEEDBACK_BETA switch) ---------- */
.fb-dock { position: fixed; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40; display: flex; gap: 8px; }
.fb-dock-btn { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; line-height: 1; padding: 0; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 50%; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.3); transition: transform .12s ease, border-color .12s ease; }
.fb-dock-btn:hover, .fb-dock-btn:focus-visible { border-color: var(--accent); }
.fb-dock-btn:active { transform: scale(.93); }
@media (prefers-reduced-motion: reduce) { .fb-dock-btn { transition: none; } }

/* Each icon acts out what it is for: the bug scurries, the feedback bubble pulses, the feature bulb asks for attention. Quiet most of the time. */
.fb-dock-btn { position: relative; }
.fb-dock-ico { display: inline-block; transform-origin: 50% 60%; }
.fb-dock-bug .fb-dock-ico { animation: fb-crawl 5s ease-in-out infinite; }
.fb-dock-feedback::after { content: ''; position: absolute; inset: -1px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; pointer-events: none; animation: fb-pulse 3.2s ease-out infinite 1s; }
.fb-dock-feedback .fb-dock-ico { animation: fb-beat 3.2s ease-in-out infinite 1s; }
.fb-dock-feature .fb-dock-ico { animation: fb-nudge 4.5s ease-in-out infinite 2s; }
.fb-dock-feature::after { content: ''; position: absolute; inset: -1px; border-radius: 50%; box-shadow: 0 0 0 0 rgba(255,200,60,.65); pointer-events: none; animation: fb-glow 4.5s ease-out infinite 2s; }
.fb-dock-btn:hover .fb-dock-ico, .fb-dock-btn:focus-visible .fb-dock-ico, .fb-dock-btn:hover::after, .fb-dock-btn:focus-visible::after { animation-play-state: paused; }
body.fb-open .fb-dock-ico, body.fb-open .fb-dock-btn::after { animation-play-state: paused; }
/* the bug scurries a little sideways in quick, jittery steps, then rests */
@keyframes fb-crawl {
  0%, 52%, 100% { transform: translate(0, 0) rotate(0); }
  56% { transform: translate(-3px, -1px) rotate(-14deg); }
  60% { transform: translate(-6px, 1px) rotate(10deg); }
  64% { transform: translate(-9px, -1px) rotate(-12deg); }
  68% { transform: translate(-6px, 1px) rotate(12deg); }
  72% { transform: translate(-2px, -1px) rotate(-8deg); }
  76% { transform: translate(3px, 1px) rotate(12deg); }
  80% { transform: translate(7px, -1px) rotate(-12deg); }
  84% { transform: translate(9px, 1px) rotate(10deg); }
  88% { transform: translate(4px, 0) rotate(-6deg); }
  94% { transform: translate(0, 0) rotate(0); }
}
/* feedback: a message heartbeat with a ring spreading out */
@keyframes fb-beat { 0%, 40%, 100% { transform: scale(1); } 10% { transform: scale(1.2); } 20% { transform: scale(1); } 30% { transform: scale(1.14); } }
@keyframes fb-pulse { 0% { opacity: .75; transform: scale(1); } 60%, 100% { opacity: 0; transform: scale(1.55); } }
/* feature request: "hey, pay attention to me": a hop, a wobble and a warm glow */
@keyframes fb-nudge {
  0%, 60%, 100% { transform: translateY(0) rotate(0); }
  66% { transform: translateY(-7px) rotate(0); }
  72% { transform: translateY(0) rotate(-14deg); }
  78% { transform: translateY(-4px) rotate(12deg); }
  84% { transform: translateY(0) rotate(-8deg); }
  90% { transform: translateY(-2px) rotate(5deg); }
}
@keyframes fb-glow { 0%, 62% { box-shadow: 0 0 0 0 rgba(255,200,60,.65); } 78% { box-shadow: 0 0 0 12px rgba(255,200,60,0); } 100% { box-shadow: 0 0 0 0 rgba(255,200,60,0); } }
@media (prefers-reduced-motion: reduce) { .fb-dock-ico, .fb-dock-btn::after { animation: none !important; } .fb-dock-btn::after { display: none; } }

/* Keep the icons off the "Powered by DoorPass" footer and the phone ticket bar: the page gets room at the bottom, the icons ride above the ticket bar. */
body.fb-has-dock footer { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
@media (max-width: 879px) { body.fb-has-dock:has(.stickybar:not([hidden])) .fb-dock { bottom: calc(76px + env(safe-area-inset-bottom)); } }
@media (max-width: 380px) { .fb-dock { gap: 6px; right: 8px; } .fb-dock-btn { width: 44px; height: 44px; } }

/* New event: basics step and the "Add more to your event" cards */
.setuphead { margin: 4px 0 8px; }
.setupcard > summary { flex-wrap: wrap; gap: 4px 8px; }
.setupcard .cardtitle { flex: 0 1 auto; }
.setupcard .cardbenefit { margin: 0 0 12px; }
.setupcard.suggested { border-left: 3px solid var(--accent); padding-left: 12px; }
.suggestedtag { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 40%, transparent); font-size: 0.72rem; }
.suggestrow { margin: 0 0 12px; padding: 10px 12px; background: var(--raised); border: 1px solid var(--line); }
.suggestrow .btn { margin-left: 8px; }
.kindpick { border: 0; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px 24px; }
.kindpick legend { padding: 0 0 4px; }

/* ---------- v1 admin look, phase 2: components. Shape, depth and states only; colors and fonts are unchanged. ---------- */
:root {
  --elev: 0 1px 2px color-mix(in srgb, var(--shadow) 30%, transparent);
  --elev-hover: 0 2px 10px color-mix(in srgb, var(--shadow) 38%, transparent);
  --elev-pop: 0 12px 32px color-mix(in srgb, var(--shadow) 60%, transparent);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
}
/* depth: cards sit just above the page */
.panel, .ecard, .stats div, .tcard, .event, .presetcard, .mycard, .syscheck, .tablewrap, .ticket:not(.mini) { box-shadow: var(--elev); }
.scanpage .panel { box-shadow: none; }
.ecard, .event, .mycard, .presetcard { transition: border-color .15s, box-shadow .15s; }
.ecard:hover, .event:hover, .mycard:hover, .presetcard:hover { box-shadow: var(--elev-hover); }
/* dialogs and pop-ups */
.fb-card { border-radius: var(--r-lg); box-shadow: var(--elev-pop); }
.fb-btn { border-radius: 999px; }
.fb-cat { border-radius: var(--r-sm); }
.fb-stage { border-radius: var(--r-sm); }
/* boxes that had a border but no corner rule */
.rostertabs a, .modes a, .suggestrow, .logoslot, .tchip span, .slotpick, .qrow { border-radius: var(--r-sm); }
.presetcard, .questions, .setupcard.suggested { border-radius: var(--r-md); }
/* inputs: soft hover, ring on focus (border also changes, so focus stays visible) */
input:not([type=checkbox]):not([type=radio]):hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--text) 30%, var(--line)); }
input:not([type=checkbox]):not([type=radio]):focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
}
input, select, textarea { transition: border-color .12s, box-shadow .12s; }
/* buttons and tabs */
.btn { transition: filter .12s, background .12s, border-color .12s, transform .08s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.ghost:hover { background: var(--raised); border-color: color-mix(in srgb, var(--text) 30%, var(--line)); }
.rostertabs a, .modes a { transition: border-color .12s, background .12s; }
.rostertabs a:not(.on):hover, .modes a:not(.on):hover { border-color: color-mix(in srgb, var(--text) 30%, var(--line)); background: var(--raised); }
/* tables: quieter header, row hover */
th { font-weight: 600; }
@media (hover: hover) { tbody tr:hover td { background: color-mix(in srgb, var(--raised) 55%, transparent); } }
/* tags: fully round when short, soft rectangle when a long label wraps */
.tag, .count { border-radius: 12px; }

/* ---------- v1 admin look, phase 3: sidebar. Staff back-office pages only, 1024px and wider. Phones, tablets and the scanner keep the top bar. ---------- */
.ng { display: contents; }
.nl, .ni { display: none; }
nav .ni { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 1024px) {
  body.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: 1fr auto; }
  body.shell > header.top {
    grid-column: 1; grid-row: 1 / 3; position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; gap: 6px;
    padding: 16px 12px; background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none;
    border-bottom: 0; border-right: 1px solid var(--line);
  }
  body.shell > header.top .brand { padding: 4px 8px 12px; }
  body.shell > header.top .navt, body.shell > header.top .burger { display: none; }
  body.shell > header.top > nav { order: 1; margin-left: 0; flex: 1 1 auto; flex-direction: column; align-items: stretch; gap: 2px; font-size: 0.92rem; min-height: 0; }
  body.shell > header.top .themetoggle { order: 2; align-self: flex-start; margin: 4px 0 0 4px; }
  body.shell .ng { display: flex; flex-direction: column; gap: 2px; }
  body.shell .ng.navend { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
  body.shell .nl { display: block; padding: 14px 10px 4px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
  body.shell .ni { display: block; }
  body.shell nav a, body.shell nav .linkbtn {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-sm);
    color: var(--text); opacity: 1; text-align: left; min-height: 36px; transition: background .12s, color .12s;
  }
  body.shell nav a.muted, body.shell nav .linkbtn { color: var(--muted); }
  body.shell nav form { width: 100%; margin: 0; }
  body.shell nav a:hover, body.shell nav .linkbtn:hover { background: var(--raised); color: var(--text); text-decoration: none; }
  body.shell nav a[aria-current="page"] { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--text); font-weight: 600; }
  body.shell nav a[aria-current="page"] .ni { color: var(--accent-text); }
  body.shell > main { grid-column: 2; grid-row: 1; }
  body.shell > main.wide { max-width: 1040px; }
  body.shell > footer { grid-column: 2; grid-row: 2; }
}

/* ---------- v1 admin look, phase 4: polish ---------- */
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (min-width: 1024px) { body.shell nav a:focus-visible, body.shell nav .linkbtn:focus-visible { outline-offset: -2px; } }
body:not(.scanpage) .empty { border: 1px dashed var(--line); border-radius: var(--r-md); }

/* ---------- tables fit at every width (0.94) ---------- */
/* Short cells (dates, roles, counts) never wrap; buttons never break mid-word; only real long strings (emails, usernames) may break. */
td.nw { white-space: nowrap; font-variant-numeric: tabular-nums; }
th { white-space: nowrap; }
td { overflow-wrap: break-word; }
.btn, button { white-space: nowrap; overflow-wrap: normal; }
.em { overflow-wrap: anywhere; }
td .inlineform select, td .inlineform input:not([type=hidden]) { flex: 1 1 110px; width: auto; min-width: 0; max-width: 100%; }
td.inlineform { justify-content: flex-start; }
@media (max-width: 760px) { td.nw { white-space: normal; } th { white-space: normal; } td { overflow-wrap: anywhere; } }
td.person { min-width: 8.5rem; }
.rowactions { margin-top: 8px; }
@media (min-width: 761px) and (max-width: 1023px) { th, td { padding-left: 10px; padding-right: 10px; } }

/* ---------- desktop sidebar: collapse to icons (0.94). Saved per browser by shell.js; phones and tablets never show it. ---------- */
.sbtoggle { display: none; }
@media (min-width: 1024px) {
  body.shell .sbtoggle { display: flex; order: 3; align-items: center; justify-content: center; width: 36px; height: 36px; margin: 2px 0 0 4px; padding: 0; background: transparent; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--muted); cursor: pointer; }
  body.shell .sbtoggle:hover { background: var(--raised); color: var(--text); }
  body.shell .sbtoggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
  html.sbc body.shell { grid-template-columns: 64px minmax(0, 1fr); }
  html.sbc body.shell > header.top { padding: 16px 8px; align-items: center; overflow-x: hidden; }
  html.sbc body.shell > header.top .brand { padding: 4px 0 12px; }
  html.sbc body.shell .brand .wm, html.sbc body.shell .brand .wordmark { display: none; }
  html.sbc body.shell .brandlogo { width: 34px; object-fit: cover; object-position: left center; }
  html.sbc body.shell .nl, html.sbc body.shell nav a span, html.sbc body.shell nav .linkbtn span { display: none; }
  html.sbc body.shell nav a, html.sbc body.shell nav .linkbtn { justify-content: center; padding: 8px 0; }
  html.sbc body.shell > header.top .themetoggle, html.sbc body.shell .sbtoggle { align-self: center; margin-left: 0; }
  html.sbc body.shell .sbtoggle svg { transform: rotate(180deg); }
}

/* Admin Today (#196): greeting, next-event hero, trends, attention and activity. Same palette and radius tokens as the rest of admin. */
.headsub { margin: 2px 0 0; }
.hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: center; margin-bottom: 14px; border-left: 4px solid var(--accent); }
.hero h2 { margin: 8px 0 2px; font-size: 1.5rem; letter-spacing: -0.02em; }
.hero h2 a { color: inherit; text-decoration: none; }
.hero h2 a:hover { color: var(--accent); }
.hero .btnrow { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.hero-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; }
.hero-nums dt { color: var(--muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.07em; }
.hero-nums dd { margin: 2px 0 6px; font-variant-numeric: tabular-nums; }
.hero-nums dd strong { font-size: 1.7rem; line-height: 1.1; }
.hero-nums dd span { color: var(--muted); font-size: 0.85rem; }
.bar { display: block; width: 100%; height: 6px; }
.bar .track { fill: var(--line); }
.bar .fill { fill: var(--accent); transition: width .4s ease; }
.stats > div { position: relative; }
.spark { display: block; width: 100%; height: 28px; margin-top: 8px; color: var(--accent); }
.twocol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 14px 0; }
.twocol > .panel { margin: 0; display: block; }
.attnlist, .actlist { list-style: none; margin: 10px 0 0; padding: 0; }
.attnlist li { display: flex; align-items: baseline; padding: 6px 0; font-size: 0.92rem; }
.attnlist a { color: inherit; }
.attnlist a:hover { color: var(--accent); }
.dot.warn { background: var(--gold, #d99a00); }
.actlist li { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.actlist li:last-child { border-bottom: 0; }
.actwho { font-weight: 700; }
.actago { margin-left: auto; color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.ecap { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ecap .bar { width: 96px; flex: none; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; gap: 16px; } .twocol { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .hero-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .bar .fill { transition: none; } }

/* Command palette (#198). Same tokens as the rest of admin. */
.palettebtn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; margin-bottom: 4px; border: 1px solid var(--line); border-radius: var(--r-sm); background: transparent; color: var(--muted); font: inherit; cursor: pointer; text-align: left; }
.palettebtn:hover { color: var(--text); border-color: var(--accent); }
.palettebtn kbd, .palette-status kbd { margin-left: auto; font: inherit; font-size: 0.72rem; padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); }
.sbc .palettebtn span, .sbc .palettebtn kbd { display: none; }
.palette { position: fixed; inset: 0; z-index: 90; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(10, 17, 40, 0.55); }
.palette[hidden] { display: none; }
.palette-card { width: 100%; max-width: 560px; max-height: 70vh; display: flex; flex-direction: column; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); overflow: hidden; }
.palette-input { margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 18px; background: transparent; font-size: 1.05rem; }
.palette-input:focus { outline: none; box-shadow: inset 0 -2px 0 var(--accent); }
.palette-list { overflow-y: auto; padding: 6px; }
.palette-group { padding: 10px 12px 4px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 700; }
.palette-item { display: flex; align-items: baseline; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm); color: inherit; text-decoration: none; }
.palette-item.on { background: var(--accent-soft, rgba(240, 78, 55, 0.12)); }
.palette-label { font-weight: 600; }
.palette-hint { margin-left: auto; font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-status { margin: 0; padding: 8px 18px; border-top: 1px solid var(--line); }
.palette-status:empty { display: none; }
html.palette-open { overflow: hidden; }
.palette-input::-webkit-search-cancel-button { display: none; }

/* Event page summary (#200) reuses the Today hero look. */
.evsummary { margin-bottom: 16px; }
.evsummary h2 { margin: 8px 0 2px; font-size: 1.4rem; letter-spacing: -0.02em; }

/* People and Orders (#202) */
.toolrow { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: end; margin: 4px 0 14px; }
.filterbox { margin: 0; flex: 1 1 260px; max-width: 360px; }
.filterbox input { margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 0.85rem; font-weight: 600; }
.chips a:hover { color: var(--text); border-color: var(--accent); }
.chips a[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.personcell { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.personcell:hover strong { color: var(--accent); }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--raised); border: 1px solid var(--line); font-size: 0.8rem; font-weight: 800; color: var(--muted); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
tbody tr[hidden] { display: none; }
.pstats { margin: 16px 0 4px; }
.pstats > div strong { display: block; font-size: 1.4rem; line-height: 1.15; }
.pstats > div span { color: var(--muted); font-size: 0.85rem; }
.pstats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .pstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Forms that sit next to a button in a table cell (replaces inline styles, which the CSP blocks) */
form.inl { display: inline; margin: 0; }

/* Event pages share one header and one row of page links (#206) */
.evtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.evtabs a { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 0.88rem; font-weight: 600; }
.evtabs a:hover { color: var(--text); border-color: var(--accent); }
.evtabs a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.rolebadge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); font-size: 0.72rem; font-weight: 700; color: var(--muted); vertical-align: 1px; }
.nowrap { white-space: nowrap; }

.carttotal.empty { font-weight: 500; color: var(--muted); }

.timechart { margin: 8px 0 0; }
.timechart svg { display: block; width: 100%; height: 120px; }
.timechart .base { stroke: var(--line); stroke-width: 0.6; vector-effect: non-scaling-stroke; }
.timechart .cbar { fill: color-mix(in srgb, var(--accent) 55%, transparent); }
.timechart .cbar.peak { fill: var(--accent); }
.chartaxis { display: flex; justify-content: space-between; margin-top: 4px; font-size: 0.78rem; color: var(--muted); }
.timechart figcaption { margin-top: 6px; }
.charts { margin-bottom: 16px; }
.chartaxis.short { justify-content: center; }
.evsummary .hero-nums { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.trendcell .spark { margin-top: 4px; }

/* staff profiles */
.avatar.big { width: 88px; height: 88px; font-size: 1.6rem; }
.profilepic { display: flex; align-items: center; gap: 16px; margin: 8px 0 16px; }
.contactline { font-size: 0.82rem; color: var(--muted); }
.contactline a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--line); }
/* Show at the door */
.doorrow { text-align: center; margin: 0 0 14px; }
.doorrow .btn { min-width: 220px; }
dialog.doormode { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; padding: 18px 16px; background: #fff; color: #111; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
dialog.doormode:not([open]) { display: none; }
dialog.doormode .doorqr { width: min(92vw, 62vh); height: auto; background: #fff; }
.doortitle { margin: 0; font-weight: 800; font-size: 1.1rem; }
.doorwho { margin: 0; font-size: 1.3rem; font-weight: 700; }
.doorlabel { margin: 0; font-size: 0.85rem; color: #555; }
.doorcode { margin: 0; font-size: 1.9rem; font-weight: 800; letter-spacing: 0.14em; white-space: nowrap; font-variant-numeric: tabular-nums; }
dialog.doormode .doorclose { color: #111; border-color: #999; }
@media print { .doorrow { display: none; } }
/* share button on the event page */
.sharebtn { text-decoration: underline; text-underline-offset: 3px; }
.sharebtn:hover, .sharebtn:focus-visible { color: var(--text); }
/* phone tap target: at least 44px tall without changing the look */
@media (pointer: coarse) { .sharebtn:not([hidden]) { display: inline-flex; align-items: center; min-height: 44px; } }

/* accessibility polish */
.formsub { letter-spacing: normal; line-height: inherit; }
.sronly { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
