/* ============================================================================
   Shiva Temple Manchester — Event Booking
   Layout + components. All values come from tokens.css; edit that file to
   re-brand, not this one.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
/* Component classes set display:flex/grid, which beats the UA rule for the
   hidden attribute. State it once, here, so `el.hidden = true` always works. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .art-flame { animation: none !important; }   /* an .01ms infinite loop would strobe, not stop */
  .hero__photo { animation: none !important; }  /* same: the hero's slow drift is infinite too */
}

/* Cross-fade to and from the temple site's pages — both sides opt in, so the
   hop from Events to the booking page fades rather than flashing blank. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .38s; }
}

/* The diya's flame on generated event artwork. Each flame gets its own offset
   (ui.js), so a grid of lamp cards never flickers in step. */
.art-flame {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: flame-flicker 2.9s ease-in-out infinite;
}
@keyframes flame-flicker {
  0%, 100% { transform: scale(1, 1) rotate(0deg);          stroke-opacity: .95; }
  18%      { transform: scale(.95, 1.06) rotate(-2deg);     stroke-opacity: .80; }
  37%      { transform: scale(1.04, .96) rotate(1.2deg);    stroke-opacity: 1;   }
  55%      { transform: scale(.97, 1.04) rotate(-.6deg);    stroke-opacity: .85; }
  74%      { transform: scale(1.02, .98) rotate(1.6deg);    stroke-opacity: .92; }
}
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  /* The site sets prose in --ink-soft at 1.72 and keeps --ink for headings and
     emphasis (main.css body). Matching it is what makes a booking section and
     a poojas section breathe alike — and the shared footer inherits from here,
     so while these differed the same footer was set tighter on this page. */
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.15; margin: 0 0 var(--sp-3); letter-spacing: -.01em; }
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
p  { margin: 0 0 var(--sp-4); }
p, li, td, dd { overflow-wrap: break-word; }
a  { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
/* A heading the page moves focus to (the drawer opening, a new step) is there for screen readers, which read it out; it is not
   a control, so a keyboard user does not get a ring drawn round it. Real controls keep the ring above. */
h1[tabindex="-1"]:focus-visible, h2[tabindex="-1"]:focus-visible, h3[tabindex="-1"]:focus-visible { outline: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--sp-4); top: -100px; z-index: 200;
  background: var(--accent); color: var(--text-onbrand); padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md); font-weight: 600; transition: top .15s var(--ease);
}
.skip-link:focus { top: var(--sp-4); }

/* Must be the same column as chrome.css's .wrap, or the hero text and the
   header logo above it start at different left edges. */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.stack > * + * { margin-top: var(--sp-4); }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); font-size: var(--step--1); }
.mono  { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }

/* ---------------------------------------------------------------- buttons -- */
/* The site's button: square corners, small uppercase letterspaced type, and
   the gradient that slides up from the foot on hover.

   Two deliberate differences from main.css. The booking app's bare .btn is its
   PRIMARY action — Pay, Book, Continue, written from the JavaScript in 48
   places — so it carries the solid fill the site spells .btn--solid, and
   .btn--ghost is the site's plain outline button. Source of truth for the
   shape and motion is main.css .btn and chrome.css .btn--solid; keep them in
   step. --btn-slide lets each variant name its own hover fill. */
.btn {
  --btn-bg: linear-gradient(100deg, var(--saffron), var(--marigold));
  --btn-fg: var(--ink);
  --btn-bd: transparent;
  --btn-slide: linear-gradient(100deg, var(--marigold), var(--sand-deep));
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  padding: .95em 2em; min-height: 48px;
  font-family: var(--font-body); font-size: .8rem; font-weight: 600; line-height: 1;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 1px solid var(--btn-bd); border-radius: var(--r-md);
  cursor: pointer; text-decoration: none; text-align: center;
  position: relative; overflow: hidden; isolation: isolate;
  transition: color .45s var(--ease), border-color .45s var(--ease), transform .45s var(--ease);
}
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--btn-slide);
  transform: translateY(101%); transition: transform .5s var(--ease-out);
}
.btn:hover:not(:disabled) { color: var(--ink); transform: translateY(-2px); }
.btn:hover:not(:disabled)::after { transform: translateY(0); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn:disabled::after { content: none; }

.btn--ghost {
  --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--accent);
  --btn-slide: linear-gradient(100deg, var(--saffron), var(--marigold));
}
.btn--ghost:hover:not(:disabled) { border-color: var(--saffron); }

/* Primary action standing on a photograph. chrome.css styles .btn--solid for
   the shared header, and its `.hero .btn:not(.btn--solid)` rule lightens every
   other button in a hero — so a hero's primary button must wear .btn--solid,
   not this, or it inherits near-white text on a pale fill. */
.btn--onbrand { --btn-bg: var(--sand); --btn-fg: var(--brand-red-dark); --btn-bd: transparent; }

/* chrome.css lightens the text and border of every non-solid button in a hero,
   but it does not clear the fill — on the site it has nothing to clear, since
   the base .btn there is transparent. Ours is not, so clear it here. */
.hero .btn:not(.btn--solid) { --btn-bg: transparent; }

.btn--block   { width: 100%; }
.btn--lg      { font-size: .86rem; padding: 1.05em 2.2em; min-height: 52px; }
.btn--sm      { font-size: .75rem; padding: .6em 1.2em; min-height: 38px; letter-spacing: .14em; }

/* The quiet button is a text action — no fill slides up behind it, and it
   keeps sentence case. The site's letterspaced capitals suit a short label
   like Donate; this variant carries phrases ("Back to all events", "Remove
   picture — use the artwork"), and capitals are emphatic, not quiet. They
   also ran the longest of them out past its container.

   It sits after --lg and --sm on purpose: those say how big, this says in
   what voice, and it is nearly always worn with --sm. Order decides, since
   all three are single classes. */
.btn--quiet {
  --btn-bg: transparent; --btn-fg: var(--text-muted); --btn-bd: transparent;
  --btn-slide: none;
  padding: .55em .9em; min-height: 36px;
  font-size: var(--step--1); font-weight: 500;
  letter-spacing: normal; text-transform: none;
}
.btn--quiet:hover:not(:disabled) {
  --btn-fg: var(--ink); background: var(--surface-sunk); transform: none;
}

/* ------------------------------------------------------------------ badges -- */
.badge {
  display: inline-flex; align-items: center; gap: .35em;
  font-size: var(--step--1); font-weight: 600; letter-spacing: .02em;
  padding: .3em .7em; border-radius: var(--r-pill);
  background: var(--surface-sunk); color: var(--text-muted); white-space: nowrap;
}
.badge--free    { background: var(--ok-bg);   color: var(--ok); }
.badge--low     { background: var(--warn-bg); color: var(--warn-ink); }
.badge--sold    { background: var(--err-bg);  color: var(--err); }
.badge--early   { background: var(--accent-soft); color: var(--accent-hover); }
.badge--soon    { background: var(--info-bg); color: var(--info); }
.badge--gold    { background: linear-gradient(100deg, var(--brand-ornament), var(--brand-ornament-soft)); color: var(--brand-red-dark); }
.badge--dot::before { content: ""; width: .45em; height: .45em; border-radius: 50%; background: currentColor; }

/* ------------------------------------------------------------------ header --
   The booking app's own header, brand lockup, badge and basket button went
   with ticket 04, and their rules went with them. Two of them had to go rather
   than simply stop being used: .brand is also the shared header's class, and
   this file's copy was adding gap:12px and margin-right:auto to it — the same
   trap as the .nav rules below, which pushed the Donate button off the page.
   The site's own .brand lives in chrome.css.

   .icon-btn survives because the drawers still use it for Back and Close.

   (The old note, kept because it earned it: the booking app's own .nav went
   with its old header. The site header uses the same class name, and those
   rules outranked chrome.css's .menu__link — .nav a is (0,1,1) against (0,1,0)
   — so every link in the shared header grew by 1.6rem of padding and pushed
   the Donate button off the side of the page. Dead code is not harmless when
   it shares a name with live code.) */
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none;
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--text-muted); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }


