/* ==========================================================================
 * AKTVO Festival Studio - tokens and component kit
 *
 * One stylesheet for the whole app. Every class is prefixed st- so nothing
 * here can collide with /styles.css (which the studio does not load). The
 * token values are the ones letsgoaktvo.com uses; the look is an operations
 * console: flat panels, one violet accent, dense text. No gradients on
 * surfaces, no glows, no hover lifts.
 *
 * Views build their screens from these classes (mostly through js/ui.js)
 * and keep view-specific rules in css/<view>.css.
 *
 * INDEX
 *  1. Tokens            :root custom properties (--st-*)
 *  2. Base              reset, type, focus ring, scrollbars
 *  3. Utilities         st-row  st-stack  st-grow  st-grid-2/3/4  st-muted
 *                       st-dim  st-small  st-strong  st-mono  st-num
 *                       st-truncate  st-nowrap  st-sr-only  st-ta-right
 *                       st-ta-center  st-link  st-textlink  st-divider
 *                       st-dot  st-prose  st-hide-narrow
 *  4. App shell         st-app  st-sidebar  st-brand  st-switcher  st-nav
 *                       st-account  st-main  st-topbar  st-content  st-page
 *                       st-narrow-note  st-offline-note  st-skip-link
 *                       st-env-badge
 *  5. Buttons           st-btn  --primary --secondary --ghost --danger
 *                       --sm --icon --block  .is-busy  st-filepicker
 *  6. Form controls     st-field  st-input  st-textarea  st-select
 *                       st-datetime  st-cal  st-search  st-toggle  st-check
 *                       st-chips / st-chip  st-swatches / st-swatch
 *                       st-form-grid  st-form-actions
 *  7. Cards             st-card (--flush)  st-callout --success --warning
 *                       --danger  st-kv
 *  8. Page header       st-page-header  st-page-title  st-page-subtitle
 *  9. Stat tiles        st-stats  st-stat
 * 10. Badges, avatar    st-badge --neutral --violet --green --amber --red
 *                       --blue  st-avatar  st-person  st-thumb
 * 11. Data table        st-toolbar  st-table
 * 12. Tabs              st-tabs  st-tab
 * 13. Dropdown menu     st-menu
 * 14. Dialogs           st-dialog  st-modal --sm --md --lg  st-drawer
 * 15. Toasts            st-toasts  st-toast
 * 16. Empty / loading   st-empty  st-spinner  st-skeleton  st-loading
 *                       st-boot  st-progress
 * 17. Lists             st-list (--divided)  st-list__item  st-list__heading
 *                       st-picker__results
 * 18. Sign-in screen    st-signin
 * 19. Festival picker   st-fest-grid  st-fest-card
 * 20. Gate pages        st-gate (no access, finish setup, not found)
 *                       st-store-link
 * 21. Responsive        960px: sidebar collapses to icons. 720px: note.
 * 22. Reduced motion, print
 * ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --st-bg: #05060a;
  --st-bg-elev: #0b0f1a;
  --st-bg-card: #111627;
  --st-bg-hover: #161c30;
  --st-bg-pop: #171d32;
  --st-bg-head: #0e1322;
  --st-border: rgba(255, 255, 255, 0.08);
  --st-border-strong: rgba(255, 255, 255, 0.14);
  --st-text: #f5f7ff;
  --st-text-dim: #aab2c5;
  /* The site's --text-muted (#6b7280) is under 4.5:1 on dark cards; this is
     the readable muted tone /host and the venue tour use instead. */
  --st-text-muted: #8b93a7;
  --st-violet: #6d5cff;
  --st-violet-2: #7c5cff;
  --st-lavender: #b9aeff;
  --st-blue: #4f7cff;
  --st-green: #34d399;
  --st-amber: #fbbf24;
  --st-red: #fb7185;
  --st-red-text: #fda4af;

  --st-r-8: 8px;
  --st-r-10: 10px;
  --st-r-12: 12px;
  --st-r-14: 14px;

  --st-sidebar-w: 248px;
  --st-topbar-h: 56px;
  --st-page-max: 1280px;
  --st-page-pad: 28px;
  --st-control-h: 38px;

  --st-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --st-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --st-ease: 140ms ease;
  --st-shadow-pop: 0 14px 36px rgba(0, 0, 0, 0.5);
  --st-focus: #b3a8ff;

  color-scheme: dark;
}

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

html { height: 100%; -webkit-text-size-adjust: 100%; }
html.st-has-dialog { overflow: hidden; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--st-bg);
  color: var(--st-text);
  font-family: var(--st-font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
table { border-collapse: collapse; }
strong, b { font-weight: 600; }
::selection { background: rgba(109, 92, 255, 0.45); color: #fff; }

/* One focus ring for everything reachable by keyboard. Inputs draw their
   own (border + soft ring) in section 6. */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--st-focus); outline-offset: 2px; }

* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.16) transparent; }

.st-icon { flex: 0 0 auto; }
.st-icon--emoji { overflow: visible; }

/* ---------- 3. Utilities ---------- */
.st-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.st-row--wrap { flex-wrap: wrap; }
.st-row--between { justify-content: space-between; }
.st-row--end { justify-content: flex-end; }
.st-row--top { align-items: flex-start; }
.st-row--tight { gap: 6px; }
.st-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.st-stack--tight { gap: 8px; }
.st-stack--loose { gap: 24px; }
.st-grow { flex: 1 1 auto; min-width: 0; }
.st-grid-2, .st-grid-3, .st-grid-4 { display: grid; gap: 16px; }
.st-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.st-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.st-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.st-muted { color: var(--st-text-muted); }
.st-dim { color: var(--st-text-dim); }
.st-small { font-size: 12.5px; }
.st-strong { font-weight: 600; color: var(--st-text); }
.st-mono { font-family: var(--st-mono); font-size: 0.93em; }
.st-num { font-variant-numeric: tabular-nums; }
.st-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.st-nowrap { white-space: nowrap; }
.st-ta-right { text-align: right; font-variant-numeric: tabular-nums; }
.st-ta-center { text-align: center; }
.st-sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.st-link { color: var(--st-lavender); font-weight: 500; text-decoration: underline; text-decoration-color: rgba(185, 174, 255, 0.4); text-underline-offset: 3px; }
.st-link:hover { color: #fff; text-decoration-color: currentColor; }
.st-divider { height: 1px; background: var(--st-border); border: 0; margin: 4px 0; }
.st-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--st-text-muted); flex: 0 0 auto; }
.st-prose { color: var(--st-text-dim); font-size: 13.5px; line-height: 1.55; }
.st-prose + .st-prose { margin-top: 10px; }
.st-prose strong { color: var(--st-text); }

