[hidden] { display: none !important; }
/* === Broaduction design tokens - see DESIGN.md (RetroUI / NeoBrutalism) === */
      :root {
        --radius: 0; /* sharp corners */
        --navh: 60px; /* fixed bottom navigation bar height */

        --background: #ffffff;
        --foreground: #000000;
        --card: #ffffff;
        --card-foreground: #000000;

        --primary: #ffdb33;
        --primary-hover: #ffcc00;
        --primary-foreground: #000000;

        --secondary: #000000;
        --secondary-foreground: #ffffff;

        --muted: #cccccc;
        --muted-foreground: #5a5a5a;

        --accent: #fae583;
        --accent-foreground: #000000;

        --destructive: #e63946;
        --destructive-foreground: #ffffff;

        --border: #000000;

        /* Vibrant accent palette - NeoBrutalist multi-color (see DESIGN.md). */
        --coral:  #ff6b6b;
        --orange: #ff8c42;
        --lime:   #aafc3d;
        --purple: #5f4fe6;
        --sky:    #2ec4f0;
        --pink:   #ff5da2;
        --navy:   #1a1a6e;
        --teal:   #14b8a6;
        --violet: #9b5de5;

        /* Open-background retro texture (themeable). */
        --bg-base: #fff8ec;
        --bg-dot1: rgba(255,107,107,.18);
        --bg-dot2: rgba(95,79,230,.16);
        --bg-hatch: rgba(0,0,0,.025);

        --font-head: Impact, Haettenschweiler, "Arial Black", ui-sans-serif, system-ui, sans-serif;
        --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      }
      [dir="rtl"] {
        --font-head: Tahoma, Arial, ui-sans-serif, system-ui, sans-serif;
        --font-sans: Tahoma, Arial, ui-sans-serif, system-ui, sans-serif;
      }
      :root {
        /* Hard, zero-blur shadows drawn in the border color.
           Offsets keep their physical direction by design choice (see DESIGN.md). */
        --shadow-xs: 1px 1px 0 0 var(--border);
        --shadow-sm: 2px 2px 0 0 var(--border);
        --shadow: 3px 3px 0 0 var(--border);
        --shadow-md: 4px 4px 0 0 var(--border);
        --shadow-lg: 6px 6px 0 0 var(--border);
        --shadow-xl: 10px 10px 0 1px var(--border);
      }

      /* === Color themes - override tokens only; everything else inherits. ===
         Default (no data-theme / "sunshine") keeps the :root values above.
         Each theme remaps surface, text, border, primary, accent, muted,
         secondary, and the textured-background tokens so the page recolors
         end to end. The shadow variables reference --border and therefore
         recolor automatically with each theme. */

      /* Midnight - dark surfaces, light text, vibrant accents kept for punch. */
      [data-theme="midnight"] {
        --background: #14151c;
        --foreground: #f4f5fb;
        --card: #1d1f2b;
        --card-foreground: #f4f5fb;
        --border: #f4f5fb;

        --primary: #ffdb33;
        --primary-hover: #ffe66b;
        --primary-foreground: #14151c;

        --secondary: #f4f5fb;
        --secondary-foreground: #14151c;

        --muted: #2a2d3c;
        --muted-foreground: #b9bdd0;

        --accent: #5f4fe6;
        --accent-foreground: #ffffff;

        --destructive: #ff5d6c;
        --destructive-foreground: #14151c;

        --bg-base: #0e0f15;
        --bg-dot1: rgba(95,79,230,.30);
        --bg-dot2: rgba(46,196,240,.22);
        --bg-hatch: rgba(255,255,255,.04);
      }

      /* Bubblegum - soft pastel pinks and purples, dark plum ink for contrast. */
      [data-theme="bubblegum"] {
        --background: #fff0f7;
        --foreground: #3a1230;
        --card: #ffe3f1;
        --card-foreground: #3a1230;
        --border: #c33d8c;

        --primary: #ff8fc8;
        --primary-hover: #ff6fb6;
        --primary-foreground: #3a1230;

        --secondary: #8a4fd6;
        --secondary-foreground: #ffffff;

        --muted: #f3cfe6;
        --muted-foreground: #8a4f7a;

        --accent: #d6b3ff;
        --accent-foreground: #3a1230;

        --destructive: #e63973;
        --destructive-foreground: #ffffff;

        --bg-base: #fff5fb;
        --bg-dot1: rgba(255,93,162,.22);
        --bg-dot2: rgba(155,93,229,.18);
        --bg-hatch: rgba(195,61,140,.05);
      }

      /* Terminal - near-black background, phosphor green text, amber highlights. */
      [data-theme="terminal"] {
        --background: #05140a;
        --foreground: #4dff88;
        --card: #08240f;
        --card-foreground: #4dff88;
        --border: #4dff88;

        --primary: #ffb000;
        --primary-hover: #ffc740;
        --primary-foreground: #05140a;

        --secondary: #4dff88;
        --secondary-foreground: #05140a;

        --muted: #0e3318;
        --muted-foreground: #8fffb6;

        --accent: #ffb000;
        --accent-foreground: #05140a;

        --destructive: #ff5555;
        --destructive-foreground: #05140a;

        --bg-base: #03100a;
        --bg-dot1: rgba(77,255,136,.18);
        --bg-dot2: rgba(255,176,0,.14);
        --bg-hatch: rgba(77,255,136,.06);
      }

      * { box-sizing: border-box; }

      body {
        margin: 0;
        min-height: 100svh;
        padding-bottom: var(--navh);
        font-family: var(--font-sans);
        color: var(--foreground);
        background-color: var(--bg-base);
        /* Vibrant retro texture: warm base, two-tone polka dots, faint diagonal hatch. */
        background-image:
          radial-gradient(var(--bg-dot1) 2px, transparent 2.4px),
          radial-gradient(var(--bg-dot2) 2px, transparent 2.4px),
          repeating-linear-gradient(45deg, var(--bg-hatch) 0 2px, transparent 2px 22px);
        background-size: 26px 26px, 26px 26px, auto;
        background-position: 0 0, 13px 13px, 0 0;
        background-attachment: fixed;
      }

      /* Mobile-first: full-bleed fluid column, widen on larger screens. */
      .wrap {
        width: 100%;
        max-width: 720px;
        margin-inline: auto;
        padding: 20px 16px 48px;
      }
      @media (min-width: 640px) {
        .wrap { padding: 32px 20px 64px; }
      }

      .brand {
        display: inline-block;
        font-family: var(--font-head);
        font-size: 18px;
        color: var(--primary-foreground);
        background: var(--primary);
        text-decoration: none;
        padding: 8px 14px;
        border: 2px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
      }
      @media (min-width: 640px) {
        .brand { font-size: 20px; }
      }
      .topbar {
        display: flex; justify-content: space-between; align-items: center;
        gap: 12px; flex-wrap: wrap; margin-bottom: 24px;
      }
      @media (min-width: 640px) {
        .topbar { gap: 16px; margin-bottom: 32px; }
      }
      .nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
      .nav a {
        font-family: var(--font-head); font-size: 14px; text-decoration: none;
        color: var(--foreground); background: var(--background);
        border: 2px solid var(--border); border-radius: var(--radius);
        padding: 8px 12px; box-shadow: var(--shadow-xs);
        min-height: 44px; display: inline-flex; align-items: center;
      }
      .nav a:hover { background: var(--accent); }

      /* Language / direction toggle: two chunky neobrutalist buttons. */
      .lang-toggle { display: inline-flex; gap: 4px; }
      .lang-btn {
        appearance: none; cursor: pointer;
        font-family: var(--font-head); font-size: 14px;
        min-width: 44px; min-height: 44px; padding: 8px 10px;
        color: var(--foreground); background: var(--background);
        border: 2px solid var(--border); border-radius: var(--radius);
        box-shadow: var(--shadow-xs);
      }
      .lang-btn[aria-pressed="true"] { background: var(--primary); }
      .lang-btn:hover { background: var(--accent); }
      .lang-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
      .lang-btn[data-lang="ar"] { font-family: Tahoma, Arial, sans-serif; }
      /* Theme-cycle button: centers the inlined palette icon, tints with foreground. */
      .lang-btn.theme-btn { display: inline-flex; align-items: center; justify-content: center; color: var(--foreground); }
      .lang-btn.theme-btn svg { width: 20px; height: 20px; display: block; }

      h1 {
        font-family: var(--font-head);
        font-size: 32px;
        line-height: 1.08;
        letter-spacing: -0.01em;
        margin: 0 0 14px;
      }
      @media (min-width: 640px) {
        h1 { font-size: 40px; line-height: 1.05; }
      }
      p.lede { font-size: 16px; line-height: 1.55; margin-top: 0; color: var(--foreground); }
      @media (min-width: 640px) {
        p.lede { font-size: 17px; }
      }

      .panel {
        background: var(--card);
        color: var(--card-foreground);
        border: 2px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow-lg);
        padding: 18px;
      }
      @media (min-width: 640px) {
        .panel { padding: 24px; }
      }

      .row { display: flex; gap: 12px; flex-wrap: wrap; }
      @media (min-width: 640px) {
        .row { gap: 16px; }
      }

      /* === Buttons: rest at shadow-md, press into the shadow on click === */
      .btn {
        appearance: none; cursor: pointer;
        font-family: var(--font-head);
        font-size: 16px;
        padding: 12px 20px;
        min-height: 44px;
        color: var(--primary-foreground);
        background: var(--primary);
        border: 2px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow-md);
        text-decoration: none;
        display: inline-flex; align-items: center; justify-content: center; gap: 10px;
        transition: all 200ms;
      }
      .btn:hover { background: var(--primary-hover); box-shadow: var(--shadow); transform: translateY(4px); }
      .btn:active { box-shadow: none; transform: translate(4px, 8px); }
      .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
      .btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: var(--shadow-md); }
      .btn.danger { background: var(--destructive); color: var(--destructive-foreground); }
      .btn.ghost { background: var(--background); color: var(--foreground); }

      /* === Clickable cards: same press physics === */
      .card-link {
        flex: 1 1 220px; text-decoration: none; color: var(--card-foreground);
        background: var(--card);
        border: 2px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow-md);
        padding: 20px;
        transition: all 200ms;
      }
      @media (min-width: 640px) {
        .card-link { padding: 24px; }
      }
      .card-link:hover { box-shadow: var(--shadow); transform: translateY(4px); }
      .card-link:active { box-shadow: none; transform: translate(4px, 8px); }
      .card-link h2 { font-family: var(--font-head); margin: 10px 0 6px; font-size: 22px; }
      .card-link span { color: var(--muted-foreground); font-size: 15px; }
      .card-kicker { font-family: var(--font-head); font-size: 13px; letter-spacing: 0.06em; color: var(--muted-foreground); }

      label { display: block; font-family: var(--font-head); font-size: 14px; color: var(--foreground); margin: 0 0 6px; }
      input[type="text"] {
        width: 100%; padding: 12px 14px;
        font-family: var(--font-sans); font-size: 16px;
        min-height: 44px;
        border: 2px solid var(--border);
        border-radius: var(--radius);
        background: var(--background); color: var(--foreground);
        box-shadow: var(--shadow-sm);
        margin-bottom: 18px;
      }
      input[type="text"]:focus { outline: 2px solid var(--primary); outline-offset: 2px; }

      .status {
        display: inline-flex; align-items: center; gap: 8px;
        font-family: var(--font-head); font-size: 14px;
        padding: 6px 12px;
        background: var(--accent); color: var(--accent-foreground);
        border: 2px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow-xs);
      }
      .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted-foreground); flex: none; }
      .dot.live { background: var(--destructive); box-shadow: 0 0 0 3px rgba(230,57,70,.25); animation: pulse 1.4s infinite; }
      .dot.waiting { background: var(--primary); }
      @keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(230,57,70,0); } }

      .meta { color: var(--muted-foreground); margin-top: 18px; font-size: 15px; }
      .meta code { font-family: ui-monospace, monospace; background: var(--accent); padding: 1px 5px; border: 2px solid var(--border); }
      .err { color: var(--destructive); font-weight: 700; margin-top: 14px; min-height: 20px; font-size: 14px; }

      /* Level meter: scrolls instead of overflowing on narrow screens. */
      .levels { display: flex; gap: 4px; align-items: flex-end; height: 30px; margin-top: 16px; padding: 6px; border: 2px solid var(--border); background: var(--background); box-shadow: var(--shadow-sm); max-width: 100%; overflow-x: auto; }
      .levels i { width: 6px; background: var(--primary); border: 1px solid var(--border); height: 4px; transition: height .08s ease; display: inline-block; flex: none; }
      /* ── Bottom navigation bar (replaces the old top bar) ── */
      .bottomnav {
        position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
        height: var(--navh);
        display: grid; grid-template-columns: repeat(5, 1fr);
        background: var(--secondary); border-top: 2px solid var(--border);
      }
      .navlink {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        text-decoration: none; color: var(--secondary-foreground);
        font-family: var(--font-head); font-size: 10px; letter-spacing: .02em;
        border-inline-start: 2px solid rgba(255,255,255,.10);
        opacity: .72;
      }
      .navlink:first-child { border-inline-start: none; }
      .navlink svg { width: 22px; height: 22px; }
      .navlink.active { background: var(--primary); color: var(--primary-foreground); opacity: 1; }
      .navlink:active { opacity: 1; }

      /* ── Language selector (globe + dropdown), built into every .lang-toggle ── */
      .lang-toggle { position: relative; }
      .langsel { display: inline-flex; align-items: center; gap: 6px; }
      .langsel svg { width: 18px; height: 18px; }
      .langsel .lang-caret { width: 12px; height: 12px; opacity: .7; }
      .langsel-label { font-family: var(--font-head); }
      .langmenu {
        position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 80;
        list-style: none; margin: 0; padding: 4px; min-width: 160px;
        background: var(--card); color: var(--card-foreground);
        border: 2px solid var(--border); box-shadow: var(--shadow-md);
      }
      .langmenu li {
        font-family: var(--font-sans); font-size: 15px; padding: 10px 12px; cursor: pointer;
      }
      .langmenu li[data-lang="ar"] { font-family: Tahoma, Arial, sans-serif; font-size: 19px; }
      .langmenu li[aria-selected="true"] { background: var(--primary); color: var(--primary-foreground); }
      .langmenu li:hover { background: var(--accent); color: var(--accent-foreground); }

      /* Styled file inputs across the whole UI - hide the unstyled
         "No file chosen" text, keep a NeoBrutalist "choose file" button. */
      input[type="file"] { font-size: 0; color: transparent; max-width: 100%; }
      input[type="file"]::file-selector-button,
      input[type="file"]::-webkit-file-upload-button {
        font-family: var(--font-head); font-size: 13px; cursor: pointer;
        color: var(--primary-foreground); background: var(--primary);
        border: 2px solid var(--border); border-radius: var(--radius);
        box-shadow: var(--shadow-xs); padding: 8px 12px; margin-inline-end: 8px;
      }
      input[type="file"]::file-selector-button:hover,
      input[type="file"]::-webkit-file-upload-button:hover { background: var(--primary-hover); }

