/* ============================================================
   AEU-STREAM PRO — Design System
   Mobile-first, no inline styles, due temi (Grafite / Latte).
   ============================================================ */

/* ---- Tokens ---- */
:root, [data-theme="grafite"] {
  color-scheme: dark;
  --bg-0: #0e1118;
  --bg-1: #161a22;
  --bg-2: #1c2129;
  --bg-grad-1: rgba(56,189,248,.10);
  --bg-grad-2: rgba(99,102,241,.12);
  --surface: #1c2129;
  --surface-2: #232934;
  --border: rgba(148,163,184,.14);
  --border-strong: rgba(148,163,184,.28);
  --text: #e8eaef;
  --text-2: #c4c8d0;
  --muted: #8a92a0;
  --muted-2: #5a6270;
  --accent: #38bdf8;
  --accent-2: #6366f1;
  --on-accent: #ffffff;
  --ok: #22c55e;
  --err: #ef4444;
  --warn: #f59e0b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.20);
  --shadow-md: 0 8px 20px -10px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 50px -20px rgba(0,0,0,.55);
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;
  --input-bg: rgba(0,0,0,.22);
  --row-hover: rgba(148,163,184,.06);
}

[data-theme="latte"] {
  color-scheme: light;
  --bg-0: #f5ecd8;
  --bg-1: #f6efe2;
  --bg-2: #fbf4e4;
  --bg-grad-1: rgba(217,180,114,.18);
  --bg-grad-2: rgba(180,144,89,.16);
  --surface: #fffaf0;
  --surface-2: #fff6e6;
  --border: rgba(120,90,50,.16);
  --border-strong: rgba(120,90,50,.30);
  --text: #2a2118;
  --text-2: #4a3f30;
  --muted: #7a6a55;
  --muted-2: #a89882;
  --accent: #b58348;
  --accent-2: #8a5a2b;
  --on-accent: #ffffff;
  --ok: #2f8a4f;
  --err: #c0392b;
  --warn: #c2741a;
  --input-bg: #fff8e9;
  --row-hover: rgba(120,90,50,.06);
  --shadow-md: 0 8px 22px -10px rgba(60,40,15,.20);
  --shadow-lg: 0 24px 50px -22px rgba(60,40,15,.25);
}

/* ---- Reset / Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
html { height: 100%; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 0% -10%, var(--bg-grad-1), transparent),
    radial-gradient(900px 500px at 110% 110%, var(--bg-grad-2), transparent),
    var(--bg-0);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
/* Wrapper centrato — header, main, footer dentro hanno larghezza identica.
   No min-height/flex stretch: footer sale subito dopo il contenuto, niente
   vuoto innaturale quando ci sono pochi stream. */
.app {
  max-width: 1440px;
  margin-inline: auto;
  display: block;
}
img, svg, video, audio { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Layout helpers ---- */
/* Container centrato con max-width ragionevole (mobile/tablet/desktop fluido).
   Stesso padding-inline per topbar/main/footer = colonna allineata. */
.container {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: clamp(14px, 3vw, 32px);
}
.page { padding-block: clamp(16px, 2.5vw, 32px); }
.stack > * + * { margin-top: 14px; }
.row     { display: flex; align-items: center; gap: 12px; }
.row-wrap{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.spacer  { flex: 1 1 auto; }
.center  { display: flex; align-items: center; justify-content: center; }
.hidden  { display: none !important; }
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.text-strong { color: var(--text); font-weight: 600; }
.text-xs { font-size: .72rem; }
.text-sm { font-size: .85rem; }
.text-lg { font-size: 1.05rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl{ font-size: 1.5rem; }
.fw-700  { font-weight: 700; }
.mt-2{margin-top:8px}.mt-4{margin-top:16px}.mt-6{margin-top:24px}
.mb-2{margin-bottom:8px}.mb-4{margin-bottom:16px}.mb-6{margin-bottom:24px}

/* ---- Top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: transparent;                 /* si fonde con lo sfondo della pagina */
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex; align-items: center; gap: 14px;
  padding-block: 12px; max-width: 100%;
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark-wrap {
  position: relative; display: inline-block; flex-shrink: 0;
  width: auto; height: 36px;
}
.brand-mark {
  width: auto; height: 36px; display: block;
  /* Glow rosso tenue: solo drop-shadow leggero che pulsa, senza
     brightness/saturate che invadevano "tutto il logo". */
  animation: brandGlow 5s ease-in-out infinite;
}
/* Sweep luminoso che attraversa SOLO le lettere AEU, da destra → sinistra,
   appena percettibile. mask-image col PNG limita lo sweep alla sagoma.
   Prefissi separati + mask-mode esplicito → compatibile Edge/Chromium/
   Firefox/Safari. */
.brand-mark-wrap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(
    -115deg,
    transparent 45%,
    rgba(255,255,255,.32) 50%,
    transparent 55%
  );
  background-size: 220% 100%;
  background-repeat: no-repeat;
  background-position: -1% 0;
  -webkit-mask-image: url('/img/aeu-logo.df8467736b.png');
          mask-image: url('/img/aeu-logo.df8467736b.png');
  -webkit-mask-size: contain;
          mask-size: contain;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-mode: alpha;
          mask-mode: alpha;
  animation: brandShine 20s linear infinite;
}
/* Sweep DESTRA → SINISTRA: 20s totali = 15s di passaggio reale dentro
   il logo + 5s di pausa. Posizioni ricalcolate per fascio stretto (10%
   del gradient = ~22% del container): -1% = appena entra dal bordo
   destro, 101% = appena esce dal bordo sinistro. */
@keyframes brandShine {
  0%   { background-position: -1% 0; }
  75%  { background-position: 101% 0; }
  100% { background-position: 101% 0; }
}
@keyframes brandGlow {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(239,68,68,.40)); }
  50%      { filter: drop-shadow(0 0 9px rgba(239,68,68,.65)); }
}
[data-theme="latte"] .brand-mark {
  animation-name: brandGlowLight;
}
@keyframes brandGlowLight {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(220,38,38,.30)); }
  50%      { filter: drop-shadow(0 0 8px rgba(220,38,38,.50)); }
}
@media (prefers-reduced-motion: reduce) {
  .brand-mark { animation: none; filter: drop-shadow(0 0 8px rgba(239,68,68,.45)); }
  [data-theme="latte"] .brand-mark { filter: drop-shadow(0 0 6px rgba(220,38,38,.35)); }
  .brand-mark-wrap::after { animation: none; opacity: 0; }
}
.brand-title { font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; }
.brand-title .accent { color: var(--accent); }
.brand-sub { font-size: .72rem; color: var(--muted); margin-top: 1px; }