/* ---------- 4. App shell ---------- */
.st-app {
  display: grid;
  grid-template-columns: var(--st-sidebar-w) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}
.st-app--plain { grid-template-columns: minmax(0, 1fr); }
/* The spot bidding page (#/bid/...): vendors, often on a phone - the top bar only. */
.st-app--bid { grid-template-columns: minmax(0, 1fr); }
.st-app--bid > .st-sidebar, .st-app--bid .st-narrow-note { display: none !important; }

.st-skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 3000; padding: 8px 12px; border-radius: var(--st-r-8);
  background: var(--st-violet); color: #fff; font-weight: 600; transform: translateY(-200%);
}
.st-skip-link:focus { transform: none; }

.st-sidebar {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--st-bg-elev); border-right: 1px solid var(--st-border);
}
.st-sidebar__top { padding: 14px 12px 8px; display: flex; flex-direction: column; gap: 12px; }
.st-sidebar__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 12px 12px; }
.st-sidebar__foot { padding: 10px 12px 12px; border-top: 1px solid var(--st-border); }

.st-brand { display: inline-flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: var(--st-r-8); font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.st-brand__mark { width: 28px; height: 28px; border-radius: 7px; overflow: hidden; flex: 0 0 auto; }
.st-brand__mark img { width: 100%; height: 100%; object-fit: cover; }
.st-brand__tag {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--st-lavender); padding: 2px 6px; border-radius: 5px; background: rgba(109, 92, 255, 0.16);
}

.st-switcher {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; text-align: left;
  border: 1px solid var(--st-border); border-radius: var(--st-r-10); background: rgba(255, 255, 255, 0.02);
  transition: background var(--st-ease), border-color var(--st-ease);
}
.st-switcher:hover { background: var(--st-bg-hover); border-color: var(--st-border-strong); }
.st-switcher__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.st-switcher__label { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--st-text-muted); }
.st-switcher__title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-switcher .st-icon { color: var(--st-text-muted); }