/* -------------------------------------------------------------------- hero --
   The same band as the temple site's home page: a photograph, a dark veil
   over it, then eyebrow, serif headline and lead, fading into paper at the
   foot. Shorter than the home page's 94vh — people arrive here to find an
   event, not to be greeted — and a different photograph, so the two pages
   are kin rather than twins. */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: flex-end;
  min-height: min(46vh, 420px);
  color: var(--on-photo);
}
/* Shown only until the photograph loads, and behind it if it never does. */
.hero__bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(70% 44% at 22% 30%, rgba(255,158,66,.5), transparent 60%),
    linear-gradient(180deg, #2A2140 0%, #5B2E33 38%, #A8481F 68%, #2A1B14 100%);
}
.hero__photo {
  position: absolute; inset: 0; z-index: 1;
  background-image: url("../../../assets/img/gopuram.jpg");
  background-image: image-set(url("../../../assets/img/gopuram-900.webp") type("image/webp"), url("../../../assets/img/gopuram.jpg") type("image/jpeg"));
  background-size: cover; background-position: center 22%;
  animation: kenburns 30s var(--ease) infinite alternate;
}
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.09); } }
/* Narrow screens: the wash covers the whole band — there is no width to spare
   for keeping the photograph open beside the type. The site's interior page
   headers split at the same 900px, the other way up: cream there, dark here. */
.hero__veil {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(180deg,
    rgba(24,15,5,.62) 0%, rgba(24,15,5,.66) 30%, rgba(24,15,5,.78) 70%, rgba(24,15,5,.88) 100%);
}
/* Wide screens: type on a dark field at the left, photograph open at the right. */
@media (min-width: 900px) {
  .hero__veil {
    background:
      linear-gradient(180deg, rgba(24,15,5,.55) 0%, rgba(24,15,5,.30) 26%, rgba(24,15,5,.74) 68%, rgba(24,15,5,.88) 100%),
      linear-gradient(90deg, rgba(24,15,5,.74) 0%, rgba(24,15,5,.52) 38%, rgba(24,15,5,.12) 72%, transparent 88%);
  }
}
.hero__inner {
  position: relative; z-index: 3; width: 100%;
  padding-block: clamp(2.5rem, 6vw, 4.25rem) clamp(2rem, 4vw, 3rem);
}
.hero__eyebrow {
  display: flex; align-items: center; gap: var(--sp-3);
  font-family: var(--font-body); font-size: max(var(--t-eyebrow), .75rem); font-weight: 600;
  letter-spacing: .34em; text-transform: uppercase; color: var(--saffron);
  margin-bottom: var(--sp-4);
}
.hero__eyebrow::before {
  content: ""; width: 26px; height: 1px; flex: none;
  background: linear-gradient(90deg, transparent, var(--saffron));
}
.hero h1 {
  max-width: 750px; line-height: .99; letter-spacing: -.02em;
  color: var(--on-photo); margin-bottom: var(--sp-5);
}
.hero h1 em { display: block; font-style: normal; }
/* Gilt reads as bright gold on a photograph, as it does on the home page. */
.hero h1 .gilt {
  background: linear-gradient(96deg, #FFE9B0 4%, var(--marigold) 40%, var(--saffron) 64%, #E0A116 96%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__lede { max-width: 58ch; font-size: var(--step-1); color: var(--on-photo-soft); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-6); }
/* The list follows the heading closely; a page that is only the temple's events needs
   no big gap between them. */
#events.section { padding-top: clamp(2.5rem, 5vw, 4rem); }
/* A phone: the first event card must be on the first screen, so the band is only as
   tall as its words. The eyebrow repeats the site name in the header above it. */
@media (max-width: 699px) {
  .hero { min-height: 0; }
  .hero__inner { padding-block: var(--sp-4); }
  .hero__eyebrow { display: none; }
  .hero h1 { font-size: 1.7rem; margin-bottom: var(--sp-2); }
  .hero h1 em { display: inline; }
  .hero__lede { font-size: .9375rem; line-height: 1.4; margin-bottom: 0; }
  .hero__actions { margin-top: var(--sp-3); flex-wrap: nowrap; }
  .hero__actions .btn { flex: 1 1 0; min-width: 0; min-height: 44px; padding: .55rem var(--sp-3); justify-content: center; }
  #result-count:empty { display: none; }
  #events.section { padding-top: var(--sp-4); }
  #events .section__head { margin-bottom: var(--sp-3); }
  #events .section__head p, #events .section__head .eyebrow { display: none; }
  #events .section__head h2 { font-size: var(--step-2); }
}

/* The Orders tab's headline numbers: one line, with the money detail folded away. */
.ordersummary { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); margin-bottom: var(--sp-2); font-size: var(--step-0); color: var(--muted); }
.ordersummary__item { white-space: nowrap; }
.ordersummary__item b { color: var(--ink); font-weight: 600; font-size: var(--step-1); }
.money { margin-bottom: var(--sp-4); }
.money > summary { cursor: pointer; font-size: var(--step--1); color: var(--muted); padding-block: var(--sp-2); }
.money dl { display: grid; gap: var(--sp-2); margin: var(--sp-2) 0 0; padding: var(--sp-3) var(--sp-4); background: var(--paper-2); border-radius: var(--r-md); }
.money dl > div { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); align-items: baseline; }
.money dt { min-width: 8rem; color: var(--muted); font-size: var(--step--1); letter-spacing: .08em; text-transform: uppercase; }
.money dd { margin: 0; font-weight: 600; }

/* The event filter (and any export button) at the top of a panel it acts on. */
.panelbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.panelbar__label { font-size: var(--step--1); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.panelbar .select { max-width: 100%; }

/* ---------------------------------------------------------------- staff bar --
   The organiser page's own header (build.js staffBar): not the public site's
   top bar and menu. One quiet row. On a phone the "Box office" title steps
   aside (it stays for screen readers) so the name and Sign out always fit. */
.staffbar { background: var(--paper); border-bottom: 1px solid var(--hair-soft); }
.staffbar__in { display: flex; align-items: center; gap: var(--sp-4); min-height: 60px; padding-block: var(--sp-2); }
.staffbar__brand { display: flex; align-items: center; flex: none; width: 112px; min-height: 44px; line-height: 0; }
.staffbar__brand img { width: 100%; height: auto; display: block; }
.staffbar__title {
  margin: 0; font-family: var(--font-body); font-size: .8rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
}
.staffbar__who { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.staffbar__name { color: var(--muted); font-size: var(--step--1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 520px) {
  .staffbar__brand { width: 92px; }
  .staffbar__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* The dashboard starts under the bar, not a screen's worth of breathing space below it. */
.section.dash { padding-block: var(--sp-5) var(--sp-8); }

/* ------------------------------------------------------------------ layout -- */
/* The site breathes more widely than the app did (main.css .section). */
.section { padding: clamp(4rem, 9vw, 8rem) 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-6); }
.section__head p { margin: 0; max-width: 58ch; }
/* The site's eyebrow, rule and all (main.css .eyebrow). */
.eyebrow {
  display: flex; align-items: center; gap: var(--sp-3);
  font-family: var(--font-body); font-size: max(var(--t-eyebrow), .75rem); font-weight: 600;
  letter-spacing: .34em; text-transform: uppercase;
  color: var(--accent); margin-bottom: var(--sp-4);
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; flex: none;
  background: linear-gradient(90deg, transparent, var(--accent));
}
.rule { height: 1px; background: linear-gradient(90deg, var(--brand-ornament), transparent); border: 0; margin: var(--sp-5) 0; }

/* ----------------------------------------------------------------- filters -- */
/* Not sticky: a panel that follows the page down covered most of a phone's screen. */
.filters {
  display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center;
  padding: var(--sp-3); margin-bottom: var(--sp-6);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.filters__panel { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; flex: 1 1 100%; }
.filters__toggle { display: none; }
/* A phone: the controls sit behind one "Filter" button. */
@media (max-width: 699px) {
  .filters { padding: var(--sp-2); margin-bottom: var(--sp-4); }
  .filters__toggle { display: inline-flex; width: 100%; justify-content: center; }
  .filters:not([data-open]) .filters__panel { display: none; }
  .filters[data-open] .filters__panel { margin-top: var(--sp-2); }
}
.search {
  position: relative; flex: 1 1 240px; min-width: 200px;
}
.search input {
  width: 100%; font: inherit; color: var(--text);
  padding: .7rem .9rem .7rem 2.5rem; min-height: 44px;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r-md);
}
.search svg { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--text-faint); }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  font: inherit; font-size: var(--step--1); font-weight: 500;
  padding: .5rem .9rem; min-height: 38px;
  letter-spacing: .06em;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--text-muted); cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--ink); background: rgba(122,87,9,.06); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--text-onbrand); }
