/*
 * Search A Show — design system v9 "Calm"
 * Light, quiet, poster-first. One accent. Light + dark. WCAG AA.
 * Spec and rationale: DESIGN.md. Gallery: /design.html. Contrast check: node website/tools/contrast-check.mjs
 *
 * Theme: <html data-theme="light|dark"> forces a theme; no attribute (or "auto") follows the OS.
 */

/* ── 1. Tokens: light (default) ─────────────────────────────────────────── */
:root {
  color-scheme: light;

  /* Surfaces */
  --bg:            #FFFFFF;
  --surface:       #FFFFFF;
  --surface-2:     #F4F4F6;
  --surface-3:     #E9E9ED;
  --overlay:       rgba(22, 22, 26, .48);

  /* Lines */
  --line:          #E6E6EA;
  --line-strong:   #C8C8CF;

  /* Text */
  --text:          #0E0E12;
  --text-2:        #43434B;
  --text-3:        #62626B;
  --text-4:        #8C8C94;   /* placeholders + disabled only; never body copy */

  /* The one accent */
  --brand:         #FF2D55;   /* the logo pink: logo, favicon, decoration only (3.6:1 on white) */
  --accent:        #E0103F;   /* same hue as the logo, deep enough for white text (4.9:1) */
  --accent-hover:  #C70D3D;
  --accent-press:  #B80B38;
  --accent-soft:   #FFEDF1;
  --accent-text:   #C70D3D;   /* accent used as text on --bg/--surface */
  --on-accent:     #FFFFFF;
  --focus:         #E0103F;

  /* Stage: dark bands (hero, organizer band, footer) */
  --stage:         #111116;
  --stage-2:       #1C1C23;
  --on-stage:      #FFFFFF;
  --on-stage-2:    #C9C9D1;

  /* Status (text-safe on --surface; -soft for backgrounds) */
  --ok:            #1E7A4C;  --ok-soft:     #E8F4ED;
  --warn:          #8F5600;  --warn-soft:   #FBF1E1;
  --danger:        #C0281C;  --danger-soft: #FBEAE8;
  --info:          #1F5CB8;  --info-soft:   #E9F0FA;

  /* Poster stage (behind contained posters) */
  --poster-stage:  #1B1B1F;

  /* Type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --fs-xs:   0.75rem;   /* 12 */
  --fs-sm:   0.875rem;  /* 14 */
  --fs-md:   1rem;      /* 16 body; inputs never smaller (stops iOS zoom) */
  --fs-lg:   1.125rem;  /* 18 */
  --fs-xl:   1.25rem;   /* 20 */
  --fs-2xl:  1.5rem;    /* 24 */
  --fs-3xl:  clamp(1.625rem, 1.2rem + 1.6vw, 2rem);      /* 26→32 */
  --fs-4xl:  clamp(2rem, 1.4rem + 2.6vw, 3rem);          /* 32→48 */
  --lh-tight: 1.2;
  --lh-snug:  1.35;
  --lh-body:  1.55;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;
  --tracking-tight: -0.015em;
  --tracking-caps:   0.06em;

  /* Space (4px base) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px; --s-20: 80px;
  --gutter: 16px;
  --container: 1200px;
  --container-narrow: 760px;

  /* Shape */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-pill: 999px;

  /* Elevation (soft, neutral, never coloured) */
  --shadow-1: 0 1px 2px rgba(22,22,26,.05);
  --shadow-2: 0 2px 8px rgba(22,22,26,.06), 0 1px 2px rgba(22,22,26,.04);
  --shadow-3: 0 16px 40px rgba(22,22,26,.14), 0 4px 12px rgba(22,22,26,.06);

  /* Motion */
  --dur-1: 120ms; --dur-2: 200ms; --dur-3: 320ms;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

/* ── 2. Tokens: dark ────────────────────────────────────────────────────── */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111113; --surface: #18181B; --surface-2: #212125; --surface-3: #2B2B30; --overlay: rgba(0,0,0,.6);
  --line: #2C2C31; --line-strong: #45454C;
  --text: #F2F2EF; --text-2: #C6C6CA; --text-3: #A0A0A8; --text-4: #74747C;
  --accent: #FF5577; --accent-hover: #FF7390; --accent-press: #FF8FA6; --accent-soft: #3B1520; --brand: #FF2D55; --stage: #08080B; --stage-2: #15151B; --on-stage: #FFFFFF; --on-stage-2: #C9C9D1;
  --accent-text: #FF8FA6; --on-accent: #120509; --focus: #FF7390;
  --ok: #5CC99A;  --ok-soft: #173326;
  --warn: #E9B35A; --warn-soft: #3A2C14;
  --danger: #FF8378; --danger-soft: #3D1C19;
  --info: #7DB0FF; --info-soft: #1A2A44;
  --poster-stage: #0B0B0D;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 2px 10px rgba(0,0,0,.45);
  --shadow-3: 0 18px 44px rgba(0,0,0,.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111113; --surface: #18181B; --surface-2: #212125; --surface-3: #2B2B30; --overlay: rgba(0,0,0,.6);
    --line: #2C2C31; --line-strong: #45454C;
    --text: #F2F2EF; --text-2: #C6C6CA; --text-3: #A0A0A8; --text-4: #74747C;
    --accent: #FF5577; --accent-hover: #FF7390; --accent-press: #FF8FA6; --accent-soft: #3B1520; --brand: #FF2D55; --stage: #08080B; --stage-2: #15151B; --on-stage: #FFFFFF; --on-stage-2: #C9C9D1;
    --accent-text: #FF8FA6; --on-accent: #120509; --focus: #FF7390;
    --ok: #5CC99A;  --ok-soft: #173326;
    --warn: #E9B35A; --warn-soft: #3A2C14;
    --danger: #FF8378; --danger-soft: #3D1C19;
    --info: #7DB0FF; --info-soft: #1A2A44;
    --poster-stage: #0B0B0D;
    --shadow-1: 0 1px 2px rgba(0,0,0,.4);
    --shadow-2: 0 2px 10px rgba(0,0,0,.45);
    --shadow-3: 0 18px 44px rgba(0,0,0,.6);
  }
}