.st-nav { display: flex; flex-direction: column; gap: 2px; }
.st-nav__heading { padding: 10px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--st-text-muted); }
.st-nav__item {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--st-r-8);
  color: var(--st-text-dim); font-size: 13.5px; font-weight: 500;
  transition: background var(--st-ease), color var(--st-ease);
}
.st-nav__item:hover { background: rgba(255, 255, 255, 0.05); color: var(--st-text); }
.st-nav__item[aria-current="page"] { background: rgba(109, 92, 255, 0.16); color: #fff; font-weight: 600; }
.st-nav__item[aria-current="page"] .st-icon { color: var(--st-lavender); }
.st-nav__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-nav__beta {
  margin-left: auto; padding: 1px 6px; border-radius: 999px; border: 1px solid rgba(109, 92, 255, 0.45);
  color: var(--st-lavender); font-size: 10.5px; font-weight: 600; letter-spacing: 0.03em; line-height: 16px;
}

.st-account { display: flex; align-items: center; gap: 10px; min-width: 0; }
.st-account__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.st-account__name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-account__sub { font-size: 12px; color: var(--st-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.st-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.st-topbar {
  flex: 0 0 var(--st-topbar-h); height: var(--st-topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 var(--st-page-pad);
  border-bottom: 1px solid var(--st-border); background: var(--st-bg);
}
.st-topbar__title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.st-topbar__name { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-topbar__actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.st-topbar__avatar { border-radius: 50%; display: inline-flex; }

.st-content { flex: 1 1 auto; min-height: 0; overflow: auto; position: relative; }
.st-content:focus-visible { outline: none; }
.st-page { max-width: var(--st-page-max); margin: 0 auto; padding: 24px var(--st-page-pad) 48px; }
/* Full-bleed views (the map): the view element fills the content area. */
.st-content--bleed { overflow: hidden; }
.st-content--bleed > .st-page { max-width: none; height: 100%; padding: 0; }

.st-narrow-note { display: none; }

/* Offline notice, between the top bar and the page. It is a live region, so
   the element stays in the page and only its content comes and goes; empty,
   it takes no room. */
.st-offline-note { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--st-text); background: rgba(251, 191, 36, 0.08); }
.st-offline-note:not(:empty) { padding: 8px var(--st-page-pad); border-bottom: 1px solid rgba(251, 191, 36, 0.3); }
.st-offline-note .st-icon { color: var(--st-amber); }

.st-env-badge {
  position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 900; pointer-events: none;
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
  color: #fcd34d; background: #2a2210; border: 1px solid rgba(251, 191, 36, 0.4);
}

/* ---------- 5. Buttons ---------- */
.st-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 0 0 auto;
  height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--st-r-10);
  font-size: 13.5px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer; user-select: none;
  color: var(--st-text); background: transparent;
  transition: background var(--st-ease), border-color var(--st-ease), color var(--st-ease), opacity var(--st-ease);
}
.st-btn--primary { background: var(--st-violet); color: #fff; }
.st-btn--primary:hover { background: #7a6bff; }
.st-btn--primary:active { background: #5f4ef0; }
.st-btn--secondary { border-color: var(--st-border-strong); background: rgba(255, 255, 255, 0.02); }
.st-btn--secondary:hover { background: var(--st-bg-hover); border-color: rgba(255, 255, 255, 0.22); }
.st-btn--ghost { color: var(--st-text-dim); }
.st-btn--ghost:hover { background: rgba(255, 255, 255, 0.06); color: var(--st-text); }
.st-btn--danger { color: #fecdd3; background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.4); }
.st-btn--danger:hover { background: rgba(251, 113, 133, 0.2); border-color: rgba(251, 113, 133, 0.6); }
.st-btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; gap: 6px; border-radius: var(--st-r-8); }
.st-btn--icon { width: 36px; padding: 0; }
.st-btn--icon.st-btn--sm { width: 30px; }
.st-btn--block { display: flex; width: 100%; }
/* aria-disabled is how a button is switched off without losing the keyboard
   focus (busy buttons, and the rest of a dialog while one action runs). */
.st-btn:disabled, .st-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.st-btn:disabled:hover, .st-btn[aria-disabled="true"]:hover { background: transparent; }
.st-btn--primary:disabled:hover, .st-btn--primary[aria-disabled="true"]:hover, .st-btn--primary[aria-disabled="true"]:active { background: var(--st-violet); }
.st-btn--secondary:disabled:hover, .st-btn--secondary[aria-disabled="true"]:hover { background: rgba(255, 255, 255, 0.02); border-color: var(--st-border-strong); }
.st-btn--ghost[aria-disabled="true"]:hover { color: var(--st-text-dim); }
.st-btn--danger:disabled:hover, .st-btn--danger[aria-disabled="true"]:hover { background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.4); }
/* Busy: the spinner takes the icon's place; the label stays so the button
   keeps its width. */
.st-btn.is-busy { cursor: progress; opacity: 0.8; }
.st-btn.is-busy > .st-icon { display: none; }
.st-btn__spinner {
  width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.3); border-top-color: currentColor;
  animation: st-spin 0.8s linear infinite;
}
.st-filepicker { display: inline-flex; }

/* ---------- 6. Form controls ---------- */
.st-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.st-field__label { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--st-text-dim); }
.st-field__label strong { color: var(--st-text); }
.st-field__optional { font-weight: 500; color: var(--st-text-muted); }
.st-field__foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.st-field__hint { font-size: 12.5px; line-height: 1.45; color: var(--st-text-muted); }
.st-field__counter { margin-left: auto; font-size: 12px; color: var(--st-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-field__error { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; font-weight: 600; line-height: 1.4; color: var(--st-red-text); }
.st-field__error::before {
  content: "!"; flex: 0 0 auto; width: 15px; height: 15px; margin-top: 1px; border-radius: 50%;
  background: var(--st-red); color: #14080b; font-weight: 800; font-size: 10.5px; line-height: 15px; text-align: center;
}

.st-input {
  width: 100%; height: var(--st-control-h); padding: 0 12px;
  border: 1px solid var(--st-border-strong); border-radius: var(--st-r-10);
  background: var(--st-bg-elev); color: var(--st-text); font-size: 13.5px; line-height: 1.4;
  transition: border-color var(--st-ease), box-shadow var(--st-ease);
}
.st-input::placeholder { color: var(--st-text-muted); opacity: 1; }
.st-input:hover { border-color: rgba(255, 255, 255, 0.22); }
/* Same pattern as the /host form: violet border plus a soft ring. The
   transparent outline keeps a visible ring in forced-colours mode. */
.st-input:focus, .st-input:focus-visible {
  outline: 2px solid transparent; outline-offset: 0;
  border-color: var(--st-violet-2); box-shadow: 0 0 0 3px rgba(109, 92, 255, 0.25);
}
.st-input:disabled { opacity: 0.55; cursor: not-allowed; }
.st-input[readonly] { color: var(--st-text-dim); }
.st-input--sm { height: 32px; font-size: 13px; padding: 0 10px; border-radius: var(--st-r-8); }
.st-input--number { font-variant-numeric: tabular-nums; }
/* ui.js moneyInput: a '$' in front of a text input read as integer cents. */
.st-money { position: relative; display: block; }
.st-money__prefix {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 13.5px; color: var(--st-text-muted); pointer-events: none; font-variant-numeric: tabular-nums;
}
.st-money .st-money__input { padding-left: 24px; }
.st-money--sm .st-money__prefix { left: 10px; font-size: 13px; }
.st-money--sm .st-money__input { padding-left: 21px; }
.st-field.is-invalid .st-input, .st-input[aria-invalid="true"] { border-color: var(--st-red); box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.22); }
.st-textarea { height: auto; min-height: 88px; padding: 9px 12px; line-height: 1.5; resize: vertical; }
.st-select {
  -webkit-appearance: none; appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aab2c5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
.st-select option, .st-select optgroup { color: var(--st-text); background: var(--st-bg-elev); }

/* Date and time (ui.js dateTimeInput / dateInput): a typed date with the
   Studio's calendar button in it, and a typed time. The browser's own
   pickers are never used (data/date-picker.js says why), so their buttons
   are hidden on every date and time field. */
.st-input[type="date"]::-webkit-calendar-picker-indicator,
.st-input[type="time"]::-webkit-calendar-picker-indicator,
.st-input[type="datetime-local"]::-webkit-calendar-picker-indicator { display: none; }
.st-datetime { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.st-datetime .st-input { font-variant-numeric: tabular-nums; }
.st-datetime__parts { display: flex; align-items: center; gap: 6px; flex: 1 1 250px; min-width: 0; max-width: 300px; }
.st-datetime--date .st-datetime__parts { flex-basis: 150px; max-width: 200px; }
.st-datetime__datebox { position: relative; display: flex; flex: 1 1 150px; min-width: 128px; }
.st-datetime__date { flex: 1 1 auto; width: 100%; min-width: 0; padding-right: 38px; }
.st-datetime__time { flex: 0 1 112px; width: 112px; min-width: 88px; }
.st-datetime__cal {
  position: absolute; top: 50%; right: 4px; width: 30px; height: 30px; margin-top: -15px;
  display: grid; place-items: center; border-radius: 7px; color: var(--st-text-muted);
  transition: background var(--st-ease), color var(--st-ease);
}
.st-datetime__cal:hover { color: var(--st-text); background: rgba(255, 255, 255, 0.07); }
.st-datetime__cal[aria-expanded="true"] { color: var(--st-lavender); background: rgba(109, 92, 255, 0.18); }
.st-datetime__cal:focus-visible { outline-offset: 0; }
.st-datetime--sm .st-datetime__date { padding-right: 32px; }
.st-datetime--sm .st-datetime__cal { width: 26px; height: 26px; margin-top: -13px; right: 3px; border-radius: 6px; }
.st-datetime--sm .st-datetime__time { width: 104px; }
.st-datetime__zone { font-size: 12.5px; color: var(--st-text-muted); white-space: nowrap; }
.st-datetime__yours { flex: 1 0 100%; font-size: 12.5px; color: var(--st-text-muted); }

/* The calendar. A top-layer popover where the browser has them (above
   dialogs), a fixed panel otherwise; placed by the same code as st-menu. */
.st-cal {
  position: fixed; z-index: 1000; inset: auto; margin: 0; width: 280px; max-width: calc(100vw - 16px); padding: 10px 10px 8px;
  overflow: visible; color: var(--st-text); background: var(--st-bg-pop);
  border: 1px solid var(--st-border-strong); border-radius: var(--st-r-12); box-shadow: var(--st-shadow-pop);
  animation: st-fade-in 110ms ease;
}
.st-cal:focus { outline: none; }
.st-cal__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.st-cal__title { font-size: 13.5px; font-weight: 600; }
.st-cal__nav {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--st-text-dim);
  transition: background var(--st-ease), color var(--st-ease);
}
.st-cal__nav:hover { background: rgba(255, 255, 255, 0.07); color: var(--st-text); }
.st-cal__nav:disabled { opacity: 0.35; cursor: not-allowed; background: transparent; }
.st-cal__grid { width: 100%; table-layout: fixed; }
.st-cal__grid th { padding: 4px 0 6px; font-size: 11.5px; font-weight: 600; color: var(--st-text-muted); text-align: center; }
.st-cal__grid td { padding: 1px; text-align: center; }
.st-cal__day {
  width: 100%; height: 32px; border-radius: 8px; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--st-text);
  transition: background var(--st-ease), color var(--st-ease);
}
.st-cal__day:hover { background: rgba(255, 255, 255, 0.08); }
.st-cal__day.is-outside { color: var(--st-text-muted); }
.st-cal__day.is-today { font-weight: 700; color: var(--st-lavender); box-shadow: inset 0 0 0 1px rgba(185, 174, 255, 0.55); }
.st-cal__day.is-selected, .st-cal__day.is-selected:hover { background: var(--st-violet); color: #fff; font-weight: 600; box-shadow: none; }
.st-cal__day:disabled { opacity: 0.3; cursor: not-allowed; background: transparent; }
.st-cal__day:focus-visible { outline: 2px solid var(--st-focus); outline-offset: -1px; }
.st-cal__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--st-border); }

.st-search { position: relative; display: flex; align-items: center; min-width: 0; }
.st-search__icon { position: absolute; left: 11px; color: var(--st-text-muted); pointer-events: none; }
.st-search__input { padding-left: 34px; padding-right: 32px; }
.st-search__input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.st-search__clear {
  position: absolute; right: 6px; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 6px; color: var(--st-text-muted);
}
.st-search__clear:hover { color: var(--st-text); background: rgba(255, 255, 255, 0.07); }

.st-toggle { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.st-toggle.is-disabled { cursor: not-allowed; opacity: 0.55; }
.st-toggle__input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.st-toggle__track {
  position: relative; flex: 0 0 auto; width: 36px; height: 20px; margin-top: 1px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.16); transition: background var(--st-ease);
}
.st-toggle__thumb {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  transition: transform var(--st-ease);
}
.st-toggle__input:checked + .st-toggle__track { background: var(--st-violet); }
.st-toggle__input:checked + .st-toggle__track .st-toggle__thumb { transform: translateX(16px); }
.st-toggle__input:focus-visible + .st-toggle__track { outline: 2px solid var(--st-focus); outline-offset: 2px; }
.st-toggle__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-toggle__label { font-size: 13.5px; font-weight: 500; }
.st-toggle__desc { font-size: 12.5px; color: var(--st-text-muted); line-height: 1.45; }

.st-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.st-check__input { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; accent-color: var(--st-violet); cursor: pointer; }
.st-check__input:disabled { cursor: not-allowed; opacity: 0.5; }

.st-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.st-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--st-border-strong); background: transparent; color: var(--st-text-dim);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background var(--st-ease), border-color var(--st-ease), color var(--st-ease);
}
.st-chip:hover { background: rgba(255, 255, 255, 0.05); color: var(--st-text); }
.st-chip.is-active { background: rgba(109, 92, 255, 0.2); border-color: rgba(124, 92, 255, 0.7); color: #fff; }
.st-chip:disabled { opacity: 0.45; cursor: not-allowed; }
.st-chip__dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.st-chip__count { font-size: 12px; color: var(--st-text-muted); font-variant-numeric: tabular-nums; }
.st-chip.is-active .st-chip__count { color: #d7d1ff; }
.st-chips--sm .st-chip { height: 26px; padding: 0 10px; font-size: 12.5px; }

.st-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.st-swatch {
  --st-swatch: transparent;
  position: relative; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--st-swatch); border: 1px solid rgba(255, 255, 255, 0.22); color: #fff;
  transition: box-shadow var(--st-ease);
}
.st-swatch:hover { box-shadow: 0 0 0 2px var(--st-bg-card), 0 0 0 3px rgba(255, 255, 255, 0.35); }
.st-swatch.is-active { box-shadow: 0 0 0 2px var(--st-bg-card), 0 0 0 4px var(--st-focus); }
.st-swatch.is-light { color: #14161f; }
.st-swatch__check { opacity: 0; }
.st-swatch.is-active .st-swatch__check { opacity: 1; }
.st-swatch--none { color: var(--st-text-muted); background: var(--st-bg-elev); }
.st-swatch-custom { position: relative; display: inline-flex; }
.st-swatch--custom.is-empty { border-style: dashed; color: var(--st-text-dim); }
.st-swatch--custom .st-swatch__check { position: absolute; }
.st-swatch--custom.is-active .st-swatch__custom-icon { display: none; }
.st-swatch__picker { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; border: 0; padding: 0; }

/* Two fields per row; add st-field--full to span both. */
.st-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 16px; }
.st-form-grid > .st-field--full, .st-field--full { grid-column: 1 / -1; }
.st-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 4px; }

