/* IITD Live app styles. Mobile-first.
   Colours, fonts, radii, shadows and spacing come only from tokens.css (see DESIGN.md).
   Motion values are literals because the contract has no motion tokens:
   ease-out cubic-bezier(0.22, 1, 0.36, 1) · 120ms press · 200ms state · 320ms sheets. */

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: color-mix(in srgb, var(--text-muted) 55%, transparent) transparent;
  scroll-padding-top: 64px;
  accent-color: var(--primary);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  overflow-x: clip;
  caret-color: var(--primary);
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

::selection { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); color: var(--text); }

h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }
.h-headline { font-size: 1.5rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.015em; }
h2 { font-size: 1.25rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.015em; }
h3 { font-size: 1.125rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; }
small { font-size: 0.8125rem; }
b, strong { font-weight: 700; }

a { color: var(--primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { flex: none; }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

.i {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-weight: 700;
}
.skip-link:focus { top: var(--space-2); }

.muted { color: var(--text-muted); }
.fine { color: var(--text-muted); font-size: 0.875rem; line-height: 1.45; }
.mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.04em; }
.num, time { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ */
/* Masthead (maroon by day, night surface after dark)                  */
/* ------------------------------------------------------------------ */

.topbar {
  background: var(--primary);
  color: var(--primary-contrast);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar :focus-visible { outline-color: var(--primary-contrast); }

.topbar__inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: var(--space-1) var(--space-4) var(--space-3);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "brand account" "search search";
  align-items: center;
  gap: var(--space-1) var(--space-3);
}

.brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 48px;
  color: inherit;
  text-decoration: none;
  justify-self: start;
}
.brand__mark {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: url("../assets/icon.svg") center / cover no-repeat;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary-contrast) 30%, transparent);
}
.brand__name { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand__name b { font-weight: 800; }

.search { grid-area: search; position: relative; }
.search__icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  width: 20px; height: 20px;
  transform: translateY(-50%);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}
.search input {
  width: 100%;
  min-height: 44px;
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-6);
  border-radius: var(--radius);
  border: 1.5px solid color-mix(in srgb, var(--primary-contrast) 45%, transparent);
  background: color-mix(in srgb, var(--primary-contrast) 12%, var(--primary));
  color: var(--primary-contrast);
  font-size: 1rem;
  -webkit-appearance: none;
  appearance: none;
}
.search input::placeholder { color: color-mix(in srgb, var(--primary-contrast) 82%, var(--primary)); opacity: 1; }
.search input:focus { background: var(--surface); color: var(--text); border-color: var(--surface); }
.search input:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary-contrast) 70%, transparent); outline-offset: 1px; }
.search:focus-within .search__icon { color: var(--text-muted); }

.account {
  grid-area: account;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--space-4);
  border-radius: var(--radius);
  color: var(--primary-contrast);
  font-weight: 700;
  text-decoration: none;
  border: 1.5px solid color-mix(in srgb, var(--primary-contrast) 60%, transparent);
}
.account:hover { background: color-mix(in srgb, var(--primary-contrast) 12%, var(--primary)); }
.account--avatar {
  width: 44px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 0.9375rem;
}
.account--avatar:hover { background: var(--accent); box-shadow: var(--shadow-sm); }

.topnav { display: none; }

/* Feed tabs live in the masthead band and stick when the masthead scrolls away. */
.tabs--mast {
  position: sticky;
  top: 0;
  z-index: 15;
  margin: 0 calc(50% - 50vw) var(--space-4);
  padding: 0 max(var(--space-4), calc(50vw - 520px + var(--space-4)));
  background: var(--primary);
  border-bottom: 0;
  box-shadow: var(--shadow-sm);
}
.tabs--mast .tab { color: color-mix(in srgb, var(--primary-contrast) 78%, transparent); min-height: 44px; font-size: 0.9375rem; }
.tabs--mast .tab:hover { color: var(--primary-contrast); }
.tabs--mast .tab[aria-current="page"] { color: var(--primary-contrast); }
.tabs--mast .tab[aria-current="page"]::after { background: var(--accent); }
.tabs--mast .tab:focus-visible { outline-color: var(--primary-contrast); }
/* No saffron dot on maroon (2.53:1); the dot shows on the night masthead only. */
.tab__live { display: none; }

@media (prefers-color-scheme: dark) {
  .topbar { background: var(--surface); color: var(--text); }
  .topbar :focus-visible { outline-color: var(--primary); }
  .search input { background: var(--surface-2); border-color: var(--text-muted); color: var(--text); }
  .search input::placeholder { color: var(--text-muted); }
  .search input:focus { background: var(--surface-2); border-color: var(--primary); }
  .search input:focus-visible { outline-color: color-mix(in srgb, var(--primary) 45%, transparent); }
  .account { color: var(--text); border-color: var(--text-muted); }
  .account:hover { background: var(--surface-2); }
  .brand__name b { color: var(--primary); }
  .tabs--mast { background: var(--surface); border-bottom: 1px solid var(--border); }
  .tabs--mast .tab { color: var(--text-muted); }
  .tabs--mast .tab:hover, .tabs--mast .tab[aria-current="page"] { color: var(--text); }
  .tabs--mast .tab:focus-visible { outline-color: var(--primary); }
  .tab__live { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--live); margin-left: 6px; vertical-align: 0.2em; }
}

/* ------------------------------------------------------------------ */
/* Bottom navigation                                                   */
/* ------------------------------------------------------------------ */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 64px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
}
.tabbar svg {
  width: 56px; height: 32px;
  padding: 4px 16px;
  border-radius: var(--radius-lg);
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: background-color 200ms ease;
}
.tabbar a[aria-current="page"] { color: var(--primary); }
.tabbar a[aria-current="page"] svg { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); }
.tabbar a:focus-visible { outline-offset: -4px; }

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tabbar .badge { position: absolute; top: 6px; left: calc(50% + 8px); }
.topnav .badge { margin-left: 6px; }

/* ------------------------------------------------------------------ */
/* Page frame                                                          */
/* ------------------------------------------------------------------ */

.main {
  flex: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 var(--space-4) var(--space-6);
}
.main:focus { outline: none; }
.view { padding-top: var(--space-4); }
.view--flush { padding-top: 0; }
.view > * + *:not(._) { margin-top: var(--space-4); }
h1[tabindex="-1"]:focus { outline: none; }
.view > .tabs--mast + *:not(._) { margin-top: 0; }
.boot { color: var(--text-muted); padding: var(--space-6) 0; text-align: center; }

.footer {
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-4) var(--space-4) var(--space-5);
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
  border-top: 1px solid var(--border);
}
.footer p + p { margin-top: var(--space-1); font-size: 0.8125rem; }
.footer__dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: var(--space-1);
  vertical-align: 0.05em;
}

@media (min-width: 720px) {
  .main, .footer { max-width: 712px; }
  .topbar__inner { max-width: 712px; }
  .tabs--mast { padding: 0 max(var(--space-4), calc(50vw - 340px)); }
}