/* Clean landing - the shared site nav is redundant here. */
  .topbar { display: none !important; }
  .wrap { max-width: 100% !important; padding: 0 !important; }

.landing { position: relative; min-height: calc(100svh - var(--navh, 0px)); display: flex; padding: 20px; }
  .landing-lang { position: absolute; top: 16px; inset-inline-end: 16px; display: inline-flex; gap: 6px; }

  .landing-inner { margin: auto; width: 100%; max-width: 680px; display: flex; flex-direction: column; align-items: center; text-align: center; }

  .brandmark {
    display: inline-block; font-family: var(--font-head);
    font-size: clamp(38px, 12vw, 70px); line-height: 1; margin: 0;
    color: #000; background: var(--primary);
    padding: 12px 20px; border: 3px solid var(--border); box-shadow: var(--shadow-xl);
    transform: rotate(-1.8deg);
  }
  .tagline { font-size: clamp(15px, 4.2vw, 19px); margin: 30px 0 0; max-width: 28ch; line-height: 1.5; }

  .choices { display: grid; grid-template-columns: 1fr; gap: 16px; width: 100%; margin-top: 32px; }
  @media (min-width: 560px) { .choices { grid-template-columns: 1fr 1fr; } }

  .choice {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    text-decoration: none; color: #000;
    border: 3px solid var(--border); box-shadow: var(--shadow-lg);
    padding: 22px; transition: transform 160ms, box-shadow 160ms;
  }
  .choice:hover { transform: translateY(4px); box-shadow: var(--shadow); }
  .choice:active { transform: translate(4px, 8px); box-shadow: none; }
  .c-broadcast { background: var(--coral); }
  .c-listen { background: var(--purple); color: #fff; }
  .choice-ico svg { width: 46px; height: 46px; margin-bottom: 6px; }
  .choice-kicker { font-family: var(--font-head); font-size: 12px; letter-spacing: .08em; opacity: .8; }
  .choice-title { font-family: var(--font-head); font-size: 30px; line-height: 1.1; }
  .choice-desc { font-size: 14px; margin-top: 4px; }

  .secondary { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
  .secondary a {
    font-family: var(--font-head); font-size: 14px; text-decoration: none; color: #000;
    border: 2px solid var(--border); box-shadow: var(--shadow-xs); padding: 9px 16px;
    transition: transform 120ms, box-shadow 120ms;
  }
  .secondary a:active { transform: translate(2px, 2px); box-shadow: none; }
  .s-ep { background: var(--lime); }
  .s-ar { background: var(--orange); }

/* The broadcast desk owns the viewport - hide shared site chrome (this page only). */
  .topbar { display: none !important; }
  .wrap { max-width: 100% !important; padding: 0 !important; }

  /* OpenLayers - NeoBrutalist tweaks for the embedded Map tile. */
  .ol-mini { width: 100%; height: 100%; min-height: 220px; background: var(--muted); }
  .OpenLayers-container { font-family: var(--font-sans); background: var(--muted); }
  .neo-marker { background: var(--destructive); border: 2px solid var(--border); border-radius: 50%; box-shadow: 2px 2px 0 var(--border); }
  .OpenLayers-control-zoom a { border: 2px solid var(--border) !important; border-radius: 0 !important; background: var(--card) !important; color: var(--foreground) !important; }
  .OpenLayers-popup-content-wrapper, .OpenLayers-popup-tip { border: 2px solid var(--border) !important; border-radius: 0 !important; background: var(--card) !important; color: var(--card-foreground) !important; }

[hidden] { display: none !important; }
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

  /* ════════════════ SHELL ════════════════ */
  .console { display: flex; flex-direction: column; height: calc(100svh - var(--navh, 0px)); background: var(--background); overflow: hidden; }
  @media (min-width: 640px) {
    .console { height: min(calc(100svh - var(--navh, 0px)), 920px); max-width: 540px; margin: 16px auto; border: 2px solid var(--border); box-shadow: var(--shadow-lg); }
  }
  .console-head {
    flex: none; display: flex; align-items: center; gap: 8px;
    padding: 9px 12px; background: var(--secondary); color: var(--secondary-foreground);
    border-bottom: 2px solid var(--border);
  }
  .head-home { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; color: var(--secondary-foreground); text-decoration: none; border: 2px solid color-mix(in srgb, var(--secondary-foreground) 50%, transparent); background: transparent; }
  .head-home svg { width: 18px; height: 18px; }
  .head-home:active { background: color-mix(in srgb, var(--secondary-foreground) 15%, transparent); }
  .onair { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-head); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; padding: 6px 10px; border: 2px solid var(--border); background: var(--muted); color: var(--muted-foreground); }
  .onair[data-state="live"] { background: var(--destructive); color: var(--destructive-foreground); }
  .onair[data-state="preparing"], .onair[data-state="outro"] { background: var(--primary); color: var(--primary-foreground); }
  .timer { font-family: ui-monospace, monospace; font-size: 14px; border: 2px solid var(--border); padding: 5px 9px; background: var(--secondary); color: var(--primary); font-variant-numeric: tabular-nums; }
  .head-listeners { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-head); font-size: 14px; color: var(--secondary-foreground); }
  .head-listeners svg { width: 18px; height: 18px; }
  .console-lang { display: inline-flex; gap: 4px; flex: none; }
  .console-lang .lang-btn { min-width: 32px; min-height: 32px; padding: 4px 6px; font-size: 12px; box-shadow: none; }

  /* ════════════════ BENTO GRID ════════════════ */
  .bento {
    flex: 1; min-height: 0;
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 6px; padding: 8px 6px;
    align-content: center;   /* unified 2:3 tiles; leftover height = top/bottom margin */
    grid-auto-rows: var(--rowh, auto);  /* definite rows so expanded tiles never overflow */
    overflow-y: auto;
  }
  .tile:not(.tile-main) { aspect-ratio: 2 / 3; }
  .tile.expanded { aspect-ratio: auto; }
  /* Landscape / rotation: fill the short viewport with a stretched 4x4 grid
     instead of tall portrait tiles. Grid placement stays the same. */
  @media (orientation: landscape) {
    .bento { grid-template-rows: repeat(4, 1fr); align-content: stretch; }
    .tile:not(.tile-main) { aspect-ratio: auto; }
  }

  .tile {
    position: relative; min-width: 0; min-height: 0;
    border: 2px solid var(--border); box-shadow: var(--shadow-xs);
    background: var(--card); overflow: hidden; display: flex;
    transition: box-shadow 160ms ease;
  }
  .tile.expanded { z-index: 3; box-shadow: var(--shadow-md); }
  /* Covered tiles stay in the grid (keep anchoring the row/col tracks) but are
     hidden behind the expanded tile, so every expansion stays within its real
     grid rectangle instead of growing to its content. */
  .tile.covered { visibility: hidden; }
  /* Audio: a 2x2 of equal-height toggle cards that fills the whole 4:2 panel. */
  #tile-audio .tile-panel-body { display: flex; flex-direction: column; padding: 10px 12px; }
  #tile-audio.expanded .toggles {
    flex: 1; display: grid;
    grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px;
  }
  #tile-audio .chk {
    display: flex; flex-wrap: wrap; align-items: center; align-content: center;
    gap: 6px 10px; padding: 10px 12px; font-size: 14px; line-height: 1.2;
  }
  #tile-audio .chk input[type="checkbox"] { width: 24px; height: 24px; }
  #tile-audio .chk > span:not(.warn) { flex: 1 1 0; min-width: 0; }
  #tile-audio .chk .warn { flex: 1 1 100%; margin-inline-start: 34px; font-size: 11px; line-height: 1.1; }

  /* Wide (4:2) panels use the horizontal space: two columns instead of one. */
  #tile-jingles .tile-panel-body {
    display: grid; grid-template-columns: 1fr 1fr; gap: 7px 18px; align-content: start;
    padding: 8px 12px;
  }
  /* Compact so station name + all three jingle pickers fit the 4:2 panel. */
  #tile-jingles .tile-panel-body > label { font-size: 13px; }
  #tile-jingles #name { padding: 6px 10px; }
  #tile-jingles .setup-sub { font-size: 12px; }
  #tile-jingles .jingle-row label { font-size: 13px; }
  #tile-jingles .tile-panel-body > label,
  #tile-jingles .tile-panel-body > input,
  #tile-jingles .tile-panel-body > .setup-sub,
  #tile-jingles .tile-panel-body > .hint { grid-column: 1 / -1; margin: 0; }
  #tile-jingles .jingle-row { flex-direction: column; align-items: stretch; gap: 6px; margin: 0; }
  #tile-poll #pollOptions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  /* Compact so the whole create form (question + 4 options + launch) fits 4:2. */
  #tile-poll .tile-panel-body { padding: 8px 12px; }
  #tile-poll .poll-create { gap: 5px; }
  #tile-poll .poll-create > label { font-size: 13px; }
  #tile-poll .poll-create input { padding: 5px 10px; }
  #tile-poll #pollLaunch { margin-top: 2px; min-height: 38px; font-size: 15px; }

  /* Expand / shrink motion - light, small spring overshoot. */
  .tile-face { transition: filter 120ms ease, transform 200ms cubic-bezier(.2,.7,.3,1.3); }
  .tile.expanded .tile-panel { animation: tilePop 220ms cubic-bezier(.2,.7,.3,1.35); transform-origin: top center; }
  .tile.expanded .tile-panel-body { animation: tileFade 260ms ease 40ms both; }
  @keyframes tilePop { from { opacity: 0; transform: scale(.93); } to { opacity: 1; transform: scale(1); } }
  @keyframes tileFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
  @media (prefers-reduced-motion: reduce) { .tile, .tile-face, .tile.expanded .tile-panel, .tile.expanded .tile-panel-body { transition: none; animation: none; } }

  .tile-face {
    appearance: none; cursor: pointer; border: none;
    background-color: var(--tile, var(--card)); color: var(--tile-ink, var(--foreground));
    --pat: color-mix(in srgb, var(--tile-ink, #000) 16%, transparent);
    width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 6px; font-family: var(--font-head); font-size: 11px; text-align: center; line-height: 1.1;
  }
  /* Each tile carries a DISTINCT retro texture, drawn in its own ink colour. */
  #tile-sfx       .tile-face { background-image: repeating-linear-gradient(90deg,  var(--pat) 0 2.5px, transparent 2.5px 11px); }
  #tile-chat      .tile-face { background-image: radial-gradient(var(--pat) 1.7px, transparent 1.9px); background-size: 12px 12px; }
  #tile-requests  .tile-face { background-image: repeating-linear-gradient(45deg,  var(--pat) 0 3px, transparent 3px 12px); }
  #tile-poll      .tile-face { background-image: repeating-linear-gradient(0deg,   var(--pat) 0 2.5px, transparent 2.5px 12px); }
  #tile-rundown   .tile-face { background-image: repeating-linear-gradient(0deg, var(--pat) 0 2px, transparent 2px 13px), repeating-linear-gradient(90deg, var(--pat) 0 2px, transparent 2px 13px); }
  #tile-markers   .tile-face { background-image: repeating-linear-gradient(45deg, var(--pat) 0 2px, transparent 2px 13px), repeating-linear-gradient(-45deg, var(--pat) 0 2px, transparent 2px 13px); }
  #tile-stationid .tile-face { background-image: repeating-linear-gradient(45deg,  var(--pat) 0 6px, transparent 6px 13px); }
  #tile-map       .tile-face { background-image: repeating-radial-gradient(circle, var(--pat) 0 1.2px, transparent 1.2px 9px); }
  #tile-audio     .tile-face { background-image: repeating-linear-gradient(135deg, var(--pat) 0 3px, transparent 3px 12px); }
  #tile-jingles   .tile-face { background-image: repeating-linear-gradient(90deg,  var(--pat) 0 5px, transparent 5px 16px); }
  #tile-fades     .tile-face { background-image: radial-gradient(var(--pat) 2.4px, transparent 2.6px); background-size: 16px 16px; }
  .tile-face:hover { filter: brightness(0.94); }
  .tile-face:active { filter: brightness(0.86); }
  .tile-face svg { width: 28px; height: 28px; flex: none; }

  /* Per-tile vibrant colours */
  #tile-sfx       { --tile: var(--lime);        --tile-ink: #000; }
  #tile-chat      { --tile: var(--sky);         --tile-ink: #000; }
  #tile-requests  { --tile: var(--orange);      --tile-ink: #000; }
  #tile-poll      { --tile: var(--purple);      --tile-ink: #fff; }
  #tile-rundown   { --tile: var(--primary);     --tile-ink: #000; }
  #tile-markers   { --tile: var(--pink);        --tile-ink: #000; }
  #tile-stationid { --tile: var(--teal);        --tile-ink: #000; }
  #tile-map       { --tile: var(--navy);        --tile-ink: #fff; }
  #tile-audio     { --tile: var(--violet);      --tile-ink: #fff; }
  #tile-jingles   { --tile: var(--coral);       --tile-ink: #000; }
  #tile-fades     { --tile: var(--destructive); --tile-ink: #fff; }

  .tile-badge {
    position: absolute; top: 4px; inset-inline-end: 4px;
    min-width: 18px; height: 18px; padding: 0 4px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--destructive); color: var(--destructive-foreground); border: 2px solid var(--border);
    font-family: var(--font-head); font-size: 10px; line-height: 1;
  }
  .tile-badge[data-n="0"] { background: var(--muted); color: var(--muted-foreground); }

  .tile-panel { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; background: var(--card); }
  .tile-panel-head {
    flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 10px; background: var(--tile, var(--primary)); color: var(--tile-ink, #000);
    font-family: var(--font-head); font-size: 13px; border-bottom: 2px solid var(--border);
  }
  .tile-close { appearance: none; cursor: pointer; flex: none; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--border); background: var(--card); color: var(--card-foreground); }
  .tile-close svg { width: 16px; height: 16px; }
  .tile-panel-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px; }

  .tile-brand { align-items: center; justify-content: center; background: var(--secondary); color: var(--primary); }
  .tile-brand svg { width: 34px; height: 34px; }

  /* ════════════════ MAIN TILE (compact, fits 2x2) ════════════════ */
  .tile-main { display: flex; flex-direction: column; gap: 6px; padding: 8px; overflow: hidden; min-height: 0; background: var(--card); }
  .tile-main > * { flex: none; min-height: 0; }
  .setup-sub { font-family: var(--font-head); font-size: 13px; margin: 14px 0 8px; }
  .transport { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .big-go, .big-stop { width: 100%; font-size: 14px; padding: 8px 6px; min-height: 40px; }
  .meter-wrap { border: 2px solid var(--border); box-shadow: var(--shadow-xs); background: var(--background); padding: 6px; }
  .levels { display: flex; gap: 3px; align-items: flex-end; height: 18px; }
  .levels i { flex: 1; min-width: 0; background: var(--primary); border: 1px solid var(--border); height: 4px; transition: height .08s ease; }
  .levels.hot i { background: var(--destructive); }
  .vu { display: flex; gap: 10px; align-items: center; margin-top: 3px; font-family: var(--font-head); font-size: 11px; }
  .vu-peak { color: var(--muted-foreground); }
  .vu-peak.clip { color: var(--destructive); }
  .duck-pad { appearance: none; cursor: pointer; width: 100%; flex: 1 1 auto; min-height: 44px; font-family: var(--font-head); font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: var(--accent-foreground); border: 2px solid var(--border); box-shadow: var(--shadow-sm); transition: transform 80ms, box-shadow 80ms; }
  .duck-pad[disabled] { opacity: .5; cursor: not-allowed; }
  .duck-pad.held { background: var(--destructive); color: var(--destructive-foreground); box-shadow: none; transform: translate(3px, 5px); }
  kbd { font-family: ui-monospace, monospace; font-size: 11px; border: 2px solid var(--border); padding: 1px 5px; background: var(--background); }
  .fader { border: 2px solid var(--border); box-shadow: var(--shadow-xs); padding: 7px; }
  .fader-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3px; }
  .fader-top label { margin: 0; font-size: 12px; }
  .bedval { font-family: var(--font-head); }
  .fader input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 16px; background: var(--background); border: 2px solid var(--border); box-shadow: var(--shadow-xs); }
  .fader input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; background: var(--primary); border: 2px solid var(--border); box-shadow: var(--shadow-xs); cursor: pointer; }
  .fader input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; background: var(--primary); border: 2px solid var(--border); cursor: pointer; }
  .nowplaying { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
  .chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-head); font-size: 11px; padding: 4px 8px; background: var(--accent); color: var(--accent-foreground); border: 2px solid var(--border); }
  .chip-btn {
    appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
    font-family: var(--font-head); font-size: 12px; padding: 6px 12px; min-height: 34px;
    background: var(--accent); color: var(--accent-foreground);
    border: 2px solid var(--border); box-shadow: var(--shadow-sm);
    transition: transform 100ms, box-shadow 100ms;
  }
  .chip-btn:not([disabled]):hover { box-shadow: var(--shadow-xs); transform: translate(1px, 1px); }
  .chip-btn:not([disabled]):active { box-shadow: none; transform: translate(2px, 2px); }
  .chip-btn[disabled] { opacity: .5; cursor: not-allowed; }
  .warn { color: var(--destructive); font-size: 11px; }
  .err { color: var(--destructive); font-weight: 700; font-size: 13px; margin: 0; }
  .hint { color: var(--muted-foreground); font-size: 13px; margin: 8px 0 0; }

  /* ════════════════ PANEL CONTENT ════════════════ */
  /* ── SFX soundboard: compact grid of trigger pads filling the 2x2 quadrant ── */
  .sfx-board { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: stretch; height: 100%; }
  .sfx-pad {
    appearance: none; cursor: pointer; min-width: 0;
    display: flex; align-items: center; justify-content: center; text-align: center;
    font-family: var(--font-head); font-size: 13px; line-height: 1.05; padding: 6px 4px;
    background: var(--accent); color: var(--accent-foreground);
    border: 2px solid var(--border); box-shadow: var(--shadow-xs);
    transition: transform 90ms, box-shadow 90ms, background 90ms;
  }
  .sfx-pad:not([disabled]):active,
  .sfx-pad.hit { background: var(--primary); color: var(--primary-foreground); box-shadow: none; transform: translate(2px, 2px); }
  .sfx-pad[disabled] { opacity: .45; cursor: not-allowed; }

  /* ── Chat: roomy conversation list with a composer pinned at the bottom ── */
  .chat-body { display: flex; flex-direction: column; padding: 0; }
  .chat-body .scroll-list { margin: 10px 10px 10px; }
  .chat-body .composer, .chat-body .block-btn { margin: 0 10px 10px; }
  /* In a flex column the button already stretches to fill; an explicit 100% width
     plus side margins would push it past the panel, so let it auto-size. */
  .chat-body .block-btn { width: auto; }
  .scroll-list { list-style: none; padding: 0; margin: 0; flex: 1; min-height: 80px; overflow-y: auto; border: 2px solid var(--border); box-shadow: var(--shadow-xs); background: var(--background); }
  /* Empty-state hint for any dynamic list (text supplied via data-empty / i18n). */
  .scroll-list:empty::after,
  .marker-list:empty::after,
  .rundown-list:empty::after {
    content: attr(data-empty); display: block;
    padding: 18px 14px; text-align: center;
    font-size: 13px; color: var(--muted-foreground); line-height: 1.4;
  }
  .marker-list:empty, .rundown-list:empty { list-style: none; padding-inline-start: 0; }
  .req-list li, .chat-list li { padding: 10px 12px; border-bottom: 1px solid var(--muted); font-size: 14px; line-height: 1.4; }
  .req-list li:last-child, .chat-list li:last-child { border-bottom: none; }
  .req-name, .chat-name { font-family: var(--font-head); font-size: 12px; margin-inline-end: 8px; color: var(--muted-foreground); }
  .chat-list li.me .chat-name { color: var(--primary-foreground); background: var(--primary); padding: 0 4px; }
  .composer { display: flex; gap: 8px; }
  .composer input { flex: 1; margin: 0; }
  .block-btn { width: 100%; }

  /* ── Requests: readable incoming list, clear sender + text, clear-all pinned ── */
  .req-list li { display: block; }
  .req-list .req-name { display: block; margin: 0 0 2px; font-size: 13px; color: var(--foreground); }
  .req-list .req-text { font-size: 15px; }

  /* ── Poll: comfortable creation form, prominent live result bars when running ── */
  .poll-create { display: flex; flex-direction: column; gap: 10px; }
  .poll-create label, .poll-create input { margin: 0; }
  .poll-create > label { font-size: 15px; }
  #pollOptions { display: grid; grid-template-columns: 1fr; gap: 8px; }
  @media (min-width: 560px) { #pollOptions { grid-template-columns: 1fr 1fr; } }
  #pollOptions input { margin: 0; }
  #pollLaunch { margin-top: 4px; min-height: 50px; font-size: 16px; }
  .poll-q { font-family: var(--font-head); font-size: 19px; line-height: 1.2; margin: 0 0 16px; }
  .poll-bars { list-style: none; padding: 0; margin: 0 0 14px; }
  .poll-bars li { margin-bottom: 14px; }
  .poll-bar-label { font-family: var(--font-head); font-size: 14px; margin-bottom: 5px; display: flex; justify-content: space-between; gap: 8px; }
  .poll-bar-track { height: 30px; background: var(--background); border: 2px solid var(--border); box-shadow: var(--shadow-xs); }
  .poll-bar-fill { height: 100%; background: var(--primary); transition: width 0.4s; }
  #pollClose { min-height: 48px; }

  /* ── Rundown / Markers: spacious editable lists, comfortable tap targets ── */
  .rundown-add { display: flex; gap: 8px; margin-bottom: 14px; }
  .rundown-add input { flex: 1; margin: 0; }
  .rundown-add .btn { min-height: 48px; }
  /* Narrow tiles (top-right 2x2): stack the add-row so the input gets full width. */
  #tile-markers .rundown-add { flex-direction: column; align-items: stretch; }
  #tile-markers .rundown-add input { width: 100%; }
  #tile-markers .rundown-add .btn { width: 100%; }
  .rundown-list { padding-inline-start: 22px; margin: 0; }
  .rundown-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--muted); font-size: 15px; }
  .rundown-list li span { flex: 1; min-width: 0; }
  .rundown-list li.done span { text-decoration: line-through; color: var(--muted-foreground); }
  .rundown-list li input[type="checkbox"] { width: 22px; height: 22px; flex: none; cursor: pointer; }
  .rundown-list li .del { background: none; border: 2px solid transparent; color: var(--destructive); cursor: pointer; font-size: 18px; line-height: 1; margin-inline-start: auto; padding: 6px 10px; flex: none; }

  .marker-list { padding-inline-start: 22px; margin: 0; }
  .marker-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; font-family: var(--font-sans); font-size: 15px; border-bottom: 1px solid var(--muted); }
  .marker-list li .ts { font-family: ui-monospace, monospace; color: var(--muted-foreground); min-width: 64px; flex: none; }

  /* ── Station ID: clearly spaced file picker + interval + activate ── */
  .id-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
  .id-row label { margin: 0; min-width: 130px; }
  .id-row input[type="file"] { flex: 1; min-width: 0; }
  .id-row .num { width: 90px; padding: 10px 12px; margin: 0; font-family: var(--font-sans); }
  .id-row .btn { min-height: 48px; margin-inline-start: auto; }

  /* ── Setup: station name + jingle file pickers, comfortable spacing ── */
  .jingle-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
  .jingle-row label { margin: 0; min-width: 96px; font-size: 14px; }
  .jingle-row input[type="file"] { font-size: 0; min-width: 0; flex: 1; }

  /* ── Audio: toggles laid out as large, obvious switch rows ── */
  .toggles { display: flex; flex-direction: column; gap: 12px; }
  .chk {
    display: flex; align-items: center; gap: 14px;
    font-family: var(--font-sans); font-size: 15px; margin: 0;
    padding: 14px 16px; border: 2px solid var(--border); box-shadow: var(--shadow-xs);
    background: var(--background); cursor: pointer;
  }
  .chk input[type="checkbox"] { width: 26px; height: 26px; flex: none; cursor: pointer; }

  /* ── Fades: large, full-size fade controls ── */
  .fade-actions { display: flex; flex-direction: column; gap: 14px; height: 100%; }
  .fade-actions .btn { width: 100%; flex: 1; min-height: 72px; font-size: 18px; }

  .map-body { padding: 0; display: flex; }
  .ol-mini { flex: 1; min-height: 220px; }

  /* ════════════════ OVERLAYS ════════════════ */
  .deadair-toast { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 60; width: min(94%, 520px); background: var(--destructive); color: var(--destructive-foreground); border: 2px solid var(--border); box-shadow: var(--shadow-lg); padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-family: var(--font-head); font-size: 14px; }
  .deadair-toast button { background: color-mix(in srgb, var(--destructive-foreground) 20%, transparent); color: var(--destructive-foreground); border-color: color-mix(in srgb, var(--destructive-foreground) 60%, transparent); box-shadow: none; min-height: 38px; padding: 8px 12px; }

  .savesheet { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
  @media (min-width: 640px) { .savesheet { align-items: center; } }
  .savesheet .sheet { width: 100%; max-width: 520px; max-height: 90svh; overflow-y: auto; background: var(--card); border: 2px solid var(--border); box-shadow: var(--shadow-xl); padding: 18px; }
  .save-h { font-family: var(--font-head); font-size: 22px; margin: 0 0 8px; }
  .preview-player { margin: 8px 0 14px; }
  .save-markers { margin: 0 0 14px; padding: 10px; background: var(--accent); border: 2px solid var(--border); font-size: 13px; }
  .save-markers h3 { margin: 0 0 6px; font-size: 13px; }
  .save-markers ol { margin: 0; padding-inline-start: 20px; }
  .save-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }

/* The listen console owns the viewport - hide shared site chrome (this page only). */
  .topbar { display: none !important; }
  .wrap { max-width: 100% !important; padding: 0 !important; }

[hidden] { display: none !important; }
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

  /* ════════════════ SHELL ════════════════ */
  /* Reserve room for the global fixed bottom nav (height var(--navh)). */
  .console { display: flex; flex-direction: column; height: calc(100svh - var(--navh, 0px)); background: var(--background); overflow: hidden; }
  @media (min-width: 640px) {
    .console { height: min(calc(100svh - var(--navh, 0px)), 920px); max-width: 540px; margin: 16px auto; border: 2px solid var(--border); box-shadow: var(--shadow-lg); }
  }
  .console-head {
    flex: none; display: flex; align-items: center; gap: 8px;
    padding: 9px 12px; background: var(--secondary); color: var(--secondary-foreground);
    border-bottom: 2px solid var(--border);
  }
  .head-home { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; color: var(--secondary-foreground); text-decoration: none; border: 2px solid color-mix(in srgb, var(--secondary-foreground) 50%, transparent); background: transparent; }
  .head-home svg { width: 18px; height: 18px; }
  .head-home:active { background: color-mix(in srgb, var(--secondary-foreground) 15%, transparent); }
  .onair { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-head); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; padding: 6px 10px; border: 2px solid var(--border); background: var(--muted); color: var(--muted-foreground); }
  .onair[data-state="live"] { background: var(--destructive); color: var(--destructive-foreground); }
  .onair[data-state="waiting"] { background: var(--primary); color: var(--primary-foreground); }
  .head-listeners { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-head); font-size: 14px; color: var(--secondary-foreground); }
  .head-listeners svg { width: 18px; height: 18px; }
  .console-lang { display: inline-flex; gap: 4px; flex: none; }
  .console-lang .lang-btn { min-width: 32px; min-height: 32px; padding: 4px 6px; font-size: 12px; box-shadow: none; }

  /* ════════════════ BENTO GRID ════════════════ */
  .bento {
    flex: 1; min-height: 0;
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 6px; padding: 8px 6px;
    align-content: center;   /* unified 2:3 tiles; leftover height = top/bottom margin */
    grid-auto-rows: var(--rowh, auto);  /* definite rows so expanded tiles never overflow */
    overflow-y: auto;
  }
  .tile:not(.tile-main) { aspect-ratio: 2 / 3; }
  .tile.tile-brand { aspect-ratio: auto; min-height: 64px; }
  .tile.expanded { aspect-ratio: auto; }

  .tile {
    position: relative; min-width: 0; min-height: 0;
    border: 2px solid var(--border); box-shadow: var(--shadow-xs);
    background: var(--card); overflow: hidden; display: flex;
    transition: box-shadow 160ms ease;
  }
  .tile.expanded { z-index: 3; box-shadow: var(--shadow-md); }
  .tile.covered { visibility: hidden; }

  /* Expand / shrink motion - light, small spring overshoot. */
  .tile-face { transition: filter 120ms ease, transform 200ms cubic-bezier(.2,.7,.3,1.3); }
  .tile.expanded .tile-panel { animation: tilePop 220ms cubic-bezier(.2,.7,.3,1.35); transform-origin: top center; }
  .tile.expanded .tile-panel-body { animation: tileFade 260ms ease 40ms both; }
  @keyframes tilePop { from { opacity: 0; transform: scale(.93); } to { opacity: 1; transform: scale(1); } }
  @keyframes tileFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
  @media (prefers-reduced-motion: reduce) { .tile, .tile-face, .tile.expanded .tile-panel, .tile.expanded .tile-panel-body { transition: none; animation: none; } }

  .tile-face {
    appearance: none; cursor: pointer; border: none;
    background-color: var(--tile, var(--card)); color: var(--tile-ink, var(--foreground));
    --pat: color-mix(in srgb, var(--tile-ink, #000) 16%, transparent);
    width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 6px; font-family: var(--font-head); font-size: 11px; text-align: center; line-height: 1.1;
  }
  /* Each tile carries a DISTINCT retro texture, drawn in its own ink colour. */
  #tile-chat     .tile-face { background-image: radial-gradient(var(--pat) 1.7px, transparent 1.9px); background-size: 12px 12px; }
  #tile-request  .tile-face { background-image: repeating-linear-gradient(45deg, var(--pat) 0 3px, transparent 3px 12px); }
  #tile-location .tile-face { background-image: repeating-radial-gradient(circle, var(--pat) 0 1.2px, transparent 1.2px 9px); }
  #tile-poll     .tile-face { background-image: repeating-linear-gradient(0deg, var(--pat) 0 2px, transparent 2px 13px), repeating-linear-gradient(90deg, var(--pat) 0 2px, transparent 2px 13px); }
  .tile-face:hover { filter: brightness(0.94); }
  .tile-face:active { filter: brightness(0.86); }
  .tile-face svg { width: 28px; height: 28px; flex: none; }

  /* Per-tile vibrant colours - each UNIQUE, no repeats. */
  #tile-chat     { --tile: var(--coral);   --tile-ink: #000; }
  #tile-request  { --tile: var(--lime);    --tile-ink: #000; }
  #tile-location { --tile: var(--sky);     --tile-ink: #000; }
  #tile-poll     { --tile: var(--purple);  --tile-ink: #fff; }

  .tile-badge {
    position: absolute; top: 4px; inset-inline-end: 4px;
    min-width: 18px; height: 18px; padding: 0 4px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--destructive); color: var(--destructive-foreground); border: 2px solid var(--border);
    font-family: var(--font-head); font-size: 10px; line-height: 1;
  }

  .tile-panel { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; background: var(--card); }
  .tile-panel-head {
    flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 10px; background: var(--tile, var(--primary)); color: var(--tile-ink, #000);
    font-family: var(--font-head); font-size: 13px; border-bottom: 2px solid var(--border);
  }
  .tile-close { appearance: none; cursor: pointer; flex: none; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--border); background: var(--card); color: var(--foreground); }
  .tile-close svg { width: 16px; height: 16px; }
  .tile-panel-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px; }

  .tile-brand { align-items: center; justify-content: center; gap: 12px; background: var(--secondary); color: var(--primary); }
  .tile-brand svg { width: 30px; height: 30px; flex: none; }
  .brand-word { font-family: var(--font-head); font-size: 13px; letter-spacing: .03em; color: var(--secondary-foreground); }

  /* ════════════════ MAIN TILE (compact, fits 2x2 down to 360px) ════════════════ */
  .tile-main { display: flex; flex-direction: column; gap: 8px; padding: 10px; overflow: hidden; min-height: 0; background: var(--card); }
  .tile-main > * { flex: none; min-height: 0; }
  .transport { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .big-go, .big-stop { width: 100%; font-size: 14px; padding: 9px 6px; min-height: 42px; }
  /* Status card is the hero - it grows to absorb leftover height so the tile
     never overflows on small phones and the layout stays clean. */
  .status-card {
    flex: 1 1 auto; display: flex; align-items: center; gap: 10px;
    border: 2px solid var(--border); box-shadow: var(--shadow-xs); background: var(--background);
    padding: 10px 12px;
  }
  .status-dot { flex: none; }
  .status-big { font-family: var(--font-head); font-size: 14px; line-height: 1.15; }
  .tuned-row { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-size: 13px; }
  .tuned-icon { display: inline-flex; flex: none; }
  .tuned-icon svg { width: 18px; height: 18px; }
  .tuned-label { color: var(--muted-foreground); }
  .tuned-count { margin-inline-start: auto; font-size: 18px; }
  .nowplaying { display: flex; min-height: 28px; align-items: center; }
  .chip { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-head); font-size: 12px; padding: 5px 10px; background: var(--accent); color: var(--accent-foreground); border: 2px solid var(--border); }
  .np-chip { background: var(--destructive); color: var(--destructive-foreground); }
  .np-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
  .np-bars i { width: 3px; background: currentColor; animation: npPulse .9s ease-in-out infinite; }
  .np-bars i:nth-child(1) { height: 6px; animation-delay: 0s; }
  .np-bars i:nth-child(2) { height: 12px; animation-delay: .2s; }
  .np-bars i:nth-child(3) { height: 8px; animation-delay: .4s; }
  @keyframes npPulse { 0%, 100% { transform: scaleY(.4); } 50% { transform: scaleY(1); } }
  @media (prefers-reduced-motion: reduce) { .np-bars i { animation: none; } }
  .err { color: var(--destructive); font-weight: 700; font-size: 13px; margin: 0; min-height: 0; }
  .hint { color: var(--muted-foreground); font-size: 14px; margin: 0; }

  /* ════════════════ PANEL CONTENT ════════════════ */
  /* Shared panel scaffolding - every expanded body reads as finished & spacious. */
  .block-btn { width: 100%; }
  .panel-intro { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
  .panel-intro-icon {
    flex: none; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--tile, var(--accent)); color: var(--tile-ink, #000); border: 2px solid var(--border); box-shadow: var(--shadow-xs);
  }
  .panel-intro-icon svg { width: 20px; height: 20px; }
  .panel-intro label, .panel-intro .hint { margin: 0; align-self: center; }
  .panel-confirm {
    display: flex; align-items: center; gap: 8px; margin: 12px 0 0;
    font-family: var(--font-head); font-size: 13px; color: var(--accent-foreground);
    padding: 8px 10px; background: var(--accent); border: 2px solid var(--border); box-shadow: var(--shadow-xs);
  }
  .panel-confirm svg { width: 18px; height: 18px; flex: none; }
  .panel-empty {
    margin: auto; padding: 16px 12px; text-align: center;
    color: var(--muted-foreground); font-size: 14px;
  }
  /* Bigger centred empty state with an icon (poll). */
  .panel-empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; text-align: center; min-height: 100%; padding: 16px;
  }
  .panel-empty-icon {
    width: 56px; height: 56px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--muted); color: var(--muted-foreground); border: 2px solid var(--border); box-shadow: var(--shadow-xs);
  }
  .panel-empty-icon svg { width: 30px; height: 30px; }
  .panel-empty-title { font-family: var(--font-head); font-size: 16px; margin: 0; color: var(--foreground); }
  .panel-empty-state .hint { max-width: 32ch; }

  /* Chat - tall, roomy conversation list; composer pinned at the bottom. */
  .chat-body { display: flex; flex-direction: column; padding: 0; gap: 0; }
  .chat-body .scroll-list { margin: 10px 10px 8px; }
  .chat-body .composer { margin: 0 10px 12px; }
  .scroll-list { display: flex; flex-direction: column; flex: 1; min-height: 120px; overflow-y: auto; -webkit-overflow-scrolling: touch; border: 2px solid var(--border); box-shadow: var(--shadow-xs); background: var(--background); }
  .chat-list { list-style: none; padding: 0; margin: 0; }
  .chat-list li { padding: 10px 12px; border-bottom: 1px solid var(--muted); font-size: 15px; line-height: 1.45; }
  .chat-list li:last-child { border-bottom: none; }
  .chat-name { font-family: var(--font-head); font-size: 12px; margin-inline-end: 8px; color: var(--muted-foreground); }
  .chat-list li.me .chat-name { color: var(--primary-foreground); background: var(--primary); padding: 0 4px; }
  .chat-list li.broadcaster .chat-name { color: var(--destructive-foreground); background: var(--destructive); padding: 0 4px; }
  /* Friendly, centred empty state that fills the tall list. */
  .chat-empty {
    margin: auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; padding: 24px 18px; text-align: center;
  }
  .chat-empty-icon {
    width: 52px; height: 52px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--tile, var(--accent)); color: var(--tile-ink, var(--foreground));
    border: 2px solid var(--border); box-shadow: var(--shadow-xs);
  }
  .chat-empty-icon svg { width: 28px; height: 28px; }
  .chat-empty-title { font-family: var(--font-head); font-size: 15px; margin: 0; color: var(--foreground); }
  .chat-empty .hint { max-width: 28ch; }
  .composer { display: flex; gap: 8px; }
  .composer input { flex: 1; margin: 0; }

  /* Request - label, big input, prominent send, confirmation, tip; room to breathe. */
  .req-body { display: flex; flex-direction: column; gap: 0; }
  .req-body input { margin: 0 0 12px; font-size: 16px; min-height: 50px; }
  .req-send { gap: 8px; min-height: 50px; font-size: 16px; }
  .req-send svg { width: 20px; height: 20px; flex: none; }
  .req-hint { margin-top: auto; padding-top: 14px; }

  /* Location - clear opt-in hero, big share button, privacy hint, live status. */
  .loc-body { display: flex; flex-direction: column; gap: 0; }
  .loc-hero {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
    padding: 8px 6px 16px;
  }
  .loc-hero-icon {
    width: 52px; height: 52px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--tile, var(--accent)); color: var(--tile-ink, var(--foreground));
    border: 2px solid var(--border); box-shadow: var(--shadow-xs);
  }
  .loc-hero-icon svg { width: 28px; height: 28px; }
  .loc-kicker { font-family: var(--font-head); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-foreground); margin: 0; }
  .loc-hero .loc-hint { max-width: 34ch; }
  .loc-btn { gap: 8px; min-height: 52px; font-size: 16px; }
  .loc-btn svg { width: 20px; height: 20px; flex: none; }
  .loc-privacy { font-size: 13px; color: var(--muted-foreground); margin: 10px 0 0; text-align: center; }
  .loc-status {
    margin: 12px 0 0; font-family: var(--font-head); font-size: 14px;
    padding: 10px 12px; border: 2px solid var(--border); box-shadow: var(--shadow-xs);
    background: var(--background); color: var(--foreground);
  }
  .loc-status[data-kind="ok"] { background: var(--accent); color: var(--accent-foreground); }
  .loc-status[data-kind="pending"] { background: var(--background); color: var(--muted-foreground); }
  .loc-status[data-kind="err"] { background: var(--destructive); color: var(--destructive-foreground); }

  /* Poll - strong empty state; live = prominent question + big votes + result bars. */
  .poll-body { display: flex; flex-direction: column; }
  #pollNone, #pollLive { flex: 1 1 auto; min-height: 0; }
  .poll-live { display: flex; flex-direction: column; }
  .poll-question-card {
    background: var(--tile, var(--accent)); color: var(--tile-ink, var(--foreground));
    border: 2px solid var(--border); box-shadow: var(--shadow-sm);
    padding: 14px 16px; margin-bottom: 16px;
  }
  .poll-kicker { font-family: var(--font-head); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; opacity: .85; margin: 0 0 6px; }
  .poll-q { font-family: var(--font-head); font-size: 20px; line-height: 1.18; margin: 0; }
  /* On the wide bottom band, vote buttons sit two-up; results sit beside/under. */
  .poll-vote { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
  @media (min-width: 480px) { .poll-vote { grid-template-columns: 1fr 1fr; } }
  .poll-vote button { width: 100%; min-height: 52px; font-size: 16px; text-align: start; justify-content: flex-start; }
  .poll-results-head { font-family: var(--font-head); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-foreground); margin: 0 0 10px; }
  .poll-bars { list-style: none; padding: 0; margin: 0; }
  .poll-bars li { margin-bottom: 14px; }
  .poll-bars li:last-child { margin-bottom: 0; }
  .poll-bar-label { font-family: var(--font-head); font-size: 14px; margin-bottom: 5px; display: flex; justify-content: space-between; gap: 8px; }
  .poll-bar-track { height: 26px; background: var(--background); border: 2px solid var(--border); box-shadow: var(--shadow-xs); }
  .poll-bar-fill { height: 100%; background: var(--tile, var(--primary)); transition: width 0.4s; min-width: 2px; }

  /* ════════════════ LANDSCAPE ════════════════ */
  @media (orientation: landscape) and (max-height: 540px) {
    .console { height: calc(100svh - var(--navh, 0px)); }
    .tile-main { gap: 6px; padding: 8px; }
    .status-card { padding: 7px 10px; }
  }

