  /* Studio brand alignment with the 2026-05 landing redesign.
     Studio shares the landing's industrial-editorial direction:
     Geist Sans/Mono typography, ink + paper + brand-teal palette,
     hairline rules. Old token names (--bg, --accent, etc.) are aliased
     to the new tokens so the rest of this 3.6k-line stylesheet keeps
     working without touching every component. */
  @import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;450;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

:root {
    /* === Phantomline Brand Bible v1.0 (2026-05) ============================
       Geist Sans + Geist Mono. Ideally self-hosted from vercel.com/font;
       Google Fonts CDN here as a fallback (slight loss of OpenType
       features but brand identity preserved). To upgrade: download
       GeistVariable + GeistMonoVariable woff2, place in static/fonts/,
       and replace the @import above with @font-face declarations.

       Old token names (--bg, --accent, etc.) are aliased to the new
       tokens so the existing 3.8k-line stylesheet keeps working.
       New components should reference the new token names directly. */

    /* Color (Bible §02) */
    --cyan-900: #0A7A85;
    --cyan-700: #0AA7B5;
    --cyan-500: #22E7F5;
    --cyan-400: #26F3FF;
    --cyan-200: #BAFFFF;

    --gray-950: #0B0F11;
    --gray-900: #111619;
    --gray-850: #161B1F;
    --gray-800: #1C2227;
    --gray-700: #2A3137;
    --gray-600: #3A4249;
    --gray-500: #5C6B77;
    --gray-400: #7A8B97;
    --gray-300: #94A3B0;
    --gray-100: #E6EAEC;

    --bg-base: var(--gray-950);
    --bg-surface-1: var(--gray-900);
    --bg-surface-2: var(--gray-850);
    --bg-surface-3: var(--gray-800);
    --bg-overlay: rgba(0, 0, 0, 0.6);

    --border-default: var(--gray-700);
    --border-subtle: var(--gray-800);
    --border-strong: var(--gray-600);
    --border-focus: var(--cyan-500);

    --text-primary: var(--gray-100);
    --text-secondary: var(--gray-300);
    --text-muted: var(--gray-500);
    --text-accent: var(--cyan-500);
    --text-on-accent: var(--gray-950);

    --accent-default: var(--cyan-500);
    --accent-hover: var(--cyan-400);
    --accent-muted: rgba(34, 231, 245, 0.15);
    --accent-glow: rgba(34, 231, 245, 0.25);

    --success: #34D399;
    --success-muted: rgba(52, 211, 153, 0.15);
    --warning: #FBBF24;
    --warning-muted: rgba(251, 191, 36, 0.15);
    --error: #F87171;
    --error-muted: rgba(248, 113, 113, 0.15);

    /* Typography (Bible §01) */
    --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --text-display: 56px;
    --text-h1: 40px;
    --text-h2: 32px;
    --text-h3: 24px;
    --text-h4: 20px;
    --text-body: 16px;
    --text-body-sm: 14px;
    --text-caption: 13px;
    --text-label: 12px;
    --text-mono: 14px;

    /* Spacing (Bible §03) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --space-9: 96px;
    --space-10: 128px;

    /* Radius (Bible §04: NO PILLS, EVER) */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Motion */
    --motion-fast: 150ms;
    --motion-base: 200ms;
    --motion-slow: 300ms;
    --ease-out: ease;

    /* Backward-compat aliases */
    --ink: var(--bg-base);
    --ink-2: var(--bg-surface-2);
    --paper: var(--text-primary);
    --paper-dim: var(--text-secondary);
    --rule: var(--border-subtle);
    --rule-strong: var(--border-default);
    --brand: var(--accent-default);
    --brand-deep: var(--cyan-700);
    --brand-faint: var(--accent-muted);
    --signal: var(--warning);
    --signal-deep: #B8761D;
    --bg: var(--bg-base);
    --panel: var(--bg-surface-1);
    --panel-2: var(--bg-surface-2);
    --panel-3: var(--bg-surface-3);
    --border: var(--border-default);
    --text: var(--text-primary);
    --muted: var(--text-muted);
    --accent: var(--accent-default);
    --accent-2: var(--warning);
    --cyan: var(--accent-default);
    --good: var(--success);
    --warn: var(--warning);
    --bad: var(--error);
    --shadow: 0 20px 70px rgba(0, 0, 0, 0.42);

    --r-1: var(--radius-sm);
    --r-2: var(--radius-md);
    --r-3: var(--radius-md);
    --r-4: var(--radius-lg);
    --r-pill: var(--radius-sm);
    --r-circle: 50%;
}
  * { box-sizing: border-box; }
  /* Screen-reader-only utility. Used to keep semantic structure (h1, etc)
     for assistive tech without painting the element visually. */
  .visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
  }
  html, body {
    margin: 0; padding: 0;
    background: var(--ink);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    /* Mobile defensive. prevent any rogue absolutely-positioned element
       (notification panel, dropdowns) from forcing horizontal scroll on
       phones. The studio is grid-heavy and a single overflowing child
       can break layout below ~640px.

       ORDER MATTERS: `clip` after `hidden` so modern browsers use clip
       (which preserves position:sticky on descendants) and old browsers
       fall back to hidden. The previous order had hidden winning,
       which broke the right-rail sticky behavior. main column scrolled
       freely while the right rail's bounding box left the viewport,
       creating a 1300px-tall empty void below it. */
    overflow-x: hidden;
    overflow-x: clip;
    max-width: 100vw;
  }
  /* Long unbreakable strings (URLs, model names like 'llama3.1:70b-instruct')
     shouldn't punch out the layout. but regular words must NEVER break
     mid-character. `break-word` only kicks in when a string can't fit any
     other way; `anywhere` was causing "Phantomline" to wrap as
     "Phantomlin / e" on the studio launch hero where the column is narrow
     but the H2 font is large. */
  p, code, .hint, .help, span.url, span.path {
    overflow-wrap: break-word;
  }
  h1, h2, h3, h4, .launch-hero h2 {
    overflow-wrap: normal;
    word-break: keep-all;
    hyphens: none;
  }
  .wrap {
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px 24px 60px;
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas:
      "banner  banner"
      "header  header"
      "sidebar main"
      "footer  footer";
    column-gap: 28px;
    row-gap: 24px;
    min-height: calc(100vh - 24px);
  }
  /* Anchor the install banner to its grid row so it actually sits at
     the TOP of the studio, not at the bottom (auto-placement). */
  .wrap > .install-banner { grid-area: banner; margin: 0 -24px; }
  @media (max-width: 900px) {
    .wrap {
      grid-template-columns: 1fr;
      grid-template-areas: "header" "sidebar" "main" "footer";
    }
  }
  header {
    grid-area: header;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 4px;
  }
  .tab-content { grid-area: main; min-width: 0; }
  a.brand, .brand {
    display: flex; align-items: center; gap: 12px;
    font-weight: 600; letter-spacing: 0.2px;
    text-decoration: none; color: inherit;
    transition: opacity 0.15s;
  }
  a.brand:hover { opacity: 0.85; text-decoration: none; }
  /* Studio brand mark. single primary-logo PNG sized to header height.
     Replaced the legacy icon-plus-CSS-text combo when the real designed
     logo shipped. */
  .brand .brand-img {
    height: 36px;
    width: auto;
    max-width: min(60vw, 220px);
    object-fit: contain;
    flex: 0 0 auto;
  }
  .brand h1 { font-size: 16px; margin: 0; font-weight: 600; }
  .brand small,
  .brand .brand-tagline { color: var(--muted); font-weight: 400; font-size: 12px; letter-spacing: 0.3px; }

  .ollama-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
    color: var(--muted);
  }
  .ollama-badge .pulse {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--muted);
  }
  .ollama-badge.ok .pulse { background: var(--good); box-shadow: 0 0 10px var(--good); }
  .ollama-badge.bad .pulse { background: var(--bad); box-shadow: 0 0 10px var(--bad); }

  /* Mode toggle: badge becomes a clickable dropdown that lets the user
     switch between hosted browser mode and their local Phantomline. */
  .mode-toggle-wrap { position: relative; }
  .mode-toggle-btn {
    cursor: pointer;
    border: 1px solid var(--border);
    font-family: inherit;
    transition: border-color 120ms, background 120ms;
  }
  .mode-toggle-btn:hover { border-color: rgba(34,231,245,0.45); background: rgba(34,231,245,0.05); }
  .mode-toggle-caret {
    margin-left: 4px; opacity: 0.6; font-size: 10px;
  }
  .mode-toggle-menu {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 280px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    padding: 6px;
    z-index: 80;
    text-align: left;
  }
  .mode-toggle-menu[hidden] { display: none; }
  .mode-toggle-row {
    display: flex; flex-direction: column; gap: 2px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: background 100ms;
  }
  .mode-toggle-row:hover { background: rgba(34,231,245,0.08); }
  .mode-toggle-row strong { font-size: 13px; color: var(--text); }
  .mode-toggle-row .mode-toggle-meta { font-size: 11px; color: var(--muted); }
  .mode-toggle-row[data-mode-row="browser"] { background: rgba(34,231,245,0.06); cursor: default; }
  .mode-toggle-row[data-mode-row="browser"]:hover { background: rgba(34,231,245,0.06); }
  .mode-toggle-status {
    font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
    padding: 1px 6px; border-radius: 4px;
    background: rgba(255,255,255,0.08); color: var(--muted);
    text-transform: uppercase;
    margin-left: 4px;
  }
  .mode-toggle-status.detected { background: rgba(34,231,245,0.20); color: #22E7F5; }
  .mode-toggle-status.missing { background: rgba(255,122,122,0.15); color: #ff7a7a; }
  .mode-toggle-download { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 12px; }
  .mode-toggle-hint {
    color: #c9a93a !important;
    font-style: italic;
    margin-top: 4px;
  }

  /* Render-quota counter (top-right of studio header) */
  .quota-widget {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 12px;
    text-decoration: none;
    transition: border-color 120ms, background 120ms;
  }
  .quota-widget:hover { border-color: rgba(34,231,245,0.45); background: rgba(34,231,245,0.05); }
  .quota-widget.over { border-color: #ff7a7a; background: rgba(255,122,122,0.08); color: #ff9c9c; }
  .quota-widget .quota-sep { color: var(--muted); margin: 0 1px; }
  .quota-widget .quota-label { color: var(--muted); margin-left: 4px; }
  .quota-widget .quota-upgrade {
    margin-left: 8px; padding: 2px 8px;
    border-radius: 4px;
    background: #22E7F5; color: #0a1722;
    font-weight: 700; font-size: 10px; letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .quota-widget.over .quota-upgrade { background: #ff7a7a; }
  @media (max-width: 720px) {
    .quota-widget .quota-label { display: none; }
  }

  /* Profile widget (top-right of studio header) */
  .profile-wrap { position: relative; }
  .profile-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 10px 4px 4px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    transition: background 120ms, border-color 120ms;
  }
  .profile-btn:hover { background: rgba(34,231,245,0.06); border-color: rgba(34,231,245,0.35); }
  .profile-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    object-fit: cover;
    background: rgba(34,231,245,0.15);
    display: none;
  }
  .profile-avatar[src] { display: block; }
  .profile-initials {
    width: 28px; height: 28px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-default);
    color: #0a1722; font-weight: 700; font-size: 12px;
    text-transform: uppercase;
  }
  .profile-avatar[src] + .profile-initials { display: none; }
  .profile-name {
    max-width: 110px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .profile-menu {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 280px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    padding: 6px;
    z-index: 80;
  }
  .profile-menu[hidden] { display: none; }
  .profile-menu-head {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 10px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
  }
  .profile-menu-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    object-fit: cover; background: rgba(34,231,245,0.15);
    display: none;
  }
  .profile-menu-avatar[src] { display: block; }
  .profile-menu-initials {
    width: 40px; height: 40px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-default);
    color: #0a1722; font-weight: 700; font-size: 16px;
    text-transform: uppercase;
  }
  .profile-menu-avatar[src] + .profile-menu-initials { display: none; }
  .profile-menu-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
  .profile-menu-info strong {
    font-size: 14px; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .profile-menu-info span {
    font-size: 12px; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .profile-menu-row {
    display: block; width: 100%; text-align: left;
    background: transparent; border: 0;
    color: var(--text);
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    transition: background 100ms;
  }
  .profile-menu-row:hover { background: rgba(34,231,245,0.08); }
  .profile-menu-row.danger { color: #ff7a7a; }
  .profile-menu-row.danger:hover { background: rgba(255,122,122,0.10); }
  @media (max-width: 720px) {
    .profile-name { display: none; }
    .profile-menu { width: 260px; }
  }
  .header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
  }
  .notification-wrap {
    position: relative;
  }
  .notification-button {
    width: 38px;
    height: 38px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    display: grid;
    place-items: center;
    cursor: pointer;
    position: relative;
    /* box-shadow removed (Bible §02: depth via bg-color) */
  }
  .notification-button svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
  }
  .notification-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 4px;
    background: var(--accent-2);
    color: #06101d;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
  }
  .notification-count.shown { display: flex; }
  .notification-panel {
    position: absolute;
    right: 0;
    top: 48px;
    width: min(360px, calc(100vw - 32px));
    max-height: 470px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(15, 18, 18, 0.98);
    box-shadow: 0 24px 80px rgba(0,0,0,0.55);
    z-index: 80;
    display: none;
  }
  .notification-panel.open { display: block; }
  .notification-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--border);
  }
  .notification-head strong {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
  }
  .notification-actions {
    display: flex;
    gap: 6px;
  }
  .notification-actions button {
    border: 1px solid var(--border);
    border-radius: 4px;
    background: rgba(255,255,255,0.03);
    color: var(--muted);
    font: inherit;
    font-size: 11px;
    padding: 5px 9px;
    cursor: pointer;
  }
  .notification-actions button:hover {
    color: var(--text);
    border-color: rgba(34, 231, 245,0.55);
  }
  .notification-list {
    max-height: 360px;
    overflow: auto;
    padding: 8px;
  }
  .notification-item {
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px;
    background: rgba(255,255,255,0.025);
    margin-bottom: 6px;
  }
  .notification-item.unread {
    border-color: rgba(34, 231, 245,0.28);
    background: rgba(34, 231, 245,0.075);
  }
  .notification-item strong {
    display: block;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 3px;
  }
  .notification-item p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
  }
  .notification-item small {
    display: block;
    color: rgba(154,166,160,0.72);
    font-size: 11px;
    margin-top: 7px;
  }
  .notification-empty {
    padding: 32px 14px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
  }

  .grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
  }
  @media (max-width: 1200px) {
    .grid { grid-template-columns: 1fr; }
  }

  /* Library / projects grid */
  .library-toolbar {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    margin-bottom: 16px;
  }
  .library-toolbar .filter-btn {
    padding: 8px 14px;
    background: var(--panel-2);
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
  }
  .library-toolbar .filter-btn:hover { color: var(--text); border-color: var(--accent); }
  .library-toolbar .filter-btn.active {
    background: var(--accent); color: #06100d; border-color: var(--accent);
  }
  .library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
  }
  .proj-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    /* box-shadow removed (Bible §02: depth via bg-color) */
    display: flex; flex-direction: column; gap: 10px;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  }
  .proj-card:hover {
    transform: translateY(-2px);
    border-color: rgba(105,207,240,0.35);
  }
  .proj-card .row1 {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  }
  .proj-card h3 {
    margin: 0; font-size: 14px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  }
  .proj-card .kind-badge {
    flex-shrink: 0;
    font-size: 11px; padding: 3px 9px;
    border-radius: 4px; letter-spacing: 0.4px; text-transform: uppercase;
    background: rgba(105,207,240,0.14); color: var(--accent-2);
    font-weight: 600;
  }
  .proj-card .meta {
    color: var(--muted); font-size: 12px;
  }
  .proj-card audio { width: 100%; height: 32px; }
  .proj-card .actions {
    display: flex; gap: 6px; margin-top: 4px;
  }
  .proj-card .iconbtn {
    flex: 1;
    background: var(--panel-2); color: var(--muted);
    border: 1px solid var(--border); border-radius: 8px;
    padding: 7px 8px; font-size: 12px; font-family: inherit;
    cursor: pointer; transition: color 0.12s, border-color 0.12s, background 0.12s;
  }
  .proj-card .iconbtn:hover { color: var(--text); border-color: var(--accent); background: rgba(105,207,240,0.06); }
  .proj-card .iconbtn.danger:hover { color: var(--bad); border-color: rgba(217,122,122,0.5); }
  .scene-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .scene-card .scene-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
  }
  .scene-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
  }
  .prompt-box {
    background: #090b13;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.45;
  }
  .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
  }
  .empty-state .big { font-size: 36px; margin-bottom: 14px; opacity: 0.6; }
  .empty-state h3 { color: var(--text); margin: 0 0 6px; font-size: 16px; font-weight: 600; }
  .empty-state p { margin: 0 0 18px; font-size: 14px; }

  .panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 26px;
    /* box-shadow removed (Bible §02: depth via bg-color) */
    backdrop-filter: blur(18px);
  }
  .panel h2 {
    font-size: clamp(24px, 2.8vw, 38px);
    text-transform: none;
    letter-spacing: 0.2px;
    color: var(--text);
    margin: 0 0 16px 0;
    font-weight: 600;
    line-height: 1.05;
    margin-bottom: 12px;
  }

  label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin: 14px 0 6px 0;
  }
  input[type=text], input[type=number], input[type=datetime-local],
  input[type=date], input[type=time], textarea, select {
    width: 100%;
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border 0.15s, box-shadow 0.15s;
  }
  input[type=datetime-local],
  input[type=date],
  input[type=time] {
    color-scheme: dark;
  }
  input[type=datetime-local]::-webkit-calendar-picker-indicator,
  input[type=date]::-webkit-calendar-picker-indicator,
  input[type=time]::-webkit-calendar-picker-indicator {
    filter: brightness(0) saturate(100%) invert(85%) sepia(16%) saturate(3000%) hue-rotate(148deg) brightness(101%) contrast(93%);
    cursor: pointer;
  }
  input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 231, 245,0.18);
  }
  textarea { resize: vertical; min-height: 80px; }

  .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .make-top-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
  .make-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(34, 231, 245,0.09), rgba(105,207,240,0.06));
  }
  .make-hero h2 {
    color: var(--text);
    font-size: 24px;
    line-height: 1.08;
    text-transform: none;
    letter-spacing: 0;
    margin: 0 0 6px;
  }
  .make-hero p { margin: 0; max-width: 620px; }
  .make-mini-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
  .make-stage {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(244,248,245,0.025);
    margin-top: 12px;
  }
  .make-stage-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
  }
  .make-stage-title strong {
    color: var(--text);
    font-size: 13px;
    letter-spacing: 0.4px;
  }
  .make-stage-title span {
    color: var(--muted);
    font-size: 12px;
  }
  .choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .choice-card {
    border: 1px solid var(--border);
    background: rgba(244,248,245,0.035);
    color: var(--text);
    border-radius: 12px;
    padding: 13px;
    text-align: left;
    cursor: pointer;
    font: inherit;
    min-height: 88px;
    transition: transform 0.15s, border-color 0.15s, background 0.15s;
  }
  .choice-card:hover {
    transform: translateY(-1px);
    border-color: rgba(34, 231, 245,0.55);
    background: rgba(34, 231, 245,0.07);
  }
  .choice-card.active {
    border-color: var(--accent);
    background: rgba(34, 231, 245,0.12);
    box-shadow: inset 0 0 0 1px rgba(34, 231, 245,0.16);
  }
  .choice-card strong { display: block; font-size: 13px; margin-bottom: 5px; }
  .choice-card span { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
  .title-package { display: none; }
  .advanced-box {
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(244,248,245,0.025);
    overflow: hidden;
  }
  .advanced-box summary {
    cursor: pointer;
    padding: 14px 16px;
    color: var(--text);
    font-weight: 600;
    list-style: none;
  }
  .advanced-box summary::-webkit-details-marker { display: none; }
  .advanced-box .advanced-inner {
    padding: 0 16px 16px;
    border-top: 1px solid var(--border);
  }
  .readiness-card {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(34, 231, 245,0.055);
  }
  .readiness-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
  }
  .readiness-score {
    font-size: 28px;
    font-weight: 750;
    color: var(--accent);
  }
  .readiness-items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .readiness-item {
    color: var(--muted);
    font-size: 12px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: rgba(0,0,0,0.12);
  }
  .readiness-item.ok { color: var(--text); border-color: rgba(34, 231, 245,0.35); }
  .readiness-item.miss { color: var(--warn); border-color: rgba(255,184,107,0.25); }
  .make-section {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
  }
  .make-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
  }
  .make-section-title strong {
    color: var(--text);
    font-size: 12px;
    letter-spacing: 0.9px;
    text-transform: uppercase;
  }
  .make-section-title span {
    color: var(--muted);
    font-size: 12px;
  }
  .quality-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }
  .quality-pill {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 7px 10px;
    color: var(--muted);
    background: rgba(244,248,245,0.03);
    font-size: 12px;
  }
  .idea-deck {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
  }
  .idea-card {
    text-align: left;
    background: rgba(244,248,245,0.035);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    color: var(--text);
    cursor: pointer;
  }
  .idea-card:hover {
    border-color: rgba(34, 231, 245,0.65);
    background: rgba(34, 231, 245,0.08);
  }
  .idea-card strong {
    display: block;
    font-size: 13px;
    margin-bottom: 5px;
  }
  .idea-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
  }
  @media (max-width: 1100px) {
    .make-top-grid, .quality-list, .idea-deck, .choice-grid, .readiness-items { grid-template-columns: 1fr; }
    .make-hero { flex-direction: column; }
    .make-mini-actions { justify-content: flex-start; }
  }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    background: var(--brand);
    color: var(--ink);
    border: 1px solid var(--brand);
    border-radius: 0;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: lowercase;
    cursor: pointer;
    width: 100%;
    margin-top: 18px;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 60ms ease;
    transition: transform 0.14s ease, filter 0.14s ease, box-shadow 0.14s ease;
    min-height: 44px;
    box-shadow: 0 14px 34px rgba(34, 231, 245,0.16), inset 0 1px 0 rgba(255,255,255,0.28);
  }
  .btn:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: var(--paper); }
  .btn:active { transform: translateY(1px); }
  .btn:disabled { opacity: 0.55; cursor: not-allowed; }

  .btn.secondary {
    background: transparent;
    border: 1px solid var(--rule-strong);
    color: var(--paper);
    width: auto;
    margin-top: 0;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    text-transform: lowercase;
  }
  .btn.secondary:hover { background: transparent; color: var(--brand); border-color: var(--brand); }

  .status-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }
  .stat {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
  }
  .stat .label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
  .stat .value { font-size: 20px; font-weight: 600; margin-top: 4px; }

  .progress {
    height: 8px;
    background: var(--panel-2);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 16px;
  }
  .progress > div {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.4s ease;
  }

  .title-display {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    min-height: 32px;
  }
  .title-display.empty { color: var(--muted); font-style: italic; font-weight: 400; font-size: 14px; }

  .log {
    background: #090b13;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    font-family: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
    font-size: 13px;
    color: var(--muted);
    height: 220px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.55;
  }
  .log .line { display: block; }
  .log .line .t { color: #4a5170; margin-right: 8px; }
  .log .line.ok { color: var(--good); }
  .log .line.err { color: var(--bad); }

  .script-output {
    margin-top: 22px;
    display: none;
  }
  .script-output.shown { display: block; }
  .script-output textarea {
    height: 360px;
    font-family: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
    font-size: 13px;
    line-height: 1.6;
    background: #090b13;
  }
  .script-actions {
    display: flex; gap: 10px; margin-top: 12px;
    flex-wrap: wrap;
  }

  .hint {
    color: var(--muted);
    font-size: 12px;
    margin-top: 6px;
  }

  .tag {
    display: inline-block;
    padding: 2px 9px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 11px;
    color: var(--muted);
    margin-right: 4px;
    margin-bottom: 4px;
    cursor: pointer;
    user-select: none;
  }
  .tag:hover { border-color: var(--accent); color: var(--text); }
  .tag.active { background: var(--accent); border-color: var(--accent); color: var(--text-primary); }

  .footer {
    margin-top: 36px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
  }

  /* Sidebar nav (was top tabs) */
  .tabs {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 0;
    background: transparent;
    border: 0;
    border-right: 1px solid var(--rule);
    border-radius: 0;
    align-self: start;
    position: sticky;
    top: 24px;
    height: fit-content;
  }
  .tabs .nav-section {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 16px 12px 8px;
    font-weight: 500;
  }
  .tab-btn {
    padding: 10px 12px;
    background: transparent;
    color: var(--muted);
    border: 1px solid transparent;
    border-left: 2px solid transparent;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-sans);
    letter-spacing: -0.01em;
    text-align: left;
    width: 100%;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
  }
  .tab-btn:hover { color: var(--paper); background: var(--brand-faint); }
  .tab-btn.active {
    background: var(--brand-faint);
    border-left-color: var(--brand);
    color: var(--paper);
  }
  /* Anchor scroll offset. when the workflow rail click-to-scrolls to
     a make-stage, leave room for the sticky header + banner above. */
  .make-stage[id] { scroll-margin-top: 80px; }

  /* Install-reminder banner. sticky at the top of the studio when
     /api/launch/readiness reports required blockers (Ollama missing,
     etc). Driven by static/install-banner.js. */
  .install-banner {
    background: var(--brand-faint);
    border-top: 1px solid var(--brand);
    border-bottom: 1px solid var(--brand);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 30;
  }
  .install-banner-inner {
    width: min(1320px, calc(100% - 48px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
  }
  .install-banner-icon {
    width: 24px; height: 24px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand);
    color: var(--ink);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
  }
  .install-banner-msg { flex: 1; min-width: 200px; }
  .install-banner-msg strong {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--paper);
    margin-right: 8px;
    letter-spacing: -0.01em;
  }
  .install-banner-msg span {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-2);
  }
  .install-banner .btn {
    width: auto !important;
    margin-top: 0 !important;
    padding: 8px 14px !important;
    font-size: 12px !important;
    flex-shrink: 0;
  }
  .install-banner-x {
    background: transparent;
    border: 0;
    color: var(--text-2);
    font-size: 24px;
    line-height: 1;
    padding: 4px 10px;
    cursor: pointer;
    flex-shrink: 0;
  }
  .install-banner-x:hover { color: var(--paper); }

  /* Cloud-sync status pill. sits in the studio header. Driven by
     static/sync-status.js polling /api/projects success state. */
  .sync-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: lowercase;
    color: var(--text-2);
    border: 1px solid var(--rule);
    border-radius: 0;
    user-select: none;
  }
  .sync-status .sync-status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--text-3);
    transition: background 200ms ease;
  }
  .sync-status--ok           .sync-status-dot { background: var(--brand); box-shadow: 0 0 8px var(--brand); }
  .sync-status--warn         .sync-status-dot { background: var(--signal); }
  .sync-status--err          .sync-status-dot { background: #ef8b8b; }
  .sync-status--unconfigured .sync-status-dot { background: var(--text-3); }
  .sync-status--unknown      .sync-status-dot { background: var(--text-3); }
  .sync-status--ok           { color: var(--brand); border-color: var(--brand); }
  .sync-status--warn         { color: var(--signal); border-color: var(--signal); }
  .sync-status--err          { color: #ef8b8b; border-color: #ef8b8b; }
  /* Hidden when cloud sync is irrelevant (Capacitor Android shell). */
  .sync-status[hidden] { display: none; }

  .tab-btn .ico {
    display: inline-grid;
    width: 18px;
    text-align: center;
    opacity: 0.7;
    height: 18px;
    align-items: center;
    justify-content: center;
    color: currentColor;
    border-radius: 0;
    place-items: center;
    background: transparent;
  }
  .tab-btn.active .ico { opacity: 1; color: var(--brand); }
  .tab-content { display: none; }
  .tab-content.active { display: block; }

  .dur-btn {
    padding: 9px 14px;
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.12s, border 0.12s, color 0.12s;
  }
  .dur-btn:hover { border-color: var(--accent); }
  .dur-btn.active {
    background: var(--accent);
    border-color: transparent;
    color: var(--text-primary);
  }

  .paste-text {
    min-height: 320px;
    font-family: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
    font-size: 13px;
    line-height: 1.6;
  }

  .toast {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: 13px;
    transform: translateY(20px); opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
  }
  .toast.show { opacity: 1; transform: translateY(0); }
  .toast.bad { border-color: rgba(217,122,122,0.5); }

  /* ===== Channel Insights ===== */
  .insights-panel {
    background: linear-gradient(135deg, rgba(34, 231, 245,0.07), rgba(34, 231, 245,0.04));
    border: 1px solid rgba(34, 231, 245,0.20);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex; flex-direction: column; gap: 10px;
    margin-bottom: 14px;
  }
  .insights-panel .ip-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
  }
  .insights-panel .ip-title {
    font-size: 13px; font-weight: 700; letter-spacing: 0.4px;
    text-transform: uppercase; color: var(--accent, #22E7F5);
    display: inline-flex; align-items: center; gap: 8px;
  }
  .insights-panel .ip-title::before {
    content: ""; width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent, #22E7F5);
    box-shadow: 0 0 10px rgba(34, 231, 245,0.7);
  }
  .insights-panel .ip-status { font-size: 12px; color: var(--muted, #9aa6a0); }
  .insights-panel .ip-empty {
    color: var(--muted, #9aa6a0); font-size: 13px;
  }
  .insights-panel .ip-section { display: flex; flex-direction: column; gap: 4px; }
  .insights-panel .ip-section-label {
    font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
    color: var(--muted, #9aa6a0); font-weight: 600;
  }
  .insights-panel .ip-list { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
  .insights-panel .ip-asset, .insights-panel .ip-gap {
    color: var(--text); padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.05);
    line-height: 1.35;
  }
  .insights-panel .ip-gap {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
  }
  .insights-panel .ip-gap:hover {
    background: rgba(34, 231, 245,0.08);
    border-color: rgba(34, 231, 245,0.3);
  }
  .insights-panel .ip-meta {
    color: var(--muted, #9aa6a0); font-size: 11px; margin-left: 6px;
  }
  .insights-panel .ip-actions { display: flex; gap: 6px; flex-wrap: wrap; }
  .insights-panel .ip-actions button {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
  }
  .insights-panel .ip-actions button:hover {
    background: rgba(34, 231, 245,0.10);
    border-color: rgba(34, 231, 245,0.3);
  }

  /* Title-fit badges on generated title cards */
  .fit-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
  }
  .fit-strong_fit { background: rgba(34, 231, 245,0.18); color: #22E7F5; }
  .fit-good_fit   { background: rgba(34, 231, 245,0.10); color: #aef0d2; }
  .fit-stretch    { background: rgba(105,207,240,0.14); color: var(--accent-2); }
  .fit-neutral    { background: rgba(255,255,255,0.05); color: var(--muted, #9aa6a0); }
  .fit-risky      { background: rgba(217,122,122,0.16); color: #f47c7c; }
  .fit-why {
    display: block;
    font-size: 12px;
    color: var(--muted, #9aa6a0);
    margin-top: 4px;
    font-style: italic;
  }

  /* ===== Optimize Library tab ===== */
  .ip-link {
    background: transparent; border: none; color: var(--accent, #22E7F5);
    font-family: inherit; font-size: inherit; padding: 0; cursor: pointer;
    text-decoration: underline; text-underline-offset: 2px;
  }
  .optimize-toolbar {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    margin-bottom: 10px;
  }
  .optimize-filter-row {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
    margin-bottom: 14px;
  }
  .optimize-search {
    flex: 1; min-width: 180px; max-width: 320px;
    background: var(--panel-2, #1b2021);
    border: 1px solid var(--border, rgba(238,246,241,0.10));
    color: var(--text);
    padding: 8px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
  }
  .optimize-layout {
    display: grid; grid-template-columns: 380px 1fr;
    gap: 16px;
  }
  @media (max-width: 1100px) {
    .optimize-layout { grid-template-columns: 1fr; }
  }
  .optimize-list {
    max-height: 70vh; overflow-y: auto;
    display: flex; flex-direction: column; gap: 8px;
    padding-right: 6px;
  }
  .vid-card {
    background: var(--panel-2, #1b2021);
    border: 1px solid var(--border, rgba(238,246,241,0.10));
    border-radius: 8px;
    padding: 10px;
    display: flex; gap: 10px;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s, transform 0.12s;
  }
  .vid-card:hover {
    border-color: rgba(34, 231, 245,0.30);
    background: rgba(34, 231, 245,0.05);
    transform: translateY(-1px);
  }
  .vid-card.selected {
    border-color: var(--accent, #22E7F5);
    background: rgba(34, 231, 245,0.08);
  }
  .vid-card .thumb {
    width: 96px; height: 54px;
    border-radius: 8px; flex-shrink: 0;
    background: #000; background-size: cover; background-position: center;
  }
  .vid-card .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
  .vid-card .vt {
    color: var(--text); font-size: 13px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    line-height: 1.3;
  }
  .vid-card .vstats { color: var(--muted, #9aa6a0); font-size: 11px; }
  .vid-card .vbadges { display: flex; gap: 4px; }
  .tier-badge {
    font-size: 10px; font-weight: 700; letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 2px 6px; border-radius: 4px;
  }
  .tier-winner { background: rgba(34, 231, 245,0.18); color: #22E7F5; }
  .tier-mid { background: rgba(255,255,255,0.06); color: var(--muted); }
  .tier-underperformer { background: rgba(255,184,107,0.16); color: var(--warn); }

  .optimize-detail {
    background: var(--panel-2, #1b2021);
    border: 1px solid var(--border, rgba(238,246,241,0.10));
    border-radius: 12px;
    padding: 18px;
    min-height: 400px;
  }
  .opt-current {
    display: grid; grid-template-columns: 220px 1fr;
    gap: 14px; margin-bottom: 16px;
  }
  @media (max-width: 720px) { .opt-current { grid-template-columns: 1fr; } }
  .opt-current .opt-thumb {
    width: 100%; aspect-ratio: 16/9; border-radius: 8px;
    background: #000; background-size: cover; background-position: center;
  }
  .opt-current h3 { margin: 0 0 6px; font-size: 16px; line-height: 1.3; }
  .opt-current .opt-stats { color: var(--muted, #9aa6a0); font-size: 12px; margin-bottom: 8px; }
  .opt-current .opt-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
  .opt-current .opt-tags span {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 4px; padding: 2px 8px; font-size: 11px;
    color: var(--muted, #9aa6a0);
  }
  .opt-section { margin-top: 14px; }
  .opt-section .opt-label {
    font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
    color: var(--muted, #9aa6a0); font-weight: 600;
    margin-bottom: 6px;
  }
  .opt-diagnosis {
    background: rgba(34, 231, 245,0.06);
    border: 1px solid rgba(34, 231, 245,0.18);
    border-radius: 8px; padding: 12px 14px;
    color: var(--text); font-size: 14px; line-height: 1.5;
  }
  .opt-diff {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  }
  @media (max-width: 720px) { .opt-diff { grid-template-columns: 1fr; } }
  .opt-diff .col {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px; padding: 10px 12px;
  }
  .opt-diff .col.new {
    border-color: rgba(34, 231, 245,0.25);
    background: rgba(34, 231, 245,0.05);
  }
  .opt-diff .col-label {
    font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase;
    color: var(--muted, #9aa6a0); font-weight: 600; margin-bottom: 6px;
  }
  .opt-diff .col-text { font-size: 13px; color: var(--text); white-space: pre-wrap; line-height: 1.45; }
  .opt-why { color: var(--muted, #9aa6a0); font-size: 12px; margin-top: 6px; font-style: italic; }
  .opt-tag-changes { display: flex; flex-wrap: wrap; gap: 6px; }
  .opt-tag-add, .opt-tag-remove {
    border-radius: 4px; padding: 3px 9px; font-size: 12px; font-weight: 600;
  }
  .opt-tag-add { background: rgba(34, 231, 245,0.16); color: #22E7F5; }
  .opt-tag-remove { background: rgba(217,122,122,0.16); color: #f47c7c; text-decoration: line-through; }
  .opt-risks { color: var(--warn, #ffb86b); }
  .opt-risks li { margin-bottom: 4px; font-size: 13px; }
  .opt-verdict-pill {
    display: inline-block; padding: 4px 10px;
    border-radius: 4px; font-size: 11px;
    font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  }
  .opt-verdict-needs_repackaging { background: rgba(255,184,107,0.18); color: var(--warn); }
  .opt-verdict-drift             { background: rgba(217,122,122,0.16); color: #f47c7c; }
  .opt-verdict-underperformer    { background: rgba(255,184,107,0.16); color: var(--warn); }
  .opt-verdict-healthy           { background: rgba(34, 231, 245,0.18); color: #22E7F5; }

  /* ========== Tier 1-3 polish ========== */

  /* All studio headings use the brand-aligned Geist Sans now.
     The previous rule applied a serif (Iowan Old Style → Palatino →
     Georgia) to every .panel h2 across the studio, which clashed with
     the landing/account/install sites that use Plex everywhere. The
     ux-audit on /app caught this when the Make Video hero h2 read as
     a different brand than the surrounding chrome. */
  .brand h1, .panel h2, .hero-card h2, .recent-strip h3, h1.serif {
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: -0.025em;
  }

.panel h2.eyebrow {
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--muted);
    font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    font-weight: 600;
  }

  /* SVG icons in the sidebar */

.tab-btn .ico svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .tab-btn.active .ico { opacity: 1; color: var(--accent); }

  /* Hover lift. applied universally to interactive surfaces. */
  .panel, .feat, .stat, .proj-card, .hero-choice, .recent-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  }

  /* Asymmetric Long Story layout: form is settings, work area dominates. */
  .grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 22px;
  }
  @media (max-width: 1100px) { .grid { grid-template-columns: 1fr; } }

  /* Idle dashboard inside the right work-area panel */
  .dashboard {
    display: flex; flex-direction: column; gap: 18px;
  }
  .hero-card {
    background: linear-gradient(135deg, rgba(34, 231, 245,0.10), rgba(105,207,240,0.06));
    border: 1px solid rgba(105,207,240,0.22);
    border-radius: 12px;
    padding: 26px 24px;
  }
  .hero-card h2 {
    margin: 0 0 6px;
    font-size: 24px;
    color: var(--text);
    font-weight: 600;
  }
  .hero-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
  }
  .hero-choices {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px;
  }
  @media (max-width: 720px) { .hero-choices { grid-template-columns: 1fr; } }
  .hero-choice {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    text-align: left;
    color: var(--text);
    font-family: inherit;
    display: flex; gap: 12px; align-items: flex-start;
  }
  .hero-choice:hover {
    transform: translateY(-1px);
    border-color: rgba(105,207,240,0.45);
    background: rgba(105,207,240,0.05);
  }
  .hero-choice .hc-ico {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: rgba(105,207,240,0.16);
    color: var(--accent-2);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .hero-choice .hc-ico svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .hero-choice strong { display: block; font-size: 14px; color: var(--text); font-weight: 600; }
  .hero-choice span.hint { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }

  .recent-strip h3 {
    font-size: 14px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin: 6px 0 10px;
    font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-weight: 600;
  }
  .recent-row {
    display: flex; flex-direction: column; gap: 8px;
  }
  .recent-card {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex; align-items: center; gap: 12px;
    cursor: pointer;
  }
  .recent-card:hover {
    transform: translateY(-1px);
    border-color: rgba(105,207,240,0.4);
  }
  .recent-card .rc-meta { flex: 1; min-width: 0; }
  .recent-card .rc-title { color: var(--text); font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .recent-card .rc-sub { color: var(--muted); font-size: 12px; margin-top: 1px; }
  .recent-card .rc-kind {
    flex-shrink: 0;
    font-size: 11px; padding: 3px 8px;
    border-radius: 4px; letter-spacing: 0.3px; text-transform: uppercase;
    background: rgba(105,207,240,0.14); color: var(--accent-2);
    font-weight: 600;
  }

  /* Skeleton shimmer */
  .skeleton {
    position: relative;
    overflow: hidden;
    background: var(--panel-2);
    border-radius: 8px;
  }
  .skeleton::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,248,236,0.06) 50%, transparent 100%);
    animation: shimmer 1.4s infinite;
  }
  @keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
  }
  .skeleton.line-lg { height: 24px; margin-bottom: 12px; width: 70%; }
  .skeleton.line-md { height: 14px; margin-bottom: 10px; width: 100%; }
  .skeleton.line-sm { height: 12px; margin-bottom: 8px; width: 60%; }
  .skeleton.audio-bar { height: 56px; margin-top: 4px; }

  /* Empty-state subtle pulse on the icon */
  .empty-state .big {
    animation: emptyPulse 3.2s ease-in-out infinite;
  }
  @keyframes emptyPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.03); }
  }

  /* Wavesurfer wrapper */
  .wave-wrap {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex; align-items: center; gap: 12px;
  }
  .wave-wrap .wave-play {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: #06100d;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: filter 0.12s, transform 0.06s;
    flex-shrink: 0;
  }
  .wave-wrap .wave-play:hover { filter: brightness(1.08); }
  .wave-wrap .wave-play:active { transform: scale(0.96); }
  .wave-wrap .wave-play svg { width: 14px; height: 14px; fill: currentColor; }
  .wave-wrap .wave-canvas { flex: 1; min-width: 0; }
  .wave-wrap .wave-time {
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    min-width: 40px;
    text-align: right;
  }

  /* Persistent generation tray (bottom-right) */
  .gen-tray {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 320px;
    max-height: 60vh;
    background: var(--panel);
    border: 1px solid rgba(105,207,240,0.25);
    border-radius: 12px;
    /* box-shadow removed (Bible §02: depth via bg-color) */
    z-index: 60;
    overflow: hidden;
    display: none;
    flex-direction: column;
  }
  .gen-tray.shown { display: flex; }
  .gen-tray .gt-head {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
  }
  .gen-tray .gt-head .gt-dot {
    width: 18px; height: 18px;
    border-radius: 0;
    background: url('/static/phantomline-logo.svg') center / contain no-repeat;
    box-shadow: none;
    filter: drop-shadow(0 0 8px rgba(34,231,245,0.65));
    margin-right: 8px;
    animation: emptyPulse 1.6s ease-in-out infinite;
  }
  .gen-tray .gt-head button.gt-close {
    background: transparent; border: none; color: var(--muted);
    cursor: pointer; padding: 4px 6px; border-radius: 8px;
    font-size: 16px; line-height: 1;
  }
  .gen-tray .gt-head button.gt-close:hover { color: var(--text); background: var(--panel-2); }
  .gen-tray .gt-list {
    overflow-y: auto;
    padding: 8px;
    display: flex; flex-direction: column; gap: 6px;
  }
  .gen-tray .gt-item {
    background: var(--panel-2);
    border-radius: 8px;
    padding: 10px 12px;
  }
  .gen-tray .gt-item .gt-row1 {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
  }
  .gen-tray .gt-item .gt-title {
    color: var(--text); font-size: 13px; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    min-width: 0;
  }
  .gen-tray .gt-item .gt-stage {
    color: var(--muted); font-size: 11px;
    flex-shrink: 0; margin-left: 8px;
  }
  .gen-tray .gt-bar {
    height: 4px; background: var(--bg); border-radius: 4px; overflow: hidden;
  }
  .gen-tray .gt-bar > div {
    height: 100%; width: 0%;
    background: var(--accent);
    transition: width 0.4s ease;
  }
  .workflow-grid {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: 22px;
  }
  @media (max-width: 1100px) { .workflow-grid { grid-template-columns: 1fr; } }
  .workflow-steps {
    display: grid;
    gap: 10px;
  }
  .workflow-step {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border);
    border-radius: 12px;
  }
  .workflow-step .num {
    width: 28px; height: 28px;
    border-radius: 4px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,248,236,0.08);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }
  .workflow-step strong { display: block; color: var(--text); font-size: 14px; }
  .workflow-step span { color: var(--muted); font-size: 12px; }
  .workflow-step .state { color: var(--muted); font-size: 12px; }
  .workflow-step.running { border-color: rgba(105,207,240,0.55); }
  .workflow-step.running .num { background: var(--accent-2); color: #06101d; }
  .workflow-step.done .num { background: var(--good); color: #102014; }
  .workflow-step.error .num { background: var(--bad); color: #260b0b; }
  .make-result {
    display: none;
    margin-top: 18px;
    padding: 16px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
  }
  .make-result.shown { display: block; }
  .make-result video { width: 100%; max-height: 420px; background: #000; border-radius: 8px; margin-top: 12px; }

  /* ── Wizard step bar + panels ── */
  .wiz-bar {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 18px 0 8px;
    margin-bottom: 6px;
  }
  .wiz-step {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.15s;
  }
  .wiz-step:hover { background: rgba(255,255,255,0.04); }
  .wiz-num {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    background: rgba(255,255,255,0.06);
    color: var(--muted);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  }
  .wiz-label {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    transition: color 0.2s;
  }
  .wiz-step.active .wiz-num {
    background: var(--accent);
    color: #06101d;
    box-shadow: 0 0 14px rgba(34, 231, 245,0.5);
  }
  .wiz-step.active .wiz-label { color: var(--text); }
  .wiz-step.done .wiz-num {
    background: var(--good);
    color: #102014;
  }
  .wiz-step.done .wiz-label { color: var(--text-2); }
  .wiz-line {
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.08);
    min-width: 12px;
  }
  .wiz-panel {
    display: none;
    animation: wizFadeIn 0.25s ease;
  }
  .wiz-panel.active { display: block; }
  @keyframes wizFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .wiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  .wiz-nav .btn {
    width: auto;
    margin-top: 0;
    min-width: 160px;
    padding: 12px 22px;
  }
  .wiz-nav .btn.secondary {
    min-width: 120px;
  }
  .wiz-render-group {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .wiz-render-group .btn { width: auto; margin-top: 0; }
  .wiz-review {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 8px;
  }
  .wiz-review-item {
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border);
  }
  .wiz-review-item .wiz-rv-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 4px;
  }
  .wiz-review-item .wiz-rv-value {
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  @media (max-width: 600px) {
    .wiz-bar { flex-wrap: wrap; gap: 4px; }
    .wiz-line { display: none; }
    .wiz-review { grid-template-columns: 1fr; }
  }

  /* Make Video premium studio treatment.
     align-items: stretch so left + right panels match each other's
     full height. bottoms line up cleanly instead of one panel ending
     mid-air while the other extends. The right rail is non-sticky
     (see .make-studio-panel below) so the page scrolls as one block. */
  #tab-make .workflow-grid {
    grid-template-columns: minmax(0, 1fr) 410px;
    align-items: stretch;
    gap: 24px;
  }
  #tab-make .panel {
    border-radius: 12px;
    background:
      radial-gradient(circle at 12% 0%, rgba(34, 231, 245,0.08), transparent 34%),
      radial-gradient(circle at 92% 14%, rgba(105,207,240,0.08), transparent 30%),
      var(--panel);
  }
  .make-main-panel {
    position: relative;
    overflow: hidden;
  }
  .make-main-panel:before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255,255,255,0.045), transparent 18%, transparent 82%, rgba(255,255,255,0.025));
    opacity: 0.7;
  }
  .make-main-panel > * { position: relative; z-index: 1; }
  .make-hero {
    padding: 24px;
    border-radius: 12px;
    background:
      linear-gradient(135deg, rgba(34, 231, 245,0.13), rgba(105,207,240,0.07)),
      linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  }
  /* Returning-user mode: hide the marketing-y hero block (eyebrow +
     headline + lede + 5-step rail + brand actions) since the user
     already knows what this tab does. The Load Demo button is
     surfaced in the next-action-card on the right rail instead, so
     they can still kick off a demo from a single click. */
  body.is-returning .make-hero[data-first-run-only] {
    display: none;
  }
  .make-hero h2 {
    font-size: clamp(28px, 4vw, 44px);
    max-width: 720px;
    letter-spacing: 0;
  }
  .make-hero .hint {
    font-size: 14px;
    max-width: 760px;
  }
  .make-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 10px;
  }
  .make-eyebrow:before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 16px rgba(34, 231, 245,0.7);
  }
  .make-trust-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
  }
  .make-trust-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid rgba(34, 231, 245,0.24);
    background: rgba(0,0,0,0.18);
    color: var(--text);
    font-size: 12px;
  }
  .make-mini-actions {
    min-width: 156px;
  }
  .make-stage {
    border-radius: 12px;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012)),
      rgba(244,248,245,0.02);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  }
  .make-stage-title strong {
    font-size: 14px;
  }
  .choice-card {
    border-radius: 12px;
    min-height: 104px;
    position: relative;
    overflow: hidden;
  }
  .choice-card:after {
    content: "";
    position: absolute;
    inset: auto 12px 12px auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.14);
  }
  .choice-card.active {
    box-shadow: 0 12px 38px rgba(0,0,0,0.24), inset 0 0 0 1px rgba(34, 231, 245,0.20);
  }
  .choice-card.active:after {
    background: var(--accent);
    box-shadow: 0 0 16px rgba(34, 231, 245,0.75);
  }
  .choice-card strong {
    font-size: 14px;
  }
  .idea-card {
    border-radius: 12px;
    padding: 14px;
    min-height: 150px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  }
  .idea-card strong {
    font-size: 14px;
  }
  .idea-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
  }
  .idea-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 7px;
    border-radius: 4px;
    background: rgba(34, 231, 245,0.09);
    border: 1px solid rgba(34, 231, 245,0.18);
    color: var(--accent);
    font-size: 10px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    font-weight: 700;
  }
  .make-studio-panel {
    /* Non-sticky. Earlier versions used position: sticky; top: 24px so
       the readiness + next-action stayed visible while scrolling, but
       the trade-off was the rail "ran out" of content before the left
       column did, leaving an empty bottom that looked broken. Now the
       page scrolls as one block; bottoms align via grid stretch on
       the parent. Content inside the rail uses flex column so
       readiness + next-action push to natural positions and the
       panel background fills any leftover height to the shared
       bottom edge. */
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  /* When the studio-preview <details> is open, let it take its natural
     height; when closed, the readiness + next-action cards float to
     the top and the panel background still extends to bottom-align
     with the left column. */
  .make-studio-panel > .studio-preview-collapse { flex: 0 0 auto; }
  .make-studio-panel > .readiness-card,
  .make-studio-panel > .next-action-card { flex: 0 0 auto; }
  .studio-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }
  .studio-head h2 {
    margin: 0;
  }
  .studio-live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
  }
  .studio-live:before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(34, 231, 245,0.8);
  }
  .studio-preview-card {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(0,0,0,0.12));
    padding: 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  }
  .phone-preview {
    position: relative;
    width: min(230px, 72%);
    aspect-ratio: 9 / 16;
    margin: 4px auto 16px;
    border-radius: 22px;
    overflow: hidden;
    background: #0e1418;
    box-shadow: 0 0 0 4px #0e1418, 0 28px 70px rgba(0,0,0,0.45);
  }
  /* Dynamic island */
  .phone-preview::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 14px;
    border-radius: 999px;
    background: #000;
    z-index: 6;
    pointer-events: none;
  }
  .phone-preview-inner {
    position: relative;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
    background:
      radial-gradient(circle at 50% 18%, rgba(105,207,240,0.22), transparent 22%),
      radial-gradient(circle at 20% 52%, rgba(34, 231, 245,0.18), transparent 24%),
      linear-gradient(180deg, #141917 0%, #0b0d0e 56%, #070808 100%);
  }
  .phone-preview-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
  }
  .phone-preview-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    background: #000;
    z-index: 0;
  }
  .phone-preview-inner.has-video:before,
  .phone-preview-inner.has-video .phone-preview-bg,
  .phone-preview-inner.has-video .preview-title,
  .phone-preview-inner.has-video .preview-meta {
    display: none;
  }
  .phone-preview-inner:before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(115deg, transparent 0 38%, rgba(255,255,255,0.08) 39%, transparent 44%),
      repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 12px);
    opacity: 0.55;
  }
  .preview-title {
    position: absolute;
    left: 10px;
    right: 10px;
    top: 14px;
    padding: 7px 9px;
    border-radius: 4px;
    background: rgba(0,0,0,0.48);
    color: var(--text);
    font-size: 10px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-wrap: balance;
  }
  .preview-meta {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 14px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: rgba(255,255,255,0.72);
    font-size: 10px;
    font-weight: 700;
  }
  /* ── Shorts chrome (matches footage cards + hero) ──────────────── */
  .shorts-chrome {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    border-radius: inherit;
    color: #fff;
    font-family: var(--font-sans, system-ui, -apple-system, "Segoe UI", sans-serif);
  }
  .shorts-chrome-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 70px;
    z-index: 3;
    padding: 8px 14px 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
  }
  .shorts-chrome-system { display: inline-flex; align-items: center; gap: 4px; }
  .shorts-chrome-topactions {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
  }
  .shorts-chrome-topactions svg { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }
  .shorts-chrome-rail {
    position: absolute;
    right: 8px;
    bottom: 30px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .shorts-chrome-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  }
  .shorts-chrome-action svg { width: 18px; height: 18px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55)); }
  .shorts-chrome-yt {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
  }
  .shorts-chrome-yt svg { width: 100%; height: 100%; }
  .shorts-chrome-bottom {
    position: absolute;
    inset: auto 56px 14px 12px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  }
  .shorts-chrome-creator {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
  }
  .shorts-chrome-desc {
    font-weight: 450;
    color: rgba(255, 255, 255, 0.92);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .studio-specs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .studio-spec {
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.14);
  }
  .studio-spec span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
  }
  .studio-spec strong {
    display: block;
    color: var(--text);
    font-size: 13px;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .readiness-card {
    background:
      linear-gradient(135deg, rgba(34, 231, 245,0.085), rgba(105,207,240,0.04)),
      rgba(0,0,0,0.10);
  }
  .readiness-score {
    transition: transform 0.18s ease, color 0.18s ease;
  }
  .readiness-score.bump {
    transform: scale(1.08);
  }
  .workflow-steps {
    margin-top: 16px;
  }

.workflow-step.running {
    background: rgba(105,207,240,0.07);
    /* box-shadow removed (Bible §02: depth via bg-color) */
  }
  .workflow-step.done {
    border-color: rgba(118,216,154,0.30);
  }
  .launch-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 820px;
  }
  .launch-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent, #22E7F5);
    color: #000;
    font-size: 13px;
    font-weight: 700;
    margin-right: 8px;
    flex-shrink: 0;
  }
  .launch-final-cta {
    text-align: center;
    padding: 28px 18px;
  }
  .launch-final-cta .btn {
    font-size: 16px;
    padding: 14px 36px;
    width: auto;
  }
  .launch-hero {
    position: relative;
    overflow: hidden;
    padding: 32px;
    border: 1px solid rgba(89,255,210,0.18);
    background:
      radial-gradient(circle at 78% 18%, rgba(89,255,210,0.18), transparent 28%),
      linear-gradient(135deg, rgba(89,255,210,0.11), rgba(105,207,240,0.06) 48%, rgba(255,255,255,0.025));
  }
  .launch-hero h2 {
    font-size: clamp(28px, 3.6vw, 44px);
    line-height: 1.1;
    max-width: 820px;
    margin-bottom: 12px;
    overflow-wrap: normal;
    word-break: keep-all;
    hyphens: none;
  }
  .launch-hero p { max-width: 660px; font-size: 16px; }
  .launch-score-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 28px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(0,0,0,0.24);
  }
  .launch-score {
    font-size: 56px;
    line-height: 1;
    color: var(--accent);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
  }
  .launch-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 22px;
  }
  .launch-actions .btn { width: auto; margin-top: 0; }
  .launch-card {
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.035);
    padding: 18px;
    margin-bottom: 14px;
  }
  .launch-check {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: start;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }
  .launch-check:last-child { border-bottom: 0; }
  .launch-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-top: 5px;
    background: var(--warn);
    box-shadow: 0 0 0 4px rgba(243,201,105,0.10);
  }
  .launch-check.ready .launch-dot {
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(89,255,210,0.12);
  }
  .launch-check.missing .launch-dot {
    background: var(--bad);
    box-shadow: 0 0 0 4px rgba(255,107,107,0.10);
  }
  .launch-status {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
    color: var(--muted);
  }
  /* Per-check action buttons. Render under the hint text only when the
     check is missing/optional and the backend ships an actions array. */
  .launch-check-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
  }
  .launch-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 4px;
    background: rgba(255,255,255,0.03);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
    transition: background 120ms, border-color 120ms, transform 60ms;
  }
  .launch-action:hover {
    background: rgba(34,231,245,0.08);
    border-color: rgba(34,231,245,0.35);
  }
  .launch-action:active { transform: translateY(1px); }
  .launch-action[disabled] {
    opacity: 0.55;
    cursor: progress;
  }
  .launch-action.primary {
    border-color: #22E7F5;
    background: #22E7F5;
    color: #0a1722;
    font-weight: 600;
    padding: 8px 14px;
    /* box-shadow removed (Bible §02: depth via bg-color) */
  }
  .launch-action.primary:hover {
    background: #33c8f0;
    border-color: #33c8f0;
    color: #0a1722;
    transform: translateY(-1px);
  }
  .launch-action.primary .launch-action-icon { opacity: 1; color: #0a1722; }
  .launch-action-icon {
    font-size: 13px;
    line-height: 1;
    opacity: 0.85;
  }
  .launch-demo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .demo-tile {
    text-align: left;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(0,0,0,0.18);
    color: var(--text);
    padding: 16px;
    cursor: pointer;
  }
  .demo-tile:hover { border-color: rgba(89,255,210,0.45); background: rgba(89,255,210,0.07); }
  .demo-tile strong { display: block; margin-bottom: 6px; }
  .launch-tool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
  }
  .launch-tool-grid .btn {
    width: 100%;
    margin-top: 0;
  }
  .launch-test-result {
    margin-top: 16px;
    display: none;
  }
  .phone-preview-wizard {
    max-width: 280px;
    margin: 0 auto;
  }
  .launch-kit-grid,
  .pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .pricing-tier,
  .launch-kit-box {
    border: 1px solid rgba(238,246,241,0.10);
    border-radius: 12px;
    padding: 14px;
    background: rgba(4,7,8,0.24);
  }
  .pricing-tier strong,
  .launch-kit-box strong {
    display: block;
    color: var(--text);
    margin-bottom: 6px;
  }
  .launch-kit-box textarea {
    min-height: 118px;
    resize: vertical;
    margin-top: 8px;
  }
  .next-action-card {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(34, 231, 245,0.24);
    border-radius: 12px;
    background:
      linear-gradient(135deg, rgba(34, 231, 245,0.10), rgba(105,207,240,0.045)),
      rgba(4,7,8,0.30);
  }
  .next-action-card .btn {
    margin-top: 12px;
  }
  /* ── Wizard flow ─────────────────────────────────── */
  .wizard-progress {
    margin-bottom: 8px;
  }
  .wizard-bar {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
  }
  .wizard-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--accent, #22E7F5);
    border-radius: 3px;
    transition: width 400ms ease;
  }
  .wizard-steps-row {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 10px;
  }
  .wizard-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    transition: background 200ms, box-shadow 200ms;
    cursor: default;
  }
  .wizard-dot.active {
    background: var(--accent, #22E7F5);
    box-shadow: 0 0 0 3px rgba(34,231,245,0.25);
  }
  .wizard-dot.done {
    background: var(--good, #59ffd2);
  }
  .wizard-step {
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.035);
    padding: 24px;
    animation: wizFadeIn 250ms ease;
  }
  @keyframes wizFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .wizard-step-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }
  .wizard-step-inner h3 {
    margin: 0 0 4px;
    font-size: 18px;
  }
  .wizard-step-inner .hint {
    margin: 0;
  }
  .wizard-check-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 6px;
    background: rgba(255,255,255,0.03);
    font-size: 14px;
  }
  .wizard-check-status.ready {
    background: rgba(89,255,210,0.08);
    color: var(--good, #59ffd2);
  }
  .wizard-check-status.ready .launch-dot {
    background: var(--good, #59ffd2);
    box-shadow: 0 0 0 4px rgba(89,255,210,0.12);
  }
  .wizard-check-status.missing {
    background: rgba(255,107,107,0.08);
    color: var(--bad, #ff6b6b);
  }
  .wizard-check-status.missing .launch-dot {
    background: var(--bad, #ff6b6b);
    box-shadow: 0 0 0 4px rgba(255,107,107,0.10);
  }
  .wizard-check-actions-area {
    margin-top: 12px;
  }
  .wizard-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  .wizard-actions .btn {
    width: auto;
    margin-top: 0;
  }
  .wizard-actions .btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
  }
  .wizard-actions .secondary {
    background: transparent;
    border-color: rgba(255,255,255,0.15);
    color: var(--muted);
    font-size: 13px;
  }
  .wizard-actions .secondary:hover {
    border-color: rgba(255,255,255,0.30);
    color: var(--text);
  }
  .wizard-done-inner {
    text-align: center;
    padding: 40px 20px;
  }
  .wizard-done-check {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--good, #59ffd2);
    color: #000;
    font-size: 32px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
  }
  .wizard-done-inner h3 {
    font-size: 24px;
    margin: 0 0 8px;
  }
  .wizard-optional-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .wizard-optional-check:last-child { border-bottom: 0; }
  .wizard-optional-check .launch-dot { margin-top: 4px; flex-shrink: 0; }
  .wizard-optional-check strong { display: block; margin-bottom: 2px; }

  @media (max-width: 1100px) {
    .launch-demo-grid { grid-template-columns: 1fr; }
    .launch-kit-grid,
    .pricing-grid { grid-template-columns: 1fr; }
  }
  .publish-shell {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 18px;
  }
  .publish-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-self: start;
    position: sticky;
    top: 24px;
  }
  .publish-nav-label {
    margin: 14px 4px 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }
  .publish-nav-label:first-child { margin-top: 0; }
  .publish-nav button {
    background: transparent;
    color: var(--muted);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: left;
    font: inherit;
    cursor: pointer;
  }
  .publish-nav button.active,
  .publish-nav button:hover {
    color: var(--text);
    background: rgba(244,248,245,0.055);
    border-color: var(--border);
  }
  .publish-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
    gap: 18px;
  }
  .publish-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(244,248,245,0.03);
    padding: 20px;
    margin-bottom: 14px;
  }
  .workflow-rail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 8px;
    margin: 18px 0 0;
  }
  .rail-step {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(238,246,241,0.10);
    border-radius: 12px;
    padding: 8px 9px;
    background: rgba(0,0,0,0.16);
    color: var(--muted);
    min-height: 0;
  }
  .rail-step b {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    margin-bottom: 0;
    flex: 0 0 auto;
    background: rgba(34, 231, 245,0.12);
    color: var(--accent);
    font-size: 12px;
  }
  .rail-step strong {
    display: block;
    color: var(--text);
    font-size: 12px;
    line-height: 1.15;
  }
  .rail-step span { display: none; }
  .insights-panel.compact {
    margin-top: 18px;
    background: rgba(0,0,0,0.14);
  }
  .handoff-card {
    margin-top: 14px;
    border: 1px solid rgba(34, 231, 245,0.24);
    border-radius: 12px;
    padding: 14px;
    background:
      linear-gradient(135deg, rgba(34, 231, 245,0.10), rgba(105,207,240,0.055)),
      rgba(0,0,0,0.16);
  }
  .handoff-card strong { display:block; color: var(--text); margin-bottom: 6px; }
  .handoff-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top: 12px; }
  .readiness-checklist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }
  .check-chip {
    border: 1px solid rgba(238,246,241,0.10);
    border-radius: 12px;
    padding: 8px 10px;
    background: rgba(0,0,0,0.14);
    color: var(--muted);
    font-size: 12px;
  }
  .check-chip.ok {
    color: var(--text);
    border-color: rgba(34, 231, 245,0.32);
    background: rgba(34, 231, 245,0.06);
  }
  .advanced-banner {
    border: 1px solid rgba(105,207,240,0.18);
    border-radius: 12px;
    padding: 12px 14px;
    margin: 0 0 18px;
    background: rgba(105,207,240,0.055);
    color: var(--muted);
  }
  .advanced-banner strong {
    color: var(--text);
    display: block;
    margin-bottom: 4px;
  }
  .settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .settings-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(244,248,245,0.03);
    padding: 18px;
  }
  .publish-phone {
    position: relative;
    width: min(230px, 72%);
    aspect-ratio: 9 / 16;
    margin: 4px auto 16px;
    border-radius: 22px;
    overflow: hidden;
    background: #0e1418;
    box-shadow: 0 0 0 4px #0e1418, 0 14px 32px rgba(0, 0, 0, 0.55);
  }
  .publish-phone::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 14px;
    border-radius: 999px;
    background: #000;
    z-index: 6;
    pointer-events: none;
  }
  .publish-preview {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: inherit;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .publish-preview video { width: 100%; height: 100%; object-fit: cover; }
  .publish-preview .empty { color: var(--muted); font-size: 13px; }
  .publish-pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
  .publish-pill {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 6px 9px;
    color: var(--muted);
    background: rgba(0,0,0,0.14);
    font-size: 12px;
  }
  .thumb-chip {
    border: 1px solid #1f3447;
    border-radius: 4px;
    padding: 5px 11px;
    background: rgba(34, 231, 245,0.05);
    color: #cdd6df;
    font-size: 11px;
    cursor: pointer;
    transition: background 120ms, border-color 120ms, transform 60ms;
  }
  .thumb-chip:hover {
    background: rgba(34, 231, 245,0.18);
    border-color: #22E7F5;
    color: var(--text-primary);
  }
  .thumb-chip.active {
    background: #22E7F5;
    color: #0a1722;
    border-color: #22E7F5;
    font-weight: 600;
  }
  .publish-list {
    display: grid;
    gap: 10px;
  }
  .publish-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: rgba(0,0,0,0.12);
  }
  .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
  }
  .calendar-day {
    min-height: 92px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    background: rgba(0,0,0,0.12);
    color: var(--muted);
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, transform 60ms ease;
  }
  .calendar-day:hover {
    background: rgba(34, 231, 245, 0.08);
    border-color: rgba(34, 231, 245, 0.45);
  }
  .calendar-day:active {
    transform: translateY(1px);
  }
  .calendar-day:focus-visible {
    outline: 2px solid var(--accent, #22E7F5);
    outline-offset: 2px;
  }
  .calendar-past {
    opacity: 0.55;
  }
  .calendar-past:hover {
    background: rgba(244, 67, 67, 0.08);
    border-color: rgba(244, 67, 67, 0.3);
  }
  .calendar-today {
    border-color: var(--accent, #22E7F5);
    background: rgba(34, 231, 245, 0.06);
  }
  .calendar-today strong {
    color: var(--accent, #22E7F5);
  }
  .calendar-dot {
    margin-top: 6px;
    padding: 5px 6px;
    border-radius: 8px;
    background: rgba(34, 231, 245,0.12);
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
  }
  .calendar-dot-posted { background: rgba(40, 200, 110, 0.18); }
  .calendar-dot-failed { background: rgba(244, 67, 67, 0.18); }
  @media (max-width: 1100px) {
    #tab-make .workflow-grid { grid-template-columns: 1fr; }
    .make-studio-panel { position: static; }
    .publish-shell, .publish-grid { grid-template-columns: 1fr; }
    .publish-nav { position: static; flex-direction: row; flex-wrap: wrap; }
    .publish-nav-label { width: 100%; margin-top: 10px; }
    .workflow-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }

  /* ===== Ghostline Studio Polish: app-wide premium shell ===== */
  body {
    background:
      radial-gradient(circle at 15% -4%, rgba(34, 231, 245,0.14), transparent 34%),
      radial-gradient(circle at 84% 2%, rgba(105,207,240,0.10), transparent 28%),
      linear-gradient(135deg, #070a0b 0%, #0f1515 54%, #0b1015 100%) fixed;
  }
  body:before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
      linear-gradient(rgba(244,248,245,0.024) 1px, transparent 1px),
      linear-gradient(90deg, rgba(244,248,245,0.018) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.82), transparent 78%);
    z-index: -1;
  }
  .wrap {
    max-width: 1460px;
    grid-template-columns: 280px minmax(0, 1fr);
    column-gap: 32px;
  }
  header {
    position: sticky;
    top: 12px;
    z-index: 70;
    padding: 10px 12px;
    border: 1px solid rgba(238,246,241,0.10);
    border-radius: 12px;
    background: rgba(7,10,11,0.62);
    backdrop-filter: blur(18px);
    /* box-shadow removed (Bible §02: depth via bg-color) */
  }
  .brand h1 {
    font-size: 16px;
    letter-spacing: 0;
  }
  .brand small {
    display: block;
    margin: 2px 0 0;
    font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 11px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
  }
  .brand .brand-logo {
    height: 60px;
    width: auto;
    max-width: 220px;
    filter: drop-shadow(0 0 18px rgba(34, 231, 245,0.5));
  }
  .ollama-badge,
  .notification-button {
    background: rgba(15, 19, 20, 0.72);
    backdrop-filter: blur(18px);
    border-color: rgba(238,246,241,0.12);
    /* box-shadow removed (Bible §02: depth via bg-color) */
  }
  .tabs {
    position: sticky;
    top: 100px;
    min-height: calc(100vh - 128px);
    padding: 18px;
    border-radius: 12px;
    background:
      linear-gradient(180deg, rgba(244,248,245,0.052), rgba(244,248,245,0.018)),
      rgba(9, 12, 13, 0.62);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(238,246,241,0.12);
    box-shadow: 0 28px 90px rgba(0,0,0,0.30), inset 0 1px 0 rgba(255,255,255,0.055);
  }
  .tabs .nav-section {
    margin: 10px 10px 6px;
    color: rgba(154,166,160,0.85);
    font-size: 11px;
    letter-spacing: 1.6px;
  }

.tab-btn:hover {
    transform: translateX(2px);
    color: var(--text);
    background: rgba(244,248,245,0.055);
    border-color: rgba(238,246,241,0.10);
  }
  .tab-btn.active {
    border-left-color: transparent;
    border-color: rgba(34, 231, 245,0.72);
    background:
      linear-gradient(135deg, rgba(34, 231, 245,0.16), rgba(105,207,240,0.10)),
      rgba(244,248,245,0.035);
    box-shadow: 0 0 0 1px rgba(34, 231, 245,0.16), inset 0 1px 0 rgba(255,255,255,0.06);
  }

.tab-btn.active .ico {
    color: var(--accent);
    background: rgba(34, 231, 245,0.12);
    /* box-shadow removed (Bible §02: depth via bg-color) */
  }
  .tabs:not(.show-advanced) .secondary-nav {
    display: none;
  }
  .nav-toggle {
    margin-top: 8px;
  }
  .nav-toggle .chev {
    margin-left: auto;
    font-size: 14px;
    color: var(--muted);
    transition: transform 0.16s ease;
  }
  .tabs.show-advanced .nav-toggle .chev {
    transform: rotate(180deg);
  }
  .tab-content.active {
    animation: studioFadeIn 0.22s ease-out;
  }
  @keyframes studioFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .panel,
  .make-stage,
  .publish-card,
  .optimize-detail,
  .insights-panel,
  .proj-card,
  .scene-card,
  .make-result,
  .notification-panel {
    border: 1px solid rgba(238,246,241,0.12);
    background:
      linear-gradient(180deg, rgba(244,248,245,0.052), rgba(244,248,245,0.018)),
      rgba(15, 19, 20, 0.70);
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 80px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.045);
  }

.panel h2,
  .make-section-title strong,
  .make-stage-title strong {
    color: var(--text);
  }

.hint {
    color: rgba(154,166,160,0.92);
  }
  input,
  textarea,
  select {
    border-radius: 12px;
    border-color: rgba(238,246,241,0.12);
    background: rgba(4, 7, 8, 0.56);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  }
  input:hover,
  textarea:hover,
  select:hover {
    border-color: rgba(105,207,240,0.28);
  }
  input:focus,
  textarea:focus,
  select:focus {
    border-color: rgba(34, 231, 245,0.78);
    box-shadow: 0 0 0 4px rgba(34, 231, 245,0.13), inset 0 1px 0 rgba(255,255,255,0.045);
  }

.btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 18px 44px rgba(34, 231, 245,0.20), inset 0 1px 0 rgba(255,255,255,0.32);
  }
  .btn.secondary {
    background: rgba(244,248,245,0.045);
    color: var(--text);
    border-color: rgba(238,246,241,0.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.045);
  }
  .btn.secondary:hover {
    background: rgba(105,207,240,0.10);
    border-color: rgba(105,207,240,0.30);
  }
  .make-hero {
    position: relative;
    overflow: hidden;
    background:
      radial-gradient(circle at 72% 12%, rgba(105,207,240,0.18), transparent 30%),
      radial-gradient(circle at 18% 0%, rgba(34, 231, 245,0.16), transparent 28%),
      linear-gradient(135deg, rgba(34, 231, 245,0.11), rgba(105,207,240,0.075)),
      rgba(4,7,8,0.20);
  }
  .make-hero:after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(115deg, transparent 0 42%, rgba(255,255,255,0.06) 43%, transparent 49%),
      repeating-linear-gradient(180deg, rgba(255,255,255,0.026) 0 1px, transparent 1px 18px);
    opacity: 0.42;
    pointer-events: none;
  }
  .make-hero h2 {
    font-size: clamp(34px, 4.2vw, 54px);
    line-height: 0.98;
    max-width: 640px;
  }
  .make-trust-pill,
  .publish-pill,
  .fit-badge,
  .idea-badge {
    border-color: rgba(34, 231, 245,0.20);
    background: rgba(34, 231, 245,0.075);
  }
  .choice-card,
  .idea-card,
  .title-card,
  .publish-item,
  .calendar-day,
  .workflow-step,
  .vid-card,
  .recent-card,
  .hero-choice,
  .quality-item,
  .readiness-item {
    border-color: rgba(238,246,241,0.11);
    background:
      linear-gradient(180deg, rgba(244,248,245,0.034), rgba(244,248,245,0.012)),
      rgba(4,7,8,0.24);
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
  }
  .choice-card:hover,
  .idea-card:hover,
  .title-card:hover,
  .publish-item:hover,
  .calendar-day:hover,
  .vid-card:hover,
  .recent-card:hover,
  .hero-choice:hover {
    transform: translateY(-2px);
    border-color: rgba(34, 231, 245,0.42);
    background: rgba(34, 231, 245,0.055);
    /* box-shadow removed (Bible §02: depth via bg-color) */
  }
  .choice-card.active,
  .idea-card.selected,
  .title-card.selected,
  .vid-card.selected {
    border-color: rgba(34, 231, 245,0.82);
    background:
      linear-gradient(135deg, rgba(34, 231, 245,0.15), rgba(105,207,240,0.085)),
      rgba(4,7,8,0.22);
    box-shadow: 0 20px 54px rgba(0,0,0,0.24), 0 0 0 1px rgba(34, 231, 245,0.16);
  }
  .readiness-card {
    border-radius: 12px;
    border-color: rgba(34, 231, 245,0.20);
    background:
      radial-gradient(circle at 90% 12%, rgba(105,207,240,0.16), transparent 30%),
      linear-gradient(135deg, rgba(34, 231, 245,0.12), rgba(34, 231, 245,0.035)),
      rgba(4,7,8,0.24);
  }
  .readiness-score {
    color: var(--accent);
    text-shadow: 0 0 28px rgba(34, 231, 245,0.24);
  }
  .phone-preview {
    border-radius: 22px;
    border: 0;
    background: #0e1418;
    box-shadow: 0 0 0 4px #0e1418, 0 34px 95px rgba(0,0,0,0.52), -16px 0 70px rgba(34, 231, 245,0.14);
  }
  .phone-preview-inner {
    border-radius: inherit;
    background:
      linear-gradient(180deg, rgba(34, 231, 245,0.10), transparent 34%),
      radial-gradient(circle at 72% 18%, rgba(105,207,240,0.18), transparent 24%),
      #060808;
  }
  .publish-shell {
    gap: 22px;
  }
  .publish-nav {
    padding: 12px;
    border-radius: 12px;
    background: rgba(4,7,8,0.34);
    border: 1px solid rgba(238,246,241,0.10);
    top: 100px;
  }
  .publish-nav-label {
    margin: 14px 4px 4px;
    color: rgba(180,194,187,0.72);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }
  .publish-nav-label:first-child { margin-top: 0; }
  .publish-nav button {
    border-radius: 12px;
    font-weight: 760;
  }
  .publish-nav button.active {
    color: var(--text);
    border-color: rgba(34, 231, 245,0.62);
    background: var(--accent-muted);
  }

