/* ==========================================================================
   Al Leone UI kit: "Soft tactile".
   One stylesheet for the organizer admin and the standard event theme
   (event page, checkout sheet, my tickets). Custom themes (the launch camp)
   keep base.css + public.css and never load this file.

   Layers: white cards float on a faint lavender-grey ground, lifted by soft
   multi-layer shadows and a 1px inner highlight. Neutrals stay quiet; one
   accent colours actions and selection. Motion only on hover, press, open.

   Contents
     1. Tokens            7. Navigation        13. Sheets
     2. Accents           8. Surfaces          14. Events and posters
     3. Base              9. Tables            15. Tickets, price, capacity
     4. App shell        10. Pills, feedback   16. Public event page
     5. Buttons          11. Menus, avatars    17. Loading
     6. Forms            12. ui.js widgets     18. Utilities, motion
   Docs: docs/ui-kit.md. Living guide: GET /dev/ui (development only).
   ========================================================================== */

@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/plus-jakarta-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/plus-jakarta-sans-500.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/plus-jakarta-sans-600.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/plus-jakarta-sans-700.woff2") format("woff2"); }

/* ---------------------------------------------------------------- 1. Tokens
   Components use only these names. A dark theme is a second block that
   redefines the colour, surface and shadow tokens (e.g. [data-theme="dark"]). */
:root {
  /* Surfaces, lowest to highest */
  --ground: #f3f2f8;            /* page */
  --well: #eae8f2;              /* sunken: segmented track, meter track */
  --surface-2: #f8f7fc;         /* quiet fill: table head, hover rows */
  --surface: #ffffff;           /* cards, controls */
  --glass: rgba(255, 255, 255, .72);
  --glass-blur: saturate(1.6) blur(16px);
  --scrim: rgba(24, 17, 52, .40);

  /* Ink */
  --ink: #1d1b26;
  --ink-2: #474456;
  --muted: #6f6c82;
  --faint: #a5a2b6;
  --line: #e9e7f0;
  --line-strong: #d8d5e3;
  --highlight: rgba(255, 255, 255, .9);

  /* Status */
  --ok: #1a7446;       --ok-soft: #e2f6ea;
  --warn: #8f5400;     --warn-soft: #fff2dc;
  --danger: #c22f4b;   --danger-soft: #fdeaee;   --danger-hi: #e3506a;  --danger-lo: #bf2b47;
  --info: #2257d6;     --info-soft: #e8effe;

  /* Radius */
  --r-xs: 6px; --r-sm: 9px; --r-md: 12px; --r-lg: 18px; --r-xl: 22px; --r-pill: 999px;

  /* Spacing (4px base) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 48px; --s-9: 64px;

  /* Type */
  /* Plus Jakarta Sans (the subset we ship) is Latin only: no Cyrillic, Thai
     or CJK. Other scripts come from system fonts (the CSP allows no external
     fonts). The :lang() blocks after the tokens reorder the stack per
     admin language (ADR 0006). */
  --font-system: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  --font-thai: "Noto Sans Thai", "Thonburi", "Leelawadee UI";
  --font-sc: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC";
  --font: "Plus Jakarta Sans", var(--font-system), var(--font-thai), var(--font-sc), sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 11.5px; --fs-sm: 12.5px; --fs-base: 14px; --fs-md: 15px; --fs-lg: 17px; --fs-xl: 21px; --fs-2xl: 28px; --fs-3xl: 38px;

  /* Elevation. --shadow-rgb tints every shadow slightly violet. */
  --shadow-rgb: 40 20 90;
  --ring: 0 0 0 1px rgb(var(--shadow-rgb) / .055);
  --e-1: inset 0 1px 0 var(--highlight), var(--ring), 0 1px 2px rgb(var(--shadow-rgb) / .04), 0 12px 28px -18px rgb(var(--shadow-rgb) / .30);
  --e-2: inset 0 1px 0 var(--highlight), 0 0 0 1px rgb(var(--shadow-rgb) / .075), 0 2px 5px rgb(var(--shadow-rgb) / .05), 0 20px 38px -18px rgb(var(--shadow-rgb) / .40);
  --e-3: inset 0 1px 0 var(--highlight), 0 0 0 1px rgb(var(--shadow-rgb) / .07), 0 4px 10px -2px rgb(var(--shadow-rgb) / .08), 0 24px 48px -12px rgb(var(--shadow-rgb) / .28);
  --e-4: inset 0 1px 0 var(--highlight), 0 0 0 1px rgb(var(--shadow-rgb) / .06), 0 32px 80px -12px rgb(var(--shadow-rgb) / .42);
  --e-control: 0 1px 2px rgb(var(--shadow-rgb) / .05);

  /* Motion */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur-1: .12s; --dur-2: .2s;

  /* Layout */
  --page: 880px; --page-wide: 1060px; --control-h: 38px;

  /* Icons used as masks or backgrounds (img-src allows data:). */
  --i-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  --i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.5 8.5 3 3 6-7'/%3E%3C/svg%3E");
  --i-check-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.5 8.5 3 3 6-7'/%3E%3C/svg%3E");
  --i-check-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%232a1d00' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.5 8.5 3 3 6-7'/%3E%3C/svg%3E");
  --i-calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round'%3E%3Crect x='2.2' y='3.2' width='11.6' height='10.6' rx='2.6'/%3E%3Cpath d='M5.2 1.8v2.8M10.8 1.8v2.8M2.4 6.8h11.2'/%3E%3C/svg%3E");
  --accent-check: var(--i-check-light);
}

/* --------------------------------------------------------------- 2. Accents
   The CSP forbids inline styles, so an accent is a class: acc-<name> (or the
   older accent-<name>) on <body> or on any element. Each accent sets three
   hand-tuned values; everything else is derived in the shared rule below.
   Names mirror events.Accents. The default (no class) is violet. */