/* Slim per-page header replaces the shared site chrome on this page. */
  .topbar { display: none !important; }
  .wrap { max-width: 100% !important; }

/* Vibrant multi-color NeoBrutalism - see DESIGN.md "Color".
     Each episode is a record card with its own accent hue cycling
     coral / lime / sky / orange / purple / pink down the list. Tokens drive
     every color so the themes recolor the page end to end. */

  /* Slim header row: home/back link on the start side, language toggle on the end. */
  .page-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 24px;
  }
  .bar-home {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; flex: none; color: var(--foreground);
    text-decoration: none; background: var(--background);
    border: 2px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
  }
  .bar-home svg { width: 22px; height: 22px; }
  .bar-home:hover { background: var(--accent); color: var(--accent-foreground); }
  .bar-home:active { transform: translate(2px, 2px); box-shadow: none; }

  /* Tilted brandmark-style page title - episodes pick the lime hue. */
  .page-head.brandmark {
    display: inline-block; align-self: flex-start;
    font-family: var(--font-head);
    font-size: clamp(32px, 9vw, 44px); line-height: 1;
    margin: 0 0 14px; padding: 10px 18px;
    color: #000; background: var(--lime);
    border: 3px solid var(--border); box-shadow: var(--shadow-lg);
    transform: rotate(-1.8deg);
  }

  /* Status line as a sky-blue pill (black ink on a light hue). */
  .status-pill {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-head); font-size: 14px;
    margin-top: 8px;
    padding: 6px 12px;
    background: var(--sky); color: #000;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
  }
  .status-pill[hidden] { display: none; }

  .ep-list { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }

  /* ── Record card ─────────────────────────────────────────────────────── */
  .ep-card {
    --hue: var(--coral);
    position: relative;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--card); color: var(--card-foreground);
    padding: 16px;
    /* Colored edge sits on the start side and mirrors under RTL. */
    border-inline-start: 10px solid var(--hue);
  }
  /* Rotate the accent hue across the list. */
  .ep-card:nth-child(6n + 1) { --hue: var(--coral); }
  .ep-card:nth-child(6n + 2) { --hue: var(--lime); }
  .ep-card:nth-child(6n + 3) { --hue: var(--sky); }
  .ep-card:nth-child(6n + 4) { --hue: var(--orange); }
  .ep-card:nth-child(6n + 5) { --hue: var(--purple); }
  .ep-card:nth-child(6n + 6) { --hue: var(--pink); }

  /* Header: a hued record-disc badge next to the title. */
  .ep-head { display: flex; align-items: flex-start; gap: 12px; }
  .ep-disc {
    flex: none; width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--hue); color: #000;
    border: 2px solid var(--border); box-shadow: var(--shadow-xs);
  }
  .ep-disc svg { width: 24px; height: 24px; }
  .ep-title {
    font-family: var(--font-head); font-size: 18px; line-height: 1.15;
    margin: 0; align-self: center;
    overflow-wrap: anywhere;
  }

  /* Meta row: small bordered chips with an icon + value each. */
  .ep-meta {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin: 12px 0 0; padding: 0;
  }
  .ep-chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-sans); font-size: 13px; line-height: 1;
    color: var(--foreground);
    background: var(--background);
    padding: 6px 9px;
    border: 2px solid var(--border);
    box-shadow: var(--shadow-xs);
  }
  .ep-chip svg { width: 15px; height: 15px; flex: none; opacity: .85; }

  .ep-card audio { width: 100%; margin-top: 14px; display: block; }

  /* ── Loading / empty states ──────────────────────────────────────────── */
  .ep-state {
    text-align: center;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--card); color: var(--card-foreground);
    padding: 36px 22px;
    box-shadow: var(--shadow-sm);
  }
  .ep-state-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; margin-bottom: 14px;
    background: var(--lime); color: #000;
    border: 2px solid var(--border); box-shadow: var(--shadow-sm);
    transform: rotate(-3deg);
  }
  .ep-state-icon svg { width: 34px; height: 34px; }
  .ep-state h2 { font-family: var(--font-head); font-size: 20px; margin: 0 0 6px; }
  .ep-state p { font-family: var(--font-sans); font-size: 15px; line-height: 1.5; margin: 0 auto; max-width: 36ch; color: var(--muted-foreground); }

  /* Skeleton placeholders shown while loading. */
  .ep-skel { pointer-events: none; }
  .ep-skel .sk {
    background: var(--muted);
    border: 2px solid var(--border);
    animation: epPulse 1.2s ease-in-out infinite;
  }
  .ep-skel .sk-disc { width: 44px; height: 44px; }
  .ep-skel .sk-title { height: 20px; width: 65%; align-self: center; }
  .ep-skel .sk-chip { height: 27px; width: 84px; }
  .ep-skel .sk-audio { height: 36px; width: 100%; margin-top: 14px; }
  @keyframes epPulse { 50% { opacity: .45; } }
  @media (prefers-reduced-motion: reduce) { .ep-skel .sk { animation: none; } }