.publish-phone {
    border-radius: 22px;
    border: 0;
    background: #0e1418;
    box-shadow: 0 0 0 4px #0e1418, 0 34px 95px rgba(0,0,0,0.52), -16px 0 70px rgba(34, 231, 245,0.14);
  }
  .calendar-dot {
    background: var(--accent-default);
    border: 1px solid rgba(34, 231, 245,0.16);
  }
  .status-grid .stat,
  .stat {
    border-radius: 12px;
    background:
      linear-gradient(180deg, rgba(244,248,245,0.035), rgba(244,248,245,0.012)),
      rgba(4,7,8,0.24);
    border: 1px solid rgba(238,246,241,0.11);
  }
  .stat .value {
    color: var(--accent);
    text-shadow: 0 0 22px rgba(34, 231, 245,0.18);
  }
  .progress,
  .gt-bar,
  .bar {
    background: rgba(4,7,8,0.68);
  }
  .progress-fill,
  .gen-tray .gt-bar > div,
  .bar i,
  .meter i {
    background: linear-gradient(90deg, var(--accent), var(--cyan), var(--accent-2));
  }
  .toast {
    border-radius: 12px;
    background:
      linear-gradient(180deg, rgba(244,248,245,0.06), rgba(244,248,245,0.018)),
      rgba(9,12,13,0.88);
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 80px rgba(0,0,0,0.42);
  }
  .gen-tray {
    border-color: rgba(105,207,240,0.22);
    background:
      linear-gradient(180deg, rgba(244,248,245,0.055), rgba(244,248,245,0.018)),
      rgba(9,12,13,0.88);
    backdrop-filter: blur(18px);
  }

  /* Final contrast pass: keep every app button readable after all theme overrides. */
  .btn,
  a.btn,
  button.btn {
    background:
      linear-gradient(135deg, rgba(34, 231, 245,0.24), rgba(34, 231, 245,0.18)),
      rgba(10, 18, 18, 0.92) !important;
    color: #f4f8f5 !important;
    border-color: rgba(34, 231, 245,0.36) !important;
    text-shadow: 0 1px 1px rgba(0,0,0,0.55) !important;
  }
  .btn.secondary,
  a.btn.secondary,
  button.btn.secondary {
    background: rgba(244,248,245,0.075) !important;
    color: #f4f8f5 !important;
    border-color: rgba(238,246,241,0.20) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.055) !important;
  }
  .btn.secondary:hover,
  a.btn.secondary:hover,
  button.btn.secondary:hover {
    background: rgba(34, 231, 245,0.12) !important;
    color: var(--text-primary) !important;
    border-color: rgba(34, 231, 245,0.44) !important;
  }
  .btn:disabled,
  a.btn:disabled,
  button.btn:disabled {
    opacity: 0.82 !important;
    color: rgba(244,248,245,0.92) !important;
    background:
      linear-gradient(135deg, rgba(34, 231, 245,0.12), rgba(34, 231, 245,0.09)),
      rgba(12, 18, 18, 0.88) !important;
    border-color: rgba(238,246,241,0.18) !important;
    cursor: not-allowed;
  }
  /* Prerequisite-locked buttons (data-blocked-reason) look clearly muted,
     not busy — cursor:not-allowed, not wait. */
  button.btn[data-blocked-reason]:disabled,
  a.btn[data-blocked-reason]:disabled {
    opacity: 0.38 !important;
    background: rgba(244,248,245,0.04) !important;
    border-color: rgba(238,246,241,0.12) !important;
    cursor: not-allowed !important;
  }
  .tab-btn,
  .filter-btn,
  .dur-btn,
  .publish-pill,
  .iconbtn,
  .notification-actions button,
  .publish-nav button {
    color: #dbe7e1;
  }
  .tab-btn.active,
  .filter-btn.active,
  .dur-btn.active,
  .publish-nav button.active {
    color: var(--text-primary);
  }
  @media (max-width: 1100px) {
    .wrap {
      grid-template-columns: 1fr;
    }
    header,
    .tabs {
      position: static;
    }
    .tabs {
      min-height: 0;
    }
  }
  @media (max-width: 720px) {
    .wrap {
      padding: 14px 14px 48px;
      row-gap: 16px;
    }
    header {
      align-items: flex-start;
      gap: 12px;
      flex-direction: column;
    }
    .header-actions {
      width: 100%;
      justify-content: space-between;
    }
    .brand small {
      display: none;
    }
    .tabs {
      padding: 12px;
      border-radius: 12px;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    .tabs .nav-section {
      grid-column: 1 / -1;
      margin: 8px 6px 2px;
    }
    .tab-btn {
      min-height: 44px;
      padding: 10px;
      font-size: 13px;
    }
    .tab-btn .ico {
      width: 24px;
      height: 24px;
      border-radius: 8px;
    }
    .panel {
      padding: 18px;
      border-radius: 12px;
    }
    .make-hero h2 {
      font-size: clamp(32px, 11vw, 44px);
    }
    .workflow-rail {
      grid-template-columns: 1fr;
    }
    .readiness-checklist,
    .settings-grid {
      grid-template-columns: 1fr;
    }
  }

  /* ---- Simple mode: hide advanced tools when user opts in ---- */
  /* Simple mode is now driven by toggling .tabs.show-advanced in JS. The
     existing `.tabs:not(.show-advanced) .secondary-nav { display: none }`
     rule above handles visibility, and the "Advanced Tools" toggle button
     can override on demand. We intentionally do NOT hide secondary-nav via
     a body.simple-mode !important rule. that would prevent the toggle
     from ever revealing the panel. */

  /* ---- Toggle row used in Settings ---- */
  .toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 10px 0 0;
    cursor: pointer;
    line-height: 1.45;
  }
  .toggle-row input[type="checkbox"] {
    flex: 0 0 auto;
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: var(--accent, #22E7F5);
  }
  .toggle-row span { color: var(--text); font-size: 14px; }
  .toggle-row span strong { color: var(--text); margin-right: 4px; }

  /* ---- Disabled-button "why blocked" tooltip ---- */
  [data-blocked-reason] { position: relative; }
  [data-blocked-reason][disabled]::after,
  [data-blocked-reason][aria-disabled="true"]::after {
    content: attr(data-blocked-reason);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    background: rgba(15,19,20,0.97);
    color: #f4f8f5;
    border: 1px solid rgba(238,246,241,0.18);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
    max-width: 320px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease;
    z-index: 200;
    box-shadow: 0 14px 32px rgba(0,0,0,0.4);
  }
  [data-blocked-reason][disabled]:hover::after,
  [data-blocked-reason][aria-disabled="true"]:hover::after,
  [data-blocked-reason][disabled]:focus-visible::after { opacity: 1; }

  /* ---- Floating feedback widget ---- */
  .gh-feedback-fab {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 9000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid rgba(34, 231, 245,0.32);
    border-radius: 4px;
    background: var(--bg-surface-2);
    color: #f4f8f5;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    /* box-shadow removed (Bible §02: depth via bg-color) */
    transition: transform 0.12s ease, box-shadow 0.12s ease;
  }
  .gh-feedback-fab:hover { transform: translateY(-1px); box-shadow: 0 22px 48px rgba(0,0,0,0.5), 0 0 32px rgba(34, 231, 245,0.18); }
  .gh-feedback-fab svg { width: 16px; height: 16px; }
  .gh-feedback-modal {
    position: fixed; inset: 0; z-index: 9001;
    display: none;
    align-items: center; justify-content: center;
    background: rgba(4,7,8,0.62);
    backdrop-filter: blur(6px);
  }
  .gh-feedback-modal.shown { display: flex; }
  .gh-feedback-card {
    width: min(480px, 92vw);
    background: rgba(15,19,20,0.98);
    border: 1px solid rgba(238,246,241,0.14);
    border-radius: 12px;
    padding: 22px;
    /* box-shadow removed (Bible §02: depth via bg-color) */
  }
  .gh-feedback-card h3 { margin: 0 0 6px; font-size: 16px; }
  .gh-feedback-card p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
  .gh-feedback-card textarea { width: 100%; min-height: 110px; resize: vertical; }
  .gh-feedback-card .row { gap: 10px; margin-top: 12px; }
  .gh-feedback-card .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

  /* ---- Onboarding overlay ---- */
  .ob-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: var(--bg-base);
    display: flex; align-items: center; justify-content: center;
    overflow-y: auto;
  }
  .ob-overlay[hidden] { display: none; }
  .ob-container {
    width: 100%; max-width: 640px;
    padding: 48px 24px 64px;
    position: relative;
  }
  .ob-progress {
    position: fixed; top: 0; left: 0; right: 0;
    height: 3px; background: var(--bg-surface-2); z-index: 10001;
  }
  .ob-progress-fill {
    height: 100%; background: var(--accent-default);
    width: 0%; transition: width var(--motion-slow) var(--ease-out);
  }
  .ob-screen { display: none; }
  .ob-screen.active { display: block; animation: obFadeIn var(--motion-base) var(--ease-out); }
  @keyframes obFadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
  .ob-eyebrow {
    font-family: var(--font-mono);
    font-size: var(--text-label);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-accent);
    margin-bottom: var(--space-5);
    display: inline-flex; align-items: center; gap: 10px;
  }
  .ob-eyebrow::before {
    content: ""; width: 24px; height: 1px; background: var(--accent-default);
  }
  .ob-heading {
    font-family: var(--font-sans);
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    margin: 0 0 var(--space-3) 0;
  }
  .ob-subtext {
    font-size: var(--text-body);
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0 0 var(--space-7) 0;
  }
  .ob-back {
    background: none; border: none; color: var(--text-muted);
    font-family: var(--font-mono); font-size: var(--text-caption);
    letter-spacing: 0.02em; cursor: pointer;
    padding: 0; margin-bottom: var(--space-6);
    display: inline-block;
    transition: color var(--motion-fast);
  }
  .ob-back:hover { color: var(--text-primary); }

  /* Intent cards */
  .ob-cards {
    display: flex; flex-direction: column; gap: var(--space-3);
  }
  .ob-card {
    display: flex; align-items: flex-start; gap: var(--space-4);
    padding: var(--space-5);
    background: var(--bg-surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer; text-align: left;
    transition: border-color var(--motion-fast), background var(--motion-fast);
    color: var(--text-primary);
    font-family: var(--font-sans);
  }
  .ob-card:hover, .ob-card:focus-visible {
    border-color: var(--accent-default);
    background: var(--bg-surface-2);
  }
  .ob-card-icon {
    width: 28px; height: 28px; flex-shrink: 0;
    color: var(--accent-default);
    margin-top: 2px;
  }
  .ob-card-title {
    display: block; font-size: var(--text-body);
    font-weight: 600; margin-bottom: 4px;
  }
  .ob-card-desc {
    display: block; font-size: var(--text-body-sm);
    color: var(--text-secondary);
  }

  /* Connect YouTube */
  .ob-connect-area { margin-bottom: var(--space-6); }
  .ob-cta {
    display: inline-flex; align-items: center; gap: var(--space-2);
    min-height: 48px; padding: 0 var(--space-5);
    background: var(--accent-default); color: var(--text-on-accent);
    font-family: var(--font-mono); font-size: var(--text-caption);
    font-weight: 600; letter-spacing: 0.02em; text-transform: lowercase;
    border: 1px solid var(--accent-default); border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--motion-fast), border-color var(--motion-fast);
  }
  .ob-cta:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
  .ob-cta:disabled { opacity: 0.5; cursor: not-allowed; }
  .ob-cta-icon { width: 20px; height: 20px; }
  .ob-cta-next { margin-top: var(--space-4); }
  .ob-skip {
    display: block; background: none; border: none;
    color: var(--text-muted); font-family: var(--font-mono);
    font-size: var(--text-label); letter-spacing: 0.02em;
    cursor: pointer; padding: 0;
    margin-top: var(--space-5);
    text-decoration: underline; text-underline-offset: 3px;
    transition: color var(--motion-fast);
  }
  .ob-skip:hover { color: var(--text-secondary); }
  .ob-connect-status { margin-top: var(--space-5); }
  .ob-channel-card {
    display: flex; align-items: center; gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-surface-2);
    border: 1px solid var(--success);
    border-radius: var(--radius-md);
  }
  .ob-channel-avatar {
    width: 48px; height: 48px; border-radius: var(--radius-sm);
    object-fit: cover; background: var(--bg-surface-3);
  }
  .ob-channel-card strong {
    display: block; font-size: var(--text-body);
    color: var(--text-primary);
  }
  .ob-channel-subs {
    font-size: var(--text-body-sm); color: var(--text-secondary);
  }

  /* Niche grid */
  .ob-niche-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-5);
  }
  .ob-niche-card {
    display: flex; flex-direction: column; align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-3);
    background: var(--bg-surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer; text-align: center;
    font-family: var(--font-sans); font-size: var(--text-body-sm);
    font-weight: 500; color: var(--text-primary);
    transition: border-color var(--motion-fast), background var(--motion-fast);
  }
  .ob-niche-card:hover, .ob-niche-card:focus-visible {
    border-color: var(--accent-default);
    background: var(--bg-surface-2);
  }
  .ob-niche-card.selected {
    border-color: var(--accent-default);
    background: var(--accent-muted);
  }
  .ob-niche-emoji { font-size: 24px; }
  .ob-custom-niche {
    display: flex; gap: var(--space-3); align-items: center;
    margin-top: var(--space-3);
  }
  .ob-custom-niche[hidden] { display: none; }
  .ob-niche-input, .ob-topic-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-surface-1);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans); font-size: var(--text-body);
    line-height: 1.5; resize: vertical;
    transition: border-color var(--motion-fast);
  }
  .ob-niche-input:focus, .ob-topic-input:focus {
    outline: none; border-color: var(--border-focus);
  }
  .ob-niche-input { flex: 1; }

  /* Topic card */
  .ob-preview-area { margin-bottom: var(--space-6); }
  .ob-topic-card {
    padding: var(--space-5);
    background: var(--bg-surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
  }
  .ob-topic-label {
    display: block; font-family: var(--font-mono);
    font-size: var(--text-label); letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--text-muted);
    margin-bottom: var(--space-2);
  }
  .ob-niche-row { margin-top: var(--space-4); }
  .ob-niche-row .ob-topic-label { margin-bottom: var(--space-2); }

  /* Generating screen */
  .ob-gen-progress { margin: var(--space-7) 0; }
  .ob-gen-steps {
    display: flex; flex-direction: column; gap: var(--space-4);
  }
  .ob-gen-step {
    display: flex; align-items: center; gap: var(--space-3);
    font-family: var(--font-sans); font-size: var(--text-body);
    color: var(--text-muted);
    transition: color var(--motion-fast);
  }
  .ob-gen-step.active { color: var(--text-primary); }
  .ob-gen-step.done { color: var(--success); }
  .ob-gen-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--bg-surface-3);
    flex-shrink: 0;
    transition: background var(--motion-fast);
  }
  .ob-gen-step.active .ob-gen-dot {
    background: var(--accent-default);
    animation: obPulse 1.2s ease-in-out infinite;
  }
  .ob-gen-step.done .ob-gen-dot { background: var(--success); }
  @keyframes obPulse {
    0%, 100% { opacity: 1; } 50% { opacity: 0.4; }
  }
  .ob-gen-status {
    margin-top: var(--space-5);
    font-family: var(--font-mono); font-size: var(--text-caption);
    color: var(--text-muted); letter-spacing: 0.02em;
  }
  .ob-generating-heading {
    background: linear-gradient(90deg, var(--text-primary) 0%, var(--accent-default) 50%, var(--text-primary) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: obShimmer 2.5s linear infinite;
  }
  @keyframes obShimmer { to { background-position: -200% center; } }

  /* Showcase layout (phone + info side by side) */
  .ob-showcase-layout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-7);
    align-items: center;
  }

  /* Phone frame */
  .ob-phone-wrap { justify-self: center; }
  .ob-phone-frame {
    aspect-ratio: 9 / 16;
    width: 240px;
    background: var(--bg-base);
    border: 1px solid var(--border-default);
    border-radius: 22px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 0 5px #0e1418, 0 20px 50px rgba(0, 0, 0, 0.5);
    color: #fff;
    font-family: var(--font-sans);
  }
  .ob-phone-frame::before {
    content: "";
    position: absolute;
    top: 7px; left: 50%; transform: translateX(-50%);
    width: 50px; height: 14px;
    border-radius: 999px;
    background: #000; z-index: 5;
    pointer-events: none;
  }
  .ob-phone-video {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    border-radius: inherit;
    background: var(--bg-surface-2);
  }
  .ob-phone-top {
    position: absolute;
    inset: 0 60px auto 0; z-index: 2;
    padding: 8px 12px;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11px; font-weight: 600;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0));
    pointer-events: none;
  }
  .ob-phone-system {
    display: inline-flex; align-items: center; gap: 4px;
  }
  .ob-phone-topactions {
    position: absolute; top: 10px; right: 12px; z-index: 3;
    display: flex; align-items: center; gap: 10px;
    color: #fff; pointer-events: none;
  }
  .ob-phone-topactions svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }
  .ob-phone-rail {
    position: absolute; right: 8px; bottom: 30px; z-index: 2;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    pointer-events: none;
  }
  .ob-phone-action {
    display: flex; flex-direction: column; align-items: center; gap: 0;
    font-size: 9px; font-weight: 600; line-height: 1.1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.55);
  }
  .ob-phone-action svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.55)); }
  .ob-phone-yt {
    width: 22px; height: 22px; border-radius: 4px;
    display: inline-flex; align-items: center; justify-content: center;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.55));
  }
  .ob-phone-yt svg { width: 100%; height: 100%; }
  .ob-phone-bottom {
    position: absolute;
    inset: auto 50px 14px 12px; z-index: 2;
    display: flex; flex-direction: column; gap: 4px;
    font-size: 11px; line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0,0,0,0.65);
    pointer-events: none;
  }
  .ob-phone-creator {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 12px; font-weight: 700;
  }
  .ob-phone-avatar {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--accent-default);
    border: 1px solid rgba(255,255,255,0.5);
    flex-shrink: 0;
  }
  .ob-phone-desc {
    font-weight: 450;
    color: rgba(255,255,255,0.92);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Showcase info column */
  .ob-showcase-info {
    display: flex; flex-direction: column; gap: var(--space-4);
  }
  .ob-showcase-info .ob-gen-steps { margin-bottom: var(--space-3); }
  .ob-showcase-info .ob-gen-status {
    font-family: var(--font-mono); font-size: var(--text-caption);
    color: var(--text-secondary); letter-spacing: 0.02em;
    margin-bottom: var(--space-4);
  }
  .ob-showcase-info .ob-cta { align-self: flex-start; }
  .ob-showcase-info .ob-skip { margin-top: var(--space-2); }

  @media (max-width: 720px) {
    .ob-container { padding: 32px 16px 48px; }
    .ob-niche-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .ob-cards { gap: var(--space-2); }
    .ob-card { padding: var(--space-4); }
    .ob-showcase-layout {
      grid-template-columns: 1fr;
      gap: var(--space-5);
    }
    .ob-phone-frame { width: 200px; margin: 0 auto; }
  }

  /* ---- First-run walkthrough overlay ---- */
  /* Backdrop is transparent. its only job is blocking click-through and
     catching Escape. The highlight's box-shadow below creates the dim
     overlay, with a hole-punch around the target so the highlighted
     element stays fully readable. */
  .gh-walk-backdrop {
    position: fixed; inset: 0; z-index: 9500;
    background: transparent;
    pointer-events: auto;
  }
  .gh-walk-highlight {
    position: fixed; z-index: 9501;
    border: 2px solid var(--accent, #22E7F5);
    border-radius: 12px;
    /* The 9999px outer shadow is a single dim layer that fills the viewport
       minus the highlight rectangle. so the target shows through clearly.
       Doubling this with a backdrop background would re-dim the target. */
    /* box-shadow removed (Bible §02: depth via bg-color) */
    pointer-events: none;
    transition: top 0.25s ease, left 0.25s ease, width 0.25s ease, height 0.25s ease;
  }
  .gh-walk-tooltip {
    position: fixed; z-index: 9502;
    width: min(360px, calc(100vw - 32px));
    background: rgba(15, 19, 20, 0.98);
    border: 1px solid rgba(34, 231, 245, 0.32);
    border-radius: 12px;
    padding: 18px 18px 14px;
    box-shadow: 0 28px 64px rgba(0, 0, 0, 0.5), 0 0 24px rgba(34, 231, 245, 0.16);
    color: var(--text, #f4f8f5);
    transition: top 0.25s ease, left 0.25s ease;
  }
  .gh-walk-tooltip h4 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text, #f4f8f5);
  }
  .gh-walk-tooltip p {
    margin: 0 0 14px;
    color: var(--muted, #9aa6a0);
    font-size: 14px;
    line-height: 1.45;
  }
  .gh-walk-tooltip .gh-walk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .gh-walk-tooltip .gh-walk-step {
    color: var(--muted, #9aa6a0);
    font-size: 11px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
  }
  .gh-walk-tooltip .gh-walk-actions {
    display: flex;
    gap: 8px;
  }
  .gh-walk-tooltip button {
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid rgba(238, 246, 241, 0.16);
    background: transparent;
    color: var(--muted, #9aa6a0);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  }
  .gh-walk-tooltip button:hover {
    color: var(--text, #f4f8f5);
    border-color: rgba(238, 246, 241, 0.28);
  }
  .gh-walk-tooltip button.gh-walk-primary {
    background: var(--accent-default);
    color: #f4f8f5;
    border-color: rgba(34, 231, 245, 0.4);
  }
  .gh-walk-tooltip button.gh-walk-primary:hover {
    border-color: rgba(34, 231, 245, 0.7);
  }

  /* ---- Loading skeletons (Library, Optimize, SEO Finder, Analytics) ---- */
  .gh-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
  }
  .gh-skeleton-card {
    height: 168px;
    border: 1px solid rgba(238, 246, 241, 0.08);
    border-radius: 12px;
    background: rgba(18, 21, 22, 0.55);
    position: relative;
    overflow: hidden;
  }
  .gh-skeleton-card::before {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(
      90deg,
      transparent 0%,
      rgba(244, 248, 245, 0.05) 35%,
      rgba(244, 248, 245, 0.08) 50%,
      rgba(244, 248, 245, 0.05) 65%,
      transparent 100%
    );
    transform: translateX(-100%);
    animation: ghSkeletonShimmer 1.4s ease-in-out infinite;
  }
  @keyframes ghSkeletonShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
  }
  /* Reduced-motion users: kill the shimmer, keep the placeholder visible. */
  @media (prefers-reduced-motion: reduce) {
    .gh-skeleton-card::before { animation: none; opacity: 0.6; }
    .gh-walk-highlight, .gh-walk-tooltip { transition: none; }
  }

  /* ---- Accessibility: focus-visible rings on all interactive elements ---- */
  button:focus-visible,
  a:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  [role="button"]:focus-visible,
  .tab-btn:focus-visible,
  .filter-btn:focus-visible,
  .iconbtn:focus-visible {
    outline: 2px solid var(--accent, #22E7F5);
    outline-offset: 2px;
    border-radius: 8px;
  }
  /* When keyboard focus lands on a skip-only element, reveal it. */
  .gh-skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    padding: 8px 12px;
    background: var(--panel-2, #1b2021);
    color: var(--text, #f4f8f5);
    border-radius: 8px;
    z-index: 9999;
    text-decoration: none;
  }
  .gh-skip-link:focus { left: 8px; }

  /* ---- Render ETA chip on the active workflow step ---- */
  .workflow-step .gh-eta {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(34, 231, 245, 0.14);
    color: var(--accent, #22E7F5);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
  }

  /* ===========================================================================
     Mobile-responsive pass.

     The studio app was built desktop-first. These rules collapse the layout
     gracefully on phones, enlarge tap targets, and hide chrome that wastes
     screen space in narrow viewports. Scoped to one breakpoint for clarity;
     the existing inline media queries earlier in the file handle smaller
     responsive tweaks per-component.
     =========================================================================== */

  /* Touch targets: any actionable element gets at least 40px on small screens
     so fingers can hit it. */
  @media (max-width: 900px) and (pointer: coarse) {
    .btn, .iconbtn, .filter-btn, .tab-btn, .gh-feedback-fab,
    button[type="button"], button[type="submit"], .cta {
      min-height: 40px;
    }
  }

  /* Tablet + smaller: stop forcing wide grids, give touch users more breathing
     room, hide the desktop-only sidebar in favor of a drawer-style flow. */
  @media (max-width: 960px) {
    .wrap { padding: 12px; }
    header {
      flex-direction: column;
      align-items: stretch;
      gap: 12px;
    }
    .brand { justify-content: center; }
    .header-actions {
      justify-content: space-between;
      width: 100%;
    }
    .tabs {
      position: static !important;
      min-height: auto !important;
      padding: 12px !important;
      border-radius: 12px !important;
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }
    .tab-btn {
      flex: 0 0 auto;
      min-width: 0;
      padding: 9px 12px !important;
    }
    .tab-btn .tab-label,
    .tab-btn .tab-sub { display: inline; }
    .nav-section, .nav-section--advanced { width: 100%; }
    .panel {
      padding: 18px !important;
      border-radius: 12px !important;
    }
    .workflow-grid,
    .grid,
    .settings-grid,
    .library-grid,
    .pricing-grid,
    .formats-grid,
    .video-grid,
    .publish-grid {
      grid-template-columns: 1fr !important;
      gap: 12px !important;
    }
    .row {
      flex-direction: column;
      gap: 10px;
    }
    .row > * { width: 100%; }
    /* Make Video tab specific */
    .make-stage,
    .make-section,
    .workflow-rail {
      grid-template-columns: 1fr !important;
    }
    .idea-deck,
    .choice-grid {
      grid-template-columns: 1fr !important;
      gap: 10px;
    }
    .idea-card { padding: 14px; }
    /* Library: bundle/project cards stack full width */
    .proj-card, .bundle-card { padding: 14px; }
    .proj-card video,
    .bundle-card video { max-height: 220px !important; }
    /* Phone preview shouldn't take up half the screen on a phone */
    .phone-stage, .phone-shell { display: none; }
    /* Floating feedback button: smaller, lower so it doesn't cover content */
    .gh-feedback-fab {
      bottom: 14px;
      right: 14px;
      padding: 9px 13px;
      font-size: 12px;
    }
    /* Walkthrough tooltip: full width on mobile */
    .gh-walk-tooltip {
      width: calc(100vw - 24px);
      max-width: 360px;
    }
    /* Inputs: prevent iOS zoom on focus */
    input, select, textarea {
      font-size: 16px !important;
    }
    /* Loading skeletons: tighter on mobile */
    .gh-skeleton-grid {
      grid-template-columns: 1fr !important;
    }
    .gh-skeleton-card { height: 132px; }
  }

  /* Phone-specific: drop visual weight further. */
  @media (max-width: 540px) {
    .wrap { padding: 8px; }
    h1 { font-size: 24px !important; }
    h2 { font-size: 16px !important; }
    .panel { padding: 14px !important; border-radius: 12px !important; }
    .tab-btn .tab-sub { display: none; }  /* Just labels, no subtitles */
    .tab-btn { font-size: 13px !important; }
    .filter-btn { padding: 7px 10px !important; font-size: 12px !important; }
    /* Buttons: full width on phone for chunkier tap targets */
    .script-actions {
      flex-direction: column;
      gap: 8px;
    }
    .script-actions .btn {
      width: 100%;
      min-height: 44px;
    }
    /* Workflow steps stack vertically with bigger numbers */
    .workflow-step {
      padding: 12px;
    }
    /* Settings card grid */
    .settings-card { padding: 14px; }
    /* Notification panel: full screen on phone */
    .notification-panel {
      position: fixed !important;
      inset: 60px 8px auto 8px !important;
      width: auto !important;
      max-height: calc(100vh - 80px) !important;
    }
  }

  /* Safe area for notched phones (iOS, recent Android with cutouts). */
  @supports (padding: env(safe-area-inset-top)) {
    body {
      padding-top: env(safe-area-inset-top);
      padding-bottom: env(safe-area-inset-bottom);
    }
  }

  /* ===========================================================================
     Pricing grid in Settings. shows the four tiers with upgrade CTAs.
     =========================================================================== */
  .settings-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
  }
  .pricing-tier-card {
    border: 1px solid rgba(238, 246, 241, 0.10);
    border-radius: 12px;
    padding: 14px;
    background: rgba(15, 19, 20, 0.55);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.15s ease, transform 0.15s ease;
  }
  .pricing-tier-card.is-current {
    border-color: rgba(34, 231, 245, 0.5);
    box-shadow: 0 0 0 1px rgba(34, 231, 245, 0.18) inset;
  }
  .pricing-tier-card.is-founding {
    border-color: rgba(105, 207, 240, 0.4);
    background: var(--bg-surface-2);
  }
  .pricing-tier-name {
    font-weight: 800;
    font-size: 14px;
    color: var(--text);
    letter-spacing: 0.2px;
  }
  .pricing-tier-tagline {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.35;
  }
  .pricing-tier-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
  }
  .pricing-tier-price small {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    margin-left: 3px;
  }
  .pricing-tier-secondary {
    font-size: 12px;
    color: var(--muted);
  }
  .pricing-tier-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--text);
  }
  .pricing-tier-features li {
    padding-left: 18px;
    position: relative;
    line-height: 1.4;
  }
  .pricing-tier-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent);
  }
  .pricing-tier-card .btn,
  .pricing-tier-card .btn.secondary {
    width: 100%;
    margin-top: auto;
    min-height: 36px;
    font-size: 13px;
  }
  .pricing-tier-current-badge {
    align-self: flex-start;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(34, 231, 245, 0.16);
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }

  /* When the user selects "This device" as the AI engine, hide features that
     depend on the local Python pipeline (MusicGen, FLUX image gen, advanced
     timeline editing). Mobile users get a simpler workflow that matches what
     WebLLM + bundled assets can actually deliver. */
  body.engine-device .engine-server-only,
  body.engine-device [data-engine-server-only] {
    display: none !important;
  }
  body.engine-server .engine-device-only,
  body.engine-server [data-engine-device-only] {
    display: none !important;
  }

  /* ----------------------------------------------------------------------
     Studio mobile pass (≤640px). The studio is grid-heavy on desktop;
     existing breakpoints collapse columns at 900/1100/1200, but they
     don't cover small-screen edge cases like dense form rows, tab pills
     overflowing, dropdown menus going off-edge, or the launch checklist
     sprouting horizontal whitespace. This block tightens those.
     ---------------------------------------------------------------------- */
  @media (max-width: 640px) {
    .wrap {
      padding: 14px 14px 40px;
      column-gap: 14px;
      row-gap: 14px;
    }
    header {
      flex-wrap: wrap;
      gap: 10px;
      justify-content: space-between;
    }
    .brand .brand-mark {
      gap: 8px;
    }
    .brand .brand-icon { height: 32px; width: 32px; }
    .brand .brand-name { font-size: 24px; }
    .brand-tagline { display: none; }
    .header-actions {
      gap: 8px;
    }
    .ollama-badge {
      font-size: 11px;
      padding: 4px 8px;
    }
    /* Sidebar tab list. make it horizontal, scrollable, so it doesn't
       eat half the viewport vertically before the user even sees content. */
    .sidebar, .tabs-vertical, .left-rail {
      width: 100%;
    }
    /* Tab buttons stack as horizontal scroll instead of one-per-row. */
    .tab-list, .tabs, .nav-list {
      display: flex;
      flex-wrap: nowrap;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: thin;
      gap: 6px;
      padding-bottom: 6px;
    }
    .tab-btn {
      flex: 0 0 auto;
      white-space: nowrap;
      font-size: 13px;
      padding: 8px 12px;
    }
    /* Forms. single-column at all costs. */
    .grid, .form-grid, .row, .two-col {
      grid-template-columns: 1fr !important;
      gap: 10px;
    }
    /* Notification panel + dropdowns. clamp width and align right edge to viewport. */
    .notification-panel, .dropdown, .menu, .popover {
      max-width: calc(100vw - 24px) !important;
      right: 12px !important;
    }
    /* Launch checklist on phones. give the "X READY" status pill room
       to wrap below the label rather than crash off the right edge. */
    .launch-check {
      grid-template-columns: auto 1fr;
      gap: 10px;
    }
    .launch-status {
      grid-column: 2 / 3;
      justify-self: start;
      margin-top: 2px;
    }
    .launch-check-actions {
      gap: 6px;
      margin-top: 8px;
    }
    .launch-action {
      font-size: 11px;
      padding: 5px 9px;
    }
    /* Buttons + CTAs full-width when they're the primary action. */
    .btn-primary, .btn-cta {
      width: 100%;
      text-align: center;
      justify-content: center;
    }
  }

/* ─── Footage library picker (modal + grid) ──────────────────────────── */
.source-library-row[hidden] { display: none; }
.source-library-row .btn { margin-top: 4px; }

.source-library-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(34, 231, 245, 0.32);
  border-radius: 8px;
  background: rgba(34, 231, 245, 0.08);
  font-size: 12px;
  color: var(--text, #f4f8f5);
}
.source-library-pick[hidden] { display: none; }
.source-library-pick-label {
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-default, #22E7F5);
}
.source-library-pick-clear {
  background: transparent;
  border: 0;
  color: var(--muted, #9aa6a0);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.source-library-pick-clear:hover { color: var(--text, #f4f8f5); }

.gh-footage-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 7, 8, 0.72);
  backdrop-filter: blur(8px);
  padding: 24px;
}
.gh-footage-modal.shown { display: flex; }
.gh-footage-card {
  width: min(1280px, 100%);
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  background: rgba(15, 19, 20, 0.98);
  border: 1px solid rgba(238, 246, 241, 0.14);
  border-radius: 12px;
  padding: 18px 22px;
  overflow: hidden;
}
.gh-footage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.gh-footage-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.gh-footage-close {
  background: transparent;
  border: 0;
  color: var(--muted, #9aa6a0);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.gh-footage-close:hover { color: var(--text, #f4f8f5); }
.gh-footage-sub { margin: 0 0 10px; font-size: 12px; color: var(--muted, #9aa6a0); }
.gh-footage-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.gh-footage-pill {
  background: rgba(238, 246, 241, 0.04);
  border: 1px solid rgba(238, 246, 241, 0.12);
  color: var(--muted, #9aa6a0);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 11px;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-transform: capitalize;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.gh-footage-pill:hover {
  color: var(--text, #f4f8f5);
  border-color: rgba(238, 246, 241, 0.24);
}
.gh-footage-pill.is-active {
  background: rgba(34, 231, 245, 0.10);
  border-color: var(--accent-default, #22E7F5);
  color: var(--text, #f4f8f5);
}
.gh-footage-grid {
  flex: 1 1 auto;
  overflow-y: auto;
  display: grid;
  /* Cap tile width at 280 so 9:16 phones never grow taller than the
     visible grid height — full tile (status bar to creator strip)
     stays inside the viewport at typical desktop sizes. */
  grid-template-columns: repeat(auto-fill, minmax(200px, 280px));
  grid-auto-rows: max-content;
  justify-content: center;
  gap: 24px 20px;
  padding: 6px;
}
/* Tile = phone-frame: rounded body, dark bezel via box-shadow, dynamic
   island pseudo-element at top center. Mirrors the landing-hero phone
   styling but tile-scaled. */
.gh-footage-thumb {
  position: relative;
  align-self: start;
  background: #0e1418;
  border: 0;
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  color: #fff;
  font-family: var(--font-sans, system-ui, -apple-system, "Segoe UI", sans-serif);
  box-shadow: 0 0 0 4px #0e1418, 0 14px 32px rgba(0, 0, 0, 0.55);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.gh-footage-thumb:hover,
.gh-footage-thumb:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px #0e1418, 0 0 0 6px var(--accent-default, #22E7F5),
              0 18px 38px rgba(34, 231, 245, 0.18);
  transform: translateY(-2px);
}
/* Dynamic island */
.gh-footage-thumb::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 58px;
  height: 16px;
  border-radius: 999px;
  background: #000;
  z-index: 5;
  pointer-events: none;
}
/* Image is in-flow so it defines the tile height via aspect-ratio (grid
   row sizes correctly because the item has real content height). */
.gh-footage-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;     /* real-phone aspect — capped tile width keeps the height in viewport */
  object-fit: cover;
  border-radius: inherit;
}
.gh-footage-thumb video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  z-index: 1;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

/* ─── Shorts chrome (mirrors .hero-shorts-* on landing) ─────────────── */
.gh-footage-thumb-chrome {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
}
.gh-footage-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 70px;
  z-index: 3;
  padding: 8px 14px 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
}
.gh-footage-system { display: inline-flex; align-items: center; gap: 4px; }
.gh-footage-topactions {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}
.gh-footage-topactions svg { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }

.gh-footage-rail {
  position: absolute;
  right: 8px;
  bottom: 30px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.gh-footage-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.gh-footage-action svg { width: 18px; height: 18px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55)); }
.gh-footage-yt {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}
.gh-footage-yt svg { width: 100%; height: 100%; }

.gh-footage-bottom {
  position: absolute;
  inset: auto 56px 14px 12px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  line-height: 1.3;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}
.gh-footage-creator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  min-width: 0;
}
.gh-footage-creator strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gh-footage-avatar {
  width: 22px;
  height: 22px;
  border-radius: 0;
  background: transparent;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  flex-shrink: 0;
}
.gh-footage-avatar img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gh-footage-desc {
  font-weight: 450;
  color: rgba(255, 255, 255, 0.92);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Below ~640px the phone-frame chrome is too cramped to read;
   keep the structure but hide non-essential elements. */
@media (max-width: 640px) {
  .gh-footage-rail .gh-footage-action:nth-child(n+4) { display: none; }
  .gh-footage-yt { display: none; }
  .gh-footage-topactions svg:first-child { display: none; }
}
.gh-footage-thumb.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  border-top: 2px solid var(--accent-default, #22E7F5);
  border-right: 2px solid transparent;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  margin: auto;
  animation: gh-footage-spin 0.8s linear infinite;
}
@keyframes gh-footage-spin {
  to { transform: rotate(360deg); }
}
.gh-footage-status {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted, #9aa6a0);
  min-height: 18px;
}
.gh-footage-status.error { color: #F87171; }

/* Inline spinner on generate buttons while waiting for LLM response */
.btn.generating {
  pointer-events: none;
  position: relative;
  color: transparent !important;
}
.btn.generating::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  top: 50%; left: 50%;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(34, 231, 245, 0.25);
  border-top-color: #22E7F5;
  border-radius: 50%;
  animation: btnSpin 0.7s linear infinite;
}
@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

/* Loading pulse for status text lines across the studio */
.loading-status {
  animation: statusPulse 1.6s ease-in-out infinite;
}
@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
/* Pulsing animation on actively-running workflow step state label */
.workflow-step.running .state {
  animation: statusPulse 1.6s ease-in-out infinite;
}
/* Color-coded SEO score spans — !important overrides .make-section-title span */
.seo-score-good  { color: var(--good,  #34D399) !important; font-weight: 700; }
.seo-score-warn  { color: var(--warn,  #FBBF24) !important; font-weight: 700; }
.seo-score-muted { color: var(--muted, #6b7c75); }
.gh-footage-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 12px;
  color: var(--muted, #9aa6a0);
  font-size: 13px;
}
@media (max-width: 540px) {
  .gh-footage-modal { padding: 12px; }
  .gh-footage-card { padding: 16px; max-height: 92vh; }
  .gh-footage-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
}