/* ---------- 7. Cards ---------- */
.st-card { background: var(--st-bg-card); border: 1px solid var(--st-border); border-radius: var(--st-r-14); min-width: 0; }
/* Not enough room for the title and the actions side by side (a phone, a
   drawer): the actions go under the title instead of squeezing the
   description to one word per line. */
.st-card__header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding: 16px 20px 0; }
.st-card__heading { min-width: 0; flex: 1 1 220px; }
.st-card__title { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.35; }
.st-card__desc { margin-top: 3px; font-size: 13px; color: var(--st-text-muted); line-height: 1.5; max-width: 72ch; }
.st-card__actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.st-card__body { padding: 16px 20px 20px; }
.st-card__body > * + * { margin-top: 16px; }
.st-card--flush > .st-card__body { padding: 0; }
.st-card--flush > .st-card__header { padding-bottom: 14px; }
.st-card--flush > .st-card__body > .st-table { border: 0; border-radius: 0 0 var(--st-r-14) var(--st-r-14); }
.st-card--flush > .st-card__header + .st-card__body > .st-table { border-top: 1px solid var(--st-border); }

.st-callout {
  display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--st-r-12);
  border: 1px solid var(--st-border-strong); background: rgba(255, 255, 255, 0.03); font-size: 13.5px;
}
.st-callout__icon { flex: 0 0 auto; margin-top: 1px; color: var(--st-lavender); }
.st-callout__content { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.st-callout__title { font-weight: 600; }
.st-callout__body, .st-callout__body .st-prose { color: var(--st-text-dim); }
.st-callout__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.st-callout--success { border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.07); }
.st-callout--success .st-callout__icon { color: var(--st-green); }
.st-callout--warning { border-color: rgba(251, 191, 36, 0.38); background: rgba(251, 191, 36, 0.07); }
.st-callout--warning .st-callout__icon { color: var(--st-amber); }
.st-callout--danger { border-color: rgba(251, 113, 133, 0.42); background: rgba(251, 113, 133, 0.08); }
.st-callout--danger .st-callout__icon { color: var(--st-red); }

