      /* ===================== Design tokens ===================== */
      :root {
        --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
        --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
        --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

        /* Light theme — warm editorial cream + indigo */
        --bg: #f2efe8;
        --bg-card: #faf8f3;
        --bg-soft: #ebe7dd;
        --fg: #15161a;
        --fg-muted: #6c6a64;
        --fg-faint: #9c9a92;
        --accent: #4f46e5;
        --accent-soft: #ece9ff;
        --accent-ink: #ffffff;
        --pill: #15161a;
        --pill-ink: #faf8f3;
        --line: rgba(20, 18, 14, 0.10);
        --line-soft: rgba(20, 18, 14, 0.06);
        --shadow-sm: 0 1px 2px rgba(20, 18, 14, 0.04);
        --shadow-md: 0 1px 2px rgba(20, 18, 14, 0.04), 0 14px 40px rgba(20, 18, 14, 0.06);
        --screen: #15161a;
        --radius: 14px;
        --radius-sm: 9px;
        /* World-map heatmap palette */
        --world-bg: #ebe7dd;
        --world-land: #d8d4c8;
        --world-stroke: rgba(20, 18, 14, 0.18);
      }
      :root[data-theme="dark"] {
        --bg: #14151a;
        --bg-card: #1c1d23;
        --bg-soft: #0e0f13;
        --fg: #ecebe6;
        --fg-muted: #9a9aa1;
        --fg-faint: #5e5f66;
        --accent: #8b85ff;
        --accent-soft: #20204a;
        --accent-ink: #14151a;
        --pill: #ecebe6;
        --pill-ink: #14151a;
        --line: rgba(255, 255, 255, 0.09);
        --line-soft: rgba(255, 255, 255, 0.05);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 40px rgba(0, 0, 0, 0.4);
        --screen: #0a0a0c;
        --world-bg: #0e0f13;
        --world-land: #2b2c33;
        --world-stroke: rgba(255, 255, 255, 0.12);
      }

      * { box-sizing: border-box; }
      html, body { background: var(--bg); }
      body {
        margin: 0;
        color: var(--fg);
        font-family: var(--font-body);
        font-size: 15px; line-height: 1.5;
        -webkit-font-smoothing: antialiased;
        /* subtle horizontal grid lines as a layout cue, like the mockup */
        background-image: linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
        background-size: 100% 96px;
        background-position: 0 88px;
        background-attachment: fixed;
      }
      .wrap { max-width: 1280px; margin: 0 auto; padding: 22px 32px 80px; }
      .hidden { display: none !important; }
      a { color: inherit; }

      /* ===================== Typography ===================== */
      .display {
        font-family: var(--font-display);
        font-weight: 400;
        font-size: clamp(54px, 8vw, 96px);
        line-height: 0.98;
        letter-spacing: -0.012em;
        margin: 0;
      }
      .display em { font-style: italic; color: var(--accent); }
      .eyebrow {
        font-family: var(--font-mono);
        font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
        color: var(--accent); font-weight: 500;
      }
      .eyebrow .dash { color: var(--fg-faint); margin-right: 8px; }
      .lead {
        font-size: 17px; line-height: 1.5; color: var(--fg-muted);
        max-width: 56ch; margin: 22px 0 0;
      }
      .muted { color: var(--fg-muted); }
      .faint { color: var(--fg-faint); }
      .mono {
        font-family: var(--font-mono); font-size: 11.5px;
        letter-spacing: 0.10em; text-transform: uppercase; color: var(--fg-muted);
      }

      /* ===================== Header ===================== */
      header.site {
        display: flex; align-items: center; justify-content: space-between; gap: 16px;
        padding: 6px 0 22px;
        border-bottom: 1px solid var(--line-soft);
        margin-bottom: 56px;
      }
      .brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
      .brand .logo { width: 38px; height: 38px; border-radius: 50%; background: var(--screen); display: block; }
      .brand-wordmark {
        font-family: var(--font-display); font-weight: 400; font-size: 26px;
        margin: 0; letter-spacing: -0.005em; line-height: 1;
      }
      .nav { display: flex; align-items: center; gap: 6px; }
      .nav a, .nav button {
        background: transparent; border: 0; color: var(--fg); cursor: pointer;
        font-family: var(--font-body); font-size: 14.5px; padding: 8px 14px;
        border-radius: 8px; text-decoration: none; line-height: 1;
      }
      .nav a:hover, .nav button:hover { background: var(--bg-soft); }

      /* Theme switch (sun / moon) */
      .switch {
        display: inline-flex; align-items: center; padding: 3px;
        background: var(--bg-soft); border-radius: 999px; margin: 0 4px;
      }
      .switch button {
        width: 28px; height: 28px; padding: 0; border: 0; background: transparent;
        border-radius: 50%; color: var(--fg-muted); cursor: pointer;
        display: inline-flex; align-items: center; justify-content: center;
      }
      .switch button.on { background: var(--accent); color: var(--accent-ink); }
      .switch svg { width: 16px; height: 16px; }

      /* Hamburger button - hidden on desktop, shown on mobile by the media
         query below. The aria-expanded attribute on the button tracks state. */
      .hamburger {
        display: none; background: transparent; border: 1px solid var(--line);
        border-radius: 10px; padding: 8px; cursor: pointer; color: var(--fg);
      }
      .hamburger:hover { background: var(--bg-soft); }
      .hamburger svg { width: 22px; height: 22px; display: block; }

      /* ===================== Buttons ===================== */
      .btn {
        background: var(--pill); color: var(--pill-ink); border: 0; border-radius: 999px;
        padding: 11px 22px; font-size: 14px; font-weight: 500; cursor: pointer;
        font-family: var(--font-body); transition: opacity .15s;
      }
      .btn:hover { opacity: 0.88; }
      .btn:disabled { opacity: 0.4; cursor: not-allowed; }
      .btn-block { width: 100%; padding: 14px 24px; font-size: 15px; }
      .btn-accent {
        background: var(--accent); color: var(--accent-ink);
      }
      .btn-ghost {
        background: transparent; color: var(--fg); border: 1px solid var(--line);
        border-radius: 999px; padding: 9px 18px; font-size: 13.5px; cursor: pointer;
        font-family: var(--font-body); transition: background .15s, border-color .15s;
      }
      .btn-ghost:hover { background: var(--bg-soft); border-color: var(--fg-muted); }

      /* ===================== Cards ===================== */
      .panel { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); }
      .card {
        background: var(--bg-card); border: 1px solid var(--line);
        border-radius: var(--radius); padding: 28px;
        box-shadow: var(--shadow-md);
      }
      .card h2 {
        font-family: var(--font-display); font-weight: 400; font-size: 30px;
        letter-spacing: -0.01em; margin: 0; line-height: 1.05;
      }
      .card-eyebrow {
        font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em;
        text-transform: uppercase; color: var(--fg-faint); margin: 0 0 16px;
      }
      .card-eyebrow .num { color: var(--fg-muted); }

      /* ===================== Landing ===================== */
      .hero { margin-bottom: 56px; }
      .hero-grid {
        display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px;
        align-items: stretch;
      }
      @media (max-width: 920px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }

      /* upload card */
      #drop {
        background: var(--bg); border: 1.5px dashed var(--line);
        border-radius: 12px; padding: 22px;
        display: flex; align-items: center; gap: 18px;
        cursor: pointer; transition: border-color .15s, background .15s;
      }
      #drop.over { border-color: var(--accent); background: var(--accent-soft); }
      #drop .icon {
        width: 52px; height: 52px; flex-shrink: 0;
        background: var(--accent); color: var(--accent-ink);
        border-radius: 12px; display: flex; align-items: center; justify-content: center;
      }
      #drop .icon svg { width: 22px; height: 22px; }
      #drop .copy { flex: 1; min-width: 0; }
      #drop h3 {
        font-family: var(--font-display); font-weight: 400; font-size: 24px;
        margin: 0; line-height: 1.1; letter-spacing: -0.005em;
      }
      #drop .hint { font-size: 13px; color: var(--fg-muted); margin-top: 4px; }
      #drop .pickbtn {
        background: var(--bg-card); border: 1px solid var(--line); border-radius: 999px;
        padding: 9px 18px; font-size: 13.5px; color: var(--fg);
        cursor: pointer; flex-shrink: 0; font-family: var(--font-body);
      }
      #drop .pickbtn:hover { border-color: var(--fg-muted); }
      #uperr {
        margin-top: 12px; padding: 10px 14px; border-radius: 9px;
        background: #fdf0e0; color: #8a4a14; font-size: 13.5px; border: 1px solid #f1c79a;
      }
      :root[data-theme="dark"] #uperr { background: #2d1f10; color: #f3c688; border-color: #533a18; }

      .thumb-strip {
        display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px;
        margin-top: 18px;
      }
      .thumb-strip img {
        width: 100%; aspect-ratio: 16/9; object-fit: cover;
        border-radius: 8px; background: var(--bg-soft);
        cursor: pointer; transition: transform .15s;
      }
      .thumb-strip img:hover { transform: translateY(-1px); }

      .privacy {
        margin-top: 18px;
        font-family: var(--font-mono); font-size: 11.5px;
        letter-spacing: 0.10em; text-transform: lowercase; color: var(--fg-faint);
      }

      .feature-list { list-style: none; padding: 0; margin: 18px 0 0; }
      .feature-list li {
        display: flex; align-items: baseline; gap: 12px;
        padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 15px;
      }
      .feature-list li:first-child { border-top: 0; }
      .feature-list li::before {
        content: ""; width: 6px; height: 6px; border-radius: 50%;
        background: var(--accent); flex-shrink: 0; transform: translateY(-2px);
      }
      .feature-list .tag {
        margin-left: auto; font-family: var(--font-mono); font-size: 11px;
        letter-spacing: 0.10em; text-transform: lowercase; color: var(--fg-faint);
      }

      /* ===================== Processing ===================== */
      #processing { padding: 48px 28px; text-align: center; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); }
      #processing h2 { font-family: var(--font-display); font-weight: 400; font-size: 28px; margin: 0 0 6px; letter-spacing: -0.005em; }
      .bar { height: 4px; background: var(--line-soft); border-radius: 999px; overflow: hidden; margin: 22px auto 0; max-width: 420px; position: relative; }
      .bar > div { height: 100%; background: var(--accent); width: 0%; transition: width .5s ease; position: relative; }
      /* Shimmer sliding across the filled portion — makes the bar feel alive
         even when the % isn't moving every poll. */
      .bar.shimmer > div::after {
        content: ""; position: absolute; inset: 0; border-radius: inherit;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55) 50%, transparent);
        animation: bar-shimmer 1.6s linear infinite;
      }
      @keyframes bar-shimmer { from { transform: translateX(-100%);} to { transform: translateX(100%);} }
      [data-theme="dark"] .bar.shimmer > div::after {
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18) 50%, transparent);
      }

      /* Skeleton placeholder shown in place of the player while nothing is loaded. */
      .player-skeleton {
        width: 100%; aspect-ratio: 16/9; background: var(--screen);
        border-radius: 12px; border: 1px solid var(--line); position: relative; overflow: hidden;
        display: flex; align-items: flex-end; padding: 14px 16px;
      }
      .player-skeleton .skel-screen {
        position: absolute; inset: 0;
        background: linear-gradient(90deg, var(--screen) 0%, var(--bg-soft) 50%, var(--screen) 100%);
        background-size: 220% 100%;
        animation: skel-slide 2.4s ease-in-out infinite;
      }
      .player-skeleton .skel-copy { position: relative; z-index: 1; width: 60%; }
      .player-skeleton .skel-line {
        height: 10px; background: rgba(255,255,255,0.18); border-radius: 6px; margin: 6px 0;
      }
      .player-skeleton .skel-line.short { width: 40%; }
      @keyframes skel-slide { 0% { background-position: 0 0;} 100% { background-position: 220% 0;} }

      /* "While you wait" tip card */
      .tip-card {
        background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 16px 18px; margin-top: 14px;
      }
      .tip-card.center { text-align: center; }
      .tip-eyebrow {
        display: inline-block; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
        color: var(--fg-faint); font-weight: 600;
      }
      .tip-text { margin: 6px 0 10px; font-size: 14.5px; line-height: 1.55; min-height: 44px; }
      .tip-text.fade-in { animation: tip-fade 480ms ease both; }
      @keyframes tip-fade { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: none;} }
      .tip-dots { display: flex; gap: 6px; justify-content: center; }
      .tip-card:not(.center) .tip-dots { justify-content: flex-start; }
      .tip-dots .dot {
        width: 6px; height: 6px; border-radius: 999px; background: var(--line);
        transition: background 200ms, transform 200ms;
      }
      .tip-dots .dot.on { background: var(--accent); transform: scale(1.25); }

      /* Live per-file upload queue (client-side, before backend knows) */
      .upload-queue { display: flex; flex-direction: column; gap: 6px; }
      .upload-queue .lbl {
        font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
        color: var(--fg-faint); font-weight: 600; margin-bottom: 4px;
      }
      .queue-row {
        display: flex; align-items: center; gap: 10px;
        padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px;
        background: var(--bg-card);
      }
      .queue-row .name {
        flex: 1; min-width: 0; font-size: 13.5px;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
      }
      .queue-row.active { border-color: var(--accent); }
      .libitem.indexing { opacity: 0.78; }
      .libitem .status-dot, .queue-row .status-dot {
        flex-shrink: 0; width: 8px; height: 8px; border-radius: 999px; background: var(--line);
      }
      .status-dot.ok { background: var(--accent); }
      .status-dot.pulse {
        background: var(--accent);
        animation: dot-pulse 1.2s ease-in-out infinite;
      }
      .status-dot.idle { background: var(--line); }
      @keyframes dot-pulse {
        0%, 100% { transform: scale(0.85); opacity: 0.55; }
        50%      { transform: scale(1.15); opacity: 1; }
      }

      /* Admin: world-map heatmap. The SVG ships paths labelled by lowercase
         country name; JS replaces inline fills with neutral land, then tints
         country paths by relative view share for the current window. */
      .world-map {
        background: var(--world-bg);
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        padding: 6px;
        line-height: 0;          /* kill the descender gap under inline SVG */
        overflow: hidden;
      }
      .world-map svg { color: var(--accent); }
      .world-map path { transition: fill 240ms ease; }
      .world-map path.heat-on { cursor: pointer; }
      .world-map path.heat-on:hover {
        filter: brightness(1.15);
      }

      /* Admin: geographic heat grid. Each tile is a country, sized like a
         badge and tinted by its share of view traffic (--heat: 0..1). The
         flag emoji sits on top of a brand-accent wash so the densest
         countries glow brightest. */
      .geo-heat {
        display: flex; flex-wrap: wrap; gap: 8px;
      }
      .geo-tile {
        display: inline-flex; align-items: center; gap: 6px;
        padding: 8px 12px; border-radius: 12px;
        background: color-mix(in srgb, var(--accent) calc(var(--heat, 0.2) * 100%), var(--bg-card));
        border: 1px solid color-mix(in srgb, var(--accent) calc(var(--heat, 0.2) * 60%), var(--line));
        font-size: 13px; min-width: 0; cursor: default;
        transition: transform .12s;
      }
      .geo-tile:hover { transform: translateY(-1px); }
      .geo-tile .flag { font-size: 16px; line-height: 1; }
      .geo-tile .iso {
        font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
        color: var(--fg);
      }
      .geo-tile .count {
        font-variant-numeric: tabular-nums; font-size: 12.5px;
        color: var(--fg); font-weight: 600;
      }

      /* ===================== Workspace ===================== */
      #workspace, #libworkspace {
        display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
        gap: 26px; align-items: start;
      }
      #workspace > div, #libworkspace > div { min-width: 0; }
      .col-player { position: sticky; top: 24px; align-self: start; }
      @media (max-width: 920px) {
        #workspace, #libworkspace { grid-template-columns: 1fr; }
        .col-player { position: static; }
      }
      video { width: 100%; aspect-ratio: 16/9; background: var(--screen); border-radius: 12px; border: 1px solid var(--line); display: block; }
      #vtitle, #libtitle {
        font-family: var(--font-display); font-weight: 400; font-size: 26px;
        letter-spacing: -0.005em; margin: 0 0 14px;
      }

      .searchrow { display: flex; gap: 8px; }
      #query, #question, #libquery, #libquestion {
        flex: 1; background: var(--bg-card); border: 1px solid var(--line); border-radius: 999px;
        padding: 12px 18px; color: var(--fg); font-size: 14.5px; font-family: var(--font-body);
      }
      #query::placeholder, #question::placeholder, #libquery::placeholder, #libquestion::placeholder { color: var(--fg-faint); }
      #query:focus, #question:focus, #libquery:focus, #libquestion:focus { outline: none; border-color: var(--accent); }

      #results, #libresults { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
      .result {
        display: flex; gap: 14px; padding: 12px; background: var(--bg-card);
        border: 1px solid var(--line); border-radius: 12px; cursor: pointer; text-align: left;
        transition: border-color .12s, transform .12s, box-shadow .12s;
      }
      .result:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-md); }
      .result img { width: 132px; height: 74px; object-fit: cover; border-radius: 8px; background: var(--screen); flex-shrink: 0; }
      .result .meta { min-width: 0; flex: 1; }
      .result .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
      .result .time { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; color: var(--fg); font-variant-numeric: tabular-nums; }
      .result .vid { font-size: 13px; font-weight: 500; color: var(--fg); margin: 0; }
      .badge {
        font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
        padding: 3px 8px; border-radius: 999px;
        background: var(--accent); color: var(--accent-ink); flex-shrink: 0;
        letter-spacing: 0.05em;
      }
      .badge.weak { background: var(--bg-soft); color: var(--fg-muted); }
      .result .desc { font-size: 13px; color: var(--fg-muted); margin: 4px 0 0; line-height: 1.4; }
      .result .snip { font-size: 12px; color: var(--fg-faint); font-style: italic; margin: 4px 0 0; line-height: 1.4; }
      .empty {
        padding: 36px 18px; text-align: center; color: var(--fg-muted); font-size: 13.5px;
        border: 1px dashed var(--line); border-radius: 12px;
      }
      .clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
      .clamp1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

      .libitem {
        display: flex; justify-content: space-between; align-items: center; gap: 10px;
        padding: 10px 14px; background: var(--bg-card); border: 1px solid var(--line);
        border-radius: 10px; cursor: pointer; font-size: 13.5px; transition: border-color .12s, background .12s;
      }
      .libitem:hover { border-color: var(--accent); background: var(--accent-soft); }
      .libitem .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
      .libitem.indexing { cursor: default; }
      .libitem.indexing:hover { border-color: var(--line); background: var(--bg-card); }

      .chapter {
        display: flex; gap: 10px; align-items: baseline; padding: 8px 12px;
        border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px;
        cursor: pointer; font-size: 13px; transition: border-color .12s, background .12s;
        background: var(--bg-card);
      }
      .chapter:hover { border-color: var(--accent); background: var(--accent-soft); }
      .chapter .ctime { font-family: var(--font-mono); color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 500; flex-shrink: 0; }

      .lbl {
        font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.10em;
        text-transform: uppercase; color: var(--fg-faint); margin-bottom: 10px;
      }

      .tabs { display: inline-flex; padding: 3px; background: var(--bg-soft); border-radius: 999px; margin-bottom: 14px; }
      .tab {
        background: transparent; border: 0; color: var(--fg-muted);
        border-radius: 999px; padding: 7px 16px; font-size: 13px; cursor: pointer;
        font-family: var(--font-body);
      }
      .tab.active { background: var(--bg-card); color: var(--fg); box-shadow: var(--shadow-sm); }

      #answer, #libAnswer { font-size: 14px; line-height: 1.6; color: var(--fg); }
      .cite { color: var(--accent); cursor: pointer; font-weight: 500; }
      .cite:hover { text-decoration: underline; }

      /* ===================== Modals ===================== */
      .modal-bg {
        position: fixed; inset: 0; background: rgba(20, 18, 14, 0.55);
        display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
        backdrop-filter: blur(6px);
      }
      .modal {
        background: var(--bg-card); border-radius: var(--radius); padding: 28px;
        max-width: 720px; width: 100%; box-shadow: var(--shadow-md);
        border: 1px solid var(--line);
      }

      /* ===================== Mobile (tablet + phone) ===================== */
      @media (max-width: 760px) {
        body { font-size: 14.5px; background-attachment: scroll; }
        .wrap { padding: 16px 18px 64px; }

        header.site {
          flex-wrap: wrap; gap: 10px; padding-bottom: 14px; margin-bottom: 32px;
          position: relative;
        }
        .brand-wordmark { font-size: 22px; }
        .brand .logo { width: 32px; height: 32px; }

        /* Hamburger pattern: button appears, nav collapses into a full-width
           dropdown below the header. Click outside or any link to close. */
        .hamburger { display: inline-flex; align-items: center; justify-content: center; }
        .nav {
          display: none; width: 100%; flex-basis: 100%;
          flex-direction: column; align-items: stretch; gap: 4px;
          padding: 12px 0 4px; margin-top: 4px;
          border-top: 1px solid var(--line);
        }
        .nav.open { display: flex; }
        .nav a, .nav button {
          padding: 12px 14px; font-size: 16px; border-radius: 10px;
          width: 100%; text-align: left;
        }
        .nav .btn {
          text-align: center; padding: 14px 18px; margin-top: 6px;
        }
        .switch { margin: 8px 0 0; align-self: flex-start; }
        #authArea {
          flex-direction: column !important; align-items: stretch !important;
          gap: 4px !important; width: 100%;
        }
        #authArea a { padding: 12px 14px; font-size: 16px; border-radius: 10px; }

        .display { font-size: clamp(40px, 11vw, 60px); line-height: 1.02; }
        .display br { display: none; }
        .lead { font-size: 15.5px; margin-top: 16px; }
        .hero { margin-bottom: 36px; }
        .hero-grid { gap: 14px; }
        .card { padding: 20px; }
        .card h2 { font-size: 24px; }

        /* drop zone stacks vertically — icon → copy → Choose file */
        #drop {
          flex-direction: column; align-items: stretch; gap: 12px; padding: 16px;
        }
        #drop .icon { width: 44px; height: 44px; }
        #drop .pickbtn { width: 100%; }
        #drop .copy h3 { font-size: 20px; }

        /* tighter sample preview on small screens (minmax(0,1fr) so the imgs
           are allowed to shrink below their intrinsic width). */
        .thumb-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }

        /* modals: full-bleed and scrollable */
        .modal-bg { padding: 10px; align-items: flex-end; }
        .modal { padding: 18px; max-height: 92vh; overflow-y: auto; border-radius: 16px 16px 0 0; }
        .modal h2 { font-size: 22px !important; }

        /* workspace + library: stack player above results */
        #workspace, #libworkspace { grid-template-columns: 1fr; gap: 18px; }
        .col-player { position: static; }
        #vtitle, #libtitle { font-size: 22px; }
        .result img { width: 92px; height: 52px; }

        /* admin: drop to 2-up cards, breakdown table scrolls horizontally */
        #adminCards, #adminActivity { grid-template-columns: 1fr 1fr; }
        #adminBreakdown { overflow-x: auto; }
        #adminBreakdown table { min-width: 520px; }
      }

      @media (max-width: 460px) {
        .display { font-size: clamp(36px, 12vw, 48px); }
        .card h2 { font-size: 22px; }
        .feature-list li { font-size: 14px; }
        .thumb-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }

        /* admin one-up at phone widths */
        #adminCards, #adminActivity { grid-template-columns: 1fr; }

        /* result cards stack image above text */
        .result { flex-direction: column; gap: 10px; }
        .result img { width: 100%; height: 160px; }

        /* tip card + queue rows: tighten paddings on phone */
        .tip-card { padding: 14px 14px; }
        .tip-text { font-size: 14px; min-height: 56px; }
        .queue-row { padding: 10px 12px; }

        /* Allow searchrows with 3+ children (browse + input + scan) to wrap. */
        .searchrow { flex-wrap: wrap; }
        .searchrow > input { min-width: 0; flex-basis: 100%; }
      }