:root, .acc-violet, .accent-violet { --accent: #6b4cf6; --accent-text: #5a3ee0; --accent-ink: #fff; }
.acc-blue, .accent-blue     { --accent: #2a63e6; --accent-text: #2257d6; --accent-ink: #fff; }
.acc-teal, .accent-teal     { --accent: #0a7770; --accent-text: #0a6c66; --accent-ink: #fff; }
.acc-green, .accent-green   { --accent: #1f783a; --accent-text: #1e6e36; --accent-ink: #fff; }
.acc-amber, .accent-amber   { --accent: #f0a81e; --accent-text: #8a5c06; --accent-ink: #2a1d00; --accent-check: var(--i-check-dark); }
.acc-orange, .accent-orange { --accent: #c2410f; --accent-text: #b03f10; --accent-ink: #fff; }
.acc-rose, .accent-rose     { --accent: #cf2f68; --accent-text: #b3245a; --accent-ink: #fff; }
.acc-slate, .accent-slate   { --accent: #454c5c; --accent-text: #3d4451; --accent-ink: #fff; }
.acc-violet, .acc-blue, .acc-teal, .acc-green, .acc-orange, .acc-rose, .acc-slate,
.accent-violet, .accent-blue, .accent-teal, .accent-green, .accent-orange, .accent-rose, .accent-slate { --accent-check: var(--i-check-light); }

:root,
.acc-violet, .acc-blue, .acc-teal, .acc-green, .acc-amber, .acc-orange, .acc-rose, .acc-slate,
.accent-violet, .accent-blue, .accent-teal, .accent-green, .accent-amber, .accent-orange, .accent-rose, .accent-slate {
  --accent-hi: color-mix(in srgb, var(--accent) 94%, #fff);       /* gradient top; keeps --accent-ink at 4.5:1 or better */
  --accent-lo: color-mix(in srgb, var(--accent) 84%, #000);       /* gradient bottom */
  --accent-soft: color-mix(in srgb, var(--accent) 11%, #fff);     /* tinted fill */
  --accent-line: color-mix(in srgb, var(--accent) 30%, #fff);     /* tinted border */
  --accent-glow: color-mix(in srgb, var(--accent) 60%, transparent);
  --accent-halo: color-mix(in srgb, var(--accent) 18%, transparent); /* focus ring */
  --accent-deep: color-mix(in srgb, var(--accent) 46%, #0e0a26);  /* mesh and wash base */
  --mesh-warm: color-mix(in srgb, #ffb38a 80%, var(--accent));
  --mesh-cool: color-mix(in srgb, #9ee6ff 72%, var(--accent));
  --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -1px 0 rgba(0, 0, 0, .10), 0 1px 2px color-mix(in srgb, var(--accent) 40%, transparent), 0 8px 16px -8px var(--accent-glow);
}

/* Per-language type (ADR 0006). Thai and Chinese keep Plus Jakarta Sans for
   Latin text and digits and take their own script from the system. Russian
   uses the system font throughout, so Latin and Cyrillic never mix faces. */
:root:lang(th) { --font: "Plus Jakarta Sans", var(--font-thai), var(--font-system), sans-serif; }
:root:lang(zh) { --font: "Plus Jakarta Sans", var(--font-sc), var(--font-system), sans-serif; }
:root:lang(ru) { --font: var(--font-system), sans-serif; }

/* ------------------------------------------------------------------ 3. Base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink);
  font: 400 var(--fs-base)/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(900px 360px at 12% -140px, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%),
    radial-gradient(760px 320px at 92% -160px, color-mix(in srgb, var(--mesh-cool) 20%, transparent), transparent 70%),
    var(--ground);
  background-repeat: no-repeat;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: var(--fs-2xl); line-height: 1.12; letter-spacing: -.025em; }
h2 { font-size: var(--fs-lg); letter-spacing: -.015em; }
h3 { font-size: var(--fs-md); letter-spacing: -.01em; }
p { margin: 0 0 var(--s-3); }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
strong, b { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-4) 0; }
kbd { font: 600 10.5px var(--mono); color: var(--muted); background: var(--surface); border-radius: 5px; padding: 1px 5px; box-shadow: 0 0 0 1px var(--line-strong), 0 1px 0 var(--line-strong); }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------- 4. App shell */
/* Brand. One class, so the PNG can be swapped for an SVG later. The source
   is a white wordmark: on light surfaces it is flattened to ink. */
.brand { display: inline-flex; align-items: center; flex: none; border-radius: var(--r-sm); }
.brand-logo { display: block; height: 19px; width: auto; filter: brightness(0); opacity: .9; }
.brand-logo.lg { height: 26px; }
.on-dark .brand-logo, .brand-logo.on-dark { filter: none; opacity: 1; }

/* Admin top bar: a floating glass strip. */
.topnav { position: sticky; top: 0; z-index: 30; padding: 14px var(--s-4) 0; }
.topnav-in {
  max-width: calc(var(--page-wide) + 40px); margin: 0 auto; display: flex; align-items: center; gap: var(--s-3);
  padding: 10px 10px 10px 22px; border-radius: var(--r-xl);
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 var(--highlight), var(--ring), 0 10px 24px -16px rgb(var(--shadow-rgb) / .35);
}
.topnav .brand-logo { height: 21px; }
.topnav-links { display: flex; gap: 4px; flex: 1; min-width: 0; margin-left: var(--s-5); }
.topnav-links a { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 12px; color: var(--muted); font-size: var(--fs-base); font-weight: 600; white-space: nowrap; transition: background var(--dur-1), color var(--dur-1); }
.topnav-links a svg { width: 18px; height: 18px; flex: none; }
.topnav-links a:hover { color: var(--ink); background: rgb(var(--shadow-rgb) / .05); text-decoration: none; }
.topnav-links a[aria-current="page"] { color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.topnav-right { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }
.btn.topnav-cta { height: 42px; padding: 0 16px; border-radius: 12px; font-size: 13.5px; }
.topnav .avatar { width: 40px; height: 40px; font-size: 13px; }
.topnav-mark { display: none; }

/* Admin tab bar: the sections at the bottom of the screen on phones.
   Hidden on wider screens, where .topnav-links carries them. */
.tabbar { display: none; gap: 4px; padding: 6px; border-radius: var(--r-xl);
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 var(--highlight), var(--ring), 0 18px 36px -14px rgb(var(--shadow-rgb) / .45); }
.tabbar a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 56px; padding: 0 2px; border-radius: 16px;
  color: var(--muted); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; transition: background var(--dur-1), color var(--dur-1); }
.tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tabbar a svg { width: 22px; height: 22px; flex: none; }
.tabbar a:hover { color: var(--ink); text-decoration: none; }
.tabbar a[aria-current="page"] { color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }

@media (max-width: 640px) {
  .topnav { padding: 8px 10px 0; }
  .topnav-in { padding: 8px 8px 8px 16px; gap: var(--s-2); border-radius: var(--r-lg); }
  .topnav .brand-logo { height: 18px; }
  .topnav-cta span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .btn.topnav-cta { width: 40px; padding: 0; }
  /* With a tab bar the sections leave the top bar. Staff (one section) have no tab bar and keep the icon links. */
  .has-tabbar .topnav-links { display: none; }
  .topnav-links { margin-left: var(--s-1); justify-content: center; }
  .topnav-links a { width: 40px; padding: 0; justify-content: center; }
  .topnav-links a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tabbar { display: flex; position: fixed; z-index: 30; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .has-tabbar .main { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .has-sheet .tabbar, body:has(> .sheet) .tabbar { display: none; }
}

/* Page container and header */
.main { width: 100%; max-width: var(--page-wide); min-width: 0; margin: 0 auto; padding: var(--s-7) var(--s-5) 96px; }
/* Every admin page has the same content width (no jumping between pages); .main-wide is kept as a no-op alias. */
.main-wide { max-width: var(--page-wide); }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-3) var(--s-4); margin-bottom: var(--s-6); }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-actions, .actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.actions-row form, .page-actions form { margin: 0; }
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-3); margin-bottom: var(--s-4); }
.toolbar-note { margin: 0; max-width: 62ch; color: var(--muted); }
.event-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-4); margin-bottom: var(--s-2); }
.event-head-main { min-width: 0; }
.event-head h1 { margin: 8px 0 4px; }
.event-head p { margin: 0; color: var(--muted); }
.event-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
@media (max-width: 640px) {
  .main { padding: var(--s-5) var(--s-4) 72px; }
  h1 { font-size: 24px; }
  .event-head { flex-direction: column; }
}

/* Sign-in */
body.admin-auth { display: grid; place-items: center; padding: var(--s-4); }
.auth-card { width: min(400px, 100%); background: var(--surface); border-radius: var(--r-xl); padding: var(--s-7); box-shadow: var(--e-2); }
.auth-card .brand { margin-bottom: var(--s-6); }
.auth-card h1 { font-size: var(--fs-xl); margin-bottom: 6px; }
.auth-card .btn { width: 100%; }

/* Public top bar and footer (standard theme) */
.topbar { position: sticky; top: 0; z-index: 20; padding: 10px var(--s-3) 0; }
.topbar-in { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: 8px 8px 8px 18px; border-radius: var(--r-lg);
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 var(--highlight), var(--ring), 0 10px 24px -16px rgb(var(--shadow-rgb) / .35); }
.topbar-brand { display: inline-flex; align-items: center; gap: var(--s-2); min-width: 0; color: var(--ink); font-weight: 600; }
.topbar-brand:hover { text-decoration: none; }
.topbar-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-link { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: var(--r-pill); color: var(--ink-2); font-size: 13px; font-weight: 600; white-space: nowrap; background: rgb(var(--shadow-rgb) / .05); transition: background var(--dur-1); }
.topbar-link:hover { background: rgb(var(--shadow-rgb) / .09); text-decoration: none; }
.foot { margin-top: var(--s-9); border-top: 1px solid var(--line); }
.foot-in { max-width: 1080px; margin: 0 auto; padding: var(--s-5); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-6); color: var(--muted); font-size: var(--fs-sm); }
.foot nav { display: flex; gap: var(--s-4); }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--ink); }
.foot .brand-logo { height: 14px; opacity: .55; }
.preview-banner { position: relative; z-index: 21; background: var(--ink); color: #fff; text-align: center; padding: 8px var(--s-4); font-size: var(--fs-sm); font-weight: 500; }

/* ---------------------------------------------------------------- 5. Buttons
   .btn is the secondary button. Add .primary (one per view), .ghost, .soft
   or .danger. Sizes: .sm, .lg. Shapes: .icon (square), .btn-block. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: none;
  height: var(--control-h); padding: 0 15px; border: 0; border-radius: var(--r-md);
  font: 600 13.5px/1 var(--font); letter-spacing: -.005em; white-space: nowrap; text-decoration: none; cursor: pointer; user-select: none;
  color: var(--ink); background: var(--surface);
  box-shadow: inset 0 1px 0 var(--highlight), 0 0 0 1px var(--line-strong), 0 1px 2px rgb(var(--shadow-rgb) / .06), 0 4px 8px -6px rgb(var(--shadow-rgb) / .25);
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1), background var(--dur-1), filter var(--dur-1), color var(--dur-1);
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { text-decoration: none; background: var(--surface-2); box-shadow: inset 0 1px 0 var(--highlight), 0 0 0 1px var(--faint), 0 2px 4px rgb(var(--shadow-rgb) / .07), 0 8px 14px -8px rgb(var(--shadow-rgb) / .3); }
.btn:active { transform: translateY(1px) scale(.985); box-shadow: 0 0 0 1px var(--line-strong), inset 0 1px 2px rgb(var(--shadow-rgb) / .10); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; filter: none; }

.btn.primary, .btn-accent, .checkout-submit, .checkout-actions .primary {
  color: var(--accent-ink); background: linear-gradient(180deg, var(--accent-hi), var(--accent-lo)); box-shadow: var(--btn-shadow);
}
.btn.primary:hover, .btn-accent:hover, .checkout-submit:hover, .checkout-actions .primary:hover { background: linear-gradient(180deg, var(--accent-hi), var(--accent-lo)); filter: brightness(1.06) saturate(1.05); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -1px 0 rgba(0, 0, 0, .10), 0 2px 3px color-mix(in srgb, var(--accent) 40%, transparent), 0 12px 20px -8px var(--accent-glow); }
.btn.primary:active, .btn-accent:active, .checkout-submit:active, .checkout-actions .primary:active { transform: translateY(1px) scale(.985); filter: brightness(.97); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .22), 0 1px 2px color-mix(in srgb, var(--accent) 40%, transparent); }

.btn.soft { color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent); }
.btn.soft:hover { background: color-mix(in srgb, var(--accent) 16%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
.btn.ghost, .btn.subtle { color: var(--ink-2); background: transparent; box-shadow: none; }
.btn.ghost:hover { color: var(--ink); background: rgb(var(--shadow-rgb) / .06); box-shadow: none; }
.btn.subtle { color: var(--muted); }
.btn.subtle:hover { color: var(--danger); background: var(--danger-soft); box-shadow: none; }
.btn.ghost:active, .btn.subtle:active, .btn.soft:active { box-shadow: none; }
.btn.danger { color: #fff; background: linear-gradient(180deg, var(--danger-hi), var(--danger-lo)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 -1px 0 rgba(0, 0, 0, .1), 0 1px 2px rgba(194, 47, 75, .4), 0 8px 16px -8px rgba(194, 47, 75, .6); }
.btn.danger:hover { background: linear-gradient(180deg, var(--danger-hi), var(--danger-lo)); filter: brightness(1.05); transform: translateY(-1px); }

.btn.sm { height: 30px; padding: 0 11px; border-radius: 10px; font-size: 12.5px; }
.btn.sm svg { width: 14px; height: 14px; }
.btn.lg, .btn-accent, .checkout-submit, .checkout-actions .primary { height: 48px; padding: 0 22px; border-radius: 14px; font-size: 15px; }
.btn.icon { width: var(--control-h); padding: 0; }
.btn.icon.sm { width: 30px; }
.btn-block, .btn-accent, .checkout-submit, .checkout-actions .primary { display: flex; width: 100%; }
.btn-accent, .checkout-submit, .checkout-actions .primary { align-items: center; justify-content: center; gap: 7px; border: 0; font-family: var(--font); font-weight: 600; text-decoration: none; cursor: pointer; transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1), filter var(--dur-1); }
.btn-accent:hover { text-decoration: none; }
.checkout-actions .primary { display: inline-flex; width: auto; }
.btn.is-loading { color: transparent !important; pointer-events: none; position: relative; }
.btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent-ink); border-right-color: transparent; animation: kit-spin .7s linear infinite; }
.btn.is-loading:not(.primary):not(.danger)::after { border-color: var(--muted); border-right-color: transparent; }

button.link, .linkish, .link-accent { display: inline; padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--accent-text); cursor: pointer; text-decoration: none; }
button.link:hover, .linkish:hover, .link-accent:hover { text-decoration: underline; text-underline-offset: 3px; }
button.link.muted { color: var(--muted); font-weight: 500; }

/* ------------------------------------------------------------------ 6. Forms */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); }
input, textarea, select, .ui-select-trigger {
  width: 100%; min-width: 0; min-height: var(--control-h); padding: 8px 12px; margin: 0;
  font: 500 var(--fs-base)/1.4 var(--font); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  box-shadow: var(--e-control), inset 0 1px 0 var(--highlight);
  transition: border-color var(--dur-1), box-shadow var(--dur-1), background var(--dur-1);
}
input::placeholder, textarea::placeholder { color: var(--faint); font-weight: 400; }
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
input:hover, textarea:hover, select:hover, .ui-select-trigger:hover { border-color: var(--faint); }
input:focus, textarea:focus, select:focus, .ui-select-trigger:focus-visible, .is-open > .ui-select-trigger {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-halo), var(--e-control);
}
input:disabled, textarea:disabled, select:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"], .ui-select-trigger[aria-invalid="true"],
.has-error input:not([type="checkbox"]):not([type="radio"]), .has-error textarea, .has-error .ui-select-trigger { border-color: var(--danger); }
input[aria-invalid="true"]:focus, textarea[aria-invalid="true"]:focus, .has-error input:focus, .has-error textarea:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 16%, transparent); }
input[type="file"] { padding: 6px; font-size: 13px; }
input[type="hidden"] { display: none; }
label > input, label > textarea, label > select, label > .prefix, label > .ui-select, label > .ui-date { margin-top: 6px; }
@media (max-width: 640px) {
  /* 16px stops iOS zooming into a focused field. */
  input, textarea, select, .ui-select-trigger { font-size: 16px; min-height: 44px; }
  .prefix { min-height: 44px; }
}

/* Field: label, control, then a hint or an error. */
.field { margin: 0 0 var(--s-4); min-width: 0; }
.field:not(.check) > label:not(.choice):not(.check), .field legend { display: block; margin: 0 0 6px; padding: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field fieldset, fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field { margin-bottom: var(--s-4); }
.hint, .field-hint { display: block; margin: 6px 0 0; font-size: var(--fs-sm); font-weight: 400; color: var(--muted); }
.hint.center { text-align: center; }
.field-error { display: block; margin: 6px 0 0; font-size: var(--fs-sm); font-weight: 600; color: var(--danger); }
.optional { font-weight: 400; color: var(--muted); }
.grid-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); align-items: start; }
.grid-form .wide { grid-column: 1 / -1; }
.grid-form .field { margin: 0; }
.grid-form + .field, .grid-form + .grid-form { margin-top: var(--s-4); }
@media (min-width: 641px) { .grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4) var(--s-5); } }
.phone-row { display: grid; grid-template-columns: minmax(0, 132px) minmax(0, 1fr); gap: var(--s-2); }
/* Stepper: a small number picked with − and + (the checkout quantity).
   Markup is a native <select data-stepper data-native> that works without
   JavaScript; checkout.js puts the stepper in front of it and hides it. */
.stepper { display: inline-flex; align-items: center; gap: 2px; padding: 3px; background: var(--well); border-radius: var(--r-pill); box-shadow: inset 0 1px 2px rgb(var(--shadow-rgb) / .08); }
.stepper button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); font: 600 19px/1 var(--font); cursor: pointer; box-shadow: var(--e-control), inset 0 1px 0 var(--highlight); transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1); }
.stepper button:hover:not(:disabled) { box-shadow: var(--e-2); }
.stepper button:active:not(:disabled) { transform: scale(.94); }
.stepper button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-halo), var(--e-control); }
.stepper button:disabled { opacity: .4; cursor: not-allowed; }
.stepper output { min-width: 40px; text-align: center; font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
/* Quantity row: the stepper (or select + Update without JS) and the total. */
.qty-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
.qty-row select { width: auto; min-width: 88px; }
.qty-total { margin: 0 0 0 auto; color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.qty-total b { margin-left: 4px; color: var(--ink); font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
/* Holder block: one ticket of a multi-ticket order (name, optional email,
   the questions asked for every ticket). */
fieldset.holder { min-width: 0; margin: 0 0 var(--s-4); padding: var(--s-4); border: 0; border-radius: var(--r-lg); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
fieldset.holder > legend { float: left; width: 100%; margin: 0 0 var(--s-3); padding: 0; font-size: var(--fs-md); font-weight: 700; color: var(--ink); }
fieldset.holder > legend + * { clear: both; }
fieldset.holder > .field:last-child, fieldset.holder > .field-hint:last-child { margin-bottom: 0; }
.search { max-width: 360px; }
.prefix.search { width: 100%; }
.page-head > .prefix.search { flex: 1 1 260px; }
.inline-add { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.inline-add input { flex: 1 1 200px; max-width: 320px; }

/* Prefix / suffix input: the wrapper is the control. */
.prefix { display: flex; align-items: center; min-height: var(--control-h); padding: 0 12px; gap: 6px; color: var(--muted); font-weight: 500; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--e-control), inset 0 1px 0 var(--highlight); transition: border-color var(--dur-1), box-shadow var(--dur-1); }
.prefix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-halo), var(--e-control); }
.prefix > input { flex: 1; border: 0; padding-left: 0; padding-right: 0; background: none; box-shadow: none; min-height: 0; }
.prefix > input:focus { box-shadow: none; }
.code-input { text-transform: uppercase; font-family: var(--mono); letter-spacing: .04em; }

/* Checkbox, radio, switch (native inputs, restyled) */
input[type="checkbox"], input[type="radio"] {
  -webkit-appearance: none; appearance: none; flex: none; position: relative; display: inline-block; vertical-align: -4px;
  width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--faint); border-radius: var(--r-xs);
  box-shadow: inset 0 1px 2px rgb(var(--shadow-rgb) / .08);
  transition: background var(--dur-1), border-color var(--dur-1), box-shadow var(--dur-1);
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:hover, input[type="radio"]:hover { border-color: var(--accent); }
input[type="checkbox"]:focus, input[type="radio"]:focus { box-shadow: none; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-halo); }
input[type="checkbox"]:checked { border-color: transparent; background: var(--accent-check) center / 12px no-repeat, linear-gradient(180deg, var(--accent-hi), var(--accent-lo)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 2px 5px -2px var(--accent-glow); }
input[type="radio"]:checked { border-color: transparent; background: radial-gradient(circle, var(--accent-ink) 0 3.2px, transparent 3.7px), linear-gradient(180deg, var(--accent-hi), var(--accent-lo)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 2px 5px -2px var(--accent-glow); }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: .5; cursor: not-allowed; }
input[type="checkbox"].switch { width: 38px; height: 22px; border: 0; border-radius: var(--r-pill); background: var(--line-strong); box-shadow: inset 0 1px 3px rgb(var(--shadow-rgb) / .22); vertical-align: -6px; }
input[type="checkbox"].switch::before { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(var(--shadow-rgb) / .3), 0 2px 6px -1px rgb(var(--shadow-rgb) / .25); transition: transform var(--dur-2) var(--ease); }
input[type="checkbox"].switch:checked { background: linear-gradient(180deg, var(--accent-hi), var(--accent-lo)); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .15); }
input[type="checkbox"].switch:checked::before { transform: translateX(16px); }
.check, .choice, .field.check > label { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-size: var(--fs-base); font-weight: 500; color: var(--ink); cursor: pointer; }
.check input, .choice input, .field.check > label input { margin-top: 1.5px; }
.choice + .choice, .check + .check { margin-top: var(--s-2); }
.check .hint, .choice .hint { margin-top: 1px; }
.check a, .choice a { font-weight: 600; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); font-weight: 500; color: var(--ink); cursor: pointer; }