.select {
  font: inherit; font-size: var(--step--1); color: var(--text);
  padding: .55rem 2rem .55rem .8rem; min-height: 38px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%2394796B' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center;
}

/* ------------------------------------------------------------ event cards -- */
.event-grid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
/* A festival's heading across the whole grid, over its days (festival-grouping plan, F03). */
.festival-head { grid-column: 1 / -1; padding-top: var(--sp-3); border-top: 1px solid var(--hair-soft); }
.festival-head h3 { margin: 0; font-size: var(--step-2); }
.festival-head p { margin: var(--sp-1) 0 0; font-size: var(--step--1); }
/* The site's card: paper gradient, hairline, and a gold bar that grows down
   the leading edge on hover (main.css .card). */
.event-card {
  display: flex; flex-direction: column; overflow: hidden; position: relative;
  background: linear-gradient(168deg, #FFFDF7, #F7F0DE);
  border: 1px solid var(--hair-soft); border-radius: var(--r-lg);
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease), border-color .45s var(--ease), background .45s var(--ease);
}
.event-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; z-index: 2;
  background: linear-gradient(180deg, var(--accent), var(--saffron));
  transform: scaleY(0); transform-origin: top;
  transition: transform .55s var(--ease-out);
}
.event-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-lift);
  border-color: var(--hair); background: linear-gradient(168deg, #FFFFFC, #F9F2E2);
}
.event-card:hover::before { transform: scaleY(1); }
.event-card--soldout { opacity: .82; }
.event-card__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-sunk); }
.event-card__media svg, .event-card__media img { width: 100%; height: 100%; object-fit: cover; }
.event-card__flags { position: absolute; top: var(--sp-3); left: var(--sp-3); display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.event-card__date {
  position: absolute; right: var(--sp-3); bottom: var(--sp-3);
  display: grid; place-items: center; width: 58px; padding: .35rem 0;
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-1); text-align: center;
}
.event-card__date b { display: block; font-family: var(--font-display); font-size: var(--step-2); line-height: 1; }
.event-card__date span { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); }
.event-card__body { display: flex; flex-direction: column; flex: 1; padding: var(--sp-5); gap: var(--sp-3); }
.event-card__body h3 { margin: 0; font-size: var(--step-2); }
.event-card__meta { display: grid; gap: var(--sp-2); font-size: var(--step--1); color: var(--text-muted); }
.event-card__meta > div { display: flex; gap: var(--sp-2); align-items: flex-start; }
.event-card__meta svg { flex: none; margin-top: .15em; color: var(--text-faint); }
.event-card__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: auto; padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.price { font-family: var(--font-display); font-size: var(--step-2); line-height: 1; }
.price small { font-family: var(--font-body); font-size: var(--step--1); color: var(--text-faint); display: block; margin-bottom: 2px; }
.price s { color: var(--text-faint); font-size: var(--step-0); margin-right: .3em; }
.capacity-bar { height: 5px; border-radius: var(--r-pill); background: var(--surface-sunk); overflow: hidden; }
.capacity-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--brand-red-light)); }
.capacity-bar--low i { background: linear-gradient(90deg, #C7411F, #E8871E); }

/* A phone: the card is shorter, a low picture strip and a two-line summary, so a
   devotee sees an event's name, date, place and button without scrolling. */
@media (max-width: 699px) {
  .event-card__media { aspect-ratio: 16 / 5; }
  .event-card__body { padding: var(--sp-3) var(--sp-4) var(--sp-4); gap: var(--sp-2); }
  .event-card__body h3 { font-size: var(--step-1); }
  .event-card__summary {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  }
  .event-card__foot { padding-top: var(--sp-2); }
}

.empty-state { padding: var(--sp-8) var(--sp-4); text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--text-muted); }

/* ------------------------------------------------------ dialog / drawer -- */
.scrim {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(24,10,16,.55); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .22s var(--ease);
}
.scrim[data-open] { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 100;
  width: min(560px, 100%); display: flex; flex-direction: column;
  background: var(--surface); box-shadow: var(--shadow-3);
  transform: translateX(100%); transition: transform .28s var(--ease);
}
.drawer[data-open] { transform: none; }
.drawer--wide { width: min(760px, 100%); }
.drawer__head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line);
  background: var(--surface); position: sticky; top: 0; z-index: 2;
}
.drawer__head h2, .drawer__head h3 { margin: 0; font-size: var(--step-2); flex: 1; }
.drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: var(--sp-5); }
.drawer__foot {
  padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--line);
  background: var(--surface); box-shadow: 0 -6px 20px rgba(42,23,18,.05);
}
@media (max-width: 620px) {
  .drawer { top: 6vh; border-radius: var(--r-xl) var(--r-xl) 0 0; transform: translateY(100%); }
  .drawer[data-open] { transform: none; }
}

/* ------------------------------------------------------------ event detail -- */
.detail__hero { position: relative; aspect-ratio: 16/8; border-radius: var(--r-lg); overflow: hidden; margin-bottom: var(--sp-5); background: var(--surface-sunk); }
.detail__hero svg, .detail__hero img { width: 100%; height: 100%; object-fit: cover; }
/* an event photo sits exactly over the artwork it replaces */
.event-photo { position: absolute; inset: 0; }

/* The printed poster on an event page: whole, upright, never cropped. */
.event-poster { margin: var(--sp-5) 0 0; text-align: center; }
.event-poster img {
  max-width: min(100%, 26rem); height: auto; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface-sunk);
}
.event-poster figcaption { margin-top: var(--sp-2); font-size: var(--step--1); }
.detail__facts { display: grid; gap: var(--sp-3); padding: var(--sp-4); margin-bottom: var(--sp-5); background: var(--surface-sunk); border-radius: var(--r-md); }
.detail__facts > div { display: flex; gap: var(--sp-3); align-items: flex-start; font-size: var(--step-0); }
.detail__facts svg { flex: none; margin-top: .2em; color: var(--accent); }
.detail__facts b { display: block; font-weight: 600; }
.detail__facts span { color: var(--text-muted); font-size: var(--step--1); }
.prose h4 { margin-top: var(--sp-5); }
.prose ul { padding-left: 1.2em; margin: 0 0 var(--sp-4); }
.prose li + li { margin-top: var(--sp-2); }

/* ------------------------------------------------------------------ tiers -- */
.tier {
  display: grid; gap: var(--sp-3); padding: var(--sp-4);
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  grid-template-columns: 1fr auto; align-items: center;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.tier + .tier { margin-top: var(--sp-3); }
.tier:has(.stepper input:not([value="0"])) { border-color: var(--accent); background: var(--accent-soft); }
.tier--unavailable { opacity: .62; }
.tier__name { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); font-weight: 600; }
.tier__desc { font-size: var(--step--1); color: var(--text-muted); margin-top: var(--sp-1); }
.tier__price { font-family: var(--font-display); font-size: var(--step-1); margin-top: var(--sp-2); }
.tier__price s { font-family: var(--font-body); font-size: var(--step--1); color: var(--text-faint); margin-right: .35em; }
.tier__note { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--sp-2); margin: 0; font-size: var(--step--1); color: var(--warn-ink); }
/* A service (car pooja, tharpanam): the ticket-row look for the choice, then one
   box of questions for each one chosen. */
.service + .service { margin-top: var(--sp-4); }
.service__units { margin-top: var(--sp-3); }
.service__units fieldset { margin-bottom: var(--sp-3); }

.stepper {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); overflow: hidden;
}
.stepper button {
  width: 44px; height: 44px; border: 0; background: transparent; color: var(--text);
  font-size: var(--step-1); line-height: 1; cursor: pointer;
}
.stepper button:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-hover); }
.stepper button:disabled { color: var(--text-faint); cursor: not-allowed; }
.stepper input {
  width: 44px; height: 44px; border: 0; text-align: center; font: inherit; font-weight: 600;
  background: transparent; color: var(--text); -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ----------------------------------------------------------------- stepper -- */
.steps { display: flex; gap: var(--sp-2); padding: var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--line); background: var(--bg-alt); }
.steps li { flex: 1; list-style: none; font-size: var(--step--1); color: var(--text-faint); }
.steps li b { display: block; height: 3px; border-radius: var(--r-pill); background: var(--line); margin-bottom: .4rem; }
.steps li[data-state="done"] { color: var(--text-muted); }
.steps li[data-state="done"] b { background: var(--ok); }
.steps li[data-state="current"] { color: var(--accent); font-weight: 600; }
.steps li[data-state="current"] b { background: var(--accent); }