@media (min-width: 1000px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .main, .footer, .topbar__inner { max-width: 1072px; }
  .main { padding: 0 var(--space-4) var(--space-6); }
  .topbar__inner {
    grid-template-columns: auto minmax(220px, 360px) 1fr auto;
    grid-template-areas: "brand search nav account";
    padding: var(--space-2) var(--space-4);
    gap: var(--space-5);
  }
  .tabs--mast { padding: 0 max(var(--space-4), calc(50vw - 520px)); }
  .topnav { grid-area: nav; display: flex; gap: var(--space-1); justify-self: end; }
  .topnav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 var(--space-3);
    color: inherit;
    text-decoration: none;
    font-weight: 700;
    opacity: 0.86;
  }
  .topnav a:hover { opacity: 1; }
  .topnav a[aria-current="page"] { opacity: 1; }
  .topnav a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: var(--space-3); right: var(--space-3); bottom: 0;
    height: 3px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--accent);
  }
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 20px;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-contrast);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 200ms ease, box-shadow 200ms ease, transform 120ms cubic-bezier(0.22, 1, 0.36, 1);
}
.btn .i { width: 20px; height: 20px; }
.btn:hover { background: color-mix(in srgb, var(--primary) 88%, var(--text)); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--surface-2);
  color: var(--text-muted);
  border-color: var(--surface-2);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.btn--block { display: flex; width: 100%; }
.btn--sm { min-height: 44px; padding: 0 var(--space-3); font-size: 0.9375rem; }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--ok { background: color-mix(in srgb, var(--success) 14%, var(--surface)); color: var(--success); border-color: color-mix(in srgb, var(--success) 40%, var(--surface)); }
.btn--ok:hover { background: color-mix(in srgb, var(--success) 14%, var(--bg)); }
.btn--danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); }
.confirm__ask .btn--danger { background: var(--danger); color: var(--surface); }
.btn--wa { background: var(--success); color: var(--surface); }
.btn--wa:hover { background: color-mix(in srgb, var(--success) 88%, var(--text)); }

.iconbtn {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
}
.iconbtn:hover { background: var(--surface-2); color: var(--text); }

.confirm { display: inline-flex; flex-wrap: wrap; }
.confirm__ask { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.confirm__q { font-weight: 700; width: 100%; }

.back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 44px;
  padding-right: var(--space-3);
  margin-left: calc(var(--space-1) * -1);
  color: var(--text-muted);
  font-weight: 700;
  text-decoration: none;
}
.back:hover { color: var(--text); }

/* ------------------------------------------------------------------ */
/* Tabs (in-page: fest days, organiser sections)                       */
/* ------------------------------------------------------------------ */

.tabs {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 var(--space-3);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
  transition: color 200ms ease;
}
.tab:hover { color: var(--text); }
.tab[aria-current="page"] { color: var(--text); }
.tab[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: var(--space-3); right: var(--space-3); bottom: 0;
  height: 3px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--primary);
}
.tab:focus-visible { outline-offset: -3px; }
.tab--day { min-height: 56px; line-height: 1.25; flex-direction: column; align-items: flex-start; justify-content: center; }
.tab--day small { font-weight: 400; font-size: 0.75rem; }

/* ------------------------------------------------------------------ */
/* Chips, status, seal, live                                           */
/* ------------------------------------------------------------------ */

.chips { display: flex; flex-wrap: wrap; gap: var(--space-1) 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chip .i { width: 14px; height: 14px; }
.chip--free { background: color-mix(in srgb, var(--success) 14%, var(--surface)); color: var(--success); }
.chip--paid { background: var(--surface-2); color: var(--text); }
.chip--iitd { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); color: var(--primary); }
.chip--open, .chip--team, .chip--venue { background: var(--surface-2); color: var(--text-muted); }
.chip--venue { color: var(--text); font-weight: 400; }
.chip--first, .chip--tbc { background: var(--accent); color: var(--accent-contrast); }
.chip--first .i { fill: currentColor; stroke-width: 1.5; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.status .i { width: 14px; height: 14px; stroke-width: 2.5; }
.status--confirmed, .status--checked_in { background: color-mix(in srgb, var(--success) 14%, var(--surface)); color: var(--success); }
.status--waitlisted { background: color-mix(in srgb, var(--warning) 14%, var(--surface)); color: var(--warning); }
.status--cancelled, .status--draft { background: var(--surface-2); color: var(--text-muted); }

.seal { width: 16px; height: 16px; margin-left: 4px; vertical-align: -0.15em; flex: none; }
.seal--lg { width: 20px; height: 20px; margin-left: 6px; }
h1 .seal--lg { width: 0.7em; height: 0.7em; vertical-align: 0; }
.seal__fill { fill: var(--primary); }
.seal__mark { fill: none; stroke: var(--primary-contrast); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.idchip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
}
.idchip--iitd { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); color: var(--primary); }
.idchip .seal { margin: 0; width: 14px; height: 14px; }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  flex: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8125rem;
}

/* The live pulse: the only looping animation in the app. */
.pulse { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: currentColor;
  animation: ring 1.6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
@keyframes ring { from { transform: scale(1); opacity: 0.6; } to { transform: scale(2.4); opacity: 0; } }

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--live);
  color: var(--accent-contrast);
  font-size: 0.8125rem;
  font-weight: 700;
}

/* Poster tile: emoji on the organiser's colour. Never put text on it. */
.tile {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  flex: none;
  border-radius: var(--radius-sm);
  background: var(--poster, var(--surface-2));
  font-size: 1.5rem;
  line-height: 1;
  user-select: none;
}
.tile--xs { width: 24px; height: 24px; font-size: 0.875rem; border-radius: var(--radius-sm); }

/* ------------------------------------------------------------------ */
/* Page heads, notes, empty states                                     */
/* ------------------------------------------------------------------ */

.page-head { padding-top: var(--space-1); }
.page-head .lede { margin-top: var(--space-1); }
.lede { color: var(--text-muted); max-width: 62ch; }
.page-head--row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3); }
.page-head__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.view > .section-title:not(._), .section-title { margin-top: var(--space-6); font-size: 1.25rem; }
.section-title + * { margin-top: var(--space-3) !important; }
.section-title--sm { margin-top: var(--space-5); font-size: 1.0625rem; }

.note, .reason {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: 0.9375rem;
  line-height: 1.45;
}
.note { padding: var(--space-3); border-radius: var(--radius); background: var(--surface-2); color: var(--text); }
.note .i, .reason .i { color: var(--text-muted); margin-top: 2px; flex: none; }
.reason a { font-weight: 700; display: inline-block; margin-top: 2px; }

.state { font-size: 0.9375rem; line-height: 1.45; }
.state--wait { color: var(--text); }
.state--wait b { color: var(--warning); }
.state--panel { padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: color-mix(in srgb, var(--warning) 14%, var(--surface)); width: 100%; }
.state--ok { display: flex; align-items: center; gap: var(--space-2); color: var(--success); }

.verify-line { display: flex; align-items: flex-start; gap: 6px; color: var(--text-muted); font-size: 0.875rem; }
.verify-line .i { width: 16px; height: 16px; margin-top: 2px; }

.empty {
  padding: var(--space-6) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px dashed var(--border);
  text-align: center;
  color: var(--text-muted);
}
.empty p { max-width: 44ch; margin-left: auto; margin-right: auto; }
.empty__title, .empty h1 { color: var(--text); font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; margin-bottom: var(--space-2) !important; }
.empty .btn { margin-top: var(--space-4); }
.empty--page { margin-top: var(--space-5); }
.empty--page h1 { font-size: 1.75rem; }