/* ── 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;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video, picture { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { margin: 0; line-height: var(--lh-tight); letter-spacing: var(--tracking-tight); font-weight: var(--fw-bold); color: var(--text); }
h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); font-weight: var(--fw-semibold); }
h4 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
p { margin: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
::selection { background: var(--accent-soft); color: var(--text); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-6) 0; }
.tabular { font-variant-numeric: tabular-nums; }

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

/* ── 4. Layout primitives ───────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { max-width: var(--container-narrow); }
@media (min-width: 768px) { :root { --gutter: 24px; } }
@media (min-width: 1200px) { :root { --gutter: 32px; } }
.stack   { display: flex; flex-direction: column; gap: var(--stack-gap, var(--s-4)); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, var(--s-2)); }
.spread  { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.grid-cards { display: grid; gap: var(--s-6) var(--s-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
@media (max-width: 479px) { .grid-cards { grid-template-columns: repeat(2, 1fr); gap: var(--s-5) var(--s-3); } }
.section { padding-block: var(--s-12); }
@media (min-width: 768px) { .section { padding-block: var(--s-16); } }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--s-4); top: -60px; z-index: 100; padding: var(--s-2) var(--s-4); background: var(--surface); color: var(--text); border-radius: var(--r-md); box-shadow: var(--shadow-2); }
.skip-link:focus { top: var(--s-4); }

/* ── 5. Text helpers ────────────────────────────────────────────────────── */
.eyebrow { font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-3); }
.lead { font-size: var(--fs-lg); color: var(--text-2); line-height: var(--lh-snug); }
.meta { font-size: var(--fs-sm); color: var(--text-3); }
.muted { color: var(--text-2); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── 6. Buttons ─────────────────────────────────────────────────────────── */
.btn {
  --btn-h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--btn-h); padding: 0 var(--s-5);
  border: 1px solid transparent; border-radius: var(--r-md);
  font: inherit; font-size: var(--fs-md); font-weight: var(--fw-semibold); line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none;
  transition: background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary   { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-primary:active { background: var(--accent-press); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost     { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger    { background: var(--surface); color: var(--danger); border-color: var(--line-strong); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-sm { --btn-h: 36px; padding: 0 var(--s-3); font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn-lg { --btn-h: 52px; padding: 0 var(--s-6); font-size: var(--fs-lg); }
.btn-block { width: 100%; }
.btn-icon { width: var(--btn-h); padding: 0; }
.btn .spinner { width: 16px; height: 16px; }

/* ── 7. Form fields ─────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.field > label, .label { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text); }
.label .req { color: var(--accent-text); margin-inline-start: 2px; }
.label .opt { color: var(--text-3); font-weight: var(--fw-regular); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px var(--s-3);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  font: inherit; font-size: var(--fs-md); line-height: 1.4;
  transition: border-color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
.textarea { min-height: 112px; resize: vertical; }
.select { appearance: none; padding-inline-end: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-2); color: var(--text-4); cursor: not-allowed; }
.hint  { font-size: var(--fs-sm); color: var(--text-3); }
.error { font-size: var(--fs-sm); color: var(--danger); }
.input-group { display: flex; align-items: stretch; }
.input-group > .input { border-radius: 0; }
.input-group > :first-child { border-start-start-radius: var(--r-md); border-end-start-radius: var(--r-md); }
.input-group > :last-child  { border-start-end-radius: var(--r-md); border-end-end-radius: var(--r-md); }
.input-group > * + * { margin-inline-start: -1px; }
.form-row { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-row.cols-2 { grid-template-columns: 1fr 1fr; } .form-row.cols-3 { grid-template-columns: repeat(3, 1fr); } }

.check { display: inline-flex; align-items: flex-start; gap: var(--s-2); font-size: var(--fs-md); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }

.switch { position: relative; display: inline-flex; align-items: center; gap: var(--s-3); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 40px; height: 24px; border-radius: var(--r-pill); background: var(--surface-3); border: 1px solid var(--line-strong); position: relative; transition: background-color var(--dur-2) var(--ease-out); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-1); transition: transform var(--dur-2) var(--ease-out); }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
[dir="rtl"] .switch input:checked + .track::after { transform: translateX(-16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }

.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: var(--r-md); }
.segmented button { min-height: 36px; padding: 0 var(--s-3); border: 0; border-radius: calc(var(--r-md) - 3px); background: transparent; color: var(--text-2); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium); cursor: pointer; }
.segmented button[aria-pressed="true"], .segmented button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

details.disclosure { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
details.disclosure > summary { list-style: none; cursor: pointer; padding: var(--s-4); font-weight: var(--fw-semibold); display: flex; justify-content: space-between; align-items: center; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after { content: "+"; color: var(--text-3); font-weight: var(--fw-regular); font-size: var(--fs-xl); line-height: 1; }
details.disclosure[open] > summary::after { content: "–"; }
details.disclosure > .disclosure-body { padding: 0 var(--s-4) var(--s-4); }

/* ── 8. Chips & badges ──────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: var(--s-1);
  min-height: 36px; padding: 0 var(--s-3);
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--surface); color: var(--text-2);
  font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium); white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.chip:hover { border-color: var(--text-3); color: var(--text); }
.chip[aria-pressed="true"], .chip[aria-checked="true"], .chip[aria-current="true"], .chip.is-active { background: var(--text); border-color: var(--text); color: var(--surface); }
.chip-row { display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; padding-block: 2px; scroll-snap-type: x proximity; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-row > * { scroll-snap-align: start; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px var(--s-2); border-radius: var(--r-sm); font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1.5; background: var(--surface-2); color: var(--text-2); }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); }
.badge-ok     { background: var(--ok-soft); color: var(--ok); }
.badge-warn   { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info   { background: var(--info-soft); color: var(--info); }

/* ── 9. Surfaces ────────────────────────────────────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-6); }
.panel-tight { padding: var(--s-4); }

/* ── 10. Show card (poster-first) ───────────────────────────────────────── */
.show-card { position: relative; display: flex; flex-direction: column; gap: var(--s-3); color: inherit; text-decoration: none; min-width: 0; }
.show-card:hover { color: inherit; }
.poster {
  position: relative; overflow: hidden; border-radius: var(--r-lg);
  aspect-ratio: var(--poster-ratio, 4 / 5);
  background: var(--poster-stage);
  isolation: isolate;
}
.poster > img, .poster > picture, .poster > picture > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-3) var(--ease-out); }
.poster.is-contain > img, .poster.is-contain > picture > img { object-fit: contain; }
.poster.is-contain::before { content: ""; position: absolute; inset: -24px; z-index: -1; background: var(--poster-fill, var(--poster-stage)) center / cover no-repeat; filter: blur(24px) saturate(1.1) brightness(.7); }
.show-card:hover .poster > img, .show-card:hover .poster > picture > img { transform: scale(1.025); }
.poster .poster-tag { position: absolute; top: var(--s-2); inset-inline-start: var(--s-2); z-index: 1; }
.show-card .title { font-size: var(--fs-md); font-weight: var(--fw-semibold); line-height: var(--lh-snug); color: var(--text); }
.show-card .when, .show-card .where { font-size: var(--fs-sm); color: var(--text-3); }
.show-card .price { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text); }
.show-card .card-body { display: flex; flex-direction: column; gap: 2px; padding-inline: 2px; }
.show-card:focus-visible { outline: none; }
.show-card:focus-visible .poster { outline: 2px solid var(--focus); outline-offset: 3px; }

/* Row variant (lists, dashboards) */
.show-row { display: grid; grid-template-columns: 64px 1fr auto; gap: var(--s-3); align-items: center; padding: var(--s-3); border-radius: var(--r-md); text-decoration: none; color: inherit; }
.show-row:hover { background: var(--surface-2); color: inherit; }
.show-row .poster { --poster-ratio: 4 / 5; border-radius: var(--r-sm); }

/* ── 11. Header / nav ───────────────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .bar { display: flex; align-items: center; gap: var(--s-4); min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: var(--fw-bold); font-size: var(--fs-lg); letter-spacing: var(--tracking-tight); text-decoration: none; color: var(--text); }
.nav-links { display: none; gap: var(--s-1); }
.nav-links a { padding: var(--s-2) var(--s-3); border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-2); text-decoration: none; }
.nav-links a:hover { background: var(--surface-2); color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
@media (min-width: 900px) { .nav-links { display: flex; } }
.brand { white-space: nowrap; }
.nav-links.always { display: flex; overflow-x: auto; scrollbar-width: none; }
@media (max-width: 639px) { .site-header .bar:has(.nav-links.always) { flex-wrap: wrap; padding-block: var(--s-2); } .site-header .bar:has(.nav-links.always) .nav-links { order: 3; width: 100%; } }
.segmented.is-block { display: flex; } .segmented.is-block > button { flex: 1; }
@media (max-width: 639px) { .hide-sm { display: none !important; } }

.site-footer { border-top: 1px solid var(--line); padding-block: var(--s-10); color: var(--text-3); font-size: var(--fs-sm); }

/* ── 12. Tabs ───────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs [role="tab"] { padding: var(--s-3) var(--s-3); border: 0; background: none; font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

/* ── 13. Table ──────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: start; font-weight: var(--fw-semibold); color: var(--text-3); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: var(--tracking-caps); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; }
.table td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }

/* ── 14. Dialog / sheet ─────────────────────────────────────────────────── */
dialog.dialog { border: 0; padding: 0; background: var(--surface); color: var(--text); border-radius: var(--r-xl); box-shadow: var(--shadow-3); width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
dialog.dialog::backdrop { background: var(--overlay); }
dialog.dialog[open] { animation: sas-rise var(--dur-2) var(--ease-out); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-5) var(--s-6) var(--s-3); }
.dialog-body { padding: 0 var(--s-6) var(--s-5); overflow: auto; }
.dialog-foot { display: flex; justify-content: flex-end; gap: var(--s-2); padding: var(--s-4) var(--s-6); border-top: 1px solid var(--line); }
@media (max-width: 639px) {
  dialog.dialog.is-sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92dvh; }
  dialog.dialog.is-sheet[open] { animation: sas-sheet var(--dur-3) var(--ease-out); }
}
@keyframes sas-rise  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes sas-sheet { from { transform: translateY(100%); } to { transform: none; } }

/* ── 15. Toast ──────────────────────────────────────────────────────────── */
.toast-region { position: fixed; inset-inline: 0; bottom: var(--s-4); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: var(--s-2); pointer-events: none; padding-inline: var(--gutter); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--s-3); max-width: 480px; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--text); color: var(--surface); box-shadow: var(--shadow-3); font-size: var(--fs-sm); animation: sas-rise var(--dur-2) var(--ease-out); }
.toast.is-error { background: var(--danger); color: var(--surface); }