.topbar .nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar .nav a {
  padding: 8px 12px; border-radius: 8px; color: var(--text-2);
  font-size: .9rem; font-weight: 500; white-space: nowrap;
}
.topbar .nav a:hover { background: var(--row-hover); text-decoration: none; }
.topbar .nav a.active { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.topbar .who { font-size: .82rem; color: var(--muted); white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }

/* Tablet ≤ 1024 */
@media (max-width: 1024px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px 12px; }
  .topbar .nav { order: 3; flex-basis: 100%; justify-content: center; padding-top: 4px; border-top: 1px solid var(--border); }
}
/* Mobile ≤ 640 */
@media (max-width: 640px) {
  .brand-sub { display: none; }
  .brand-title { font-size: .92rem; }
  .topbar .who { display: none; }
  .topbar .nav a { padding: 7px 10px; font-size: .82rem; }
  .theme-switch button { padding: 5px 8px; font-size: .7rem; }
  .btn-sm { padding: 6px 10px; font-size: .78rem; }
  .modal { padding: 0; }
  .modal .panel { max-width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; padding: 18px; }
  .modal .actions { position: sticky; bottom: 0; background: var(--surface); padding-top: 14px; margin-top: 18px; }
}
/* Mobile XS ≤ 380 */
@media (max-width: 380px) {
  .brand-mark { height: 26px; }
  .brand-title { font-size: .82rem; }
  .topbar .nav a { padding: 6px 8px; font-size: .78rem; }
}

/* ---- Card ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.card-pad { padding: clamp(18px, 2.4vw, 28px); }
.card-narrow { width: 100%; max-width: 440px; margin: 0 auto; }

/* ---- Forms ---- */
.label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.input, .select, .textarea {
  width: 100%; padding: 11px 14px;
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  outline: none; font: inherit; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 90px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.input-otp {
  text-align: center; letter-spacing: 8px; font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 16px; border-radius: var(--radius);
  font: 600 .9rem/1.1 inherit; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .05s ease, background .15s ease, border-color .15s ease, filter .15s ease;
  white-space: nowrap;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn:active   { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost {
  background: transparent; color: var(--text-2);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--row-hover); }
.btn-danger { background: var(--err); color: #fff; }
.btn-warn { background: var(--warn); color: #1a1407; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 11px; border-radius: 9px; font-size: .82rem; }

/* ---- Section header ---- */
.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: .78rem; font-weight: 700; letter-spacing: .12em;
  color: var(--muted); text-transform: uppercase;
  margin: 0 0 14px;
}
.section-title::after {
  content: ''; flex: 1 1 auto; height: 1px;
  background: linear-gradient(90deg, var(--border-strong), transparent);
}
.section-title .badge { letter-spacing: 0; text-transform: none; }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 8px var(--ok);
  animation: pulse 1.8s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* ---- Tiles (channel cards) ---- */
.cat-section { margin-bottom: 26px; }

/* ============================
   MODALITÀ PLAYER APERTO:
   stessa grid auto-fit, ma tile più piccole per mostrarne di più
   nello spazio rimasto. Niente più carosello orizzontale.
   ============================ */
body.player-open .cat-section { margin-bottom: 16px; }
body.player-open .grid-tiles {
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr));
}
body.player-open .tile .poster-auto { padding: 6px; }
body.player-open .tile .poster-auto svg { height: 78%; max-width: 92%; }
body.player-open .tile .meta { padding: 6px 9px 8px; }
body.player-open .tile .name { font-size: .78rem; }
body.player-open .tile .desc { display: none; }
body.player-open .tile .meta .badge { display: none; }
body.player-open .tile.is-playing {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent);
}
@media (max-width: 380px) {
  body.player-open .grid-tiles { grid-template-columns: repeat(2, 1fr); }
}