/* ------------------------------------------------------------------ */
/* Feed: filters + ticket cards                                        */
/* ------------------------------------------------------------------ */

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); margin-top: var(--space-2) !important; }
/* 36px visual pill inside a 44px hit area. */
.fchip {
  position: relative;
  z-index: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 700;
  white-space: nowrap;
}
.fchip::before {
  content: "";
  position: absolute;
  inset: 4px 0;
  z-index: -1;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background-color 200ms ease, border-color 200ms ease;
}
.fchip:hover::before { border-color: var(--text-muted); }
.fchip[aria-pressed="true"], .fchip.is-on { color: var(--primary-contrast); }
.fchip[aria-pressed="true"]::before, .fchip.is-on::before { background: var(--primary); border-color: var(--primary); }
.fchip .i { width: 16px; height: 16px; stroke-width: 2.5; }
.fchip:focus-visible { outline: none; }
.fchip:focus-visible::before { outline: 3px solid var(--primary); outline-offset: 2px; }
.fchip--select { padding: 0; }
.fchip--select select {
  min-height: 44px;
  padding: 0 34px 0 14px;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 700;
  font-size: 0.9375rem;
  max-width: 64vw;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.fchip--select::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px; height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.fchip--select select option { color: var(--text); background: var(--surface); }
.fchip--select:focus-within::before { outline: 3px solid var(--primary); outline-offset: 2px; }
.fchip--select select:focus-visible { outline: none; }
.fclear {
  min-height: 44px;
  padding: 0 var(--space-2);
  border: 0;
  background: none;
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.grid { display: grid; gap: var(--space-3); grid-template-columns: minmax(0, 1fr); }
.grid--one { grid-template-columns: minmax(0, 1fr) !important; }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Event card: a ticket. The stub carries "when"; the body answers what, where, ₹ and who. */
.card {
  --notch: 6px;
  position: relative;
  --art-h: 128px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-rows: var(--art-h) auto;
  min-height: 104px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 200ms ease, transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
/* Ticket notches where the stub meets the body. */
.card::before, .card::after {
  content: "";
  position: absolute;
  left: calc(64px - var(--notch));
  width: calc(var(--notch) * 2);
  height: calc(var(--notch) * 2);
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--border);
  z-index: 2;
}
.card::before { top: calc(var(--art-h) - var(--notch)); }
.card::after { bottom: calc(var(--notch) * -1 - 1px); }
@media (hover: hover) {
  .card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
}
.card:focus-within { box-shadow: var(--shadow); }

.stub {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: var(--space-3) var(--space-1);
  background: var(--primary);
  color: var(--primary-contrast);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.stub::after {
  content: "";
  position: absolute;
  right: -1px;
  top: var(--space-3);
  bottom: var(--space-3);
  border-right: 2px dotted color-mix(in srgb, var(--primary-contrast) 55%, var(--primary));
}
.stub__day { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; }
.stub__date { font-family: var(--font-display); font-size: 1.75rem; font-weight: 800; line-height: 1; }
.stub__month { font-size: 0.75rem; font-weight: 700; }
.stub__time { margin-top: var(--space-1); font-size: 0.75rem; font-weight: 700; line-height: 1.15; }
.stub--live { background: var(--live); color: var(--accent-contrast); gap: var(--space-1); }
.stub--live::after { border-right-color: color-mix(in srgb, var(--accent-contrast) 45%, var(--live)); }
.stub__live { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; }
.stub--past { background: var(--surface-2); color: var(--text-muted); }
.stub--past::after { border-right-color: var(--border); }

.card__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: var(--space-3); }
.card__top { min-height: 0; }
.card__title {
  font-size: 1.125rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__title a { color: var(--text); text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: var(--radius); }
.card__title a:focus-visible { outline: none; }
.card__title a:focus-visible::after { outline: 3px solid var(--primary); outline-offset: -3px; }
.card__club, .card__where { font-size: 0.875rem; line-height: 1.4; color: var(--text-muted); }
.card__where { display: flex; align-items: flex-start; gap: var(--space-1); }
.card__where .i { width: 16px; height: 16px; margin-top: 1px; }
.card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); font-size: 0.875rem; }
.card__urgent { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--warning); font-weight: 700; font-variant-numeric: tabular-nums; }
.card__urgent .i { width: 16px; height: 16px; }
.card__going { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.card__note { display: flex; align-items: center; gap: var(--space-2); font-size: 0.875rem; min-width: 0; }
.card__notetag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 700;
  flex: none;
}
.card__notetag .i { width: 14px; height: 14px; }
.card__notetag.is-fresh { background: var(--live); color: var(--accent-contrast); }
.card__notetext { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.org { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; color: inherit; }
.org__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.org { text-decoration: none; }
a.org:hover .org__name { text-decoration: underline; }

/* Fests list */
.grid--fests { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .grid--fests { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fest-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 200ms ease;
}
.fest-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--accent); }
@media (hover: hover) { .fest-card:hover { box-shadow: var(--shadow); } }
.fest-card__name { font-size: 1.375rem; }
.fest-card__name a { color: var(--text); text-decoration: none; }
.fest-card__name a::after { content: ""; position: absolute; inset: 0; }
.fest-card__name a:focus-visible { outline: none; }
.fest-card:focus-within { outline: 3px solid var(--primary); outline-offset: 2px; }
.fest-card__tag { color: var(--text-muted); }
.fest-card__meta { display: flex; align-items: center; gap: var(--space-2); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.fest-card__meta > span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.fest-card__meta .i { color: var(--text-muted); }

/* ------------------------------------------------------------------ */
/* Event page                                                          */
/* ------------------------------------------------------------------ */

.event {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "poster" "main" "cta";
  gap: var(--space-4);
  margin-top: var(--space-1) !important;
}
.event__poster { grid-area: poster; }
.event__main { grid-area: main; min-width: 0; }
.event__cta { grid-area: cta; position: sticky; bottom: calc(64px + env(safe-area-inset-bottom, 0px) + var(--space-2)); z-index: 10; }
.event__main > * + *:not(._) { margin-top: var(--space-4); }
.event__head > * + * { margin-top: var(--space-2); }
.event__head h1 { overflow-wrap: anywhere; }
.event__when { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); color: var(--primary); font-weight: 700; font-variant-numeric: tabular-nums; }
.event__by { color: var(--text-muted); }
.event__by .org { color: var(--text); font-weight: 700; }
.event__fest { color: var(--text-muted); font-size: 0.9375rem; }
.event__fest a { font-weight: 700; }


.banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
}
.banner > .i { width: 20px; height: 20px; margin-top: 2px; color: var(--text-muted); }
.banner > .pulse { width: 10px; height: 10px; margin-top: 6px; }
.banner--live { background: var(--live); color: var(--accent-contrast); }
.banner__label { display: block; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; }
.banner__note { font-size: 0.9375rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.banner small { display: block; margin-top: 2px; }
.banner--sm { padding: var(--space-2) var(--space-3); }

/* Sticky action bar: price on the left, state-aware button on the right. */
.cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  max-height: calc(100dvh - 160px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.cta__row { display: flex; align-items: center; gap: var(--space-3); }
.cta__price { display: flex; flex-direction: column; min-width: 0; flex: 0 1 auto; font-variant-numeric: tabular-nums; }
.cta__price b { font-family: var(--font-display); font-weight: 800; font-size: 1.375rem; line-height: 1.1; }
.cta__price small { color: var(--text-muted); font-size: 0.8125rem; font-weight: 700; }
.cta__price small.warn { color: var(--warning); }
.cta__btn { flex: 1 1 auto; display: flex; justify-content: flex-end; min-width: 0; }
.cta__btn .btn { width: 100%; max-width: 320px; padding: 0 var(--space-4); }
.cta__btn .btn .i { width: 18px; height: 18px; }
.cta__note { color: var(--text-muted); font-size: 0.875rem; line-height: 1.45; }
.cta__more { display: flex; flex-direction: column; gap: var(--space-3); }
.cta__msg .state--wait { padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--warning) 14%, var(--surface)); }

.team-form label, .team__label, .form label, .label { display: block; font-weight: 700; margin-bottom: 6px; }
.team-form + .team-form { padding-top: var(--space-3); border-top: 1px solid var(--border); }
.inline { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.inline > input { flex: 1 1 12ch; min-width: 0; }
.inline > .btn { flex: 0 0 auto; }

.team {
  padding: var(--space-4);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.team > * + * { margin-top: var(--space-3); }
.team__name { font-size: 1.125rem; }
.team__count { color: var(--text-muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.team__code { font-size: 0.875rem; color: var(--text-muted); }
.team__code code { font-family: var(--font-mono); font-weight: 500; font-size: 1.125rem; color: var(--text); letter-spacing: 0.08em; }
.team__members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.team__members li { display: flex; align-items: center; gap: var(--space-2); }
.team__members small { color: var(--text-muted); }
.team .inline input { font-size: 1rem; }

.facts { margin: 0; padding: 0 var(--space-4); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.facts > div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: var(--space-3); padding: var(--space-3) 0; }
.facts > div + div { border-top: 1px solid var(--border); }
.facts dt { display: flex; align-items: flex-start; gap: var(--space-2); color: var(--text-muted); font-size: 0.875rem; font-weight: 700; padding-top: 1px; }
.facts dt .i { width: 18px; height: 18px; }
.facts dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.maplink { display: inline-flex; align-items: center; gap: 2px; margin-left: var(--space-1); font-weight: 700; font-size: 0.875rem; padding: var(--space-1) 0; }
.maplink .i { width: 14px; height: 14px; }

.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: var(--space-2); }
.actions .btn { padding: 0 var(--space-3); }
.cancel-row { display: flex; }

.prose h2 { margin-bottom: var(--space-2); }
.prose p { white-space: pre-line; max-width: 68ch; overflow-wrap: anywhere; }

.going h2 { margin-bottom: var(--space-3); font-variant-numeric: tabular-nums; }
.going h2 .muted { font-family: var(--font-body); font-weight: 400; font-size: 1rem; }
.going .fine { margin-top: var(--space-3); }

.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.bars li { display: grid; gap: 6px; }
.bars__label { font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.bars__track { display: block; height: 8px; border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; }
.bars__fill { display: block; height: 100%; border-radius: var(--radius-sm); background: var(--primary); }
.bars__rest { color: var(--text-muted); font-size: 0.875rem; }

@media (min-width: 1000px) {
  .event {
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-areas: "main poster" "main cta";
    grid-template-rows: auto 1fr;
    column-gap: var(--space-6);
    align-items: start;
  }
  .event__cta { position: sticky; top: var(--space-4); bottom: auto; }
  .hero { aspect-ratio: 4 / 5; }
  .cta { max-height: none; }
}

/* ------------------------------------------------------------------ */
/* "Stamped" sheet: the one celebration                                */
/* ------------------------------------------------------------------ */

.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--accent-contrast) 45%, transparent); animation: fade 320ms ease; }
.sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-3) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow);
  animation: rise 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
.sheet > * + * { margin-top: var(--space-4); }
.sheet__head { display: flex; align-items: center; gap: var(--space-3); }
.sheet__head h2 { flex: 1; font-size: 1.5rem; }
.sheet__head h2:focus { outline: none; }
.sheet__ok { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--success); color: var(--surface); }
.sheet__ok .i { stroke-width: 3; }
.sheet__actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.sheet__actions .btn { padding: 0 var(--space-3); }
.sheet-wrap.is-closing { opacity: 0; transition: opacity 200ms ease; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes stamp { from { transform: scale(1.06); } to { transform: none; } }
@media (min-width: 1000px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: var(--radius-lg); }
}

.mini-pass { border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.mini-pass__stub {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--accent);
  color: var(--accent-contrast);
  animation: stamp 200ms cubic-bezier(0.22, 1, 0.36, 1) 260ms both;
}
.mini-pass__text { display: flex; flex-direction: column; min-width: 0; }
.mini-pass__text b { font-family: var(--font-display); font-weight: 800; font-size: 1.125rem; line-height: 1.2; }
.mini-pass__text small { font-size: 0.875rem; font-weight: 700; }
.mini-pass__body { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-4); }
.mini-pass__body .qr { width: min(60vw, 220px); }

/* ------------------------------------------------------------------ */
/* Wallet: the pass                                                    */
/* ------------------------------------------------------------------ */

.passes { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .passes { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }

.pass {
  --notch: 10px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  scroll-margin-top: var(--space-4);
}
.pass__stub {
  list-style: none;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 24px;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--accent);
  color: var(--accent-contrast);
  cursor: pointer;
}
.pass[open] .pass__stub { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.pass__stub::-webkit-details-marker { display: none; }
.pass__stub::marker { content: ""; }
.pass__stub:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.pass__head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pass__when { font-size: 0.875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pass__title { font-family: var(--font-display); font-weight: 800; font-size: 1.375rem; line-height: 1.15; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.pass__venue { display: flex; align-items: flex-start; gap: 4px; font-size: 0.9375rem; }
.pass__venue .i { width: 16px; height: 16px; margin-top: 3px; }
.pass__club { font-size: 0.875rem; }
/* No maroon/rose seal on marigold: the seal takes the ink colour on the stub. */
.pass__stub .seal__fill, .mini-pass__stub .seal__fill { fill: var(--accent-contrast); }
.pass__stub .seal__mark, .mini-pass__stub .seal__mark { stroke: var(--accent); }
.pass__id { margin-top: 4px; font-size: 0.8125rem; font-weight: 700; }
.pass__toggle { display: grid; place-items: center; width: 24px; height: 24px; margin-top: 2px; transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1); }
.pass[open] .pass__toggle { transform: rotate(180deg); }

.pass__perf { position: relative; height: calc(var(--notch) * 2); background: var(--surface); }
.pass__perf::before {
  content: "";
  position: absolute;
  left: calc(var(--notch) + var(--space-2)); right: calc(var(--notch) + var(--space-2)); top: 50%;
  border-top: 2px dotted var(--border);
}
.pass__perf::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 0 50%, var(--bg) calc(var(--notch) - 0.5px), transparent var(--notch)) left / var(--notch) 100% no-repeat,
    radial-gradient(circle at 100% 50%, var(--bg) calc(var(--notch) - 0.5px), transparent var(--notch)) right / var(--notch) 100% no-repeat;
}