.st-kv { display: flex; flex-direction: column; }
.st-kv__row { display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--st-border); font-size: 13.5px; }
.st-kv__row:last-child { border-bottom: 0; }
.st-kv dt { color: var(--st-text-muted); }
.st-kv dd { min-width: 0; overflow-wrap: anywhere; }

/* ---------- 8. Page header ---------- */
.st-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.st-page-header__text { min-width: 0; flex: 1 1 320px; }
.st-page-header__title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.st-page-header__badges { display: flex; align-items: center; gap: 6px; }
.st-page-header__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.st-page-header__back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12.5px; font-weight: 500; color: var(--st-text-muted); }
.st-page-header__back:hover { color: var(--st-text); }
.st-page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; }
.st-page-subtitle { margin-top: 4px; font-size: 13.5px; color: var(--st-text-dim); max-width: 80ch; }
.st-section-title { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; }

/* ---------- 9. Stat tiles ---------- */
.st-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.st-stat { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 14px 16px; border-radius: var(--st-r-12); background: var(--st-bg-card); border: 1px solid var(--st-border); }
.st-stat__label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--st-text-dim); }
.st-stat__label .st-icon { color: var(--st-text-muted); }
.st-stat__value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.st-stat__hint { font-size: 12.5px; color: var(--st-text-muted); line-height: 1.4; }
.st-stat--violet .st-stat__value { color: var(--st-lavender); }
.st-stat--green .st-stat__value { color: #6ee7b7; }
.st-stat--amber .st-stat__value { color: #fcd34d; }
.st-stat--red .st-stat__value { color: var(--st-red-text); }
.st-stat--blue .st-stat__value { color: #93b4ff; }

/* ---------- 10. Badges, avatar ---------- */
.st-badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; flex: 0 0 auto;
  font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap;
  color: var(--st-text-dim); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--st-border);
}
.st-badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-badge--violet { color: #c9c1ff; background: rgba(109, 92, 255, 0.18); border-color: rgba(124, 92, 255, 0.4); }
.st-badge--green { color: #6ee7b7; background: rgba(52, 211, 153, 0.13); border-color: rgba(52, 211, 153, 0.32); }
.st-badge--amber { color: #fcd34d; background: rgba(251, 191, 36, 0.13); border-color: rgba(251, 191, 36, 0.32); }
.st-badge--red { color: var(--st-red-text); background: rgba(251, 113, 133, 0.13); border-color: rgba(251, 113, 133, 0.36); }
.st-badge--blue { color: #93b4ff; background: rgba(79, 124, 255, 0.16); border-color: rgba(79, 124, 255, 0.38); }

.st-avatar {
  position: relative; display: inline-grid; place-items: center; flex: 0 0 auto; overflow: hidden; border-radius: 50%;
  background: #232a45; color: #d7d1ff; font-weight: 600; line-height: 1; user-select: none;
}
.st-avatar__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.st-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.st-person__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.st-person__name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-person__sub { font-size: 12.5px; color: var(--st-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.st-thumb { width: 40px; height: 40px; border-radius: var(--st-r-8); object-fit: cover; background: var(--st-bg-elev); border: 1px solid var(--st-border); flex: 0 0 auto; }

/* ---------- 11. Data table ---------- */
/* Row above a table: search on the left, filters, then actions pushed right
   with st-grow in between. */
.st-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 12px; }
.st-toolbar .st-search { flex: 0 1 300px; }

.st-table { background: var(--st-bg-card); border: 1px solid var(--st-border); border-radius: var(--st-r-14); overflow: hidden; min-width: 0; }
/* The header sticks inside this scroll area, so the area needs a height cap.
   The default leaves room for the top bar, page header and toolbar. */
.st-table__scroll { overflow: auto; max-height: max(320px, calc(100dvh - 300px)); overscroll-behavior: contain; }
.st-table__scroll--free { max-height: none; overflow-y: visible; }
.st-table__scroll:focus-visible { outline-offset: -2px; }
.st-table__table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.st-table__table th {
  position: sticky; top: 0; z-index: 1; height: 38px; padding: 0 14px; text-align: left; white-space: nowrap;
  background: var(--st-bg-head); border-bottom: 1px solid var(--st-border);
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--st-text-muted);
}
.st-table__table th.st-ta-right { text-align: right; }
.st-table__table th.st-ta-center { text-align: center; }
.st-table__table td { height: 44px; padding: 6px 14px; border-bottom: 1px solid var(--st-border); vertical-align: middle; }
.st-table__row:last-child td { border-bottom: 0; }
.st-table__row:hover td { background: var(--st-bg-hover); }
.st-table__row.is-selected td { background: rgba(109, 92, 255, 0.1); }
.st-table__row--clickable { cursor: pointer; }
.st-table__row--clickable:focus-visible { outline-offset: -2px; }
.st-table__row--skeleton:hover td { background: transparent; }
.st-table__select { width: 44px; padding-right: 0 !important; }
/* Icons are block-level, so text-align alone does not place them. */
.st-table__table td.st-ta-center > .st-icon { margin: 0 auto; }
.st-table__table td.st-ta-right > .st-icon { margin-left: auto; }
/* Sortable header: the whole label is a button; the arrow shows the state. */
.st-table__sort { display: inline-flex; align-items: center; gap: 4px; height: 26px; margin: 0 -6px; padding: 0 6px; border-radius: 6px; font: inherit; letter-spacing: inherit; color: inherit; }
.st-table__sort:hover { color: var(--st-text); background: rgba(255, 255, 255, 0.05); }
.st-table__sort-icon {
  width: 12px; height: 12px; flex: 0 0 auto; background: currentColor; opacity: 0.45;
  -webkit-mask: var(--st-sort-icon) center / contain no-repeat; mask: var(--st-sort-icon) center / contain no-repeat;
  --st-sort-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E");
}
th[aria-sort="ascending"] .st-table__sort, th[aria-sort="descending"] .st-table__sort { color: var(--st-text); }
th[aria-sort="ascending"] .st-table__sort-icon, th[aria-sort="descending"] .st-table__sort-icon { opacity: 1; color: var(--st-lavender); }
th[aria-sort="ascending"] .st-table__sort-icon { --st-sort-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 7-7 7 7'/%3E%3Cpath d='M12 19V5'/%3E%3C/svg%3E"); }
th[aria-sort="descending"] .st-table__sort-icon { --st-sort-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='m19 12-7 7-7-7'/%3E%3C/svg%3E"); }
.st-table__empty { border-bottom: 1px solid var(--st-border); }
.st-table__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 6px 8px 6px 14px; border-top: 1px solid var(--st-border); background: var(--st-bg-card); }
.st-table__scroll[hidden] + .st-table__empty + .st-table__footer { border-top: 0; }
.st-table__count { font-size: 12.5px; color: var(--st-text-muted); font-variant-numeric: tabular-nums; }
.st-table__pager { display: flex; align-items: center; gap: 2px; }
.st-table__page { padding: 0 8px; font-size: 12.5px; color: var(--st-text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- 12. Tabs ---------- */
.st-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--st-border); overflow-x: auto; scrollbar-width: none; }
.st-tabs::-webkit-scrollbar { display: none; }
.st-tab {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; margin-bottom: -1px; flex: 0 0 auto;
  border-bottom: 2px solid transparent; color: var(--st-text-dim); font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: color var(--st-ease), border-color var(--st-ease);
}
.st-tab:hover { color: var(--st-text); }
.st-tab.is-active { color: var(--st-text); font-weight: 600; border-bottom-color: var(--st-violet-2); }
.st-tab:disabled { opacity: 0.45; cursor: not-allowed; }
.st-tab:focus-visible { outline-offset: -2px; border-radius: 6px; }
.st-tab__count { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; background: rgba(255, 255, 255, 0.08); color: var(--st-text-dim); }
.st-tab.is-active .st-tab__count { background: rgba(109, 92, 255, 0.26); color: #d7d1ff; }

/* ---------- 13. Dropdown menu ---------- */
.st-menu {
  position: fixed; z-index: 1000; min-width: 200px; max-width: min(340px, calc(100vw - 16px)); overflow-y: auto; padding: 4px;
  background: var(--st-bg-pop); border: 1px solid var(--st-border-strong); border-radius: var(--st-r-10);
  box-shadow: var(--st-shadow-pop); animation: st-fade-in 110ms ease;
}
.st-menu__item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 6px 10px; border-radius: 7px;
  text-align: left; font-size: 13.5px; font-weight: 500; color: var(--st-text); cursor: pointer;
}
.st-menu__item:hover, .st-menu__item:focus-visible { background: rgba(255, 255, 255, 0.08); outline: none; }
.st-menu__item .st-icon { color: var(--st-text-muted); }
.st-menu__item:disabled { opacity: 0.45; cursor: not-allowed; background: transparent; }
.st-menu__item.is-danger, .st-menu__item.is-danger .st-icon { color: var(--st-red-text); }
.st-menu__item.is-danger:hover, .st-menu__item.is-danger:focus-visible { background: rgba(251, 113, 133, 0.14); }
.st-menu__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-menu__hint { flex: 0 0 auto; font-size: 12px; color: var(--st-text-muted); }
.st-menu__gap { width: 16px; flex: 0 0 auto; }
.st-menu__item .st-menu__check { color: var(--st-lavender); }
.st-menu__divider { height: 1px; margin: 4px 0; background: var(--st-border); }
.st-menu__heading { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--st-text-muted); }

/* ---------- 14. Dialogs ---------- */
.st-dialog { padding: 0; border: 0; background: transparent; color: var(--st-text); max-width: none; max-height: none; overflow: visible; }
.st-dialog::backdrop { background: rgba(3, 4, 8, 0.68); animation: st-fade-in 140ms ease; }
.st-dialog__panel { display: flex; flex-direction: column; min-height: 0; background: var(--st-bg-card); border: 1px solid var(--st-border-strong); }
.st-dialog__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 14px 12px 20px; }
.st-dialog__heading { min-width: 0; }
.st-dialog__title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.4; padding-top: 3px; overflow-wrap: anywhere; }
.st-dialog__subtitle { margin-top: 2px; font-size: 13px; color: var(--st-text-muted); }
.st-dialog__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 20px; }
.st-dialog__body > * + * { margin-top: 16px; }
.st-dialog__footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--st-border); }
.st-dialog__footer-start, .st-dialog__footer-end { display: flex; align-items: center; gap: 8px; }
.st-dialog__footer-end { margin-left: auto; }
.st-dialog.is-busy .st-dialog__body { pointer-events: none; opacity: 0.7; }