/* Slim per-page header replaces the shared site chrome on this page. */
  .topbar { display: none !important; }
  .wrap { max-width: 100% !important; }

/* Vibrant multi-color NeoBrutalism - see DESIGN.md "Color".
     Each archived episode is a record card with its own accent hue cycling
     coral / lime / sky / orange / purple / pink down the list. Tokens drive
     every color so the themes recolor the page end to end. */

  /* Slim header row: home/back link on the start side, language toggle on the end. */
  .page-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 24px;
  }
  .bar-home {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; flex: none; color: var(--foreground);
    text-decoration: none; background: var(--background);
    border: 2px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
  }
  .bar-home svg { width: 22px; height: 22px; }
  .bar-home:hover { background: var(--accent); color: var(--accent-foreground); }
  .bar-home:active { transform: translate(2px, 2px); box-shadow: none; }

  /* Tilted brandmark-style page title - archive picks the orange hue. */
  .page-head.brandmark {
    display: inline-block; align-self: flex-start;
    font-family: var(--font-head);
    font-size: clamp(32px, 9vw, 44px); line-height: 1;
    margin: 0 0 14px; padding: 10px 18px;
    color: #000; background: var(--orange);
    border: 3px solid var(--border); box-shadow: var(--shadow-lg);
    transform: rotate(-1.8deg);
  }

  /* Status line as a lime pill (black ink on a light hue). */
  .status-pill {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-head); font-size: 14px;
    margin-top: 8px;
    padding: 6px 12px;
    background: var(--lime); color: #000;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
  }
  .status-pill[hidden] { display: none; }

  .ep-list { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }

  /* ── Record card ─────────────────────────────────────────────────────── */
  .ep-card {
    --hue: var(--coral);
    position: relative;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--card); color: var(--card-foreground);
    padding: 16px;
    border-inline-start: 10px solid var(--hue);
  }
  .ep-card:nth-child(6n + 1) { --hue: var(--coral); }
  .ep-card:nth-child(6n + 2) { --hue: var(--lime); }
  .ep-card:nth-child(6n + 3) { --hue: var(--sky); }
  .ep-card:nth-child(6n + 4) { --hue: var(--orange); }
  .ep-card:nth-child(6n + 5) { --hue: var(--purple); }
  .ep-card:nth-child(6n + 6) { --hue: var(--pink); }

  /* Header: hued record-disc badge, the title, and the status badge. */
  .ep-head { display: flex; align-items: flex-start; gap: 12px; }
  .ep-disc {
    flex: none; width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--hue); color: #000;
    border: 2px solid var(--border); box-shadow: var(--shadow-xs);
  }
  .ep-disc svg { width: 24px; height: 24px; }
  .ep-headtext { min-width: 0; flex: 1; }
  .ep-title {
    font-family: var(--font-head); font-size: 18px; line-height: 1.15;
    margin: 0 0 6px; overflow-wrap: anywhere;
  }

  /* Status pills: published = sky (black ink), private = navy (white ink). */
  .badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-family: var(--font-head); font-size: 11px; line-height: 1;
    letter-spacing: .03em; text-transform: uppercase;
    padding: 4px 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
  }
  .badge svg { width: 13px; height: 13px; }
  .badge.pub { background: var(--sky); color: #000; }
  .badge.priv { background: var(--navy); color: #fff; }

  /* Meta row: small bordered chips with an icon + value each. */
  .ep-meta {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin: 12px 0 0; padding: 0;
  }
  .ep-chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-sans); font-size: 13px; line-height: 1;
    color: var(--foreground);
    background: var(--background);
    padding: 6px 9px;
    border: 2px solid var(--border);
    box-shadow: var(--shadow-xs);
  }
  .ep-chip svg { width: 15px; height: 15px; flex: none; opacity: .85; }

  .ep-card audio { width: 100%; margin: 14px 0 0; display: block; }

  /* Actions: full-width press-physics buttons; wrap to a row when there's room. */
  .ep-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
  .ep-actions .btn {
    flex: 1 1 calc(50% - 5px);
    font-size: 14px; padding: 10px 14px; gap: 8px;
  }
  .ep-actions .btn svg { width: 16px; height: 16px; flex: none; }
  /* Primary action (publish/unpublish) carries a purple hue with white ink. */
  .ep-actions .btn.publish { background: var(--purple); color: #fff; }
  .ep-actions .btn.publish:hover { background: var(--purple); }

  /* ── Loading / empty states ──────────────────────────────────────────── */
  .ep-state {
    text-align: center;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--card); color: var(--card-foreground);
    padding: 36px 22px;
    box-shadow: var(--shadow-sm);
  }
  .ep-state-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; margin-bottom: 14px;
    background: var(--orange); color: #000;
    border: 2px solid var(--border); box-shadow: var(--shadow-sm);
    transform: rotate(-3deg);
  }
  .ep-state-icon svg { width: 34px; height: 34px; }
  .ep-state h2 { font-family: var(--font-head); font-size: 20px; margin: 0 0 6px; }
  .ep-state p { font-family: var(--font-sans); font-size: 15px; line-height: 1.5; margin: 0 auto; max-width: 36ch; color: var(--muted-foreground); }
  .ep-state .btn { margin-top: 18px; }

  /* Skeleton placeholders shown while loading. */
  .ep-skel { pointer-events: none; }
  .ep-skel .sk {
    background: var(--muted);
    border: 2px solid var(--border);
    animation: epPulse 1.2s ease-in-out infinite;
  }
  .ep-skel .sk-disc { width: 44px; height: 44px; }
  .ep-skel .sk-title { height: 18px; width: 60%; margin-bottom: 8px; }
  .ep-skel .sk-badge { height: 18px; width: 80px; }
  .ep-skel .sk-chip { height: 27px; width: 84px; }
  .ep-skel .sk-audio { height: 36px; width: 100%; margin-top: 14px; }
  .ep-skel .sk-btn { height: 40px; flex: 1 1 calc(50% - 5px); }
  @keyframes epPulse { 50% { opacity: .45; } }
  @media (prefers-reduced-motion: reduce) { .ep-skel .sk { animation: none; } }