/* ── 16. Feedback ───────────────────────────────────────────────────────── */
.alert { display: flex; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); font-size: var(--fs-sm); background: var(--surface-2); color: var(--text); }
.alert-ok { background: var(--ok-soft); } .alert-warn { background: var(--warn-soft); } .alert-danger { background: var(--danger-soft); } .alert-info { background: var(--info-soft); }
.skeleton { background: var(--surface-2); border-radius: var(--r-md); animation: sas-pulse 1.4s ease-in-out infinite; }
@keyframes sas-pulse { 50% { opacity: .55; } }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; border-inline-end-color: transparent; animation: sas-spin .7s linear infinite; }
@keyframes sas-spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: var(--s-12) var(--s-4); color: var(--text-3); }
.empty h3 { color: var(--text); margin-bottom: var(--s-2); }
.progress { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width var(--dur-2) var(--ease-out); }

/* ── 17. Combobox / token input (manage app) ────────────────────────────── */
.ac-list { position: absolute; z-index: 30; inset-inline: 0; top: calc(100% + 4px); margin: 0; padding: var(--s-1); list-style: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow-3); max-height: 320px; overflow: auto; }
.ac-list li { display: flex; flex-direction: column; gap: 2px; padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); cursor: pointer; }
.ac-list li[aria-selected="true"], .ac-list li:hover { background: var(--surface-2); }
.tokens { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; padding: 6px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); }
.tokens:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tokens .token { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border-radius: var(--r-pill); background: var(--surface-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.tokens .token button { border: 0; background: none; color: var(--text-3); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font: inherit; line-height: 1; }
.tokens .token button:hover { background: var(--surface-3); color: var(--text); }
.tokens .token-input { flex: 1; min-width: 140px; position: relative; }
.tokens .token-input input { width: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: var(--fs-md); padding: 4px 6px; color: var(--text); min-height: 30px; }
.action-bar { position: sticky; bottom: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding-block: var(--s-3); }