/* The entrance animation is on the panel, never on the <dialog>: a transform
   on the dialog would become the containing block of the fixed-position
   menus and toasts that live inside it and throw them off screen. */
.st-modal { margin: auto; width: min(var(--st-modal-w, 560px), calc(100vw - 32px)); }
.st-modal .st-dialog__panel { max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); border-radius: var(--st-r-14); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55); animation: st-pop-in 140ms ease; }
.st-modal--sm { --st-modal-w: 420px; }
.st-modal--md { --st-modal-w: 560px; }
.st-modal--lg { --st-modal-w: 840px; }

.st-drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0; height: 100vh; height: 100dvh;
  width: min(var(--st-drawer-w, 480px), 100vw);
}
.st-drawer .st-dialog__panel { height: 100%; border-width: 0 0 0 1px; box-shadow: -18px 0 48px rgba(0, 0, 0, 0.45); animation: st-slide-in 150ms ease; }
.st-drawer .st-dialog__header { padding-top: 18px; border-bottom: 1px solid var(--st-border); }
.st-drawer .st-dialog__body { padding-top: 18px; }
.st-drawer .st-dialog__title:focus-visible { outline: none; }
/* Put back after the browser closed it against a guard (ui.js openLayer):
   it never left as far as the user is concerned, so it does not slide in again. */
