    /* ---- platform preview switch ----
       Deliberately NOT styled like .filter-row/.filter-btn above it: the
       category filter is a row of separate spaced pills, this is a single
       bordered panel with a heading and one continuous segmented-control
       track, so the two controls read as different kinds of choices. */
    .ps-panel {
      max-width: 720px; margin: 0 auto 40px; padding: 24px; border-radius: 16px;
      background: var(--bg-elevated); border: 1px solid var(--border);
      display: flex; flex-direction: column; align-items: center; gap: 16px;
    }
    .ps-heading { text-align: center; }
    .ps-heading h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--text-primary); margin: 0 0 4px; }
    .ps-heading p { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
    .platform-switch { width: 100%; }
    .ps-track {
      position: relative; display: flex; width: 100%; padding: 4px; border-radius: 9999px;
      background: var(--bg-inset); border: 1px solid var(--border);
    }
    .ps-thumb {
      position: absolute; top: 4px; bottom: 4px; left: 4px; z-index: 0;
      width: calc((100% - 8px) / var(--ps-count, 4)); border-radius: 9999px; background: var(--accent);
      transform: translateX(calc(var(--ps-index, 0) * 100%));
      transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .ps-btn {
      position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
      flex: 1; padding: 8px; border-radius: 9999px; border: none; background: transparent;
      color: var(--text-secondary); font-size: 0.78rem; font-weight: 600; transition: color 0.25s ease;
    }
    .ps-btn svg { width: 16px; height: 16px; flex: none; }
    .ps-btn.active { color: #fff; }
    .ps-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
    .rv-switch .ps-btns .ps-btn {
      flex: none; padding: 8px; border-radius: 9999px; background: var(--bg-inset); border: 1px solid var(--border); color: var(--text-secondary);
    }
    .rv-switch .ps-btns .ps-btn.active { background: var(--accent); color: #fff; }
    .rv-switch .ps-btn span { display: none; }
    @media (max-width: 640px) {
      .ps-track { flex-wrap: wrap; background: none; border: none; padding: 0; gap: 8px; }
      .ps-thumb { display: none; }
      .ps-track .ps-btn { flex: 1 1 calc(50% - 4px); background: var(--bg-inset); border: 1px solid var(--border); }
      .ps-track .ps-btn.active { background: var(--accent); color: #fff; }
    }

    /* ---- gallery card: media + chrome mount ---- */
    .gallery-card { cursor: pointer; }
    .gallery-card .gc-media { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; transition: top 0.25s ease, bottom 0.25s ease, left 0.25s ease, right 0.25s ease; background: linear-gradient(155deg, var(--bg-inset), var(--bg-muted)); }
    .gallery-card .gc-media svg { width: 32px; height: 32px; color: var(--text-muted); opacity: 0.55; }
    .gallery-card .gc-media .gc-vid, .gallery-card .gc-media .gc-vid-embed {
      width: 100%; height: 100%; object-fit: cover; border: 0;
      opacity: 0; transition: opacity 0.4s ease;
    }
    .gallery-card .gc-media .gc-vid.is-loaded, .gallery-card .gc-media .gc-vid-embed.is-loaded { opacity: 1; }
    .gallery-card::after {
      content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
      background: linear-gradient(0deg, rgba(10,8,24,0.78), transparent 42%, transparent 68%, rgba(10,8,24,0.32));
    }
    .gallery-card .gc-chrome { position: absolute; inset: 0; z-index: 3; direction: ltr; font-family: var(--font-display); }
    .gallery-card .gc-chrome > div { position: absolute; inset: 0; display: none; }
    .chrome-reels, .chrome-tiktok, .chrome-shorts { color: #fff; }
    .gallery-grid[data-platform="reels"] .chrome-reels,
    .gallery-grid[data-platform="tiktok"] .chrome-tiktok,
    .gallery-grid[data-platform="shorts"] .chrome-shorts,
    .gallery-grid[data-platform="adlibrary"] .chrome-adlibrary,
    .reel-viewer[data-platform="reels"] .chrome-reels,
    .reel-viewer[data-platform="tiktok"] .chrome-tiktok,
    .reel-viewer[data-platform="shorts"] .chrome-shorts,
    .reel-viewer[data-platform="adlibrary"] .chrome-adlibrary { display: block; }
    .gallery-card .gc-chrome button { pointer-events: none; background: none; border: none; color: inherit; font: inherit; text-align: inherit; }

    .ai-chip { display: none !important; }

    /* ==== Instagram Reels skin ==== */
    .chrome-reels .rl-top { position: absolute; top: 8px; left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; }
    .chrome-reels .rl-badge { font-size: 0.72rem; font-weight: 700; text-shadow: 0 1px 6px rgba(0,0,0,0.5); }
    .chrome-reels .rl-rail { position: absolute; right: 8px; bottom: 88px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
    .chrome-reels .rl-ic { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.65rem; font-weight: 600; }
    .chrome-reels .rl-ic svg { width: 24px; height: 24px; filter: drop-shadow(0 1px 4px rgba(0,0,0,0.55)); }
    .chrome-reels .rl-disc { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, #8fb0ec, #2a2a52); border: 2px solid rgba(255,255,255,0.9); margin-top: 4px; animation: rl-spin 3.2s linear infinite; }
    .chrome-reels .rl-bottom { position: absolute; left: 16px; right: 56px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
    .chrome-reels .rl-user { display: flex; align-items: center; gap: 8px; }
    .chrome-reels .rl-avatar {
      width: 24px; height: 24px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
      font-size: 0.7rem; font-weight: 700; background: linear-gradient(135deg, #8fb0ec, #5f7fd6); border: 1.5px solid rgba(255,255,255,0.8);
    }
    .chrome-reels .rl-user b { font-size: 0.82rem; font-weight: 700; }
    .chrome-reels .rl-follow { font-size: 0.68rem; font-weight: 700; border: 1.3px solid #fff; border-radius: 8px; padding: 4px 8px; }
    .chrome-reels .rl-caption { font-size: 0.76rem; line-height: 1.35; opacity: 0.96; }
    .chrome-reels .rl-audio { display: flex; align-items: center; gap: 8px; font-size: 0.7rem; opacity: 0.9; overflow: hidden; white-space: nowrap; }
    .chrome-reels .rl-audio svg { width: 16px; height: 16px; flex: none; }
    @keyframes rl-spin { to { transform: rotate(360deg); } }

    /* ==== TikTok skin ==== */
    .chrome-tiktok .tt-top { position: absolute; top: 8px; left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; }
    .chrome-tiktok .tt-tab { font-size: 0.76rem; font-weight: 700; opacity: 0.75; }
    .chrome-tiktok .tt-tab.active { opacity: 1; padding-bottom: 4px; border-bottom: 2px solid #fff; }
    .chrome-tiktok .tt-rail { position: absolute; right: 8px; bottom: 88px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
    .chrome-tiktok .tt-avatar-wrap { position: relative; margin-bottom: 4px; }
    .chrome-tiktok .tt-avatar {
      width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
      font-size: 0.74rem; font-weight: 700; background: linear-gradient(135deg, #8fb0ec, #5f7fd6); border: 1.5px solid #fff;
    }
    .chrome-tiktok .tt-plus {
      position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); width: 16px; height: 16px; border-radius: 50%;
      background: #ff3b56; color: #fff; font-size: 0.7rem; font-weight: 800; display: flex; align-items: center; justify-content: center; line-height: 1;
    }
    .chrome-tiktok .tt-ic { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.65rem; font-weight: 600; }
    .chrome-tiktok .tt-ic svg { width: 24px; height: 24px; filter: drop-shadow(0 1px 4px rgba(0,0,0,0.55)); }
    .chrome-tiktok .tt-disc {
      width: 24px; height: 24px; border-radius: 50%; margin-top: 4px; animation: rl-spin 2.6s linear infinite;
      background: radial-gradient(circle at center, #1c1c2e 30%, #333 31% 55%, #1c1c2e 56%);
      border: 2px solid rgba(255,255,255,0.85);
    }
    .chrome-tiktok .tt-bottom { position: absolute; left: 16px; right: 56px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
    .chrome-tiktok .tt-handle { font-size: 0.84rem; font-weight: 700; }
    .chrome-tiktok .tt-caption { font-size: 0.76rem; line-height: 1.35; opacity: 0.96; }
    .chrome-tiktok .tt-sound { display: flex; align-items: center; gap: 8px; font-size: 0.7rem; opacity: 0.9; overflow: hidden; white-space: nowrap; }
    .chrome-tiktok .tt-sound svg { width: 16px; height: 16px; flex: none; }

    /* ==== YouTube Shorts skin ==== */
    .chrome-shorts { --yt-red: #ff3b47; }
    .chrome-shorts .sh-top { position: absolute; top: 8px; left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; }
    .chrome-shorts .sh-logo { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; font-weight: 800; letter-spacing: -0.01em; }
    .chrome-shorts .sh-logo svg { width: 16px; height: 16px; color: var(--yt-red); }
    .chrome-shorts .sh-rail { position: absolute; right: 8px; bottom: 88px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
    .chrome-shorts .sh-ic { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.63rem; font-weight: 600; }
    .chrome-shorts .sh-ic svg { width: 24px; height: 24px; filter: drop-shadow(0 1px 4px rgba(0,0,0,0.55)); }
    .chrome-shorts .sh-bottom { position: absolute; left: 16px; right: 56px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; }
    .chrome-shorts .sh-channel { display: flex; align-items: center; gap: 8px; }
    .chrome-shorts .sh-avatar {
      width: 24px; height: 24px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
      font-size: 0.68rem; font-weight: 700; background: linear-gradient(135deg, #8fb0ec, #5f7fd6);
    }
    .chrome-shorts .sh-channel b { font-size: 0.8rem; font-weight: 700; }
    .chrome-shorts .sh-sub { font-size: 0.68rem; font-weight: 700; background: var(--yt-red); color: #fff; border-radius: 8px; padding: 4px 8px; }
    .chrome-shorts .sh-title { font-size: 0.76rem; line-height: 1.35; opacity: 0.96; }
    .chrome-shorts .sh-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,0.28); }
    .chrome-shorts .sh-progress-fill { height: 100%; background: var(--yt-red); }

    /* ==== Meta Ad Library skin (card-style, not full-bleed) ====
       Every row below is a fixed, non-wrapping height (nowrap + ellipsis)
       so header/sponsored/copy/badge/footer heights can never drift and
       overlap the absolutely-positioned rows around them - a fixed
       8px-grid stack (16 top -> 32 header -> 8 gap -> 16 sponsored -> 8 gap
       -> 16 copy -> 8 gap -> media -> 8 gap -> 16 badge -> 8 gap -> 40
       footer -> 16 bottom). */
    .gallery-grid[data-platform="adlibrary"] { grid-template-columns: repeat(auto-fit, minmax(272px, 340px)); justify-content: center; }
    .gallery-grid[data-platform="adlibrary"] .gallery-card { aspect-ratio: auto; min-height: 480px; width: 100%; background: var(--card-bg); border-color: var(--card-border); }
    .gallery-grid[data-platform="adlibrary"] .gallery-card::after { display: none; }
    .gallery-grid[data-platform="adlibrary"] .gallery-card .gc-media {
      top: 104px; bottom: 88px; left: 16px; right: 16px; border-radius: 8px; overflow: hidden;
      background: linear-gradient(155deg, var(--bg-inset), var(--bg-muted)); border: 1px solid var(--card-border);
    }
    .chrome-adlibrary { color: var(--text-primary); }
    .chrome-adlibrary .al-header { position: absolute; top: 16px; left: 16px; right: 16px; height: 32px; display: flex; align-items: center; gap: 8px; }
    .chrome-adlibrary .al-avatar {
      width: 32px; height: 32px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
      font-size: 0.75rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--periwinkle-light), var(--accent));
    }
    .chrome-adlibrary .al-header-text {
      flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
      font-size: 0.8rem; font-weight: 700; line-height: 32px;
    }
    .chrome-adlibrary .al-menu { flex: none; font-size: 1rem; color: var(--text-muted); line-height: 1; padding: 2px; }
    .chrome-adlibrary .al-sponsored-row {
      position: absolute; top: 56px; left: 56px; right: 16px; height: 16px; line-height: 16px;
      display: flex; align-items: center; gap: 4px; font-size: 0.68rem; color: var(--text-muted);
      white-space: nowrap; overflow: hidden;
    }
    .chrome-adlibrary .al-sponsored-row svg { flex: none; width: 11px; height: 11px; }
    .chrome-adlibrary .al-sponsored-row span { overflow: hidden; text-overflow: ellipsis; }
    .chrome-adlibrary .al-copy {
      position: absolute; top: 80px; left: 16px; right: 16px; height: 16px; line-height: 16px;
      font-size: 0.72rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .chrome-adlibrary .al-badge-row {
      position: absolute; left: 16px; right: 16px; bottom: 64px; height: 16px; line-height: 16px;
      display: flex; align-items: center; gap: 6px; font-size: 0.64rem; color: var(--text-muted); white-space: nowrap;
    }
    .chrome-adlibrary .al-active-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: #3fb56d; box-shadow: 0 0 5px rgba(63,181,109,0.7); }
    .chrome-adlibrary .al-active-text { flex: none; font-weight: 700; color: #3fb56d; }
    .chrome-adlibrary .al-libid { flex: none; margin-left: auto; font-family: 'Geist Mono', monospace; overflow: hidden; text-overflow: ellipsis; }
    .chrome-adlibrary .al-footer {
      position: absolute; left: 16px; right: 16px; bottom: 16px; height: 40px;
      display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border);
    }
    .chrome-adlibrary .al-domain { display: flex; flex-direction: column; gap: 0; min-width: 0; overflow: hidden; }
    .chrome-adlibrary .al-domain span { font-size: 0.62rem; line-height: 16px; letter-spacing: 0.04em; color: var(--text-muted); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .chrome-adlibrary .al-domain b { font-size: 0.76rem; line-height: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .chrome-adlibrary .al-cta { flex: none; font-size: 0.72rem; font-weight: 700; height: 32px; padding: 0 16px; border-radius: 8px; background: var(--accent); color: #fff; }
    .chrome-adlibrary .ai-chip { flex: none; background: var(--accent-dim); color: var(--accent); }
    .chrome-adlibrary .ai-chip::before { background: var(--accent); box-shadow: none; }

    /* ---- immersive fullscreen viewer ---- */
    .reel-viewer { position: fixed; inset: 0; z-index: 9000; display: none; }
    .reel-viewer.open { display: block; }
    .reel-viewer .rv-backdrop { position: absolute; inset: 0; background: rgba(8,6,18,0.92); }
    .reel-viewer .rv-topbar {
      position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
      gap: 16px; padding: 16px; pointer-events: none;
    }
    .reel-viewer .rv-topbar .platform-switch, .reel-viewer .rv-topbar .rv-close { pointer-events: auto; }
    .reel-viewer .rv-switch { margin: 0; }
    .reel-viewer .rv-close {
      position: absolute; right: 16px; top: 16px; width: 40px; height: 40px; border-radius: 50%;
      background: rgba(255,255,255,0.12); color: #fff; display: flex; align-items: center; justify-content: center;
    }
    .reel-viewer .rv-close svg { width: 20px; height: 20px; }
    .reel-viewer .rv-track {
      position: absolute; inset: 0; overflow-y: auto; scroll-snap-type: y mandatory; z-index: 1;
      -webkit-overflow-scrolling: touch; scrollbar-width: none;
    }
    .reel-viewer .rv-track::-webkit-scrollbar { display: none; }
    .rv-slide { height: 100%; height: 100svh; scroll-snap-align: start; display: flex; align-items: center; justify-content: center; padding: 72px 16px; }
    .rv-slide .rv-card {
      position: relative; width: min(360px, 88vw); aspect-ratio: 9/16; border-radius: 20px; overflow: hidden;
      background: linear-gradient(155deg, var(--bg-inset), var(--bg-muted)); box-shadow: 0 30px 80px rgba(0,0,0,0.5);
    }
    .rv-slide .rv-card .gc-media svg { width: 40px; height: 40px; }
    .reel-viewer[data-platform="adlibrary"] .rv-slide .rv-card { aspect-ratio: auto; width: min(384px, 90vw); min-height: 520px; background: var(--card-bg); }
    .reel-viewer[data-platform="adlibrary"] .rv-slide .rv-card::after { display: none; }
    .reel-viewer[data-platform="adlibrary"] .rv-slide .rv-card .gc-media { top: 112px; bottom: 96px; }
    /* Anchored to the card's actual right edge (card is centered, width
       min(360px, 88vw)), not the corner of the full-viewport .reel-viewer —
       otherwise the buttons land far from the card on wide screens. */
    .rv-nav {
      position: absolute;
      left: calc(50% + min(180px, 44vw) + 16px);
      top: 50%;
      transform: translateY(-50%);
      z-index: 2;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .reel-viewer[data-platform="adlibrary"] .rv-nav { left: calc(50% + min(192px, 45vw) + 16px); }
    .rv-nav-btn {
      width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.12); color: #fff;
      display: flex; align-items: center; justify-content: center;
    }
    .rv-nav-btn svg { width: 20px; height: 20px; }
    .rv-nav-btn:disabled { opacity: 0.35; }
    body.rv-lock { overflow: hidden; }
    @media (max-width: 640px) {
      .rv-nav { display: none; }
      .platform-switch { margin-bottom: 24px; }
    }