/* Accent picker: radios shown as colour dots. Each option carries acc-<name>. */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; border: 0; margin: 0; padding: 4px 0; }
.swatch { position: relative; display: block; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; background: linear-gradient(180deg, var(--accent-hi), var(--accent-lo)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 5px -2px var(--accent-glow); transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1); }
.swatch:hover { transform: scale(1.1); }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; cursor: pointer; }
.swatch:has(input:checked), .swatch.is-selected, .swatch[aria-current="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 5px; }

/* Grouped fields (Luma-style): rows in one soft panel, label left, control
   right. Controls are borderless until hovered or focused. */
.group-title { margin: var(--s-5) 0 var(--s-2); font-size: var(--fs-sm); font-weight: 600; color: var(--muted); letter-spacing: 0; }
.group-title:first-child { margin-top: 0; }
.group { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--e-1); }
.group-row { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 2px var(--s-3); padding: 10px 12px 10px 16px; margin: 0; font-weight: 400; min-width: 0; }
.group-row + .group-row, .group-error + .group-row, .group > * + .group-row, .group > * + .group-text { border-top: 1px solid var(--line); }
.group-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.group-value { color: var(--ink); font-weight: 500; text-align: left; overflow-wrap: anywhere; }
.group-row > input, .group-row > textarea, .group-row > .prefix, .group-row .ui-select-trigger { margin: 0; border-color: transparent; background: transparent; box-shadow: none; }
.group-row > input:hover, .group-row > textarea:hover, .group-row > .prefix:hover, .group-row .ui-select-trigger:hover { background: var(--surface-2); border-color: transparent; }
.group-row > input:focus, .group-row > textarea:focus, .group-row > .prefix:focus-within, .group-row .ui-select-trigger:focus-visible, .group-row .is-open > .ui-select-trigger { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-halo); }
.group-row > .ui-select, .group-row > .ui-date { margin: 0; }
/* Date + time in one row (ADR 0007): the date fills, the time stays compact.
   Use a div.group-row (two controls, so no wrapping label). */
.group-when { display: flex; gap: var(--s-2); min-width: 0; }
.group-when > :first-child { flex: 1 1 auto; min-width: 0; }
.group-when > .group-time, .group-when > .ui-select { flex: 0 0 116px; min-width: 0; }
.group-when > input, .group-when > select { margin: 0; border-color: transparent; background: transparent; box-shadow: none; }
.group-when > input:hover, .group-when > select:hover { background: var(--surface-2); border-color: transparent; }
.group-when > input:focus, .group-when > select:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-halo); }
.group-when .ui-select-value { font-variant-numeric: tabular-nums; }
.group-text { display: block; border: 0; border-radius: var(--r-lg); background: transparent; box-shadow: none; padding: 14px 16px; }
.group-text:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
.group-error { display: block; margin: 0; padding: 0 16px 10px; }
@media (min-width: 561px) {
  .group-row { grid-template-columns: 150px minmax(0, 1fr); padding: 7px 8px 7px 16px; min-height: 52px; }
  .group-row > .group-value { text-align: right; padding-right: 8px; }
  .group-row > .swatches { justify-content: flex-end; padding-right: 8px; }
  .group-error { padding-left: 178px; }
}
/* Borderless title field at the top of the event form. */
.title-input, .ev-name-input { min-height: 0; padding: 4px 0 8px; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 30px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
.title-input:hover, .ev-name-input:hover { border: 0; }
.title-input:focus, .ev-name-input:focus { box-shadow: inset 0 -2px 0 var(--accent); }
.title-input::placeholder, .ev-name-input::placeholder { font-weight: 700; color: var(--faint); }
@media (min-width: 641px) { .title-input, .ev-name-input { font-size: 36px; } }
@media (max-width: 640px) { .title-input, .ev-name-input { font-size: 28px; min-height: 0; } }
.schedule-rows { display: flex; flex-direction: column; }
.schedule-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); padding: 8px; }
@media (min-width: 561px) { .schedule-row { grid-template-columns: 150px minmax(0, 1fr); } }
.save-bar, .actions.sticky { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-3); padding: var(--s-4) 0 var(--s-3); background: linear-gradient(transparent, var(--ground) 38%); }

/* ------------------------------------------------------------ 7. Navigation */
/* Segmented control: links (aria-current) or radios. */
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-md); background: var(--well); box-shadow: inset 0 1px 2px rgb(var(--shadow-rgb) / .10); }
.segmented a, .segmented label { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 14px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: color var(--dur-1), background var(--dur-1), box-shadow var(--dur-1); }
.segmented a:hover, .segmented label:hover { color: var(--ink); text-decoration: none; }
.segmented a[aria-current], .segmented label:has(input:checked) { color: var(--ink); background: var(--surface); box-shadow: inset 0 1px 0 var(--highlight), 0 0 0 1px rgb(var(--shadow-rgb) / .05), 0 1px 3px rgb(var(--shadow-rgb) / .14), 0 4px 8px -4px rgb(var(--shadow-rgb) / .2); }
.segmented input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; cursor: pointer; }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.segmented.block { display: flex; }
.segmented.block > * { flex: 1; }

/* Tabs: sections of one object (an event). */
.tabs { display: flex; gap: var(--s-1); margin: var(--s-4) 0 var(--s-6); padding-bottom: 0; overflow-x: auto; scrollbar-width: none; box-shadow: inset 0 -1px 0 var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { position: relative; padding: 10px 12px 12px; color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap; border-radius: 10px 10px 0 0; transition: color var(--dur-1); }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2.5px; border-radius: 2px 2px 0 0; background: transparent; transition: background var(--dur-1); }
.tabs a:hover::after { background: var(--line-strong); }
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"]::after { background: linear-gradient(90deg, var(--accent-hi), var(--accent-lo)); }
.tabs .badge { margin-left: 4px; }