body[data-page="episodes"] .page-head.brandmark { background: var(--lime); }
body[data-page="episodes"] .status-pill { background: var(--sky); }
body[data-page="episodes"] .ep-state-icon { background: var(--lime); }
body[data-page="episodes"] .wrap { max-width: 100% !important; padding: 20px 16px 48px !important; }
body[data-page="archive"] .page-head.brandmark { background: var(--orange); }
body[data-page="archive"] .status-pill { background: var(--lime); }
body[data-page="archive"] .ep-state-icon { background: var(--orange); }
body[data-page="archive"] .wrap { max-width: 100% !important; padding: 20px 16px 48px !important; }
@media (min-width: 640px) {
  body[data-page="episodes"] .wrap,
  body[data-page="archive"] .wrap { padding: 32px 20px 64px !important; }
}

body[data-page="calculator"] .wrap {
  max-width: 1180px !important;
  padding: 24px 16px 72px !important;
}
.calculator {
  display: grid;
  gap: 18px;
}
.calc-title {
  display: inline-flex;
  width: fit-content;
  margin: 0;
  padding: 8px 12px;
  font-family: var(--font-head);
  font-size: clamp(30px, 8vw, 64px);
  line-height: .95;
  background: var(--lime);
  color: #000;
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
}
.calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.calc-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--card);
  color: var(--card-foreground);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.calc-panel h2 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 24px;
}
.calc-muted {
  margin: 0;
  color: var(--muted-foreground);
}
.calc-field {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.calc-label {
  font-family: var(--font-head);
  font-size: 18px;
}
.calc-input {
  width: 100%;
  min-width: 0;
  padding: 12px;
  font: 16px/1.3 var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}
.calc-keypad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.calc-key {
  min-height: 44px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--sky);
  box-shadow: var(--shadow-xs);
  font-family: var(--font-head);
  font-size: 16px;
}
.calc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.calc-actions .btn {
  flex: 1 1 132px;
}
.calc-result {
  min-height: 96px;
  padding: 14px;
  overflow-wrap: anywhere;
  background: var(--background);
  border: 2px solid var(--border);
  font: 18px/1.45 var(--font-sans);
}
.calc-graph {
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: auto;
  background: #fff;
  border: 2px solid var(--border);
}
.calc-graph:empty::before {
  content: "Plot output";
  color: #777;
  font-family: var(--font-sans);
}
.calc-graph svg {
  max-width: 100%;
  height: auto;
}
.calc-stack {
  width: fit-content;
  padding: 6px 9px;
  background: var(--orange);
  border: 2px solid var(--border);
  font-family: var(--font-head);
  font-size: 12px;
  text-transform: uppercase;
}
@media (min-width: 840px) {
  .calc-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
}