.pass__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-4) var(--space-4);
}
.pass__body > .banner { width: 100%; margin-bottom: var(--space-2); }
.pass__qr { display: grid; place-items: center; }

/* QR: always dark modules on a white square (drawn into the SVG), both modes. */
.qr { width: min(72vw, 280px); border-radius: var(--radius-sm); overflow: hidden; box-shadow: 0 0 0 1px var(--border); }
.qr svg { display: block; width: 100%; height: auto; }
.qr--missing { aspect-ratio: 1; display: grid; place-items: center; padding: var(--space-4); text-align: center; color: var(--text-muted); font-size: 0.875rem; background: var(--surface-2); }
.pass--checked_in .qr { opacity: 0.25; }

.pass__codelabel { margin-top: var(--space-1); font-size: 0.8125rem; font-weight: 700; color: var(--text-muted); }
.pass__code {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.04em;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
  max-width: 24ch;
  user-select: all;
  color: var(--text);
}

.pass__holder {
  width: 100%;
  margin: var(--space-2) 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}
.pass__holder-name { grid-column: 1 / -1; }
.pass__holder dt { font-size: 0.8125rem; font-weight: 700; color: var(--text-muted); }
.pass__holder dd { margin: 0; overflow-wrap: anywhere; }
.pass__holder .mono { font-size: 0.875rem; }
.pass__name { font-family: var(--font-display); font-weight: 700; font-size: 1.125rem; }
.pass__actions { width: 100%; display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }

.pass.is-past { box-shadow: var(--shadow-sm); }
.pass.is-past .pass__stub { background: var(--surface-2); color: var(--text); }
.pass.is-past .pass__stub .seal__fill { fill: var(--primary); }
.pass.is-past .pass__stub .seal__mark { stroke: var(--primary-contrast); }

/* ------------------------------------------------------------------ */
/* Fest hub                                                            */
/* ------------------------------------------------------------------ */

.fest-head {
  position: relative;
  padding: var(--space-5) var(--space-4) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}