/* ------------------------------------------------------------------- forms -- */
.field { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-4); }
/* The site names things in small letterspaced caps (main.css .bank__label). */
.field > label, .field__legend {
  font-size: var(--t-small); font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
}
.field__hint { font-size: var(--step--1); color: var(--text-muted); }
.field input[type=text], .field input[type=email], .field input[type=tel],
.field input[type=number], .field input[type=password], .field input[type=date], .field input[type=time],
.field input[type=search], .field input[type=url], .field select, .field textarea {
  font: inherit; color: var(--text); width: 100%; min-height: 46px;
  padding: .65rem .85rem; background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
}
/* One height for every single-line box, so the boxes in a row line up whatever sits above or below them. */
.field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=range]), .field select {
  height: 48px; box-sizing: border-box;
}
/* A file box: the browser's grey "Choose file" button, dressed as the site's own small button. */
.field input[type=file] { font: inherit; font-size: var(--step--1); color: var(--text-muted); width: 100%; }
.field input[type=file]::file-selector-button {
  font: inherit; font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink); background: transparent; border: 1px solid var(--accent); border-radius: var(--r-sm, 4px);
  padding: .6em 1.2em; margin-right: var(--sp-3); cursor: pointer; transition: border-color .2s, background .2s;
}
.field input[type=file]::file-selector-button:hover { background: var(--surface-sunk); border-color: var(--saffron, var(--accent)); }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field--invalid input, .field--invalid select, .field--invalid textarea { border-color: var(--err); background: var(--err-bg); }
.field__error { font-size: var(--step--1); color: var(--err); font-weight: 500; }
.field--check { display: flex; flex-direction: row; align-items: flex-start; gap: var(--sp-3); }
.field--check input { margin-top: .25rem; width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
/* Consent and opt-in text is prose, not a label: it must not inherit the small
   caps above (.field > label and .field--check label are both (0,1,1), so this
   only wins on what it names). Terms and refund wording in letterspaced gold
   capitals is both harder to read and the wrong tone. */
.field--check label {
  font-weight: 400; font-size: var(--step-0);
  letter-spacing: normal; text-transform: none; color: var(--text);
}
/* sponsorship options: the amount sits on the first line, the description under it */
.field--check label .field__hint { display: block; margin-top: .15rem; }
.field--check input:disabled + label { opacity: .55; }
.grid-2 { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: start; }
fieldset { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-4); margin: 0 0 var(--sp-4); }
legend { padding: 0 var(--sp-2); font-weight: 600; }
.req { color: var(--err); }

/* --------------------------------------------------------------- summary -- */
.summary { background: var(--surface-sunk); border-radius: var(--r-md); padding: var(--sp-4); }

/* "Find a booking" in the bookings panel. Closed by default: most people
   opening the panel already have what they came for, and only the one who
   does not needs the form. It opens itself when there is something to say. */
.lookup, .past-bookings { margin-top: var(--sp-5); border-top: 1px solid var(--hair); padding-top: var(--sp-4); }
.lookup > summary, .past-bookings > summary {
  cursor: pointer; list-style: none;
  font-size: var(--t-small); font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
}
.lookup > summary::-webkit-details-marker, .past-bookings > summary::-webkit-details-marker { display: none; }
.lookup > summary::after, .past-bookings > summary::after { content: " +"; }
.lookup[open] > summary::after, .past-bookings[open] > summary::after { content: " \2212"; }
.past-bookings__list { margin-top: var(--sp-4); }
.lookup form { margin-top: var(--sp-4); }
.lookup p { margin-bottom: var(--sp-4); }
.summary__row { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: var(--step-0); }
.summary__row + .summary__row { margin-top: var(--sp-2); }
.summary__row--total {
  margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line-strong);
  font-family: var(--font-display); font-size: var(--step-2); align-items: baseline;
}
.summary__row--discount { color: var(--ok); }
.summary__row small { color: var(--text-faint); font-size: var(--step--1); display: block; font-family: var(--font-body); }

.promo { display: flex; gap: var(--sp-2); }
.promo input { flex: 1; min-height: 44px; padding: .6rem .8rem; font: inherit; text-transform: uppercase;
  border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: var(--bg); color: var(--text); }
.promo input::placeholder { text-transform: none; }
.applied-code {
  display: flex; align-items: center; gap: var(--sp-2); font-size: var(--step--1); font-weight: 600;
  color: var(--ok); background: var(--ok-bg); padding: .5rem .75rem; border-radius: var(--r-md);
}
.applied-code button { margin-left: auto; border: 0; background: none; color: inherit; cursor: pointer; text-decoration: underline; font: inherit; }

.donation__presets { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.donation__presets .chip[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }

/* --------------------------------------------------------------- payment -- */
.pay-methods { display: grid; gap: var(--sp-3); }
.pay-method {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4);
  border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer;
}
.pay-method:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pay-method input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.pay-method__label { flex: 1; font-weight: 600; }
.pay-method__label small { display: block; font-weight: 400; color: var(--text-muted); font-size: var(--step--1); }
.pay-logo { height: 22px; width: auto; flex: none; }
.stub-note {
  display: flex; gap: var(--sp-3); padding: var(--sp-4); margin-top: var(--sp-4);
  background: var(--info-bg); color: var(--info); border-radius: var(--r-md); font-size: var(--step--1);
}
.stub-note code { background: rgba(0,0,0,.07); padding: .1em .35em; border-radius: 4px; }

/* The strip at the top of the page while payments are fake. In the page, not sticky. */
.test-banner {
  background: var(--warn-bg); color: var(--ink); border-bottom: 1px solid var(--warn);
  padding: var(--sp-2) var(--sp-4); text-align: center; font-size: var(--step--1);
}
.card-fields { display: grid; gap: var(--sp-3); margin-top: var(--sp-4); padding: var(--sp-4); border: 1px dashed var(--line-strong); border-radius: var(--r-md); }

