    :root {
      --bg: #0b1420;
      --surface: rgba(7, 14, 29, 0.88);
      --surface-2: rgba(12, 22, 44, 0.92);
      --card: linear-gradient(180deg, rgba(11, 20, 40, 0.96) 0%, rgba(4, 9, 19, 0.99) 100%);
      --border: rgba(148, 163, 184, 0.18);
      --border-hi: rgba(41, 200, 204, 0.48);
      --specular: inset 0 1px 0 rgba(255, 255, 255, 0.12);
      --text: #f8fafc;
      --text-soft: #cbd5e1;
      --text-dim: #8b9db8;
      --accent: #29c8cc;
      --emerald: #10b981;
      --amber: #f59e0b;
      --orange: #f97316;
      --red: #ef4444;
      --purple: #a855f7;
      --accent-glow: rgba(41, 200, 204, 0.42);
      --grid-cols: 3;
      --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }
    html, body {
      height: 100%; width: 100%;
      background: var(--bg); color: var(--text);
      font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Display", "Segoe UI", sans-serif;
      overflow: hidden; -webkit-font-smoothing: antialiased;
    }
    button, select, input { font-family: inherit; }

    /* Visible Breathing Ambient Glow Behind Workspace */
    .living-aura {
      position: fixed; inset: -15%; z-index: 0; pointer-events: none;
      background:
        radial-gradient(880px 520px at 18% 15%, rgba(41, 200, 204, 0.18) 0%, transparent 62%),
        radial-gradient(820px 480px at 82% 22%, rgba(16, 185, 129, 0.15) 0%, transparent 60%),
        radial-gradient(920px 560px at 50% 90%, rgba(99, 102, 241, 0.16) 0%, transparent 64%);
      animation: livingBreath 18s ease-in-out infinite alternate;
    }
    @keyframes livingBreath {
      0%   { transform: scale(1) translate3d(0, 0, 0); filter: hue-rotate(0deg) brightness(1); }
      50%  { transform: scale(1.06) translate3d(1.5%, -1.2%, 0); filter: hue-rotate(20deg) brightness(1.12); }
      100% { transform: scale(1.03) translate3d(-1.5%, 1.2%, 0); filter: hue-rotate(-14deg) brightness(1.04); }
    }

    .app { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100vh; width: 100vw; }

    /* =========================================================
       1. UNIFIED HYPERGRID COMMAND HEADER + TRAVELING LASER LINE
       ========================================================= */
    .topbar {
      position: relative;
      min-height: 58px; height: auto; padding: 10px 11px;
      background: linear-gradient(180deg, rgba(10, 19, 40, 0.94) 0%, rgba(4, 9, 20, 0.96) 100%);
      backdrop-filter: blur(20px) saturate(155%);
      border-bottom: 1px solid rgba(41, 200, 204, 0.3);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.72), var(--specular);
      display: flex; align-items: center; justify-content: flex-start;
      gap: 7px; flex-shrink: 0; flex-wrap: wrap; z-index: 60;
    }
    .topbar::after {
      content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
      background: linear-gradient(90deg, transparent 0%, #29c8cc 28%, #10b981 52%, #ef4444 76%, transparent 100%);
      background-size: 200% 100%;
      animation: laserSweep 6.5s linear infinite;
      pointer-events: none;
    }
    @keyframes laserSweep {
      0% { background-position: 100% 0; }
      100% { background-position: -100% 0; }
    }
    body.frameless .topbar { display: none !important; }
    body.frameless.idle-naked { cursor: none !important; }

    /* Floating Exit Bar for Naked Wall (F) — Never Traps the User, Auto-Hides on Idle! */
    .naked-exit-pill {
      position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 950;
      background: rgba(4, 10, 24, 0.92); backdrop-filter: blur(16px);
      border: 1px solid rgba(41, 200, 204, 0.55); border-radius: 999px;
      padding: 6px 14px; display: none; align-items: center; gap: 10px;
      box-shadow: 0 12px 34px rgba(0,0,0,0.85), 0 0 22px -4px rgba(41,200,204,0.45);
      transition: opacity 0.32s ease, transform 0.32s ease;
    }
    body.frameless .naked-exit-pill { display: inline-flex; }
    body.frameless.idle-naked .naked-exit-pill { opacity: 0; pointer-events: none; transform: translate(-50%, -10px); }
    body.frameless.idle-naked .clean-hover-title,
    body.frameless.idle-naked .card-top-actions { opacity: 0 !important; display: none !important; }

    .brand-group { display: flex; align-items: center; gap: 9px; flex: 0 1 auto; min-width: 0; max-width: 100%; }
    .brand-anchor, .brand-titles { min-width: 0; }
    .brand-tag { overflow: hidden; }
    #brandSubTag { overflow: hidden; text-overflow: ellipsis; }
    #launchSmartTvBtn { flex-shrink: 0; }
    .brand-anchor { display: flex; align-items: center; gap: 9px; text-decoration: none; color: #fff; }

    /* Animated Broadcast Monitor + 360° Radar Sweep Logo */
    .hyper-logo-stage {
      width: 42px; height: 42px; flex-shrink: 0;
      filter: drop-shadow(0 0 12px rgba(41, 200, 204, 0.52));
    }
    body.frameless .hyper-logo-stage { width: 30px; height: 30px; }
    .hyper-logo-stage svg { width: 100%; height: 100%; overflow: visible; }
    .hg-radar-beam { transform-origin: 70px 65px; animation: hgSpinCW 3.4s linear infinite; }
    .hg-blip-pulse { animation: blipGlow 1.8s ease-in-out infinite alternate; }
    @keyframes hgSpinCW { to { transform: rotate(360deg); } }
    @keyframes blipGlow { 0% { opacity: 0.35; } 100% { opacity: 1; filter: drop-shadow(0 0 4px #10b981); } }

    .brand-titles { display: flex; flex-direction: column; line-height: 1.05; }
    .brand-name { font-size: 17px; font-weight: 900; letter-spacing: 0.13em; color: #fff; text-shadow: 0 0 18px var(--accent-glow); }
    .brand-accent { background: linear-gradient(90deg, #29c8cc 0%, #5eead4 55%, #38bdf8 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
    .brand-tag { font-family: var(--mono); font-size: 8.2px; font-weight: 800; letter-spacing: 0.055em; color: #6ee7b7; margin-top: 2.5px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
    .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 9px var(--emerald); animation: blipGlow 1.2s infinite alternate; }
    body.frameless .brand-tag, body.frameless .hide-frameless { display: none !important; }

    /* Prominent Animated Smart TV Shuffle Button (Right Where Theme Used To Be!) */
    .smart-tv-cta {
      position: relative; overflow: hidden;
      height: 33px; padding: 0 11px; border-radius: 9px;
      background: linear-gradient(135deg, #059669 0%, #0284c7 52%, #4f46e5 100%);
      border: 1px solid rgba(167, 243, 208, 0.8);
      color: #fff; font-size: 11px; font-weight: 900; letter-spacing: 0.02em;
      cursor: pointer; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
      box-shadow: 0 0 18px -2px rgba(16, 185, 129, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.35);
      animation: tvBtnGlow 2.8s ease-in-out infinite alternate;
      transition: transform 0.14s;
    }
    .smart-tv-cta::after {
      content: ""; position: absolute; top: 0; bottom: 0; width: 45%;
      background: linear-gradient(90deg, transparent, rgba(255,255,255,0.32), transparent);
      transform: skewX(-22deg); animation: ctaSheen 4.2s ease-in-out infinite;
      pointer-events: none;
    }
    @keyframes ctaSheen { 0%, 55% { left: -60%; } 100% { left: 130%; } }
    @keyframes tvBtnGlow {
      0% { box-shadow: 0 0 14px -3px rgba(41, 200, 204, 0.55); }
      100% { box-shadow: 0 0 24px 0px rgba(16, 185, 129, 0.82); }
    }
    .smart-tv-cta:hover { transform: translateY(-1px) scale(1.02); }

    /* Universal Search, ZIP & Near Me */
    .search-command {
      flex: 1 1 345px; min-width: min(320px, 100%); max-width: 460px; height: 34px;
      background: rgba(3, 7, 16, 0.92); border: 1px solid rgba(148, 163, 184, 0.25);
      border-radius: 9px; padding: 0 4px 0 8px;
      display: flex; align-items: center; gap: 4px;
      box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
    }
    .search-command:focus-within { border-color: var(--accent); box-shadow: 0 0 18px -3px var(--accent-glow); }
    .search-command input { flex: 1 1 0; width: 0; background: transparent; border: none; color: #fff; font-size: 12px; outline: none; min-width: 0; }
    .search-command input::placeholder { color: #64748b; }
    .clear-x { background: none; border: none; color: #94a3b8; cursor: pointer; display: none; font-size: 12px; padding: 2px 4px; }
    .search-command.has-val .clear-x { display: block; }
    .rad-select { height: 25px; background: var(--surface-2); border: 1px solid var(--border); color: #e2e8f0; font-size: 10px; font-weight: 700; border-radius: 6px; padding: 0 4px; outline: none; }
    .near-btn {
      height: 26px; padding: 0 8px; border-radius: 6px;
      background: linear-gradient(180deg, rgba(41, 200, 204, 0.24) 0%, rgba(2, 132, 199, 0.28) 100%);
      border: 1px solid var(--border-hi); color: #e0f2fe; font-size: 10.5px; font-weight: 800; cursor: pointer; white-space: nowrap;
    }
    .near-btn:hover { color: #fff; box-shadow: 0 0 14px -2px var(--accent-glow); }

    .search-command > :not(input) { flex-shrink: 0; }
    .deck-actions { display: flex; align-items: center; gap: 5px; flex: 0 1 auto; min-width: 0; max-width: 100%; flex-wrap: wrap; position: relative; }
    .deck-actions > * { flex-shrink: 0; }
    @media (max-width: 1390px) { .deck-actions { flex-basis: 100%; } }
    @media (max-width: 600px) { .search-command { flex-basis: 100%; max-width: none; height: 40px; } .search-command input { font-size: 16px; } .search-command .rad-select, .search-command .near-btn { height: 32px; } }

    /* Animated 3-State Scope Button: US Only -> All Global -> Intl Only */
    .scope-cycle-btn {
      height: 33px; padding: 0 9px; border-radius: 8px;
      background: linear-gradient(135deg, rgba(29, 78, 216, 0.32) 0%, rgba(220, 38, 38, 0.24) 100%);
      border: 1px solid rgba(96, 165, 250, 0.6); color: #fff;
      font-size: 11px; font-weight: 800; cursor: pointer;
      display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
      transition: all 0.2s;
    }
    .scope-cycle-btn[data-scope="all"] {
      background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(14, 165, 233, 0.3) 100%);
      border-color: #10b981; box-shadow: 0 0 16px -3px rgba(16, 185, 129, 0.55);
    }
    .scope-cycle-btn[data-scope="intl"] {
      background: linear-gradient(135deg, rgba(168, 85, 247, 0.32) 0%, rgba(236, 72, 153, 0.26) 100%);
      border-color: #c084fc; box-shadow: 0 0 16px -3px rgba(168, 85, 247, 0.55);
    }
    .scope-ico { display: inline-block; }
    .scope-cycle-btn[data-scope="all"] .scope-ico, .scope-cycle-btn[data-scope="intl"] .scope-ico {
      animation: globeBob 2.4s ease-in-out infinite alternate;
    }
    @keyframes globeBob { 0% { transform: rotate(-12deg) scale(0.96); } 100% { transform: rotate(12deg) scale(1.1); } }

    /* High-contrast split shuffle control, no continuous animation. */
    .rand-group { display:inline-flex; align-items:center; gap:1px; position:relative; border-radius:9px; box-shadow:0 3px 13px #00b8d427; }
    .randomizer-btn { height:33px; padding:0 12px; border-radius:8px 0 0 8px; border:1px solid #8defff; border-right:0; background:linear-gradient(135deg,#a0e4df,#29c8cc); color:#062334; font-size:11px; font-weight:850; letter-spacing:.015em; cursor:pointer; display:inline-flex; align-items:center; gap:7px; white-space:nowrap; transition:background .15s, box-shadow .15s; }
    .randomizer-btn:hover { background:linear-gradient(135deg,#bbfff3,#70e4ff); box-shadow:0 0 16px #29c8cc50; }
    .randomizer-btn.active { box-shadow:inset 0 -3px 0 #087f91; }
    .randomizer-btn:active .shuffle-icon { transform:rotate(-18deg); }
    .shuffle-icon { flex-shrink:0; transition:transform .15s ease; }
    .rand-cfg-btn { height:33px; min-width:34px; padding:0 8px; border:1px solid #3e9bad; border-radius:0 8px 8px 0; background:#10263c; color:#a5f3fc; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; }
    .rand-cfg-btn:hover,.rand-cfg-btn[aria-expanded="true"] { background:#20465b; color:#fff; }
    .randomizer-btn:focus-visible,.rand-cfg-btn:focus-visible { outline:2px solid #fff; outline-offset:3px; }
    @media (prefers-reduced-motion:reduce) { .randomizer-btn,.shuffle-icon { transition:none; } }

    .rand-popover {
      position: absolute; top: 41px; left: 0; width: 300px; z-index: 200;
      background: rgba(6, 13, 28, 0.98); backdrop-filter: blur(18px);
      border: 1px solid var(--border-hi); border-radius: 12px;
      padding: 12px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
      display: none; flex-direction: column; gap: 9px;
    }
    .rand-popover.open { display: flex; }
    .rp-title { font-family: var(--mono); font-size: 10px; font-weight: 800; color: #7dd3fc; display: flex; justify-content: space-between; align-items: center; }
    .rp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
    .rp-chk { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #e2e8f0; cursor: pointer; user-select: none; }
    .rp-chk input { accent-color: #29c8cc; cursor: pointer; }

    .wall-sizer {
      display: inline-flex; align-items: center; gap: 2px;
      background: rgba(3, 7, 16, 0.88); border: 1px solid var(--border);
      border-radius: 8px; padding: 2px;
    }
    .grid-preset {
      height: 26px; min-width: 27px; padding: 0 4px; border-radius: 6px;
      border: 1px solid transparent; background: transparent;
      color: var(--text-dim); font-family: var(--mono); font-size: 10px; font-weight: 800; cursor: pointer;
    }
    .grid-preset.active {
      background: linear-gradient(180deg, rgba(41, 200, 204, 0.25) 0%, rgba(59, 130, 246, 0.22) 100%);
      border-color: var(--border-hi); color: #fff;
    }

    .cmd-btn {
      height: 33px; padding: 0 8.5px; border-radius: 8px;
      background: linear-gradient(180deg, rgba(16, 28, 54, 0.92) 0%, rgba(8, 15, 30, 0.96) 100%);
      border: 1px solid var(--border); color: var(--text-soft);
      font-size: 11px; font-weight: 700; cursor: pointer; text-decoration: none;
      display: inline-flex; align-items: center; gap: 4.5px; white-space: nowrap;
      box-shadow: var(--specular); transition: all 0.14s;
    }
    .cmd-btn:hover { border-color: var(--border-hi); color: #fff; }
    .cmd-btn.active {
      background: linear-gradient(180deg, rgba(41, 200, 204, 0.2) 0%, rgba(12, 26, 52, 0.96) 100%);
      border-color: var(--border-hi); color: #fff; box-shadow: 0 0 14px -4px var(--accent-glow);
    }
    .cmd-btn.live-only-btn.active {
      background: linear-gradient(135deg, rgba(239, 68, 68, 0.26) 0%, rgba(16, 185, 129, 0.22) 100%);
      border-color: rgba(248, 113, 113, 0.65); color: #fff;
    }
    .cmd-badge {
      font-family: var(--mono); font-size: 9px; font-weight: 800; padding: 1px 4.5px;
      border-radius: 999px; background: rgba(239, 68, 68, 0.25); border: 1px solid rgba(239, 68, 68, 0.6); color: #fca5a5;
    }

    /* =========================================================
       2. THREE-ZONE WORKSPACE (LEFT RAIL, STAGE, MINI-MAP + INTEL)
       ========================================================= */
    .workspace { flex: 1; display: flex; min-height: 0; overflow: hidden; }

    .left-rail {
      width: 206px;
      background: linear-gradient(180deg, rgba(6, 12, 26, 0.88) 0%, rgba(3, 7, 16, 0.94) 100%);
      border-right: 1px solid var(--border);
      display: flex; flex-direction: column; flex-shrink: 0;
      overflow-y: auto; padding: 7px 7px 9px; gap: 2px; z-index: 30;
    }
    body.frameless .left-rail { display: none; }

    .rail-heading {
      font-family: var(--mono); font-size: 8.8px; font-weight: 800;
      letter-spacing: 0.11em; color: #64748b; text-transform: uppercase;
      padding: 3px 7px 4px; display: flex; justify-content: space-between; align-items: center;
    }
    .cat-btn {
      position: relative; width: 100%; padding: 6px 8px; border-radius: 8px;
      border: 1px solid transparent; background: transparent;
      color: var(--text-soft); font-size: 11.5px; font-weight: 600;
      cursor: pointer; display: flex; align-items: center; justify-content: space-between;
      gap: 5px; text-align: left; transition: all 0.13s;
    }
    .cat-btn-lbl { display: flex; align-items: center; gap: 7px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .cat-ico { font-size: 13px; width: 17px; text-align: center; flex-shrink: 0; }
    .cat-btn:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
    .cat-btn.active {
      background: linear-gradient(90deg, rgba(41, 200, 204, 0.2) 0%, rgba(16, 185, 129, 0.09) 100%);
      border-color: var(--border-hi); color: #fff; font-weight: 700;
      box-shadow: 0 4px 16px -4px var(--accent-glow), var(--specular);
    }
    .cat-btn.active::before {
      content: ""; position: absolute; left: 0; top: 16%; bottom: 16%;
      width: 3px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 10px var(--accent);
    }
    .cat-cnt { font-family: var(--mono); font-size: 9.5px; color: #64748b; font-weight: 700; }
    .cat-btn.active .cat-cnt { color: var(--accent); }

    /* Polished Left-Rail Graphical Sponsor Card */
    .menu-sponsor-wrap { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
    body:not(.ads-enabled) .sponsor-unit { display: none !important; }
    .sponsor-card-under-menu {
      border-radius: 10px; border: 1px solid rgba(56, 189, 248, 0.34);
      background: linear-gradient(180deg, rgba(11, 20, 38, 0.96) 0%, rgba(5, 9, 19, 0.99) 100%);
      overflow: hidden; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
    }
    .sp-top-bar { padding: 4px 8px; background: rgba(2, 6, 14, 0.82); display: flex; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: 8.2px; color: #94a3b8; }
    .sp-dots { display: flex; gap: 4px; }
    .sp-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(148, 163, 184, 0.35); border: none; cursor: pointer; padding: 0; }
    .sp-dot.active { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
    .sp-art-link { display: block; text-decoration: none; color: inherit; }
    .sp-art-img { width: 100%; height: auto; display: block; border-bottom: 1px solid rgba(148, 163, 184, 0.14); }
    .sp-copy { padding: 7px 8px 8px; }
    .sp-copy-title { font-size: 10.5px; font-weight: 800; color: #fff; line-height: 1.25; }
    .sp-copy-sub { font-size: 9.4px; color: #94a3b8; line-height: 1.3; margin-top: 2.5px; }

    .rail-util-row { display: flex; gap: 4px; }
    .rail-mini-btn {
      flex: 1; height: 24px; border-radius: 6px; border: 1px solid var(--border);
      background: rgba(15, 23, 42, 0.78); color: #94a3b8; font-size: 9.5px; font-weight: 700;
      cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
    }
    .rail-mini-btn:hover { color: #fff; border-color: var(--border-hi); }

    /* CENTER STAGE */
    .center-stage { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; background: rgba(2, 6, 15, 0.45); }

    /* Polished Non-Overlapping Wide Leaderboard Ad */
    .top-leaderboard-ad {
      padding: 5px 12px 4px;
      background: rgba(4, 9, 20, 0.72); border-bottom: 1px solid var(--border);
      display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    }
    body.frameless .top-leaderboard-ad { display: none !important; }
    .top-leaderboard-ad a { display: block; max-width: 790px; width: 100%; }
    .top-leaderboard-ad img { width: 100%; max-height: 62px; object-fit: contain; display: block; border-radius: 9px; filter: drop-shadow(0 6px 16px rgba(0,0,0,0.55)); }

    .context-bar {
      min-height: 40px; padding: 5px 12px;
      background: rgba(7, 13, 28, 0.86); border-bottom: 1px solid var(--border);
      display: flex; align-items: center; justify-content: space-between;
      gap: 7px; flex-wrap: wrap; flex-shrink: 0;
    }
    body.frameless .context-bar { display: none; }
    .ctx-left { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; }
    .ctx-title { font-size: 13.5px; font-weight: 800; color: #fff; white-space: nowrap; }
    .ctx-stats { font-family: var(--mono); font-size: 9.8px; color: #7dd3fc; background: rgba(41, 200, 204, 0.1); border: 1px solid rgba(41, 200, 204, 0.28); padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
    .wx-pill { font-family: var(--mono); font-size: 9.8px; color: #6ee7b7; background: rgba(16, 185, 129, 0.11); border: 1px solid rgba(16, 185, 129, 0.34); padding: 2px 7px; border-radius: 6px; white-space: nowrap; cursor: help; }
    .smart-note-pill { font-size: 10px; font-weight: 700; color: #fde68a; background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.42); padding: 2px 7px; border-radius: 6px; }

    .ctx-right { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
    .slim-select { height: 26px; background: rgba(12, 20, 38, 0.95); border: 1px solid var(--border); color: #e2e8f0; font-size: 10.5px; font-weight: 600; padding: 0 6px; border-radius: 6px; outline: none; max-width: 165px; }
    .pager-box { display: inline-flex; align-items: center; gap: 2px; background: rgba(3, 7, 16, 0.85); border: 1px solid var(--border); border-radius: 7px; padding: 2px 4px; height: 26px; }
    .pg-btn { background: transparent; border: none; color: #cbd5e1; cursor: pointer; font-size: 10.5px; font-weight: 700; padding: 2px 4px; }
    .pg-in { width: 32px; background: transparent; border: none; color: var(--accent); font-family: var(--mono); font-size: 10px; font-weight: 800; text-align: center; outline: none; }
    .pg-tot { font-family: var(--mono); font-size: 9.5px; color: #64748b; }

    .subchips-bar { padding: 4px 12px; background: rgba(4, 8, 18, 0.82); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; overflow-x: auto; flex-shrink: 0; }
    .subchips-bar:empty, body.frameless .subchips-bar { display: none; }
    .sub-chip { height: 24px; padding: 0 9px; border-radius: 999px; background: rgba(15, 25, 48, 0.88); border: 1px solid var(--border); color: #cbd5e1; font-size: 10.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
    .sub-chip:hover { border-color: var(--accent); color: #fff; }
    .sub-chip.active { background: linear-gradient(90deg, rgba(41, 200, 204, 0.24) 0%, rgba(59, 130, 246, 0.2) 100%); border-color: var(--accent); color: #fff; font-weight: 700; }

    /* =========================================================
       VIDEO MATRIX + CLEAN FEED-ONLY VIEW + BALANCED 16:9 CROP
       ========================================================= */
    .grid-scroll { flex: 1; overflow-y: auto; padding: 9px; scroll-behavior: smooth; }
    .video-grid { display: grid; grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr)); gap: 9px; align-content: start; }
    body.clean-tiles .video-grid, body.frameless .video-grid { gap: 5px; }

    .feed-card {
      background: var(--card); border: 1px solid rgba(148, 163, 184, 0.22);
      border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; cursor: pointer;
      box-shadow: 0 10px 26px -10px rgba(0, 0, 0, 0.88), var(--specular);
      transition: border-color 0.18s, box-shadow 0.18s; user-select: none;
    }
    .feed-card[data-status="live"] { border-color: rgba(41, 200, 204, 0.34); }
    .feed-card:hover { border-color: var(--accent); box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.95), 0 0 22px -4px var(--accent-glow); }
    .feed-card.audio-active { border-color: var(--emerald) !important; box-shadow: 0 0 24px -2px rgba(16, 185, 129, 0.6) !important; }
    .feed-card.pinned { border-color: rgba(250, 204, 21, 0.78); }

    .feed-viewport { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0b1420; overflow: hidden; }
    .feed-media { position: absolute; inset: 0; width: 100%; height: 100%; }
    .feed-video, .feed-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: none; }
    /* Consistent balanced 16:9 framing matching TV Mode */
    .feed-iframe {
      position: absolute; inset: 0; width: 100%; height: 100%;
      transform: none;
      border: none; pointer-events: auto; z-index: 2;
    }
    .feed-embed-direct {
      position: absolute; inset: 0; width: 100%; height: 100%;
      border: none; z-index: 2; background: #02050d;
    }
    .feed-card.locked-slot {
      border-color: #facc15 !important;
      box-shadow: 0 0 20px -4px rgba(250, 204, 21, 0.55) !important;
    }
    .mini-act-btn.lock-btn.locked {
      background: rgba(250, 204, 21, 0.25); border-color: #facc15; color: #fef08a;
    }

    /* Event-Driven Signal Curtain: Stays opaque until real live frames play (Zero Daytime Thumbnail Flash!) */
    .signal-curtain {
      position: absolute; inset: 0; z-index: 4;
      background: radial-gradient(circle at 50% 45%, #0c1a38 0%, #02050d 100%);
      display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
      pointer-events: none; opacity: 1; transition: opacity 0.32s ease;
    }
    .feed-card[data-revealed="1"] .signal-curtain { opacity: 0; }
    .curtain-lbl { font-family: var(--mono); font-size: 9px; font-weight: 800; letter-spacing: 0.09em; color: #7dd3fc; }

    /* Clean-Tiles Hover Whisper Overlay (Only shown when Clean View hides bottom bars) */
    .clean-hover-title {
      position: absolute; left: 8px; bottom: 8px; z-index: 6;
      padding: 4px 8px; border-radius: 6px; background: rgba(3, 8, 20, 0.84);
      border: 1px solid rgba(41, 200, 204, 0.36); font-size: 11px; font-weight: 700; color: #fff;
      display: none; max-width: calc(100% - 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
      pointer-events: none;
    }
    body.clean-tiles .feed-card:hover .clean-hover-title,
    body.frameless .feed-card:hover .clean-hover-title { display: block; }
    body.clean-tiles .feed-bar, body.frameless .feed-bar { display: none !important; }

    .card-top-actions { position: absolute; top: 6px; right: 6px; z-index: 6; display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
    .feed-card:hover .card-top-actions, .feed-card.pinned .card-top-actions { opacity: 1; }
    .mini-act-btn { height: 23px; min-width: 23px; padding: 0 6px; border-radius: 6px; background: rgba(4, 9, 20, 0.88); border: 1px solid rgba(255, 255, 255, 0.25); color: #f1f5f9; font-size: 10.5px; font-weight: 700; cursor: pointer; }
    .mini-act-btn:hover { border-color: var(--accent); color: #fff; }
    .feed-card.pinned .pin-btn { color: #facc15; border-color: rgba(250, 204, 21, 0.7); }

    .feed-bar {
      padding: 5.5px 8px;
      background: linear-gradient(180deg, rgba(11, 20, 40, 0.98) 0%, rgba(4, 9, 19, 1) 100%);
      border-top: 1px solid rgba(148, 163, 184, 0.15);
      display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 40px;
    }
    .src-emblem { width: 25px; height: 25px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
    .src-emblem svg { width: 25px; height: 25px; display: block; }
    .feed-text { flex: 1; min-width: 0; }
    .feed-title { font-size: 11.2px; font-weight: 700; color: #f8fafc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .feed-sub { font-size: 9.5px; color: var(--text-dim); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .feed-badges { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

    .tile-audio-btn {
      height: 21px; padding: 0 6px; border-radius: 5px;
      border: 1px solid rgba(56, 189, 248, 0.36); background: rgba(15, 28, 52, 0.9);
      color: #bae6fd; font-family: var(--mono); font-size: 8.8px; font-weight: 800; cursor: pointer; white-space: nowrap;
    }
    .feed-card.audio-active .tile-audio-btn { background: linear-gradient(90deg, #10b981 0%, #29c8cc 100%); border-color: #fff; color: #020617; }

    .cadence-pill { font-family: var(--mono); font-size: 8.6px; font-weight: 800; padding: 2.5px 5.5px; border-radius: 5px; display: inline-flex; align-items: center; gap: 4px; border: 1px solid rgba(148, 163, 184, 0.25); background: rgba(15, 23, 42, 0.85); color: #cbd5e1; white-space: nowrap; }
    .cad-dot { width: 5.5px; height: 5.5px; border-radius: 50%; background: #64748b; }
    .cadence-pill.cad-live_video { background: rgba(16, 185, 129, 0.14); border-color: rgba(16, 185, 129, 0.52); color: #6ee7b7; }
    .feed-card[data-status="live"] .cadence-pill.cad-live_video .cad-dot { background: #10b981; box-shadow: 0 0 8px #10b981; }
    .cadence-pill.cad-snap { background: rgba(245, 158, 11, 0.13); border-color: rgba(245, 158, 11, 0.45); color: #fcd34d; }
    .cadence-pill.cad-snap .cad-dot { background: #f59e0b; }

    .scroll-more-sentinel { grid-column: 1 / -1; padding: 12px; text-align: center; font-family: var(--mono); font-size: 10.5px; color: #7dd3fc; }

    /* =========================================================
       ORGANIZED LOCATION-SYNCED NATIONAL RF & SCANNER TUNER
       ========================================================= */
    .scanner-console {
      padding: 6px 12px;
      background: linear-gradient(180deg, rgba(10, 20, 42, 0.96) 0%, rgba(4, 8, 18, 0.99) 100%);
      border-top: 1px solid rgba(41, 200, 204, 0.36);
      display: flex; flex-direction: column; gap: 5px; flex-shrink: 0; z-index: 40;
    }
    .scanner-console.hidden, body.frameless .scanner-console { display: none; }
    .sc-row { display: flex; align-items: center; justify-content: space-between; gap: 7px; flex-wrap: wrap; }
    .sc-left, .sc-cats, .sc-right { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

    .sc-play-btn {
      height: 30px; padding: 0 11px; border-radius: 7px;
      background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(41, 200, 204, 0.25) 100%);
      border: 1px solid rgba(252, 165, 165, 0.65); color: #fff;
      font-family: var(--mono); font-size: 10.5px; font-weight: 900;
      cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
    }
    .sc-play-btn.playing { background: linear-gradient(135deg, #10b981 0%, #29c8cc 100%); border-color: #fff; color: #020617; box-shadow: 0 0 18px rgba(16, 185, 129, 0.65); }
    .eq-bars { display: none; align-items: flex-end; gap: 2px; height: 11px; }
    .sc-play-btn.playing .eq-bars { display: inline-flex; }
    .eq-bars i { width: 2.5px; height: 11px; background: #020617; border-radius: 1px; transform-origin: bottom; animation: eqPulse 0.5s ease-in-out infinite alternate; }
    .eq-bars i:nth-child(2) { animation-duration: 0.35s; }
    .eq-bars i:nth-child(3) { animation-duration: 0.65s; }
    @keyframes eqPulse { 0% { transform: scaleY(0.25); } 100% { transform: scaleY(1); } }

    .sc-loc-pill { font-family: var(--mono); font-size: 9.5px; color: #6ee7b7; background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.35); padding: 3px 7px; border-radius: 6px; white-space: nowrap; }
    .sc-cat-btn { height: 25px; padding: 0 8px; border-radius: 6px; background: rgba(15, 26, 48, 0.88); border: 1px solid var(--border); color: #cbd5e1; font-size: 10px; font-weight: 700; cursor: pointer; white-space: nowrap; }
    .sc-cat-btn:disabled { opacity: .45; cursor: not-allowed; }
    .sc-cat-btn.active, .sc-cat-btn:hover { border-color: var(--accent); color: #fff; background: rgba(41, 200, 204, 0.18); }

    .sc-search { height: 27px; width: 155px; background: rgba(3, 7, 16, 0.95); border: 1px solid var(--border); border-radius: 6px; color: #fff; font-size: 10.5px; padding: 0 7px; outline: none; }
    .sc-search:focus { border-color: var(--accent); }
    .sc-state-sel { height: 27px; background: rgba(3, 7, 16, 0.95); border: 1px solid var(--border); border-radius: 6px; color: #e2e8f0; font-size: 10.5px; font-weight: 700; padding: 0 5px; outline: none; }
    .sc-select { height: 27px; min-width: 240px; max-width: 360px; background: rgba(3, 7, 16, 0.95); border: 1px solid var(--border); color: #f1f5f9; font-size: 11px; font-weight: 600; padding: 0 7px; border-radius: 6px; outline: none; }
    .sc-sdr-launch { height: 27px; padding: 0 9px; border-radius: 6px; background: rgba(168, 85, 247, 0.25); border: 1px solid #c084fc; color: #f3e8ff; font-size: 10.5px; font-weight: 800; text-decoration: none; display: none; align-items: center; gap: 4px; white-space: nowrap; }
    .sc-sdr-launch.show { display: inline-flex; }
    .sc-status { font-family: var(--mono); font-size: 10px; color: #7dd3fc; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* =========================================================
       3. RIGHT RAIL: DOCKED TOGGLEABLE MINI-MAP + CHRONOLOGICAL INTEL
       ========================================================= */
    .right-rail {
      width: 348px;
      background: linear-gradient(180deg, rgba(7, 13, 28, 0.94) 0%, rgba(3, 7, 16, 0.98) 100%);
      border-left: 1px solid var(--border);
      display: flex; flex-direction: column; flex-shrink: 0; min-height: 0; z-index: 30;
    }
    .right-rail.all-hidden, body.frameless .right-rail { display: none; }

    /* Always-Available Toggleable Docked Mini-Map */
    .minimap-dock {
      height: 242px; flex-shrink: 0;
      border-bottom: 1px solid rgba(41, 200, 204, 0.3);
      display: flex; flex-direction: column; background: #0b1420;
    }
    .minimap-dock.hidden { display: none; }
    .mm-bar {
      padding: 5px 9px; background: rgba(10, 20, 42, 0.95); border-bottom: 1px solid var(--border);
      display: flex; align-items: center; justify-content: space-between; gap: 5px;
    }
    .mm-title { font-family: var(--mono); font-size: 9.5px; font-weight: 900; color: #7dd3fc; display: inline-block; white-space: nowrap; }
    .mm-bar { flex-wrap: wrap; }
    .mm-pills { flex-shrink: 0; }
    .mm-pills { display: flex; gap: 4px; }
    .mm-pill { padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border); background: rgba(15, 25, 48, 0.9); color: #cbd5e1; font-size: 9.5px; font-weight: 700; cursor: pointer; }
    .mm-pill.active, .mm-pill:hover { border-color: var(--accent); color: #fff; background: rgba(41, 200, 204, 0.2); }
    #miniRadarMap { flex: 1; width: 100%; background: #02050d; }

    /* Chronological (<24h) Live Intel Feed */
    .intel-section { flex: 1; display: flex; flex-direction: column; min-height: 0; }
    .intel-section.hidden { display: none; }
    .intel-header { padding: 7px 10px 6px; background: rgba(11, 20, 42, 0.92); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
    .intel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
    .intel-heading { font-family: var(--mono); font-size: 10.2px; font-weight: 900; letter-spacing: 0.06em; color: #fff; display: flex; align-items: center; gap: 6px; }
    .pulse-red { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); animation: blipGlow 1.1s infinite alternate; }
    .intel-scope-sel { height: 22px; background: rgba(4, 9, 20, 0.92); border: 1px solid var(--border-hi); border-radius: 5px; color: #7dd3fc; font-size: 9.5px; font-weight: 700; padding: 0 5px; outline: none; }

    .intel-filters { display: flex; gap: 4px; flex-wrap: wrap; }
    .intel-fbtn { padding: 2px 6.5px; border-radius: 5px; border: 1px solid var(--border); background: rgba(4, 9, 18, 0.85); color: #94a3b8; font-size: 9.5px; font-weight: 700; cursor: pointer; }
    .intel-fbtn.active, .intel-fbtn:hover { background: rgba(41, 200, 204, 0.18); border-color: var(--accent); color: #fff; }

    .intel-list { flex: 1; overflow-y: auto; padding: 7px 8px; display: flex; flex-direction: column; gap: 6px; }
    .intel-card { border-radius: 8px; padding: 7px 9px; border: 1px solid var(--border); border-left-width: 3.5px; background: rgba(9, 16, 32, 0.92); font-size: 10.8px; line-height: 1.34; }
    .intel-card.sev-critical { border-left-color: #ef4444; border-color: rgba(239, 68, 68, 0.42); background: linear-gradient(90deg, rgba(239, 68, 68, 0.15) 0%, rgba(9, 16, 32, 0.94) 80%); }
    .intel-card.sev-severe { border-left-color: #f97316; border-color: rgba(249, 115, 22, 0.36); background: linear-gradient(90deg, rgba(249, 115, 22, 0.12) 0%, rgba(9, 16, 32, 0.94) 80%); }
    .intel-card.sev-advisory { border-left-color: #f59e0b; border-color: rgba(245, 158, 11, 0.28); }
    .intel-card.sev-info { border-left-color: #10b981; border-color: rgba(16, 185, 129, 0.34); }
    .ic-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 3px; }
    .ic-badge { font-family: var(--mono); font-size: 8.6px; font-weight: 800; padding: 1px 5px; border-radius: 4px; background: rgba(255,255,255,0.08); color: #e2e8f0; }
    .ic-time { font-family: var(--mono); font-size: 8.8px; color: #6ee7b7; font-weight: 700; }
    .ic-title { font-weight: 800; color: #f8fafc; font-size: 11px; }
    .ic-desc { color: #94a3b8; font-size: 10px; margin-top: 2px; }
    .ic-actions { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
    .ic-jump { padding: 2.5px 7px; border-radius: 5px; border: 1px solid rgba(56, 189, 248, 0.38); background: rgba(15, 28, 52, 0.9); color: #7dd3fc; font-size: 9.8px; font-weight: 700; cursor: pointer; text-decoration: none; }
    .ic-jump:hover { border-color: var(--accent); color: #fff; background: rgba(41, 200, 204, 0.22); }

    /* =========================================================
       4. LAG-FREE CANVAS FULL-PAGE MAP + TOWN ZOOM + PLANE ATC
       ========================================================= */
    .fullpage-map-overlay { position: fixed; inset: 0; z-index: 1000; background: #02050d; display: none; flex-direction: column; }
    .fullpage-map-overlay.open { display: flex; }
    .fpm-bar { min-height: 52px; padding: 7px 14px; background: rgba(8, 16, 36, 0.97); border-bottom: 1px solid rgba(41, 200, 204, 0.36); display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; z-index: 20; }
    .fpm-layers { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
    .fpm-toggle { height: 29px; padding: 0 10px; border-radius: 7px; background: rgba(15, 25, 48, 0.9); border: 1px solid var(--border); color: #94a3b8; font-size: 10.5px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
    .fpm-toggle.active { background: rgba(16, 185, 129, 0.2); border-color: #10b981; color: #ecfdf5; }
    .fpm-toggle.mil-btn.active { background: rgba(245, 158, 11, 0.24); border-color: #fbbf24; color: #fef3c7; }

    .fpm-stage { flex: 1; position: relative; min-height: 0; }
    #hypergridMap { width: 100%; height: 100%; background: #02050d; }
    .fpm-sectors { position: absolute; top: 12px; left: 52px; z-index: 600; display: flex; gap: 5px; flex-wrap: wrap; background: rgba(5, 11, 24, 0.9); border: 1px solid var(--border-hi); border-radius: 9px; padding: 5px 8px; }
    .fpm-legend { position: absolute; bottom: 14px; left: 14px; z-index: 600; background: rgba(5, 11, 24, 0.92); border: 1px solid var(--border-hi); border-radius: 9px; padding: 7px 12px; font-family: var(--mono); font-size: 10px; color: #cbd5e1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

    .leaflet-tooltip.hg-tip { background: rgba(6, 13, 28, 0.96); border: 1px solid rgba(41, 200, 204, 0.55); border-radius: 8px; color: #f8fafc; padding: 6px 9px; font-size: 11px; box-shadow: 0 10px 26px rgba(0,0,0,0.85); }
    .leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #08132a; color: #f8fafc; border: 1px solid var(--border-hi); }
    .hud-cluster { display: flex; align-items: center; justify-content: center; border-radius: 999px; background: rgba(8, 18, 38, 0.92); border: 1.6px solid var(--accent); color: #fff; font-family: var(--mono); font-size: 10px; font-weight: 800; }

    /* =========================================================
       5. SPOTLIGHT & REDESIGNED INTERACTIVE HOW-IT-WORKS GUIDE
       ========================================================= */
    .modal-backdrop { position: fixed; inset: 0; z-index: 1050; background: rgba(2, 5, 12, 0.88); backdrop-filter: blur(14px); display: none; align-items: center; justify-content: center; padding: 16px; }
    .modal-backdrop.open { display: flex; }
    .spot-box { width: min(1020px, 96vw); max-height: 92vh; background: linear-gradient(180deg, #0a1428 0%, #040812 100%); border: 1px solid var(--border-hi); border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,0.92); display: flex; flex-direction: column; overflow: hidden; }
    .spot-top, .spot-bot { padding: 10px 15px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
    .spot-top { border-bottom: 1px solid var(--border); }
    .spot-bot { border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-dim); }
    .spot-stage { background: #000; aspect-ratio: 16 / 9; max-height: calc(92vh - 130px); width: 100%; position: relative; display: flex; align-items: center; justify-content: center; }
    .spot-play-status:not(:empty) { position:absolute; top:12px; left:12px; right:12px; padding:8px; background:#101827e6; color:#fff; text-align:center; pointer-events:none; }
    .spot-stage video, .spot-stage img, .spot-stage iframe { width: 100%; height: 100%; object-fit: contain; border: none; }

    .guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(275px, 100%), 1fr)); gap: 13px; padding: 16px; overflow-y: auto; }
    .guide-card { background: rgba(9, 18, 38, 0.94); border: 1px solid rgba(56, 189, 248, 0.25); border-radius: 11px; padding: 13px; display: flex; flex-direction: column; gap: 8px; }
    .guide-card h3 { font-size: 13px; color: #7dd3fc; display: flex; align-items: center; gap: 6px; }
    .guide-card p { font-size: 13px; color: #cbd5e1; line-height: 1.45; flex: 1; }
    .guide-try-btn { align-self: flex-start; padding: 5px 11px; border-radius: 7px; border: 1px solid rgba(41, 200, 204, 0.55); background: rgba(41, 200, 204, 0.16); color: #fff; font-size: 11px; font-weight: 800; cursor: pointer; }
    .guide-try-btn:hover { background: var(--accent); color: #020617; }

    @media (max-width: 1220px) { .right-rail { width: 295px; } .left-rail { width: 184px; } }
    @media (max-width: 960px) {
      .workspace { flex-direction: column; }
      .left-rail { width: 100%; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 5px 8px; }
      .rail-heading, .menu-sponsor-wrap, .right-rail { display: none; }
      .cat-btn { width: auto; white-space: nowrap; }
    }
    html:has(body.phone-mode), body.phone-mode { overflow-x: hidden; overflow-y: auto; height: auto; }
    body.phone-mode .app { height: auto; min-height: 100dvh; }
    body.phone-mode .topbar { height: auto; flex-wrap: wrap; padding: 8px; gap: 7px; }
    body.phone-mode .deck-actions { width: 100%; flex-wrap: wrap; }
    body.phone-mode .sc-row, body.phone-mode .sc-left, body.phone-mode .sc-right, body.phone-mode .sc-cats { flex-wrap: wrap; min-width: 0; width: 100%; }
    body.phone-mode .living-aura { animation: none; }
    body.phone-mode .workspace { overflow: visible; min-height: 0; flex-direction: column; }
    body.phone-mode .left-rail { flex-shrink: 0; }
    body.phone-mode .center-stage { min-height: 0; }
    body.phone-mode .grid-scroll { flex: none; overflow: visible; min-height: 200px; }
    body.phone-mode .video-grid { grid-template-columns: 1fr; }
    body.phone-mode .scanner-console { flex-shrink: 0; }
    body.phone-mode .sc-select { min-width: 0; max-width: 100%; width: 100%; }
    body.phone-mode .sc-status { white-space: normal; max-width: 100%; }
    body.phone-mode .ctx-title { white-space: normal; }
    body.phone-mode .top-leaderboard-ad { display: none; }
    body.phone-mode .right-rail:not(.all-hidden) { display:flex; width:100%; min-width:0; }
    body.phone-mode .grid-preset:disabled { display: none; }
    body.phone-mode .card-top-actions { opacity: 1; }
    body.phone-mode .feed-iframe { pointer-events:auto; transform:none; }
    .curtain-lbl { text-align:center; padding:0 12px; }
    .feed-card:not([data-status="live"]) .cadence-pill.cad-live_video { background: rgba(15,23,42,.85); border-color: var(--border); color: #cbd5e1; }
    .feed-card[data-status="failed"] .cadence-pill { color: #fca5a5; border-color: rgba(239,68,68,.5); }
    @media (max-width: 960px) {
      html:has(body.compact-layout), body.compact-layout { overflow-x: hidden; overflow-y: auto; height: auto; }
      body.compact-layout .app { height: auto; min-height: 100dvh; }
      body.compact-layout .workspace { overflow: visible; }
      body.compact-layout .right-rail:not(.all-hidden) { display: flex; width: 100%; min-width: 0; }
      body.compact-layout .grid-scroll { flex: none; overflow: visible; }
      body.compact-layout .left-rail { flex-shrink: 0; }
    }
    @media (max-width: 600px) {
      .brand-group { width: 100%; justify-content: space-between; }
      .brand-name { font-size: 15px; letter-spacing: .08em; }
      .brand-tag { font-size: 8px; }
      .deck-actions, .rand-group { position: static; }
      .rand-popover { top: 100%; left: 8px; width: min(300px, calc(100% - 16px)); max-height: 55dvh; overflow-y: auto; }
    }
    [hidden] { display:none !important; }

/* Empty results: actionable recovery, not instructions to find hidden controls. */
.hg-empty-state{grid-column:1/-1;align-self:start;display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center;padding:clamp(18px,4vw,48px);border:1px dashed #36516b;border-radius:14px;background:linear-gradient(145deg,#0e1d31,#07111f);color:#b5c7d9;min-width:0;overflow-wrap:anywhere}
.hg-empty-state h2{font-size:clamp(19px,2vw,25px);color:#e5f5ff;margin:0}.hg-empty-state p{font-size:14px;max-width:520px;margin:0;line-height:1.5}.hg-empty-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:9px}.hg-empty-actions button{font:600 13px system-ui;padding:11px 16px;min-height:44px;border:1px solid #43637b;background:#13263b;color:#d6eafa;border-radius:9px;cursor:pointer;max-width:100%}.hg-empty-actions .hg-empty-primary{background:#8ce3e5;color:#062334;border-color:#8ce3e5}.hg-empty-actions button:focus-visible,.reset-view-button:focus-visible{outline:2px solid #8ce3e5;outline-offset:3px}.reset-view-button{border-color:#3996a8;color:#a5f3fc}.hg-empty-state a{color:#8ce3e5}

.hg-local-preview{color:#fde68a;font:600 11px system-ui;padding:6px 9px;border:1px solid #a16207;border-radius:6px;white-space:normal;max-width:100%;text-decoration:none}

.rail-count-note{font-size:10px;color:#8fa6bb;padding:0 10px 5px;letter-spacing:.02em;}

/* R77: slightly smoother reveal for deck status curtains. */
.signal-curtain{transition:opacity .28s ease, transform .28s ease; transform:scale(1);}
.feed-card[data-revealed="1"] .signal-curtain{transform:scale(.985);}

.feed-sub{color:#d1e2ef;font-size:10.5px}

/* R156 public radio discovery */
.sc-heading{font-size:14px;color:#e7f5fa}.sc-discovery{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.sc-discovery a{color:#9ce4ea;font-size:12px;text-decoration:underline}.sc-help{color:#c2d1df;font-size:12px;margin:0;line-height:1.4}.sc-status{white-space:normal;overflow:visible;max-width:none;line-height:1.4}.sc-loc-pill{white-space:normal;overflow-wrap:anywhere}.sc-select{min-width:0;max-width:100%}.camera-radio{font-size:11px}.feed-card:focus-within .card-top-actions{opacity:1}
body.phone-mode .scanner-console{padding:10px;max-width:100%;max-height:55vh;overflow:auto;box-sizing:border-box}body.phone-mode .sc-right{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}body.phone-mode .sc-right :is(input,select){width:100%;max-width:100%;min-height:44px;font-size:16px;box-sizing:border-box}body.phone-mode .sc-cats{display:flex;flex-wrap:wrap}body.phone-mode .sc-cat-btn{min-height:44px;height:auto;white-space:normal;font-size:12px}body.phone-mode .sc-discovery a{display:flex;align-items:center;min-height:44px}body.phone-mode .sc-play-btn{min-height:44px}body.phone-mode:not(.frameless):not(.clean-tiles) .feed-card .camera-radio{display:none;order:4}body.phone-mode:not(.frameless):not(.clean-tiles) .feed-card.camera-tools-expanded .camera-radio{display:block}

/* R157: radio player and progressive discovery */
#scannerConsole{padding:12px;gap:10px;max-height:46vh;overflow:auto;min-width:0;overscroll-behavior:contain;box-sizing:border-box;background:#101e2c;color:#e5eff6}
#scannerConsole .rf-head{display:flex;align-items:center;justify-content:space-between;gap:12px}#scannerConsole .rf-head>div{display:grid;gap:4px;min-width:0}#scannerConsole .sc-heading{font-size:16px}#scannerConsole .sc-loc-pill{font-size:12px;background:none;border:0;padding:0;color:#b6d7e2;font-family:inherit}
#scannerConsole .rf-player{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(110px,160px);align-items:end;gap:10px}#scannerConsole label{display:block;font-size:12px;color:#c6d9e5;margin-bottom:4px}#scannerConsole .sc-select,#scannerConsole .sc-search,#scannerConsole .sc-state-sel{width:100%;min-width:0;max-width:none;min-height:44px;height:auto;font:inherit;font-size:14px;box-sizing:border-box}#scannerConsole .sc-play-btn{height:44px;justify-content:center;background:#78d9dc;border-color:#78d9dc;color:#082331;font-family:inherit;font-size:14px}#scannerConsole .sc-play-btn:disabled{opacity:.5;cursor:not-allowed}#scannerConsole .rf-volume{display:grid;grid-template-columns:1fr auto;align-items:center;gap:3px 6px}#scannerConsole .rf-volume label{grid-column:1/-1}#scannerConsole input[type=range]{width:100%;min-width:0;height:30px;accent-color:#78d9dc}#scannerConsole output{font-size:12px}#scannerConsole .sc-status{font:inherit;font-size:13px;color:#b6e8f1}#scannerConsole .rf-panel{border:1px solid #385566;border-radius:8px;padding:0 10px}#scannerConsole summary{padding:12px 0;cursor:pointer;font-weight:600;font-size:14px}#scannerConsole summary span{font-size:11px;color:#bfd1dc;font-weight:400;margin-left:6px}#scannerConsole .rf-panel[open]{padding-bottom:10px}#scannerConsole .rf-filter-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr) auto auto;gap:8px;align-items:end;margin:8px 0}#scannerConsole .rf-filter-row label{margin:0}#scannerConsole .sc-cat-btn,#scannerConsole .cmd-btn{min-height:44px;height:auto;white-space:normal;font-size:13px}#scannerConsole [hidden]{display:none!important}#scannerConsole .sc-discovery{gap:8px}#scannerConsole .sc-discovery a{display:inline-flex;align-items:center;padding:8px;border:1px solid #385566;border-radius:6px;min-height:44px;box-sizing:border-box}#scannerConsole :focus-visible{outline:2px solid #f4ce80;outline-offset:2px}
@media(max-width:700px){#scannerConsole{max-height:55vh;max-height:55dvh}#scannerConsole .rf-player{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}#scannerConsole .rf-station{grid-column:1/-1}#scannerConsole .rf-filter-row{grid-template-columns:1fr 1fr}#scannerConsole .sc-select,#scannerConsole .sc-search,#scannerConsole .sc-state-sel{font-size:16px}#scannerConsole .rf-volume{align-self:center}#scannerConsole .sc-discovery a{flex:1 1 140px}}

/* R161 local listening pilot */
.rf-pilot-extra{margin:12px 0;border-top:1px solid #365061;padding-top:10px}.rf-pilot-extra h3{font-size:14px;margin:0 0 8px;color:#e7f5fa}.rf-test-actions{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}.rf-test-actions button{min-height:44px;white-space:normal}.rf-test-actions button:disabled{opacity:.55;cursor:default}

#scannerConsole .world-radio-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0}#scannerConsole .world-radio-form input{display:block;width:100%;min-width:0;box-sizing:border-box;padding:9px;background:#0c1927;color:#e5f1f7;border:1px solid #527082;border-radius:8px;font-size:16px}#scannerConsole .world-radio-form button{grid-column:1/-1;min-height:44px}#scannerConsole .world-radio-results{display:grid;gap:8px;max-height:340px;overflow:auto;overscroll-behavior:contain;margin:8px 0}#scannerConsole .world-radio-card{display:grid;gap:5px;padding:10px;border:1px solid #527082;border-radius:8px;overflow-wrap:anywhere}#scannerConsole .world-radio-card small{color:#b9cdd9}#scannerConsole #worldRadio a{color:#9ee5e8;text-decoration:underline}#scannerConsole .world-radio-card a{min-height:44px;display:flex;align-items:center}@media(max-width:440px){#scannerConsole .world-radio-form{grid-template-columns:minmax(0,1fr)}}

/* R165: map-first responsive overlay */
.fullpage-map-overlay{padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);box-sizing:border-box}
.fpm-bar{display:flex;flex-direction:column;align-items:stretch;flex:0 1 auto;min-height:0;max-height:48%;overflow-y:auto;overscroll-behavior:contain;padding:8px 12px;gap:8px}
.map-title,.map-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}.map-title strong{font-size:16px}.map-actions button{flex:1}.fpm-bar button{min-height:44px;height:auto;white-space:normal}.fpm-bar summary,.fpm-legend summary{cursor:pointer;padding:9px;min-height:24px;color:#e2e8f0;font-weight:700}.fpm-bar details{border:1px solid #34475d;border-radius:8px}.fpm-layers{padding:6px}.fpm-sectors{position:static;padding:6px;border:0;background:none;gap:6px}.fpm-sectors button{font-size:12px}.fpm-stage{min-height:0}.fpm-legend{display:block;bottom:24px;left:8px;max-width:calc(100% - 16px);box-sizing:border-box;max-height:50%;overflow:auto;padding:2px 8px}.fpm-legend div{display:grid;gap:6px;padding:4px}.map-disclosure,#mapTelemetryStatus,#mapSearchStatus{color:#cbd5e1;font-size:12px;padding:4px 9px;overflow-wrap:anywhere}#mapZipForm{display:flex;align-items:center;gap:6px;padding:6px;flex-wrap:wrap}#mapZip{min-width:0;flex:1;max-width:160px;font-size:16px;min-height:44px;background:#101e2c;color:#fff;border:1px solid #60758a;border-radius:6px;padding:6px}.leaflet-popup-content{max-width:calc(100vw - 90px);overflow-wrap:anywhere}.leaflet-popup-content a{color:#91dce9}.leaflet-popup-content button{min-height:40px}.hud-cluster{box-shadow:0 0 0 2px #0b1828}.fpm-bar .fpm-toggle:focus-visible,.fpm-bar summary:focus-visible,.fpm-legend summary:focus-visible{outline:2px solid #8ce3e5;outline-offset:2px}
@media(max-height:480px){.fpm-bar{max-height:48%;padding:4px 8px;gap:3px}.fpm-bar button{min-height:36px}.map-title strong{font-size:14px}.fpm-bar summary{padding:4px}}

.earth-space-panel{margin:8px 0;padding:10px;border:1px solid #456477;border-radius:10px;color:#dceaf3;background:#122433}.earth-space-panel summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-weight:700}.earth-space-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:8px}.earth-space-grid section{min-width:0;padding:10px;border:1px solid #456477;border-radius:8px}.earth-space-grid h3{margin:0 0 6px;font-size:1rem}.earth-space-grid p{white-space:pre-line;overflow-wrap:anywhere}.earth-space-grid a{color:#8ce3e5;text-decoration:underline}.earth-space-panel button{margin-bottom:8px}