.fest-head::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--accent); }
.fest-head > * + * { margin-top: var(--space-2); }
.fest-head__dates { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.fest-head__dates > span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.fest-head__dates > .i { color: var(--text-muted); }

.sched-wrap { display: none; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { display: grid; grid-template-columns: 4.75rem minmax(0, 1fr); gap: var(--space-3); padding: var(--space-3) 0; }
.timeline > li + li { border-top: 1px solid var(--border); }
.timeline__time { font-family: var(--font-body); font-size: 0.9375rem; font-weight: 700; padding-top: var(--space-3); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.timeline ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.tl-item {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  text-decoration: none;
}
.tl-item.is-live { border-top: 6px solid var(--live); }
.tl-item__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tl-item__title { font-weight: 700; line-height: 1.25; }
.tl-item__meta { display: flex; flex-wrap: wrap; gap: var(--space-1); }

@media (min-width: 720px) {
  .sched-wrap {
    display: block;
    overflow: auto;
    max-height: 70vh;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
  }
  .timeline { display: none; }
  .sched { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; min-width: 600px; }
  .sched th, .sched td { padding: var(--space-2); border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
  .sched td, .sched thead th + th { border-left: 1px solid var(--border); }
  .sched thead th {
    position: sticky; top: 0; z-index: 2;
    font-size: 0.8125rem; font-weight: 700; color: var(--text-muted);
    background: var(--surface-2);
    width: 11rem;
  }
  .sched thead th:first-child, .sched tbody th { width: 5.5rem; position: sticky; left: 0; background: var(--surface-2); }
  .sched thead th:first-child { z-index: 3; }
  .sched tbody th { z-index: 1; font-size: 0.875rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
  .sched tbody tr:last-child > * { border-bottom: 0; }
  .slot {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-size: 0.875rem;
  }
  .slot + .slot { margin-top: var(--space-2); }
  @media (hover: hover) { .slot:hover { box-shadow: var(--shadow); } }
  .slot.is-live { border-top: 6px solid var(--live); }
  .slot__top { display: flex; align-items: flex-start; gap: 6px; }
  .slot__title {
    font-weight: 700; line-height: 1.25; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .slot__meta { color: var(--text-muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
  .slot__elig { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); font-size: 0.8125rem; font-weight: 700; }
  .slot__elig .i { width: 14px; height: 14px; }
}

/* ------------------------------------------------------------------ */
/* Club, invite                                                        */
/* ------------------------------------------------------------------ */

.club-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }
.club-head > div { flex: 1 1 14rem; min-width: 0; }
.club-head h1 { font-size: clamp(1.5rem, 5vw, 2rem); overflow-wrap: anywhere; }
.club-head h1 + * { margin-top: var(--space-1); }
.club-head__mark {
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  flex: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-contrast);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
}

.invite { max-width: 560px; margin: 0 auto; }
.invite > * + * { margin-top: var(--space-4); }
.invite__from { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--primary); font-weight: 700; }
.cta-panel { display: flex; flex-direction: column; gap: var(--space-3); }

/* ------------------------------------------------------------------ */
/* Forms, auth                                                         */
/* ------------------------------------------------------------------ */

.auth { max-width: 520px; margin: 0 auto; padding-top: var(--space-1); }
.auth > * + * { margin-top: var(--space-4); }
.stack { display: flex; flex-direction: column; gap: var(--space-2); }
.whoami { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); overflow-wrap: anywhere; }

.form { display: flex; flex-direction: column; gap: var(--space-4); }
.field { display: flex; flex-direction: column; min-width: 0; }
.field-row { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 520px) { .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hint { margin-top: 6px; color: var(--text-muted); font-size: 0.875rem; line-height: 1.45; }
.hint .idchip { margin-right: var(--space-1); }
.hint.field-error, .field-error { color: var(--danger); font-weight: 700; }
label small, legend small { font-weight: 400; color: var(--text-muted); }

:where(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea) {
  width: 100%;
  min-height: 48px;
  padding: var(--space-2) var(--space-3);
  border: 1.5px solid var(--text-muted);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
textarea { resize: vertical; min-height: 88px; }
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: var(--space-6);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.fchip--select select { background-image: none; }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent);
}
[aria-invalid="true"] { border-color: var(--danger) !important; }
input[readonly] { background: var(--surface-2); }
input.mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.04em; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
legend { font-family: var(--font-display); font-weight: 800; font-size: 1.125rem; padding: 0; margin-bottom: var(--space-3); }
.form--event { max-width: 720px; }
.form--event fieldset { padding: var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.form--event legend { float: left; width: 100%; margin-bottom: 0; }
.form--event legend + * { clear: both; }
.form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  position: sticky;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  padding: var(--space-3) 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  z-index: 5;
}
.form__actions .btn { flex: 1 1 10rem; }
@media (min-width: 1000px) { .form__actions { bottom: 0; } }

.preview { padding: var(--space-3); border-radius: var(--radius); background: var(--surface-2); }
.preview__label { font-size: 0.8125rem; font-weight: 700; color: var(--text-muted); margin-bottom: var(--space-2); }
.preview__missing { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.preview__missing:empty { display: none; }
.preview__missing li { display: flex; align-items: flex-start; gap: var(--space-2); font-size: 0.875rem; color: var(--warning); font-weight: 700; }
.preview__missing .i { width: 16px; height: 16px; margin-top: 2px; }

.seg { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.seg label { position: relative; flex: 1 1 8rem; margin: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--space-3);
  border: 1.5px solid var(--text-muted);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-weight: 700;
  text-align: center;
  transition: background-color 200ms ease, color 200ms ease;
}
.seg input:checked + span { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
.seg input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }

.check { display: flex; align-items: center; gap: var(--space-3); min-height: 44px; font-weight: 700; }
.check input { width: 22px; height: 22px; }

.emoji-pick { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-2); }
.emoji-pick button { width: 44px; height: 44px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 1.25rem; }
.emoji-pick button:hover { background: var(--surface-2); }
.swatches { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.swatches input[type="color"] { width: 52px; height: 44px; padding: 2px; border: 1.5px solid var(--text-muted); border-radius: var(--radius-sm); background: var(--surface); }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--surface); background: var(--poster); box-shadow: 0 0 0 1px var(--text-muted); }

.demo { padding-top: var(--space-5); border-top: 1px solid var(--border); }
.demo > * + * { margin-top: var(--space-2); }
.demo__list { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-3) !important; }
.demo__btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 60px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.demo__btn:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.demo__text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.demo__text small { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }

.linklist { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.linklist > a, .linklist > button {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 52px;
  padding: 0 var(--space-4);
  border: 0;
  background: none;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  text-align: left;
}
.linklist > * + * { border-top: 1px solid var(--border) !important; }
.linklist > a span, .linklist > button span { flex: 1; }
.linklist > a:hover, .linklist > button:hover { background: var(--surface-2); }
.linklist > button { color: var(--danger); }
.linklist > a:focus-visible, .linklist > button:focus-visible { outline-offset: -3px; }

/* ------------------------------------------------------------------ */
/* Organiser                                                           */
/* ------------------------------------------------------------------ */

.clubs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.clubs li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.clubs__name { font-weight: 700; color: var(--text); min-height: 32px; display: inline-flex; align-items: center; }

.olist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.orow {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: var(--space-1) var(--space-3);
  align-items: center;
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  text-decoration: none;
}
@media (hover: hover) { .orow:hover { box-shadow: var(--shadow); } }
.orow .tile { grid-row: span 2; }
.orow__main { display: flex; flex-direction: column; min-width: 0; }
.orow__title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orow__meta { color: var(--text-muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.orow__stats { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); font-size: 0.875rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.orow__stats b { color: var(--text); }
@media (min-width: 720px) {
  .orow { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .orow .tile { grid-row: auto; }
}

.strip { padding: var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.strip__nums { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); font-variant-numeric: tabular-nums; }
.strip__nums b { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; margin-right: 4px; }
.meter { margin-top: var(--space-3); height: 8px; border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--success); border-radius: var(--radius-sm); transition: width 320ms cubic-bezier(0.22, 1, 0.36, 1); }
.strip__rate { margin-top: var(--space-2); color: var(--text-muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }

.dash { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }

.panel { padding: var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.panel > * + * { margin-top: var(--space-3); }
.panel .form { gap: var(--space-2); }
.panel .form .btn { align-self: flex-start; }
.panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.panel__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.panel--danger { border-color: color-mix(in srgb, var(--danger) 40%, var(--surface)); }
.panel--share { border-color: color-mix(in srgb, var(--success) 40%, var(--surface)); }

.filter-input { max-width: 420px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table th {
  position: sticky; top: 0;
  text-align: left; font-size: 0.8125rem; color: var(--text-muted); font-weight: 700;
  padding: var(--space-2); border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface);
}
.table td { padding: var(--space-2); border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.table td.mono { font-size: 0.875rem; }
@media (max-width: 639px) {
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
  .table tr[hidden] { display: none; }
  .table td { border: 0; padding: 2px 0; display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: var(--space-2); }
  .table td::before { content: attr(data-label); color: var(--text-muted); font-family: var(--font-body); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0; }
  .table td:first-child { font-weight: 700; }
}

/* Scanner */
.scan { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
.scan__cam { display: flex; flex-direction: column; gap: var(--space-3); }
.reader { width: 100%; max-width: 520px; margin: 0 auto; border-radius: var(--radius-lg); overflow: hidden; background: var(--accent-contrast); }
.reader:empty { display: none; }
.reader video { display: block; width: 100% !important; height: auto !important; }
.scan__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 700;
}
.scan__placeholder .i { width: 48px; height: 48px; stroke-width: 1.5; }
.scan__cam .btn { max-width: 520px; margin: 0 auto; }
.scan__side > * + * { margin-top: var(--space-4); }
@media (min-width: 1000px) { .scan { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }

.verdict-wrap:empty { display: none; }
.verdict-wrap {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
}
.verdict {
  width: 100%;
  max-width: 520px;
  min-height: 46vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow);
  text-align: center;
  animation: rise 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
.verdict__disc { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; color: var(--surface); }
.verdict--ok .verdict__disc { background: var(--success); }
.verdict--bad .verdict__disc { background: var(--danger); }
.verdict__disc .i { width: 36px; height: 36px; stroke-width: 3; }
.verdict__name { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.75rem, 6vw, 2.5rem); line-height: 1.05; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.verdict--bad .verdict__name { color: var(--danger); }
.verdict__sub { color: var(--text-muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.verdict .btn { margin-top: var(--space-3); }

.scanlog { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: flex; flex-direction: column; }
.scanlog li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-2); align-items: start; padding: var(--space-2) 0; border-bottom: 1px solid var(--border); font-size: 0.9375rem; }
.scanlog li.is-ok > .i { color: var(--success); }
.scanlog li.is-bad > .i { color: var(--danger); }
.scanlog time { color: var(--text-muted); font-size: 0.8125rem; }
.scanlog__empty { display: block !important; color: var(--text-muted); border-bottom: 0 !important; }

/* Admin */
.adm { list-style: none; margin: 0; padding: 0; }
.adm li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.adm li:last-child { border-bottom: 0; }
.adm__name { min-width: 0; overflow-wrap: anywhere; }
.adm__name a { font-weight: 700; color: var(--text); }
.adm__name small { display: block; }
.adm .btn { flex: none; }

/* ------------------------------------------------------------------ */
/* Toasts                                                              */
/* ------------------------------------------------------------------ */

.toasts {
  position: fixed;
  left: var(--space-4); right: var(--space-4);
  top: calc(var(--space-2) + env(safe-area-inset-top, 0px));
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  width: 100%;
  max-width: 440px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.4;
  pointer-events: auto;
  animation: toast-in 320ms cubic-bezier(0.22, 1, 0.36, 1);
  transition: opacity 200ms ease, transform 200ms ease;
}
.toast .i { margin-top: 1px; }
.toast--error { background: var(--danger); color: var(--surface); }
.toast.is-leaving { opacity: 0; transform: translateY(-8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@media (min-width: 1000px) { .toasts { top: auto; bottom: var(--space-5); left: auto; right: var(--space-5); align-items: flex-end; } }

/* ------------------------------------------------------------------ */
/* Motion preferences, print                                           */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .pulse::after { display: none; }
}

@media print {
  .topbar, .tabbar, .footer, .toasts, .actions, .tabs--mast, .event__cta { display: none !important; }
  body { padding: 0; }
  .pass { box-shadow: none; break-inside: avoid; }
}

.more-row { display: flex; justify-content: center; padding-top: var(--space-3); }

/* ------------------------------------------------------------------ */
/* Photos, rails and the spotlight (the high-energy discovery layer)    */
/* ------------------------------------------------------------------ */

/* A photo on the organiser's colour: if the photo fails, the colour field still reads as a poster. */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 18% 12%, color-mix(in srgb, var(--poster, var(--primary)) 70%, #fff 30%) 0%, transparent 55%),
    linear-gradient(160deg, var(--poster, var(--primary)), color-mix(in srgb, var(--poster, var(--primary)) 55%, #000));
}
.media__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb { width: 44px; height: 44px; flex: none; border-radius: var(--radius-sm); }
.thumb--xs { width: 24px; height: 24px; border-radius: 6px; }
.thumb--lg { width: 56px; height: 56px; }

/* Ticket card: the photo sits above the stub/body seam. */
.card__art { grid-column: 1 / -1; position: relative; }
.card__art .media { position: absolute; inset: 0; }
.card__art .media__img { transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1); }
.card__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgb(20 10 13 / 0.35)); pointer-events: none; }
@media (hover: hover) { .card:hover .card__art .media__img { transform: scale(1.04); } }
.card.is-live { box-shadow: var(--glow-live); border-color: color-mix(in srgb, var(--live) 50%, var(--border)); }
.card.is-past .card__art { filter: grayscale(0.85); opacity: 0.7; }

/* Rails: horizontal, snap, full-bleed to the screen edge on phones. */
.rail { margin-top: var(--space-6) !important; }
.rail__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.rail__title { font-size: 1.375rem; line-height: 1.15; letter-spacing: -0.01em; }
.rail__more { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; font-weight: 700; color: var(--primary); text-decoration: none; white-space: nowrap; }
.rail__more .i { width: 18px; height: 18px; }
.rail__more:hover { text-decoration: underline; text-underline-offset: 3px; }
.rail__track {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--space-4);
  margin-inline: calc(var(--space-4) * -1);
  padding: var(--space-1) var(--space-4) var(--space-5);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.rail__track > * { scroll-snap-align: start; flex: none; }
.rail__track:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; border-radius: var(--radius); }

/* Poster card (BookMyShow-style portrait): the photo sells, the text confirms. */
.pcard { position: relative; width: clamp(156px, 42vw, 208px); }
.pcard__art { position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); isolation: isolate; }
.pcard__art .media { position: absolute; inset: 0; }
.pcard__art .media__img { transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1); }
.pcard__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(20 10 13 / 0.45) 0%, transparent 28%, transparent 62%, rgb(20 10 13 / 0.55)); pointer-events: none; }
@media (hover: hover) {
  .pcard:hover .pcard__art { box-shadow: var(--glow-primary); }
  .pcard:hover .media__img { transform: scale(1.06); }
}
.pcard.is-live .pcard__art { box-shadow: var(--glow-live); }
.pcard__when, .pcard__price, .pcard__feat {
  position: absolute;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 var(--space-2);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pcard__when { top: var(--space-2); left: var(--space-2); background: rgb(20 10 13 / 0.78); color: var(--on-stage); max-width: calc(100% - 48px); }
.pcard__when--live { background: var(--live); color: var(--accent-contrast); box-shadow: var(--glow-live); }
.pcard__feat { top: var(--space-2); right: var(--space-2); width: 26px; padding: 0; justify-content: center; background: var(--accent); color: var(--accent-contrast); box-shadow: var(--glow-accent); }
.pcard__feat .i { width: 14px; height: 14px; fill: currentColor; }
.pcard__price { left: var(--space-2); bottom: var(--space-2); min-height: 28px; padding: 0 10px; background: var(--accent); color: var(--accent-contrast); font-size: 0.875rem; }
.pcard__body { padding: var(--space-2) 2px 0; }
.pcard__title { font-size: 1rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.pcard__title a { color: var(--text); text-decoration: none; }
.pcard__title a::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: var(--radius); }
.pcard__title a:focus-visible { outline: none; }
.pcard__title a:focus-visible::after { outline: 3px solid var(--primary); outline-offset: 2px; }
.pcard__where { margin-top: 2px; font-size: 0.8125rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard__foot { display: flex; flex-wrap: wrap; gap: 2px var(--space-2); margin-top: var(--space-1); font-size: 0.8125rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pcard__elig { display: inline-flex; align-items: center; gap: 3px; }
.pcard__elig .i { width: 14px; height: 14px; }
.pcard__urgent { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 0.8125rem; font-weight: 700; color: var(--warning); }
.pcard__urgent .i { width: 14px; height: 14px; }

/* Category tiles */
/* Category tiles: an icon on a small stage. The duotone layer (.duo) carries the accent. */
.cat {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 124px;
  aspect-ratio: 1;
  padding: var(--space-3) var(--space-3) var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--stage);
  color: var(--on-stage);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  isolation: isolate;
  transition: box-shadow 200ms ease, transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
.cat::before { /* a soft light behind the icon */
  content: "";
  position: absolute;
  left: -20%; top: -30%;
  width: 90%; aspect-ratio: 1;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 34%, transparent), transparent);
  pointer-events: none;
}
.cat__icon { width: 40px; height: 40px; fill: currentColor; flex: none; transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1); }
.cat__icon .duo { fill: var(--accent); opacity: 0.9; }
.cat__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cat__name { color: var(--on-stage); font-family: var(--font-display); font-weight: 800; font-size: 1rem; line-height: 1.1; overflow-wrap: anywhere; }
.cat__count { color: var(--on-stage-muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
@media (hover: hover) {
  .cat:hover { box-shadow: var(--glow-primary); transform: translateY(-2px); }
  .cat:hover .cat__icon { transform: translateY(-2px) rotate(-6deg); }
}
.cat:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* Fest tiles: wide, photo-led. Also used for the Fests grid. */
.ftile { position: relative; width: clamp(272px, 82vw, 380px); aspect-ratio: 16 / 11; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); isolation: isolate; }
.grid--fests .ftile { width: auto; }
.ftile > .media { position: absolute; inset: 0; z-index: -2; }
.ftile::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--scrim); }
.ftile::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--accent); box-shadow: var(--glow-accent); }
.ftile__body { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--space-4); color: var(--on-stage); }
.ftile__dates { font-size: 0.8125rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.ftile__name { margin-top: 2px; font-size: 1.625rem; line-height: 1.05; letter-spacing: -0.02em; }
.ftile__name a { color: var(--on-stage); text-decoration: none; }
.ftile__name a::after { content: ""; position: absolute; inset: 0; }
.ftile__name a:focus-visible { outline: none; }
.ftile:focus-within { outline: 3px solid var(--primary); outline-offset: 2px; }
.ftile__tag { margin-top: var(--space-1); font-size: 0.875rem; color: var(--on-stage-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ftile__count { display: inline-flex; align-items: center; gap: 2px; margin-top: var(--space-2); font-size: 0.875rem; font-weight: 700; }
.ftile__count .i { width: 16px; height: 16px; }
@media (hover: hover) { .ftile:hover { box-shadow: var(--glow-primary); } }

/* Spotlight carousel: one loud thing per screen. */
.spot { position: relative; margin: var(--space-4) calc(var(--space-4) * -1) 0 !important; }
.spot__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.spot__track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; padding: 0 var(--space-4) var(--space-6); }
.slide__card { position: relative; aspect-ratio: 4 / 5; max-height: 72vh; border-radius: var(--radius-lg); isolation: isolate; }
/* The glow is the photo itself, blurred and spilled beneath the card: each slide lights the page in its own colours. */
.slide__glow, .hero__glow {
  position: absolute;
  inset: 10% 6% -4%;
  z-index: -1;
  border-radius: inherit;
  background: var(--img, none) center / cover, var(--primary);
  filter: blur(30px) saturate(1.7);
  opacity: 0.7;
  transform: translateY(14px);
  pointer-events: none;
}
.slide__media { position: absolute; inset: 0; border-radius: inherit; box-shadow: var(--shadow); }
.slide__media::after { content: ""; position: absolute; inset: 0; background: var(--scrim); }
.slide.is-live .slide__media { box-shadow: var(--glow-live); }
.slide__body { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--space-5) var(--space-4) var(--space-4); color: var(--on-stage); }
.slide__when { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); font-size: 0.875rem; font-weight: 700; color: var(--on-stage-muted); font-variant-numeric: tabular-nums; }
.slide__when > span + span::before { content: "·"; margin-right: var(--space-3); }
.slide__when .live { background: var(--live); color: var(--accent-contrast); box-shadow: var(--glow-live); }
.slide__title { margin-top: var(--space-2); font-size: clamp(2rem, 9vw, 3.5rem); font-weight: 800; line-height: 0.98; letter-spacing: -0.03em; text-wrap: balance; }
.slide__title a { color: var(--on-stage); text-decoration: none; }
.slide__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius-lg); }
.slide__title a:focus-visible { outline: none; }
.slide__title a:focus-visible::after { outline: 3px solid var(--accent); outline-offset: 3px; }
.slide__sub { margin-top: var(--space-2); display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 0.9375rem; color: var(--on-stage-muted); }
.slide .seal__fill { fill: var(--accent); }
.slide .seal__mark { stroke: var(--accent-contrast); }
.slide__cta { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-4); }
.slide__price { display: flex; flex-direction: column; font-family: var(--font-display); font-size: 1.75rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.slide__price small { margin-top: 4px; font-family: var(--font-body); font-size: 0.8125rem; font-weight: 400; color: var(--on-stage-muted); }
.btn--glow { background: var(--accent); color: var(--accent-contrast); box-shadow: var(--glow-accent); }
.btn--glow:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); box-shadow: 0 14px 38px -8px rgb(255 178 30 / 0.9); }
.spot__dots { display: flex; justify-content: center; margin-top: calc(var(--space-5) * -1) !important; }
.spot__dot { display: grid; place-items: center; width: 32px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
.spot__dot::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--border); transition: width 300ms cubic-bezier(0.22, 1, 0.36, 1), background-color 300ms ease; }
.spot__dot[aria-current="true"]::before { width: 24px; background: var(--accent); box-shadow: var(--glow-accent); }
.spot__dot:focus-visible { outline: 3px solid var(--primary); outline-offset: -6px; border-radius: var(--radius-sm); }
@media (min-width: 720px) {
  .spot { margin-inline: 0 !important; }
  .slide { padding-inline: 0; }
  .slide__card { aspect-ratio: 16 / 9; max-height: none; }
  .slide__body { padding: var(--space-6) var(--space-6) var(--space-5); max-width: 70%; }
}
@media (min-width: 1000px) {
  .slide__card { aspect-ratio: 21 / 9; }
  .slide__title { font-size: 3.75rem; }
  .cat { width: 140px; }
}