/* ------------------------------------------------------------- confirmation -- */
.confirm-hero { text-align: center; padding: var(--sp-5) 0; }
.confirm-hero__tick {
  width: 76px; height: 76px; margin: 0 auto var(--sp-4); display: grid; place-items: center;
  border-radius: 50%; background: var(--ok-bg); color: var(--ok);
}
.confirm-hero__tick--wait { background: var(--info-bg); color: var(--info); }
.held-note { margin-top: var(--sp-4); }
/* the slow bar under "Confirming your payment": still when the visitor asks for less motion */
.wait-bar { position: relative; height: 4px; max-width: 220px; margin: var(--sp-5) auto 0; border-radius: 2px; background: var(--line-strong); overflow: hidden; }
.wait-bar::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; border-radius: 2px; background: var(--info); }
@media (prefers-reduced-motion: no-preference) {
  .wait-bar::after { animation: wait-slide 1.4s ease-in-out infinite; }
}
@keyframes wait-slide { from { left: -40%; } to { left: 100%; } }
.ticket {
  display: grid; grid-template-columns: 1fr auto; gap: var(--sp-4);
  padding: var(--sp-4); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface); position: relative; overflow: hidden;
}
.ticket + .ticket { margin-top: var(--sp-3); }
.ticket::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, var(--accent), var(--brand-red-light)); }
.ticket__qr { width: 116px; height: 116px; flex: none; background: #fff; padding: 6px; border-radius: var(--r-sm); }
.ticket__qr svg { width: 100%; height: 100%; }
.ticket__code { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: .06em; color: var(--text-muted); }
.ticket__name { font-weight: 600; font-size: var(--step-1); }
.ticket--used { opacity: .6; }

/* ------------------------------------------------------------------ toast -- */
.toasts { position: fixed; left: 50%; bottom: var(--sp-5); transform: translateX(-50%); z-index: 200; display: grid; gap: var(--sp-2); width: min(420px, calc(100% - 2rem)); }
.toast {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md);
  background: var(--surface-inv); color: var(--text-inv); box-shadow: var(--shadow-2);
  font-size: var(--step-0); animation: toast-in .25s var(--ease);
}
.toast--err { background: var(--err); color: #fff; }
.toast--ok  { background: var(--ok);  color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* --------------------------------------------------------------- footer --
   The booking app's dark footer went with ticket 04; the site's .foot is
   generated into the page instead. Only this survives, and only because
   #visit-contact is not part of the footer. */
/* give these links a bigger touch area than their text line */
#visit-contact a { display: inline-block; padding: .35rem 0; }

/* ------------------------------------------------------------ info blocks -- */

.faq details { border-bottom: 1px solid var(--line); padding: var(--sp-4) 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: var(--step-1); font-family: var(--font-display); list-style: none; display: flex; justify-content: space-between; gap: var(--sp-3); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: var(--step-2); line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: var(--sp-3) 0 0; color: var(--text-muted); max-width: 68ch; }

/* --------------------------------------------------------------- organiser -- */
/* The sign-in gate is built in auth.js, which is security-adjacent, so it is
   styled from here rather than edited. It borrows .stat as its panel; these
   rules give it a panel's proportions instead of a tile's. Its inline padding
   and max-width stay — an inline style outranks any selector here, and both
   values are the ones this would have chosen anyway. */
#auth-gate { display: grid; place-items: center; min-height: 60vh; }
#auth-gate .container { max-width: 26rem; }
#auth-gate .stat { width: 100%; padding: var(--sp-6); }
#auth-gate h2 { font-size: var(--step-4); margin-bottom: var(--sp-3); }
#auth-gate .stub-note { margin-bottom: var(--sp-4); }
#auth-gate .eyebrow { font-size: .8rem; }
#auth-gate .field > label {
  font-size: var(--t-small); letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
}


/* The site's panel (main.css .panel): paper gradient, hairline, 4px. Staff
   read these at a glance, so the figure takes the display face and the gold
   the site uses for figures elsewhere. */
.stat {
  padding: var(--sp-4) var(--sp-5);
  background: linear-gradient(168deg, #FFFDF7, #F7F0DE);
  border: 1px solid var(--hair-soft); border-radius: var(--r-lg);
}
.stat b { display: block; font-family: var(--font-display); font-size: var(--step-3); line-height: 1.1; color: var(--accent); }
.stat span { display: block; font-size: var(--t-small); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.stat i { display: block; margin-top: 2px; font-style: normal; font-size: var(--step--1); color: var(--ok); }

/* A staff table: dense and legible, hairlines rather than boxes. Column heads
   borrow the site's small caps; the rows stay in the reading face and size. */
.table-wrap { overflow-x: auto; border: 1px solid var(--hair-soft); border-radius: var(--r-lg); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: var(--step-0); min-width: 720px; }
thead th {
  text-align: left; font-size: var(--t-small); letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--hair); background: var(--paper-2); position: sticky; top: 0;
  white-space: nowrap;
}
tbody td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--hair-soft); vertical-align: middle; line-height: 1.5; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(122,87,9,.05); }
/* The tab bar: twelve tabs under five headings (organiser.html). The tabs are
   the same small caps as the site's menu, underlined rather than boxed; the
   headings are in the display face so they do not read as tabs. Every tab a
   person may use is on the screen at every width, with no sideways scrolling,
   and the tabs read across and down in the order the arrow keys move.

   Phone: one grid, three across. A group is a block under its heading; a
   group of one or two tabs takes one or two of the three columns (data-count,
   kept up to date by organiser.js), so short groups share a row: a Door
   volunteer's Check-in, Walk-in and Claims are one row.
   From 640px: the groups sit side by side, each as wide as its words, and
   wrap onto a second line when the window is too narrow for one. One line
   from 1280px. */
.tabs { --tab-gap: var(--sp-2); display: flex; flex-wrap: wrap; column-gap: var(--tab-gap); margin-bottom: var(--sp-5); }
.tabgroup { min-width: 0; display: flex; flex-direction: column; border-bottom: 1px solid var(--hair); }
.tabgroup[hidden] { display: none; }
.tabgroup__label { padding-inline: var(--sp-2); font: italic 500 1rem/1.2 var(--font-display); color: var(--muted); }
.tabs button {
  min-width: 0; font-family: var(--font-body); font-size: .75rem; font-weight: 600; line-height: 1.2;
  letter-spacing: .08em; text-transform: uppercase; text-align: center; overflow-wrap: anywhere;
  padding: var(--sp-1) 2px;
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); cursor: pointer;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
/* Tabs sit edge to edge, so the focus ring is drawn inside the button. */
.tabs button:focus-visible { outline-offset: -4px; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
@media (max-width: 639px) {
  /* widths are a hair under the exact thirds, so rounding can never push a group onto the next row */
  .tabgroup { flex: 0 0 100%; padding-top: var(--sp-2); }
  .tabgroup[data-count="1"] { flex-basis: calc((100% - 2 * var(--tab-gap)) / 3 - .5px); }
  .tabgroup[data-count="2"] { flex-basis: calc((100% - 2 * var(--tab-gap)) / 3 * 2 + var(--tab-gap) - .5px); }
  .tabgroup__tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--tab-gap); grid-auto-rows: 44px; }
  .tabgroup[data-count="1"] .tabgroup__tabs { grid-template-columns: minmax(0, 1fr); }
  .tabgroup[data-count="2"] .tabgroup__tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 640px) {
  .tabs { --tab-gap: var(--sp-4); row-gap: var(--sp-3); }
  .tabgroup { flex: none; }
  .tabgroup__tabs { display: flex; }
  .tabs button { flex: none; height: 44px; white-space: nowrap; padding-inline: var(--sp-2); }
}
@media (min-width: 900px) {
  .tabs button { height: 46px; font-size: .8rem; letter-spacing: .16em; }
}
@media (min-width: 1366px) {
  .tabs { --tab-gap: var(--sp-5); }
  .tabgroup__label, .tabs button { padding-inline: 10px; }
}