/* Breadcrumbs */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 var(--s-4); padding: 0; list-style: none; font-size: 13px; font-weight: 500; color: var(--muted); }
.crumbs a { color: var(--muted); border-radius: 6px; }
.crumbs a:hover { color: var(--ink); text-decoration: none; }
.crumbs li { display: inline-flex; align-items: center; gap: 6px; }
.crumbs li + li::before { content: ""; width: 12px; height: 12px; background: var(--faint); -webkit-mask: var(--i-chevron) center / contain no-repeat; mask: var(--i-chevron) center / contain no-repeat; transform: rotate(-90deg); }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }

/* --------------------------------------------------------------- 8. Surfaces
   .card  : a lifted white panel for one object or one task.
   .group : the same surface for rows (fields, list rows); no padding.
   .well  : a sunken area for secondary content inside a page or card. */
.card, .side-card { background: var(--surface); border-radius: var(--r-lg); padding: var(--s-5); margin: 0 0 var(--s-4); box-shadow: var(--e-1); min-width: 0; }
.card.flush, .card:has(> .card-body) { padding: 0; }
.card.raised { box-shadow: var(--e-2); }
a.card, .card.is-link { display: block; color: inherit; transition: box-shadow var(--dur-2), transform var(--dur-2) var(--ease); }
a.card:hover, .card.is-link:hover { text-decoration: none; box-shadow: var(--e-2); transform: translateY(-1px); }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-2) var(--s-3); margin: 0 0 var(--s-3); }
.card-head h2, .card-head h3 { margin: 0; }
.card.flush > .card-head, .card:has(> .card-body) > .card-head { margin: 0; padding: 14px var(--s-5); border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.card-body { padding: var(--s-2) var(--s-5) var(--s-4); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin: var(--s-4) calc(var(--s-5) * -1) calc(var(--s-5) * -1); padding: var(--s-3) var(--s-5); border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); color: var(--muted); font-size: 13px; }
.side-card { padding: var(--s-4); }
.side-card h2 { font-size: var(--fs-base); margin: 0 0 4px; }
.side-card p { color: var(--muted); margin: 0 0 var(--s-3); }
.well { background: var(--well); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); box-shadow: inset 0 1px 2px rgb(var(--shadow-rgb) / .08); }
.type-card { margin-top: var(--s-4); }
.type-card.archived, .card.archived { opacity: .68; }
.type-card-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: var(--s-3); margin-bottom: var(--s-3); }
.type-card-head h2 { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.type-card-head p { margin: 4px 0 0; }
.status-card { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--s-4); }
.status-card p { margin: 0; max-width: 60ch; }

/* Stat tiles */
.stats, .tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); margin-bottom: var(--s-5); }
@media (min-width: 761px) { .stats, .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat, .tiles > .tile { display: flex; flex-direction: column; gap: 2px; padding: 14px var(--s-4); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--e-1); min-width: 0; }
.stat-label, .tile-label { font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }
.stat-value, .tile-value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-note { font-size: var(--fs-xs); color: var(--muted); }
.stat .meter { margin-top: 6px; }

/* Grouped list: rows with a title, meta and a trailing action. */
.list, .question-list { list-style: none; margin: 0 0 var(--s-4); padding: 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--e-1); }
.list-row, .question-item { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 12px var(--s-4); min-width: 0; color: inherit; }
.list-row + .list-row, .question-item + .question-item { border-top: 1px solid var(--line); }
a.list-row { transition: background var(--dur-1); }
a.list-row:hover { background: var(--surface-2); text-decoration: none; }
a.list-row:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0; }
a.list-row:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.list-main { min-width: 0; flex: 1; }
.list-title { display: block; font-weight: 600; overflow-wrap: anywhere; }
.list-meta { display: block; font-size: var(--fs-sm); color: var(--muted); }
.question-item { flex-wrap: wrap; align-items: flex-start; }
.question-item .list-main { flex: 1 1 220px; }
.terms-list { list-style: none; margin: 0 0 var(--s-3); padding: 0; }
.terms-list li { display: flex; justify-content: space-between; gap: var(--s-3); padding: 5px 0; }

/* Read-only summary (definition list) */
.summary { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px var(--s-4); margin: 0; }
.summary dt { color: var(--muted); font-size: 13px; }
.summary dd { margin: 0 0 var(--s-2); font-weight: 500; overflow-wrap: anywhere; }
@media (min-width: 641px) { .summary { grid-template-columns: 160px minmax(0, 1fr); gap: var(--s-2) var(--s-4); } .summary dd { margin: 0; } }

.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6); align-items: start; }
@media (min-width: 761px) { .split { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }

/* ----------------------------------------------------------------- 9. Tables
   A bare .table is its own card. Inside a .card (or .table-scroll in a card)
   it loses its surface and runs edge to edge. */
.table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 0 0 var(--s-5); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--e-1); font-size: 13.5px; }
.table th { padding: 10px 14px; text-align: left; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.table th:first-child { border-top-left-radius: var(--r-lg); }
.table th:last-child { border-top-right-radius: var(--r-lg); }
.table td { padding: 12px 14px; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--dur-1); }
.table.hover tbody tr:hover td, .table tr.is-link:hover td { background: var(--surface-2); }
.table tr.current td { background: var(--accent-soft); }
.table tr.current td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--r-lg); }
.table tbody tr:last-child td:last-child { border-bottom-right-radius: var(--r-lg); }
.table.compact td, .table.setup td { padding: 7px 12px; }
.table.setup input { min-height: 32px; padding: 5px 9px; }
/* Long column heads (Russian) must not squeeze the inputs under the short ones. */
.table.setup td:first-child input { min-width: 116px; }
.table.setup td input { min-width: 68px; }
.table .num, .num { text-align: right; font-variant-numeric: tabular-nums; }
.table a.cell-link { color: var(--ink); font-weight: 600; }
/* tr.is-link (and every list row tr[data-row]): the whole row opens its .cell-link (a stretched link, so click,
   Cmd-click and the keyboard behave like the link itself). Keep other
   interactive elements out of such rows. */
.table tr.is-link, .table tr[data-row]:has(> td > a.cell-link) { position: relative; cursor: pointer; }
.table tr.is-link a.cell-link::after, .table tr[data-row] > td > a.cell-link::after { content: ""; position: absolute; inset: 0; }
.table tr.is-link a.cell-link:hover, .table tr[data-row] > td > a.cell-link:hover { text-decoration: none; }
.table tr.is-link:hover a.cell-link, .table tr[data-row]:hover > td > a.cell-link { color: var(--accent-text); }
.table tr[data-row]:hover td { background: var(--surface-2); }
.table tr[data-row].current:hover td { background: var(--accent-soft); }
.table tr.is-link a.cell-link:focus-visible, .table tr[data-row] > td > a.cell-link:focus-visible { outline: none; }
.table tr:is(.is-link, [data-row]):has(a.cell-link:focus-visible) td { background: var(--surface-2); }
.table tr:is(.is-link, [data-row]):has(a.cell-link:focus-visible) td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.cell-sub { display: block; font-size: var(--fs-sm); color: var(--muted); font-weight: 400; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions form { display: inline-flex; margin: 0; }
.row-actions .btn { height: 30px; padding: 0 11px; border-radius: 10px; font-size: 12.5px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card > .table, .card > .table-scroll > .table, .card > .table-scroll { margin-bottom: 0; }
.card > .table, .card > .table-scroll > .table { background: none; box-shadow: none; border-radius: 0; }
.card:not(.flush) > .table, .card:not(.flush) > .table-scroll { width: calc(100% + var(--s-5) * 2); margin-left: calc(var(--s-5) * -1); margin-right: calc(var(--s-5) * -1); }
.card:not(.flush) > .table-scroll > .table { min-width: 100%; }
.card:not(.flush) > .table:last-child, .card:not(.flush) > .table-scroll:last-child { margin-bottom: calc(var(--s-5) * -1); }
.card > .table th, .card > .table-scroll > .table th { border-radius: 0; border-top: 1px solid var(--line); }
.card.flush > .table:first-child th, .card.flush > .table-scroll:first-child th { border-top: 0; }
.card.flush > .table:first-child th:first-child, .card.flush > .table-scroll:first-child th:first-child { border-top-left-radius: var(--r-lg); }
.card.flush > .table:first-child th:last-child, .card.flush > .table-scroll:first-child th:last-child { border-top-right-radius: var(--r-lg); }
.card > .table th:first-child, .card > .table td:first-child, .card > .table-scroll th:first-child, .card > .table-scroll td:first-child { padding-left: var(--s-5); }
.card > .table th:last-child, .card > .table td:last-child, .card > .table-scroll th:last-child, .card > .table-scroll td:last-child { padding-right: var(--s-5); }
@media (max-width: 760px) {
  /* Wide tables scroll inside their own box, never the page. */
  .table:not(.card > .table):not(.table-scroll > .table) { display: block; overflow-x: auto; }
  .table th, .table td { white-space: nowrap; }
}

/* ------------------------------------------------------ 10. Pills, feedback */
.pill, .chip { display: inline-flex; align-items: center; gap: 5px; width: fit-content; padding: 3px 9px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; line-height: 1.45; white-space: nowrap; color: var(--accent-text); background: var(--accent-soft); }
.pill-ok { color: var(--ok); background: var(--ok-soft); }
.pill-warn { color: var(--warn); background: var(--warn-soft); }
.pill-danger { color: var(--danger); background: var(--danger-soft); }
.pill-muted, .chip-muted { color: var(--muted); background: var(--well); }
.pill.dot::before, .chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.dot.live::before { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent); }
.chip { margin: 0 0 var(--s-3); font-size: var(--fs-sm); padding: 4px 11px; }
.pills, .ev-card-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent-ink); background: var(--accent); }
.badge.muted { color: var(--muted); background: var(--well); }