.st-dialog--reopened .st-dialog__panel, .st-dialog--reopened::backdrop { animation: none; }

/* ---------- 15. Toasts ---------- */
.st-toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px;
  width: min(400px, calc(100vw - 32px)); pointer-events: none;
}
.st-toasts:empty { display: none; }
.st-toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px 10px 12px;
  background: var(--st-bg-pop); border: 1px solid var(--st-border-strong); border-radius: var(--st-r-10);
  box-shadow: var(--st-shadow-pop); font-size: 13.5px; line-height: 1.45; animation: st-toast-in 150ms ease;
  transition: opacity 140ms ease, transform 140ms ease;
}
.st-toast.is-leaving { opacity: 0; transform: translateY(6px); }
.st-toast__icon { flex: 0 0 auto; margin-top: 1px; color: var(--st-lavender); }
.st-toast--success .st-toast__icon { color: var(--st-green); }
.st-toast--error { border-color: rgba(251, 113, 133, 0.45); }
.st-toast--error .st-toast__icon { color: var(--st-red); }
.st-toast__text { flex: 1 1 auto; min-width: 0; padding-top: 1px; overflow-wrap: anywhere; }
.st-toast__action { margin: -3px 0; color: var(--st-lavender); }
.st-toast__close { flex: 0 0 auto; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--st-text-muted); }
.st-toast__close:hover { color: var(--st-text); background: rgba(255, 255, 255, 0.07); }

/* ---------- 16. Empty and loading states ---------- */
.st-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 56px 24px; }
.st-empty--compact { padding: 32px 20px; }
.st-empty__icon {
  width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 6px; border-radius: var(--st-r-12);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--st-border); color: var(--st-text-dim);
}
.st-empty--compact .st-empty__icon { width: 38px; height: 38px; }
.st-empty__title { font-size: 15px; font-weight: 600; }
.st-empty__body { max-width: 460px; font-size: 13.5px; color: var(--st-text-dim); }
.st-empty__body .st-prose { color: inherit; }
.st-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }

/* The spinner keeps turning under reduced motion: it is the only sign that
   work is in progress, and it is small. Everything else stops (section 22). */
.st-spinner {
  display: inline-block; flex: 0 0 auto; border-radius: 50%; vertical-align: -3px;
  border: 2px solid rgba(255, 255, 255, 0.18); border-top-color: var(--st-lavender);
  animation: st-spin 0.8s linear infinite;
}
.st-skeleton { display: flex; flex-direction: column; gap: 10px; }
.st-skeleton__line { display: block; height: 12px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); animation: st-pulse 1.3s ease-in-out infinite alternate; }
.st-table__row--skeleton .st-skeleton__line { width: 100%; max-width: 520px; }
.st-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px 24px; color: var(--st-text-dim); font-size: 13.5px; }
.st-boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.st-boot .st-spinner { width: 28px; height: 28px; }

.st-progress { display: flex; flex-direction: column; gap: 6px; }
.st-progress__track { display: block; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.st-progress__bar { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--st-violet-2); transition: width 160ms ease; }
.st-progress__text { font-size: 12.5px; color: var(--st-text-muted); font-variant-numeric: tabular-nums; }

/* ---------- 17. Lists ---------- */
.st-list { display: flex; flex-direction: column; }
.st-list__item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 10px; border-radius: var(--st-r-10); text-align: left; }
button.st-list__item, a.st-list__item { cursor: pointer; transition: background var(--st-ease); }
button.st-list__item:hover, a.st-list__item:hover { background: var(--st-bg-hover); }
.st-list__item + .st-list__item { margin-top: 2px; }
.st-list__heading { padding: 4px 10px 8px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--st-text-muted); }
.st-list--divided .st-list__item { border-radius: 0; padding-left: 0; padding-right: 0; }
.st-list--divided .st-list__item + .st-list__item { margin-top: 0; border-top: 1px solid var(--st-border); }
.st-picker__results { min-height: 260px; max-height: min(52vh, 420px); overflow-y: auto; margin: 14px -8px 0 !important; padding: 0 8px; }

/* ---------- 18. Sign-in screen ---------- */
.st-signin { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.st-signin__brand { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 40px 56px; background: var(--st-bg-elev); border-right: 1px solid var(--st-border); }
.st-signin__pitch { max-width: 480px; }
.st-signin__pitch h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 14px; }
.st-signin__pitch > p { font-size: 15px; color: var(--st-text-dim); line-height: 1.6; }
.st-signin__points { display: grid; gap: 12px; margin-top: 28px; }
.st-signin__points li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--st-text); }
.st-signin__points .st-icon { color: var(--st-lavender); margin-top: 2px; }
.st-signin__foot { font-size: 12.5px; color: var(--st-text-muted); }
.st-signin__main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.st-signin__form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.st-signin__form h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.st-signin__lead { margin-top: -8px; font-size: 13.5px; color: var(--st-text-dim); }
.st-signin__error { padding: 10px 12px; border-radius: var(--st-r-10); font-size: 13px; font-weight: 500; color: #fecdd3; background: rgba(251, 113, 133, 0.1); border: 1px solid rgba(251, 113, 133, 0.4); }
.st-signin__notice { padding: 10px 12px; border-radius: var(--st-r-10); font-size: 13px; color: var(--st-text); background: rgba(52, 211, 153, 0.08); border: 1px solid rgba(52, 211, 153, 0.35); }
.st-signin__pw { position: relative; }
.st-signin__pw .st-input { padding-right: 42px; }
.st-signin__reveal { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; color: var(--st-text-muted); }
.st-signin__reveal:hover { color: var(--st-text); background: rgba(255, 255, 255, 0.06); }
.st-signin__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -6px; }
.st-signin__or { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--st-text-muted); }
.st-signin__or::before, .st-signin__or::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--st-border); }
.st-signin__note { font-size: 12.5px; color: var(--st-text-muted); line-height: 1.55; }
.st-textlink { color: var(--st-lavender); font-size: 13px; font-weight: 500; }
.st-textlink:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 19. Festival picker ---------- */
.st-fest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.st-fest-card {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--st-bg-card); border: 1px solid var(--st-border); border-radius: var(--st-r-14);
  transition: border-color var(--st-ease), background var(--st-ease);
}
a.st-fest-card:hover { border-color: rgba(255, 255, 255, 0.24); background: #131930; }
a.st-fest-card:focus-visible { outline-offset: 3px; }
.st-fest-card__cover { position: relative; aspect-ratio: 16 / 8; background: var(--st-bg-elev); border-bottom: 1px solid var(--st-border); overflow: hidden; }
.st-fest-grid > li { display: flex; min-width: 0; }
.st-fest-grid > li > .st-fest-card { flex: 1 1 auto; }
.st-fest-card__media { position: absolute; inset: 0; }
.st-fest-card__media img { width: 100%; height: 100%; object-fit: cover; }
.st-fest-card__placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--st-text-muted); }
.st-fest-card__badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.st-fest-card__badges .st-badge { background-color: rgba(10, 13, 24, 0.86); }
.st-fest-card__body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; min-width: 0; }
.st-fest-card__title { font-size: 15.5px; font-weight: 600; letter-spacing: -0.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-fest-card__meta { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--st-text-dim); }
.st-fest-card__meta > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.st-fest-card__meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-fest-card__meta .st-icon { color: var(--st-text-muted); }
.st-fest-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; min-height: 22px; }
.st-fest-card__open { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--st-text-muted); }
a.st-fest-card:hover .st-fest-card__open { color: var(--st-lavender); }