.scanner { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.scanner__video { position: relative; aspect-ratio: 4/3; background: var(--ink); border-radius: var(--r-lg); overflow: hidden; display: grid; place-items: center; }
.scanner__video video { width: 100%; height: 100%; object-fit: cover; }
.scanner__reticle { position: absolute; inset: 18%; border: 3px solid var(--brand-ornament-soft); border-radius: var(--r-md); box-shadow: 0 0 0 100vmax rgba(18,10,8,.45); }
.scan-result { padding: var(--sp-5); border-radius: var(--r-lg); border: 1px solid var(--hair-soft); background: var(--surface); }
.scan-result[data-state="ok"]   { border-color: var(--ok);  background: var(--ok-bg); }
.scan-result[data-state="dupe"] { border-color: var(--warn);background: var(--warn-bg); }
.scan-result[data-state="bad"]  { border-color: var(--err); background: var(--err-bg); }

/* ------------------------------------------------------------------- stock --
   The Stock tab (temple-stock, ticket 02). Status colours reuse the booking
   app's own green, amber and red (--ok, --warn, --err and their -bg tints,
   book/assets/css/tokens.css) rather than a second set: the badges are the
   existing .badge--free / --low / --sold. */
.stock-cards { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: var(--sp-5); }
.stock-card {
  display: block; text-align: left; padding: var(--sp-4); background: var(--surface);
  border: 1px solid var(--hair-soft); border-radius: var(--r-lg); cursor: pointer; font: inherit; color: var(--ink);
}
.stock-card:hover { border-color: var(--accent); }
.stock-card.is-selected { background: var(--paper-2); border-color: var(--accent); }
.stock-card b { display: block; font-family: var(--font-display); font-size: var(--step-2); }
.stock-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin: var(--sp-3) 0 var(--sp-2); background: var(--surface-sunk); }
.stock-seg { display: block; height: 100%; }
.stock-seg--red { background: var(--err); }
.stock-seg--amber { background: var(--warn); }
.stock-seg--green { background: var(--ok); }
.stock-card__line { display: block; font-size: var(--step--1); color: var(--muted); }
.stock-text--red { color: var(--err); }
.stock-text--amber { color: var(--warn-ink); }
.stock-text--green { color: var(--ok); }
.stock-notice { padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4); border-radius: var(--r-md); background: var(--paper-2); color: var(--ink-soft, var(--ink)); }
.stock-notice p { margin: 0 0 var(--sp-2); }
.stock-notice p:last-child { margin-bottom: 0; }
.stock-notice--err { background: var(--err-bg); color: var(--err); }
.stock-notice--warn { background: var(--warn-bg); color: var(--warn-ink); margin: var(--sp-3) 0 0; }
.stock-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.stock-form { padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-5); border: 1px solid var(--hair-soft); border-radius: var(--r-lg); background: var(--surface); }
.stock-form__title { font-family: var(--font-display); font-size: var(--step-2); margin: 0; }
.stock-form__fields { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; margin-top: var(--sp-3); }
.stock-list { padding: var(--sp-4) var(--sp-5); border: 1px solid var(--hair-soft); border-radius: var(--r-lg); background: var(--surface); }
.stock-list__head { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.stock-chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.stock-chip { font: inherit; padding: .35em .9em; border: 1px solid var(--hair-soft); border-radius: var(--r-pill); background: transparent; color: var(--ink); cursor: pointer; }
.stock-chip:hover { border-color: var(--accent); }
.stock-chip.is-selected { background: var(--paper-2); border-color: var(--accent); }
.stock-group { font-family: var(--font-body); font-size: var(--t-small); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: var(--sp-5) 0 var(--sp-1); font-weight: 600; }
.stock-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr) 10rem; gap: var(--sp-4); align-items: center; padding: var(--sp-3) 0; border-top: 1px solid var(--hair-soft); }
.stock-row__side { display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-2); }
.stock-meter { position: relative; display: block; height: 6px; border-radius: 3px; background: var(--surface-sunk); margin-bottom: var(--sp-2); }
.stock-meter__fill { display: block; height: 6px; border-radius: 3px; }
.stock-meter__tick { position: absolute; top: -3px; left: 50%; width: 2px; height: 12px; background: var(--ink-soft, var(--ink)); }
.stock-festival { display: inline-flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-4); font-size: var(--step--1); color: var(--muted); cursor: pointer; }
.stock-addform { margin: var(--sp-4) 0; padding: var(--sp-4); border: 1px solid var(--hair-soft); border-radius: var(--r-md); background: var(--paper-2); }
.stock-err { margin: var(--sp-2) 0 0; min-height: 1.2em; font-size: var(--step--1); color: var(--err); }
.stock-panel { margin: 0 0 var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--paper-2); }
.stock-panel p { margin: 0 0 var(--sp-2); }
.stock-row__buttons { display: flex; gap: var(--sp-1); flex-wrap: wrap; justify-content: flex-end; }
.stock-activity { margin-top: var(--sp-5); }
.stock-act { display: flex; gap: var(--sp-3); flex-wrap: wrap; padding: var(--sp-2) 0; border-top: 1px solid var(--hair-soft); font-size: var(--step--1); }
.stock-act__when { min-width: 9.5rem; color: var(--muted); }
.stock-act__who { min-width: 5rem; color: var(--ink-soft, var(--ink)); }
.stock-act__what { flex: 1 1 14rem; }
.stock-act__what.is-undone { text-decoration: line-through; color: var(--muted); }
@media (max-width: 640px) {
  .stock-row { grid-template-columns: minmax(0, 1fr) 8rem; }
  .stock-row__meter { grid-column: 1 / -1; order: 3; }
}

/* ------------------------------------------------------------------ claims --
   The Claims tab (.scratch/expense-claims). Built for a phone first: big
   targets for the camera and the "who needs paying" choice, one column below
   640px. Status colours reuse the badges (.badge--soon, --early, --free, --sold). */