/* Flash (after a successful action), alerts (inline, by tone) */
.flash, .alert, .checkout-notice, .checkout-errors { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 var(--s-4); padding: 11px 14px; border-radius: var(--r-md); font-size: 13.5px; font-weight: 500; }
.flash::before, .alert::before, .checkout-notice::before, .checkout-errors::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.flash, .alert.ok { color: var(--ok); background: var(--ok-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 14%, transparent); }
.alert, .checkout-errors { color: var(--danger); background: var(--danger-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 14%, transparent); }
.alert.warn, .checkout-notice { color: var(--warn); background: var(--warn-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 16%, transparent); }
.alert.info { color: var(--info); background: var(--info-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info) 14%, transparent); }
.alert > div, .flash > div { min-width: 0; }
.alert strong { display: block; }
.sheet .alert { margin: 0; }
/* Toast: a floating confirmation. Put toasts in .toast-region (fixed). */
.toast-region { position: fixed; z-index: 70; left: 50%; bottom: var(--s-5); transform: translateX(-50%); display: flex; flex-direction: column; gap: var(--s-2); width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-radius: 14px; color: #fff; font-size: 13.5px; font-weight: 500; background: rgba(29, 27, 38, .9); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 18px 36px -12px rgb(var(--shadow-rgb) / .5); animation: kit-rise var(--dur-2) var(--ease); }
.toast::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--i-check-light) center / 11px no-repeat, #2fae6b; }
.toast .btn { height: 28px; color: #fff; background: rgba(255, 255, 255, .14); box-shadow: none; margin-left: var(--s-2); }

/* Empty state */
.empty { padding: var(--s-9) var(--s-5); text-align: center; }
.empty.in-card { padding: var(--s-7) var(--s-5); }
.empty-art { width: 84px; height: 84px; margin: 0 auto var(--s-5); display: flex; align-items: center; justify-content: center; border-radius: 26px; color: var(--accent-text); background: linear-gradient(180deg, #fff, var(--accent-soft)); box-shadow: var(--e-2); transform: rotate(-4deg); }
.empty-art svg { width: 34px; height: 34px; }
.empty h2, .empty-title { margin: 0 0 6px; font-size: var(--fs-lg); font-weight: 700; color: var(--ink); }
.empty p { max-width: 38ch; margin: 0 auto var(--s-5); color: var(--muted); }

/* --------------------------------------------------------- 11. Menus, avatars */
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; border-radius: 50%; font-size: 12px; font-weight: 700; letter-spacing: .02em; color: #fff; background: radial-gradient(circle at 28% 24%, var(--mesh-warm), transparent 60%), radial-gradient(circle at 80% 80%, var(--mesh-cool), transparent 62%), var(--accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 2px 6px -2px rgb(var(--shadow-rgb) / .4); text-shadow: 0 1px 1px rgba(0, 0, 0, .18); }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.neutral { color: var(--ink-2); background: var(--well); text-shadow: none; box-shadow: inset 0 0 0 1px var(--line-strong); }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar + .avatar { margin-left: -8px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* Menu: <details class="menu"><summary>…</summary><div class="menu-pop">…</div></details> */
.menu, .me { position: relative; display: inline-block; }
.menu > summary, .me > summary { list-style: none; cursor: pointer; border-radius: var(--r-md); }
.me > summary, .menu.round > summary { border-radius: 50%; display: flex; }
.menu > summary::-webkit-details-marker, .me > summary::-webkit-details-marker { display: none; }
.menu-pop, .me-menu { position: absolute; z-index: 40; top: calc(100% + 8px); right: 0; min-width: 210px; padding: 6px; background: var(--surface); border-radius: 14px; box-shadow: var(--e-3); animation: kit-pop var(--dur-1) var(--ease); transform-origin: top right; }
.menu-pop.left { right: auto; left: 0; transform-origin: top left; }
.menu-pop.is-static { position: static; animation: none; width: 230px; }
.menu-head, .me-who { display: flex; flex-direction: column; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.menu-head strong, .me-who strong { font-weight: 600; }
.menu-head span, .me-who span { color: var(--muted); font-size: var(--fs-sm); text-transform: capitalize; }
.menu-pop form, .me-menu form { margin: 0; }
.menu-item, .me-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: none; font: 500 13.5px/1.3 var(--font); color: var(--ink); text-align: left; cursor: pointer; transition: background var(--dur-1); }
.menu-item svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.menu-item:hover, .me-item:hover, .menu-item:focus-visible { background: var(--surface-2); text-decoration: none; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-soft); }
.menu-item kbd { margin-left: auto; }
.menu-sep { height: 1px; margin: 4px 0; background: var(--line); }
.menu-label { display: block; padding: 6px 10px 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
/* The chosen item of a set of choices (the language switcher). */
.menu-item[aria-current="true"] { font-weight: 600; color: var(--accent-text); }
.menu-item[aria-current="true"]::after { content: ""; flex: none; width: 6px; height: 11px; margin: 0 4px 3px auto; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* Popover: a small floating card for extra detail. */
.popover { padding: var(--s-3) var(--s-4); background: var(--surface); border-radius: 14px; box-shadow: var(--e-3); font-size: 13px; max-width: 280px; }

/* ---------------------------------------------------------- 12. ui.js widgets
   Markup is generated by static/js/ui.js from <select> and <input type=date>. */
.ui-select, .ui-date { position: relative; min-width: 0; }
.ui-native { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; }
.ui-select-trigger { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer; }
.ui-select-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-select-value.is-placeholder { color: var(--faint); font-weight: 400; }
.ui-select-caret, .ui-date-icon { flex: none; width: 16px; height: 16px; background: var(--muted); -webkit-mask: var(--i-chevron) center / contain no-repeat; mask: var(--i-chevron) center / contain no-repeat; transition: transform var(--dur-2) var(--ease); }
.ui-date-icon { -webkit-mask-image: var(--i-calendar); mask-image: var(--i-calendar); }
.is-open > .ui-select-trigger .ui-select-caret { transform: rotate(180deg); }
.ui-popover { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; min-width: 100%; max-width: calc(100vw - 32px); padding: 6px; background: var(--surface); border-radius: 14px; box-shadow: var(--e-3); animation: kit-pop var(--dur-1) var(--ease); transform-origin: top left; }
.opens-up > .ui-popover { top: auto; bottom: calc(100% + 6px); transform-origin: bottom left; }
.ui-popover.is-static { position: relative; top: 0; animation: none; min-width: 0; z-index: auto; }
.ui-select-search { min-height: 34px; margin: 0 0 6px; padding: 6px 10px; border-radius: var(--r-sm); background: var(--surface-2); box-shadow: none; }
.ui-listbox { list-style: none; margin: 0; padding: 0; max-height: 264px; overflow-y: auto; outline: none; overscroll-behavior: contain; }
.ui-option { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--r-sm); font-size: var(--fs-base); font-weight: 500; color: var(--ink); cursor: pointer; }
.ui-option[hidden] { display: none; }
.ui-option.is-active { background: var(--surface-2); }
.ui-option[aria-selected="true"] { color: var(--accent-text); font-weight: 600; }
.ui-option[aria-disabled="true"] { opacity: .45; cursor: default; }
.ui-option.ui-placeholder { color: var(--muted); }
.ui-multi .ui-option.ui-placeholder { display: none; }
.ui-check { flex: none; width: 16px; height: 16px; border-radius: 5px; }
.ui-option[aria-selected="true"] .ui-check { background: var(--accent-text); -webkit-mask: var(--i-check) center / 14px no-repeat; mask: var(--i-check) center / 14px no-repeat; }
.ui-multi .ui-check { width: 18px; height: 18px; border: 1.5px solid var(--faint); background: var(--surface); box-shadow: inset 0 1px 2px rgb(var(--shadow-rgb) / .08); }
.ui-multi .ui-option[aria-selected="true"] { color: var(--ink); font-weight: 500; }
.ui-multi .ui-option[aria-selected="true"] .ui-check { border-color: transparent; -webkit-mask: none; mask: none; background: var(--accent-check) center / 12px no-repeat, linear-gradient(180deg, var(--accent-hi), var(--accent-lo)); }
.ui-calendar { width: 296px; padding: 12px; }
.ui-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ui-cal-title { font-weight: 700; font-size: var(--fs-base); letter-spacing: -.01em; }
.ui-cal-nav, .ui-cal-link { border: 0; background: none; font: 600 13px var(--font); color: var(--ink-2); cursor: pointer; border-radius: var(--r-sm); padding: 5px 10px; transition: background var(--dur-1); }
.ui-cal-nav { width: 32px; height: 32px; padding: 0; font-size: 20px; line-height: 1; color: var(--muted); }
.ui-cal-nav:hover, .ui-cal-link:hover { background: var(--surface-2); color: var(--ink); }
.ui-cal-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ui-cal-grid th { padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.ui-cal-grid td { padding: 1px; text-align: center; }
.ui-day { width: 100%; aspect-ratio: 1; max-width: 38px; border: 0; border-radius: 11px; background: none; font: 500 13px var(--font); font-variant-numeric: tabular-nums; color: var(--ink); cursor: pointer; transition: background var(--dur-1); }
.ui-day:hover { background: var(--accent-soft); }
.ui-day.is-outside { color: var(--faint); }
.ui-day.is-today { box-shadow: inset 0 0 0 1.5px var(--line-strong); font-weight: 700; }
.ui-day.is-selected { color: var(--accent-ink); font-weight: 700; background: linear-gradient(180deg, var(--accent-hi), var(--accent-lo)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 10px -4px var(--accent-glow); }
.ui-day:disabled { opacity: .3; cursor: default; background: none; }
.ui-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ui-cal-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.ui-cal-link { color: var(--accent-text); }

/* ------------------------------------------------------------------ 13. Sheets
   Server-rendered by partials/sheet.tmpl, enhanced by ui.js. Desktop: a
   floating panel on the right (sheet-wide: wider; sheet-dialog: a centred
   confirmation). Phone: a bottom sheet. ui.js removes a closing sheet after
   220ms, so exit animations must stay under that. */
html.has-sheet { overflow: hidden; }
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: kit-fade var(--dur-2) ease-out; }
.sheet-panel { position: relative; display: flex; flex-direction: column; width: 100%; max-height: 94vh; max-height: 94dvh; background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--e-4); outline: none; animation: kit-sheet-rise .26s var(--ease); }
.sheet-panel::before { content: ""; position: absolute; top: 7px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line-strong); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 20px 14px 12px var(--s-5); border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: var(--fs-lg); }
.sheet-close { display: flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: 50%; color: var(--muted); background: var(--well); font-size: 12px; line-height: 1; transition: background var(--dur-1), color var(--dur-1), transform var(--dur-1); }
.sheet-close:hover { color: var(--ink); background: var(--line-strong); text-decoration: none; }
.sheet-close:active { transform: scale(.92); }
.sheet-form { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); }
.sheet-body > p, .sheet-body .field { margin: 0; }
.sheet-body > .checkout { display: block; }
.sheet-subhead { margin: var(--s-2) 0 0; font-size: var(--fs-base); font-weight: 700; }
.sheet-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2); padding: var(--s-3) var(--s-5) calc(var(--s-3) + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0; }
.sheet-foot .btn { flex: 1; height: 44px; }
.sheet .grid-form { grid-template-columns: minmax(0, 1fr); }
.sheet.is-out .sheet-panel { animation: kit-sheet-sink .2s ease-in forwards; }
.sheet.is-out .sheet-backdrop { animation: kit-fade-out .2s ease-in forwards; }
@media (min-width: 641px) {
  .sheet { justify-content: flex-end; align-items: stretch; padding: 10px; }
  .sheet-panel { width: min(520px, 100%); max-height: none; border-radius: var(--r-xl); animation-name: kit-sheet-slide; }
  .sheet-panel::before { display: none; }
  .sheet-wide .sheet-panel { width: min(880px, 100%); }
  .sheet-wide .grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet-head { padding: 16px 14px 14px var(--s-6); }
  .sheet-body { padding: var(--s-6); }
  .sheet-foot { padding: var(--s-3) var(--s-6); border-radius: 0 0 var(--r-xl) var(--r-xl); }
  .sheet-foot .btn { flex: none; height: var(--control-h); }
  .sheet.is-out .sheet-panel { animation-name: kit-sheet-slide-out; }
  .sheet-dialog { justify-content: center; align-items: center; }
  .sheet-dialog .sheet-panel { width: min(440px, 100%); height: auto; max-height: calc(100dvh - 40px); animation-name: kit-pop-in; }
  .sheet-dialog.is-out .sheet-panel { animation-name: kit-fade-out; }
}
/* A sheet shown in the flow of the page (style guide, docs). */
.sheet-panel.is-static { animation: none; width: 100%; max-width: 440px; max-height: none; border-radius: var(--r-xl); }
.sheet-panel.is-static::before { display: none; }
.sheet-panel.is-static .sheet-foot { border-radius: 0 0 var(--r-xl) var(--r-xl); }