/* Happening-now strip */
.livestrip { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-5) !important; }
.livestrip__label { flex: none; }
.livestrip__label .live { box-shadow: var(--glow-live); }
.livestrip__track { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; padding: 6px 2px 10px; margin-right: calc(var(--space-4) * -1); }
.livestrip__track::-webkit-scrollbar { display: none; }
.livechip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
  min-height: 48px;
  padding: 4px var(--space-3) 4px 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--live) 45%, var(--border));
  box-shadow: var(--glow-live);
  color: var(--text);
  text-decoration: none;
}
.livechip__media { width: 38px; height: 38px; border-radius: 50%; }
.livechip b { display: block; font-size: 0.875rem; line-height: 1.2; }
.livechip small { display: block; font-size: 0.75rem; color: var(--text-muted); }

.discover__all { margin-top: var(--space-6) !important; text-align: center; }

/* Event page hero */
.hero { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-lg); isolation: isolate; }
.hero__media { position: absolute; inset: 0; border-radius: inherit; box-shadow: var(--shadow); }
.hero.is-live .hero__media { box-shadow: var(--glow-live); }

/* Entry rules */
.know h2 { font-size: 1.25rem; }
.know ul { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: var(--space-2); }
.know li { display: flex; gap: var(--space-2); align-items: flex-start; font-size: 0.9375rem; line-height: 1.45; }
.know li .i { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--primary); }