.cl-start { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: var(--sp-4); }
.cl-big {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 72px; padding: var(--sp-4); text-align: left;
  font: inherit; color: #FFFDF9; background: var(--brand-red, #75121A); border: 1px solid var(--brand-ornament, #B38F4A);
  border-radius: var(--r-lg); cursor: pointer; position: relative;
}
.cl-big svg { width: 28px; height: 28px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; }
.cl-big b { display: block; font-family: var(--font-display); font-size: var(--step-2); font-weight: 600; line-height: 1.15; }
.cl-big small { display: block; font-size: var(--step--1); opacity: .85; margin-top: 2px; }
.cl-big--quiet { color: var(--ink); background: var(--surface); border-color: var(--hair-soft); }
.cl-big:hover { filter: brightness(1.05); }
.cl-big:focus-within, .cl-big:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.cl-big input[type=file], .cl-file input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.cl-file { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: var(--sp-2); }
.cl-file svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.cl-seg { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-2); }
.cl-count { display: inline-block; min-width: 1.5em; padding: 0 .4em; margin-left: .2em; border-radius: var(--r-pill); background: var(--err); color: #fff; font-size: .8em; text-align: center; }
.cl-list { border: 1px solid var(--hair-soft); border-radius: var(--r-lg); background: var(--surface); margin-top: var(--sp-3); overflow: hidden; }
.cl-row { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--hair-soft); cursor: pointer; }
.cl-row:first-child { border-top: 0; }
.cl-row:hover, .cl-row:focus-visible { background: var(--paper-2); outline: none; }
.cl-row__main { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.cl-row__side { flex: none; }
.cl-amount { font-family: var(--font-body); font-weight: 600; font-size: 1.05em; font-variant-numeric: tabular-nums; margin-right: .25em; }
.cl-flags { display: flex; gap: var(--sp-1); flex-wrap: wrap; margin-top: var(--sp-2); }
.cl-tick { width: 22px; height: 22px; margin-top: 4px; flex: none; accent-color: var(--brand-red, #75121A); }
.cl-paybar {
  position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-end; justify-content: space-between;
  margin-top: var(--sp-4); padding: var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r-lg);
  box-shadow: 0 -6px 18px rgba(42, 35, 33, .08);
}
.cl-fields { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; flex: 1 1 320px; }
.cl-form { max-width: 640px; padding: var(--sp-4) var(--sp-5); border: 1px solid var(--hair-soft); border-radius: var(--r-lg); background: var(--surface); }
.cl-form .stock-form__title { margin-bottom: var(--sp-3); }
.cl-snap { display: grid; gap: var(--sp-2); justify-items: start; margin-bottom: var(--sp-4); }
.cl-snap .cl-big { position: relative; overflow: hidden; }
.cl-thumbs { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin: 0 0 var(--sp-4); }
.cl-thumb {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 92px; padding: 0; font: inherit;
  background: transparent; border: 0; color: var(--muted); cursor: pointer;
}
.cl-thumb img, .cl-pdf { width: 92px; height: 92px; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--hair-soft); background: var(--surface-sunk); }
.cl-pdf { display: grid; place-items: center; font-weight: 600; letter-spacing: .1em; color: var(--ink); }
.cl-thumb small { font-size: var(--step--1); }
.cl-thumb__x {
  position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--ink); color: #fff; font-size: 18px; line-height: 28px; padding: 0;
}
.cl-pound { display: flex; align-items: center; gap: var(--sp-2); }
.cl-pound span { font-family: var(--font-display); font-size: 2rem; color: var(--muted); }
.field .cl-pound input { font-size: 1.75rem; font-family: var(--font-display); max-width: 12rem; }
.cl-chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.cl-chip { font: inherit; min-height: 44px; padding: .45em 1em; border: 1px solid var(--hair-soft); border-radius: var(--r-pill); background: transparent; color: var(--ink); cursor: pointer; }
.cl-chip.is-selected { background: var(--brand-red, #75121A); border-color: var(--brand-red, #75121A); color: #FFFDF9; }
.cl-pay { border: 0; padding: 0; margin: 0 0 var(--sp-4); display: grid; gap: var(--sp-2); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cl-pay legend { margin-bottom: var(--sp-2); }
.cl-paycard {
  display: grid; gap: 2px; padding: var(--sp-3) var(--sp-4); min-height: 64px; border: 1px solid var(--hair-soft); border-radius: var(--r-md);
  cursor: pointer; background: var(--surface); position: relative;
}
.cl-paycard input { position: absolute; opacity: 0; pointer-events: none; }
.cl-paycard b { font-weight: 600; }
.cl-paycard span { font-size: var(--step--1); color: var(--muted); }
.cl-paycard.is-selected { border: 2px solid var(--brand-red, #75121A); background: var(--paper-2); }
.cl-paycard:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.cl-more { margin: 0 0 var(--sp-4); }
.cl-more summary { cursor: pointer; color: var(--accent); padding: var(--sp-2) 0; min-height: 44px; display: flex; align-items: center; }
.cl-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; margin: var(--sp-4) 0; }
.cl-detail { max-width: 720px; margin-top: var(--sp-3); padding: var(--sp-4) var(--sp-5); border: 1px solid var(--hair-soft); border-radius: var(--r-lg); background: var(--surface); }
.cl-detail__amount { margin: 0; font-family: var(--font-display); font-size: var(--step-4, 2.2rem); }
.cl-dl { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: var(--sp-2) var(--sp-4); margin: var(--sp-4) 0; }
.cl-dl dt { color: var(--muted); font-size: var(--step--1); letter-spacing: .08em; text-transform: uppercase; padding-top: 2px; }
.cl-dl dd { margin: 0; overflow-wrap: anywhere; }
.cl-track { display: flex; list-style: none; margin: var(--sp-4) 0 var(--sp-2); padding: 0; counter-reset: step; }
.cl-track li { flex: 1 1 0; position: relative; padding-top: 28px; text-align: center; font-size: var(--step--1); color: var(--muted); }
.cl-track li::before {
  content: ""; position: absolute; top: 4px; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%;
  border: 2px solid var(--hair); background: var(--surface); z-index: 1;
}
.cl-track li::after { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--hair); }
.cl-track li:first-child::after { content: none; }
.cl-track li.is-done { color: var(--ink); font-weight: 600; }
.cl-track li.is-done::before { background: var(--ok); border-color: var(--ok); }
.cl-track li.is-done::after { background: var(--ok); }
.cl-track li.is-stop { color: var(--err); font-weight: 600; }
.cl-track li.is-stop::before { background: var(--err); border-color: var(--err); }
.cl-booksbar { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: flex-end; margin-bottom: var(--sp-4); }
.cl-booksbar svg, .cl-big--quiet svg { stroke: currentColor; fill: none; stroke-width: 2; }
.cl-booksbar .btn svg { width: 14px; height: 14px; vertical-align: -2px; }
.cl-stats { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: var(--sp-4); }
.cl-stat { padding: var(--sp-3) var(--sp-4); border: 1px solid var(--hair-soft); border-radius: var(--r-md); background: var(--surface); }
.cl-stat b { display: block; font-family: var(--font-display); font-size: var(--step-2); }
.cl-stat span { font-size: var(--step--1); color: var(--muted); }
.cl-book { margin-bottom: var(--sp-4); }
.cl-bar { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 6.5rem; gap: var(--sp-3); align-items: center; padding: 6px 0; font-size: var(--step--1); }
.cl-bar__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-bar__track { display: block; height: 10px; border-radius: 5px; background: var(--surface-sunk); overflow: hidden; }
.cl-bar__fill { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.cl-bar__sum { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .cl-form, .cl-detail { padding: var(--sp-3) var(--sp-4); }
  .cl-dl { grid-template-columns: 1fr; gap: 0 0; }
  .cl-dl dd { margin-bottom: var(--sp-2); }
  .cl-bar { grid-template-columns: minmax(0, 1fr) 5.5rem; }
  .cl-bar__track { grid-column: 1 / -1; order: 3; }
  .cl-row { padding: var(--sp-3); }
  /* on a phone the bar would cover the list it acts on, so it sits under it instead */
  .cl-paybar { position: static; box-shadow: none; }
}

/* ----------------------------------------------------------- dashboard helpers --
   What used to be inline `style="…"` attributes in organiser.js and auth.js
   (organiser-shell, ticket 06), kept as named classes so the stylesheet owns
   the spacing and the markup says what a thing is. The `u-` ones are single-job
   helpers and, like the inline styles they replace, win over other rules. The
   only inline styles left are genuinely dynamic (a bar's width as a percentage). */
.u-m0 { margin: 0 !important; }
/* A heading that keeps the size of the level below it. The dashboard's page
   title is the only level 1, so the first heading on a tab is a level 2 and
   the ones under it level 3: these keep them looking as they always have. */
.u-h3 { font-size: var(--step-2); }
.u-h4 { font-size: var(--step-1); }
.u-mt-2 { margin-top: var(--sp-2) !important; }
.u-mt-3 { margin-top: var(--sp-3) !important; }
.u-mt-4 { margin-top: var(--sp-4) !important; }
.u-mt-5 { margin-top: var(--sp-5) !important; }
.u-mb-2 { margin-bottom: var(--sp-2) !important; }
.u-mb-3 { margin-bottom: var(--sp-3) !important; }
.u-mb-4 { margin-bottom: var(--sp-4) !important; }
.u-my-3 { margin-block: var(--sp-3) !important; }
.u-prose { max-width: 60ch; }
.is-dim { opacity: .55; }

.rowhead { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; }
.rowhead--center { align-items: center; }
.btnrow { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.btnrow--tight { gap: var(--sp-2); }
.listbar { display: flex; gap: var(--sp-3); align-items: center; margin-bottom: var(--sp-4); flex-wrap: wrap; }
.table--sm { min-width: 520px; }
.table--lg { min-width: 760px; }
.stat--note { margin-bottom: var(--sp-4); border: 1px solid var(--accent); }
.historylist { margin: var(--sp-2) 0 0; padding-left: 1.1em; }
.historylist li { margin-bottom: var(--sp-2); }
.search--narrow { max-width: 320px; }
.scanner__placeholder { padding: var(--sp-5); text-align: center; color: #C4A794; }
.field input.input--code, .input--code { text-transform: uppercase; font-family: var(--font-mono); }
.recent__row { padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); }
.field-note { margin-top: calc(var(--sp-3) * -1); margin-bottom: var(--sp-3); }
.grid-2--start { align-items: start; }
.grid-2--end { align-items: end; margin: 0; }
.passcode-shown { font-size: 1.3em; letter-spacing: .08em; margin: 0 0 var(--sp-3); }

/* ---------------------------------------------------- type and touch floor --
   On the staff dashboard nothing is set below 12px and anything a finger uses
   is at least 44px tall. Scoped to the dashboard (main.dash: the public booking page's <main> is
   also id="main", so the id is not used) and the staff bar, so the public
   booking pages that share .btn--sm are untouched. */
main.dash .btn--sm, .staffbar .btn--sm { min-height: 44px; }
/* .btn--quiet is already 14px; only the outlined and solid small buttons were under 12px. */
main.dash .btn--sm:not(.btn--quiet) { font-size: .8rem; }
main.dash .field input:not([type="checkbox"]):not([type="radio"]), main.dash .field select, main.dash td select { min-height: 44px; }
.money > summary, .stock-chip { min-height: 44px; }
.money > summary { display: flex; align-items: center; }

/* The same floor on the public booking page (booking-page ticket 07): no text below
   12px (the eyebrows, the card's month and .btn--sm above), and on a phone everything
   a finger uses is at least 44px: the quantity buttons and the round Back and Close
   buttons above, and here the chips, the small buttons in My bookings, the sort menu
   and the fold-out questions. Spacing outside them is unchanged. */
.faq details { padding-block: var(--sp-2); }
.faq summary { min-height: 44px; align-items: center; padding-block: var(--sp-2); }
#drawer-body details > summary, #bookings-body details > summary { display: flex; align-items: center; min-height: 44px; }
@media (max-width: 699px) {
  .chip, .select { min-height: 44px; }
  #bookings-drawer .btn--sm, #event-drawer .btn--sm, #event-drawer .btn--quiet { min-height: 44px; }
}

/* ------------------------------------------------------------------ print -- */
/* Printing from the confirmation step gives a clean ticket sheet. */
@media print {
  /* chrome.css hides .site-head, .site-drawer and .foot for print already. */
  .hero, .filters, .scrim, .toasts,
  .drawer__head, .drawer__foot, .steps, .section:not(#events),
  [data-action], .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .drawer {
    position: static !important; width: 100% !important; box-shadow: none !important;
    transform: none !important; height: auto !important;
  }
  .drawer__body { overflow: visible !important; padding: 0 !important; }
  .ticket {
    break-inside: avoid; page-break-inside: avoid;
    border: 1px solid #999 !important; background: #fff !important;
  }
  .ticket__qr { background: #fff !important; }
  .detail__hero, .detail__about, .prose, .stub-note, .confirm-hero__tick { display: none !important; }
  .summary, .detail__facts { background: #fff !important; border: 1px solid #ccc; }
  a[href]::after { content: ""; }
}

/* ------------------------------------------------------------------ embedded --
   The Services page opens the services booking in a frame over itself (?embed=1), so a
   devotee stays on that page. Inside the frame only the drawer is shown: the booking
   page behind it is hidden, and the frame's own backdrop is clear (the Services page
   dims itself behind the frame). */
html.embed, html.embed body { background: transparent !important; }
html.embed body > *:not(.drawer):not(.scrim):not(.toasts) { display: none !important; }
html.embed .scrim { background: transparent !important; }


/* ------------------------------------------------- the Services tab (dashboard) --
   One voice throughout: a small letterspaced label above each control (as in every .field),
   boxes of one height, figures in one weight with the label beneath, and buttons of one size. */
.svc-filters {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--sp-3);
  align-items: start; margin-bottom: var(--sp-4);
}
.svc-filters .field, .svc-form .field { margin-bottom: 0; align-content: start; }
.svc-filters .field input:focus, .svc-form .field input:focus { border-color: var(--accent); }
.svc-filters__check { align-self: end; height: 48px; align-items: center; }
.svc-filters__check label { text-transform: none; letter-spacing: normal; font-size: var(--step-0); font-weight: 500; color: var(--text); }

.svc-stats {
  display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-6);
  padding: var(--sp-4); margin-bottom: var(--sp-3);
  background: var(--surface-sunk); border-radius: var(--r-md);
}
.svc-stat { display: grid; gap: .15rem; align-content: start; }
.svc-stat b { font-family: var(--font-display); font-size: var(--step-2); font-weight: 500; line-height: 1.1; color: var(--text); font-variant-numeric: lining-nums tabular-nums; }
.svc-stat span { font-size: var(--t-small); font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.svc-stat small { font-size: var(--step--1); color: var(--text-muted); }
.svc-stat--alert b { color: var(--err); }

.svc-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.svc-actions--bar { margin-bottom: var(--sp-4); }
.svc-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: .55em; min-height: 38px; line-height: 1; }
.svc-actions .btn svg { flex: none; }

.svc-when { font-weight: 500; color: var(--text); }

/* The Services list (redesigned): the three lanes, a toolbar of filter chips, headings that sort, and the preferred
   date as a date tile, so the date a devotee asked for is in the list and not only in the details. */
.svc-lanes { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.svc-lane {
  min-height: 44px; padding: 0 var(--sp-4); border: 1px solid var(--hair); border-radius: var(--r-pill);
  background: var(--surface); color: var(--text); font: inherit; font-size: var(--t-small); font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
}
.svc-lane:hover { border-color: var(--accent); }
.svc-lane.is-on { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.svc-lane__n { font-variant-numeric: tabular-nums; opacity: .75; margin-left: .25em; }

.svc-toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; justify-content: space-between; margin-bottom: var(--sp-4); }
.svc-toolbar__filters, .svc-toolbar__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.svc-chip, .svc-toggle {
  min-height: 36px; padding: 0 var(--sp-3); border-radius: var(--r-pill); font: inherit; font-size: var(--step--1);
  border: 1px solid var(--hair); background: var(--surface); color: var(--text); cursor: pointer;
}
.svc-chip { border-color: var(--accent); background: var(--accent-soft); font-weight: 500; }
.svc-chip span { font-weight: 700; margin-left: .25em; }
.svc-toggle[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.svc-table { min-width: 980px; }
.svc-table tbody tr[data-svc-open] { cursor: pointer; }
.svc-table tbody tr[data-svc-open]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.svc-sort {
  display: inline-flex; align-items: center; gap: .35em; min-height: 44px; padding: 0; border: 0; background: none;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer;
}
.svc-sort__arrow { font-size: .7em; opacity: .55; }
.svc-sort.is-on { color: var(--text); }
.svc-sort.is-on .svc-sort__arrow { opacity: 1; color: var(--accent); }

.svc-date { display: flex; align-items: baseline; gap: .4em; line-height: 1; }
.svc-date b { font-family: var(--font-display); font-size: var(--step-2); font-weight: 500; color: var(--text); font-variant-numeric: lining-nums tabular-nums; }
.svc-date span { font-size: var(--t-small); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.svc-date--soon b { color: var(--warn-ink); }
.svc-date--past b { color: var(--err); }
.svc-date__sub { margin-top: .3rem; font-size: var(--step--1); color: var(--text-muted); white-space: nowrap; }
.svc-date__more { font-size: var(--step--1); color: var(--text-faint); }

.svc-who__name { font-weight: 600; color: var(--text); }
.svc-ref { margin: .1rem 0 .25rem; font-size: var(--step--1); color: var(--text-muted); }
.svc-contact { font-size: var(--step--1); line-height: 1.5; overflow-wrap: anywhere; }
.svc-table td:nth-child(2) { min-width: 230px; }

/* The waiting bar: how long a request has waited for a date. Calm to two days, amber to six, red from a week. */
.svc-wait { margin-top: .4rem; width: 100%; max-width: 160px; height: 8px; border-radius: var(--r-pill); background: var(--surface-sunk); overflow: hidden; }
.svc-wait__fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.svc-wait--warn .svc-wait__fill { background: var(--warn); }
.svc-wait--err .svc-wait__fill { background: var(--err); }
.svc-wait__words { display: block; margin-top: .25rem; font-size: var(--step--1); color: var(--text-muted); white-space: nowrap; }
.svc-table td:nth-child(5) { min-width: 170px; }
.svc-wait--warn + .svc-wait__words { color: var(--warn); font-weight: 600; }
.svc-wait--err + .svc-wait__words { color: var(--err); font-weight: 600; }

/* The organiser's pages use the width of the screen (up to 1680px), not the public site's 1240px: the lists are wide tables. */
main.dash > .container, .staffbar > .container { max-width: 1680px; }

.svc-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-3); }
.svc-form--offering { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.svc-form__wide { grid-column: 1 / -1; }
.svc-form-title { margin: 0 0 var(--sp-3); font-size: var(--step-1); }

/* The request panel (Services tab): a side drawer, a bottom sheet on a phone. The next step is the first thing in it. */
.svcdrawer { width: min(540px, 100%); }
.svcdrawer__who { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.svcdrawer__who h2 { flex: 0 1 auto; font-size: var(--step-1); overflow-wrap: anywhere; }
.svcdrawer .drawer__head { gap: var(--sp-2); }
.svcdrawer .drawer__body { padding: var(--sp-4) var(--sp-5) var(--sp-6); }
.svcdrawer__foot .svc-actions .btn { flex: 1 1 140px; }
.svc-sheet__next { margin: 0 0 var(--sp-4); padding: var(--sp-3) var(--sp-4); background: var(--accent-soft); border-radius: var(--r-md); font-weight: 500; line-height: 1.45; }
.svc-sheet__h { margin: var(--sp-5) 0 var(--sp-2); font-size: var(--step-0); }
.svc-sheet__notice { margin: 0 0 var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); line-height: 1.45; }
.svc-sheet__notice--ok { background: var(--ok-bg); color: var(--ok); }
.svc-sheet__notice--warn { background: var(--warn-bg); color: var(--warn); }
.svc-sheet__notice--err { background: var(--err-bg); color: var(--err); }
.svc-sheet__history { margin-top: var(--sp-4); }
.svc-sheet__history > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 500; }
.svc-sheet__danger { margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.svcdrawer .summary a { overflow-wrap: anywhere; }
/* the panel is outside main.dash, so the staff touch floor is stated here too */
.svcdrawer .btn, .svcdrawer .btn--sm, .svcdrawer .icon-btn, .svcdrawer .field input:not([type="checkbox"]):not([type="radio"]) { min-height: 44px; }
.svcdrawer .icon-btn { min-width: 44px; }

/* The event editor's sections: a heading you can see, set off from the one before it. */
#event-form > h3 { font-size: var(--step-2); margin: var(--sp-6) 0 var(--sp-4); padding-top: var(--sp-5); border-top: 1px solid var(--line); }
#event-form > h3:first-of-type { margin-top: var(--sp-4); padding-top: 0; border-top: 0; }

/* The actions at the end of a table row (Edit, Delete, View): one quiet row, not a stack. */
.row-actions { display: flex; flex-wrap: nowrap; gap: var(--sp-1); align-items: center; justify-content: flex-end; white-space: nowrap; }

/* "I'm coming" box for events with no booking needed (household-headcount H05) */
.signup-sizes { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.signup-size { min-width: 3rem; min-height: 2.75rem; padding: 0 var(--sp-3); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.signup-size[aria-checked="true"] { border: 2px solid var(--accent); background: var(--accent-soft); }
.signup-size:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
.signup-count { font-weight: 600; min-height: 1.5em; }
.signup-status { min-height: 1.5em; }
.signup-saved { margin-top: var(--sp-4); }