/* ------------------------------------------------------ 14. Events and posters */
/* Mesh gradient: the stand-in for a missing poster. Coloured by the accent
   on the element (acc-<name>); mesh-b / mesh-c vary the composition. */
.mesh, .ev-thumb-blank, .ev-poster-blank { color: #fff; background: radial-gradient(circle at 28% 26%, var(--mesh-warm), transparent 55%), radial-gradient(circle at 78% 74%, var(--mesh-cool), transparent 60%), radial-gradient(circle at 60% 20%, var(--accent-hi), transparent 50%), var(--accent-deep); }
.mesh-b { background: radial-gradient(circle at 72% 24%, var(--mesh-cool), transparent 55%), radial-gradient(circle at 24% 80%, var(--accent-hi), transparent 60%), radial-gradient(circle at 85% 85%, var(--mesh-warm), transparent 40%), var(--accent-deep); }
.mesh-c { background: radial-gradient(circle at 50% 110%, var(--mesh-warm), transparent 60%), radial-gradient(circle at 15% 15%, var(--accent-hi), transparent 55%), radial-gradient(circle at 90% 20%, var(--mesh-cool), transparent 45%), var(--accent-deep); }

/* Event list: a date column and a card with a poster thumb. */
.ev-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }
.ev-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; align-items: start; }
.ev-when { display: flex; flex-direction: row; align-items: baseline; gap: 6px; padding: 0 4px; }
.ev-when strong { font-size: var(--fs-base); font-weight: 700; }
.ev-when span { color: var(--muted); font-size: 13px; }
.ev-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-4); padding: 14px 14px 14px 18px; color: var(--ink); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--e-1); transition: box-shadow var(--dur-2), transform var(--dur-2) var(--ease); }
a.ev-card:hover { text-decoration: none; box-shadow: var(--e-2); transform: translateY(-2px); }
a.ev-card:active { transform: translateY(0) scale(.995); }
.ev-card-text { min-width: 0; }
.ev-card-date { margin: 0 0 3px; font-size: var(--fs-sm); font-weight: 600; color: var(--accent-text); }
.ev-card h2, .ev-card h3 { margin: 0 0 3px; font-size: var(--fs-lg); letter-spacing: -.015em; overflow-wrap: anywhere; }
.ev-card .muted { margin: 0 0 10px; font-size: 13px; }
.ev-card .meter-row { margin-top: 10px; max-width: 280px; }
.ev-thumb { display: flex; align-items: center; justify-content: center; flex: none; width: 76px; height: 76px; border-radius: 14px; object-fit: cover; font-size: 20px; font-weight: 700; letter-spacing: -.02em; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 8px 16px -10px rgb(var(--shadow-rgb) / .6); text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
img.ev-thumb { box-shadow: 0 0 0 1px rgb(var(--shadow-rgb) / .08), 0 8px 16px -10px rgb(var(--shadow-rgb) / .6); }
@media (min-width: 761px) {
  .ev-item { grid-template-columns: 104px minmax(0, 1fr); gap: var(--s-4); }
  .ev-when { flex-direction: column; align-items: flex-start; gap: 0; padding: 18px 0 0; }
  .ev-when strong { font-size: var(--fs-md); }
  .ev-card { padding: 16px 16px 16px 22px; }
  .ev-thumb { width: 96px; height: 96px; border-radius: var(--r-lg); font-size: 24px; }
}

/* Poster with an optional glass caption. */
.poster, .ev-poster-blank, .ev-edit-poster { position: relative; display: block; width: 100%; border-radius: var(--r-xl); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 28px 44px -26px color-mix(in srgb, var(--accent-deep) 85%, transparent), 0 6px 14px -8px rgb(var(--shadow-rgb) / .35); }
.poster > img, img.ev-edit-poster, .ev-poster > img { display: block; width: 100%; height: auto; border-radius: var(--r-xl); }
.poster.mesh, .ev-poster-blank, div.ev-edit-poster { aspect-ratio: 1; display: flex; align-items: flex-end; padding: var(--s-5); }
.ev-poster > img { box-shadow: 0 28px 44px -26px color-mix(in srgb, var(--accent-deep) 85%, transparent), 0 6px 14px -8px rgb(var(--shadow-rgb) / .35); }
.poster-title, .ev-poster-blank span { font-size: 28px; font-weight: 700; line-height: 1.08; letter-spacing: -.025em; color: #fff; text-shadow: 0 1px 12px rgba(0, 0, 0, .25); }
.poster-glass { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 11px 14px; border-radius: 14px; color: #fff; background: rgba(255, 255, 255, .2); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .32), inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 20px -10px rgba(0, 0, 0, .35); text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.poster-glass b { display: block; font-size: var(--fs-base); font-weight: 700; letter-spacing: -.01em; }
.poster-glass small { font-size: var(--fs-sm); opacity: .92; }
.ev-edit-poster-wrap { position: relative; }
.poster-form { position: absolute; right: 12px; top: 12px; display: flex; gap: 6px; margin: 0; }
.poster-pick { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: var(--r-pill); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; background: rgba(20, 16, 40, .55); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); transition: background var(--dur-1); }
.poster-pick:hover { background: rgba(20, 16, 40, .75); }
.poster-pick:focus-within { outline: 2px solid #fff; outline-offset: 2px; }
.poster-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.poster-pick svg { width: 16px; height: 16px; }
.poster-upload { height: 34px; border-radius: var(--r-pill); }

/* Create / edit event: poster left, grouped fields right. */
.ev-edit { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.ev-edit-side { display: flex; flex-direction: column; gap: var(--s-4); }
.ev-edit-poster-wrap { max-width: 360px; width: 100%; margin: 0 auto; }
.ev-edit-main { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; margin: 0; }
@media (min-width: 861px) {
  .ev-edit { grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: 40px; }
  .ev-edit-side { position: sticky; top: 84px; }
  .ev-edit-poster-wrap { max-width: none; }
}

/* ------------------------------------------- 15. Tickets, price, capacity */
/* Ticket (phase) card. States: is-open (on sale), is-soldout, is-upcoming,
   is-held; is-selected or a checked radio inside adds the accent ring.
   The older .ph rows map onto the same look. */
.tickets, .tt-phases { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.tk, .ph { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px var(--s-3); margin: 0; padding: 12px 14px; color: var(--ink); background: var(--surface); border-radius: 14px; box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgb(var(--shadow-rgb) / .04); transition: box-shadow var(--dur-2), transform var(--dur-1) var(--ease), background var(--dur-1); }
label.tk, a.tk { cursor: pointer; }
a.tk:hover { text-decoration: none; }
label.tk:hover, a.tk:hover { box-shadow: 0 0 0 1px var(--faint), 0 6px 14px -10px rgb(var(--shadow-rgb) / .4); }
label.tk:active { transform: scale(.992); }
.tk > input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; border-radius: 14px; cursor: pointer; }
.tk-main { min-width: 0; grid-column: 1; }
.tk-name, .ph-name { display: block; grid-column: 1; font-size: var(--fs-md); font-weight: 700; letter-spacing: -.01em; }
.tk-status, .ph-status { display: block; grid-column: 1; font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }
.tk-price, .ph-price { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ph-price .alt, .tk-price .alt { display: block; font-size: var(--fs-xs); font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tk.is-open .tk-status, .ph-open .ph-status { color: var(--accent-text); font-weight: 600; }
.tk.is-held .tk-status, .ph-held .ph-status { color: var(--warn); font-weight: 600; }
.tk.is-soldout, .tk.is-closed, .ph-sold_out, .ph-closed { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.tk.is-soldout .tk-price, .tk.is-closed .tk-price, .ph-sold_out .ph-price, .ph-closed .ph-price { color: var(--faint); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.tk.is-upcoming, .ph-upcoming, .ph-not_on_sale { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.tk.is-upcoming .tk-price, .ph-upcoming .ph-price, .ph-not_on_sale .ph-price { color: var(--ink-2); }
.tk.is-selected, .tk:has(> input:checked), .ph-open { background: var(--surface); box-shadow: 0 0 0 2px var(--accent), 0 10px 22px -12px var(--accent-glow); }
.tk:has(> input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.tk:has(> input:disabled) { cursor: not-allowed; }
/* Ticket type group on the event page */
.tt { padding: var(--s-4) 0; }
.tt + .tt { border-top: 1px solid var(--line); }
.tt-head { margin-bottom: var(--s-3); }
.tt-head h3 { font-size: var(--fs-md); }
.tt-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.tt-phases { margin-bottom: var(--s-4); }
.tt-note { margin: 0; color: var(--muted); font-size: 13px; }

/* Price */
.price { display: inline-flex; align-items: baseline; gap: 6px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price.lg { font-size: var(--fs-2xl); }
.price.xl { font-size: var(--fs-3xl); letter-spacing: -.03em; }
.price .cur { font-size: .6em; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.price .alt, .price-note { font-size: var(--fs-sm); font-weight: 500; color: var(--muted); letter-spacing: 0; }
.price.was { font-weight: 500; color: var(--faint); text-decoration: line-through; }

/* Capacity meter: <progress class="meter" value max>. */
.meter { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: var(--r-pill); overflow: hidden; background: var(--well); box-shadow: inset 0 1px 2px rgb(var(--shadow-rgb) / .14); color: var(--accent); }
.meter::-webkit-progress-bar { background: transparent; }
.meter::-webkit-progress-value { border-radius: var(--r-pill); background: linear-gradient(180deg, var(--accent-hi), var(--accent-lo)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); transition: width var(--dur-2) var(--ease); }
.meter::-moz-progress-bar { border-radius: var(--r-pill); background: linear-gradient(180deg, var(--accent-hi), var(--accent-lo)); }
.meter.sm { height: 5px; }
.meter.warn::-webkit-progress-value { background: linear-gradient(180deg, #f5b041, #dd8a0a); }
.meter.warn::-moz-progress-bar { background: linear-gradient(180deg, #f5b041, #dd8a0a); }
.meter.full::-webkit-progress-value { background: linear-gradient(180deg, #3cc47c, #1f9a58); }
.meter.full::-moz-progress-bar { background: linear-gradient(180deg, #3cc47c, #1f9a58); }
.meter-row { display: grid; gap: 5px; min-width: 0; }
.meter-label { display: flex; justify-content: space-between; gap: var(--s-3); font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.meter-label strong { color: var(--ink); font-weight: 600; }

/* Pass: an attendee ticket on the standard theme (my tickets, checkout
   status). The code must stay legible on a phone at arm's length. */
.pass { position: relative; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--e-2); margin: 0 0 var(--s-4); }
.pass-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); padding: var(--s-5) var(--s-5) var(--s-4); }
.pass-head h1, .pass-head h3 { font-size: var(--fs-lg); margin: 2px 0; }
.pass-head p { margin: 0; }
.pass-head p:not(.label) { color: var(--muted); font-size: 13px; }
.pass-tear { position: relative; height: 0; margin: 0 16px; border-top: 2px dashed var(--line-strong); }
.pass-tear::before, .pass-tear::after { content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--ground); box-shadow: inset 0 1px 2px rgb(var(--shadow-rgb) / .12); }
.pass-tear::before { left: -26px; }
.pass-tear::after { right: -26px; }
.pass-stub { padding: var(--s-4) var(--s-5) var(--s-5); }
.pass-stub .label { margin-bottom: 4px; }
.ticket-code, .checkout-pass strong { display: block; font: 700 clamp(22px, 7vw, 34px)/1.15 var(--mono); letter-spacing: .08em; color: var(--ink); overflow-wrap: anywhere; }
.label { margin: 0; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }

/* ------------------------------------------------- 16. Public event page */
/* .has-wash: an accent-coloured wash behind the poster on phones, where the
   poster comes first. The top bar turns transparent with a white logo. */
.theme-standard { font-size: var(--fs-md); }
@media (max-width: 820px) {
  .has-wash { position: relative; background: var(--ground); }
  .has-wash::before { content: ""; position: absolute; z-index: -1; top: 0; left: 0; right: 0; height: 560px; background: linear-gradient(180deg, var(--accent-deep) 0, var(--accent) 46%, color-mix(in srgb, var(--accent) 30%, var(--ground)) 74%, var(--ground) 100%); }
  .has-wash .topbar { position: relative; padding-top: 6px; }
  .has-wash .topbar-in { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding-left: 10px; }
  .has-wash .topbar .brand-logo { filter: none; opacity: 1; }
  .has-wash .topbar-brand { color: #fff; }
  .has-wash .topbar-link { color: #fff; background: rgba(255, 255, 255, .18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
  .has-wash .topbar-link:hover { background: rgba(255, 255, 255, .28); }
}
.ev { max-width: 1080px; margin: 0 auto; padding: var(--s-3) var(--s-4) 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); align-items: start; }
.ev-poster { width: 100%; max-width: 440px; margin: 0 auto; }
.ev-main { min-width: 0; }
.ev-title { margin: 0 0 var(--s-4); font-size: clamp(30px, 7.4vw, 46px); line-height: 1.06; letter-spacing: -.03em; overflow-wrap: anywhere; }
.ev-facts { list-style: none; margin: 0 0 var(--s-6); padding: 0; display: grid; gap: var(--s-3); }
.ev-facts li { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.ev-facts strong { display: block; font-weight: 600; }
.ev-facts strong a { color: inherit; }
.ev-facts li > div { min-width: 0; }
.ev-facts li > div > span { display: block; color: var(--muted); font-size: 13px; }
.datebox, .ev-facts .tile { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 13px; overflow: hidden; line-height: 1; color: var(--ink-2); background: var(--surface); box-shadow: var(--e-1); }
.datebox small, .ev-facts .tile-date small { display: block; width: 100%; padding: 4px 0 3px; text-align: center; font-size: 9.5px; font-weight: 700; letter-spacing: .08em; color: var(--accent-text); background: var(--accent-soft); }
.datebox b, .ev-facts .tile-date b { display: block; padding: 5px 0 4px; font-size: 17px; font-weight: 700; color: var(--ink); }
.ev-tickets { margin-bottom: 0; }
.ev-tickets .card-body { padding-top: 0; padding-bottom: var(--s-2); }
.ev-sec { margin-top: var(--s-7); }
.ev-sec h2 { margin: 0 0 var(--s-3); padding-bottom: var(--s-2); font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--muted); border-bottom: 1px solid var(--line); }
.ev-sec p { margin: 0 0 10px; }
.prose p { margin: 0 0 var(--s-3); color: var(--ink-2); line-height: 1.6; }
.sched { margin: 0; display: grid; gap: 10px; }
.sched div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.sched dt { font-weight: 600; }
.sched dd { margin: 0; color: var(--ink-2); }
.sched + p { margin-top: var(--s-4); }
.sched-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sched-items li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px var(--s-3); }
.sched-items.has-times li { grid-template-columns: 92px minmax(0, 1fr); }
.sched-time { color: var(--accent-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.sched-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sched-items.has-times .sched-title, .sched-items li:has(.sched-details) .sched-title { color: var(--ink); font-weight: 500; }
.sched-details { color: var(--muted); font-size: var(--fs-sm); line-height: 1.55; }
/* Schedule summary row in settings (ADR 0010): a .group-row link. */
a.group-row.sched-sum { grid-template-columns: minmax(0, 1fr) auto 18px; color: inherit; text-decoration: none; padding-top: 12px; padding-bottom: 12px; }
a.group-row.sched-sum:hover { background: var(--surface-2); text-decoration: none; }
.group > a.sched-sum:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.group > a.sched-sum:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.group > a.sched-sum:only-child { border-radius: var(--r-lg); }
.sched-sum-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sched-sum-days { display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: var(--fs-sm); color: var(--ink); }
.sched-sum-days b { font-weight: 500; }
.sched-sum-days b + b::before { content: "·"; margin-right: 6px; color: var(--muted); }
.sched-sum-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
a.sched-sum > svg { color: var(--muted); }
/* Schedule editor in a sheet (ADR 0010). */
.sched-edit { display: flex; flex-direction: column; gap: 10px; }
.sched-edit-day { border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px 6px 8px; background: var(--surface); }
.sched-edit-head { display: flex; align-items: center; gap: 8px; padding: 2px 0 4px; }
.sched-edit-label { flex: 1; min-width: 0; height: 36px; font-weight: 700; }
.sched-edit-items { list-style: none; margin: 0; padding: 0; }
.sched-edit-item { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; gap: 0 4px; align-items: start; padding: 2px 0; border-top: 1px solid var(--line); }
.sched-edit-main { display: flex; flex-direction: column; min-width: 0; }
.sched-edit input, .sched-edit textarea { margin: 0; height: 34px; padding: 6px 8px; border-color: transparent; background: transparent; box-shadow: none; font-size: 14px; }
.sched-edit input:hover, .sched-edit textarea:hover { background: var(--surface-2); border-color: transparent; }
.sched-edit input:focus, .sched-edit textarea:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-halo); }
.sched-edit .sched-edit-label { height: 36px; font-weight: 700; font-size: var(--fs-base); }
.sched-edit-time { color: var(--accent-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.sched-edit-title { font-weight: 500; }
.sched-edit .sched-edit-details { height: auto; min-height: 30px; padding-top: 2px; resize: vertical; field-sizing: content; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.sched-edit-more { display: none; align-self: flex-start; margin: -4px 0 4px 8px; padding: 0; border: 0; background: none; color: var(--muted); font: 500 12px/1.4 inherit; cursor: pointer; }
.sched-edit-tools { display: none; gap: 0; padding-top: 3px; }
.sched-edit-tools button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 13px; cursor: pointer; }
.sched-edit-tools button:hover { background: var(--surface-2); color: var(--ink); }
.sched-edit-add { align-self: flex-start; margin: 4px 0 0 104px; padding: 5px 8px; border: 0; border-radius: 8px; background: none; color: var(--accent-text); font: 600 13px/1 inherit; cursor: pointer; }
.sched-edit-add:hover { background: var(--accent-soft); }
/* With schedule.js: details fold away until used, tools show on hover. */
.sched-edit.is-live .sched-edit-tools { display: flex; opacity: 0; transition: opacity .12s; }
.sched-edit.is-live .sched-edit-head:hover .sched-edit-tools, .sched-edit.is-live .sched-edit-head:focus-within .sched-edit-tools,
.sched-edit.is-live .sched-edit-item:hover .sched-edit-tools, .sched-edit.is-live .sched-edit-item:focus-within .sched-edit-tools { opacity: 1; }
.sched-edit.is-live .sched-edit-item:not(.has-details) .sched-edit-details { display: none; }
.sched-edit.is-live .sched-edit-item:not(.has-details):is(:hover, :focus-within) .sched-edit-more { display: block; }
.sched-edit-item.is-new { animation: kit-panel-in .2s ease-out; }
@media (hover: none) { .sched-edit.is-live .sched-edit-tools { opacity: 1; } .sched-edit.is-live .sched-edit-item:not(.has-details) .sched-edit-more { display: block; } }
@media (max-width: 640px) {
  .sched-edit-item { grid-template-columns: 84px minmax(0, 1fr) auto; }
  .sched-edit-add { margin-left: 84px; }
  .sched-edit-item .sched-edit-tools [data-sched-up], .sched-edit-item .sched-edit-tools [data-sched-down] { display: none; }
}
.sched-edit > [data-sched-add-day], .sched-mode { align-self: flex-start; }
.sheet-body .sched-note { margin-top: var(--s-4); }
/* Participant emails (ADR 0011): message cards and the preview. */
.ann-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); align-items: start; }
@media (min-width: 760px) { .ann-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } }
.ann-options { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; margin: 0; padding: 0; border: 0; }
.ann-option { display: flex; gap: var(--s-3); align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; transition: background .15s, box-shadow .15s; }
.ann-option:hover { background: var(--surface-2); }
.ann-option:has(input:checked) { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.ann-option.is-disabled { cursor: not-allowed; opacity: .6; }
.ann-option input { flex: none; margin-top: 2px; }
.ann-option > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ann-option b { font-size: var(--fs-base); }
.ann-option small { color: var(--muted); font-size: var(--fs-sm); line-height: 1.45; }
.ann-option em { font-style: normal; margin-top: 4px; }
.ann-note { display: none; padding: 2px 0 4px 40px; }
.ann-option:has(input:checked) + .ann-note { display: block; }
.ann-note .field { margin: 0; }
.ann-preview { margin: 0; }
.ann-preview .label { margin: 0 0 var(--s-2); }
.ann-preview .actions-row { gap: var(--s-2); margin-top: var(--s-2); }
.ann-confirm { max-width: 540px; }
.ann-confirm h3 { margin: 4px 0 var(--s-2); font-size: var(--fs-xl); }
.ann-note-quote { font-weight: 600; color: var(--ink); }
.ann-confirm .alert { margin-top: var(--s-3); }
.ann-count { color: var(--ink); }
.sched-preview { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; background: var(--well); }
.sched-sync { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--well); font-size: var(--fs-sm); }
/* Sticky buy bar for phones: the price and the primary action stay in reach. */
.buy-bar { position: sticky; bottom: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin: var(--s-5) calc(var(--s-4) * -1) 0; padding: 10px var(--s-4) calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: 0 -1px 0 var(--line); }
.buy-bar .btn { flex: 1; max-width: 240px; }
@media (min-width: 821px) {
  .ev { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: var(--s-8); padding: var(--s-6) var(--s-5) 0; }
  .ev-poster { position: sticky; top: 84px; max-width: none; }
  .ev-title { margin-bottom: var(--s-5); }
  .sched div { grid-template-columns: 140px minmax(0, 1fr); gap: var(--s-4); }
  .buy-bar { display: none; }
}
/* Simple pages: checkout status, terms, errors, my tickets */
.wrap { max-width: 640px; margin: 0 auto; padding: 0 var(--s-5); }
.doc, .checkout.wrap, .mytickets { padding-top: var(--s-7); padding-bottom: var(--s-7); }
.doc h1, .checkout.wrap h1 { margin: 4px 0 var(--s-4); font-size: 30px; }
.doc p:not(.label):not(.doc-meta) { color: var(--ink-2); }
.doc-meta { color: var(--muted); font-size: 13px; }
.checkout-pass { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: var(--s-2) var(--s-4); margin: var(--s-4) 0; padding: var(--s-5); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--e-1); }
.checkout-pass span { color: var(--muted); font-size: 13px; }
.checkout-pass strong { grid-column: 1 / -1; margin-bottom: var(--s-2); }
.checkout-pass b { overflow-wrap: anywhere; }
.checkout-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin: var(--s-4) 0; }
/* Checkout form (inside a sheet) */
.checkout .label { margin-bottom: 6px; }
.checkout-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px var(--s-3); margin: 0 0 var(--s-2); font-size: var(--fs-xl); }
.checkout-price { color: var(--accent-text); font-variant-numeric: tabular-nums; }
.checkout-lead, .checkout-blocked { margin: 0 0 var(--s-5); color: var(--ink-2); font-size: var(--fs-base); }
.checkout-form .field { margin-bottom: var(--s-4); }
.checkout-form .checkout-submit { margin-top: var(--s-2); }
.checkout-form > .field-hint { text-align: center; margin-top: var(--s-3); }

/* ------------------------------------------------- 16b. Lists with a detail
   The admin bookings screen: a filter bar, a list (a table on desktop, rows
   on phones), an optional detail panel beside it, a timeline and a pager. */
/* Search bar: one row on desktop; on phones the search fills the width. */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin: 0 0 var(--s-4); }
.filter-bar > form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); flex: 1 1 320px; margin: 0; }
.filter-bar .prefix.search { flex: 1 1 220px; max-width: none; }
.filter-bar .ui-select, .filter-bar select { width: auto; min-width: 170px; }
/* Segmented control that scrolls sideways on phones instead of wrapping. */
.segmented.scroll { display: flex; width: 100%; margin-bottom: var(--s-4); overflow-x: auto; scrollbar-width: none; }
.segmented.scroll::-webkit-scrollbar { display: none; }
.segmented.scroll > * { flex: none; }
.segmented .badge { margin-left: 2px; }
@media (min-width: 761px) { .segmented.scroll { display: inline-flex; width: auto; } }
/* Master-detail: the list and a sticky panel beside it (≥1000px). Below
   that the panel comes first, full width. */
.master-detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); align-items: start; }
.master-detail > .md-panel { order: -1; }
@media (min-width: 1000px) {
  .master-detail.has-panel { grid-template-columns: minmax(0, 1fr) 380px; }
  .master-detail > .md-panel { order: 0; position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; overscroll-behavior: contain; }
}
.md-panel { margin: 0; }
/* Columns that step aside while the panel is open (.md-col-wide). */
.master-detail .table td { white-space: nowrap; }
.master-detail .table td:first-child { white-space: normal; }
@media (min-width: 1000px) { .master-detail.has-panel .md-col-wide { display: none; } }
.md-panel-head { margin-bottom: var(--s-3); display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-3); }
.md-panel-head h2 { margin: 0; font-size: var(--fs-xl); overflow-wrap: anywhere; }
.md-panel-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.md-panel-head ~ .pills { margin-bottom: var(--s-3); }
.md-section { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.md-section > h3 { margin: 0 0 var(--s-3); font-size: 13px; font-weight: 600; color: var(--muted); }
.md-section .summary { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 641px) { .md-section .summary { grid-template-columns: 120px minmax(0, 1fr); } }
/* Keyboard focus of a row (j / k), alongside tr.current (the open one). */
.table tr.is-focused td { background: var(--surface-2); }
.table tr.is-focused td:first-child { box-shadow: inset 3px 0 0 var(--line-strong); }
.list-row.is-focused { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--line-strong); }
/* Pills may wrap under each other (long status labels in Russian or Thai)
   instead of squeezing the name beside them. */
.list-row .pills { flex: 0 1 auto; max-width: 58%; justify-content: flex-end; }
.list-row .list-meta .code-sm, .cell-sub .code-sm { white-space: nowrap; }
.code-sm { font: 600 12.5px var(--mono); letter-spacing: .04em; color: var(--ink-2); }
/* Extra-large button: the door's main action, 56px tall. */
.btn.xl { height: 56px; padding: 0 24px; border-radius: 16px; font-size: 17px; letter-spacing: .02em; }
.btn.xl svg { width: 20px; height: 20px; }
/* Timeline: newest first, a dot per entry, coloured by tone. */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; padding: 0 0 var(--s-3) 20px; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.timeline li::after { content: ""; position: absolute; left: 6.5px; top: 18px; bottom: 2px; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.ok::before { background: var(--ok); }
.timeline li.warn::before { background: var(--warn); }
.timeline li.danger::before { background: var(--danger); }
.timeline time { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline span { font-size: 13.5px; overflow-wrap: anywhere; }
/* Pager: keyset "next page" and "first page" links. */
.pager { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); margin: var(--s-4) 0; color: var(--muted); font-size: 13px; }
/* Back link above a full-page detail. */
.back-link { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 var(--s-4); min-height: 44px; color: var(--accent-text); font-weight: 600; }
.back-link svg { transform: rotate(180deg); }

/* ----------------------------------------------------------------- 17. Loading */
.skeleton { display: block; border-radius: var(--r-sm); color: transparent !important; background: linear-gradient(90deg, var(--well) 25%, #f4f3f9 45%, var(--well) 65%) 0 0 / 300% 100%; animation: kit-shimmer 1.4s linear infinite; user-select: none; }
.skeleton.text { height: 12px; margin: 5px 0; border-radius: 6px; }
.skeleton.title { height: 20px; width: 55%; border-radius: 8px; }
.skeleton.thumb { width: 76px; height: 76px; border-radius: 14px; }
.skeleton.w-25 { width: 25%; } .skeleton.w-40 { width: 40%; } .skeleton.w-60 { width: 60%; } .skeleton.w-80 { width: 80%; }
.spinner { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: kit-spin .7s linear infinite; vertical-align: -4px; }

/* ------------------------------------------------------- 18. Utilities, motion */
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.center { text-align: center; }
.mono-ish, .tabular { font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; gap: var(--s-3); }
.stack.tight { gap: var(--s-2); }
.inline { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2); }
.inline select, .inline .ui-select { width: auto; min-width: 140px; }
.actions { display: flex; justify-content: flex-end; gap: var(--s-2); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Show one of two renderings by width: .hide-sm on desktop, .show-sm on phones (≤760px). */
@media (max-width: 760px) { .hide-sm { display: none !important; } }
@media (min-width: 761px) { .show-sm { display: none !important; } }

@keyframes kit-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes kit-pop-in { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes kit-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes kit-fade { from { opacity: 0; } }
@keyframes kit-fade-out { to { opacity: 0; } }
@keyframes kit-sheet-rise { from { transform: translateY(48px); opacity: 0; } }
@keyframes kit-sheet-sink { to { transform: translateY(48px); opacity: 0; } }
@keyframes kit-sheet-slide { from { transform: translateX(36px); opacity: 0; } }
@keyframes kit-sheet-slide-out { to { transform: translateX(36px); opacity: 0; } }
@keyframes kit-shimmer { to { background-position: -300% 0; } }
@keyframes kit-spin { to { transform: rotate(360deg); } }

/* Motion for the bookings master-detail and check-in (progressive; admin.js
   adds .is-entering only right after a row click on a wide screen). */
@media (min-width: 1000px) {
  .md-panel.is-entering { animation: kit-panel-in .34s var(--ease) both; }
  .table tr.current.is-entering > td { animation: kit-row-flash 1s ease-out; }
}
@keyframes kit-panel-in { from { opacity: 0; transform: translateX(28px) scale(.985); } }
@keyframes kit-row-flash { from { background: color-mix(in srgb, var(--accent) 18%, transparent); } }

/* .btn.shine: a light sweep on hover and a springy icon (the big Check in button). */
.btn.shine { position: relative; overflow: hidden; isolation: isolate; }
.btn.shine::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 30%, rgb(255 255 255 / .38) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s var(--ease); pointer-events: none; }
.btn.shine:hover::after, .btn.shine:focus-visible::after { transform: translateX(120%); }
.btn.shine svg { transition: transform .25s cubic-bezier(.2, 1.6, .4, 1); }
.btn.shine:hover svg { transform: scale(1.18) rotate(-8deg); }
.btn.shine:active { transform: translateY(1px) scale(.97); }

/* .alert.celebrate: the success flash after a check-in. A ring and tick draw
   in, a few accent dots burst out, and the ticket code (.is-admitted) glows once. */
.alert.celebrate { align-items: center; gap: 14px; padding: 14px 16px; animation: kit-celebrate-in .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.alert.celebrate::before { display: none; }
.celebrate-mark { position: relative; flex: none; width: 40px; height: 40px; }
.celebrate-mark svg { display: block; width: 40px; height: 40px; fill: none; stroke: var(--ok); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.celebrate-mark circle { fill: color-mix(in srgb, var(--ok) 12%, transparent); stroke-dasharray: 145; stroke-dashoffset: 145; animation: kit-draw .5s .1s ease-out forwards; }
.celebrate-mark path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: kit-draw .35s .5s ease-out forwards; }
.celebrate-mark::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; pointer-events: none;
  box-shadow: 0 -27px var(--accent), 19px -19px var(--ok), 27px 0 var(--info), 19px 19px var(--accent), 0 27px var(--ok), -19px 19px var(--info), -27px 0 var(--accent), -19px -19px var(--ok);
  animation: kit-confetti .75s .45s ease-out both; }
.ticket-code.is-admitted { animation: kit-admit 1.4s .35s ease-out; }
@keyframes kit-celebrate-in { from { opacity: 0; transform: translateY(-6px) scale(.94); } }
@keyframes kit-draw { to { stroke-dashoffset: 0; } }
@keyframes kit-confetti { 0% { opacity: 0; transform: scale(.3); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.7); } }
@keyframes kit-admit { 30% { color: var(--ok); text-shadow: 0 0 18px color-mix(in srgb, var(--ok) 45%, transparent); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .skeleton { animation: none; background: var(--well); }
  .btn:hover, .btn:active, a.card:hover, a.ev-card:hover, .swatch:hover { transform: none; }
  .btn.shine::after { display: none; }
  .btn.shine:hover svg { transform: none; }
  .celebrate-mark::after { display: none; }
}


/* ------------------------------------------------- Languages (ADR 0006)
   Thai stacks vowels and tone marks above and below the line, and neither
   Thai nor Chinese is designed for tight tracking: drop the negative
   letter-spacing, give lines more room and never clip a control's text.
   Thai has no spaces between words, so long labels must be allowed to
   break inside a line. */
:lang(th) body { line-height: 1.65; }
:lang(zh) body { line-height: 1.6; }
:lang(th) :is(h1, h2, h3, h4, .btn, .title-input, .ev-name-input, .stat-value, .tile-value, .ui-cal-title, .poster-title, .label, .table th, .group-title, .tk-name, .ph-name),
:lang(zh) :is(h1, h2, h3, h4, .btn, .title-input, .ev-name-input, .stat-value, .tile-value, .ui-cal-title, .poster-title, .tk-name, .ph-name) { letter-spacing: 0; }
:lang(th) :is(h1, h2, h3, h4, .title-input, .ev-name-input, .poster-title) { line-height: 1.4; }
:lang(zh) :is(h1, h2, h3, h4, .title-input, .ev-name-input, .poster-title) { line-height: 1.3; }
:lang(th) :is(.btn, .pill, .chip, .badge, .menu-item, .segmented a, .tabs a) { line-height: 1.5; }
:lang(th) :is(p, li, dd, td, label, .hint, .alert, .flash, .list-title) { line-break: loose; overflow-wrap: anywhere; }