/* Fest hub hero */
.fest-head--photo { min-height: 260px; display: flex; flex-direction: column; justify-content: flex-end; border: 0; overflow: visible; isolation: isolate; color: var(--on-stage); background: var(--stage); }
.fest-head--photo::before { display: none; }
.fest-head--photo .fest-head__media { position: absolute; inset: 0; border-radius: inherit; z-index: 0; }
.fest-head--photo .fest-head__media::after { content: ""; position: absolute; inset: 0; background: var(--scrim); }
.fest-head--photo > :not(.fest-head__media, .hero__glow) { position: relative; z-index: 1; }
.fest-head--photo h1 { color: var(--on-stage); font-size: clamp(2rem, 8vw, 3.25rem); letter-spacing: -0.03em; }
.fest-head--photo .lede { color: var(--on-stage-muted); }
.fest-head--photo .fest-head__dates > .i { color: var(--accent); }
@media (min-width: 720px) { .fest-head--photo { min-height: 340px; padding: var(--space-6); } }

/* Organiser cover picker */
.covers { border: 0; padding: 0; margin: 0; }
.covers legend { font-weight: 700; }
.covers__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: var(--space-2); margin-top: var(--space-2); }
.cover-opt { position: relative; display: block; cursor: pointer; }
.cover-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cover-opt .media { aspect-ratio: 1; border-radius: var(--radius-sm); outline: 2px solid transparent; outline-offset: 2px; transition: outline-color 150ms ease, box-shadow 150ms ease; }
.cover-opt__none { display: grid; place-items: center; background: var(--surface-2); color: var(--text-muted); font-size: 0.75rem; font-weight: 700; text-align: center; }
.cover-opt input:checked + .media { outline-color: var(--primary); box-shadow: var(--glow-primary); }
.cover-opt input:focus-visible + .media { outline: 3px solid var(--primary); }

/* Credits */
.credits { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.credits li { display: flex; align-items: center; gap: var(--space-3); }
.credits b { display: block; font-size: 0.9375rem; overflow-wrap: anywhere; }
.credits small { display: block; color: var(--text-muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.footer a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  .cat, .cat__icon { transition: none; }
  .cat:hover, .cat:hover .cat__icon { transform: none; }
  .card__art .media__img, .pcard__art .media__img { transition: none; }
  .spot__dot::before { transition: none; }
}