/* ---------- 20. Gate pages ---------- */
.st-gate { min-height: 100%; display: grid; place-items: center; padding: 40px 24px; }
.st-gate--screen { min-height: 100vh; min-height: 100dvh; }
.st-gate__card { width: 100%; max-width: 480px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 32px 28px; background: var(--st-bg-card); border: 1px solid var(--st-border); border-radius: var(--st-r-14); }
.st-gate__icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 6px; border-radius: var(--st-r-12); background: rgba(109, 92, 255, 0.14); border: 1px solid rgba(124, 92, 255, 0.3); color: var(--st-lavender); }
.st-gate__title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
/* Focus is moved here for screen readers when a gate replaces the page; a
   heading is not a control, so it gets no ring. */
.st-gate__title:focus-visible { outline: none; }
.st-gate__body { font-size: 14px; color: var(--st-text-dim); line-height: 1.6; }
.st-gate__body .st-prose { font-size: inherit; }
.st-gate__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.st-gate__foot { margin-top: 8px; font-size: 12.5px; color: var(--st-text-muted); }
.st-store-link { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--st-r-10); border: 1px solid var(--st-border-strong); font-size: 13.5px; font-weight: 600; }
.st-store-link:hover { background: var(--st-bg-hover); }
.st-store-link img { width: 16px; height: 16px; object-fit: contain; }
/* The Apple mark is a black glyph on a transparent canvas: white on the dark
   card, and scaled up because it only fills half of that canvas (the site
   does the same in styles.css). */
.st-store-link img[src*="apple"] { filter: brightness(0) invert(1); transform: scale(1.25); }

/* ---------- 21. Responsive ---------- */
@media (max-width: 1100px) {
  .st-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Sidebar collapses to an icon rail. Labels stay in the accessibility tree
   (and in each link's title) so the rail is still usable. */
@media (max-width: 960px) {
  :root { --st-sidebar-w: 64px; --st-page-pad: 20px; }
  .st-sidebar__top { padding: 12px 8px 6px; align-items: center; }
  .st-sidebar__scroll { padding: 4px 8px 10px; }
  .st-sidebar__foot { padding: 10px 8px; }
  .st-brand__text, .st-brand__tag, .st-switcher__text, .st-switcher .st-icon--chev, .st-nav__heading, .st-account__text {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
  }
  /* A button, not a label: clipped it would still take the keyboard focus
     with nothing to show for it. Sign out stays in the account menu of the
     top bar, which is visible at every width. */
  .st-account__signout { display: none; }
  .st-brand { padding: 4px; }
  .st-switcher { width: 44px; height: 40px; padding: 0; justify-content: center; }
  .st-nav__item { justify-content: center; padding: 0; height: 40px; }
  .st-nav__label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .st-nav__beta { display: none; }
  .st-account { justify-content: center; }
  .st-signin { grid-template-columns: minmax(0, 1fr); }
  .st-signin__brand { padding: 28px 24px; gap: 20px; border-right: 0; border-bottom: 1px solid var(--st-border); }
  .st-signin__pitch h1 { font-size: 24px; }
  .st-signin__points, .st-signin__foot { display: none; }
  .st-signin__main { align-items: flex-start; padding: 28px 24px 48px; }
}

@media (max-width: 720px) {
  :root { --st-page-pad: 16px; }
  .st-narrow-note {
    display: flex; align-items: center; gap: 8px; padding: 8px var(--st-page-pad);
    font-size: 12.5px; color: var(--st-text-dim); background: var(--st-bg-elev); border-bottom: 1px solid var(--st-border);
  }
  .st-grid-2, .st-grid-3, .st-grid-4, .st-form-grid { grid-template-columns: minmax(0, 1fr); }
  .st-hide-narrow { display: none !important; }
  .st-page { padding-top: 16px; }
  .st-page-title { font-size: 20px; }
  .st-topbar { gap: 8px; }
  .st-toasts { left: 16px; right: 16px; width: auto; }
  .st-dialog__footer { flex-wrap: wrap; }
  .st-card__header { padding: 14px 16px 0; }
  .st-card__body { padding: 14px 16px 16px; }
  .st-card__actions { flex-wrap: wrap; }
}

/* ---------- 22. Motion, print ---------- */
@keyframes st-spin { to { transform: rotate(360deg); } }
@keyframes st-pulse { from { opacity: 0.55; } to { opacity: 1; } }
@keyframes st-fade-in { from { opacity: 0; } }
@keyframes st-pop-in { from { opacity: 0; transform: translateY(6px) scale(0.985); } }
@keyframes st-slide-in { from { opacity: 0; transform: translateX(18px); } }
@keyframes st-toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .st-dialog__panel, .st-dialog::backdrop, .st-menu, .st-cal, .st-toast, .st-skeleton__line { animation: none !important; }
  .st-spinner, .st-btn__spinner { animation-duration: 1.4s; }
}

@media print {
  .st-sidebar, .st-topbar, .st-toasts, .st-env-badge, .st-narrow-note, .st-offline-note, .st-skip-link { display: none !important; }
  .st-app { display: block; height: auto; }
  .st-content { overflow: visible; }
  body { background: #fff; color: #000; }
}