/* auto-fit + minmax piccolo = piu' colonne entrano = riempiono lo schermo
   senza buchi anche su mobile/tablet. min(...,100%) evita overflow su
   schermi piu' stretti del minmax. */
.grid-tiles {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
}
/* Desktop: tile piu' generose */
@media (min-width: 1280px) {
  .grid-tiles {
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  }
}
/* Tablet medio: tile medie (min 150 → su 1080 entrano 6 track, auto-fit
   collassa quelle vuote: 5 tile riempiono perfettamente in 5 col) */
@media (min-width: 700px) and (max-width: 1279px) {
  .grid-tiles {
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  }
}
/* Mobile XS: 2 colonne fisse */
@media (max-width: 380px) {
  .grid-tiles { gap: 10px; grid-template-columns: repeat(2, 1fr); }
}

.tile {
  position: relative; cursor: pointer; isolation: isolate;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.tile:hover, .tile:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border-strong));
  box-shadow: var(--shadow-lg);
  outline: none;
}
.tile:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }

.tile .poster {
  position: relative; aspect-ratio: 16 / 9;
  background:
    radial-gradient(ellipse at top, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%),
    var(--bg-1);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.tile .poster-img { width: 100%; height: 100%; object-fit: cover; }
.tile .poster-auto { display: flex; align-items: center; justify-content: center; padding: 8px; }
.tile .poster-auto svg { width: auto; height: 86%; max-width: 88%; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }

.tile .poster::after {
  content: '▶';
  position: absolute; right: 10px; bottom: 10px;
  width: 28px; height: 28px; border-radius: 50%;
  background: color-mix(in srgb, var(--bg-0) 60%, transparent);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  color: var(--text); font-size: .65rem;
  opacity: 0; transform: translateY(6px);
  transition: opacity .18s, transform .18s;
}
.tile:hover .poster::after, .tile:focus-visible .poster::after { opacity: 1; transform: translateY(0); }

.tile .meta { padding: 9px 11px 11px; }
.tile .name {
  font-size: .85rem; font-weight: 600; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.tile .desc {
  color: var(--muted); font-size: .72rem; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.tile .meta .badge { font-size: .58rem; padding: 1px 6px; }

/* ---- Player ---- */
/* Schermo player nero garantito.
   Il browser disegna il <video> in un compositor layer interno che IGNORA
   il background CSS dell'elemento — durante il loading mostra il grigio
   nativo del media-element. Per coprirlo usiamo un overlay ::before dentro
   .player-wrap, sempre nero, che si nasconde solo quando il video emette
   davvero un frame (classe .is-live aggiunta dal JS sull'evento `playing`).
   Bust 2026-04-28T21:55 */
.player-wrap {
  position: relative; background: #000;
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.player-wrap::before {
  content: ""; position: absolute; inset: 0;
  background: #000; z-index: 1; pointer-events: none;
  transition: opacity .2s ease;
}
/* Spinner bianco al centro dell'overlay durante il loading. Sparisce
   quando il video parte (.is-live → opacity 0). */
.player-wrap::after {
  content: ""; position: absolute;
  top: 50%; left: 50%; width: 56px; height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,.18);
  border-top-color: #ffffff;
  animation: aeu-spin .9s linear infinite;
  z-index: 2; pointer-events: none;
  transition: opacity .2s ease;
}
.player-wrap.is-live::before,
.player-wrap.is-live::after { opacity: 0; }
@keyframes aeu-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .player-wrap::after { animation-duration: 2.4s; }
}
.player-wrap video { width: 100%; height: auto; aspect-ratio: 16/9;
  background: #000 !important; display: block; }
.player-wrap audio { width: 100%; padding: 18px 16px; background: #000; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: .9rem; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; background: var(--bg-1); }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--row-hover); }
td.td-url { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
td.td-actions { white-space: nowrap; text-align: right; }
td.td-actions .btn + .btn { margin-left: 6px; }

/* Tablet/mobile ≤ 860px: tabelle in card impilate */
@media (max-width: 860px) {
  .table-wrap { border: 0; border-radius: 0; overflow: visible; background: transparent; }
  table { min-width: 0; width: 100%; border-collapse: separate; border-spacing: 0 10px; }
  thead { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  tbody tr {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.06));
  }
  tbody tr:hover { background: var(--surface); }
  tbody td {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border);
    font-size: .88rem; min-width: 0;
  }
  tbody td:last-child { border-bottom: 0; padding-bottom: 2px; }
  tbody td:first-child { padding-top: 2px; }
  tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
    flex-shrink: 0; margin-right: 12px;
  }
  /* Valore del cell (tutto ciò che non è ::before) deve poter andare a capo */
  tbody td > * { min-width: 0; max-width: 100%; word-break: break-word; }
  td.td-url { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: right; }
  /* Cella azioni: bottoni a tutta larghezza, in colonna sotto l'etichetta */
  tbody td.td-actions { display: block; padding-top: 10px; }
  tbody td.td-actions::before { display: block; margin-bottom: 8px; }
  tbody td.td-actions .btn { display: inline-flex; margin: 4px 4px 0 0; }
  .between { gap: 8px; }
}
@media (max-width: 480px) {
  tbody tr { padding: 8px 10px; }
  tbody td { font-size: .84rem; padding: 6px 0; }
  tbody td.td-actions .btn { width: 100%; margin: 4px 0 0 0; justify-content: center; }
  .card-pad { padding: 14px; }
}

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 999px; font-size: .68rem; font-weight: 600; letter-spacing: .02em;
}
.badge-admin { background: color-mix(in srgb, var(--accent-2) 22%, transparent); color: color-mix(in srgb, var(--accent-2) 60%, var(--text)); }
.badge-user  { background: color-mix(in srgb, var(--accent) 18%, transparent);  color: color-mix(in srgb, var(--accent) 60%, var(--text)); }
.badge-on    { background: color-mix(in srgb, var(--ok) 18%, transparent);     color: color-mix(in srgb, var(--ok) 70%, var(--text)); }
.badge-off   { background: color-mix(in srgb, var(--err) 18%, transparent);    color: color-mix(in srgb, var(--err) 70%, var(--text)); }

/* ---- Modal ---- */
.modal {
  position: fixed; inset: 0; padding: 16px; z-index: 50;
  background: color-mix(in srgb, var(--bg-0) 75%, transparent);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
}
.modal.show { display: flex; }
.modal .panel {
  width: 100%; max-width: 680px; max-height: 90vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: clamp(18px, 2.5vw, 26px);
  box-shadow: var(--shadow-lg);
}
.modal h2 { margin: 0 0 16px; font-size: 1.1rem; font-weight: 700; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

/* ---- Check list ---- */
.check-list {
  max-height: 240px; overflow: auto; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--input-bg);
}
.check-list label { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: .9rem; }

/* ---- Alert ---- */
.alert {
  padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  font-size: .88rem; line-height: 1.5;
}
.alert code { background: var(--row-hover); padding: 1px 6px; border-radius: 4px; font-size: .85em; }
.alert-warn { background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.alert-info { background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--surface-2); color: var(--text);
  padding: 11px 16px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); z-index: 1000;
  box-shadow: var(--shadow-lg);
  opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none;
  max-width: calc(100vw - 32px); text-align: center; font-size: .88rem;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-2px); }
.toast.ok  { border-color: var(--ok);  }
.toast.err { border-color: var(--err); }

/* ---- Theme switcher ---- */
.theme-switch {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px;
}
.theme-switch button {
  border: 0; background: transparent; color: var(--muted);
  padding: 5px 11px; border-radius: 999px; font-size: .76rem;
  cursor: pointer; font-family: inherit; font-weight: 500;
  transition: background .15s, color .15s;
}
.theme-switch button:hover { color: var(--text); }
.theme-switch button.on { background: var(--accent); color: var(--on-accent); }

/* ---- Footer ---- */
.footer {
  padding-block: 18px;
  font-size: .76rem; color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: clamp(20px, 3vw, 40px);
}
.footer .container { text-align: center; }
.footer .accent { color: var(--accent); font-weight: 700; }

/* ---- Channel logo helpers ---- */
.row-cell-logo { display: inline-flex; vertical-align: middle; margin-right: 8px; }
.row-cell-logo svg { display: block; border-radius: 5px; }

/* ---- Utility ---- */
.audio-only { display: block; }
