@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@600;700;800;900&family=JetBrains+Mono:wght@400;600&display=swap');

/* === Lifted from HexCoded-Design-Mockup.html — DO NOT hand-edit by class === */
/* Block 1: foundation tokens, base components (mockup lines 9-1118) */
/* ── hexcoded-ds.css (inlined) ── */
/* HexCoded Design System — foundation + hexcoded tokens (built from amplify-design-system @ 2026-05-26) */
/* Auto-generated by build-tokens.js — do not edit */
:root {
  --amp-breakpoint-sm: 640px;
  --amp-breakpoint-md: 768px;
  --amp-breakpoint-lg: 1024px;
  --amp-breakpoint-xl: 1280px;
  --amp-breakpoint-2xl: 1536px;
  --amp-color-violet-50: #FAF5FF;
  --amp-color-violet-100: #F3E8FF;
  --amp-color-violet-200: #E9D5FF;
  --amp-color-violet-300: #D8B4FE;
  --amp-color-violet-400: #C084FC;
  --amp-color-violet-500: #A855F7;
  --amp-color-violet-600: #7C3AED;
  --amp-color-violet-700: #6D28D9;
  --amp-color-violet-800: #5B21B6;
  --amp-color-violet-900: #4C1D95;
  --amp-color-stone-50: #FAFAF9;
  --amp-color-stone-100: #F5F5F4;
  --amp-color-stone-200: #E7E5E4;
  --amp-color-stone-300: #D6D3D1;
  --amp-color-stone-400: #A8A29E;
  --amp-color-stone-500: #78716C;
  --amp-color-stone-600: #57534E;
  --amp-color-stone-700: #44403C;
  --amp-color-stone-800: #292524;
  --amp-color-stone-900: #1C1917;
  --amp-color-stone-950: #0C0A09;
  --amp-color-red-50: #FEF2F2;
  --amp-color-red-100: #FEE2E2;
  --amp-color-red-500: #EF4444;
  --amp-color-red-600: #DC2626;
  --amp-color-red-700: #B91C1C;
  --amp-color-green-50: #ECFDF5;
  --amp-color-green-100: #D1FAE5;
  --amp-color-green-500: #10B981;
  --amp-color-green-600: #059669;
  --amp-color-green-700: #047857;
  --amp-color-amber-50: #FFFBEB;
  --amp-color-amber-100: #FEF3C7;
  --amp-color-amber-500: #F59E0B;
  --amp-color-amber-600: #D97706;
  --amp-color-amber-700: #B45309;
  --amp-color-blue-50: #EFF6FF;
  --amp-color-blue-100: #DBEAFE;
  --amp-color-blue-500: #3B82F6;
  --amp-color-blue-600: #2563EB;
  --amp-color-blue-700: #1D4ED8;
  --amp-color-rose-500: #F43F5E;
  --amp-color-rose-600: #E11D48;
  --amp-color-white: #FFFFFF;
  --amp-color-black: #000000;
  --amp-color-transparent: transparent;
  --amp-motion-duration-instant: 60ms;
  --amp-motion-duration-fast: 150ms;
  --amp-motion-duration-normal: 250ms;
  --amp-motion-duration-slow: 400ms;
  --amp-motion-duration-lazy: 700ms;
  --amp-motion-duration-slower: 600ms;
  --amp-motion-stagger-1: 50ms;
  --amp-motion-stagger-2: 100ms;
  --amp-motion-stagger-3: 200ms;
  --amp-motion-stagger-delay: 50ms;
  --amp-opacity-disabled: 0.5;
  --amp-opacity-hover: 0.04;
  --amp-opacity-pressed: 0.08;
  --amp-opacity-overlay: 0.5;
  --amp-opacity-status-bg: 0.08;
  --amp-radius-none: 0px;
  --amp-radius-sm: 4px;
  --amp-radius-md: 8px;
  --amp-radius-lg: 12px;
  --amp-radius-xl: 16px;
  --amp-radius-2xl: 24px;
  --amp-radius-full: 9999px;
  --amp-shadow-0: none;
  --amp-shadow-1: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --amp-shadow-2: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --amp-shadow-3: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --amp-shadow-4: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --amp-shadow-5: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --amp-shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.04);
  --amp-shadow-md: 0 2px 8px rgba(28, 25, 23, 0.06);
  --amp-shadow-lg: 0 8px 24px rgba(28, 25, 23, 0.08);
  --amp-shadow-sm-dark: 0 1px 3px rgba(0, 0, 0, 0.2);
  --amp-shadow-md-dark: 0 2px 8px rgba(0, 0, 0, 0.3);
  --amp-shadow-lg-dark: 0 8px 24px rgba(0, 0, 0, 0.4);
  --amp-shadow-accent-sm: 0 1px 4px 0 rgba(101, 49, 255, 0.15);
  --amp-shadow-accent-md: 0 4px 12px -2px rgba(101, 49, 255, 0.25);
  --amp-shadow-accent-lg: 0 10px 25px -4px rgba(101, 49, 255, 0.35);
  --amp-shadow-ring-accent: 0 0 0 2px var(--amp-semantic-border-accent);
  --amp-shadow-composer: 0 -4px 12px -4px rgba(28, 25, 23, 0.08);
  --amp-shadow-device: 0 12px 32px -8px rgba(28, 25, 23, 0.18), 0 4px 12px -4px rgba(28, 25, 23, 0.10);
  --amp-spacing-1: 4px;
  --amp-spacing-2: 8px;
  --amp-spacing-3: 12px;
  --amp-spacing-4: 16px;
  --amp-spacing-5: 20px;
  --amp-spacing-6: 24px;
  --amp-spacing-8: 32px;
  --amp-spacing-10: 40px;
  --amp-spacing-12: 48px;
  --amp-spacing-16: 64px;
  --amp-spacing-20: 80px;
  --amp-spacing-24: 96px;
  --amp-font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --amp-font-family-mono: 'JetBrains Mono', 'SF Mono', Monaco, Menlo, monospace;
  --amp-font-weight-light: 300;
  --amp-font-weight-regular: 400;
  --amp-font-weight-medium: 500;
  --amp-font-weight-semibold: 600;
  --amp-font-weight-bold: 700;
  --amp-font-size-display: 34px;
  --amp-font-size-h-lg: 24px;
  --amp-font-size-h-md: 18px;
  --amp-font-size-h-sm: 15px;
  --amp-font-size-body: 14px;
  --amp-font-size-body-sm: 12px;
  --amp-font-size-mono: 13px;
  --amp-font-lineHeight-tight: 1.2;
  --amp-font-lineHeight-normal: 1.5;
  --amp-font-lineHeight-relaxed: 1.6;
  --amp-z-index-base: 0;
  --amp-z-index-dropdown: 1000;
  --amp-z-index-sticky: 1020;
  --amp-z-index-fixed: 1030;
  --amp-z-index-modal-backdrop: 1040;
  --amp-z-index-modal: 1050;
  --amp-z-index-popover: 1060;
  --amp-z-index-tooltip: 1070;
  --amp-z-index-toast: 1080;
  --amp-semantic-accent: #7C3AED;
  --amp-semantic-accent-hover: #6D28D9;
  --amp-semantic-accent-light: #F3E8FF;
  --amp-semantic-accent-subtle: #FAF5FF;
  --amp-semantic-bg-primary: #FAFAF9;
  --amp-semantic-bg-surface: #FFFFFF;
  --amp-semantic-bg-raised: #FFFFFF;
  --amp-semantic-bg-sunken: #F5F5F4;
  --amp-semantic-bg-overlay: rgba(28, 25, 23, 0.5);
  --amp-semantic-text-primary: #1C1917;
  --amp-semantic-text-secondary: #57534E;
  --amp-semantic-text-muted: #78716C;
  --amp-semantic-text-disabled: #A8A29E;
  --amp-semantic-text-inverse: #FFFFFF;
  --amp-semantic-text-accent: #7C3AED;
  --amp-semantic-border-default: #E7E5E4;
  --amp-semantic-border-strong: #D6D3D1;
  --amp-semantic-border-subtle: #F5F5F4;
  --amp-semantic-border-accent: #E9D5FF;
  --amp-semantic-border-focus: #7C3AED;
  --amp-semantic-status-success: #059669;
  --amp-semantic-status-success-bg: rgba(5, 150, 105, 0.08);
  --amp-semantic-status-warning: #D97706;
  --amp-semantic-status-warning-bg: rgba(217, 119, 6, 0.08);
  --amp-semantic-status-error: #DC2626;
  --amp-semantic-status-error-bg: rgba(220, 38, 38, 0.08);
  --amp-semantic-status-info: #2563EB;
  --amp-semantic-status-info-bg: rgba(37, 99, 235, 0.08);
  --amp-semantic-color-info-soft: rgba(37, 99, 235, 0.08);
}

/* ──────────────────────────────────────────────────────────────────
   Product-agnostic semantic aliases — resolve to active product theme.
   Consumed by Canvas v2 primitives in @one-impression/ui via Tailwind
   arbitrary classes (e.g. bg-[var(--amp-semantic-bg-accent-subtle)]).
   Dark mode cascades through var() indirection automatically.
   ────────────────────────────────────────────────────────────────── */
:root {
  --amp-semantic-bg-base: var(--amp-semantic-bg-primary);
  --amp-semantic-bg-canvas: var(--amp-semantic-bg-sunken);
  --amp-semantic-bg-subtle: var(--amp-semantic-bg-sunken);
  --amp-semantic-bg-accent: var(--amp-semantic-accent);
  --amp-semantic-bg-accent-subtle: var(--amp-semantic-accent-subtle);
  --amp-semantic-bg-success-subtle: var(--amp-semantic-status-success-bg);
  --amp-semantic-bg-warning-subtle: var(--amp-semantic-status-warning-bg);
  --amp-semantic-bg-error-subtle: var(--amp-semantic-status-error-bg);
  --amp-semantic-bg-info-subtle: var(--amp-semantic-status-info-bg);
  --amp-semantic-text-default: var(--amp-semantic-text-primary);
  --amp-semantic-text-tertiary: var(--amp-semantic-text-muted);
  --amp-semantic-text-on-accent: var(--amp-semantic-text-inverse);
  --amp-semantic-border-success: var(--amp-semantic-status-success);
  --amp-semantic-border-error: var(--amp-semantic-status-error);
  --amp-semantic-border-warning: var(--amp-semantic-status-warning);
  --amp-semantic-border-info: var(--amp-semantic-status-info);
  --amp-semantic-accent-primary: var(--amp-semantic-accent);
  --amp-semantic-accent-soft: var(--amp-semantic-accent-light);
}

/* Dark mode overrides */
[data-theme="dark"] {
  --amp-breakpoint-sm: 640px;
  --amp-breakpoint-md: 768px;
  --amp-breakpoint-lg: 1024px;
  --amp-breakpoint-xl: 1280px;
  --amp-breakpoint-2xl: 1536px;
  --amp-color-violet-50: #FAF5FF;
  --amp-color-violet-100: #F3E8FF;
  --amp-color-violet-200: #E9D5FF;
  --amp-color-violet-300: #D8B4FE;
  --amp-color-violet-400: #C084FC;
  --amp-color-violet-500: #A855F7;
  --amp-color-violet-600: #7C3AED;
  --amp-color-violet-700: #6D28D9;
  --amp-color-violet-800: #5B21B6;
  --amp-color-violet-900: #4C1D95;
  --amp-color-stone-50: #FAFAF9;
  --amp-color-stone-100: #F5F5F4;
  --amp-color-stone-200: #E7E5E4;
  --amp-color-stone-300: #D6D3D1;
  --amp-color-stone-400: #A8A29E;
  --amp-color-stone-500: #78716C;
  --amp-color-stone-600: #57534E;
  --amp-color-stone-700: #44403C;
  --amp-color-stone-800: #292524;
  --amp-color-stone-900: #1C1917;
  --amp-color-stone-950: #0C0A09;
  --amp-color-red-50: #FEF2F2;
  --amp-color-red-100: #FEE2E2;
  --amp-color-red-500: #EF4444;
  --amp-color-red-600: #DC2626;
  --amp-color-red-700: #B91C1C;
  --amp-color-green-50: #ECFDF5;
  --amp-color-green-100: #D1FAE5;
  --amp-color-green-500: #10B981;
  --amp-color-green-600: #059669;
  --amp-color-green-700: #047857;
  --amp-color-amber-50: #FFFBEB;
  --amp-color-amber-100: #FEF3C7;
  --amp-color-amber-500: #F59E0B;
  --amp-color-amber-600: #D97706;
  --amp-color-amber-700: #B45309;
  --amp-color-blue-50: #EFF6FF;
  --amp-color-blue-100: #DBEAFE;
  --amp-color-blue-500: #3B82F6;
  --amp-color-blue-600: #2563EB;
  --amp-color-blue-700: #1D4ED8;
  --amp-color-rose-500: #F43F5E;
  --amp-color-rose-600: #E11D48;
  --amp-color-white: #FFFFFF;
  --amp-color-black: #000000;
  --amp-color-transparent: transparent;
  --amp-motion-duration-instant: 60ms;
  --amp-motion-duration-fast: 150ms;
  --amp-motion-duration-normal: 250ms;
  --amp-motion-duration-slow: 400ms;
  --amp-motion-duration-lazy: 700ms;
  --amp-motion-duration-slower: 600ms;
  --amp-motion-stagger-1: 50ms;
  --amp-motion-stagger-2: 100ms;
  --amp-motion-stagger-3: 200ms;
  --amp-motion-stagger-delay: 50ms;
  --amp-opacity-disabled: 0.5;
  --amp-opacity-hover: 0.04;
  --amp-opacity-pressed: 0.08;
  --amp-opacity-overlay: 0.5;
  --amp-opacity-status-bg: 0.08;
  --amp-radius-none: 0px;
  --amp-radius-sm: 4px;
  --amp-radius-md: 8px;
  --amp-radius-lg: 12px;
  --amp-radius-xl: 16px;
  --amp-radius-2xl: 24px;
  --amp-radius-full: 9999px;
  --amp-shadow-0: none;
  --amp-shadow-1: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --amp-shadow-2: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --amp-shadow-3: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --amp-shadow-4: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --amp-shadow-5: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --amp-shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.04);
  --amp-shadow-md: 0 2px 8px rgba(28, 25, 23, 0.06);
  --amp-shadow-lg: 0 8px 24px rgba(28, 25, 23, 0.08);
  --amp-shadow-sm-dark: 0 1px 3px rgba(0, 0, 0, 0.2);
  --amp-shadow-md-dark: 0 2px 8px rgba(0, 0, 0, 0.3);
  --amp-shadow-lg-dark: 0 8px 24px rgba(0, 0, 0, 0.4);
  --amp-shadow-accent-sm: 0 1px 4px 0 rgba(101, 49, 255, 0.15);
  --amp-shadow-accent-md: 0 4px 12px -2px rgba(101, 49, 255, 0.25);
  --amp-shadow-accent-lg: 0 10px 25px -4px rgba(101, 49, 255, 0.35);
  --amp-shadow-ring-accent: 0 0 0 2px var(--amp-semantic-border-accent);
  --amp-shadow-composer: 0 -4px 12px -4px rgba(28, 25, 23, 0.08);
  --amp-shadow-device: 0 12px 32px -8px rgba(28, 25, 23, 0.18), 0 4px 12px -4px rgba(28, 25, 23, 0.10);
  --amp-spacing-1: 4px;
  --amp-spacing-2: 8px;
  --amp-spacing-3: 12px;
  --amp-spacing-4: 16px;
  --amp-spacing-5: 20px;
  --amp-spacing-6: 24px;
  --amp-spacing-8: 32px;
  --amp-spacing-10: 40px;
  --amp-spacing-12: 48px;
  --amp-spacing-16: 64px;
  --amp-spacing-20: 80px;
  --amp-spacing-24: 96px;
  --amp-font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --amp-font-family-mono: 'JetBrains Mono', 'SF Mono', Monaco, Menlo, monospace;
  --amp-font-weight-light: 300;
  --amp-font-weight-regular: 400;
  --amp-font-weight-medium: 500;
  --amp-font-weight-semibold: 600;
  --amp-font-weight-bold: 700;
  --amp-font-size-display: 34px;
  --amp-font-size-h-lg: 24px;
  --amp-font-size-h-md: 18px;
  --amp-font-size-h-sm: 15px;
  --amp-font-size-body: 14px;
  --amp-font-size-body-sm: 12px;
  --amp-font-size-mono: 13px;
  --amp-font-lineHeight-tight: 1.2;
  --amp-font-lineHeight-normal: 1.5;
  --amp-font-lineHeight-relaxed: 1.6;
  --amp-z-index-base: 0;
  --amp-z-index-dropdown: 1000;
  --amp-z-index-sticky: 1020;
  --amp-z-index-fixed: 1030;
  --amp-z-index-modal-backdrop: 1040;
  --amp-z-index-modal: 1050;
  --amp-z-index-popover: 1060;
  --amp-z-index-tooltip: 1070;
  --amp-z-index-toast: 1080;
  --amp-semantic-accent: #A855F7;
  --amp-semantic-accent-hover: #C084FC;
  --amp-semantic-accent-light: rgba(168, 85, 247, 0.12);
  --amp-semantic-accent-subtle: rgba(168, 85, 247, 0.06);
  --amp-semantic-bg-primary: #1C1917;
  --amp-semantic-bg-surface: #292524;
  --amp-semantic-bg-raised: #44403C;
  --amp-semantic-bg-sunken: #0C0A09;
  --amp-semantic-bg-overlay: rgba(0, 0, 0, 0.6);
  --amp-semantic-text-primary: #E7E5E4;
  --amp-semantic-text-secondary: #A8A29E;
  --amp-semantic-text-muted: #78716C;
  --amp-semantic-text-disabled: #57534E;
  --amp-semantic-text-inverse: #1C1917;
  --amp-semantic-text-accent: #C084FC;
  --amp-semantic-border-default: #44403C;
  --amp-semantic-border-strong: #57534E;
  --amp-semantic-border-subtle: rgba(255, 255, 255, 0.06);
  --amp-semantic-border-accent: rgba(168, 85, 247, 0.3);
  --amp-semantic-border-focus: #A855F7;
  --amp-semantic-status-success: #10B981;
  --amp-semantic-status-success-bg: rgba(16, 185, 129, 0.12);
  --amp-semantic-status-warning: #F59E0B;
  --amp-semantic-status-warning-bg: rgba(245, 158, 11, 0.12);
  --amp-semantic-status-error: #EF4444;
  --amp-semantic-status-error-bg: rgba(239, 68, 68, 0.12);
  --amp-semantic-status-info: #3B82F6;
  --amp-semantic-status-info-bg: rgba(59, 130, 246, 0.12);
  --amp-semantic-color-info-soft: rgba(59, 130, 246, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --amp-breakpoint-sm: 640px;
    --amp-breakpoint-md: 768px;
    --amp-breakpoint-lg: 1024px;
    --amp-breakpoint-xl: 1280px;
    --amp-breakpoint-2xl: 1536px;
    --amp-color-violet-50: #FAF5FF;
    --amp-color-violet-100: #F3E8FF;
    --amp-color-violet-200: #E9D5FF;
    --amp-color-violet-300: #D8B4FE;
    --amp-color-violet-400: #C084FC;
    --amp-color-violet-500: #A855F7;
    --amp-color-violet-600: #7C3AED;
    --amp-color-violet-700: #6D28D9;
    --amp-color-violet-800: #5B21B6;
    --amp-color-violet-900: #4C1D95;
    --amp-color-stone-50: #FAFAF9;
    --amp-color-stone-100: #F5F5F4;
    --amp-color-stone-200: #E7E5E4;
    --amp-color-stone-300: #D6D3D1;
    --amp-color-stone-400: #A8A29E;
    --amp-color-stone-500: #78716C;
    --amp-color-stone-600: #57534E;
    --amp-color-stone-700: #44403C;
    --amp-color-stone-800: #292524;
    --amp-color-stone-900: #1C1917;
    --amp-color-stone-950: #0C0A09;
    --amp-color-red-50: #FEF2F2;
    --amp-color-red-100: #FEE2E2;
    --amp-color-red-500: #EF4444;
    --amp-color-red-600: #DC2626;
    --amp-color-red-700: #B91C1C;
    --amp-color-green-50: #ECFDF5;
    --amp-color-green-100: #D1FAE5;
    --amp-color-green-500: #10B981;
    --amp-color-green-600: #059669;
    --amp-color-green-700: #047857;
    --amp-color-amber-50: #FFFBEB;
    --amp-color-amber-100: #FEF3C7;
    --amp-color-amber-500: #F59E0B;
    --amp-color-amber-600: #D97706;
    --amp-color-amber-700: #B45309;
    --amp-color-blue-50: #EFF6FF;
    --amp-color-blue-100: #DBEAFE;
    --amp-color-blue-500: #3B82F6;
    --amp-color-blue-600: #2563EB;
    --amp-color-blue-700: #1D4ED8;
    --amp-color-rose-500: #F43F5E;
    --amp-color-rose-600: #E11D48;
    --amp-color-white: #FFFFFF;
    --amp-color-black: #000000;
    --amp-color-transparent: transparent;
    --amp-motion-duration-instant: 60ms;
    --amp-motion-duration-fast: 150ms;
    --amp-motion-duration-normal: 250ms;
    --amp-motion-duration-slow: 400ms;
    --amp-motion-duration-lazy: 700ms;
    --amp-motion-duration-slower: 600ms;
    --amp-motion-stagger-1: 50ms;
    --amp-motion-stagger-2: 100ms;
    --amp-motion-stagger-3: 200ms;
    --amp-motion-stagger-delay: 50ms;
    --amp-opacity-disabled: 0.5;
    --amp-opacity-hover: 0.04;
    --amp-opacity-pressed: 0.08;
    --amp-opacity-overlay: 0.5;
    --amp-opacity-status-bg: 0.08;
    --amp-radius-none: 0px;
    --amp-radius-sm: 4px;
    --amp-radius-md: 8px;
    --amp-radius-lg: 12px;
    --amp-radius-xl: 16px;
    --amp-radius-2xl: 24px;
    --amp-radius-full: 9999px;
    --amp-shadow-0: none;
    --amp-shadow-1: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --amp-shadow-2: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --amp-shadow-3: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --amp-shadow-4: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --amp-shadow-5: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --amp-shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.04);
    --amp-shadow-md: 0 2px 8px rgba(28, 25, 23, 0.06);
    --amp-shadow-lg: 0 8px 24px rgba(28, 25, 23, 0.08);
    --amp-shadow-sm-dark: 0 1px 3px rgba(0, 0, 0, 0.2);
    --amp-shadow-md-dark: 0 2px 8px rgba(0, 0, 0, 0.3);
    --amp-shadow-lg-dark: 0 8px 24px rgba(0, 0, 0, 0.4);
    --amp-shadow-accent-sm: 0 1px 4px 0 rgba(101, 49, 255, 0.15);
    --amp-shadow-accent-md: 0 4px 12px -2px rgba(101, 49, 255, 0.25);
    --amp-shadow-accent-lg: 0 10px 25px -4px rgba(101, 49, 255, 0.35);
    --amp-shadow-ring-accent: 0 0 0 2px var(--amp-semantic-border-accent);
    --amp-shadow-composer: 0 -4px 12px -4px rgba(28, 25, 23, 0.08);
    --amp-shadow-device: 0 12px 32px -8px rgba(28, 25, 23, 0.18), 0 4px 12px -4px rgba(28, 25, 23, 0.10);
    --amp-spacing-1: 4px;
    --amp-spacing-2: 8px;
    --amp-spacing-3: 12px;
    --amp-spacing-4: 16px;
    --amp-spacing-5: 20px;
    --amp-spacing-6: 24px;
    --amp-spacing-8: 32px;
    --amp-spacing-10: 40px;
    --amp-spacing-12: 48px;
    --amp-spacing-16: 64px;
    --amp-spacing-20: 80px;
    --amp-spacing-24: 96px;
    --amp-font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --amp-font-family-mono: 'JetBrains Mono', 'SF Mono', Monaco, Menlo, monospace;
    --amp-font-weight-light: 300;
    --amp-font-weight-regular: 400;
    --amp-font-weight-medium: 500;
    --amp-font-weight-semibold: 600;
    --amp-font-weight-bold: 700;
    --amp-font-size-display: 34px;
    --amp-font-size-h-lg: 24px;
    --amp-font-size-h-md: 18px;
    --amp-font-size-h-sm: 15px;
    --amp-font-size-body: 14px;
    --amp-font-size-body-sm: 12px;
    --amp-font-size-mono: 13px;
    --amp-font-lineHeight-tight: 1.2;
    --amp-font-lineHeight-normal: 1.5;
    --amp-font-lineHeight-relaxed: 1.6;
    --amp-z-index-base: 0;
    --amp-z-index-dropdown: 1000;
    --amp-z-index-sticky: 1020;
    --amp-z-index-fixed: 1030;
    --amp-z-index-modal-backdrop: 1040;
    --amp-z-index-modal: 1050;
    --amp-z-index-popover: 1060;
    --amp-z-index-tooltip: 1070;
    --amp-z-index-toast: 1080;
    --amp-semantic-accent: #A855F7;
    --amp-semantic-accent-hover: #C084FC;
    --amp-semantic-accent-light: rgba(168, 85, 247, 0.12);
    --amp-semantic-accent-subtle: rgba(168, 85, 247, 0.06);
    --amp-semantic-bg-primary: #1C1917;
    --amp-semantic-bg-surface: #292524;
    --amp-semantic-bg-raised: #44403C;
    --amp-semantic-bg-sunken: #0C0A09;
    --amp-semantic-bg-overlay: rgba(0, 0, 0, 0.6);
    --amp-semantic-text-primary: #E7E5E4;
    --amp-semantic-text-secondary: #A8A29E;
    --amp-semantic-text-muted: #78716C;
    --amp-semantic-text-disabled: #57534E;
    --amp-semantic-text-inverse: #1C1917;
    --amp-semantic-text-accent: #C084FC;
    --amp-semantic-border-default: #44403C;
    --amp-semantic-border-strong: #57534E;
    --amp-semantic-border-subtle: rgba(255, 255, 255, 0.06);
    --amp-semantic-border-accent: rgba(168, 85, 247, 0.3);
    --amp-semantic-border-focus: #A855F7;
    --amp-semantic-status-success: #10B981;
    --amp-semantic-status-success-bg: rgba(16, 185, 129, 0.12);
    --amp-semantic-status-warning: #F59E0B;
    --amp-semantic-status-warning-bg: rgba(245, 158, 11, 0.12);
    --amp-semantic-status-error: #EF4444;
    --amp-semantic-status-error-bg: rgba(239, 68, 68, 0.12);
    --amp-semantic-status-info: #3B82F6;
    --amp-semantic-status-info-bg: rgba(59, 130, 246, 0.12);
    --amp-semantic-color-info-soft: rgba(59, 130, 246, 0.12);
  }
}
/* Auto-generated by build-tokens.js — do not edit */
:root {
  --amp-hexcoded-breakpoint-sm: 640px;
  --amp-hexcoded-breakpoint-md: 768px;
  --amp-hexcoded-breakpoint-lg: 1024px;
  --amp-hexcoded-breakpoint-xl: 1280px;
  --amp-hexcoded-breakpoint-2xl: 1536px;
  --amp-hexcoded-color-violet-50: #FAF5FF;
  --amp-hexcoded-color-violet-100: #F3E8FF;
  --amp-hexcoded-color-violet-200: #E9D5FF;
  --amp-hexcoded-color-violet-300: #D8B4FE;
  --amp-hexcoded-color-violet-400: #C084FC;
  --amp-hexcoded-color-violet-500: #A855F7;
  --amp-hexcoded-color-violet-600: #7C3AED;
  --amp-hexcoded-color-violet-700: #6D28D9;
  --amp-hexcoded-color-violet-800: #5B21B6;
  --amp-hexcoded-color-violet-900: #4C1D95;
  --amp-hexcoded-color-stone-50: #FAFAF9;
  --amp-hexcoded-color-stone-100: #F5F5F4;
  --amp-hexcoded-color-stone-200: #E7E5E4;
  --amp-hexcoded-color-stone-300: #D6D3D1;
  --amp-hexcoded-color-stone-400: #A8A29E;
  --amp-hexcoded-color-stone-500: #78716C;
  --amp-hexcoded-color-stone-600: #57534E;
  --amp-hexcoded-color-stone-700: #44403C;
  --amp-hexcoded-color-stone-800: #292524;
  --amp-hexcoded-color-stone-900: #1C1917;
  --amp-hexcoded-color-stone-950: #0C0A09;
  --amp-hexcoded-color-red-50: #FEF2F2;
  --amp-hexcoded-color-red-100: #FEE2E2;
  --amp-hexcoded-color-red-500: #EF4444;
  --amp-hexcoded-color-red-600: #DC2626;
  --amp-hexcoded-color-red-700: #B91C1C;
  --amp-hexcoded-color-green-50: #ECFDF5;
  --amp-hexcoded-color-green-100: #D1FAE5;
  --amp-hexcoded-color-green-500: #10B981;
  --amp-hexcoded-color-green-600: #059669;
  --amp-hexcoded-color-green-700: #047857;
  --amp-hexcoded-color-amber-50: #FFFBEB;
  --amp-hexcoded-color-amber-100: #FEF3C7;
  --amp-hexcoded-color-amber-500: #F59E0B;
  --amp-hexcoded-color-amber-600: #D97706;
  --amp-hexcoded-color-amber-700: #B45309;
  --amp-hexcoded-color-blue-50: #EFF6FF;
  --amp-hexcoded-color-blue-100: #DBEAFE;
  --amp-hexcoded-color-blue-500: #3B82F6;
  --amp-hexcoded-color-blue-600: #2563EB;
  --amp-hexcoded-color-blue-700: #1D4ED8;
  --amp-hexcoded-color-rose-500: #F43F5E;
  --amp-hexcoded-color-rose-600: #E11D48;
  --amp-hexcoded-color-white: #FFFFFF;
  --amp-hexcoded-color-black: #000000;
  --amp-hexcoded-color-transparent: transparent;
  --amp-hexcoded-motion-duration-instant: 60ms;
  --amp-hexcoded-motion-duration-fast: 150ms;
  --amp-hexcoded-motion-duration-normal: 250ms;
  --amp-hexcoded-motion-duration-slow: 400ms;
  --amp-hexcoded-motion-duration-lazy: 700ms;
  --amp-hexcoded-motion-duration-slower: 600ms;
  --amp-hexcoded-motion-stagger-1: 50ms;
  --amp-hexcoded-motion-stagger-2: 100ms;
  --amp-hexcoded-motion-stagger-3: 200ms;
  --amp-hexcoded-motion-stagger-delay: 50ms;
  --amp-hexcoded-motion-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --amp-hexcoded-motion-d-fast: 120ms;
  --amp-hexcoded-motion-d-base: 200ms;
  --amp-hexcoded-motion-d-slow: 320ms;
  --amp-hexcoded-opacity-disabled: 0.5;
  --amp-hexcoded-opacity-hover: 0.04;
  --amp-hexcoded-opacity-pressed: 0.08;
  --amp-hexcoded-opacity-overlay: 0.5;
  --amp-hexcoded-opacity-status-bg: 0.08;
  --amp-hexcoded-radius-none: 0px;
  --amp-hexcoded-radius-sm: 4px;
  --amp-hexcoded-radius-md: 8px;
  --amp-hexcoded-radius-lg: 12px;
  --amp-hexcoded-radius-xl: 16px;
  --amp-hexcoded-radius-2xl: 24px;
  --amp-hexcoded-radius-full: 9999px;
  --amp-hexcoded-shadow-0: none;
  --amp-hexcoded-shadow-1: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --amp-hexcoded-shadow-2: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --amp-hexcoded-shadow-3: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --amp-hexcoded-shadow-4: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --amp-hexcoded-shadow-5: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --amp-hexcoded-shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.04);
  --amp-hexcoded-shadow-md: 0 2px 8px rgba(28, 25, 23, 0.06);
  --amp-hexcoded-shadow-lg: 0 8px 24px rgba(28, 25, 23, 0.08);
  --amp-hexcoded-shadow-sm-dark: 0 1px 3px rgba(0, 0, 0, 0.2);
  --amp-hexcoded-shadow-md-dark: 0 2px 8px rgba(0, 0, 0, 0.3);
  --amp-hexcoded-shadow-lg-dark: 0 8px 24px rgba(0, 0, 0, 0.4);
  --amp-hexcoded-shadow-accent-sm: 0 1px 4px 0 rgba(101, 49, 255, 0.15);
  --amp-hexcoded-shadow-accent-md: 0 4px 12px -2px rgba(101, 49, 255, 0.25);
  --amp-hexcoded-shadow-accent-lg: 0 10px 25px -4px rgba(101, 49, 255, 0.35);
  --amp-hexcoded-shadow-ring-accent: 0 0 0 2px var(--amp-semantic-border-accent);
  --amp-hexcoded-shadow-composer: 0 -4px 12px -4px rgba(28, 25, 23, 0.08);
  --amp-hexcoded-shadow-device: 0 12px 32px -8px rgba(28, 25, 23, 0.18), 0 4px 12px -4px rgba(28, 25, 23, 0.10);
  --amp-hexcoded-spacing-1: 4px;
  --amp-hexcoded-spacing-2: 8px;
  --amp-hexcoded-spacing-3: 12px;
  --amp-hexcoded-spacing-4: 16px;
  --amp-hexcoded-spacing-5: 20px;
  --amp-hexcoded-spacing-6: 24px;
  --amp-hexcoded-spacing-8: 32px;
  --amp-hexcoded-spacing-10: 40px;
  --amp-hexcoded-spacing-12: 48px;
  --amp-hexcoded-spacing-16: 64px;
  --amp-hexcoded-spacing-20: 80px;
  --amp-hexcoded-spacing-24: 96px;
  --amp-hexcoded-font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --amp-hexcoded-font-family-mono: 'JetBrains Mono', 'SF Mono', Monaco, Menlo, monospace;
  --amp-hexcoded-font-weight-light: 300;
  --amp-hexcoded-font-weight-regular: 400;
  --amp-hexcoded-font-weight-medium: 500;
  --amp-hexcoded-font-weight-semibold: 600;
  --amp-hexcoded-font-weight-bold: 700;
  --amp-hexcoded-font-size-display: 34px;
  --amp-hexcoded-font-size-h-lg: 24px;
  --amp-hexcoded-font-size-h-md: 18px;
  --amp-hexcoded-font-size-h-sm: 15px;
  --amp-hexcoded-font-size-body: 14px;
  --amp-hexcoded-font-size-body-sm: 12px;
  --amp-hexcoded-font-size-mono: 13px;
  --amp-hexcoded-font-lineHeight-tight: 1.2;
  --amp-hexcoded-font-lineHeight-normal: 1.5;
  --amp-hexcoded-font-lineHeight-relaxed: 1.6;
  --amp-hexcoded-font-display: 'Outfit', sans-serif;
  --amp-hexcoded-font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --amp-hexcoded-font-mono: 'JetBrains Mono', SFMono-Regular, monospace;
  --amp-hexcoded-z-index-base: 0;
  --amp-hexcoded-z-index-dropdown: 1000;
  --amp-hexcoded-z-index-sticky: 1020;
  --amp-hexcoded-z-index-fixed: 1030;
  --amp-hexcoded-z-index-modal-backdrop: 1040;
  --amp-hexcoded-z-index-modal: 1050;
  --amp-hexcoded-z-index-popover: 1060;
  --amp-hexcoded-z-index-tooltip: 1070;
  --amp-hexcoded-z-index-toast: 1080;
  --amp-hexcoded-semantic-accent: #7C3AED;
  --amp-hexcoded-semantic-accent-hover: #6D28D9;
  --amp-hexcoded-semantic-accent-light: #F3E8FF;
  --amp-hexcoded-semantic-accent-subtle: #FAF5FF;
  --amp-hexcoded-semantic-bg-primary: #FAFAF9;
  --amp-hexcoded-semantic-bg-surface: #FFFFFF;
  --amp-hexcoded-semantic-bg-raised: #FFFFFF;
  --amp-hexcoded-semantic-bg-sunken: #F5F5F4;
  --amp-hexcoded-semantic-bg-overlay: rgba(28, 25, 23, 0.5);
  --amp-hexcoded-semantic-text-primary: #1C1917;
  --amp-hexcoded-semantic-text-secondary: #57534E;
  --amp-hexcoded-semantic-text-muted: #78716C;
  --amp-hexcoded-semantic-text-disabled: #A8A29E;
  --amp-hexcoded-semantic-text-inverse: #FFFFFF;
  --amp-hexcoded-semantic-text-accent: #7C3AED;
  --amp-hexcoded-semantic-border-default: #E7E5E4;
  --amp-hexcoded-semantic-border-strong: #D6D3D1;
  --amp-hexcoded-semantic-border-subtle: #F5F5F4;
  --amp-hexcoded-semantic-border-accent: #E9D5FF;
  --amp-hexcoded-semantic-border-focus: #7C3AED;
  --amp-hexcoded-semantic-status-success: #059669;
  --amp-hexcoded-semantic-status-success-bg: rgba(5, 150, 105, 0.08);
  --amp-hexcoded-semantic-status-warning: #D97706;
  --amp-hexcoded-semantic-status-warning-bg: rgba(217, 119, 6, 0.08);
  --amp-hexcoded-semantic-status-error: #DC2626;
  --amp-hexcoded-semantic-status-error-bg: rgba(220, 38, 38, 0.08);
  --amp-hexcoded-semantic-status-info: #2563EB;
  --amp-hexcoded-semantic-status-info-bg: rgba(37, 99, 235, 0.08);
  --amp-hexcoded-semantic-color-info-soft: rgba(37, 99, 235, 0.08);
  --amp-hexcoded-theme-color-bg: #FAFAFA;
  --amp-hexcoded-theme-color-bg-elev: #FFFFFF;
  --amp-hexcoded-theme-color-bg-soft: #F5F5F7;
  --amp-hexcoded-theme-color-accent: #22C55E;
  --amp-hexcoded-theme-color-accent-deep: #16A34A;
  --amp-hexcoded-theme-color-accent-light: #86EFAC;
  --amp-hexcoded-theme-color-accent-whisper: #DCFCE7;
  --amp-hexcoded-theme-color-text-primary: #0B0B0F;
  --amp-hexcoded-theme-color-text-secondary: #3B3B42;
  --amp-hexcoded-theme-color-text-tertiary: #86868B;
  --amp-hexcoded-theme-color-border: #E5E5EA;
  --amp-hexcoded-status-success: #22C55E;
  --amp-hexcoded-status-warning: #FBBF24;
  --amp-hexcoded-status-danger: #EF4444;
  --amp-hexcoded-status-info: #0EA5E9;
  --amp-hexcoded-weight-display: 900;
  --amp-hexcoded-weight-body-default: 400;
  --amp-hexcoded-weight-body-emphasis: 500;
  --amp-hexcoded-letter-spacing-tight: -0.025em;
  --amp-hexcoded-layout-max-width: 1400px;
}

/* ──────────────────────────────────────────────────────────────────
   Product-agnostic semantic aliases — resolve to active product theme.
   Consumed by Canvas v2 primitives in @one-impression/ui via Tailwind
   arbitrary classes (e.g. bg-[var(--amp-semantic-bg-accent-subtle)]).
   Dark mode cascades through var() indirection automatically.
   ────────────────────────────────────────────────────────────────── */
:root {
  --amp-semantic-bg-surface: var(--amp-hexcoded-semantic-bg-surface);
  --amp-semantic-bg-base: var(--amp-hexcoded-semantic-bg-primary);
  --amp-semantic-bg-canvas: var(--amp-hexcoded-semantic-bg-sunken);
  --amp-semantic-bg-subtle: var(--amp-hexcoded-semantic-bg-sunken);
  --amp-semantic-bg-sunken: var(--amp-hexcoded-semantic-bg-sunken);
  --amp-semantic-bg-raised: var(--amp-hexcoded-semantic-bg-raised);
  --amp-semantic-bg-accent: var(--amp-hexcoded-semantic-accent);
  --amp-semantic-bg-accent-subtle: var(--amp-hexcoded-semantic-accent-subtle);
  --amp-semantic-bg-success-subtle: var(--amp-hexcoded-semantic-status-success-bg);
  --amp-semantic-bg-warning-subtle: var(--amp-hexcoded-semantic-status-warning-bg);
  --amp-semantic-bg-error-subtle: var(--amp-hexcoded-semantic-status-error-bg);
  --amp-semantic-bg-info-subtle: var(--amp-hexcoded-semantic-status-info-bg);
  --amp-semantic-text-default: var(--amp-hexcoded-semantic-text-primary);
  --amp-semantic-text-primary: var(--amp-hexcoded-semantic-text-primary);
  --amp-semantic-text-secondary: var(--amp-hexcoded-semantic-text-secondary);
  --amp-semantic-text-tertiary: var(--amp-hexcoded-semantic-text-muted);
  --amp-semantic-text-muted: var(--amp-hexcoded-semantic-text-muted);
  --amp-semantic-text-inverse: var(--amp-hexcoded-semantic-text-inverse);
  --amp-semantic-text-on-accent: var(--amp-hexcoded-semantic-text-inverse);
  --amp-semantic-text-accent: var(--amp-hexcoded-semantic-text-accent);
  --amp-semantic-status-success: var(--amp-hexcoded-semantic-status-success);
  --amp-semantic-status-warning: var(--amp-hexcoded-semantic-status-warning);
  --amp-semantic-status-error: var(--amp-hexcoded-semantic-status-error);
  --amp-semantic-status-info: var(--amp-hexcoded-semantic-status-info);
  --amp-semantic-status-error-bg: var(--amp-hexcoded-semantic-status-error-bg);
  --amp-semantic-status-warning-bg: var(--amp-hexcoded-semantic-status-warning-bg);
  --amp-semantic-status-success-bg: var(--amp-hexcoded-semantic-status-success-bg);
  --amp-semantic-status-info-bg: var(--amp-hexcoded-semantic-status-info-bg);
  --amp-semantic-border-default: var(--amp-hexcoded-semantic-border-default);
  --amp-semantic-border-strong: var(--amp-hexcoded-semantic-border-strong);
  --amp-semantic-border-subtle: var(--amp-hexcoded-semantic-border-subtle);
  --amp-semantic-border-accent: var(--amp-hexcoded-semantic-border-accent);
  --amp-semantic-border-success: var(--amp-hexcoded-semantic-status-success);
  --amp-semantic-border-error: var(--amp-hexcoded-semantic-status-error);
  --amp-semantic-border-warning: var(--amp-hexcoded-semantic-status-warning);
  --amp-semantic-border-info: var(--amp-hexcoded-semantic-status-info);
  --amp-semantic-border-focus: var(--amp-hexcoded-semantic-border-focus);
  --amp-semantic-accent: var(--amp-hexcoded-semantic-accent);
  --amp-semantic-accent-light: var(--amp-hexcoded-semantic-accent-light);
  --amp-semantic-accent-primary: var(--amp-hexcoded-semantic-accent);
  --amp-semantic-accent-soft: var(--amp-hexcoded-semantic-accent-light);
}

/* Dark mode overrides */
[data-theme="dark"] {
  --amp-hexcoded-breakpoint-sm: 640px;
  --amp-hexcoded-breakpoint-md: 768px;
  --amp-hexcoded-breakpoint-lg: 1024px;
  --amp-hexcoded-breakpoint-xl: 1280px;
  --amp-hexcoded-breakpoint-2xl: 1536px;
  --amp-hexcoded-color-violet-50: #FAF5FF;
  --amp-hexcoded-color-violet-100: #F3E8FF;
  --amp-hexcoded-color-violet-200: #E9D5FF;
  --amp-hexcoded-color-violet-300: #D8B4FE;
  --amp-hexcoded-color-violet-400: #C084FC;
  --amp-hexcoded-color-violet-500: #A855F7;
  --amp-hexcoded-color-violet-600: #7C3AED;
  --amp-hexcoded-color-violet-700: #6D28D9;
  --amp-hexcoded-color-violet-800: #5B21B6;
  --amp-hexcoded-color-violet-900: #4C1D95;
  --amp-hexcoded-color-stone-50: #FAFAF9;
  --amp-hexcoded-color-stone-100: #F5F5F4;
  --amp-hexcoded-color-stone-200: #E7E5E4;
  --amp-hexcoded-color-stone-300: #D6D3D1;
  --amp-hexcoded-color-stone-400: #A8A29E;
  --amp-hexcoded-color-stone-500: #78716C;
  --amp-hexcoded-color-stone-600: #57534E;
  --amp-hexcoded-color-stone-700: #44403C;
  --amp-hexcoded-color-stone-800: #292524;
  --amp-hexcoded-color-stone-900: #1C1917;
  --amp-hexcoded-color-stone-950: #0C0A09;
  --amp-hexcoded-color-red-50: #FEF2F2;
  --amp-hexcoded-color-red-100: #FEE2E2;
  --amp-hexcoded-color-red-500: #EF4444;
  --amp-hexcoded-color-red-600: #DC2626;
  --amp-hexcoded-color-red-700: #B91C1C;
  --amp-hexcoded-color-green-50: #ECFDF5;
  --amp-hexcoded-color-green-100: #D1FAE5;
  --amp-hexcoded-color-green-500: #10B981;
  --amp-hexcoded-color-green-600: #059669;
  --amp-hexcoded-color-green-700: #047857;
  --amp-hexcoded-color-amber-50: #FFFBEB;
  --amp-hexcoded-color-amber-100: #FEF3C7;
  --amp-hexcoded-color-amber-500: #F59E0B;
  --amp-hexcoded-color-amber-600: #D97706;
  --amp-hexcoded-color-amber-700: #B45309;
  --amp-hexcoded-color-blue-50: #EFF6FF;
  --amp-hexcoded-color-blue-100: #DBEAFE;
  --amp-hexcoded-color-blue-500: #3B82F6;
  --amp-hexcoded-color-blue-600: #2563EB;
  --amp-hexcoded-color-blue-700: #1D4ED8;
  --amp-hexcoded-color-rose-500: #F43F5E;
  --amp-hexcoded-color-rose-600: #E11D48;
  --amp-hexcoded-color-white: #FFFFFF;
  --amp-hexcoded-color-black: #000000;
  --amp-hexcoded-color-transparent: transparent;
  --amp-hexcoded-motion-duration-instant: 60ms;
  --amp-hexcoded-motion-duration-fast: 150ms;
  --amp-hexcoded-motion-duration-normal: 250ms;
  --amp-hexcoded-motion-duration-slow: 400ms;
  --amp-hexcoded-motion-duration-lazy: 700ms;
  --amp-hexcoded-motion-duration-slower: 600ms;
  --amp-hexcoded-motion-stagger-1: 50ms;
  --amp-hexcoded-motion-stagger-2: 100ms;
  --amp-hexcoded-motion-stagger-3: 200ms;
  --amp-hexcoded-motion-stagger-delay: 50ms;
  --amp-hexcoded-opacity-disabled: 0.5;
  --amp-hexcoded-opacity-hover: 0.04;
  --amp-hexcoded-opacity-pressed: 0.08;
  --amp-hexcoded-opacity-overlay: 0.5;
  --amp-hexcoded-opacity-status-bg: 0.08;
  --amp-hexcoded-radius-none: 0px;
  --amp-hexcoded-radius-sm: 4px;
  --amp-hexcoded-radius-md: 8px;
  --amp-hexcoded-radius-lg: 12px;
  --amp-hexcoded-radius-xl: 16px;
  --amp-hexcoded-radius-2xl: 24px;
  --amp-hexcoded-radius-full: 9999px;
  --amp-hexcoded-shadow-0: none;
  --amp-hexcoded-shadow-1: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --amp-hexcoded-shadow-2: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --amp-hexcoded-shadow-3: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --amp-hexcoded-shadow-4: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --amp-hexcoded-shadow-5: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --amp-hexcoded-shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.04);
  --amp-hexcoded-shadow-md: 0 2px 8px rgba(28, 25, 23, 0.06);
  --amp-hexcoded-shadow-lg: 0 8px 24px rgba(28, 25, 23, 0.08);
  --amp-hexcoded-shadow-sm-dark: 0 1px 3px rgba(0, 0, 0, 0.2);
  --amp-hexcoded-shadow-md-dark: 0 2px 8px rgba(0, 0, 0, 0.3);
  --amp-hexcoded-shadow-lg-dark: 0 8px 24px rgba(0, 0, 0, 0.4);
  --amp-hexcoded-shadow-accent-sm: 0 1px 4px 0 rgba(101, 49, 255, 0.15);
  --amp-hexcoded-shadow-accent-md: 0 4px 12px -2px rgba(101, 49, 255, 0.25);
  --amp-hexcoded-shadow-accent-lg: 0 10px 25px -4px rgba(101, 49, 255, 0.35);
  --amp-hexcoded-shadow-ring-accent: 0 0 0 2px var(--amp-semantic-border-accent);
  --amp-hexcoded-shadow-composer: 0 -4px 12px -4px rgba(28, 25, 23, 0.08);
  --amp-hexcoded-shadow-device: 0 12px 32px -8px rgba(28, 25, 23, 0.18), 0 4px 12px -4px rgba(28, 25, 23, 0.10);
  --amp-hexcoded-spacing-1: 4px;
  --amp-hexcoded-spacing-2: 8px;
  --amp-hexcoded-spacing-3: 12px;
  --amp-hexcoded-spacing-4: 16px;
  --amp-hexcoded-spacing-5: 20px;
  --amp-hexcoded-spacing-6: 24px;
  --amp-hexcoded-spacing-8: 32px;
  --amp-hexcoded-spacing-10: 40px;
  --amp-hexcoded-spacing-12: 48px;
  --amp-hexcoded-spacing-16: 64px;
  --amp-hexcoded-spacing-20: 80px;
  --amp-hexcoded-spacing-24: 96px;
  --amp-hexcoded-font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --amp-hexcoded-font-family-mono: 'JetBrains Mono', 'SF Mono', Monaco, Menlo, monospace;
  --amp-hexcoded-font-weight-light: 300;
  --amp-hexcoded-font-weight-regular: 400;
  --amp-hexcoded-font-weight-medium: 500;
  --amp-hexcoded-font-weight-semibold: 600;
  --amp-hexcoded-font-weight-bold: 700;
  --amp-hexcoded-font-size-display: 34px;
  --amp-hexcoded-font-size-h-lg: 24px;
  --amp-hexcoded-font-size-h-md: 18px;
  --amp-hexcoded-font-size-h-sm: 15px;
  --amp-hexcoded-font-size-body: 14px;
  --amp-hexcoded-font-size-body-sm: 12px;
  --amp-hexcoded-font-size-mono: 13px;
  --amp-hexcoded-font-lineHeight-tight: 1.2;
  --amp-hexcoded-font-lineHeight-normal: 1.5;
  --amp-hexcoded-font-lineHeight-relaxed: 1.6;
  --amp-hexcoded-z-index-base: 0;
  --amp-hexcoded-z-index-dropdown: 1000;
  --amp-hexcoded-z-index-sticky: 1020;
  --amp-hexcoded-z-index-fixed: 1030;
  --amp-hexcoded-z-index-modal-backdrop: 1040;
  --amp-hexcoded-z-index-modal: 1050;
  --amp-hexcoded-z-index-popover: 1060;
  --amp-hexcoded-z-index-tooltip: 1070;
  --amp-hexcoded-z-index-toast: 1080;
  --amp-hexcoded-semantic-accent: #A855F7;
  --amp-hexcoded-semantic-accent-hover: #C084FC;
  --amp-hexcoded-semantic-accent-light: rgba(168, 85, 247, 0.12);
  --amp-hexcoded-semantic-accent-subtle: rgba(168, 85, 247, 0.06);
  --amp-hexcoded-semantic-bg-primary: #1C1917;
  --amp-hexcoded-semantic-bg-surface: #292524;
  --amp-hexcoded-semantic-bg-raised: #44403C;
  --amp-hexcoded-semantic-bg-sunken: #0C0A09;
  --amp-hexcoded-semantic-bg-overlay: rgba(0, 0, 0, 0.6);
  --amp-hexcoded-semantic-text-primary: #E7E5E4;
  --amp-hexcoded-semantic-text-secondary: #A8A29E;
  --amp-hexcoded-semantic-text-muted: #78716C;
  --amp-hexcoded-semantic-text-disabled: #57534E;
  --amp-hexcoded-semantic-text-inverse: #1C1917;
  --amp-hexcoded-semantic-text-accent: #C084FC;
  --amp-hexcoded-semantic-border-default: #44403C;
  --amp-hexcoded-semantic-border-strong: #57534E;
  --amp-hexcoded-semantic-border-subtle: rgba(255, 255, 255, 0.06);
  --amp-hexcoded-semantic-border-accent: rgba(168, 85, 247, 0.3);
  --amp-hexcoded-semantic-border-focus: #A855F7;
  --amp-hexcoded-semantic-status-success: #10B981;
  --amp-hexcoded-semantic-status-success-bg: rgba(16, 185, 129, 0.12);
  --amp-hexcoded-semantic-status-warning: #F59E0B;
  --amp-hexcoded-semantic-status-warning-bg: rgba(245, 158, 11, 0.12);
  --amp-hexcoded-semantic-status-error: #EF4444;
  --amp-hexcoded-semantic-status-error-bg: rgba(239, 68, 68, 0.12);
  --amp-hexcoded-semantic-status-info: #3B82F6;
  --amp-hexcoded-semantic-status-info-bg: rgba(59, 130, 246, 0.12);
  --amp-hexcoded-semantic-color-info-soft: rgba(59, 130, 246, 0.12);
  --amp-hexcoded-theme-color-bg: #0B0B0F;
  --amp-hexcoded-theme-color-bg-elev: #1C1C22;
  --amp-hexcoded-theme-color-bg-soft: #15151B;
  --amp-hexcoded-theme-color-accent: #22C55E;
  --amp-hexcoded-theme-color-accent-deep: #16A34A;
  --amp-hexcoded-theme-color-accent-light: #86EFAC;
  --amp-hexcoded-theme-color-accent-whisper: #DCFCE7;
  --amp-hexcoded-theme-color-text-primary: #FAFAFA;
  --amp-hexcoded-theme-color-text-secondary: #C8C8CD;
  --amp-hexcoded-theme-color-text-tertiary: #86868B;
  --amp-hexcoded-theme-color-border: #2C2C30;
  --amp-hexcoded-status-success: #22C55E;
  --amp-hexcoded-status-warning: #FBBF24;
  --amp-hexcoded-status-danger: #EF4444;
  --amp-hexcoded-status-info: #0EA5E9;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --amp-hexcoded-breakpoint-sm: 640px;
    --amp-hexcoded-breakpoint-md: 768px;
    --amp-hexcoded-breakpoint-lg: 1024px;
    --amp-hexcoded-breakpoint-xl: 1280px;
    --amp-hexcoded-breakpoint-2xl: 1536px;
    --amp-hexcoded-color-violet-50: #FAF5FF;
    --amp-hexcoded-color-violet-100: #F3E8FF;
    --amp-hexcoded-color-violet-200: #E9D5FF;
    --amp-hexcoded-color-violet-300: #D8B4FE;
    --amp-hexcoded-color-violet-400: #C084FC;
    --amp-hexcoded-color-violet-500: #A855F7;
    --amp-hexcoded-color-violet-600: #7C3AED;
    --amp-hexcoded-color-violet-700: #6D28D9;
    --amp-hexcoded-color-violet-800: #5B21B6;
    --amp-hexcoded-color-violet-900: #4C1D95;
    --amp-hexcoded-color-stone-50: #FAFAF9;
    --amp-hexcoded-color-stone-100: #F5F5F4;
    --amp-hexcoded-color-stone-200: #E7E5E4;
    --amp-hexcoded-color-stone-300: #D6D3D1;
    --amp-hexcoded-color-stone-400: #A8A29E;
    --amp-hexcoded-color-stone-500: #78716C;
    --amp-hexcoded-color-stone-600: #57534E;
    --amp-hexcoded-color-stone-700: #44403C;
    --amp-hexcoded-color-stone-800: #292524;
    --amp-hexcoded-color-stone-900: #1C1917;
    --amp-hexcoded-color-stone-950: #0C0A09;
    --amp-hexcoded-color-red-50: #FEF2F2;
    --amp-hexcoded-color-red-100: #FEE2E2;
    --amp-hexcoded-color-red-500: #EF4444;
    --amp-hexcoded-color-red-600: #DC2626;
    --amp-hexcoded-color-red-700: #B91C1C;
    --amp-hexcoded-color-green-50: #ECFDF5;
    --amp-hexcoded-color-green-100: #D1FAE5;
    --amp-hexcoded-color-green-500: #10B981;
    --amp-hexcoded-color-green-600: #059669;
    --amp-hexcoded-color-green-700: #047857;
    --amp-hexcoded-color-amber-50: #FFFBEB;
    --amp-hexcoded-color-amber-100: #FEF3C7;
    --amp-hexcoded-color-amber-500: #F59E0B;
    --amp-hexcoded-color-amber-600: #D97706;
    --amp-hexcoded-color-amber-700: #B45309;
    --amp-hexcoded-color-blue-50: #EFF6FF;
    --amp-hexcoded-color-blue-100: #DBEAFE;
    --amp-hexcoded-color-blue-500: #3B82F6;
    --amp-hexcoded-color-blue-600: #2563EB;
    --amp-hexcoded-color-blue-700: #1D4ED8;
    --amp-hexcoded-color-rose-500: #F43F5E;
    --amp-hexcoded-color-rose-600: #E11D48;
    --amp-hexcoded-color-white: #FFFFFF;
    --amp-hexcoded-color-black: #000000;
    --amp-hexcoded-color-transparent: transparent;
    --amp-hexcoded-motion-duration-instant: 60ms;
    --amp-hexcoded-motion-duration-fast: 150ms;
    --amp-hexcoded-motion-duration-normal: 250ms;
    --amp-hexcoded-motion-duration-slow: 400ms;
    --amp-hexcoded-motion-duration-lazy: 700ms;
    --amp-hexcoded-motion-duration-slower: 600ms;
    --amp-hexcoded-motion-stagger-1: 50ms;
    --amp-hexcoded-motion-stagger-2: 100ms;
    --amp-hexcoded-motion-stagger-3: 200ms;
    --amp-hexcoded-motion-stagger-delay: 50ms;
    --amp-hexcoded-opacity-disabled: 0.5;
    --amp-hexcoded-opacity-hover: 0.04;
    --amp-hexcoded-opacity-pressed: 0.08;
    --amp-hexcoded-opacity-overlay: 0.5;
    --amp-hexcoded-opacity-status-bg: 0.08;
    --amp-hexcoded-radius-none: 0px;
    --amp-hexcoded-radius-sm: 4px;
    --amp-hexcoded-radius-md: 8px;
    --amp-hexcoded-radius-lg: 12px;
    --amp-hexcoded-radius-xl: 16px;
    --amp-hexcoded-radius-2xl: 24px;
    --amp-hexcoded-radius-full: 9999px;
    --amp-hexcoded-shadow-0: none;
    --amp-hexcoded-shadow-1: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --amp-hexcoded-shadow-2: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --amp-hexcoded-shadow-3: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --amp-hexcoded-shadow-4: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --amp-hexcoded-shadow-5: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --amp-hexcoded-shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.04);
    --amp-hexcoded-shadow-md: 0 2px 8px rgba(28, 25, 23, 0.06);
    --amp-hexcoded-shadow-lg: 0 8px 24px rgba(28, 25, 23, 0.08);
    --amp-hexcoded-shadow-sm-dark: 0 1px 3px rgba(0, 0, 0, 0.2);
    --amp-hexcoded-shadow-md-dark: 0 2px 8px rgba(0, 0, 0, 0.3);
    --amp-hexcoded-shadow-lg-dark: 0 8px 24px rgba(0, 0, 0, 0.4);
    --amp-hexcoded-shadow-accent-sm: 0 1px 4px 0 rgba(101, 49, 255, 0.15);
    --amp-hexcoded-shadow-accent-md: 0 4px 12px -2px rgba(101, 49, 255, 0.25);
    --amp-hexcoded-shadow-accent-lg: 0 10px 25px -4px rgba(101, 49, 255, 0.35);
    --amp-hexcoded-shadow-ring-accent: 0 0 0 2px var(--amp-semantic-border-accent);
    --amp-hexcoded-shadow-composer: 0 -4px 12px -4px rgba(28, 25, 23, 0.08);
    --amp-hexcoded-shadow-device: 0 12px 32px -8px rgba(28, 25, 23, 0.18), 0 4px 12px -4px rgba(28, 25, 23, 0.10);
    --amp-hexcoded-spacing-1: 4px;
    --amp-hexcoded-spacing-2: 8px;
    --amp-hexcoded-spacing-3: 12px;
    --amp-hexcoded-spacing-4: 16px;
    --amp-hexcoded-spacing-5: 20px;
    --amp-hexcoded-spacing-6: 24px;
    --amp-hexcoded-spacing-8: 32px;
    --amp-hexcoded-spacing-10: 40px;
    --amp-hexcoded-spacing-12: 48px;
    --amp-hexcoded-spacing-16: 64px;
    --amp-hexcoded-spacing-20: 80px;
    --amp-hexcoded-spacing-24: 96px;
    --amp-hexcoded-font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --amp-hexcoded-font-family-mono: 'JetBrains Mono', 'SF Mono', Monaco, Menlo, monospace;
    --amp-hexcoded-font-weight-light: 300;
    --amp-hexcoded-font-weight-regular: 400;
    --amp-hexcoded-font-weight-medium: 500;
    --amp-hexcoded-font-weight-semibold: 600;
    --amp-hexcoded-font-weight-bold: 700;
    --amp-hexcoded-font-size-display: 34px;
    --amp-hexcoded-font-size-h-lg: 24px;
    --amp-hexcoded-font-size-h-md: 18px;
    --amp-hexcoded-font-size-h-sm: 15px;
    --amp-hexcoded-font-size-body: 14px;
    --amp-hexcoded-font-size-body-sm: 12px;
    --amp-hexcoded-font-size-mono: 13px;
    --amp-hexcoded-font-lineHeight-tight: 1.2;
    --amp-hexcoded-font-lineHeight-normal: 1.5;
    --amp-hexcoded-font-lineHeight-relaxed: 1.6;
    --amp-hexcoded-z-index-base: 0;
    --amp-hexcoded-z-index-dropdown: 1000;
    --amp-hexcoded-z-index-sticky: 1020;
    --amp-hexcoded-z-index-fixed: 1030;
    --amp-hexcoded-z-index-modal-backdrop: 1040;
    --amp-hexcoded-z-index-modal: 1050;
    --amp-hexcoded-z-index-popover: 1060;
    --amp-hexcoded-z-index-tooltip: 1070;
    --amp-hexcoded-z-index-toast: 1080;
    --amp-hexcoded-semantic-accent: #A855F7;
    --amp-hexcoded-semantic-accent-hover: #C084FC;
    --amp-hexcoded-semantic-accent-light: rgba(168, 85, 247, 0.12);
    --amp-hexcoded-semantic-accent-subtle: rgba(168, 85, 247, 0.06);
    --amp-hexcoded-semantic-bg-primary: #1C1917;
    --amp-hexcoded-semantic-bg-surface: #292524;
    --amp-hexcoded-semantic-bg-raised: #44403C;
    --amp-hexcoded-semantic-bg-sunken: #0C0A09;
    --amp-hexcoded-semantic-bg-overlay: rgba(0, 0, 0, 0.6);
    --amp-hexcoded-semantic-text-primary: #E7E5E4;
    --amp-hexcoded-semantic-text-secondary: #A8A29E;
    --amp-hexcoded-semantic-text-muted: #78716C;
    --amp-hexcoded-semantic-text-disabled: #57534E;
    --amp-hexcoded-semantic-text-inverse: #1C1917;
    --amp-hexcoded-semantic-text-accent: #C084FC;
    --amp-hexcoded-semantic-border-default: #44403C;
    --amp-hexcoded-semantic-border-strong: #57534E;
    --amp-hexcoded-semantic-border-subtle: rgba(255, 255, 255, 0.06);
    --amp-hexcoded-semantic-border-accent: rgba(168, 85, 247, 0.3);
    --amp-hexcoded-semantic-border-focus: #A855F7;
    --amp-hexcoded-semantic-status-success: #10B981;
    --amp-hexcoded-semantic-status-success-bg: rgba(16, 185, 129, 0.12);
    --amp-hexcoded-semantic-status-warning: #F59E0B;
    --amp-hexcoded-semantic-status-warning-bg: rgba(245, 158, 11, 0.12);
    --amp-hexcoded-semantic-status-error: #EF4444;
    --amp-hexcoded-semantic-status-error-bg: rgba(239, 68, 68, 0.12);
    --amp-hexcoded-semantic-status-info: #3B82F6;
    --amp-hexcoded-semantic-status-info-bg: rgba(59, 130, 246, 0.12);
    --amp-hexcoded-semantic-color-info-soft: rgba(59, 130, 246, 0.12);
    --amp-hexcoded-theme-color-bg: #0B0B0F;
    --amp-hexcoded-theme-color-bg-elev: #1C1C22;
    --amp-hexcoded-theme-color-bg-soft: #15151B;
    --amp-hexcoded-theme-color-accent: #22C55E;
    --amp-hexcoded-theme-color-accent-deep: #16A34A;
    --amp-hexcoded-theme-color-accent-light: #86EFAC;
    --amp-hexcoded-theme-color-accent-whisper: #DCFCE7;
    --amp-hexcoded-theme-color-text-primary: #FAFAFA;
    --amp-hexcoded-theme-color-text-secondary: #C8C8CD;
    --amp-hexcoded-theme-color-text-tertiary: #86868B;
    --amp-hexcoded-theme-color-border: #2C2C30;
    --amp-hexcoded-status-success: #22C55E;
    --amp-hexcoded-status-warning: #FBBF24;
    --amp-hexcoded-status-danger: #EF4444;
    --amp-hexcoded-status-info: #0EA5E9;
  }
}

/* Block 2: app shell + tool-stage + popups (mockup lines 1124-2901) */
/* ════════════════════════════════════════════════════════════════
   ░ DS ALIAS LAYER (the ONLY :root block) ░
   Re-skins the entire render onto the real HexCoded design system.
   Every base token (--green-*, --ink-*, --bg-*, --hairline*, --glass-*,
   --shadow-*, --r-*, --d-*, --ease-*, --font-*, --danger/--warning)
   is aliased to the closest --amp-hexcoded-* DS token via var() — NO
   hardcoded color values. The DS tokens already flip under
   [data-theme="dark"], so light + dark both cascade automatically.
   In-between ink/border steps with no clean DS equivalent are derived
   with color-mix() between two DS theme tokens that BOTH flip with the
   theme (bg-elev = light pole, text-primary = dark pole), so the ramp
   inverts correctly in dark mode.
   ════════════════════════════════════════════════════════════════ */
:root {
  /* ── Type ── */
  --font-display: var(--amp-hexcoded-font-display);
  --font-body:    var(--amp-hexcoded-font-body);
  --font-mono:    var(--amp-hexcoded-font-mono);

  /* ── Green / accent scale ── DS theme accent (#22C55E) + foundation green ramp.
     The base uses 50→800; anchor the key steps to the DS theme accent tokens,
     fill the rest from the DS green/emerald foundation ramp. */
  --green-50:  var(--amp-hexcoded-theme-color-accent-whisper);  /* #DCFCE7 */
  --green-100: var(--amp-hexcoded-color-green-100);             /* #D1FAE5 */
  --green-200: color-mix(in srgb, var(--amp-hexcoded-theme-color-accent) 28%, var(--amp-hexcoded-color-white));
  --green-300: var(--amp-hexcoded-theme-color-accent-light);    /* #86EFAC */
  --green-400: color-mix(in srgb, var(--amp-hexcoded-theme-color-accent) 72%, var(--amp-hexcoded-color-white));
  --green-500: var(--amp-hexcoded-theme-color-accent);          /* #22C55E PRIMARY */
  --green-600: var(--amp-hexcoded-theme-color-accent-deep);     /* #16A34A DEEP */
  --green-700: color-mix(in srgb, var(--amp-hexcoded-theme-color-accent-deep) 80%, var(--amp-hexcoded-color-black));
  --green-800: color-mix(in srgb, var(--amp-hexcoded-theme-color-accent-deep) 62%, var(--amp-hexcoded-color-black));

  /* ── Ink scale ──
     Poles that flip with the theme:
       LIGHT pole  = --amp-hexcoded-theme-color-bg-elev (#FFF light / #1C1C22 dark)
       DARK  pole  = --amp-hexcoded-theme-color-text-primary (#0B0B0F light / #FAFAFA dark)
     so a mix of the two inverts correctly between themes. Where the DS has a
     clean flipping equivalent we alias it directly. */
  --ink-0:    var(--amp-hexcoded-theme-color-bg-elev);          /* surface white / inverse */
  --ink-50:   var(--amp-hexcoded-theme-color-bg);               /* #FAFAFA / #0B0B0F */
  --ink-100:  var(--amp-hexcoded-theme-color-bg-soft);          /* #F5F5F7 / #15151B */
  --ink-200:  color-mix(in srgb, var(--amp-hexcoded-theme-color-bg-elev) 88%, var(--amp-hexcoded-theme-color-text-primary));
  --ink-300:  color-mix(in srgb, var(--amp-hexcoded-theme-color-bg-elev) 80%, var(--amp-hexcoded-theme-color-text-primary));
  --ink-400:  color-mix(in srgb, var(--amp-hexcoded-theme-color-bg-elev) 58%, var(--amp-hexcoded-theme-color-text-primary));
  --ink-500:  var(--amp-hexcoded-theme-color-text-tertiary);    /* #86868B both themes */
  --ink-600:  color-mix(in srgb, var(--amp-hexcoded-theme-color-text-tertiary) 60%, var(--amp-hexcoded-theme-color-text-primary));
  --ink-700:  var(--amp-hexcoded-theme-color-text-secondary);   /* #3B3B42 / #C8C8CD */
  --ink-800:  color-mix(in srgb, var(--amp-hexcoded-theme-color-text-secondary) 45%, var(--amp-hexcoded-theme-color-text-primary));
  --ink-900:  color-mix(in srgb, var(--amp-hexcoded-theme-color-text-primary) 88%, var(--amp-hexcoded-theme-color-bg-elev));
  --ink-1000: var(--amp-hexcoded-theme-color-text-primary);     /* #0B0B0F / #FAFAFA */

  /* ── Backgrounds ── */
  --bg-canvas:   var(--amp-hexcoded-theme-color-bg);            /* page */
  --bg-surface:  var(--amp-hexcoded-theme-color-bg-elev);       /* cards/inputs */
  --bg-elevated: var(--amp-hexcoded-theme-color-bg-elev);
  --bg-soft:     var(--amp-hexcoded-theme-color-bg-soft);

  /* ── Hairlines / borders ── */
  --hairline:        color-mix(in srgb, var(--amp-hexcoded-theme-color-border) 60%, transparent);
  --hairline-strong: var(--amp-hexcoded-theme-color-border);

  /* ── Glass ── derived from the elevated surface (flips with theme) ── */
  --glass-bg:        color-mix(in srgb, var(--amp-hexcoded-theme-color-bg-elev) 72%, transparent);
  --glass-bg-strong: color-mix(in srgb, var(--amp-hexcoded-theme-color-bg-elev) 88%, transparent);
  --glass-blur:      blur(20px) saturate(180%);

  /* ── Shadows ── DS foundation elevation ramp + accent glows ── */
  --shadow-xs: var(--amp-hexcoded-shadow-1);
  --shadow-sm: var(--amp-hexcoded-shadow-2);
  --shadow-md: var(--amp-hexcoded-shadow-3);
  --shadow-lg: var(--amp-hexcoded-shadow-4);
  --shadow-xl: var(--amp-hexcoded-shadow-5);
  --shadow-green:      0 12px 32px color-mix(in srgb, var(--amp-hexcoded-theme-color-accent) 24%, transparent), 0 4px 8px color-mix(in srgb, var(--amp-hexcoded-theme-color-accent) 12%, transparent);
  --shadow-green-soft: 0 8px 20px color-mix(in srgb, var(--amp-hexcoded-theme-color-accent) 14%, transparent);

  /* ── Radii ── */
  --r-xs:   var(--amp-hexcoded-radius-sm);    /* 4px */
  --r-sm:   var(--amp-hexcoded-radius-md);    /* 8px */
  --r-md:   var(--amp-hexcoded-radius-lg);    /* 12px */
  --r-lg:   var(--amp-hexcoded-radius-xl);    /* 16px — DS Card radius */
  --r-xl:   var(--amp-hexcoded-radius-2xl);   /* 24px */
  --r-pill: var(--amp-hexcoded-radius-full);

  /* ── Motion ── */
  --ease-out:   var(--amp-hexcoded-motion-ease);
  --d-fast:     var(--amp-hexcoded-motion-d-fast);
  --d-base:     var(--amp-hexcoded-motion-d-base);
  --d-slow:     var(--amp-hexcoded-motion-d-slow);
  --d-stately:  var(--amp-hexcoded-motion-duration-lazy);

  /* ── Status ── */
  --danger:  var(--amp-hexcoded-status-danger);
  --warning: var(--amp-hexcoded-status-warning);

  /* ════════════════════════════════════════════════════════════════
     ░ CANONICAL COMPONENT PRIMITIVES ░  — defined ONCE, referenced
     everywhere. Every selected tile/card/chip/row, every accent-soft
     surface, every warning treatment, every focus ring and segmented
     control reads off THESE tokens, so a change propagates uniformly
     and the per-screen copies can no longer drift apart. All values
     flip correctly between light + dark (they derive from the green
     theme accent + theme bg/text poles, never from a frozen hex).
     ════════════════════════════════════════════════════════════════ */
  /* accent-soft surface (the green-tinted "note"/"selected" fill) */
  --accent-soft:        color-mix(in srgb, var(--green-500) 9%, var(--bg-surface));
  --accent-soft-strong: color-mix(in srgb, var(--green-500) 15%, var(--bg-surface));
  --accent-border:      color-mix(in srgb, var(--green-500) 30%, var(--hairline));
  --accent-ink:         var(--green-700);
  /* accent CHIP/badge/tick fill (the small green-100 wells) — flips with theme */
  --accent-chip-bg:  var(--green-100);
  --accent-chip-ink: var(--accent-ink);
  /* selected state — used by EVERY pickable tile/card/chip/row */
  --sel-border: var(--green-500);
  --sel-ring:   0 0 0 3px color-mix(in srgb, var(--green-500) 14%, transparent);
  --sel-ring-2: 0 0 0 2px color-mix(in srgb, var(--green-500) 16%, transparent);
  --sel-bg:     var(--accent-soft);
  /* focus ring for fields / editable surfaces */
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--green-500) 14%, transparent);
  /* neutral hover surface (readable in BOTH themes — never white-on-white) */
  --hover-surface:   color-mix(in srgb, var(--ink-1000) 6%, transparent);
  --hover-surface-2: color-mix(in srgb, var(--ink-1000) 4%, transparent);
  /* warning ink + soft fill (flips: dark uses the lighter status token) */
  --warn-ink:    color-mix(in srgb, var(--warning) 78%, var(--ink-1000));
  --warn-soft:   color-mix(in srgb, var(--warning) 12%, var(--bg-surface));
  --warn-border: color-mix(in srgb, var(--warning) 32%, transparent);
  /* info ink + soft fill (used by gate notes / proof tags) */
  --info-ink:    color-mix(in srgb, var(--amp-hexcoded-status-info) 72%, var(--ink-1000));
  --info-soft:   color-mix(in srgb, var(--amp-hexcoded-status-info) 14%, var(--bg-surface));
  --info-border: color-mix(in srgb, var(--amp-hexcoded-status-info) 30%, transparent);
  /* danger soft fill */
  --danger-soft:   color-mix(in srgb, var(--danger) 9%, var(--bg-surface));
  --danger-soft-2: color-mix(in srgb, var(--danger) 14%, var(--bg-surface));
  --danger-border: color-mix(in srgb, var(--danger) 30%, transparent);
  /* media wells (video thumbs) — a near-black that stays consistent */
  --media-well: #0a0a0c;
  /* segmented control (mode-toggle / tabs / theme-switcher / script-tabs) */
  --seg-track: var(--ink-100);
  --seg-thumb: var(--bg-surface);
}
[data-theme="dark"] {
  --warn-ink:  var(--warning);
  --accent-chip-bg:  color-mix(in srgb, var(--green-500) 16%, var(--bg-surface));
  --accent-chip-ink: var(--green-300);
  --info-ink:  #7db4ff;
  --seg-track: var(--bg-elevated);
}
/* ════════════════════════════════════════════════════════════════
   HEXCODED · Tool 1 · URL → Ad · DEFINITIVE rebuild
   Shell: thin icon rail (hover-expands flyout + pin) LEFT, numbered
   checklist beside it, carousel CENTER, right editor drawer.
   STATE: setup (editable) → after HexCode it → VIEW-ONLY; only
   "Open Editor" on a finished video; "New video" unlocks fresh setup.
   STRICT: link the HexCoded DS (../styles/hexcoded-ds.css); the only
   :root is the DS alias layer above (var(--amp-hexcoded-*), no hardcoded
   colors); var(--token) everywhere; zero inline on*; one popup pattern,
   fixed size, internal scroll; no nested <button> (role="button" rows).
   ════════════════════════════════════════════════════════════════ */
html, body { height: 100%; margin: 0; overflow: hidden; }
/* Global page background — same green-tinted radial wash the landing
   .canvas uses, applied at the body level so every interior page
   (pricing, settings, projects, library, etc.) inherits it instead of
   sitting on flat --bg-canvas. `background-attachment: fixed` keeps the
   gradient viewport-anchored so it doesn't scroll with inner containers. */
body {
  height: 100vh;
  font-family: var(--font-body);
  color: var(--ink-900);
  background:
    radial-gradient(1400px 700px at 50% -8%,
      color-mix(in srgb, var(--green-500) 10%, transparent), transparent 60%),
    radial-gradient(900px 500px at 92% 40%,
      color-mix(in srgb, var(--green-500) 6%, transparent), transparent 65%),
    var(--bg-canvas);
  background-attachment: fixed, fixed, fixed;
}
*, *::before, *::after { box-sizing: border-box; }
button { font-family: inherit; }

/* ════════════════════════════════════════════════════════════════
   ░ SHARED-COMPONENT LAYER ░ — canonical, token-driven primitives.
   Each pattern below is defined ONCE; the per-screen component classes
   later in this sheet OPT IN via these helpers + the --sel-*/--accent-*
   tokens, so selected states, hovers, segmented controls and fields
   stay pixel-identical and cannot drift. (No class renames — purely
   additive consolidation on top of the existing markup.)
   ════════════════════════════════════════════════════════════════ */

/* — Canonical SELECTED state for any pickable tile/card/chip/row — */
.is-pickable { transition: border-color var(--d-fast), box-shadow var(--d-fast), background var(--d-fast); }
.is-pickable.on,
.subj-tile.on, .pg-card.on, .fmt-tile.on, .stage-card.on, .broll-tile.on,
.ref-tile.on, .tile.on, .idea-card.on, .insight-card.on, .cast2-row.on,
.making-pill.on, .rg-thumb.on, .chip.on {
  border-color: var(--sel-border);
}

/* — Canonical SEGMENTED CONTROL (mode/theme/tabs/script-tabs) — */
.seg-track, .mode-toggle, .theme-switcher, .tabs, .script-tabs {
  display: inline-flex; align-items: center;
  background: var(--seg-track); border-radius: var(--r-pill); padding: 3px; gap: 2px;
}
.seg-track > button, .mode-toggle button, .theme-switcher button, .tabs button, .script-tabs button {
  border: none; background: transparent; cursor: pointer; border-radius: var(--r-pill);
  font-weight: 600; color: var(--ink-600);
  display: inline-flex; align-items: center; gap: 6px;
  transition: background var(--d-fast), color var(--d-fast), box-shadow var(--d-fast);
}
.seg-track > button.on, .mode-toggle button.on, .theme-switcher button.on, .tabs button.on, .script-tabs button.on {
  background: var(--seg-thumb); color: var(--ink-1000); box-shadow: var(--shadow-xs);
}

/* — Canonical FIELD shell (input-line / guide-box / ask-box) — */
.field-line { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 6px 0 13px;
  border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface);
  transition: border-color var(--d-fast), box-shadow var(--d-fast); }
.field-line:focus-within { border-color: var(--green-500); box-shadow: var(--focus-ring); }
.field-line input { flex: 1; border: none; background: transparent; outline: none;
  font-family: inherit; font-size: 13.5px; color: var(--ink-900); }
.field-line input::placeholder { color: var(--ink-400); }

/* — Canonical ACCENT-SOFT note surface (the green "info"/callout fill) — */
.accent-note { background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: var(--r-md); }

/* — Canonical NEUTRAL note surface (grey informational fill) — */
.neutral-note { background: var(--ink-50); border: 1px solid var(--hairline); }
[data-theme="dark"] .neutral-note { background: var(--bg-elevated); }

/* ── APP GRID ──────────────────────────────────────────────────── */
.app { height: 100vh; display: grid; grid-template-columns: 56px 1fr; transition: grid-template-columns var(--d-base) var(--ease-out); }
/* Both pin (sticky/click) and hover (transient, when not pinned) PUSH the layout:
   the rail column grows 56px→220px, so the checklist panel shifts right (no overlay). */
.app[data-railpin="true"], .app[data-railhover="true"] { grid-template-columns: 220px 1fr; }
.app > * { min-width: 0; min-height: 0; }

/* ── ICON RAIL (push-expands the grid; pin = sticky, hover = transient) ── */
.rail {
  position: relative; z-index: 60;
  background: var(--glass-bg-strong); backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--hairline);
  display: flex; flex-direction: column; align-items: stretch;
  padding: 12px 8px; gap: 4px; overflow: visible;
  width: 56px; transition: width var(--d-base) var(--ease-out), padding var(--d-base) var(--ease-out);
}
.app[data-railpin="true"] .rail, .app[data-railhover="true"] .rail { width: 220px; padding: 16px 12px; }
.rail-logo { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; text-decoration: none; }
/* H monogram (collapsed rail) — clean Outfit 900 in brand green · NO box, NO favicon styling.
   Matches brand-hexcoded favicon (single "H", fill #22C55E). The Phantom shadow stays subtle. */
.rail-logo .mark {
  width: 34px; height: 34px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; box-shadow: none; border: none; border-radius: 0;
}
.rail-logo .mark .hexwm { font-size: 26px; color: var(--green-500); }
/* expanded rail shows the full HEXCODED wordmark only — collapse the standalone H mark */
.app[data-railpin="true"] .rail-logo .mark, .app[data-railhover="true"] .rail-logo .mark { width: 0; opacity: 0; overflow: hidden; }
.rail-logo .wm { display: inline-flex; align-items: center; white-space: nowrap; opacity: 0; max-width: 0; transition: opacity var(--d-base), max-width var(--d-base); overflow: hidden; }
.app[data-railpin="true"] .rail-logo .wm, .app[data-railhover="true"] .rail-logo .wm { max-width: 200px; }
.app[data-railpin="true"] .rail-logo .wm, .app[data-railhover="true"] .rail-logo .wm { opacity: 1; }
.rail-logo .wm .hexwm { font-size: 19px; }
/* collapsed rail: center the H monogram so it lines up with the centered nav icons below */
.app:not([data-railpin="true"]):not([data-railhover="true"]) .rail-logo { justify-content: center; padding-left: 0; padding-right: 0; }
.app:not([data-railpin="true"]):not([data-railhover="true"]) .rail-logo .mark .hexwm { font-size: 21px; }

/* ── PHANTOM wordmark · inline HTML/CSS text (Outfit 900, green stepped shadow) ──
   data-text holds the word; an inner <span class="ph"></span> is the middle layer.
   Main text flips light/dark (text-primary); the 3 phantom layers stay green #22C55E. */
.hexwm {
  position: relative; display: inline-block;
  font-family: var(--amp-hexcoded-font-display), Outfit, sans-serif;
  font-weight: 900; letter-spacing: -0.025em; line-height: 1;
  color: var(--amp-hexcoded-theme-color-text-primary);
}
.hexwm::before, .hexwm::after, .hexwm .ph { content: attr(data-text); position: absolute; left: 0; top: 0; color: #22C55E; z-index: -1; }
.hexwm::before { transform: translate(1px,1px); opacity: .85; --ph: .85; animation: hexph 3s ease-in-out infinite; }
.hexwm .ph { transform: translate(2px,2px); opacity: .55; --ph: .55; animation: hexph 3s ease-in-out infinite .1s; }
.hexwm::after { transform: translate(3px,3px); opacity: .32; --ph: .32; animation: hexph 3s ease-in-out infinite .2s; }
@keyframes hexph { 0%,100% { opacity: var(--ph,.85); } 50% { opacity: calc(var(--ph,.85)*.4); } }
@media (prefers-reduced-motion: reduce) { .hexwm::before, .hexwm::after, .hexwm .ph { animation: none; } }
/* ── nav items — ALL identical shape (height 40px, single 19px icon) ── */
.rail-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 0 11px; height: 40px; border-radius: var(--r-md); border: none; background: transparent;
  cursor: pointer; color: var(--ink-600); transition: background var(--d-fast), color var(--d-fast);
  text-align: left; width: 100%; white-space: nowrap;
}
.rail-item:hover { background: var(--hover-surface); color: var(--ink-1000); }
.rail-item.on { background: var(--accent-soft-strong); color: var(--accent-ink); }
[data-theme="dark"] .rail-item.on { color: var(--green-300); }
.rail-item svg { width: 19px; height: 19px; flex-shrink: 0; stroke-width: 2; }
.rail-item .rl { display: flex; flex-direction: column; line-height: 1.2; opacity: 0; max-width: 0; overflow: hidden; transition: opacity var(--d-base); }
.rail-item .rl .rl-t { font-size: 13.5px; font-weight: 600; }
.rail-item .rl .rl-s { font-size: 10.5px; font-weight: 500; color: var(--ink-500); }
.rail-item.on .rl .rl-s { color: color-mix(in srgb, var(--accent-ink) 70%, transparent); }
.app[data-railpin="true"] .rail-item .rl, .app[data-railhover="true"] .rail-item .rl { opacity: 1; max-width: 200px; }

/* ── TOOLS group label — a calm mono caption, zero width when collapsed ── */
.rail-tools { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.rail-tools .tools-lab { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-400); padding: 4px 11px; opacity: 0; max-width: 0; white-space: nowrap; overflow: hidden; transition: opacity var(--d-base); }
.app[data-railpin="true"] .rail-tools .tools-lab, .app[data-railhover="true"] .rail-tools .tools-lab { opacity: 1; max-width: 200px; }
/* collapsed: a thin divider stands in for the label so the group still reads as separate */
.app:not([data-railpin="true"]):not([data-railhover="true"]) .rail-tools { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hairline); }

.rail-spacer { flex: 1; }
.rail-foot { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 1px solid var(--hairline); }
/* ── collapse / expand control — a deliberate, tidy chevron toggle ── */
.rail-pin { display: inline-flex; align-items: center; gap: 12px; padding: 0 11px; height: 40px; border-radius: var(--r-md); border: none; background: transparent; cursor: pointer; color: var(--ink-500); font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: background var(--d-fast), color var(--d-fast); width: 100%; }
.rail-pin:hover { background: var(--hover-surface); color: var(--ink-900); }
.rail-pin .pinic { width: 24px; height: 24px; flex-shrink: 0; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-500); transition: color var(--d-fast); }
.rail-pin:hover .pinic { color: var(--ink-900); }
.rail-pin .pinic svg { width: 18px; height: 18px; stroke-width: 2; }
.rail-pin .rl { opacity: 0; max-width: 0; overflow: hidden; transition: opacity var(--d-base); }
.app[data-railpin="true"] .rail-pin .rl, .app[data-railhover="true"] .rail-pin .rl { opacity: 1; max-width: 140px; }

/* ════ COLLAPSED RAIL: labels/wordmark take ZERO width — every row is a clean
   40px square with one centred icon. ════ */
.app:not([data-railpin="true"]):not([data-railhover="true"]) .rail-item,
.app:not([data-railpin="true"]):not([data-railhover="true"]) .rail-pin { justify-content: center; padding: 0; gap: 0; }
.app:not([data-railpin="true"]):not([data-railhover="true"]) .rail-logo { gap: 0; }
.app:not([data-railpin="true"]):not([data-railhover="true"]) .rail-item .rl,
.app:not([data-railpin="true"]):not([data-railhover="true"]) .rail-pin .rl { max-width: 0; padding: 0; }

/* ── MAIN COLUMN ───────────────────────────────────────────────── */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100vh; overflow: hidden; position: relative; z-index: 1; }

/* ── HEADER ────────────────────────────────────────────────────── */
.hdr { height: 58px; flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 0 18px; background: var(--glass-bg-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-bottom: 1px solid var(--hairline); }
.hdr.is-page { justify-content: flex-end; }
.proj-name { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: var(--r-md); border: 1px solid transparent; cursor: text; font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -0.02em; color: var(--ink-1000); background: transparent; transition: all var(--d-fast); max-width: 280px; }
.proj-name:hover { background: var(--hover-surface); border-color: var(--hairline); }
.proj-name:focus { outline: none; background: var(--bg-surface); border-color: var(--green-400); box-shadow: var(--sel-ring); }
.hdr .spacer { flex: 1; }
.brand-pick { display: inline-flex; align-items: center; gap: 9px; padding: 6px 11px 6px 7px; border-radius: var(--r-pill); border: 1px solid var(--hairline); background: var(--bg-surface); cursor: pointer; transition: all var(--d-fast); }
.brand-pick:hover { background: var(--hover-surface-2); border-color: var(--hairline-strong); }
.brand-pick .bdot { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--green-400), var(--green-700)); color: #fff; font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.brand-pick .blab { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.brand-pick .blab .k { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-500); }
.brand-pick .blab .v { font-size: 12.5px; font-weight: 600; color: var(--ink-900); }
.brand-pick svg { width: 15px; height: 15px; color: var(--ink-500); }
.mode-control { display: flex; align-items: center; gap: 8px; }
.mode-toggle button { padding: 6px 13px; font-size: 12.5px; }
.mode-toggle button svg { width: 14px; height: 14px; }
.tipwrap { position: relative; display: inline-flex; }
.info-i { width: 17px; height: 17px; border-radius: 50%; border: 1.4px solid var(--ink-400); color: var(--ink-500); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; cursor: help; font-family: var(--font-mono); }
.tipwrap:hover .info-i { border-color: var(--green-500); color: var(--green-600); }
.tip { position: absolute; top: calc(100% + 9px); right: -6px; width: 290px; z-index: 80; background: var(--ink-1000); color: var(--ink-0); padding: 13px 15px; border-radius: var(--r-md); font-size: 12px; font-weight: 400; line-height: 1.55; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transform: translateY(-5px); transition: opacity var(--d-fast), transform var(--d-fast); }
[data-theme="dark"] .tip { background: var(--bg-elevated); color: var(--ink-900); border: 1px solid var(--hairline-strong); }
.tip b { color: var(--green-400); font-weight: 700; }
[data-theme="dark"] .tip b { color: var(--green-500); }
.tip::before { content: ''; position: absolute; top: -6px; right: 12px; width: 12px; height: 12px; background: inherit; transform: rotate(45deg); }
.tipwrap:hover .tip { opacity: 1; pointer-events: auto; transform: translateY(0); }
.credits { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: var(--r-pill); background: var(--green-50); border: 1px solid var(--green-200); font-size: 12.5px; font-weight: 600; color: var(--green-800); }
[data-theme="dark"] .credits { background: rgba(34,197,94,0.1); }
.credits .coin { color: var(--green-600); }
.credits .muted { color: var(--green-700); font-weight: 500; opacity: 0.8; }
.theme-switcher button { padding: 6px 11px; font-size: 11.5px; gap: 5px; }

/* ── shared buttons ────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 600; border: 1px solid var(--hairline-strong); background: var(--bg-surface); color: var(--ink-800); cursor: pointer; transition: all var(--d-fast); white-space: nowrap; }
/* secondary/default: light hover surface, ink text stays dark + readable (both themes) */
.btn:hover { background: var(--ink-100); border-color: var(--ink-300); color: var(--ink-1000); }
.btn svg { width: 15px; height: 15px; }
/* DS refinement — primary CTA reads directly off the HexCoded DS accent.
   Text is ALWAYS white (forced, not via theme-flipping inverse token), so a green
   button never shows white-on-white. Hover = slightly DARKER green, white text kept. */
.btn-primary { background: linear-gradient(135deg, var(--amp-hexcoded-theme-color-accent), var(--amp-hexcoded-theme-color-accent-deep)); color: var(--amp-hexcoded-color-white); border: none; box-shadow: var(--shadow-green-soft); }
.btn-primary:hover { background: linear-gradient(135deg, var(--amp-hexcoded-theme-color-accent-deep), var(--green-700)); color: var(--amp-hexcoded-color-white); box-shadow: var(--shadow-green); }
.btn-ghost { border: 1px solid transparent; background: transparent; color: var(--ink-700); }
.btn-ghost:hover { background: var(--ink-100); color: var(--ink-1000); }
.btn-secondary { background: var(--bg-surface); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 12.5px; }
.btn-loading { opacity: 0.6; pointer-events: none; }

/* ── PAGE VIEWS ────────────────────────────────────────────────── */
.view { display: none; flex: 1; overflow-y: auto; min-height: 0; }
.view.on { display: block; }
#viewWork { overflow: hidden; }
#viewWork.on { display: flex; flex-direction: column; }
.page-inner { max-width: 1320px; margin: 0 auto; padding: 32px 28px 60px; }
.page-h { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 26px; }
.page-h .eyebrow { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--green-700); }
.page-h h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; margin: 7px 0 0; }
.page-h h1 em { font-style: normal; color: var(--green-600); }
.page-h .sub { font-size: 14.5px; color: var(--ink-600); margin-top: 8px; max-width: 560px; line-height: 1.55; }
.page-h .spacer { flex: 1; }
.np-hero { display: flex; align-items: center; gap: 16px; padding: 20px 22px; border-radius: var(--r-xl); cursor: pointer; background: linear-gradient(135deg, rgba(34,197,94,0.1), rgba(34,197,94,0.03)); border: 1px solid var(--green-200); transition: all var(--d-base); margin-bottom: 34px; }
.np-hero:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: var(--green-400); }
[data-theme="dark"] .np-hero { border-color: rgba(34,197,94,0.25); }
.np-hero .np-ic { width: 46px; height: 46px; border-radius: var(--r-md); background: linear-gradient(135deg, var(--green-500), var(--green-700)); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--shadow-green-soft); }
.np-hero .np-t { font-size: 16px; font-weight: 700; color: var(--ink-1000); }
.np-hero .np-s { font-size: 13px; color: var(--ink-600); margin-top: 2px; }
.np-hero .np-go { margin-left: auto; color: var(--green-600); }
.sec-label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.sec-label .gl { flex: 1; height: 1px; background: var(--hairline); }
.sec-label .more { font-family: var(--font-body); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--green-600); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 3px; }
[data-theme="dark"] .sec-label .more { color: var(--green-300); }
.sec-label .more svg { width: 13px; height: 13px; }

/* ════ HOME · "Spotlight" hero + the Product/Service/Place chooser ════ */
.hc-wrap { padding-top: 32px; }
.hc-hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl);
  padding: 52px 48px 46px; border: 1px solid var(--hairline);
  background:
    radial-gradient(120% 140% at 12% -10%, color-mix(in srgb, var(--green-500) 22%, transparent) 0%, transparent 46%),
    radial-gradient(100% 130% at 96% 8%, color-mix(in srgb, var(--green-500) 14%, transparent) 0%, transparent 50%),
    var(--bg-surface);
  box-shadow: var(--shadow-sm);
}
.hc-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 80% at 80% 120%, color-mix(in srgb, var(--green-500) 10%, transparent), transparent 70%); opacity: 0.9; animation: hc-drift 14s ease-in-out infinite alternate; }
@keyframes hc-drift { from { transform: translate3d(-3%, 2%, 0) scale(1); } to { transform: translate3d(4%, -3%, 0) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .hc-hero::after, .choose-tile, .choose-tile .arr { animation: none !important; transition: none !important; } }
.hc-hero > * { position: relative; z-index: 1; }
.hc-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--green-700); }
[data-theme="dark"] .hc-eyebrow { color: var(--green-300); }
.hc-eyebrow .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green-500); box-shadow: 0 0 0 0 color-mix(in srgb, var(--green-500) 50%, transparent); animation: hc-pulse 2.2s ease-out infinite; }
@keyframes hc-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green-500) 45%, transparent); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .hc-eyebrow .pulse { animation: none; } }
.hc-hero h1 { font-family: var(--font-display); font-size: 46px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; margin: 16px 0 0; color: var(--ink-1000); max-width: 18ch; }
.hc-hero h1 em { font-style: normal; background: linear-gradient(120deg, var(--green-500), var(--green-700)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hc-hero .lede { font-size: 15px; color: var(--ink-600); margin: 16px 0 0; max-width: 56ch; line-height: 1.6; }
.hc-speed { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; padding: 6px 13px; border-radius: var(--r-pill); background: var(--accent-soft); border: 1px solid var(--accent-border); font-size: 12.5px; font-weight: 600; color: var(--green-700); }
[data-theme="dark"] .hc-speed { color: var(--green-300); }
.hc-speed svg { width: 14px; height: 14px; }
.choose-q { display: flex; align-items: center; gap: 9px; margin: 32px 0 14px; font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink-1000); }
.choose-q .qn { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft-strong); color: var(--green-700); font-family: var(--font-mono); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
[data-theme="dark"] .choose-q .qn { color: var(--green-300); }
.choose-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 760px; }
.choose-tile { position: relative; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 0; padding: 20px 18px 18px; border-radius: var(--r-lg); border: 1px solid var(--hairline-strong); background: var(--bg-surface); box-shadow: var(--shadow-xs); transition: transform var(--d-base), box-shadow var(--d-base), border-color var(--d-base), background var(--d-base); }
.choose-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--green-400); background: color-mix(in srgb, var(--green-500) 4%, var(--bg-surface)); }
.choose-tile:focus-visible { outline: none; box-shadow: var(--sel-ring); border-color: var(--green-500); }
.choose-tile .ti { width: 46px; height: 46px; border-radius: var(--r-md); display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--green-500), var(--green-700)); color: #fff; box-shadow: var(--shadow-green-soft); margin-bottom: 15px; }
.choose-tile .ti svg { width: 22px; height: 22px; }
.choose-tile .tn { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink-1000); }
.choose-tile .tx { font-size: 12.5px; color: var(--ink-500); margin-top: 4px; line-height: 1.45; }
.choose-tile .arr { position: absolute; right: 16px; top: 20px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--green-600); display: inline-flex; align-items: center; justify-content: center; opacity: 0; transform: translateX(-4px); transition: opacity var(--d-fast), transform var(--d-fast); }
[data-theme="dark"] .choose-tile .arr { color: var(--green-300); }
.choose-tile:hover .arr { opacity: 1; transform: translateX(0); }
.choose-tile .arr svg { width: 15px; height: 15px; }
.hc-recent { margin-top: 40px; }

.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 18px; }
.pcard { border: 1px solid var(--hairline); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-surface); cursor: pointer; transition: all var(--d-base); box-shadow: var(--shadow-xs); }
.pcard:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--hairline-strong); }
.pcard .thumb { position: relative; aspect-ratio: 1.6; background: var(--media-well); overflow: hidden; }
.pcard .thumb video { width: 100%; height: 100%; object-fit: cover; }
.pcard .thumb .grade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.45)); }
.pcard .thumb .stagepill { position: absolute; left: 10px; top: 10px; font-size: 10px; font-weight: 700; padding: 4px 9px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 5px; background: rgba(0,0,0,0.55); color: #fff; backdrop-filter: blur(6px); }
.pcard .thumb .stagepill .d { width: 7px; height: 7px; border-radius: 50%; }
.pcard .thumb .stagepill .d.ready { background: var(--green-400); }
.pcard .thumb .stagepill .d.gen { background: var(--warning); animation: pulse 1.2s infinite; }
.pcard .thumb .stagepill .d.review { background: #ff9f0a; }
.pcard .thumb .stagepill .d.failed { background: var(--danger); }
.pcard .thumb .stagepill .d.setup { background: var(--ink-400); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.pcard .thumb .playbadge { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.92); color: #111; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.pcard .thumb .playbadge svg { width: 16px; height: 16px; margin-left: 2px; }
.pcard .pc-body { padding: 13px 15px 15px; }
.pcard .pc-tool { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green-700); }
.pcard .pc-name { font-size: 15px; font-weight: 700; color: var(--ink-1000); margin: 4px 0 2px; }
.pcard .pc-sub { font-size: 12px; color: var(--ink-500); }
.pcard .pc-meta { display: flex; align-items: center; gap: 8px; margin-top: 11px; font-size: 11px; color: var(--ink-500); }
.pcard .pc-meta .when { margin-left: auto; }
.proj-list { display: flex; flex-direction: column; gap: 8px; }
.prow { display: flex; align-items: center; gap: 16px; padding: 13px 16px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); cursor: pointer; transition: all var(--d-fast); }
.prow:hover { border-color: var(--hairline-strong); box-shadow: var(--shadow-xs); }
.prow .pr-thumb { width: 64px; height: 40px; border-radius: var(--r-sm); overflow: hidden; flex-shrink: 0; background: var(--media-well); }
.prow .pr-thumb video { width: 100%; height: 100%; object-fit: cover; }
.prow .pr-name { font-size: 14px; font-weight: 600; color: var(--ink-1000); }
.prow .pr-sub { font-size: 12px; color: var(--ink-500); margin-top: 1px; }
.prow .pr-stage { margin-left: auto; font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 6px; }
.prow .pr-stage .d { width: 7px; height: 7px; border-radius: 50%; }
.pr-stage.ready { background: var(--green-50); color: var(--green-700); } .pr-stage.ready .d { background: var(--green-500); }
[data-theme="dark"] .pr-stage.ready { background: rgba(34,197,94,0.12); color: var(--green-400); }
.pr-stage.gen { background: var(--warn-soft); color: var(--warn-ink); } .pr-stage.gen .d { background: var(--warning); animation: pulse 1.2s infinite; }
[data-theme="dark"] .pr-stage.gen { color: var(--warning); }
.pr-stage.review { background: var(--warn-soft); color: var(--warn-ink); } .pr-stage.review .d { background: #ff9f0a; }
.pr-stage.failed { background: var(--danger-soft); color: var(--danger); } .pr-stage.failed .d { background: var(--danger); }
.pr-stage.setup { background: var(--ink-100); color: var(--ink-600); } .pr-stage.setup .d { background: var(--ink-400); }
.prow .pr-when { font-size: 11px; color: var(--ink-400); width: 64px; text-align: right; }
.proj-detail-thumb { position: relative; width: 140px; height: 100px; flex-shrink: 0; border-radius: var(--r-md); overflow: hidden; background: var(--ink-100); }
.proj-detail-thumb video { width: 100%; height: 100%; object-fit: cover; }
.proj-detail-thumb .playbadge { position: absolute; bottom: 7px; right: 7px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,0.55); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; color: #fff; }
.proj-detail-thumb .playbadge svg { width: 14px; height: 14px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.lib-card { border: 1px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; background: var(--bg-surface); cursor: pointer; transition: all var(--d-base); }
.lib-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.lib-card .lc-thumb { position: relative; aspect-ratio: 0.5625; background: var(--media-well); }
.lib-card .lc-thumb video { width: 100%; height: 100%; object-fit: cover; }
.lib-card .lc-badge { position: absolute; right: 8px; top: 8px; font-size: 9px; font-weight: 700; padding: 3px 7px; border-radius: var(--r-pill); background: var(--green-600); color: #fff; display: inline-flex; align-items: center; gap: 4px; }
.lib-card .lc-badge.flag { background: #ff9f0a; }
.lib-card .lc-badge svg { width: 10px; height: 10px; }
.lib-card .lc-body { padding: 9px 11px 11px; }
.lib-card .lc-n { font-size: 12px; font-weight: 600; color: var(--ink-900); }
.lib-card .lc-s { font-size: 10.5px; color: var(--ink-500); margin-top: 2px; }
.stub-note { font-size: 12.5px; color: var(--ink-500); background: var(--ink-50); border: 1px dashed var(--hairline-strong); border-radius: var(--r-md); padding: 14px 16px; line-height: 1.55; margin-top: 8px; }
[data-theme="dark"] .stub-note { background: var(--bg-elevated); }
.stub-note b { color: var(--ink-800); }

/* ═══ ASSET LIBRARY — browse surface (built on shared primitives) ═══ */
.lib-count { font-size: 12px; font-weight: 600; color: var(--ink-500); background: var(--ink-50); border: 1px solid var(--hairline); border-radius: var(--r-pill); padding: 6px 13px; white-space: nowrap; }
[data-theme="dark"] .lib-count { background: var(--bg-elevated); }
.lib-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.lib-toolbar .lib-search { flex: 1; }
.lib-search-clear { border: none; background: transparent; cursor: pointer; color: var(--ink-400); width: 30px; height: 30px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lib-search-clear:hover { background: var(--ink-100); color: var(--ink-700); }
.lib-search-clear svg { width: 14px; height: 14px; }

.lib-filterbar { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 14px 0 4px; margin-bottom: 22px; border-bottom: 1px solid var(--hairline); }
.lib-fgroup { display: flex; flex-direction: column; gap: 6px; padding-bottom: 14px; }
.lib-fgl { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-400); }
.lib-filterbar .chip { padding: 6px 11px; font-size: 12px; }

.lib-group { margin-bottom: 30px; }
.lib-group .sec-label .g-n { background: var(--ink-100); color: var(--ink-600); font-size: 10px; padding: 1px 7px; border-radius: var(--r-pill); }
[data-theme="dark"] .lib-group .sec-label .g-n { background: var(--bg-elevated); }

/* grid card — reuses .lib-card shell, .thumb pattern from home cards */
.lib-card .thumb { position: relative; aspect-ratio: 0.5625; background: var(--media-well); overflow: hidden; }
.lib-card .thumb.sq { aspect-ratio: 1; }
.lib-card .thumb.wide { aspect-ratio: 1.778; }
.lib-card .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-card .lc-grade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,0.18), transparent 30%, transparent 70%, rgba(0,0,0,0.28)); }
.lib-card .lc-like { position: absolute; left: 8px; top: 8px; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,0.92); color: var(--green-600); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.lib-card .lc-like.off { color: var(--ink-500); }
.lib-card .lc-like svg { width: 12px; height: 12px; }
.lib-card .lc-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) scale(0.9); width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.92); color: var(--ink-1000); display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: all var(--d-fast); box-shadow: var(--shadow-md); }
.lib-card .lc-play svg { width: 16px; height: 16px; }
.lib-card:hover .lc-play { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.lib-card .lc-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-size: 10px; color: var(--ink-400); }
.lib-card .lc-meta .when { flex-shrink: 0; }

/* list view */
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-row { display: grid; grid-template-columns: 56px 1fr auto auto auto; align-items: center; gap: 14px; padding: 8px 14px 8px 8px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); cursor: pointer; transition: all var(--d-fast); }
.lib-row:hover { border-color: var(--green-300); box-shadow: var(--shadow-sm); }
.lib-row .lr-thumb { position: relative; width: 56px; aspect-ratio: 0.5625; border-radius: var(--r-sm); overflow: hidden; background: var(--media-well); }
.lib-row .lr-thumb video { width: 100%; height: 100%; object-fit: cover; }
.lib-row .lr-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; opacity: 0; transition: opacity var(--d-fast); }
.lib-row .lr-play svg { width: 14px; height: 14px; }
.lib-row:hover .lr-play { opacity: 1; }
.lib-row .lr-n { font-size: 13px; font-weight: 600; color: var(--ink-900); display: flex; align-items: center; gap: 7px; }
.lib-row .lr-like { color: var(--green-600); display: inline-flex; }
.lib-row .lr-like svg { width: 13px; height: 13px; }
.lib-row .lr-s { font-size: 11.5px; color: var(--ink-500); margin-top: 2px; }
.lib-row .lr-proj { font-size: 11.5px; color: var(--ink-600); white-space: nowrap; }
.lib-row .lr-when { font-size: 11px; color: var(--ink-400); white-space: nowrap; width: 72px; text-align: right; }
@media (max-width: 720px) { .lib-row { grid-template-columns: 56px 1fr auto; } .lib-row .lr-proj, .lib-row .lr-when { display: none; } }

/* empty state */
.lib-empty { text-align: center; padding: 60px 24px; max-width: 460px; margin: 0 auto; }
.lib-empty .le-ic { width: 54px; height: 54px; border-radius: 50%; background: var(--ink-50); border: 1px solid var(--hairline); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px; color: var(--ink-400); }
[data-theme="dark"] .lib-empty .le-ic { background: var(--bg-elevated); }
.lib-empty .le-ic svg { width: 24px; height: 24px; }
.lib-empty .le-t { font-size: 17px; font-weight: 700; color: var(--ink-900); letter-spacing: -0.01em; }
.lib-empty .le-s { font-size: 13px; color: var(--ink-500); line-height: 1.55; margin: 8px 0 20px; }

/* asset detail popup */
.asset-detail { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 26px; align-items: start; }
.asset-detail .ad-left { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.asset-detail .ad-left .res-player { width: 100%; max-width: 280px; }
.asset-detail .ad-left .res-player.ar-9x16 { aspect-ratio: 0.5625; height: auto; }
.asset-detail .ad-left .res-player.ar-1x1 { aspect-ratio: 1; height: auto; }
.asset-detail .ad-left .res-player.ar-16x9 { aspect-ratio: 1.778; height: auto; }
.asset-detail .ad-likebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.asset-detail .ad-likebar .ra-btn { height: 32px; padding: 0 12px; }
.asset-detail .ad-sec { margin-bottom: 22px; }
.asset-detail .ad-sec:last-child { margin-bottom: 0; }
.asset-detail .ad-h { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); margin-bottom: 12px; display: flex; align-items: center; gap: 9px; }
.asset-detail .ad-h-n { background: var(--ink-100); color: var(--ink-600); font-size: 10px; padding: 1px 7px; border-radius: var(--r-pill); }
[data-theme="dark"] .asset-detail .ad-h-n { background: var(--bg-elevated); }

.asset-act { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 13px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); cursor: pointer; transition: all var(--d-fast); margin-bottom: 8px; }
.asset-act:hover { border-color: var(--green-300); background: var(--ink-50); }
[data-theme="dark"] .asset-act:hover { background: var(--bg-elevated); }
.asset-act .aa-ic { width: 32px; height: 32px; flex-shrink: 0; border-radius: var(--r-sm); background: var(--green-50); color: var(--green-700); display: inline-flex; align-items: center; justify-content: center; }
[data-theme="dark"] .asset-act .aa-ic { background: rgba(34,197,94,0.12); color: var(--green-300); }
.asset-act .aa-ic svg { width: 16px; height: 16px; }
.asset-act .aa-tx { flex: 1; display: flex; flex-direction: column; }
.asset-act .aa-n { font-size: 13px; font-weight: 600; color: var(--ink-900); }
.asset-act .aa-s { font-size: 11.5px; color: var(--ink-500); margin-top: 1px; }
.asset-act .aa-go { width: 15px; height: 15px; color: var(--ink-400); flex-shrink: 0; }

.ver-list { display: flex; flex-direction: column; gap: 8px; }
.ver-row { display: flex; align-items: center; gap: 11px; padding: 8px; border: 1px solid var(--hairline); border-radius: var(--r-sm); background: var(--bg-surface); }
.ver-row.current { border-color: var(--green-200); background: var(--green-50); }
[data-theme="dark"] .ver-row.current { background: rgba(34,197,94,0.07); border-color: rgba(34,197,94,0.25); }
.ver-row .ver-thumb { width: 34px; aspect-ratio: 0.5625; border-radius: var(--r-xs); overflow: hidden; background: var(--media-well); flex-shrink: 0; }
.ver-row .ver-thumb video { width: 100%; height: 100%; object-fit: cover; }
.ver-row .ver-tx { flex: 1; display: flex; flex-direction: column; }
.ver-row .ver-v { font-size: 12px; font-weight: 700; color: var(--ink-900); display: flex; align-items: center; gap: 7px; }
.ver-row .ver-tag { font-size: 8.5px; font-weight: 700; color: var(--green-700); background: var(--green-100); padding: 1px 6px; border-radius: var(--r-pill); }
[data-theme="dark"] .ver-row .ver-tag { background: rgba(34,197,94,0.15); color: var(--green-300); }
.ver-row .ver-lbl { font-size: 11px; color: var(--ink-500); margin-top: 1px; }
.ver-row .btn-sm { flex-shrink: 0; }

.rights-card { border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 14px 15px; background: var(--bg-surface); }
.rights-head { margin-bottom: 12px; }
.rights-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: var(--r-pill); background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-200); }
[data-theme="dark"] .rights-pill { background: rgba(34,197,94,0.1); color: var(--green-300); }
.rights-pill.off { background: var(--warn-soft); color: var(--warn-ink); border-color: var(--warn-border); }
.rights-pill svg { width: 13px; height: 13px; }
.rights-grid { display: flex; flex-direction: column; gap: 0; }
.rights-row { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--hairline); font-size: 12.5px; }
.rights-row:first-child { border-top: none; }
.rights-row .rr-k { width: 100px; flex-shrink: 0; color: var(--ink-500); font-weight: 600; }
.rights-row .rr-v { color: var(--ink-900); }
.rights-note { display: flex; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--ink-50); font-size: 11.5px; color: var(--ink-600); line-height: 1.5; }
[data-theme="dark"] .rights-note { background: var(--bg-elevated); }
.rights-note svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--ink-400); margin-top: 1px; }
@media (max-width: 760px) { .asset-detail { grid-template-columns: 1fr; } .asset-detail .ad-left .res-player { max-width: 220px; } }

/* ── WORK AREA ─────────────────────────────────────────────────── */
.work { flex: 1; display: grid; grid-template-columns: 332px minmax(0,1fr) 0px; min-height: 0; overflow: hidden; transition: grid-template-columns var(--d-slow) var(--ease-out); }
.work > * { min-width: 0; min-height: 0; }
.work[data-editor-open="true"] { grid-template-columns: 332px minmax(0,1fr) 420px; }

/* ── LEFT · NUMBERED CHECKLIST ─────────────────────────────────── */
.inputs { border-right: 1px solid var(--hairline); background: var(--bg-surface); display: flex; flex-direction: column; overflow: hidden; }
.inputs-scroll { flex: 1; overflow-y: auto; padding: 16px 14px 12px; }
.inputs-foot { flex-shrink: 0; border-top: 1px solid var(--hairline); background: var(--glass-bg-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); padding: 12px 14px 14px; }
/* view-only banner after generation */
.viewonly-bar { display: none; align-items: center; gap: 10px; padding: 11px 13px; margin-bottom: 12px; border-radius: var(--r-md); background: var(--ink-50); border: 1px solid var(--hairline); }
.work[data-locked="true"] .viewonly-bar { display: flex; }
[data-theme="dark"] .viewonly-bar { background: var(--bg-elevated); }
.viewonly-bar .lock-ic { color: var(--ink-500); flex-shrink: 0; } .viewonly-bar .lock-ic svg { width: 16px; height: 16px; }
.viewonly-bar .vb-tx { flex: 1; min-width: 0; }
.viewonly-bar .vb-t { font-size: 12px; font-weight: 700; color: var(--ink-900); }
.viewonly-bar .vb-s { font-size: 10.5px; color: var(--ink-500); margin-top: 1px; line-height: 1.4; }
.ck-progress { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.work[data-locked="true"] .ck-progress { display: none; }
.ck-progress .ck-bar { flex: 1; height: 6px; border-radius: var(--r-pill); background: var(--ink-200); overflow: hidden; }
.ck-progress .ck-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--green-400), var(--green-600)); transition: width var(--d-base) var(--ease-out); }
.ck-progress .ck-lbl { font-size: 11.5px; font-weight: 600; color: var(--green-700); white-space: nowrap; }
.ck-group { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-500); padding: 0 8px; margin: 16px 0 6px; display: flex; align-items: center; gap: 8px; }
.ck-group:first-of-type { margin-top: 2px; }
.ck-group .gline { flex: 1; height: 1px; background: var(--hairline); }
.ck-row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 10px; border-radius: var(--r-md); border: 1px solid transparent; background: transparent; cursor: pointer; text-align: left; transition: background var(--d-fast), border-color var(--d-fast); margin-bottom: 2px; }
.ck-row:hover { background: var(--hover-surface-2); border-color: var(--hairline); }
.work[data-locked="true"] .ck-row { cursor: default; }
.work[data-locked="true"] .ck-row:hover { background: transparent; border-color: transparent; }
.ck-tick { width: 23px; height: 23px; flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 11px; font-weight: 700; background: var(--accent-chip-bg); color: var(--accent-chip-ink); border: 1.5px solid transparent; transition: all var(--d-fast); }
.ck-tick svg { width: 13px; height: 13px; }
.ck-tick.todo { background: var(--bg-surface); border-color: var(--ink-300); color: var(--ink-400); }
.ck-tx { flex: 1; min-width: 0; }
.ck-nm { display: block; font-size: 13px; font-weight: 600; color: var(--ink-900); letter-spacing: -0.01em; }
.ck-nm .opt { font-size: 9.5px; font-weight: 600; color: var(--ink-400); margin-left: 5px; }
.ck-vl { display: block; font-size: 11.5px; color: var(--ink-500); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck-go { color: var(--ink-400); display: inline-flex; }
.work[data-locked="true"] .ck-go { display: none; }
.ck-go svg { width: 15px; height: 15px; }
/* cost strip */
.gen-cost { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.gen-cost .gen-cost-num { display: flex; align-items: baseline; gap: 6px; }
.gen-cost .csn { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink-1000); font-family: var(--font-display); }
.gen-cost .csu { font-size: 11.5px; color: var(--ink-500); font-weight: 500; }
.gen-cost .spacer { flex: 1; }
.gen-cost .cs-detail { font-size: 11px; color: var(--green-600); font-weight: 600; cursor: pointer; background: none; border: none; }
.gen-cost .cs-detail:hover { text-decoration: underline; }
#generateBtn { width: 100%; height: 46px; }
#newVideoBtn { width: 100%; height: 46px; display: none; }
.work[data-locked="true"] #generateBtn { display: none; }
.work[data-locked="true"] #newVideoBtn { display: inline-flex; }
.work[data-locked="true"] .gen-cost { display: none; }
.credit-short { display: none; align-items: center; gap: 8px; margin-bottom: 11px; padding: 9px 11px; border-radius: var(--r-md); background: var(--warn-soft); border: 1px solid var(--warn-border); }
.inputs-foot[data-short="true"] .credit-short { display: flex; }
.work[data-locked="true"] .credit-short { display: none !important; }
.credit-short .cs-warn { flex: 1; font-size: 11.5px; font-weight: 600; color: var(--warn-ink); }

/* ── CENTER · CANVAS ───────────────────────────────────────────── */
.canvas { position: relative; overflow: hidden; display: flex; flex-direction: column; background: radial-gradient(1200px 600px at 50% -10%, rgba(34,197,94,0.05), transparent 60%), var(--bg-canvas); }
.canvas-bar { height: 46px; flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--hairline); background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.canvas-bar .ctitle { font-size: 12.5px; font-weight: 600; color: var(--ink-700); display: flex; align-items: center; gap: 8px; }
.canvas-bar .ctitle .dotgrn { width: 7px; height: 7px; border-radius: 50%; background: var(--green-500); }
.canvas-bar .spacer { flex: 1; }
.canvas-bar .ar-pill { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; color: var(--ink-700); padding: 4px 9px; border-radius: var(--r-pill); border: 1px solid var(--hairline-strong); background: var(--bg-surface); }
.canvas-stage { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 28px; position: relative; }
/* the player frame — reshapes to aspect */
.frame { position: relative; background: var(--media-well); overflow: hidden; border-radius: var(--r-xl); box-shadow: var(--shadow-xl); border: 1px solid rgba(255,255,255,0.06); transition: width var(--d-stately) var(--ease-out), height var(--d-stately) var(--ease-out); }
.frame.ar-9x16 { width: 322px; height: 572px; }
/* ── BRANDED MOTION-GRAPHIC preview (no photo, no video) — animated green mesh ──
   Shared by the setup PREVIEW (.frame) and the GENERATING screen (.gen-frame). */
.frame .mg-mesh, .gen-frame .mg-mesh { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(120% 90% at 50% 0%, #0e2a1a, #07120c 70%); }
.frame .mg-blob, .gen-frame .mg-blob { position: absolute; border-radius: 50%; filter: blur(34px); opacity: 0.85; mix-blend-mode: screen; }
.frame .mg-blob.b1, .gen-frame .mg-blob.b1 { width: 62%; height: 42%; left: -12%; top: 6%; background: radial-gradient(circle, #22C55E, transparent 68%); animation: mgFloat1 9s ease-in-out infinite; }
.frame .mg-blob.b2, .gen-frame .mg-blob.b2 { width: 70%; height: 50%; right: -18%; top: 28%; background: radial-gradient(circle, #16A34A, transparent 70%); animation: mgFloat2 11s ease-in-out infinite; }
.frame .mg-blob.b3, .gen-frame .mg-blob.b3 { width: 56%; height: 40%; left: 12%; bottom: -8%; background: radial-gradient(circle, #86EFAC, transparent 72%); opacity: 0.55; animation: mgFloat3 13s ease-in-out infinite; }
@keyframes mgFloat1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(18%,12%) scale(1.18); } }
@keyframes mgFloat2 { 0%,100% { transform: translate(0,0) scale(1.05); } 50% { transform: translate(-14%,-10%) scale(0.9); } }
@keyframes mgFloat3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(10%,-14%) scale(1.2); } }
.frame .mg-grid, .gen-frame .mg-grid { position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(34,197,94,0.10) 1px, transparent 1px), linear-gradient(90deg, rgba(34,197,94,0.10) 1px, transparent 1px); background-size: 26px 26px; mask-image: radial-gradient(120% 90% at 50% 30%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(120% 90% at 50% 30%, #000 30%, transparent 75%); }
.frame .mg-scan { position: absolute; left: 0; right: 0; height: 30%; top: -30%; pointer-events: none; background: linear-gradient(180deg, transparent, rgba(34,197,94,0.14), transparent); animation: mgScan 3.6s linear infinite; }
@keyframes mgScan { 0% { top: -30%; } 100% { top: 100%; } }
/* shimmer particles — fine drifting green specks for a premium, alive feel */
.frame .mg-spark, .gen-frame .mg-spark { position: absolute; inset: 0; pointer-events: none; opacity: 0.9; mix-blend-mode: screen;
  background-image:
    radial-gradient(1.4px 1.4px at 18% 24%, rgba(134,239,172,0.9), transparent 60%),
    radial-gradient(1.2px 1.2px at 62% 12%, rgba(34,197,94,0.85), transparent 60%),
    radial-gradient(1.6px 1.6px at 80% 46%, rgba(134,239,172,0.8), transparent 60%),
    radial-gradient(1.2px 1.2px at 34% 64%, rgba(34,197,94,0.8), transparent 60%),
    radial-gradient(1.5px 1.5px at 70% 80%, rgba(134,239,172,0.85), transparent 60%),
    radial-gradient(1.2px 1.2px at 12% 86%, rgba(34,197,94,0.75), transparent 60%);
  animation: mgSpark 6s ease-in-out infinite; }
@keyframes mgSpark { 0%,100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-10px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .frame .mg-blob, .frame .mg-scan, .frame .mg-spark, .gen-frame .mg-spark, .gen-frame .mg-blob, .gen-frame .mg-scan { animation: none; } }
.prev-badge { position:absolute; left:50%; top:14px; transform:translateX(-50%); z-index:6; display:inline-flex; align-items:center; gap:6px; font-family:var(--font-mono); font-size:10px; font-weight:700; letter-spacing:0.05em; text-transform:uppercase; color:#fff; background:rgba(0,0,0,0.55); padding:5px 11px; border-radius:var(--r-pill); backdrop-filter:blur(6px); }
.prev-badge svg { width:13px; height:13px; }
.frame.ar-1x1  { width: 470px; height: 470px; }
.frame.ar-4x5  { width: 424px; height: 530px; }
.frame.ar-16x9 { width: 680px; height: 382px; }
.frame video.fv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--media-well); }
.frame .grade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(160deg, rgba(34,197,94,0.06), transparent 38%), linear-gradient(0deg, rgba(0,0,0,0.5), transparent 52%); }
.ov-cap { position: absolute; left: 16px; right: 16px; bottom: 70px; text-align: center; pointer-events: none; transition: all var(--d-base); }
.ov-cap .line { display: inline-block; font-family: var(--amp-hexcoded-font-display), Outfit, sans-serif; font-weight: 900; font-size: 17px; letter-spacing: -0.02em; color: #fff; line-height: 1.18; padding: 2px 6px;
  /* PHANTOM stepped green shadow (1/2/3px · 85/55/32%) — breathes on a 3s cycle */
  text-shadow: 1px 1px 0 rgba(34,197,94,0.85), 2px 2px 0 rgba(34,197,94,0.55), 3px 3px 0 rgba(34,197,94,0.32), 0 2px 12px rgba(0,0,0,0.6);
  animation: capPhantom 3s ease-in-out infinite; }
@keyframes capPhantom { 0%,100% { text-shadow: 1px 1px 0 rgba(34,197,94,0.85), 2px 2px 0 rgba(34,197,94,0.55), 3px 3px 0 rgba(34,197,94,0.32), 0 2px 12px rgba(0,0,0,0.6); } 50% { text-shadow: 1px 1px 0 rgba(34,197,94,0.34), 2px 2px 0 rgba(34,197,94,0.22), 3px 3px 0 rgba(34,197,94,0.13), 0 2px 12px rgba(0,0,0,0.6); } }
@media (prefers-reduced-motion: reduce) { .ov-cap .line { animation: none; } }
.ov-cap .line em { font-style: normal; color: var(--green-300); }
.ov-cap.pos-top { bottom: auto; top: 24px; } .ov-cap.pos-mid { bottom: auto; top: 46%; } .ov-cap.pos-bot { bottom: 70px; }
.ov-cap.clean .line { background: rgba(0,0,0,0.5); border-radius: 6px; } .ov-cap.minimal .line { font-weight: 600; font-size: 14px; }
.ov-cap.off { display: none; }
.ov-super { position: absolute; left: 16px; bottom: 18px; pointer-events: none; }
.ov-super .card { background: rgba(255,255,255,0.94); border-radius: var(--r-md); padding: 7px 12px; box-shadow: 0 8px 20px rgba(0,0,0,0.3); font-size: 11.5px; font-weight: 700; color: var(--ink-1000); }
.ov-super.off { display: none; }
.ov-cast { position: absolute; left: 14px; top: 14px; pointer-events: none; }
.ov-cast .card { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.45); backdrop-filter: blur(8px); border-radius: var(--r-pill); padding: 4px 12px 4px 4px; }
.ov-cast .card img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.ov-cast .card .nm { font-size: 11px; font-weight: 600; color: #fff; }
.ov-cast .card .badge { font-size: 8px; font-weight: 700; color: #fff; background: var(--green-600); padding: 2px 5px; border-radius: var(--r-xs); }
.ov-cast.off { display: none; }
/* custom scrubber */
.scrub { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px 12px; background: linear-gradient(0deg, rgba(0,0,0,0.7), transparent); display: flex; align-items: center; gap: 11px; opacity: 0; transition: opacity var(--d-base); z-index: 5; }
.frame:hover .scrub, .frame.scrubshow .scrub { opacity: 1; }
.scrub .pp { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; border: none; background: rgba(255,255,255,0.92); color: var(--ink-1000); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.scrub .pp svg { width: 16px; height: 16px; }
.scrub .track { flex: 1; height: 5px; border-radius: var(--r-pill); background: rgba(255,255,255,0.28); cursor: pointer; position: relative; }
.scrub .track .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--r-pill); background: var(--green-400); width: 0%; }
.scrub .track .knob { position: absolute; top: 50%; transform: translate(-50%,-50%); width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.5); left: 0%; }
.scrub .tlabel { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; color: #fff; white-space: nowrap; min-width: 74px; text-align: right; }
.frame-hint { position: absolute; left: 50%; bottom: -32px; transform: translateX(-50%); font-size: 11.5px; color: var(--ink-500); white-space: nowrap; }

/* ── EMPTY / FIRST-RUN ─────────────────────────────────────────── */
.empty-stage { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: var(--bg-canvas); padding: 24px; }
.empty-stage.off { display: none; }
.empty-card { max-width: 560px; text-align: center; }
.empty-card .eyebrow { display: inline-block; margin-bottom: 14px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--green-700); background: var(--green-50); border: 1px solid var(--green-200); border-radius: var(--r-pill); padding: 5px 12px; }
[data-theme="dark"] .empty-card .eyebrow { background: rgba(34,197,94,0.1); }
.empty-card h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.12; margin: 0 0 12px; }
.empty-card h1 em { font-style: normal; color: var(--green-600); }
.empty-card .lead { font-size: 15px; color: var(--ink-600); line-height: 1.55; max-width: 460px; margin: 0 auto 26px; }
.empty-card .start-btn { margin: 0 auto; }

/* ── GENERATION (cinematic single-stage, plain grey, correct aspect) ── */
.gen-stage { position: absolute; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 22px; padding: 30px; background: var(--bg-soft); }
[data-theme="dark"] .gen-stage { background: var(--bg-canvas); }
.gen-stage.on { display: flex; }
.gen-frame { position: relative; background: #16161a; border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-xl); border: 1px solid var(--hairline); transition: width var(--d-stately) var(--ease-out), height var(--d-stately) var(--ease-out); }
.gen-frame.ar-9x16 { width: 270px; height: 480px; }
.gen-frame.ar-1x1  { width: 400px; height: 400px; }
.gen-frame.ar-4x5  { width: 360px; height: 450px; }
.gen-frame.ar-16x9 { width: 540px; height: 304px; }
.gen-frame .mg-mesh { transform: scale(1.04); filter: saturate(0.9); transition: transform 1.1s, filter 1.1s; }
.gen-frame[data-phase="build"] .mg-mesh, .gen-frame[data-phase="caption"] .mg-mesh, .gen-frame[data-phase="done"] .mg-mesh { transform: scale(1); filter: saturate(1.05); }
.gen-frame .brandtint { position: absolute; inset: 0; background: linear-gradient(150deg, rgba(34,197,94,0.28), transparent 48%), linear-gradient(0deg, rgba(0,0,0,0.55), transparent 55%); opacity: 0.35; transition: opacity 1s; }
.gen-frame[data-phase="caption"] .brandtint, .gen-frame[data-phase="done"] .brandtint { opacity: 1; }
.gen-frame .scanline { position: absolute; left: 0; right: 0; height: 32%; background: linear-gradient(180deg, transparent, rgba(34,197,94,0.16), transparent); top: -32%; animation: scan 2.4s linear infinite; pointer-events: none; }
@keyframes scan { 0% { top: -32%; } 100% { top: 100%; } }
.gen-frame .grain { position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px); background-size: 3px 3px; pointer-events: none; }
.gen-frame .assembling { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: #fff; background: rgba(0,0,0,0.5); padding: 5px 11px; border-radius: var(--r-pill); }
.gen-frame .assembling .sp { width: 11px; height: 11px; border: 2px solid rgba(255,255,255,0.3); border-top-color: var(--green-400); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Generic spinner class — apply to any svg/icon you want rotating. Used by
   the wizard's "Reading your product page…" loader on the URL → Ad Next +
   Go buttons, and by the actor-panel voice-preview loader. */
.spin { animation: spin 0.8s linear infinite; transform-origin: center; }
/* Placeholder shimmer for loading text bars — used by PlanView while
   adjustPlan is in flight and a field is being regenerated. */
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.gen-frame .forming-cap { position: absolute; left: 14px; right: 14px; bottom: 40px; text-align: center; color: #fff; font-weight: 800; font-size: 17px; text-shadow: 0 2px 10px rgba(0,0,0,0.7); opacity: 0; transition: opacity 0.8s; }
.gen-frame[data-phase="caption"] .forming-cap, .gen-frame[data-phase="done"] .forming-cap { opacity: 1; }
.gen-frame .forming-cap em { font-style: normal; color: var(--green-300); }
.gen-frame .ar-tag { position: absolute; right: 10px; top: 10px; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; color: #fff; background: rgba(0,0,0,0.5); padding: 3px 8px; border-radius: var(--r-pill); }
.gen-info { width: 100%; max-width: 460px; text-align: center; }
.gen-info .gt { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink-1000); }
.gen-info .gs { font-size: 13px; color: var(--ink-600); margin-top: 4px; line-height: 1.5; }
.gen-ring { display: flex; align-items: center; justify-content: center; gap: 13px; margin: 16px 0 16px; }
.gen-ring .ring { width: 48px; height: 48px; flex-shrink: 0; }
.gen-ring .pct { font-size: 24px; font-weight: 800; font-family: var(--font-display); color: var(--ink-1000); }
.gen-checks { display: inline-flex; flex-direction: column; gap: 7px; text-align: left; }
.gen-check { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-400); opacity: 0.4; transition: all var(--d-base); }
.gen-check.in { opacity: 1; }
.gen-check.ok { color: var(--ink-800); }
.gen-check .cdot { width: 17px; height: 17px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--ink-300); display: inline-flex; align-items: center; justify-content: center; }
.gen-check.ok .cdot { background: var(--green-500); border-color: var(--green-500); }
.gen-check .cdot svg { width: 11px; height: 11px; color: #fff; }
.gen-batchnote { font-size: 11.5px; color: var(--ink-500); }
/* ── BATCH / COMPARE progress grid — per-item status (some Ready, some Generating, one Failed) ── */
.gen-batchgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; width: 100%; max-width: 460px; }
.gbi { border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); overflow: hidden; text-align: left; }
.gbi .gbi-vid { position: relative; aspect-ratio: 1.6; background: var(--media-well); overflow: hidden; }
.gbi .gbi-vid .ph-mesh { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 0%, #0e2a1a, #07120c 70%); opacity: .9; }
.gbi .gbi-vid video { width: 100%; height: 100%; object-fit: cover; }
.gbi .gbi-spin { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.gbi .gbi-spin .sp { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,0.25); border-top-color: var(--green-400); animation: tspin .8s linear infinite; }
@keyframes tspin { to { transform: rotate(360deg); } }
.gbi .gbi-fx { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--danger); }
.gbi .gbi-fx svg { width: 22px; height: 22px; }
.gbi .gbi-body { padding: 7px 9px 8px; display: flex; align-items: center; gap: 6px; }
.gbi .gbi-n { font-size: 11px; font-weight: 600; color: var(--ink-1000); flex: 1; min-width: 0; }
.gbi .gbi-st { font-size: 9.5px; font-weight: 700; letter-spacing: 0.03em; padding: 2px 7px; border-radius: var(--r-pill); white-space: nowrap; }
.gbi .gbi-st.ready { background: var(--green-50); color: var(--green-700); }
[data-theme="dark"] .gbi .gbi-st.ready { background: color-mix(in srgb, var(--green-500) 14%, transparent); color: var(--green-300); }
.gbi .gbi-st.gen { background: var(--warn-soft); color: var(--warn-ink); }
.gbi .gbi-st.fail { background: var(--danger-soft); color: var(--danger); }
.gbi.is-fail { border-color: var(--danger-border); }
.gbi.is-ready { border-color: var(--green-300); }
/* background-run reassurance + notify affordance (behavioural copy; full notif UI later) */
.gen-bg { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 16px; padding: 11px 14px; border-radius: var(--r-md); background: var(--ink-50); border: 1px solid var(--hairline); max-width: 460px; }
[data-theme="dark"] .gen-bg { background: var(--bg-elevated); }
.gen-bg > i { color: var(--green-600); flex-shrink: 0; width: 16px; height: 16px; }
.gen-bg .gen-bg-tx { flex: 1; min-width: 180px; font-size: 11.5px; line-height: 1.45; color: var(--ink-600); text-align: left; }
.gen-bg .gen-bg-eta { display: inline-block; font-weight: 700; color: var(--green-700); }
[data-theme="dark"] .gen-bg .gen-bg-eta { color: var(--green-300); }
.gen-bg .gen-bg-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: var(--r-pill); border: 1px solid var(--hairline-strong); background: var(--bg-surface); cursor: pointer; font-size: 11.5px; font-weight: 600; color: var(--ink-800); transition: all var(--d-fast); }
.gen-bg .gen-bg-btn:hover { background: var(--ink-100); color: var(--ink-1000); border-color: var(--ink-300); }
.gen-bg .gen-bg-btn svg { width: 13px; height: 13px; }
.gen-bg .gen-bg-btn.ghost { border-color: transparent; background: transparent; color: var(--ink-500); }
.gen-bg .gen-bg-btn.ghost:hover { background: var(--ink-100); color: var(--ink-1000); }

/* ── RESULTS (responsive: gallery on large, centered on small) ──── */
.results-stage { position: absolute; inset: 0; z-index: 30; display: none; flex-direction: column; }
.results-stage.on { display: flex; }
.results-head { flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 13px 22px; border-bottom: 1px solid var(--hairline); background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.results-head .rh-t { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.results-head .rh-s { font-size: 12px; color: var(--ink-500); margin-top: 1px; }
.results-head .spacer { flex: 1; }
.res-body { flex: 1; overflow: hidden; display: flex; min-height: 0; min-width: 0; }
/* gallery rail (large) */
.res-gallery { width: 218px; flex-shrink: 0; border-right: 1px solid var(--hairline); overflow-y: auto; padding: 14px; background: var(--bg-surface); }
.res-gallery .rg-label { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-500); margin-bottom: 11px; }
.rg-thumb { position: relative; width: 100%; border: 1.5px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; background: var(--bg-surface); cursor: pointer; margin-bottom: 9px; transition: all var(--d-fast); padding: 0; text-align: left; display: block; }
.rg-thumb:hover { border-color: var(--ink-300); }
.rg-thumb.on { border-color: var(--green-500); box-shadow: var(--sel-ring); }
.rg-thumb .rt-vid { position: relative; aspect-ratio: 1.6; background: var(--media-well); overflow: hidden; }
.rg-thumb .rt-vid video { width: 100%; height: 100%; object-fit: cover; }
.rg-thumb .rt-grade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.45)); pointer-events: none; }
.rg-thumb .rt-eng { position: absolute; left: 7px; top: 7px; font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; color: #fff; background: rgba(0,0,0,0.55); padding: 2px 7px; border-radius: var(--r-pill); backdrop-filter: blur(4px); }
.rg-thumb .rt-body { padding: 7px 9px 9px; }
.rg-thumb .rt-look { font-size: 11.5px; font-weight: 700; color: var(--ink-1000); }
.rg-thumb .rt-meta { font-size: 10px; color: var(--ink-500); margin-top: 1px; }
/* detail / player area — scrolls when content exceeds the viewport.
   justify-content:flex-start (not center) so the TOP stays reachable when overflowing;
   auto-margins on the inner block keep it visually centred when there IS room. */
.res-detail { flex: 1; min-width: 0; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 14px; padding: 22px; background: radial-gradient(700px 360px at 50% 0%, rgba(34,197,94,0.05), transparent 60%), var(--bg-soft); }
.res-detail > :first-child { margin-top: auto; }
.res-detail > :last-child { margin-bottom: auto; }
[data-theme="dark"] .res-detail { background: radial-gradient(700px 360px at 50% 0%, rgba(34,197,94,0.07), transparent 60%), var(--bg-canvas); }
.res-counter { font-size: 11.5px; font-weight: 600; color: var(--ink-500); }
.res-counter b { color: var(--ink-900); }
.res-eng { font-size: 11.5px; font-weight: 600; color: var(--ink-600); }
.res-eng .cl-eng { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--green-700); background: var(--green-50); padding: 3px 8px; border-radius: var(--r-pill); margin-left: 4px; }
[data-theme="dark"] .res-eng .cl-eng { background: rgba(34,197,94,0.12); color: var(--green-300); }
/* result player frame — scales to FIT the available height/width (never overflows).
   aspect-ratio holds the shape; max-height caps it to the viewport so the full video +
   controls stay reachable; the .res-detail container scrolls if anything still spills. */
.res-player { position: relative; flex-shrink: 0; border-radius: var(--r-lg); overflow: hidden; background: var(--media-well); box-shadow: var(--shadow-xl); border: 1px solid rgba(255,255,255,0.06);
  aspect-ratio: 0.5625; height: min(448px, 62vh); width: auto; max-width: 100%; }
.res-player.ar-1x1  { aspect-ratio: 1;     height: min(380px, 62vh); }
.res-player.ar-4x5  { aspect-ratio: 0.8;   height: min(400px, 62vh); }
.res-player.ar-16x9 { aspect-ratio: 1.778; height: auto; width: min(520px, 100%); max-height: 62vh; }
.res-player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.res-player .pl-grade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(160deg, rgba(34,197,94,0.05), transparent 40%), linear-gradient(0deg, rgba(0,0,0,0.45), transparent 50%); }
.res-player .pl-cap { position: absolute; left: 14px; right: 14px; bottom: 56px; text-align: center; pointer-events: none; }
.res-player .pl-cap .ln { display: inline-block; font-weight: 800; font-size: 15px; color: #fff; line-height: 1.2; text-shadow: 0 2px 10px rgba(0,0,0,0.6); padding: 2px 6px; }
.res-player .pl-cap .ln em { font-style: normal; color: var(--green-300); }
.res-player .pl-vbadge { position: absolute; left: 12px; top: 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 9.5px; font-weight: 700; padding: 4px 9px; border-radius: var(--r-pill); background: rgba(255,255,255,0.92); color: var(--green-700); box-shadow: var(--shadow-sm); }
.res-player .pl-vbadge.flag { color: var(--warn-ink); }
.res-player .pl-vbadge svg { width: 11px; height: 11px; }
.res-nav { display: flex; align-items: center; gap: 12px; max-width: 100%; }
.cnav { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--hairline); background: var(--bg-surface); cursor: pointer; color: var(--ink-700); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--shadow-sm); transition: all var(--d-fast); }
.cnav:hover { background: var(--ink-50); border-color: var(--hairline-strong); }
.cnav:disabled { opacity: 0.3; cursor: default; }
.cnav svg { width: 18px; height: 18px; }
.res-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ra-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: var(--r-pill); border: 1px solid var(--hairline); background: var(--bg-surface); cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-700); transition: all var(--d-fast); }
/* secondary result actions: keep dark ink text on a light hover bg (both themes) */
.ra-btn:hover { background: var(--ink-100); border-color: var(--hairline-strong); color: var(--ink-1000); }
.ra-btn svg { width: 15px; height: 15px; }
.ra-btn.like.on { background: var(--green-50); border-color: var(--green-300); color: var(--green-700); }
.ra-btn.like.on:hover { background: var(--green-100); color: var(--green-800); }
[data-theme="dark"] .ra-btn.like.on { background: rgba(34,197,94,0.1); color: var(--green-300); }
.ra-btn.dislike.on { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }
.ra-btn.dislike.on:hover { background: var(--danger-soft-2); color: var(--danger); }
/* primary result action (Open Editor): white text on green, hover = darker green */
.ra-btn.primary { background: linear-gradient(135deg, var(--green-500), var(--green-600)); color: var(--amp-hexcoded-color-white); border: none; box-shadow: var(--shadow-green-soft); }
.ra-btn.primary:hover { background: linear-gradient(135deg, var(--green-600), var(--green-700)); color: var(--amp-hexcoded-color-white); box-shadow: var(--shadow-green); }
.dots { display: flex; gap: 6px; justify-content: center; }
.dots .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-300); cursor: pointer; transition: all var(--d-fast); border: none; padding: 0; }
.dots .dot.on { background: var(--green-500); width: 22px; border-radius: var(--r-pill); }
.qc-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: var(--r-pill); background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-200); }
[data-theme="dark"] .qc-pill { background: rgba(34,197,94,0.1); color: var(--green-300); }
.qc-pill svg { width: 13px; height: 13px; }
.qc-pill.flag { background: var(--warn-soft); color: var(--warn-ink); border-color: var(--warn-border); }
[data-theme="dark"] .qc-pill.flag { color: var(--warning); }
.qc-pill.fail { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.dots .dot.fail { background: var(--danger); }

/* ── gallery thumb status badges (Ready winner / Review / Failed / Dismissed) ── */
.rg-thumb .rt-st { position: absolute; right: 7px; top: 7px; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; box-shadow: var(--shadow-sm); }
.rg-thumb .rt-st svg { width: 12px; height: 12px; }
.rg-thumb .rt-st.win { background: var(--green-500); }
.rg-thumb .rt-st.rev { background: #ff9f0a; }
.rg-thumb .rt-st.fail { background: var(--danger); }
.rg-thumb .rt-st.dim { background: var(--ink-400); }
.rg-thumb.is-fail { border-color: var(--danger-border); }
.rg-thumb.is-dim { opacity: 0.5; }
.rg-thumb .rt-failmesh { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--danger) 22%, #16161a), #0b0b0d 75%); }
.rg-thumb .rt-failic { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: color-mix(in srgb, var(--danger) 80%, #fff); }
.rg-thumb .rt-failic svg { width: 22px; height: 22px; }

/* ── FAILED RENDER card (center detail) ── */
.res-player.is-fail { background: var(--bg-surface); border: 1px dashed var(--danger-border); box-shadow: none; display: flex; align-items: center; justify-content: center; }
.fail-card { text-align: center; padding: 22px 20px; max-width: 280px; }
.fail-card .fail-ic { width: 52px; height: 52px; border-radius: 50%; background: var(--danger-soft); color: var(--danger); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.fail-card .fail-ic svg { width: 26px; height: 26px; }
.fail-card .fail-ic.retry { background: var(--accent-soft); }
.fail-card .fail-ic.retry .sp { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--green-500) 28%, transparent); border-top-color: var(--green-500); animation: tspin .8s linear infinite; }
.fail-card .fail-t { font-size: 16px; font-weight: 700; color: var(--ink-1000); letter-spacing: -0.01em; }
.fail-card .fail-s { font-size: 12.5px; color: var(--ink-600); margin-top: 6px; line-height: 1.5; }
.fail-card .fail-s b { color: var(--ink-1000); }
.fail-card .fail-acts { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

/* ── NEEDS-REVIEW banner (center detail) ── */
.review-banner { display: flex; gap: 11px; align-items: flex-start; max-width: 460px; padding: 13px 15px; border-radius: var(--r-md); background: var(--warn-soft); border: 1px solid var(--warn-border); }
.review-banner .rb-ic { width: 30px; height: 30px; border-radius: 50%; background: #ff9f0a; color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.review-banner .rb-ic svg { width: 16px; height: 16px; }
.review-banner .rb-t { font-size: 13px; font-weight: 700; color: var(--warn-ink); }
.review-banner .rb-s { font-size: 12px; color: var(--ink-700); margin-top: 3px; line-height: 1.5; }

/* ── COMPARE · winner + dismiss ── */
.res-player.is-winner { box-shadow: 0 0 0 3px var(--green-500), var(--shadow-xl); }
.res-player .pl-vbadge.win { background: var(--green-500); color: #fff; }
.ra-btn.primary.is-winner { background: linear-gradient(135deg, var(--green-600), var(--green-700)); }
.compare-hint { display: flex; align-items: flex-start; gap: 8px; max-width: 460px; font-size: 11.5px; color: var(--ink-600); line-height: 1.5; padding: 0 6px; }
.compare-hint svg { width: 14px; height: 14px; color: var(--green-600); flex-shrink: 0; margin-top: 1px; }
[data-theme="dark"] .compare-hint svg { color: var(--green-300); }

/* responsive: collapse gallery rail at small center widths */
.res-body[data-compact="true"] .res-gallery { display: none; }

/* ── RIGHT · EDITOR DRAWER ─────────────────────────────────────── */
.editor { background: var(--bg-surface); border-left: 1px solid var(--hairline); display: flex; flex-direction: column; overflow: hidden; }
.work[data-editor-open="false"] .editor { display: none; }
.editor-head { flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--hairline); background: var(--glass-bg-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.editor-head .eh-t { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; }
.editor-head .eh-s { font-size: 11px; color: var(--ink-500); }
.editor-head .eh-close { margin-left: auto; width: 30px; height: 30px; border-radius: var(--r-sm); border: 1px solid var(--hairline); background: var(--bg-surface); cursor: pointer; color: var(--ink-600); display: inline-flex; align-items: center; justify-content: center; }
.editor-head .eh-close:hover { background: var(--ink-100); }
.editor-head .eh-close svg { width: 15px; height: 15px; }
.editor-scroll { flex: 1; overflow-y: auto; padding: 16px; }
.st-sec { margin-bottom: 22px; }
.st-sec .st-h { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.st-sec .st-h .gl { flex: 1; height: 1px; background: var(--hairline); }
.ed-player { position: relative; aspect-ratio: 0.5625; max-width: 218px; margin: 0 auto 6px; border-radius: var(--r-md); overflow: hidden; background: var(--media-well); box-shadow: var(--shadow-md); }
.ed-player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tool-row { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); cursor: pointer; margin-bottom: 7px; transition: all var(--d-fast); }
.tool-row:hover { border-color: var(--hairline-strong); box-shadow: var(--shadow-xs); }
.tool-row .tr-ic { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--ink-100); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--ink-700); }
[data-theme="dark"] .tool-row .tr-ic { background: var(--bg-elevated); }
.tool-row .tr-ic svg { width: 16px; height: 16px; }
.tool-row .tr-tx { flex: 1; min-width: 0; }
.tool-row .tr-name { display: block; font-size: 13px; font-weight: 600; color: var(--ink-900); }
.tool-row .tr-sub { display: block; font-size: 11px; color: var(--ink-500); margin-top: 1px; }
.cbadge { font-family: var(--font-mono); font-size: 10px; font-weight: 700; padding: 4px 8px; border-radius: var(--r-pill); white-space: nowrap; flex-shrink: 0; background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-200); }
[data-theme="dark"] .cbadge { background: rgba(34,197,94,0.1); }
.qc-grp { margin-bottom: 14px; }
.qc-grp .qg-h { font-size: 11px; font-weight: 700; color: var(--ink-700); margin-bottom: 7px; display: flex; align-items: center; gap: 7px; }
.qc-check { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border: 1px solid var(--hairline); border-radius: var(--r-sm); margin-bottom: 6px; background: var(--bg-surface); }
.qc-check .qc-ic { width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.qc-check .qc-ic svg { width: 11px; height: 11px; color: #fff; }
.qc-check.pass .qc-ic { background: var(--green-500); }
.qc-check.flag .qc-ic { background: var(--warning); }
.qc-check .qc-nm { font-size: 12px; font-weight: 600; color: var(--ink-900); }
.qc-check .qc-det { font-size: 11px; color: var(--ink-500); margin-top: 2px; line-height: 1.4; }
.qc-check .qc-miss { font-size: 10.5px; color: var(--green-700); font-weight: 600; cursor: pointer; margin-top: 4px; display: inline-block; }
.qc-check .qc-miss:hover { text-decoration: underline; }
.ask-box { border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); padding: 12px; }
.ask-box textarea { width: 100%; border: none; resize: none; background: transparent; font-family: inherit; font-size: 13px; color: var(--ink-900); outline: none; min-height: 48px; }
.ask-box textarea::placeholder { color: var(--ink-400); }
.ask-foot { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.ask-chip { font-size: 11px; font-weight: 600; padding: 5px 11px; border-radius: var(--r-pill); border: 1px solid var(--hairline); background: var(--bg-surface); cursor: pointer; color: var(--ink-700); }
.ask-chip:hover { border-color: var(--green-300); color: var(--green-700); }
.export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.export-tile { padding: 12px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); cursor: pointer; text-align: center; transition: all var(--d-fast); }
.export-tile:hover { border-color: var(--green-300); }
.export-tile .et-ic { font-size: 20px; } .export-tile .et-n { font-size: 12px; font-weight: 600; color: var(--ink-900); margin-top: 5px; } .export-tile .et-s { font-size: 10px; color: var(--ink-500); }

/* ── TOOL PICKER (New project → choose a tool first) ── */
.tp-hero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--r-xl); cursor: pointer; background: linear-gradient(135deg, rgba(34,197,94,0.12), rgba(34,197,94,0.03)); border: 1.5px solid var(--green-300); transition: all var(--d-base); }
.tp-hero:hover { box-shadow: var(--shadow-md); border-color: var(--green-500); transform: translateY(-1px); }
[data-theme="dark"] .tp-hero { border-color: rgba(34,197,94,0.35); }
.tp-hero .tp-ic { width: 48px; height: 48px; border-radius: var(--r-md); background: linear-gradient(135deg, var(--green-500), var(--green-700)); color: var(--amp-hexcoded-color-white); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--shadow-green-soft); }
.tp-hero .tp-ic svg { width: 24px; height: 24px; }
.tp-hero .tp-tx { flex: 1; min-width: 0; }
.tp-hero .tp-t { font-size: 16px; font-weight: 800; color: var(--ink-1000); letter-spacing: -0.01em; display: flex; align-items: center; gap: 9px; }
.tp-hero .tp-now { font-size: 9px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--amp-hexcoded-color-white); background: var(--green-600); padding: 3px 8px; border-radius: var(--r-pill); }
.tp-hero .tp-s { font-size: 12.5px; color: var(--ink-600); margin-top: 3px; line-height: 1.45; }
.tp-hero .tp-go { margin-left: auto; color: var(--green-600); flex-shrink: 0; }
.tp-soon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tp-soon { position: relative; overflow: hidden; text-align: left; width: 100%; padding: 13px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-soft); cursor: default; transition: border-color var(--d-fast); }
.tp-soon:hover { border-color: var(--hairline-strong); }
/* shimmer removed — the coming-soon cards stay quiet so the live URL→Ad hero leads the eye */
.tp-soon::after { display: none; }
@keyframes tpShimmer { 0% { left: -60%; } 60%,100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) { .tp-soon::after { animation: none; } }
.tp-soon .tps-head { display: flex; align-items: center; gap: 9px; }
.tp-soon .tps-ic { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--ink-100); color: var(--ink-500); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-theme="dark"] .tp-soon .tps-ic { background: var(--bg-elevated); }
.tp-soon .tps-ic svg { width: 16px; height: 16px; }
.tp-soon .tps-n { font-size: 13px; font-weight: 700; color: var(--ink-800); }
.tp-soon .tps-tag { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 8.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-500); background: var(--ink-100); padding: 3px 7px; border-radius: var(--r-pill); flex-shrink: 0; }
[data-theme="dark"] .tp-soon .tps-tag { background: var(--bg-elevated); }
.tp-soon .tps-tag svg { width: 9px; height: 9px; }
.tp-soon .tps-s { font-size: 11px; color: var(--ink-500); margin-top: 6px; line-height: 1.4; }
.tp-soon .tps-want { margin-top: 9px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: var(--r-pill); border: 1px dashed var(--green-300); background: var(--green-50); color: var(--green-700); cursor: pointer; font-size: 11px; font-weight: 700; transition: background var(--d-fast); }
[data-theme="dark"] .tp-soon .tps-want { background: rgba(34,197,94,0.1); color: var(--green-300); border-color: rgba(34,197,94,0.35); }
.tp-soon .tps-want:hover { background: var(--green-100); }
[data-theme="dark"] .tp-soon .tps-want:hover { background: rgba(34,197,94,0.18); }
.tp-soon .tps-want svg { width: 12px; height: 12px; }
.tp-soon .tps-want.on { border-style: solid; background: var(--green-500); color: var(--amp-hexcoded-color-white); }
.tp-soon .tps-req { margin-top: 9px; display: none; }
.tp-soon .tps-req.open { display: block; }

/* ════════════════════════════════════════════════════════════════
   ONE REUSABLE POPUP — fixed outer size; internal scroll; airy base
   ════════════════════════════════════════════════════════════════ */
.popup-scrim { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.45); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; padding: 28px; }
.popup-scrim.on { display: flex; }
.popup { width: 600px; max-width: 94vw; height: 600px; max-height: 90vh; background: var(--bg-surface); border: 1px solid var(--hairline); border-radius: var(--r-xl); box-shadow: var(--shadow-xl); display: flex; flex-direction: column; overflow: hidden; }
.popup.wide { width: 760px; }
.popup.narrow { width: 520px; }
.popup-head { flex-shrink: 0; padding: 24px 28px 18px; border-bottom: 1px solid var(--hairline); display: flex; align-items: flex-start; gap: 14px; }
.popup-head .ph-txt { flex: 1; min-width: 0; }
.popup-head .ph-eyebrow { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--green-600); }
.popup-head h3 { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; margin: 5px 0 0; }
.popup-head p { font-size: 12.5px; color: var(--ink-500); margin: 4px 0 0; line-height: 1.45; }
.popup-head .px { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--hairline); background: var(--bg-surface); cursor: pointer; color: var(--ink-600); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.popup-head .px:hover { background: var(--ink-100); }
.popup-head .px svg { width: 16px; height: 16px; }
.popup-body { flex: 1; overflow-y: auto; padding: 22px 28px; min-height: 0; }
.popup-foot { flex-shrink: 0; padding: 14px 28px; border-top: 1px solid var(--hairline); display: flex; align-items: center; gap: 10px; background: var(--glass-bg-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.popup-foot .spacer { flex: 1; }
.popup-foot .foot-note { font-size: 11.5px; color: var(--ink-500); display: inline-flex; align-items: center; gap: 6px; }
.popup-foot .foot-note svg { width: 13px; height: 13px; color: var(--ink-400); }
.popup-foot .foot-note.warn { color: var(--warn-ink); }

/* generic popup fragments */
.psub { font-size: 12.5px; color: var(--ink-500); margin: 0 0 16px; line-height: 1.5; }
.psub b { color: var(--ink-900); font-weight: 600; }
.flabel { font-size: 12px; font-weight: 700; letter-spacing: -0.005em; color: var(--ink-800); margin: 18px 0 9px; display: flex; align-items: center; gap: 7px; }
.flabel:first-child { margin-top: 0; }
.flabel .fopt { font-size: 9.5px; font-weight: 600; color: var(--ink-400); }
.flabel .clearbtn { margin-left: auto; font-size: 10.5px; font-weight: 600; color: var(--ink-500); background: none; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.flabel .clearbtn:hover { color: var(--danger); } .flabel .clearbtn svg { width: 12px; height: 12px; }
.chiprow { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: var(--r-pill); border: 1px solid var(--hairline-strong); background: var(--bg-surface); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-700); transition: all var(--d-fast); }
.chip:hover { border-color: var(--green-300); }
.chip.on, .chip.is-selected { border-color: var(--sel-border); background: var(--sel-bg); color: var(--accent-ink); }
[data-theme="dark"] .chip.on, [data-theme="dark"] .chip.is-selected { color: var(--green-300); }
.chip.dim { opacity: 0.42; cursor: not-allowed; }
.chip.dim:hover { border-color: var(--hairline-strong); }
.gated-note { font-size: 11.5px; color: var(--warn-ink); background: var(--warn-soft); border: 1px solid var(--warn-border); border-radius: var(--r-sm); padding: 9px 12px; line-height: 1.45; margin-top: 10px; }
.gated-note.info { color: var(--info-ink); background: var(--info-soft); border-color: var(--info-border); }
[data-theme="dark"] .gated-note { color: var(--warning); }
.input-line { display: flex; align-items: center; gap: 8px; padding: 0 6px 0 13px; height: 42px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); transition: border-color var(--d-fast), box-shadow var(--d-fast); }
.input-line:focus-within { border-color: var(--green-500); box-shadow: var(--focus-ring); }
.input-line input { flex: 1; border: none; background: transparent; outline: none; font-family: inherit; font-size: 13.5px; color: var(--ink-900); }
.input-line input::placeholder { color: var(--ink-400); }
.input-line .ic { color: var(--ink-400); } .input-line .ic svg { width: 16px; height: 16px; }
.input-line .go, .guide-box .gb-go { width: 30px; height: 30px; border-radius: var(--r-sm); border: none; background: var(--accent-soft); color: var(--accent-ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background var(--d-fast); }
.input-line .go:hover, .guide-box .gb-go:hover { background: var(--accent-soft-strong); } .input-line .go svg, .guide-box .gb-go svg { width: 15px; height: 15px; }
[data-theme="dark"] .input-line .go, [data-theme="dark"] .guide-box .gb-go { color: var(--green-300); }
.inote { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border-radius: var(--r-md); background: var(--ink-50); border: 1px solid var(--hairline); font-size: 12px; color: var(--ink-600); line-height: 1.45; }
[data-theme="dark"] .inote { background: var(--bg-elevated); }
.inote .ii { width: 17px; height: 17px; flex-shrink: 0; border-radius: 50%; border: 1.4px solid var(--ink-400); color: var(--ink-500); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); margin-top: 1px; }
.inote b { color: var(--ink-900); font-weight: 600; }
.sec-lab { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); margin: 0 0 10px; display: flex; align-items: center; gap: 9px; }
.sec-lab .gl { flex: 1; height: 1px; background: var(--hairline); }
.gate-note { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 600; color: var(--info-ink); background: var(--info-soft); padding: 4px 9px; border-radius: var(--r-pill); }
.gate-note svg { width: 11px; height: 11px; }

/* PILL stepper */
.stepper { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--hairline-strong); border-radius: var(--r-pill); padding: 4px; }
.stepper button { width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--ink-100); cursor: pointer; font-size: 17px; font-weight: 700; color: var(--ink-700); }
.stepper button:hover { background: var(--ink-200); }
.stepper .n { min-width: 36px; text-align: center; font-size: 18px; font-weight: 700; font-family: var(--font-display); }

/* SUBJECT (advertising) tiles */
.subj-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.subj-tile { padding: 18px 14px; border: 1.5px solid var(--hairline); border-radius: var(--r-lg); cursor: pointer; text-align: center; background: var(--bg-surface); transition: all var(--d-base); }
.subj-tile:hover { border-color: var(--green-400); box-shadow: var(--shadow-sm); }
.subj-tile.on { border-color: var(--sel-border); box-shadow: var(--sel-ring-2); background: var(--sel-bg); }
.subj-tile .si { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: var(--r-md); background: var(--ink-100); color: var(--ink-700); display: inline-flex; align-items: center; justify-content: center; }
.subj-tile.on .si { background: var(--accent-chip-bg); color: var(--accent-chip-ink); }
[data-theme="dark"] .subj-tile .si { background: var(--bg-elevated); }
.subj-tile .si svg { width: 22px; height: 22px; }
.subj-tile .t { font-size: 14px; font-weight: 700; color: var(--ink-1000); }
.subj-tile .d { font-size: 11px; color: var(--ink-500); margin-top: 3px; line-height: 1.4; }
.subj-detect { font-size: 11.5px; color: var(--accent-ink); background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: var(--r-sm); padding: 9px 12px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
[data-theme="dark"] .subj-detect { color: var(--green-300); }

/* product gallery / link */
.tabs { margin-bottom: 16px; }
.tabs button { padding: 7px 15px; font-size: 12.5px; }
.pg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pg-card { position: relative; border: 1.5px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; cursor: pointer; background: var(--bg-surface); transition: all var(--d-fast); }
.pg-card:hover { border-color: var(--green-300); }
.pg-card.on { border-color: var(--green-500); box-shadow: var(--sel-ring-2); }
.pg-card .check { position: absolute; right: 7px; top: 7px; width: 20px; height: 20px; border-radius: 50%; background: var(--green-600); color: #fff; font-size: 11px; display: none; align-items: center; justify-content: center; z-index: 2; }
.pg-card.on .check { display: inline-flex; }
.pg-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.pg-card .meta { padding: 8px 10px; } .pg-card .meta .nm { font-size: 12px; font-weight: 600; color: var(--ink-900); } .pg-card .meta .pr { font-size: 11px; color: var(--green-700); font-weight: 600; }
.pg-detected { display: flex; gap: 14px; margin-top: 16px; padding: 14px; border: 1px solid var(--accent-border); border-radius: var(--r-md); background: var(--accent-soft); }
.pg-detected img { width: 88px; height: 88px; border-radius: var(--r-sm); object-fit: cover; flex-shrink: 0; }
.pg-detected .dhead { font-size: 11px; font-weight: 700; color: var(--green-700); display: flex; align-items: center; gap: 6px; }
.pg-detected .dname { font-size: 15px; font-weight: 700; color: var(--ink-1000); margin: 4px 0 2px; }
.pg-detected .dprice { font-size: 12px; color: var(--ink-600); }
.pg-detected .dnotes { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.pg-detected .dnotes span { font-size: 10px; font-weight: 600; color: var(--ink-700); background: var(--bg-surface); border: 1px solid var(--hairline); border-radius: var(--r-pill); padding: 2px 8px; }

/* making pills */
.making-pills { display: flex; gap: 10px; margin-bottom: 18px; }
.making-pill { flex: 1; padding: 16px; border: 1.5px solid var(--hairline); border-radius: var(--r-lg); cursor: pointer; text-align: center; transition: all var(--d-base); background: var(--bg-surface); }
.making-pill:hover { border-color: var(--green-400); }
.making-pill.on { border-color: var(--sel-border); background: var(--sel-bg); }
.making-pill .mp-t { font-size: 14px; font-weight: 700; color: var(--ink-1000); }
.making-pill .mp-d { font-size: 11px; color: var(--ink-500); margin-top: 4px; line-height: 1.4; }
.count-row { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--ink-50); }
[data-theme="dark"] .count-row { background: var(--bg-elevated); }
.count-row .cr-tx { flex: 1; } .count-row .cr-t { font-size: 13px; font-weight: 700; color: var(--ink-900); } .count-row .cr-s { font-size: 11px; color: var(--ink-500); margin-top: 2px; }

/* FRAME steps + live preview + PRO reveal */
.frame-live { display: grid; grid-template-columns: 1fr 200px; gap: 22px; align-items: start; }
.frame-steps { display: flex; flex-direction: column; gap: 16px; }
.fstep .sl { font-size: 13px; font-weight: 700; color: var(--ink-1000); display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.fstep .sl .sval { font-size: 11px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft-strong); padding: 2px 8px; border-radius: var(--r-pill); }
[data-theme="dark"] .fstep .sl .sval { color: var(--green-300); }
.fstep .sh { font-size: 11.5px; color: var(--ink-500); margin-bottom: 8px; }
.frame-phone { position: relative; background: var(--media-well); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); margin: 0 auto; transition: aspect-ratio var(--d-base), max-width var(--d-base); }
.frame-phone video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame-phone .ftag { position: absolute; right: 8px; top: 8px; font-family: var(--font-mono); font-size: 9px; font-weight: 700; color: #fff; background: rgba(0,0,0,0.5); padding: 3px 7px; border-radius: var(--r-pill); }
.frame-phone .fcap { position: absolute; left: 10px; right: 10px; bottom: 16px; text-align: center; color: #fff; font-weight: 800; font-size: 14px; text-shadow: 0 2px 8px rgba(0,0,0,0.7); }
.frame-livenote { font-size: 11px; color: var(--ink-500); text-align: center; margin-top: 10px; }
.mode-banner { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: var(--r-md); margin-bottom: 16px; font-size: 12px; line-height: 1.45; }
.mode-banner.guided { background: var(--ink-50); border: 1px solid var(--hairline); color: var(--ink-600); }
[data-theme="dark"] .mode-banner.guided { background: var(--bg-elevated); }
.mode-banner.pro { background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--green-800); }
[data-theme="dark"] .mode-banner.pro { color: var(--green-300); }
.mode-banner svg { width: 16px; height: 16px; flex-shrink: 0; } .mode-banner b { font-weight: 700; }
.pro-reveal { margin-top: 18px; border: 1px solid var(--accent-border); border-radius: var(--r-md); background: var(--accent-soft); padding: 16px; }
.pro-reveal .prh { font-size: 11px; font-weight: 700; color: var(--green-700); display: flex; align-items: center; gap: 7px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--font-mono); }
.pro-reveal .prs { font-size: 11.5px; color: var(--ink-600); margin-bottom: 14px; line-height: 1.45; }

/* INSIGHT → IDEA left-rail (gallery Area 1, Variant 1) */
.i2-split { display: grid; grid-template-columns: 0.92fr 1.08fr; gap: 16px; align-items: start; }
.i2-split > * { min-width: 0; }
.i2-col-lab { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); margin: 0 0 9px; display: flex; align-items: center; gap: 8px; }
.i2-col-lab .gl { flex: 1; height: 1px; background: var(--hairline); }
.i2-rail { display: flex; flex-direction: column; gap: 8px; }
.insight-card { position: relative; text-align: left; cursor: pointer; width: 100%; border: 1px solid var(--accent-border); border-radius: var(--r-lg); padding: 13px 14px; background: linear-gradient(140deg, var(--accent-soft), var(--bg-surface)); transition: border-color var(--d-fast), box-shadow var(--d-fast); }
.insight-card:hover { border-color: var(--green-300); }
.insight-card.on { border-color: var(--sel-border); box-shadow: var(--sel-ring); }
.insight-card .in-kicker { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--green-700); }
[data-theme="dark"] .insight-card .in-kicker { color: var(--green-400); }
.insight-card .in-kicker svg { width: 11px; height: 11px; }
.insight-card .in-quote { font-family: var(--font-display); font-weight: 700; font-size: 14px; line-height: 1.32; letter-spacing: -0.01em; color: var(--ink-1000); margin: 8px 0 10px; }
.insight-card .in-quote .qm { color: var(--green-500); }
.insight-card .in-prov { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 600; color: var(--green-800); background: var(--bg-surface); border: 1px solid var(--green-200); border-radius: var(--r-pill); padding: 4px 9px; }
[data-theme="dark"] .insight-card .in-prov { color: var(--green-300); background: rgba(0,0,0,0.22); border-color: rgba(34,197,94,0.25); }
.insight-card .in-prov .pv-ic { font-size: 11px; line-height: 1; }
.insight-card .in-ideacount { position: absolute; top: 12px; right: 12px; font-size: 9.5px; font-weight: 700; font-family: var(--font-mono); color: var(--ink-400); }
.insight-card.on .in-ideacount { color: var(--green-600); }
.ideas-panel { display: none; }
.ideas-panel.on { display: block; }
.idea-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.idea-card { position: relative; text-align: left; padding: 11px 13px; border: 1.5px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); cursor: pointer; transition: border-color var(--d-fast), box-shadow var(--d-fast), background var(--d-fast); width: 100%; }
.idea-card:hover { border-color: var(--ink-300); box-shadow: var(--shadow-xs); }
.idea-card.on { border-color: var(--sel-border); background: var(--sel-bg); box-shadow: var(--sel-ring); }
.idea-card .ic-tag { display: inline-flex; align-items: center; font-size: 9px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 7px; border-radius: var(--r-pill); margin-bottom: 6px; }
.ic-tag.proof { background: var(--info-soft); color: var(--info-ink); }
.ic-tag.benefit { background: var(--accent-chip-bg); color: var(--accent-chip-ink); }
.ic-tag.myth { background: #fff4e0; color: var(--warn-ink); }
.ic-tag.asmr { background: #f0e6ff; color: #7c3aed; }
.ic-tag.gifting { background: #ffe6f0; color: #be185d; }
.ic-tag.occasion { background: #e0f2f1; color: #00695c; }
[data-theme="dark"] .ic-tag.myth { background: var(--warn-soft); color: var(--warning); }
[data-theme="dark"] .ic-tag.asmr { background: rgba(124,58,237,0.22); color: #c4a3ff; }
[data-theme="dark"] .ic-tag.gifting { background: rgba(190,24,93,0.24); color: #ff9ec4; }
[data-theme="dark"] .ic-tag.occasion { background: rgba(0,105,92,0.3); color: #80cbc4; }
.idea-card .ic-title { font-size: 13px; font-weight: 700; color: var(--ink-1000); letter-spacing: -0.01em; padding-right: 18px; }
.idea-card .ic-line { font-size: 11px; color: var(--ink-500); margin-top: 3px; line-height: 1.4; }
.idea-card .ic-check { position: absolute; top: 11px; right: 11px; width: 16px; height: 16px; border-radius: 50%; background: var(--green-500); color: #fff; display: none; align-items: center; justify-content: center; }
.idea-card.on .ic-check { display: inline-flex; }
.idea-card .ic-check svg { width: 10px; height: 10px; }
.gen-chip { display: inline-flex; align-items: center; gap: 7px; margin-top: 9px; padding: 7px 13px; border-radius: var(--r-pill); border: 1px dashed var(--green-300); background: var(--green-50); color: var(--green-700); cursor: pointer; font-size: 12px; font-weight: 600; transition: background var(--d-fast); }
[data-theme="dark"] .gen-chip { background: rgba(34,197,94,0.1); color: var(--green-300); border-color: rgba(34,197,94,0.35); }
.gen-chip:hover { background: var(--green-100); }
.gen-chip svg { width: 13px; height: 13px; }
.idea-write { position: relative; text-align: left; width: 100%; margin-top: 8px; padding: 11px 13px; border: 1.5px dashed var(--hairline-strong); border-radius: var(--r-md); background: transparent; cursor: pointer; transition: border-color var(--d-fast), background var(--d-fast); display: flex; align-items: center; gap: 9px; }
.idea-write:hover { border-color: var(--green-300); background: var(--accent-soft); }
.idea-write .iw-ic { width: 26px; height: 26px; border-radius: var(--r-sm); background: var(--ink-100); color: var(--ink-600); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-theme="dark"] .idea-write .iw-ic { background: var(--bg-elevated); }
.idea-write .iw-ic svg { width: 14px; height: 14px; }
.idea-write .iw-tx { font-size: 12.5px; font-weight: 600; color: var(--ink-800); }
.idea-write .iw-sub { font-size: 10.5px; color: var(--ink-500); margin-top: 1px; }
.guide-box { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 0 6px 0 13px; height: 42px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); transition: border-color var(--d-fast), box-shadow var(--d-fast); }
.guide-box:focus-within { border-color: var(--green-500); box-shadow: var(--focus-ring); }
.guide-box svg.lead { width: 15px; height: 15px; color: var(--green-600); flex-shrink: 0; }
.guide-box input { flex: 1; border: none; background: transparent; outline: none; font-family: inherit; font-size: 13px; color: var(--ink-900); }
.guide-box input::placeholder { color: var(--ink-400); }

/* FORMAT & STAGING — format-first auto-preset (gallery Area 2, Option C) */
.fmt-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.fmt-tile { position: relative; text-align: left; padding: 13px; border: 1.5px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); cursor: pointer; transition: all var(--d-fast); }
.fmt-tile:hover { border-color: var(--ink-300); }
.fmt-tile.on { border-color: var(--sel-border); background: var(--sel-bg); box-shadow: var(--sel-ring); }
.fmt-tile.dim { opacity: 0.42; cursor: not-allowed; }
.fmt-tile .ft-ic { width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--ink-100); color: var(--ink-700); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 9px; font-size: 16px; }
[data-theme="dark"] .fmt-tile .ft-ic { background: var(--bg-elevated); }
.fmt-tile.on .ft-ic { background: var(--accent-chip-bg); color: var(--accent-chip-ink); }
.fmt-tile .ft-name { font-size: 13px; font-weight: 700; color: var(--ink-1000); }
.fmt-tile .ft-sub { font-size: 11px; color: var(--ink-500); margin-top: 2px; line-height: 1.4; }
.autopreset { display: flex; align-items: center; gap: 11px; margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--accent-border); background: var(--accent-soft); }
.autopreset .ap-thumb { width: 52px; height: 33px; flex-shrink: 0; border-radius: var(--r-sm); overflow: hidden; background: var(--media-well); }
.autopreset .ap-thumb video { width: 100%; height: 100%; object-fit: cover; }
.autopreset .ap-tx { flex: 1; min-width: 0; }
.autopreset .ap-lab { font-size: 12.5px; font-weight: 700; color: var(--ink-1000); letter-spacing: -0.005em; }
.autopreset .ap-lab .ap-name { color: var(--green-800); }
[data-theme="dark"] .autopreset .ap-lab .ap-name { color: var(--green-300); }
.autopreset .ap-sub { font-size: 10.5px; color: var(--ink-500); margin-top: 2px; display: inline-flex; align-items: center; gap: 7px; }
.autopreset .ap-sub .ap-auto { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--green-700); }
[data-theme="dark"] .autopreset .ap-sub .ap-auto { color: var(--green-400); }
.autopreset .ap-sub .ap-auto svg { width: 11px; height: 11px; }
.ap-change { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; padding: 8px 13px; border-radius: var(--r-pill); border: 1px solid var(--hairline-strong); background: var(--bg-surface); color: var(--ink-800); cursor: pointer; font-size: 12px; font-weight: 600; white-space: nowrap; transition: all var(--d-fast); }
.ap-change:hover { border-color: var(--green-300); }
.ap-change svg { width: 13px; height: 13px; }
.preset-reveal { display: none; margin-top: 14px; }
.preset-reveal.open { display: block; }
.preset-reveal .pr-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.preset-reveal .pr-title { font-size: 12px; font-weight: 700; color: var(--ink-900); }
.preset-back { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: var(--r-pill); border: 1px solid var(--hairline); background: var(--bg-surface); color: var(--ink-600); cursor: pointer; font-size: 11px; font-weight: 600; transition: all var(--d-fast); }
.preset-back:hover { background: var(--hover-surface-2); }
.preset-back svg { width: 12px; height: 12px; }
.stage-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.stage-card { position: relative; text-align: left; border: 1.5px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; background: var(--bg-surface); cursor: pointer; transition: all var(--d-fast); padding: 0; }
.stage-card:hover { border-color: var(--ink-300); box-shadow: var(--shadow-xs); }
.stage-card.on { border-color: var(--green-500); box-shadow: var(--sel-ring); }
.stage-card .sc-vid { position: relative; aspect-ratio: 1.455; background: var(--media-well); overflow: hidden; }
.stage-card .sc-vid video { width: 100%; height: 100%; object-fit: cover; }
.stage-card .sc-grade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.45)); pointer-events: none; }
.stage-card .sc-play { position: absolute; right: 8px; bottom: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,0.92); color: var(--ink-1000); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.stage-card .sc-play svg { width: 12px; height: 12px; margin-left: 1px; }
.stage-card .sc-check { position: absolute; left: 8px; top: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--green-500); color: #fff; display: none; align-items: center; justify-content: center; }
.stage-card.on .sc-check { display: inline-flex; }
.stage-card .sc-check svg { width: 11px; height: 11px; }
.stage-card .sc-body { padding: 8px 10px 10px; }
.stage-card .sc-name { font-size: 12px; font-weight: 700; color: var(--ink-1000); }
.stage-card .sc-desc { font-size: 10px; color: var(--ink-500); margin-top: 1px; line-height: 1.3; }

/* SCRIPT — auto structure, fit meter, over-length block */
.script-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 11px 13px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--ink-50); margin-bottom: 14px; font-size: 12px; }
[data-theme="dark"] .script-bar { background: var(--bg-elevated); }
.script-bar .seg { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-600); }
.script-bar .seg b { color: var(--ink-900); }
.script-fit { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.script-fit .meter { width: 90px; height: 7px; border-radius: var(--r-pill); background: var(--ink-200); overflow: hidden; }
.script-fit .meter span { display: block; height: 100%; background: var(--green-500); transition: width var(--d-base); }
.script-fit.over .meter span { background: var(--danger); }
.script-fit .txt { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--ink-600); }
.script-fit.over .txt { color: var(--danger); }
.script-overbar { display: none; align-items: center; gap: 10px; padding: 10px 13px; border-radius: var(--r-md); background: var(--danger-soft); border: 1px solid var(--danger-border); margin-bottom: 14px; }
.script-overbar.on { display: flex; }
.script-overbar .so-msg { flex: 1; font-size: 12px; font-weight: 600; color: var(--danger); }
.script-tabs { margin-bottom: 14px; flex-wrap: wrap; }
.script-tabs button { padding: 6px 12px; font-size: 11.5px; }
.script-beats { display: flex; flex-direction: column; gap: 9px; }
.script-beat { border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 11px 13px; background: var(--bg-surface); }
.script-beat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.script-beat-name { font-size: 12px; font-weight: 700; color: var(--ink-900); }
.script-beat-tag { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 6px; border-radius: var(--r-xs); background: var(--accent-chip-bg); color: var(--accent-chip-ink); }
.script-beat-head .secs { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--green-600); font-weight: 700; }
.script-line { font-size: 13px; line-height: 1.5; color: var(--ink-800); outline: none; border-radius: var(--r-sm); padding: 4px 6px; margin: 0 -6px; }
.script-line[contenteditable]:focus { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--green-300); }

/* B-ROLL */
.broll-banner { font-size: 11.5px; color: var(--ink-600); line-height: 1.5; padding: 11px 13px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--ink-50); margin-bottom: 14px; }
[data-theme="dark"] .broll-banner { background: var(--bg-elevated); }
.broll-banner b { color: var(--ink-900); }
.broll-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.broll-tile { position: relative; border: 1.5px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; cursor: pointer; background: var(--media-well); transition: all var(--d-fast); }
.broll-tile:hover { border-color: var(--green-300); }
.broll-tile.on { border-color: var(--green-500); box-shadow: var(--sel-ring-2); }
.broll-tile video { width: 100%; aspect-ratio: 0.5625; object-fit: cover; display: block; }
.broll-tile .bt-check { position: absolute; right: 6px; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--green-600); color: #fff; font-size: 11px; display: none; align-items: center; justify-content: center; z-index: 2; }
.broll-tile.on .bt-check { display: inline-flex; }
.broll-tile .bt-play { position: absolute; left: 6px; bottom: 28px; width: 24px; height: 24px; border-radius: 50%; border: none; background: rgba(255,255,255,0.9); color: var(--ink-1000); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.broll-tile .bt-play svg { width: 11px; height: 11px; margin-left: 1px; }
.broll-tile .bt-n { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 7px 6px; background: linear-gradient(180deg, transparent, rgba(0,0,0,0.82)); color: #fff; font-size: 10px; font-weight: 600; }
.broll-tile .bt-cost { position: absolute; left: 6px; top: 6px; font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; color: #fff; background: rgba(34,197,94,0.85); padding: 2px 6px; border-radius: var(--r-pill); }
.broll-upload { border: 1.5px dashed var(--hairline-strong); border-radius: var(--r-md); padding: 20px; text-align: center; cursor: pointer; }
.broll-upload:hover { border-color: var(--green-400); }
.broll-upload .bu-t { font-size: 13px; font-weight: 600; color: var(--ink-800); }
.broll-upload .bu-s { font-size: 11px; color: var(--ink-500); margin-top: 5px; line-height: 1.5; }
.broll-cap { font-size: 11px; color: var(--ink-500); margin-top: 12px; display: flex; align-items: center; gap: 7px; }
.broll-cap.full { color: var(--warn-ink); }

/* CAST (gallery Area 3 cleaner) */
.cast2-note { display: flex; gap: 11px; padding: 12px 14px; border: 1px solid var(--accent-border); border-radius: var(--r-md); background: var(--accent-soft); margin-bottom: 16px; }
.cast2-note .cn-ic { color: var(--green-600); flex-shrink: 0; margin-top: 1px; } .cast2-note .cn-ic svg { width: 17px; height: 17px; }
.cast2-note .cn-t { font-size: 12.5px; font-weight: 700; color: var(--ink-1000); }
.cast2-note .cn-m { font-size: 11.5px; color: var(--ink-600); margin-top: 2px; line-height: 1.45; }
.cast2-note .cn-m b { color: var(--green-700); font-weight: 700; } [data-theme="dark"] .cast2-note .cn-m b { color: var(--green-400); }
.cast2-shell { display: grid; grid-template-columns: 168px 1fr; gap: 18px; height: 312px; }
.cast2-shell > * { min-width: 0; }
.cast2-rail { border-right: 1px solid var(--hairline); padding-right: 16px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.cast2-rail .c2-rh { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); padding: 2px 10px 8px; }
.cast2-railitem { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 11px; border-radius: var(--r-md); border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-700); font-size: 12.5px; font-weight: 600; transition: background var(--d-fast), color var(--d-fast); }
.cast2-railitem:hover { background: var(--hover-surface-2); }
.cast2-railitem.on { background: var(--accent-soft-strong); color: var(--accent-ink); } [data-theme="dark"] .cast2-railitem.on { color: var(--green-300); }
.cast2-railitem svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--ink-500); }
.cast2-railitem.on svg { color: var(--green-600); } [data-theme="dark"] .cast2-railitem.on svg { color: var(--green-400); }
.cast2-railitem .c2-ct { margin-left: auto; font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: var(--ink-400); }
.cast2-railitem.on .c2-ct { color: var(--green-600); }
.cast2-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding-right: 4px; }
.cast2-row { display: grid; grid-template-columns: 42px minmax(0,1fr) auto 32px 82px; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--bg-surface); cursor: pointer; width: 100%; text-align: left; transition: border-color var(--d-fast), box-shadow var(--d-fast), background var(--d-fast); }
.cast2-row:hover { border-color: var(--green-300); }
.cast2-row.on { border-color: var(--sel-border); box-shadow: var(--sel-ring); background: var(--sel-bg); }
.cast2-row.gated { opacity: 0.55; cursor: not-allowed; }
.cast2-row.gated:hover { border-color: var(--hairline); }
.c2-av { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--ink-100); box-shadow: 0 0 0 1px var(--hairline) inset; }
[data-theme="dark"] .c2-av { background: var(--bg-elevated); }
.c2-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c2-av.nobody { display: inline-flex; align-items: center; justify-content: center; color: var(--ink-500); }
.c2-av.nobody svg { width: 19px; height: 19px; }
.c2-who { min-width: 0; }
.c2-who .c2-nm { font-size: 13px; font-weight: 700; color: var(--ink-1000); letter-spacing: -0.01em; display: flex; align-items: center; gap: 7px; }
.c2-who .c2-vibe { font-size: 11px; color: var(--ink-500); margin-top: 2px; line-height: 1.35; }
.c2-badge { font-size: 8px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 6px; border-radius: var(--r-xs); white-space: nowrap; }
.c2-badge.default { color: var(--accent-chip-ink); background: var(--accent-chip-bg); }
.c2-badge.real { color: #fff; background: var(--green-600); }
.c2-badge.blocked { color: var(--ink-600); background: var(--ink-100); }
[data-theme="dark"] .c2-badge.blocked { color: var(--ink-400); background: var(--bg-elevated); }
.c2-lang { font-size: 10px; font-weight: 600; color: var(--ink-600); background: var(--ink-100); padding: 4px 9px; border-radius: var(--r-pill); white-space: nowrap; }
[data-theme="dark"] .c2-lang { background: var(--bg-elevated); }
.c2-voice { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--hairline-strong); background: var(--bg-surface); cursor: pointer; color: var(--green-700); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all var(--d-fast); }
.c2-voice:hover { background: var(--green-50); border-color: var(--green-300); }
[data-theme="dark"] .c2-voice { color: var(--green-400); }
.c2-voice svg { width: 15px; height: 15px; }
.c2-voice.playing { background: var(--green-500); color: #fff; border-color: var(--green-500); }
.c2-voice-ph { width: 32px; height: 32px; flex-shrink: 0; }
.c2-cost { text-align: right; }
.c2-cost .c2-amt { font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.c2-cost.free .c2-amt { color: var(--green-700); } [data-theme="dark"] .c2-cost.free .c2-amt { color: var(--green-400); }
.c2-cost.paid .c2-amt { color: var(--ink-900); }
.c2-cost.gated .c2-amt { color: var(--ink-400); }
.c2-cost .c2-unit { display: block; font-size: 9px; font-weight: 500; color: var(--ink-500); margin-top: 1px; }

/* on-screen text preview */
.ontext-grid { display: grid; grid-template-columns: 210px 1fr; gap: 20px; }
.ontext-preview { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.ontext-frame { position: relative; width: 188px; aspect-ratio: 0.5625; background: var(--media-well); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.ontext-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ontext-frame .otc { position: absolute; left: 10px; right: 10px; text-align: center; color: #fff; font-weight: 800; font-size: 13px; text-shadow: 0 2px 8px rgba(0,0,0,0.7); }
.ontext-frame .otc.pos-top { top: 18px; } .ontext-frame .otc.pos-mid { top: 46%; } .ontext-frame .otc.pos-bot { bottom: 50px; }
.ontext-frame .otc.clean { background: rgba(0,0,0,0.5); border-radius: 6px; padding: 3px; } .ontext-frame .otc.minimal { font-weight: 600; font-size: 12px; }
.ontext-frame .ots { position: absolute; left: 10px; bottom: 14px; background: rgba(255,255,255,0.94); color: var(--ink-1000); font-size: 10px; font-weight: 700; padding: 5px 9px; border-radius: var(--r-sm); }
.ontext-pnote { font-size: 10.5px; color: var(--ink-500); }
.ontext-controls { min-width: 0; }

/* audience / music tiles */
.tilegrid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.tile { padding: 13px; border: 1px solid var(--hairline); border-radius: var(--r-md); cursor: pointer; transition: all var(--d-fast); background: var(--bg-surface); display: flex; gap: 11px; align-items: flex-start; }
.tile:hover { border-color: var(--green-300); } .tile.on { border-color: var(--sel-border); background: var(--sel-bg); }
.tile .te { font-size: 21px; flex-shrink: 0; }
.tile .tt { font-size: 13px; font-weight: 700; color: var(--ink-1000); }
.tile .td { font-size: 11px; color: var(--ink-500); margin-top: 2px; line-height: 1.4; }
.tile .tplay { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--hairline); background: var(--bg-surface); cursor: pointer; color: var(--green-700); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; margin-left: auto; }
.tile .tplay svg { width: 12px; height: 12px; }
.music-rec { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--accent-border); border-radius: var(--r-md); background: var(--accent-soft); margin-bottom: 14px; }
.music-rec .mr-play { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--green-600); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.music-rec .mr-play svg { width: 15px; height: 15px; }
.music-rec .mr-t { font-size: 12.5px; font-weight: 700; color: var(--ink-1000); }
.music-rec .mr-s { font-size: 11px; color: var(--ink-600); }
.music-rec .mr-tag { margin-left: auto; font-size: 9px; font-weight: 700; color: var(--green-700); background: var(--bg-surface); padding: 3px 7px; border-radius: var(--r-pill); border: 1px solid var(--green-200); }

/* reference / space */
.ref-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.ref-tile { position: relative; border: 1.5px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; cursor: pointer; background: var(--media-well); }
.ref-tile:hover { border-color: var(--green-300); }
.ref-tile.on { border-color: var(--green-500); box-shadow: var(--sel-ring-2); }
.ref-tile video { width: 100%; aspect-ratio: 0.5625; object-fit: cover; display: block; }
.ref-tile .rt-n { position: absolute; left: 0; right: 0; bottom: 0; padding: 11px 7px 6px; background: linear-gradient(180deg, transparent, rgba(0,0,0,0.82)); color: #fff; font-size: 10px; font-weight: 600; }
.ref-tile .rt-check { position: absolute; right: 6px; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--green-600); color: #fff; font-size: 11px; display: none; align-items: center; justify-content: center; z-index: 2; }
.ref-tile.on .rt-check { display: inline-flex; }
.space-upload { border: 1.5px dashed var(--hairline-strong); border-radius: var(--r-md); padding: 22px; text-align: center; cursor: pointer; margin-bottom: 14px; }
.space-upload:hover { border-color: var(--green-400); }
.space-upload .su-ic { color: var(--green-600); } .space-upload .su-ic svg { width: 26px; height: 26px; }
.space-upload .su-t { font-size: 13px; font-weight: 700; color: var(--ink-900); margin-top: 8px; }
.space-upload .su-s { font-size: 11px; color: var(--ink-500); margin-top: 4px; line-height: 1.5; }

/* breakdown / topup / cost-confirm */
.kv-list { display: flex; flex-direction: column; gap: 2px; }
.kv-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--hairline); }
.kv-row:last-child { border-bottom: none; }
.kv-row .kv-k { font-size: 13px; color: var(--ink-700); } .kv-row .kv-k .kv-s { display: block; font-size: 11px; color: var(--ink-500); }
.kv-row .kv-v { margin-left: auto; font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--ink-1000); }
.kv-total { display: flex; align-items: center; margin-top: 8px; padding-top: 12px; border-top: 2px solid var(--hairline-strong); }
.kv-total .kt-k { font-size: 14px; font-weight: 700; } .kv-total .kt-v { margin-left: auto; font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--green-700); }
.pack-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.pack { position: relative; padding: 16px; border: 1.5px solid var(--hairline); border-radius: var(--r-md); cursor: pointer; text-align: center; transition: all var(--d-fast); }
.pack:hover { border-color: var(--green-400); } .pack.best { border-color: var(--green-500); }
.pack .best-tag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font-size: 9px; font-weight: 700; color: #fff; background: var(--green-600); padding: 2px 9px; border-radius: var(--r-pill); }
.pack .pk-cr { font-size: 20px; font-weight: 800; font-family: var(--font-display); color: var(--ink-1000); } .pack .pk-pr { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.confirm-cost { text-align: center; padding: 12px 0 4px; }
.confirm-cost .cc-big { font-family: var(--font-display); font-size: 44px; font-weight: 800; color: var(--green-700); letter-spacing: -0.03em; }
.confirm-cost .cc-u { font-size: 13px; color: var(--ink-500); margin-top: 2px; }
.confirm-cost .cc-bal { font-size: 12px; color: var(--ink-600); margin-top: 14px; }
.confirm-cost .cc-bal b { color: var(--ink-900); }
.confirm-line { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--ink-50); border: 1px solid var(--hairline); margin-bottom: 14px; font-size: 12.5px; color: var(--ink-700); line-height: 1.5; }
[data-theme="dark"] .confirm-line { background: var(--bg-elevated); }
.confirm-line svg { width: 18px; height: 18px; color: var(--green-600); flex-shrink: 0; }
.confirm-line b { color: var(--ink-900); }

/* cascade confirm */
.cascade-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.cascade-row { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); }
.cascade-row .cr-ic { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cascade-row .cr-ic svg { width: 14px; height: 14px; }
.cascade-row.will .cr-ic { background: var(--warn-soft); color: var(--warn-ink); }
.cascade-row.may .cr-ic { background: var(--ink-100); color: var(--ink-600); } [data-theme="dark"] .cascade-row.may .cr-ic { background: var(--bg-elevated); }
.cascade-row.keep .cr-ic { background: var(--accent-chip-bg); color: var(--accent-chip-ink); }
.cascade-row .cr-tx { flex: 1; min-width: 0; }
.cascade-row .cr-n { font-size: 13px; font-weight: 700; color: var(--ink-900); }
.cascade-row .cr-d { font-size: 11px; color: var(--ink-500); margin-top: 1px; }
.cascade-row .cr-tag { font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 8px; border-radius: var(--r-pill); white-space: nowrap; }
.cascade-row.will .cr-tag { background: var(--warn-soft); color: var(--warn-ink); }
.cascade-row.may .cr-tag { background: var(--ink-100); color: var(--ink-600); } [data-theme="dark"] .cascade-row.may .cr-tag { background: var(--bg-elevated); }
.cascade-row.keep .cr-tag { background: var(--accent-chip-bg); color: var(--accent-chip-ink); }

/* clone capture flow */
.clone-steps { display: flex; flex-direction: column; gap: 12px; }
.clone-step { display: flex; gap: 13px; align-items: flex-start; padding: 14px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); }
.clone-step .cs-n { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-chip-bg); color: var(--accent-chip-ink); font-family: var(--font-mono); font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.clone-step .cs-t { font-size: 13px; font-weight: 700; color: var(--ink-900); }
.clone-step .cs-d { font-size: 11.5px; color: var(--ink-500); margin-top: 2px; line-height: 1.45; }
.consent-box { display: flex; gap: 10px; align-items: flex-start; padding: 13px; border: 1px solid var(--accent-border); border-radius: var(--r-md); background: var(--accent-soft); margin-top: 14px; }
.consent-box .cb-check { width: 20px; height: 20px; border-radius: var(--r-xs); border: 1.5px solid var(--green-500); flex-shrink: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--bg-surface); }
.consent-box .cb-check.on { background: var(--green-500); }
.consent-box .cb-check svg { width: 13px; height: 13px; opacity: 0; } .consent-box .cb-check.on svg { opacity: 1; }
.consent-box .cb-tx { font-size: 11.5px; color: var(--ink-700); line-height: 1.5; }

/* compare-looks explainer */
.compare-note { display: flex; gap: 11px; padding: 13px 14px; border: 1px solid var(--accent-border); border-radius: var(--r-md); background: var(--accent-soft); margin-bottom: 14px; }
.compare-note svg { width: 18px; height: 18px; color: var(--green-600); flex-shrink: 0; margin-top: 1px; }
.compare-note .cmn-t { font-size: 12.5px; font-weight: 700; color: var(--ink-1000); }
.compare-note .cmn-m { font-size: 11.5px; color: var(--ink-600); margin-top: 2px; line-height: 1.45; }
.eng-list { display: flex; flex-direction: column; gap: 7px; }
.eng-row { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); }
.eng-row .er-d { width: 22px; height: 22px; border-radius: 50%; background: var(--accent-chip-bg); color: var(--accent-chip-ink); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; } .eng-row .er-d svg { width: 13px; height: 13px; }
.eng-row .er-n { font-size: 13px; font-weight: 600; color: var(--ink-900); } .eng-row .er-note { font-size: 11px; color: var(--ink-500); margin-left: auto; }

/* brand dropdown */
.dd { position: fixed; z-index: 1100; min-width: 252px; background: var(--bg-elevated); border: 1px solid var(--hairline); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 6px; display: none; }
.dd.on { display: block; }
.dd .dd-h { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); padding: 7px 10px 4px; }
.dd-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); cursor: pointer; }
.dd-item:hover { background: var(--hover-surface); }
.dd-item .ddot { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, var(--green-400), var(--green-700)); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.dd-item .ddn { font-size: 13px; font-weight: 600; color: var(--ink-900); } .dd-item .dds { font-size: 11px; color: var(--ink-500); }
.dd-item.on { background: var(--accent-soft-strong); }
.dd-add { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: var(--r-sm); cursor: pointer; color: var(--green-700); font-size: 12.5px; font-weight: 600; border-top: 1px solid var(--hairline); margin-top: 4px; }
.dd-add:hover { background: var(--green-50); } .dd-add svg { width: 14px; height: 14px; }

/* toast / coach */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); z-index: 1500; opacity: 0; pointer-events: none; transition: all var(--d-base) var(--ease-out); }
.toast-wrap.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast { display: inline-flex; align-items: center; gap: 9px; background: var(--ink-1000); color: var(--ink-0); padding: 11px 18px; border-radius: var(--r-pill); box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 600; }
[data-theme="dark"] .toast { background: var(--bg-elevated); color: var(--ink-900); border: 1px solid var(--hairline); }
.toast .ind { width: 8px; height: 8px; border-radius: 50%; background: var(--green-500); }
.coach { position: fixed; top: 70px; left: 50%; transform: translateX(-50%) translateY(-12px); z-index: 1400; background: var(--bg-surface); border: 1px solid var(--green-200); border-radius: var(--r-pill); box-shadow: var(--shadow-lg); padding: 10px 16px; font-size: 12.5px; color: var(--ink-800); display: none; align-items: center; gap: 9px; }
.coach.on { display: inline-flex; }
.coach .c-ic { color: var(--green-600); } .coach .c-ic svg { width: 15px; height: 15px; }

@media (max-width: 1180px) { .frame-live { grid-template-columns: 1fr; } }

/* ════════════════════════════════════════════════════════════════
   ░ ONBOARDING + BRAND KIT ░ — ADDITIVE. Built strictly on the shared
   tokens/primitives above (--sel-*, --accent-*, .btn, .chip, .field,
   .subj-tile/.input-line, .seg-track). No new colour values; all flips
   with the theme via the existing tokens.
   ════════════════════════════════════════════════════════════════ */

/* — Full-screen onboarding shell — */
.ob-wrap { max-width: 760px; margin: 0 auto; padding: 30px 32px 64px; }
.ob-steps { display: flex; align-items: center; gap: 0; margin: 4px 0 30px; }
.ob-steps .ob-step { display: flex; align-items: center; gap: 9px; }
.ob-steps .ob-num { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; font-family: var(--font-mono);
  border: 1.5px solid var(--hairline-strong); background: var(--bg-surface); color: var(--ink-500);
  transition: all var(--d-fast); }
.ob-steps .ob-num svg { width: 14px; height: 14px; }
.ob-steps .ob-lbl { font-size: 12px; font-weight: 600; color: var(--ink-500); white-space: nowrap; }
.ob-steps .ob-line { flex: 1; height: 1.5px; background: var(--hairline); margin: 0 12px; min-width: 18px; }
.ob-step.done .ob-num { background: var(--green-500); border-color: var(--green-500); color: var(--amp-hexcoded-color-white); }
.ob-step.done .ob-lbl { color: var(--ink-700); }
.ob-step.cur .ob-num { border-color: var(--sel-border); background: var(--sel-bg); color: var(--accent-ink); box-shadow: var(--sel-ring-2); }
.ob-step.cur .ob-lbl { color: var(--ink-1000); }
.ob-step.done + .ob-line { background: var(--green-400); }

.ob-pane { display: none; }
.ob-pane.on { display: block; animation: obIn var(--d-base) var(--ease-out); }
@keyframes obIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.ob-eyebrow { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--green-700); }
.ob-h { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; margin: 8px 0 0; color: var(--ink-1000); }
.ob-h em { font-style: normal; color: var(--green-600); }
.ob-sub { font-size: 14px; color: var(--ink-600); margin-top: 9px; line-height: 1.55; max-width: 560px; }
.ob-foot { display: flex; align-items: center; gap: 10px; margin-top: 30px; }
.ob-foot .spacer { flex: 1; }

/* welcome hero badge */
.ob-welcome-badge { width: 64px; height: 64px; border-radius: var(--r-lg); margin-bottom: 18px;
  background: linear-gradient(135deg, var(--green-500), var(--green-700)); color: var(--amp-hexcoded-color-white);
  display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-green-soft); }
.ob-welcome-badge svg { width: 30px; height: 30px; }
.ob-bullets { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 12px; }
.ob-bullets li { display: flex; align-items: flex-start; gap: 11px; font-size: 13.5px; color: var(--ink-700); }
.ob-bullets li .bi { width: 26px; height: 26px; border-radius: var(--r-sm); flex-shrink: 0;
  background: var(--accent-chip-bg); color: var(--accent-chip-ink); display: inline-flex; align-items: center; justify-content: center; }
.ob-bullets li .bi svg { width: 15px; height: 15px; }
.ob-bullets li b { color: var(--ink-1000); font-weight: 600; }

/* connect options (step 2) — reuse subj-tile look, full-width rows */
.ob-connect { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.ob-conn-tile { display: flex; align-items: center; gap: 15px; padding: 16px 18px;
  border: 1.5px solid var(--hairline); border-radius: var(--r-lg); background: var(--bg-surface);
  cursor: pointer; text-align: left; width: 100%; transition: all var(--d-base); }
.ob-conn-tile:hover { border-color: var(--green-400); box-shadow: var(--shadow-sm); }
.ob-conn-tile.on { border-color: var(--sel-border); box-shadow: var(--sel-ring-2); background: var(--sel-bg); }
.ob-conn-tile .ci { width: 44px; height: 44px; border-radius: var(--r-md); flex-shrink: 0;
  background: var(--ink-100); color: var(--ink-700); display: inline-flex; align-items: center; justify-content: center; }
.ob-conn-tile.on .ci { background: var(--accent-chip-bg); color: var(--accent-chip-ink); }
.ob-conn-tile .ci svg { width: 22px; height: 22px; }
.ob-conn-tile .ct-t { font-size: 14.5px; font-weight: 700; color: var(--ink-1000); }
.ob-conn-tile .ct-s { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.ob-conn-tile .ct-go { margin-left: auto; flex-shrink: 0; color: var(--ink-400); }
.ob-conn-tile.on .ct-go { color: var(--green-600); }
.ob-conn-tile .ct-go svg { width: 18px; height: 18px; }
.ob-conn-url { margin-top: 12px; display: none; }
.ob-conn-url.on { display: block; }

/* scanning → confirmation */
.ob-scan { margin-top: 22px; padding: 22px; border: 1px solid var(--accent-border); border-radius: var(--r-lg);
  background: var(--accent-soft); display: none; align-items: center; gap: 15px; }
.ob-scan.on { display: flex; }
.ob-scan .scan-sp { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%;
  border: 3px solid var(--accent-border); border-top-color: var(--green-500); animation: spin 0.8s linear infinite; }
.ob-scan.done .scan-sp { border: none; background: var(--green-500); color: var(--amp-hexcoded-color-white); display: inline-flex; align-items: center; justify-content: center; animation: none; }
.ob-scan.done .scan-sp svg { width: 19px; height: 19px; }
.ob-scan .scan-t { font-size: 13.5px; font-weight: 700; color: var(--ink-1000); }
.ob-scan .scan-s { font-size: 12px; color: var(--ink-600); margin-top: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* — BRAND KIT (shared by onboarding step 3 + Settings → Brand Kit) — */
.bk { display: flex; flex-direction: column; gap: 22px; }
.bk-block { border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--bg-surface); padding: 18px 20px; }
.bk-block .bk-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.bk-block .bk-title { font-size: 13.5px; font-weight: 700; color: var(--ink-1000); }
.bk-block .bk-hint { font-size: 11.5px; color: var(--ink-500); margin-left: auto; text-align: right; }
.bk-block .bk-spacer { flex: 1; }

/* logo */
.bk-logo-row { display: flex; align-items: center; gap: 16px; }
.bk-logo-prev { width: 76px; height: 76px; border-radius: var(--r-md); flex-shrink: 0;
  border: 1px solid var(--hairline); background: var(--ink-50); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.bk-logo-prev img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.bk-logo-prev .lw { font-family: var(--font-display); font-weight: 900; font-size: 22px; letter-spacing: -0.02em; color: var(--ink-1000); }
.bk-logo-meta .lm-d { font-size: 12px; color: var(--ink-500); margin-top: 2px; }

/* color swatches */
.bk-swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.bk-swatch { display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer; border: none; background: transparent; padding: 0; }
.bk-swatch .sw-chip { width: 52px; height: 52px; border-radius: var(--r-md); border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-xs); position: relative; transition: transform var(--d-fast), box-shadow var(--d-fast); }
.bk-swatch:hover .sw-chip { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.bk-swatch.on .sw-chip { box-shadow: var(--sel-ring), var(--shadow-sm); }
.bk-swatch .sw-edit { position: absolute; right: 3px; bottom: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(255,255,255,0.92); color: #111; display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--d-fast); }
.bk-swatch:hover .sw-edit { opacity: 1; }
.bk-swatch .sw-edit svg { width: 10px; height: 10px; }
.bk-swatch .sw-hex { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; color: var(--ink-600); }
.bk-swatch .sw-role { font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-500); }

/* fonts */
.bk-fonts { display: flex; flex-wrap: wrap; gap: 10px; }
.bk-font { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md); background: var(--bg-surface); }
.bk-font .bf-spec { font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-500); }
.bk-font .bf-name { font-size: 15px; font-weight: 700; color: var(--ink-1000); }
.bk-font .bf-name.serif { font-family: var(--font-display); }
.bk-font .bf-change { font-size: 11.5px; font-weight: 600; color: var(--green-700); border: none; background: transparent; cursor: pointer; padding: 4px 6px; border-radius: var(--r-sm); }
.bk-font .bf-change:hover { background: var(--green-50); }

/* tone of voice — segmented cards */
.bk-tones { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.bk-tone { text-align: left; padding: 13px 15px; border: 1.5px solid var(--hairline); border-radius: var(--r-md);
  background: var(--bg-surface); cursor: pointer; transition: all var(--d-fast); }
.bk-tone:hover { border-color: var(--green-400); }
.bk-tone.on { border-color: var(--sel-border); box-shadow: var(--sel-ring-2); background: var(--sel-bg); }
.bk-tone .bt-t { font-size: 13.5px; font-weight: 700; color: var(--ink-1000); display: flex; align-items: center; gap: 7px; }
.bk-tone.on .bt-t .bt-ck { color: var(--green-600); }
.bk-tone .bt-ck { color: transparent; } .bk-tone .bt-ck svg { width: 14px; height: 14px; }
.bk-tone .bt-s { font-size: 11.5px; color: var(--ink-500); margin-top: 3px; line-height: 1.4; }

/* do-not-say chips */
.bk-dns { display: flex; flex-direction: column; gap: 14px; }
.bk-dns-group .dns-lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-500); margin-bottom: 8px; }
.bk-dns-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dns-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 8px 6px 12px; border-radius: var(--r-pill);
  border: 1px solid var(--danger-border); background: var(--danger-soft); color: var(--warn-ink); font-size: 12.5px; font-weight: 600; }
.dns-chip .x { width: 18px; height: 18px; border-radius: 50%; border: none; background: transparent; color: inherit; opacity: 0.6;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dns-chip .x:hover { opacity: 1; background: var(--hover-surface); }
.dns-chip .x svg { width: 12px; height: 12px; }
.dns-add { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 12px; border-radius: var(--r-pill);
  border: 1px dashed var(--hairline-strong); background: transparent; }
.dns-add input { border: none; background: transparent; outline: none; font-family: inherit; font-size: 12.5px; color: var(--ink-900); width: 120px; }
.dns-add input::placeholder { color: var(--ink-400); }
.dns-add .add-go { width: 22px; height: 22px; border-radius: 50%; border: none; background: var(--accent-soft); color: var(--accent-ink);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dns-add .add-go svg { width: 13px; height: 13px; }

/* connected channels (brand-kit view) */
.bk-channels { display: flex; flex-direction: column; gap: 10px; }
.bk-chan { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); }
.bk-chan .chn-ic { width: 34px; height: 34px; border-radius: var(--r-sm); flex-shrink: 0; background: var(--ink-100); color: var(--ink-700); display: inline-flex; align-items: center; justify-content: center; }
.bk-chan .chn-ic svg { width: 17px; height: 17px; }
.bk-chan .chn-n { font-size: 13px; font-weight: 700; color: var(--ink-1000); }
.bk-chan .chn-s { font-size: 11.5px; color: var(--ink-500); margin-top: 1px; }
.bk-chan .chn-state { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; }
.bk-chan .chn-state.connected { color: var(--green-700); }
.bk-chan .chn-state.connected svg { width: 14px; height: 14px; }
.bk-chan .chn-state.off { color: var(--ink-500); }

/* settings nav links (reuse for Brand Kit entry) */
.set-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; max-width: 560px; }
.set-link { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--hairline);
  border-radius: var(--r-lg); background: var(--bg-surface); cursor: pointer; text-align: left; width: 100%; transition: all var(--d-base); }
.set-link:hover { border-color: var(--green-400); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.set-link.disabled { cursor: default; opacity: 0.62; } .set-link.disabled:hover { transform: none; box-shadow: none; border-color: var(--hairline); }
.set-link .sl-ic { width: 42px; height: 42px; border-radius: var(--r-md); flex-shrink: 0; background: var(--accent-chip-bg); color: var(--accent-chip-ink); display: inline-flex; align-items: center; justify-content: center; }
.set-link.disabled .sl-ic { background: var(--ink-100); color: var(--ink-500); }
.set-link .sl-ic svg { width: 21px; height: 21px; }
/* the text column: title + subtitle must STACK (they were inline → ran together) */
.set-link > span:nth-of-type(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.set-link .sl-t { font-size: 14.5px; font-weight: 700; color: var(--ink-1000); display: block; }
.set-link .sl-s { font-size: 12px; line-height: 1.45; color: var(--ink-500); display: block; }
.set-link .sl-go { margin-left: auto; color: var(--ink-400); flex-shrink: 0; } .set-link .sl-go svg { width: 18px; height: 18px; }
.set-link .sl-tag { display: inline-block; margin-left: 8px; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-500); background: var(--ink-100); border-radius: var(--r-pill); padding: 2px 7px; vertical-align: middle; }
[data-theme="dark"] .set-link .sl-tag { background: var(--bg-elevated); }

/* ════ SETTINGS · two-pane (full single-brand + AGENCY coverage) ════ */
.set2 { display: grid; grid-template-columns: 234px 1fr; gap: 0; border: 1px solid var(--hairline); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-surface); box-shadow: var(--shadow-xs); min-height: 560px; }
.set2-nav { border-right: 1px solid var(--hairline); padding: 14px; background: var(--bg-soft); }
.set2-nav .nl { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-400); padding: 6px 11px 8px; }
.set2-item { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: var(--r-md); border: none; background: transparent; cursor: pointer; color: var(--ink-700); width: 100%; text-align: left; font-size: 13.5px; font-weight: 600; transition: background var(--d-fast), color var(--d-fast); }
.set2-item svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--ink-500); transition: color var(--d-fast); }
.set2-item:hover { background: var(--hover-surface); color: var(--ink-1000); }
.set2-item.on { background: var(--accent-soft-strong); color: var(--accent-ink); }
.set2-item.on svg { color: var(--green-600); }
[data-theme="dark"] .set2-item.on, [data-theme="dark"] .set2-item.on svg { color: var(--green-300); }
.set2-item .badge2 { margin-left: auto; font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--green-700); padding: 2px 7px; border-radius: var(--r-pill); border: 1px solid var(--green-200); background: var(--green-50); }
[data-theme="dark"] .set2-item .badge2 { color: var(--green-300); background: color-mix(in srgb, var(--green-500) 12%, transparent); border-color: color-mix(in srgb, var(--green-500) 26%, transparent); }
.set2-sep { height: 1px; background: var(--hairline); margin: 10px 6px; }
.set2-pane { padding: 28px 30px; overflow-y: auto; }
.set2-pane .ph { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 24px; }
.set2-pane .ph .phi { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--green-600); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-theme="dark"] .set2-pane .ph .phi { color: var(--green-300); }
.set2-pane .ph .phi svg { width: 21px; height: 21px; }
.set2-pane .ph h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin: 0; color: var(--ink-1000); display: flex; align-items: center; gap: 9px; }
.set2-pane .ph h2 .b2 { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--green-700); padding: 3px 8px; border-radius: var(--r-pill); background: var(--green-50); border: 1px solid var(--green-200); }
[data-theme="dark"] .set2-pane .ph h2 .b2 { color: var(--green-300); background: color-mix(in srgb, var(--green-500) 12%, transparent); border-color: color-mix(in srgb, var(--green-500) 26%, transparent); }
.set2-pane .ph .psub { font-size: 13px; color: var(--ink-600); margin-top: 4px; line-height: 1.5; max-width: 520px; }
.set-card { border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--bg-surface); overflow: hidden; box-shadow: var(--shadow-xs); }
.set-card + .set-card { margin-top: 16px; }
.set-row { display: flex; align-items: center; gap: 15px; padding: 16px 18px; transition: background var(--d-fast); }
.set-row + .set-row { border-top: 1px solid var(--hairline); }
.set-row.click { cursor: pointer; }
.set-row.click:hover { background: var(--hover-surface-2); }
.set-row .ri { width: 38px; height: 38px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--green-600); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-theme="dark"] .set-row .ri { color: var(--green-300); }
.set-row .ri svg { width: 18px; height: 18px; }
.set-row .ri.brandmark { color: #fff; background: linear-gradient(135deg, var(--green-400), var(--green-700)); font-weight: 700; font-size: 13px; }
.set-row .rt { min-width: 0; flex: 1; }
.set-row .rt .rn { font-size: 14px; font-weight: 600; color: var(--ink-1000); display: inline-flex; align-items: center; gap: 8px; }
.set-row .rt .rd { font-size: 12.5px; color: var(--ink-500); margin-top: 2px; line-height: 1.45; }
.set-row .rv { margin-left: auto; display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
.set-row .rv .val { font-size: 12.5px; color: var(--ink-600); font-weight: 500; }
.set-row .rv .chev { color: var(--ink-400); display: inline-flex; }
.set-row .rv .chev svg { width: 17px; height: 17px; }
.chip-pill { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: var(--r-pill); background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-200); white-space: nowrap; }
[data-theme="dark"] .chip-pill { background: color-mix(in srgb, var(--green-500) 12%, transparent); color: var(--green-300); border-color: color-mix(in srgb, var(--green-500) 26%, transparent); }
.chip-pill.current { background: var(--green-500); color: #fff; border-color: transparent; }
.pane-cap { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); margin: 28px 0 13px; }
.pane-cap:first-child { margin-top: 0; }
.add-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border: 1px dashed var(--hairline-strong); border-radius: var(--r-md); background: transparent; color: var(--green-700); font-size: 13.5px; font-weight: 600; cursor: pointer; width: 100%; transition: background var(--d-fast), border-color var(--d-fast); margin-top: 14px; text-align: left; }
[data-theme="dark"] .add-row { color: var(--green-300); }
.add-row:hover { background: var(--accent-soft); border-color: var(--green-400); }
.add-row .ai { width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--accent-border); background: var(--accent-soft); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.add-row .ai svg { width: 16px; height: 16px; }
.add-row .at { display: flex; flex-direction: column; line-height: 1.25; }
.add-row .ad { font-size: 11.5px; font-weight: 500; color: var(--ink-500); margin-top: 1px; }
.paste-site { display: flex; align-items: center; gap: 9px; height: 46px; padding: 0 8px 0 15px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); margin-top: 14px; transition: border-color var(--d-fast), box-shadow var(--d-fast); }
.paste-site:focus-within { border-color: var(--green-500); box-shadow: var(--sel-ring); }
.paste-site .lk { color: var(--ink-400); display: inline-flex; flex-shrink: 0; }
.paste-site .lk svg { width: 17px; height: 17px; }
.paste-site input { flex: 1; border: none; background: transparent; outline: none; font-family: inherit; font-size: 13.5px; color: var(--ink-1000); }
.paste-site input::placeholder { color: var(--ink-400); }
/* tables (billing usage, members) */
.tbl-wrap { border: 1px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl thead th { text-align: left; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-500); padding: 11px 16px; background: var(--bg-soft); border-bottom: 1px solid var(--hairline); white-space: nowrap; }
table.tbl tbody td { padding: 13px 16px; border-top: 1px solid var(--hairline); color: var(--ink-800); vertical-align: middle; }
table.tbl tbody tr:first-child td { border-top: none; }
table.tbl .cell-brand { display: inline-flex; align-items: center; gap: 10px; }
table.tbl .cell-brand .bd { width: 26px; height: 26px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
table.tbl .cell-brand .nm { font-weight: 600; color: var(--ink-1000); }
table.tbl .num { font-family: var(--font-mono); font-weight: 600; color: var(--ink-900); }
table.tbl .cell-member { display: inline-flex; align-items: center; gap: 11px; }
table.tbl .cell-member .av { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--green-400), var(--green-700)); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
table.tbl .cell-member .mn { font-weight: 600; color: var(--ink-1000); }
table.tbl .cell-member .me { font-size: 11.5px; color: var(--ink-500); }
.tbl-foot { padding: 13px 16px; border-top: 1px solid var(--hairline); background: var(--bg-soft); font-size: 12px; color: var(--ink-600); display: flex; align-items: center; gap: 8px; }
.tbl-foot .num { font-family: var(--font-mono); font-weight: 700; color: var(--ink-1000); }
.tbl-foot .spacer { flex: 1; }
.role { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: var(--r-pill); border: 1px solid var(--hairline-strong); color: var(--ink-700); background: var(--bg-surface); white-space: nowrap; }
.role.admin { color: var(--green-700); border-color: var(--green-200); background: var(--green-50); }
[data-theme="dark"] .role.admin { color: var(--green-300); background: color-mix(in srgb, var(--green-500) 12%, transparent); border-color: color-mix(in srgb, var(--green-500) 26%, transparent); }
.brand-access { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.ba-tag { font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-pill); background: var(--ink-100); color: var(--ink-700); border: 1px solid var(--hairline); white-space: nowrap; }
.ba-tag.all { background: var(--accent-soft); color: var(--green-700); border-color: var(--accent-border); }
[data-theme="dark"] .ba-tag.all { color: var(--green-300); }
.plan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.plan-card { position: relative; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); padding: 16px 15px; cursor: pointer; transition: border-color var(--d-fast), box-shadow var(--d-fast), transform var(--d-fast); }
.plan-card:hover { border-color: var(--green-400); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.plan-card.on { border-color: var(--green-500); box-shadow: var(--sel-ring); background: color-mix(in srgb, var(--green-500) 5%, var(--bg-surface)); }
.plan-card .pn { font-size: 13px; font-weight: 700; color: var(--ink-1000); }
.plan-card .pp { font-family: var(--font-display); font-size: 19px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink-1000); margin-top: 7px; }
.plan-card .pp small { font-family: var(--font-body); font-size: 11px; font-weight: 500; color: var(--ink-500); }
.plan-card .pd { font-size: 11px; color: var(--ink-500); margin-top: 6px; line-height: 1.4; }
.plan-card .pcur { position: absolute; top: 12px; right: 12px; font-size: 9px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--green-700); }
[data-theme="dark"] .plan-card .pcur { color: var(--green-300); }
.plan-card.on .pcur { display: inline-flex; align-items: center; gap: 4px; }
.plan-card:not(.on) .pcur { display: none; }
.plan-card .pcur svg { width: 11px; height: 11px; }
.cred-hero { display: flex; align-items: center; gap: 18px; padding: 20px 22px; border-radius: var(--r-md); background: linear-gradient(135deg, color-mix(in srgb, var(--green-500) 14%, var(--bg-surface)), color-mix(in srgb, var(--green-500) 3%, var(--bg-surface))); border: 1px solid var(--green-200); }
[data-theme="dark"] .cred-hero { border-color: color-mix(in srgb, var(--green-500) 26%, transparent); }
.cred-hero .cc { width: 50px; height: 50px; border-radius: var(--r-md); background: linear-gradient(135deg, var(--green-500), var(--green-700)); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--shadow-green-soft); }
.cred-hero .cc svg { width: 24px; height: 24px; }
.cred-hero .cv { font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink-1000); line-height: 1; }
.cred-hero .cl { font-size: 12.5px; color: var(--ink-600); margin-top: 5px; }
.cred-hero .cspacer { flex: 1; }
.toggle { width: 40px; height: 24px; border-radius: var(--r-pill); background: var(--green-500); position: relative; flex-shrink: 0; border: none; cursor: pointer; padding: 0; transition: background var(--d-fast); }
.toggle::after { content: ""; position: absolute; top: 3px; left: 19px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: left var(--d-fast); }
.toggle.off { background: var(--ink-300); }
.toggle.off::after { left: 3px; }
.notif-tbl thead th.ch { text-align: center; width: 86px; }
.notif-tbl tbody td.ch { text-align: center; }
.notif-tbl tbody td .toggle { margin: 0 auto; }
.notif-tbl tbody td.evt .en { font-weight: 600; color: var(--ink-1000); }
.notif-tbl tbody td.evt .ed { font-size: 11.5px; color: var(--ink-500); margin-top: 2px; }
.lang-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.lang-tag { font-size: 12px; font-weight: 500; padding: 6px 13px; border-radius: var(--r-pill); background: var(--ink-100); color: var(--ink-700); border: 1px solid var(--hairline); cursor: pointer; transition: all var(--d-fast); }
.lang-tag.on { background: var(--green-50); color: var(--green-700); border-color: var(--green-200); }
[data-theme="dark"] .lang-tag.on { background: color-mix(in srgb, var(--green-500) 12%, transparent); color: var(--green-300); border-color: color-mix(in srgb, var(--green-500) 26%, transparent); }
.lang-tag.add { background: transparent; border-style: dashed; color: var(--ink-500); display: inline-flex; align-items: center; gap: 5px; }
.lang-tag.add svg { width: 13px; height: 13px; }
.voice-tbl td .sel { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--hairline-strong); background: var(--bg-surface); font-size: 12.5px; font-weight: 600; color: var(--ink-800); cursor: pointer; }
.voice-tbl td .sel svg { width: 14px; height: 14px; color: var(--ink-400); }
@media (max-width: 1180px) { .plan-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 920px) { .set2 { grid-template-columns: 1fr; } .set2-nav { border-right: none; border-bottom: 1px solid var(--hairline); } }

/* back link (brand-kit view header) */
.bk-back { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-600);
  border: none; background: transparent; cursor: pointer; padding: 4px 0; }
.bk-back:hover { color: var(--ink-1000); } .bk-back svg { width: 15px; height: 15px; }

@media (max-width: 640px) { .bk-tones { grid-template-columns: 1fr; } .ob-steps .ob-lbl { display: none; } }

/* ═══════════════════════════════════════════════════════════════════════
   APPENDED — only for components NOT defined in the mockup CSS above.
   DO NOT add any class here that is already styled by the mockup.
   ═══════════════════════════════════════════════════════════════════════ */

/* Link reset — Next.js <Link> renders <a>; cards/rows shouldn't underline */
a.pcard, a.prow, a.lib-card, a.choose-tile, a.rail-item, a.rail-logo, a.more,
a.hx-ws-menu-item, a.hx-ws-menu-add, a.hx-nav-item {
  text-decoration: none;
  color: inherit;
}
a.credits { text-decoration: none; }
a.pcard *, a.prow *, a.lib-card *, a.choose-tile *, a.hx-ws-menu-item * { text-decoration: none; }

/* WorkspaceMenu — pill trigger + popover (not in mockup; kept component) */
.hx-ws-menu-wrap { position: relative; display: inline-flex; }
/* .hx-ws-pill removed — trigger now uses mockup .brand-pick */
.brand-pick.is-open { border-color: var(--green-500); box-shadow: var(--sel-ring); }
/* Static brand badge (no dropdown) — strip the button affordances. */
.brand-pick.is-static { cursor: default; }
.brand-pick.is-static:hover { background: var(--bg-surface); border-color: var(--hairline); }

.hx-ws-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl, var(--shadow-lg));
  z-index: 200; overflow: hidden;
}
.hx-ws-menu-header { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-bottom: 1px solid var(--hairline); background: var(--bg-surface); }
.hx-ws-menu-name { font-size: 14px; font-weight: 700; color: var(--ink-1000); }
.hx-ws-menu-plan { font-size: 11.5px; color: var(--ink-500); margin-top: 2px; }
.hx-ws-menu-section { padding: 6px; background: var(--bg-surface); }
.hx-ws-menu-section + .hx-ws-menu-section { border-top: 1px solid var(--hairline); }
.hx-ws-menu-heading {
  font-family: var(--font-mono);
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-500);
  padding: 8px 10px 6px;
}
.hx-ws-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px;
  background: transparent;
  border: none; border-radius: var(--r-md);
  color: var(--ink-900);
  font-size: 13px; font-family: inherit; text-align: left;
  cursor: pointer; transition: background var(--d-fast);
}
.hx-ws-menu-item:hover { background: var(--hover-surface-2); }
.hx-ws-menu-item svg { color: var(--ink-500); flex-shrink: 0; }
.hx-ws-menu-ws-logo {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.hx-ws-menu-ws-name { font-size: 13px; font-weight: 600; color: var(--ink-1000); }
.hx-ws-menu-ws-plan { font-size: 11px; color: var(--ink-500); margin-top: 1px; }
.hx-ws-menu-add {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  border: none; border-top: 1px solid var(--hairline);
  background: transparent;
  font-size: 13px; color: var(--green-700); font-weight: 600;
  cursor: pointer; font-family: inherit; text-align: left;
}
.hx-ws-menu-add:hover { background: var(--hover-surface-2); }

/* ThemeToggle — icon button */
.hx-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-pill);
  color: var(--ink-700);
  cursor: pointer; transition: all var(--d-fast);
}
.hx-icon-btn:hover { background: var(--hover-surface-2); color: var(--ink-1000); }

/* Modal — used by TopupModal. Built on mockup popup-scrim/popup styles. */
.hx-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 28px;
}
.hx-modal {
  width: min(560px, 100%); max-height: 90vh;
  display: flex; flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl, var(--shadow-lg));
  overflow: hidden;
}
.hx-modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 26px 16px; border-bottom: 1px solid var(--hairline); }
.hx-modal-title { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink-1000); margin: 0; }
.hx-modal-sub { font-size: 12.5px; color: var(--ink-500); margin: 4px 0 0; line-height: 1.5; }
.hx-modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--bg-surface); color: var(--ink-600);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.hx-modal-body { flex: 1; padding: 22px 26px; overflow-y: auto; }
.hx-modal-foot { padding: 14px 26px; border-top: 1px solid var(--hairline); display: flex; align-items: center; gap: 10px; }

/* ═══════════════════════════════════════════════════════════════════════
   AUTH SHELL — sign-in / sign-up / verify / onboarding
   ═══════════════════════════════════════════════════════════════════════ */

/* ══════════════ AUTH SHELL ══════════════ */
.auth-shell { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
@media (max-width: 860px) { .auth-shell { grid-template-columns: 1fr; } }

/* ── Left hero panel ── */
.auth-hero { display: flex; flex-direction: column; padding: 44px 52px 52px; background: radial-gradient(130% 100% at 50% 0%, #0c2417 0%, #060f0a 70%); position: relative; overflow: hidden; }
.auth-hero::before { content:''; position: absolute; inset: 0; background-image: linear-gradient(rgba(34,197,94,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(34,197,94,0.06) 1px, transparent 1px); background-size: 32px 32px; pointer-events: none; }
.auth-hero::after { content:''; position: absolute; bottom: -120px; left: -80px; width: 400px; height: 400px; background: radial-gradient(circle, rgba(34,197,94,0.12), transparent 70%); pointer-events: none; }
.auth-hero-wm { font-family: var(--font-display, inherit); font-size: 16px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; position: relative; z-index: 1; }
.auth-hero-wm span { width: 8px; height: 8px; border-radius: 50%; background: var(--green-400); flex-shrink: 0; }

.ah-copy { margin: auto 0 0; position: relative; z-index: 1; }
.auth-hero h1 { font-size: 36px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.12; color: #fff; margin: 0 0 14px; }
.auth-hero h1 em { font-style: normal; color: var(--green-300); }
.auth-hero p { font-size: 15px; color: rgba(255,255,255,0.6); line-height: 1.6; margin: 0; }

.ah-features { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 9px; position: relative; z-index: 1; }
.ah-features li { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: rgba(255,255,255,0.75); }
.ah-features li svg { color: var(--green-400); flex-shrink: 0; }

.ah-stats { display: flex; gap: 28px; margin: 30px 0; position: relative; z-index: 1; }
.ah-stat { display: flex; flex-direction: column; gap: 2px; }
.ah-stat-n { font-family: var(--font-display, inherit); font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -0.02em; line-height: 1; }
.ah-stat-l { font-size: 11px; color: rgba(255,255,255,0.45); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }

.ah-quote { border: 1px solid rgba(255,255,255,0.1); border-radius: var(--r-lg); padding: 18px 20px; background: rgba(255,255,255,0.04); position: relative; z-index: 1; margin-top: auto; }
.ahq-text { font-size: 13.5px; color: rgba(255,255,255,0.8); line-height: 1.55; margin: 0 0 14px; font-style: italic; }
.ahq-who { display: flex; align-items: center; gap: 10px; }
.ahq-av { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--green-400), var(--green-700)); color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ahq-name { display: block; font-size: 12.5px; font-weight: 700; color: #fff; }
.ahq-role { display: block; font-size: 11px; color: rgba(255,255,255,0.45); margin-top: 1px; }

@media (max-width: 860px) { .auth-hero { display: none; } }

/* ── Right form panel ── */
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 48px 24px; min-height: 100vh; background: var(--bg-canvas); }
.auth-form { width: 100%; max-width: 380px; }

/* mobile-only wordmark */
.auth-form-logo-sm { font-family: var(--font-display, inherit); font-size: 14px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-1000); margin-bottom: 28px; display: flex; align-items: center; gap: 6px; }
.auth-form-logo-sm span { width: 7px; height: 7px; border-radius: 50%; background: var(--green-500); }
@media (min-width: 861px) { .auth-form-logo-sm { display: none; } }

.form-title { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink-1000); margin: 0 0 6px; }
.form-sub { font-size: 14px; color: var(--ink-500); margin: 0 0 22px; line-height: 1.5; }

/* Google button */
.auth-google-btn { width: 100%; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1.5px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); color: var(--ink-900); font-size: 14px; font-weight: 600; cursor: pointer; transition: border-color var(--d-fast), box-shadow var(--d-fast), background var(--d-fast); font-family: inherit; }
.auth-google-btn:hover { border-color: var(--ink-400); box-shadow: var(--shadow-sm); background: var(--hover-surface-2); }
.auth-google-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Perks list (sign-up) */
.auth-perks { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 6px; }
.auth-perks li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-700); }
.auth-perks li svg { color: var(--green-600); flex-shrink: 0; }

/* Divider */
.or-divider { position: relative; text-align: center; margin: 20px 0; font-size: 11.5px; color: var(--ink-400); }
.or-divider::before, .or-divider::after { content:''; position: absolute; top: 50%; width: calc(50% - 56px); height: 1px; background: var(--hairline); }
.or-divider::before { left: 0; } .or-divider::after { right: 0; }

/* Method tabs */
.method-tabs { display: flex; gap: 4px; margin-bottom: 16px; background: var(--bg-soft); border-radius: var(--r-md); padding: 4px; border: 1px solid var(--hairline); }
.method-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 12px; border-radius: var(--r-sm); border: none; background: transparent; font-size: 13px; font-weight: 600; color: var(--ink-500); cursor: pointer; transition: all var(--d-fast); }
.method-tab.is-active { background: var(--bg-surface); color: var(--ink-1000); box-shadow: var(--shadow-xs); }
.method-tab svg { width: 13px; height: 13px; }

/* Phone input */
.phone-input { display: flex; gap: 8px; }
.phone-cc { height: 40px; padding: 0 10px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); color: var(--ink-900); font-size: 13.5px; cursor: pointer; flex-shrink: 0; font-family: inherit; }
.phone-cc:focus { outline: none; border-color: var(--sel-border); box-shadow: var(--sel-ring); }

/* Generic field */
.field { margin-bottom: 16px; }
.field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-700); margin-bottom: 7px; }
.field-help { display: block; font-size: 11.5px; color: var(--ink-400); margin-top: 6px; line-height: 1.5; }
.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); color: var(--ink-900); font-size: 14px; font-family: inherit; transition: border-color var(--d-fast), box-shadow var(--d-fast); box-sizing: border-box; }
.input:focus { outline: none; border-color: var(--sel-border); box-shadow: var(--sel-ring); }
select.input { cursor: pointer; }

/* Account type tiles (signup / onboarding — "A brand" vs "An agency") */
.acct-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.acct-type {
  appearance: none;
  -webkit-appearance: none;
  text-align: left;
  background: var(--bg-surface);
  color: var(--ink-900);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  padding: 14px 14px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color var(--d-fast), background var(--d-fast), box-shadow var(--d-fast);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 72px;
}
.acct-type:hover { border-color: var(--ink-500); }
.acct-type:focus-visible {
  outline: none;
  border-color: var(--sel-border);
  box-shadow: var(--sel-ring);
}
.acct-type.is-selected {
  border-color: var(--green-500, #16a34a);
  background: var(--green-50, rgba(22, 163, 74, 0.08));
  box-shadow: 0 0 0 1px var(--green-500, #16a34a) inset;
}
.acct-type-title { font-size: 14px; font-weight: 700; color: var(--ink-1000); }
.acct-type.is-selected .acct-type-title { color: var(--green-700, #15803d); }
.acct-type-sub { font-size: 12px; color: var(--ink-500); line-height: 1.4; }

/* Back link */
.auth-back-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-500); background: none; border: none; cursor: pointer; padding: 0; text-decoration: none; }
.auth-back-link:hover { color: var(--ink-1000); }
.auth-back-link svg { width: 14px; height: 14px; }

/* Error */
.auth-error { font-size: 13px; color: var(--red-600, #dc2626); margin: 8px 0 0; line-height: 1.4; }

/* Legal / footer */
.auth-legal { font-size: 11.5px; color: var(--ink-500); margin: 14px 0 0; line-height: 1.55; }
.auth-legal a { color: var(--ink-600); text-decoration: underline; text-decoration-color: var(--ink-300); text-underline-offset: 2px; }
.auth-form-footer { margin-top: 22px; text-align: center; font-size: 13px; color: var(--ink-500); }
.auth-form-footer a { font-weight: 600; color: var(--green-700); text-decoration: none; }
.auth-form-footer a:hover { text-decoration: underline; }

/* OTP row */
.otp-row { display: flex; gap: 8px; justify-content: center; margin: 26px 0 16px; }
.otp-digit { width: 48px; height: 58px; border: 1.5px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); font-size: 26px; font-weight: 800; text-align: center; color: var(--ink-1000); font-family: var(--font-mono, monospace); caret-color: transparent; transition: border-color var(--d-fast), box-shadow var(--d-fast); }
.otp-digit:focus { outline: none; border-color: var(--sel-border); box-shadow: var(--sel-ring); }
.otp-digit.err { border-color: var(--red-400, #f87171); }
.otp-hint { font-size: 12.5px; color: var(--ink-500); text-align: center; }
.otp-resend { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--green-700); background: none; border: none; cursor: pointer; padding: 0; }
.otp-resend:hover { color: var(--green-800); }
[data-theme="dark"] .otp-resend { color: var(--green-300); }

/* Onboarding step indicator */
.ob-wrap { max-width: 760px; margin: 0 auto; padding: 30px 32px 64px; }
.ob-steps { display: flex; align-items: center; gap: 0; margin: 4px 0 30px; }
.ob-steps .ob-step { display: flex; align-items: center; gap: 9px; }
.ob-steps .ob-num { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; font-family: var(--font-mono); border: 2px solid var(--hairline-strong); background: var(--bg-surface); color: var(--ink-500); }
.ob-steps .ob-num svg { width: 14px; height: 14px; }
.ob-steps .ob-lbl { font-size: 12px; font-weight: 600; color: var(--ink-500); white-space: nowrap; }
.ob-steps .ob-line { flex: 1; height: 1.5px; background: var(--hairline); margin: 0 12px; min-width: 18px; }
.ob-step.done .ob-num { background: var(--green-500); border-color: var(--green-500); color: #fff; }
.ob-step.done .ob-lbl { color: var(--ink-700); }
.ob-step.cur .ob-num { border-color: var(--sel-border); background: var(--sel-bg); color: var(--accent-ink); box-shadow: var(--sel-ring-2); }
.ob-step.cur .ob-lbl { color: var(--ink-1000); }
.ob-step.done + .ob-line { background: var(--green-400); }
@media (max-width: 640px) { .ob-steps .ob-lbl { display: none; } }

/* ═══════════════════════════════════════════════════════════════════════
   Credits ledger + Invoices — page-specific styles for kept pages.
   ═══════════════════════════════════════════════════════════════════════ */

/* Header section shared by /credits and /billing/invoices */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 0;
}
.page-head h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; margin: 0; color: var(--ink-1000); }
.page-head p { font-size: 14.5px; color: var(--ink-600); margin: 8px 0 0; line-height: 1.55; max-width: 560px; }

/* Generic card (used inside credits, invoices) */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 24px;
}

/* Wallet hero — top balance summary */
.wallet-hero { display: flex; flex-direction: column; gap: 6px; margin-bottom: 24px; padding: 24px 28px; background: var(--bg-surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); }
.wallet-hero-label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); }
.wallet-hero-val { font-size: 42px; font-weight: 700; color: var(--ink-1000); letter-spacing: -0.02em; line-height: 1.1; }
.wallet-hero-val small { font-size: 16px; font-weight: 500; color: var(--ink-500); margin-left: 8px; }
.wallet-hero-bd { font-size: 13px; color: var(--ink-600); margin-top: 4px; }
.wallet-hero-bd b { color: var(--ink-1000); font-weight: 700; }

/* Wallet lots — two-card grid (subscription + topup) */
.wallet-summary { margin-bottom: 32px; }
.wallet-lots { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .wallet-lots { grid-template-columns: 1fr; } }
.wallet-lot { padding: 20px; background: var(--bg-surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); }
.wallet-lot-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.wallet-lot-head > span:first-child { font-size: 13px; font-weight: 700; color: var(--ink-900); }
.wallet-lot-expiry { font-size: 11.5px; color: var(--ink-500); font-family: var(--font-mono); }
.wallet-lot-val { font-size: 22px; font-weight: 700; color: var(--ink-1000); letter-spacing: -0.01em; margin-bottom: 8px; }
.wallet-lot-val small { font-size: 13px; font-weight: 500; color: var(--ink-500); margin-left: 6px; }
.wallet-lot-bar { width: 100%; height: 6px; background: var(--ink-100); border-radius: var(--r-pill); overflow: hidden; margin-bottom: 8px; }
.wallet-lot-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--green-400), var(--green-600)); border-radius: inherit; }
.wallet-lot-sub { font-size: 11.5px; color: var(--ink-500); line-height: 1.5; }

/* Filter pills + table for ledger */
.btn-group {
  display: inline-flex; gap: 4px;
  padding: 4px; background: var(--ink-100);
  border-radius: var(--r-pill);
}
.btn-group .btn { height: 32px; padding: 0 16px; border: 1px solid transparent; background: transparent; border-radius: calc(var(--r-pill) - 4px); font-size: 12.5px; color: var(--ink-700); font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-group .btn:hover { color: var(--ink-1000); }
.btn-group .btn.on { background: var(--bg-surface); color: var(--ink-1000); border-color: var(--hairline); box-shadow: var(--shadow-xs, 0 1px 2px rgba(0,0,0,0.04)); }

/* Ledger table */
.ledger-table { width: 100%; border-collapse: collapse; margin-top: 18px; background: var(--bg-surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); overflow: hidden; }
.ledger-table thead th { text-align: left; padding: 12px 16px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-500); background: var(--ink-50); border-bottom: 1px solid var(--hairline); }
.ledger-table tbody td { padding: 14px 16px; font-size: 13px; color: var(--ink-800); border-top: 1px solid var(--hairline); vertical-align: top; }
.ledger-table tbody tr:hover td { background: var(--bg-soft, var(--ink-50)); }
.ledger-table .num { font-family: var(--font-mono); font-weight: 600; text-align: right; }
.ledger-table .num.pos { color: var(--green-700); }
.ledger-table .num.neg { color: var(--ink-1000); }
.ledger-event { display: inline-flex; align-items: center; gap: 8px; }
.ledger-event .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-300); flex-shrink: 0; }
.ledger-event-text { display: flex; flex-direction: column; }
.ledger-event-label { font-weight: 600; color: var(--ink-1000); }
.ledger-event-id { font-family: var(--font-mono); font-size: 11px; color: var(--ink-500); }
.ledger-ref { color: var(--green-700); font-weight: 500; }
.ledger-ref:hover { text-decoration: underline; }
.ledger-note { display: block; font-size: 11.5px; color: var(--ink-500); margin-top: 2px; }
.ledger-lot { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-600); }
.ledger-lot-subscription { color: var(--green-700); }
.ledger-lot-topup { color: var(--info-ink, var(--ink-700)); }

/* Invoices KPI row + table */
.kpi-row { display: grid; gap: 14px; margin: 24px 0 32px; }
.kpi { padding: 18px; background: var(--bg-surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); }
.kpi .lbl { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-500); }
.kpi .val { font-size: 26px; font-weight: 700; color: var(--ink-1000); letter-spacing: -0.01em; margin-top: 6px; }
.kpi .delta { font-size: 11.5px; color: var(--ink-500); margin-top: 4px; }

/* Status badges */
.badge-success { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; background: var(--green-50); color: var(--green-700); border-radius: var(--r-pill); font-size: 11.5px; font-weight: 600; }
[data-theme="dark"] .badge-success { background: rgba(34,197,94,0.12); color: var(--green-300); }
.badge-soft { display: inline-flex; padding: 3px 10px; background: var(--ink-100); color: var(--ink-600); border-radius: var(--r-pill); font-size: 11.5px; font-weight: 600; }
.badge-info { display: inline-flex; padding: 3px 10px; background: var(--info-soft); color: var(--info-ink); border-radius: var(--r-pill); font-size: 11.5px; font-weight: 600; }
.badge-danger { display: inline-flex; padding: 3px 10px; background: var(--danger-soft, #fde2e2); color: var(--danger-ink, #b91c1c); border-radius: var(--r-pill); font-size: 11.5px; font-weight: 600; }
.badge-warning { display: inline-flex; padding: 3px 10px; background: var(--warn-soft, #fff4e0); color: var(--warn-ink, #c2410c); border-radius: var(--r-pill); font-size: 11.5px; font-weight: 600; }

/* Brand profile — canon ring avatar */
.canon-ring-wrap { width: 64px; height: 64px; border-radius: 50%; padding: 3px; background: conic-gradient(var(--green-500) 0%, var(--green-400) 40%, var(--green-600) 70%, var(--green-500) 100%); flex-shrink: 0; }
.canon-ring-inner { width: 100%; height: 100%; border-radius: 50%; background: linear-gradient(135deg, var(--green-600), var(--green-800)); color: white; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; }

/* Progress bar */
.progress { width: 100%; height: 6px; background: var(--ink-100); border-radius: var(--r-pill); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--info-soft); background: linear-gradient(90deg, var(--info-ink), color-mix(in srgb, var(--info-ink) 70%, transparent)); border-radius: inherit; }

/* Filter bar pill links (URL → AD eyebrows + similar) — none of these should underline */
.pc-tool, .ck-vl, .ck-nm, .ck-tx, .rl-t, .rl-s, .ar-pill { text-decoration: none !important; }

/* Asset library filter bar — pill segmented + native selects, dark-mode friendly */
.lib-filterbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0 0 22px;
}
.lib-filter-select {
  appearance: none; -webkit-appearance: none;
  padding: 7px 26px 7px 12px;
  background: var(--bg-surface);
  background-image: url('/icons/select-arrow.svg');
  background-repeat: no-repeat;
  background-position: right 8px center;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-pill);
  font-size: 12.5px; color: var(--ink-1000); font-weight: 600;
  font-family: inherit; cursor: pointer;
  transition: border-color var(--d-fast);
}
.lib-filter-select:hover { border-color: var(--green-400); }
.lib-filter-select:focus { outline: none; border-color: var(--green-500); box-shadow: var(--focus-ring); }

.lib-filter-reset {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  font-size: 11.5px; color: var(--ink-600); font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.lib-filter-reset:hover { background: var(--ink-100); color: var(--ink-1000); }

.lib-empty {
  padding: 48px 24px;
  text-align: center;
  background: var(--bg-surface);
  border: 1px dashed var(--hairline);
  border-radius: var(--r-lg);
}
.lib-empty .le-t { font-size: 14px; color: var(--ink-700); margin-bottom: 14px; }

/* Library project picker dropdown */
.lib-filter-select-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 600;
  color: var(--ink-700);
  cursor: pointer; font-family: inherit;
  transition: all var(--d-fast);
  white-space: nowrap;
}
.lib-filter-select-btn:hover { border-color: var(--green-400); }
.lib-filter-select-btn.is-active { border-color: var(--sel-border); color: var(--accent-ink); background: var(--sel-bg); }
[data-theme="dark"] .lib-filter-select-btn.is-active { color: var(--green-300); }
.lib-proj-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0;
  width: 240px; z-index: 200;
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl, var(--shadow-lg));
  overflow: hidden;
}
.lib-proj-search {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--hairline);
}
.lib-proj-search svg { color: var(--ink-400); flex-shrink: 0; }
.lib-proj-search input {
  flex: 1; border: none; background: transparent; outline: none;
  font-family: inherit; font-size: 12.5px; color: var(--ink-900);
}
.lib-proj-search input::placeholder { color: var(--ink-400); }
.lib-proj-opt {
  display: block; width: 100%;
  padding: 8px 12px;
  text-align: left; font-family: inherit;
  font-size: 13px; color: var(--ink-800);
  background: transparent; border: none; cursor: pointer;
  transition: background var(--d-fast);
}
.lib-proj-opt:hover { background: var(--hover-surface-2); }
.lib-proj-opt.is-active { color: var(--green-700); font-weight: 600; background: var(--sel-bg); }
[data-theme="dark"] .lib-proj-opt.is-active { color: var(--green-300); }
.lib-proj-empty { padding: 10px 12px; font-size: 12.5px; color: var(--ink-400); }

/* ═══════════════════════════════════════════════════════════════════════
   LIFTED VERBATIM from /Users/harish/Documents/projects/design-snapshot.html
   Credits hero/lots (lines 6325-6440) + ledger table (lines 6785-6833).
   These override the hand-written placeholders above.
   ═══════════════════════════════════════════════════════════════════════ */

.wallet-summary {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 980px) {
  .wallet-summary { grid-template-columns: 1fr; }
}

.wallet-hero {
  padding: 22px 24px;
  background: linear-gradient(135deg, rgba(34,197,94,0.10), rgba(34,197,94,0.02) 70%), var(--bg-surface);
  border: 1px solid var(--green-100);
  border-radius: 16px;
  display: flex; flex-direction: column; justify-content: center;
}
.wallet-hero-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-700);
}
.wallet-hero-val {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink-1000);
  margin: 6px 0 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.wallet-hero-val span {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-500);
  letter-spacing: 0;
  margin-left: 6px;
}
.wallet-hero-bd {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-600);
}
.wallet-hero-bd b {
  color: var(--ink-1000);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.wallet-hero-bd .dot { color: var(--ink-300); }
.wallet-hero-bd .reserved {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--warning);
  font-weight: 600;
}

.wallet-lots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) { .wallet-lots { grid-template-columns: 1fr; } }

.wallet-lot {
  padding: 18px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
}
.wallet-lot-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.wallet-lot-expiry {
  font-size: 11.5px;
  color: var(--ink-500);
  font-weight: 500;
}
.wallet-lot-val {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-1000);
  font-variant-numeric: tabular-nums;
  margin-bottom: 10px;
}
.wallet-lot-val span {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-500);
  margin-left: 4px;
  letter-spacing: 0;
}
.wallet-lot-bar {
  height: 4px;
  background: var(--ink-100);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}
.wallet-lot-bar > div {
  height: 100%;
  background: var(--green-500);
  border-radius: 2px;
  transition: width var(--d-base) var(--ease-out);
}
.wallet-lot-sub {
  font-size: 11.5px;
  color: var(--ink-500);
  line-height: 1.45;
}


.ledger-table {
  width: 100%;
  border-collapse: collapse;
}
.ledger-table thead tr {
  text-align: left;
  font-size: 11.5px;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ledger-table th { padding: 12px 20px; font-weight: 600; }
.ledger-table tbody tr { border-top: 1px solid var(--hairline); }
.ledger-table tbody tr:hover { background: var(--ink-50); }
.ledger-table td { padding: 14px 20px; font-size: 13.5px; vertical-align: middle; }

.ledger-event { display: flex; align-items: center; gap: 10px; }
.ledger-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ledger-icon-green { background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-100); }
[data-theme="dark"] .ledger-icon-green { background: rgba(34,197,94,0.12); color: var(--green-400); border-color: rgba(34,197,94,0.2); }
.ledger-icon-ink   { background: var(--ink-50);   color: var(--ink-800);   border: 1px solid var(--hairline); }
.ledger-icon-warn  { background: var(--warning-soft); color: var(--warning-ink); border: 1px solid var(--warning-soft-bd); }
.ledger-event-text { display: flex; flex-direction: column; min-width: 0; }
.ledger-event-label { font-size: 13.5px; font-weight: 600; color: var(--ink-1000); }
.ledger-event-id { font-size: 11px; color: var(--ink-400); font-family: var(--font-mono); }

.ledger-ref {
  font-weight: 500;
  color: var(--ink-900);
  text-decoration: none;
}
.ledger-ref:hover { color: var(--green-700); text-decoration: underline; }
.ledger-note { font-size: 11.5px; color: var(--ink-500); margin-top: 2px; }

.ledger-lot {
  display: inline-flex; align-items: center;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ledger-lot-subscription { background: var(--green-50);   color: var(--green-800); border: 1px solid var(--green-100); }
.ledger-lot-topup        { background: #EFF6FF;           color: #1E40AF;           border: 1px solid #BFDBFE; }
[data-theme="dark"] .ledger-lot-subscription { background: rgba(34,197,94,0.12); color: var(--green-300); border-color: rgba(34,197,94,0.25); }
[data-theme="dark"] .ledger-lot-topup        { background: rgba(59,130,246,0.12); color: #7db4ff;          border-color: rgba(59,130,246,0.25); }

/* ── Form primitives — .field / .field-label / .field-help / .input ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 13px; font-weight: 600;
  color: var(--ink-800);
  letter-spacing: -0.01em;
}
.field-help {
  font-size: 12px;
  color: var(--ink-500);
  line-height: 1.5;
}
.input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink-1000);
  outline: none;
  transition: border-color var(--d-fast), box-shadow var(--d-fast);
  -moz-appearance: textfield;
}
.input::-webkit-inner-spin-button,
.input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input:focus { border-color: var(--green-500); box-shadow: var(--focus-ring); }
.input::placeholder { color: var(--ink-400); }

/* ═══════════════════════════════════════════════════════════════════════
   Topup modal + hx-modal — lifted from design-snapshot.html lines 6484-6900
   ═══════════════════════════════════════════════════════════════════════ */

.topup-mode {
  display: inline-flex; width: 100%;
  background: var(--ink-100);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
[data-theme="dark"] .topup-mode {
  background: rgba(255,255,255,0.06);
  border-color: var(--hairline);
}
.topup-mode-btn {
  flex: 1;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--ink-500);
  cursor: pointer;
  font-family: inherit;
  transition: color var(--d-fast);
}
.topup-mode-btn.is-active {
  background: var(--bg-surface);
  color: var(--ink-1000);
  box-shadow: 0 1px 3px rgba(11,11,15,0.12), 0 0 0 1px rgba(11,11,15,0.06);
}
[data-theme="dark"] .topup-mode-btn.is-active {
  background: rgba(255,255,255,0.10);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.topup-sku-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.topup-sku {
  position: relative;
  text-align: left;
  padding: 16px;
  background: var(--bg-surface);
  border: 1.5px solid var(--hairline);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color var(--d-fast), box-shadow var(--d-fast);
}
.topup-sku:hover { border-color: var(--ink-400); }
.topup-sku.is-selected {
  border-color: var(--green-500);
  background: linear-gradient(180deg, var(--green-50), var(--bg-surface) 80%);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.12);
}
[data-theme="dark"] .topup-sku.is-selected {
  background: linear-gradient(180deg, rgba(34,197,94,0.12), var(--bg-surface) 80%);
}
.topup-sku-badge {
  position: absolute;
  top: -10px; left: 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #0B0B0F;
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;
}
[data-theme="dark"] .topup-sku-badge { background: #FAFAFA; color: #0B0B0F; }
.topup-sku-check {
  position: absolute;
  top: 12px; right: 12px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--green-500);
  color: white;
  display: flex; align-items: center; justify-content: center;
}
.topup-sku-name { font-size: 13px; font-weight: 700; color: var(--ink-700); letter-spacing: 0.02em; text-transform: uppercase; }
.topup-sku-credits {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-1000);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.topup-sku-credits span { font-size: 12px; font-weight: 500; color: var(--ink-500); margin-left: 4px; }
.topup-sku-price {
  font-size: 18px; font-weight: 700;
  color: var(--green-700);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.topup-sku-rate { font-size: 11.5px; color: var(--ink-500); margin-top: 2px; font-variant-numeric: tabular-nums; }
.topup-sku-desc { font-size: 12px; color: var(--ink-600); margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--hairline); }

/* ── Custom-amount tab (rewritten): $-input on top, quick chips underneath,
   hint line last. Every element has its own row + explicit spacing so
   nothing crashes into the summary block. */
.topup-custom { display: flex; flex-direction: column; gap: 12px; padding: 8px 0 4px; }
.topup-custom-label { font-size: 13px; font-weight: 600; color: var(--ink-800); }
.topup-custom-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.topup-custom-inputwrap {
  position: relative; flex-shrink: 0;
  display: inline-flex; align-items: center;
  border: 1.5px solid var(--hairline-strong);
  border-radius: var(--r-md);
  background: var(--bg-surface);
  padding: 0 12px 0 0;
  transition: border-color var(--d-fast), box-shadow var(--d-fast);
}
.topup-custom-inputwrap:focus-within {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-500) 18%, transparent);
}
.topup-custom-prefix {
  padding: 0 4px 0 14px;
  font-family: var(--font-mono); font-size: 22px; font-weight: 700;
  color: var(--ink-1000); user-select: none;
}
.topup-custom-input {
  width: 96px; border: none; outline: none;
  background: transparent; color: var(--ink-1000);
  font-family: var(--font-mono); font-size: 22px; font-weight: 700;
  padding: 12px 0; letter-spacing: -0.02em;
}
.topup-custom-input::-webkit-outer-spin-button,
.topup-custom-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.topup-custom-input[type=number] { -moz-appearance: textfield; }
.topup-custom-derived {
  font-size: 14px; color: var(--ink-700);
  font-variant-numeric: tabular-nums;
}
.topup-custom-derived b { color: var(--ink-1000); font-weight: 700; }
.topup-custom-rate { color: var(--ink-500); font-size: 12.5px; }
.topup-custom-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.topup-quick-chip {
  padding: 8px 14px; border-radius: var(--r-pill);
  border: 1.5px solid var(--hairline-strong);
  background: var(--bg-surface); color: var(--ink-700);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all var(--d-fast); font-variant-numeric: tabular-nums;
}
.topup-quick-chip:hover { border-color: var(--green-400); color: var(--ink-1000); }
.topup-quick-chip.is-selected {
  border-color: var(--green-500);
  background: color-mix(in srgb, var(--green-500) 12%, var(--bg-surface));
  color: var(--ink-1000);
}
.topup-custom-hint { font-size: 12px; color: var(--ink-500); line-height: 1.5; }
.topup-custom-hint.is-error { color: var(--danger, #dc2626); font-weight: 500; }
.topup-summary {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--hairline);
  font-size: 13.5px; color: var(--ink-700);
  font-variant-numeric: tabular-nums;
}
.topup-summary b { color: var(--ink-1000); font-weight: 700; }
.topup-summary-tax { color: var(--ink-500); font-weight: 500; }
.topup-summary-sub {
  margin-top: 6px; font-size: 11.5px; color: var(--ink-500); line-height: 1.5;
}
.topup-slider {
  width: 100%;
  margin-top: 12px;
  accent-color: var(--green-500);
}
.topup-slider-ticks {
  display: flex; justify-content: space-between;
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--ink-400);
  font-variant-numeric: tabular-nums;
}

.topup-pay { display: flex; flex-direction: column; gap: 6px; }
.topup-pay-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--ink-700);
}
.topup-pay-row:hover { border-color: var(--ink-400); }
.topup-pay-row.is-selected {
  border-color: var(--green-500);
  background: var(--green-50);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.12);
  color: var(--green-800);
}
[data-theme="dark"] .topup-pay-row.is-selected {
  background: rgba(34,197,94,0.10);
  color: var(--green-300);
}
.topup-pay-text { display: flex; flex-direction: column; gap: 2px; }
.topup-pay-title { font-size: 13.5px; font-weight: 600; color: var(--ink-1000); }
.topup-pay-row.is-selected .topup-pay-title { color: var(--green-800); }
[data-theme="dark"] .topup-pay-row.is-selected .topup-pay-title { color: var(--green-300); }
.topup-pay-sub { font-size: 11.5px; color: var(--ink-500); }

/* Topup modal footer — order summary */
.topup-total {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 200px;
  font-size: 12.5px;
  color: var(--ink-600);
}
.topup-total-line {
  display: flex; justify-content: space-between; align-items: baseline;
}
.topup-total-num { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--ink-800); }
.topup-total-line.is-final {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--hairline);
  font-size: 14px;
  color: var(--ink-1000);
  font-weight: 700;
}
.topup-total-line.is-final .topup-total-num { color: var(--green-700); font-size: 15px; }

/* 2-step pip indicator (used in footer) */
.topup-step-dots {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: var(--ink-500);
}
.step-dot {
  width: 18px; height: 4px; border-radius: 2px;
  background: var(--ink-200);
}
.step-dot.is-on { background: var(--green-500); }
.step-dot-label { margin-left: 6px; font-weight: 500; }

/* Order recap on step 2 */
.topup-order-recap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-radius: 10px;
}
[data-theme="dark"] .topup-order-recap {
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.20);
}
.topup-order-credits {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-1000);
  font-variant-numeric: tabular-nums;
}
.topup-order-credits span { font-size: 13px; font-weight: 500; color: var(--ink-500); margin-left: 4px; }
.topup-order-sku { font-size: 12px; color: var(--ink-600); margin-top: 2px; }
.topup-order-sku b { color: var(--ink-900); font-weight: 700; }
.topup-order-edit {
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-700);
  cursor: pointer;
}
.topup-order-edit:hover { border-color: var(--ink-400); color: var(--ink-1000); }

/* .topup-custom-quick + .topup-summary now defined in the custom-amount
   block above (rewritten for PRD-aligned modal). Duplicate here removed
   because CSS last-wins was clobbering the new layout. */

.topup-pay-row { position: relative; }
.topup-pay-check {
  position: absolute;
  right: 12px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--green-500);
  color: white;
  display: flex; align-items: center; justify-content: center;
}

/* ── Pause modal — impact list ─────────────────────────── */

.hx-modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(11,11,15,0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.hx-modal {
  width: 100%;
  max-height: calc(100vh - 48px);
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 32px 64px -16px rgba(11,11,15,0.35),
    0 12px 24px -12px rgba(11,11,15,0.2);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.hx-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--hairline);
}
.hx-modal-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink-1000);
}
.hx-modal-sub {
  font-size: 13px;
  color: var(--ink-500);
  margin: 4px 0 0;
  line-height: 1.5;
}
.hx-modal-close {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--ink-50);
  border: 1px solid var(--hairline);
  color: var(--ink-600);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hx-modal-close:hover { background: var(--ink-100); color: var(--ink-1000); }
.hx-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px;
}
.hx-modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bg-surface);
}


/* Wider container for credits + invoices (overrides .page-inner max-width on those pages) */
.credits-wide.page-inner, .invoices-wide.page-inner { max-width: 1320px; padding: 32px 28px 60px; }

/* WorkspaceMenu — force solid background so the popover never shows the page
   through. Some cascade above (link reset / color:inherit) was killing visibility. */
.hx-ws-menu,
.hx-ws-menu-section,
.hx-ws-menu-header {
  background: var(--bg-surface) !important;
}
[data-theme="dark"] .hx-ws-menu,
[data-theme="dark"] .hx-ws-menu-section,
[data-theme="dark"] .hx-ws-menu-header {
  background: #1c1c22 !important;
}
.hx-ws-menu-item {
  color: var(--ink-900) !important;
}
.hx-ws-menu-item .hx-ws-menu-name,
.hx-ws-menu-item .hx-ws-menu-ws-name { color: var(--ink-1000) !important; }
.hx-ws-menu-item .hx-ws-menu-plan,
.hx-ws-menu-item .hx-ws-menu-ws-plan { color: var(--ink-500) !important; }

/* ROOT-CAUSE FIX: .hdr has backdrop-filter which creates a stacking context.
   Without a z-index, later siblings (.page-inner > .hc-hero) paint over any
   popovers anchored inside .hdr. Lifting .hdr above the page content. */
.hdr { position: relative; z-index: 50; }

/* ── BRAND KIT BLOCKS ── */
.bk { display: flex; flex-direction: column; gap: 22px; }
.bk-block { border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--bg-surface); padding: 18px 20px; }
.bk-block .bk-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.bk-block .bk-title { font-size: 13.5px; font-weight: 700; color: var(--ink-1000); }
.bk-block .bk-hint { font-size: 11.5px; color: var(--ink-500); margin-left: auto; text-align: right; }
.bk-block .bk-spacer { flex: 1; }
.bk-logo-row { display: flex; align-items: center; gap: 16px; }
.bk-logo-prev { width: 76px; height: 76px; border-radius: var(--r-md); flex-shrink: 0; background: var(--ink-50); border: 1px solid var(--hairline); display: flex; align-items: center; justify-content: center; }
.bk-logo-prev .lw { font-family: var(--font-display); font-weight: 900; font-size: 22px; letter-spacing: -0.02em; color: var(--ink-1000); }
.bk-logo-meta .lm-d { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.bk-swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.bk-swatch { display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer; border: none; background: transparent; padding: 0; }
.bk-swatch .sw-chip { width: 52px; height: 52px; border-radius: var(--r-md); border: 1px solid var(--hairline-strong); position: relative; overflow: hidden; transition: transform var(--d-fast), box-shadow var(--d-fast); }
.bk-swatch:hover .sw-chip { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.bk-swatch .sw-edit { position: absolute; right: 3px; bottom: 3px; width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,0.9); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--d-fast); }
.bk-swatch:hover .sw-edit { opacity: 1; }
.bk-swatch .sw-edit svg { width: 10px; height: 10px; color: #000; }
.bk-swatch .sw-hex { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; color: var(--ink-600); }
.bk-swatch .sw-role { font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-500); }
.bk-fonts { display: flex; flex-wrap: wrap; gap: 10px; }
.bk-font { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); flex: 1; min-width: 160px; }
.bk-font .bf-spec { font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-500); }
.bk-font .bf-name { font-size: 15px; font-weight: 700; color: var(--ink-1000); }
.bk-font .bf-name.serif { font-family: var(--font-display); }
.bk-font .bf-change { font-size: 11.5px; font-weight: 600; color: var(--green-700); border: none; background: transparent; cursor: pointer; padding: 4px 6px; border-radius: var(--r-sm); margin-left: auto; }
.bk-font .bf-change:hover { background: var(--green-50); }
.bk-tones { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.bk-tone { text-align: left; padding: 13px 15px; border: 1.5px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); cursor: pointer; transition: border-color var(--d-fast), box-shadow var(--d-fast), background var(--d-fast); }
.bk-tone:hover { border-color: var(--green-400); }
.bk-tone.on { border-color: var(--sel-border); box-shadow: var(--sel-ring-2); background: var(--sel-bg); }
.bk-tone .bt-t { font-size: 13.5px; font-weight: 700; color: var(--ink-1000); display: flex; align-items: center; gap: 7px; }
.bk-tone.on .bt-t .bt-ck { color: var(--green-600); }
.bk-tone .bt-ck { color: transparent; }
.bk-tone .bt-ck svg { width: 14px; height: 14px; }
.bk-tone .bt-s { font-size: 11.5px; color: var(--ink-500); margin-top: 3px; line-height: 1.4; }
.bk-dns { display: flex; flex-direction: column; gap: 14px; }
.bk-dns-group .dns-lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-500); margin-bottom: 8px; }
.bk-dns-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dns-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 8px 6px 12px; border-radius: var(--r-pill); background: var(--ink-100); color: var(--ink-900); font-size: 12.5px; font-weight: 500; }
[data-theme="dark"] .dns-chip { background: var(--bg-elevated); }
.dns-chip .x { width: 18px; height: 18px; border-radius: 50%; border: none; background: transparent; color: inherit; opacity: 0.6; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: opacity var(--d-fast); }
.dns-chip .x:hover { opacity: 1; background: var(--hover-surface); }
.dns-chip .x svg { width: 12px; height: 12px; }
.dns-add { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px 0 12px; border-radius: var(--r-pill); border: 1.5px dashed var(--hairline-strong); color: var(--ink-500); font-size: 12.5px; }
.dns-add input { border: none; background: transparent; outline: none; font-family: inherit; font-size: 12.5px; color: var(--ink-900); width: 120px; }
.dns-add input::placeholder { color: var(--ink-400); }
.dns-add .add-go { width: 22px; height: 22px; border-radius: 50%; border: none; background: var(--green-50); color: var(--green-700); cursor: pointer; display: flex; align-items: center; justify-content: center; }
[data-theme="dark"] .dns-add .add-go { background: rgba(34,197,94,0.1); color: var(--green-400); }
.dns-add .add-go svg { width: 13px; height: 13px; }
.bk-channels { display: flex; flex-direction: column; gap: 10px; }
.bk-chan { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); }
.bk-chan .chn-ic { width: 34px; height: 34px; border-radius: var(--r-sm); flex-shrink: 0; background: var(--ink-100); color: var(--ink-700); display: inline-flex; align-items: center; justify-content: center; }
.bk-chan .chn-ic svg { width: 17px; height: 17px; }
.bk-chan .chn-n { font-size: 13px; font-weight: 700; color: var(--ink-1000); }
.bk-chan .chn-s { font-size: 11.5px; color: var(--ink-500); margin-top: 1px; }
.bk-chan .chn-state { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; }
.bk-chan .chn-state.connected { color: var(--green-700); }
[data-theme="dark"] .bk-chan .chn-state.connected { color: var(--green-400); }
.bk-chan .chn-state.connected svg { width: 14px; height: 14px; }
.bk-chan .chn-state.off { color: var(--ink-500); cursor: pointer; }
.bk-back { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-600); background: transparent; border: none; cursor: pointer; padding: 0; margin-bottom: 8px; }
.bk-back:hover { color: var(--ink-1000); }
.bk-back svg { width: 15px; height: 15px; }

/* ══════════════════════════════════════════════════════════════════
   PRICING PAGE
   ══════════════════════════════════════════════════════════════════ */

/* The green radial wash is applied globally on <body> so every interior
   page (not just pricing) picks it up and it extends to the full viewport
   instead of stopping mid-page. No page-scoped wash needed here anymore. */
.pr-page-inner { position: relative; }

/* align-items: stretch so all cards in the row take the tallest sibling's
   height. Combined with `flex: 1` on `.pr-features` and `margin-top: auto`
   on the CTA button (both already set), CTA buttons sit at the same
   vertical position regardless of feature-list length. */
.pr-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: stretch; }
@media (max-width: 960px) { .pr-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .pr-cards { grid-template-columns: 1fr; } }

.pr-card { position: relative; display: flex; flex-direction: column; padding: 22px 20px 20px; border: 1.5px solid var(--hairline-strong); border-radius: var(--r-lg); background: var(--bg-surface); cursor: pointer; transition: border-color var(--d-fast), box-shadow var(--d-fast), transform var(--d-fast); min-height: 420px; }
.pr-card:hover { border-color: var(--green-400); box-shadow: 0 8px 22px -12px color-mix(in srgb, var(--green-500) 45%, transparent), var(--shadow-sm); transform: translateY(-3px); }

/* Featured (Pro) — deeper resting shadow so the "Most popular" card reads
   as slightly elevated even when it's not the actively-selected card. The
   selection ring itself is on .pr-card.on, not here — so when the user
   clicks Basic, the ring transfers cleanly. */
.pr-card.featured { box-shadow: 0 6px 22px -10px color-mix(in srgb, var(--green-500) 35%, transparent); }

/* Active / selected card — the gradient ring lives here so it can move
   between cards on click. First paint auto-seeds .on on the featured card
   in JSX, so the ring starts on Pro until the user picks otherwise.
   Rendered via ::before + mask-composite so the card's own background
   stays var(--bg-surface) → dark-mode contrast holds. */
.pr-card.on { border-color: transparent; box-shadow: 0 8px 26px -12px color-mix(in srgb, var(--green-500) 55%, transparent); }
.pr-card.on::before {
  content: '';
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(140deg, var(--green-500) 0%, var(--green-400) 40%, color-mix(in srgb, var(--green-500) 35%, transparent) 100%);
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.pr-card.on:hover { transform: translateY(-4px); box-shadow: 0 14px 32px -12px color-mix(in srgb, var(--green-500) 65%, transparent); }

/* Current plan — deeper gradient (green-600 → green-400) so a subscribed
   user can tell "this is what I'm on" apart from "this is what I've clicked".
   is-current wins over .on when both apply. */
.pr-card.is-current { border-color: transparent; }
.pr-card.is-current::before {
  content: '';
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(140deg, var(--green-600) 0%, var(--green-500) 60%, var(--green-400) 100%);
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

.pr-badge { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; background: var(--green-600); padding: 3px 9px; border-radius: var(--r-pill); margin-bottom: 10px; align-self: flex-start; }
.pr-name { font-size: 14px; font-weight: 700; color: var(--ink-1000); }
.pr-price { font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink-1000); margin: 8px 0 4px; line-height: 1; }
.pr-price .pr-per { font-family: var(--font-body); font-size: 12px; font-weight: 500; color: var(--ink-500); }
.pr-desc { font-size: 12px; color: var(--ink-600); line-height: 1.5; margin-bottom: 14px; }
.pr-divider { height: 1px; background: var(--hairline); margin: 12px 0 14px; }

.pr-features { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.pr-features li { display: flex; align-items: flex-start; gap: 7px; font-size: 12.5px; color: var(--ink-800); line-height: 1.4; }
.pr-features li svg { flex-shrink: 0; margin-top: 2px; color: var(--green-600); }
.pr-features li.no { color: var(--ink-400); }
.pr-features li.no svg { color: var(--ink-300); }

.pr-compare-tbl thead th:first-child { text-align: left; }

/* ══════════════════════════════════════════════════════════════════
   CHECKOUT PAGE
   ══════════════════════════════════════════════════════════════════ */
.co-wrap { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; margin-bottom: 64px; }
@media (max-width: 860px) { .co-wrap { grid-template-columns: 1fr; } }

/* Single-column centered checkout (used after we removed the billing-form
   column — order summary is the only card, no left panel, no sticky
   behaviour needed since there's nothing to scroll past). */
/* Checkout page uses full width so the heading anchors flush-left at the
   content-area edge; only the summary card centres via co-summary-centered. */
.page-inner.co-inner { max-width: none; margin: 0; }

.co-wrap-centered { display: block; margin-bottom: 32px; }

/* Compact summary card — everything fits above the fold on a 900px-tall
   viewport. Padding tightened from 22px to 16px, internal spacing pulled
   in, feature list capped at ~4 items via slice(0, 5) in the JSX. */
.co-summary-centered {
  position: static;                /* not sticky in centered layout */
  max-width: 480px;                /* matches .co-cycle-wrap width */
  margin: 0 auto 40px;
  padding: 16px 18px 14px;
}
.co-summary-centered .co-sum-head { margin-bottom: 10px; }
.co-summary-centered .co-sum-plan { margin-bottom: 10px; }
.co-summary-centered .co-sum-feats { margin: 10px 0; }
.co-summary-centered .co-sum-divider { margin: 10px 0; }
.co-summary-centered .co-sum-line { padding: 3px 0; font-size: 13px; }
.co-summary-centered .co-sum-line.total { padding-top: 6px; margin-top: 4px; border-top: 1px solid var(--hairline); font-size: 14px; }

/* Footnote under the totals block ("Prorated..." / "Nothing charged
   today..."). Replaces the previous inline-styled p tag. */
.co-sum-footnote {
  font-size: 11.5px;
  color: var(--ink-500);
  margin: 6px 0 0;
  line-height: 1.4;
}

/* Context banner shown when the user is changing an existing subscription
   (upgrade / downgrade / same-plan). Replaces the inline-style div. */
.co-context-banner {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  font-size: 12px;
  color: var(--ink-700);
  line-height: 1.5;
}

/* CTA button — full-width, tighter top margin so the button hugs the
   context banner instead of floating away. */
.co-cta {
  width: 100%;
  justify-content: center;
  margin-top: 14px;
  height: 40px;
}

/* Seat picker on the Team upgrade path — buttons + number input styled
   for both light and dark modes. Previously the −/+/number stepper had
   no explicit color, so the browser default text colour rendered as
   dark ink on --bg-elevated (dark grey in dark mode) → invisible "2". */
.co-seat-picker { display: inline-flex; align-items: center; gap: 8px; }
.co-seat-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  background: var(--bg-elevated);
  color: var(--ink-1000);
  font-size: 16px; font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color var(--d-fast), background var(--d-fast);
}
.co-seat-btn:hover:not(:disabled) { border-color: var(--green-400); }
.co-seat-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.co-seat-input {
  width: 56px; height: 28px;
  text-align: center;
  font-size: 14px; font-weight: 600;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--ink-1000);
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  box-sizing: border-box;
}
.co-seat-input:focus {
  outline: none;
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-500) 18%, transparent);
}
.co-seat-input::-webkit-outer-spin-button,
.co-seat-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.co-seat-input[type=number] { -moz-appearance: textfield; }

/* Cycle-toggle wrapper — centers the pill with the summary card below at
   the same max-width, so the toggle + card line up as one column
   independent of the left-aligned heading above. */
.co-cycle-wrap {
  max-width: 480px;
  margin: 0 auto 12px;
  display: flex;
  justify-content: center;
}

/* Cycle toggle — segmented pill on --bg-soft so it reads as a filter
   control, not part of the order breakdown. */
.co-cycle-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--hairline);
}
.co-cycle-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; min-height: 32px;
  border-radius: 999px; border: none; cursor: pointer;
  background: transparent; color: var(--ink-500);
  font-weight: 600; font-size: 12.5px;
  transition: all var(--d-fast);
}
.co-cycle-btn.is-active {
  background: var(--bg-elevated); color: var(--ink-1000);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.co-cycle-sav { font-size: 10px; font-weight: 700; color: var(--green-600); }

.co-form { display: flex; flex-direction: column; gap: 0; }
.co-section { border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 22px 24px; margin-bottom: 16px; background: var(--bg-surface); }
.co-sec-title { font-size: 13px; font-weight: 700; color: var(--ink-1000); margin-bottom: 16px; }
.co-opt { font-weight: 500; color: var(--ink-400); font-size: 11.5px; margin-left: 6px; }
.co-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.co-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .co-row2, .co-row3 { grid-template-columns: 1fr; } }

.co-pay-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.co-pay-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; border-radius: var(--r-sm); border: 1.5px solid var(--hairline-strong); background: var(--bg-soft); font-size: 12.5px; font-weight: 600; color: var(--ink-600); cursor: pointer; transition: all var(--d-fast); }
.co-pay-tab:hover { border-color: var(--green-400); color: var(--ink-1000); }
.co-pay-tab.on { border-color: var(--green-500); background: var(--accent-soft); color: var(--green-700); }
.co-pay-tab svg { width: 15px; height: 15px; }

.co-card-fields { display: flex; flex-direction: column; gap: 2px; }
.co-agree { display: flex; align-items: flex-start; gap: 10px; font-size: 12.5px; color: var(--ink-600); line-height: 1.5; margin-top: 4px; cursor: pointer; }
.co-agree input { margin-top: 3px; flex-shrink: 0; width: 14px; height: 14px; accent-color: var(--green-600); cursor: pointer; }

/* Summary card */
.co-summary { position: sticky; top: 80px; border: 1.5px solid var(--hairline-strong); border-radius: var(--r-lg); background: var(--bg-surface); padding: 22px 22px 20px; }
.co-sum-head { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); margin-bottom: 16px; }
.co-sum-plan { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.csp-name { font-size: 15px; font-weight: 700; color: var(--ink-1000); }
.csp-price { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--ink-1000); }
.csp-price span { font-family: var(--font-body); font-size: 12px; color: var(--ink-500); font-weight: 500; }
.co-sum-feats { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.csf-row { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-700); }
.csf-row svg { color: var(--green-600); flex-shrink: 0; }
.co-sum-divider { height: 1px; background: var(--hairline); margin: 14px 0; }
.co-sum-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-700); margin-bottom: 7px; }
.co-sum-line.total { font-weight: 700; color: var(--ink-1000); font-size: 14px; margin-bottom: 0; }
.co-secure { text-align: center; font-size: 11.5px; color: var(--ink-500); margin: 10px 0 4px; }
.co-back-link { display: flex; align-items: center; gap: 4px; justify-content: center; font-size: 12px; color: var(--ink-500); margin-top: 6px; }
.co-back-link:hover { color: var(--ink-1000); }

/* Success state */
.co-success { text-align: center; padding: 80px 24px; max-width: 420px; margin: 0 auto; }
.cos-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--green-500); color: #fff; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.co-success h2 { font-size: 22px; font-weight: 700; margin: 0 0 10px; }
.co-success p { font-size: 14px; color: var(--ink-600); line-height: 1.6; margin: 0; }

/* ══════════════════════════════════════════════════════════════════
   SETTINGS — SUBSCRIPTION PANE
   ══════════════════════════════════════════════════════════════════ */
.sub-plan-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border: 1.5px solid var(--green-200); border-radius: var(--r-lg); background: linear-gradient(135deg, color-mix(in srgb, var(--green-500) 8%, var(--bg-surface)), var(--bg-surface)); margin-bottom: 4px; }
[data-theme="dark"] .sub-plan-hero { border-color: color-mix(in srgb, var(--green-500) 26%, transparent); }
.sph-left { display: flex; flex-direction: column; gap: 4px; }
.sph-badge { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green-700); background: var(--green-50); border: 1px solid var(--green-200); padding: 3px 9px; border-radius: var(--r-pill); align-self: flex-start; margin-bottom: 2px; }
[data-theme="dark"] .sph-badge { color: var(--green-300); background: color-mix(in srgb, var(--green-500) 12%, transparent); border-color: color-mix(in srgb, var(--green-500) 26%, transparent); }
.sph-price { font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink-1000); line-height: 1; }
.sph-price span { font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--ink-500); }
.sph-meta { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.sph-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.sub-credits { border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 16px 18px; background: var(--bg-surface); margin-bottom: 4px; }
.sc-top { display: flex; justify-content: space-between; margin-bottom: 10px; }
.sc-used { font-size: 13.5px; font-weight: 600; color: var(--ink-1000); }
.sc-total { font-size: 12.5px; color: var(--ink-500); }
.sc-bar { height: 8px; background: var(--ink-100); border-radius: var(--r-pill); overflow: hidden; }
.sc-fill { height: 100%; border-radius: var(--r-pill); transition: width 0.4s ease; }
.sc-renew { font-size: 11.5px; color: var(--ink-500); margin-top: 8px; }

.sub-plan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 900px) { .sub-plan-grid { grid-template-columns: repeat(2, 1fr); } .sub-plan-hero { flex-direction: column; align-items: flex-start; } }

.sub-plan-card { position: relative; padding: 16px 15px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); transition: border-color var(--d-fast); }
.sub-plan-card.current { border-color: var(--green-500); background: color-mix(in srgb, var(--green-500) 4%, var(--bg-surface)); }
.spc-cur-tag { position: absolute; top: 10px; right: 10px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--green-700); display: inline-flex; align-items: center; gap: 3px; }
.spc-cur-tag svg { width: 10px; height: 10px; }
[data-theme="dark"] .spc-cur-tag { color: var(--green-300); }
.spc-name { font-size: 13px; font-weight: 700; color: var(--ink-1000); margin-bottom: 4px; }
.spc-price { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--ink-1000); margin-bottom: 6px; }
.spc-price small { font-family: var(--font-body); font-size: 11px; font-weight: 500; color: var(--ink-500); }
.spc-desc { font-size: 11.5px; color: var(--ink-500); line-height: 1.4; }

/* ══════════════════════════════════════════════════════════════════
   SETTINGS · CANON (ADR-0015 + ADR-0012 + ADR-0013)
   Workspace-scoped, grouped left-nav, outlined cards on soft canvas,
   mono-label card headers, no shadows, no nesting. Container rule
   mirrored verbatim from design/canon/settings.html. All classes
   scoped under .settings-canon to avoid colliding with other surfaces.
   ══════════════════════════════════════════════════════════════════ */
.settings-canon { display: grid; grid-template-columns: 286px 1fr; min-height: calc(100vh - 56px); background: var(--bg-canvas); }
.settings-canon .setnav { border-right: 1px solid var(--hairline); padding: 18px 16px 16px; overflow-y: auto; background: var(--bg-surface); display: flex; flex-direction: column; }
.settings-canon .navsp { flex: 1; }
.settings-canon .wsswitch { position: relative; }
.settings-canon .wsbtn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); cursor: pointer; text-align: left; transition: all var(--d-fast); font-family: inherit; }
.settings-canon .wsbtn:hover { border-color: var(--hairline-strong); background: var(--ink-50); }
.settings-canon .wsbtn .bd { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--green-400), var(--green-700)); color: #fff; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.settings-canon .wsbtn .bl { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.settings-canon .wsbtn .bl .k { font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-500); }
.settings-canon .wsbtn .bl .v { font-size: 13.5px; font-weight: 700; color: var(--ink-1000); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-canon .wsbtn .cv { margin-left: auto; color: var(--ink-500); width: 16px; height: 16px; flex-shrink: 0; }
.settings-canon .wsmenu { display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--bg-surface); border: 1px solid var(--hairline-strong); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; }
.settings-canon .wsmenu.on { display: block; }
.settings-canon .wsmenu .mh { font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-500); padding: 6px 8px 4px; }
.settings-canon .wsmenu .mi { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: var(--r-sm); cursor: pointer; }
.settings-canon .wsmenu .mi:hover { background: var(--hover-surface); }
.settings-canon .wsmenu .mi .bd { width: 24px; height: 24px; border-radius: 6px; font-size: 11px; background: linear-gradient(135deg, var(--green-400), var(--green-700)); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.settings-canon .wsmenu .mi .nm { font-size: 13px; font-weight: 600; color: var(--ink-1000); display: block; }
.settings-canon .wsmenu .mi .ds { font-size: 10.5px; color: var(--ink-500); display: block; }
.settings-canon .wsmenu .mi.on { background: var(--accent-soft); }
.settings-canon .wsmenu .add-ws { display: flex; align-items: center; gap: 8px; padding: 8px; border-top: 1px solid var(--hairline); margin-top: 4px; color: var(--green-700); font-size: 12.5px; font-weight: 600; cursor: pointer; background: transparent; border-left: none; border-right: none; border-bottom: none; width: 100%; font-family: inherit; }
.settings-canon .wsmenu .add-ws svg { width: 15px; height: 15px; }
.settings-canon .wscredits { display: flex; align-items: center; gap: 8px; margin: 11px 2px 18px; padding: 9px 12px; border-radius: var(--r-pill); background: var(--green-50); border: 1px solid var(--green-200); font-size: 12.5px; font-weight: 600; color: var(--green-800); }
.settings-canon .wscredits .coin { color: var(--green-600); }
.settings-canon .wscredits .muted { color: var(--green-700); opacity: .8; font-weight: 500; }
.settings-canon .wscredits .add { margin-left: auto; color: var(--green-700); cursor: pointer; font-weight: 700; background: none; border: none; padding: 0; font-family: inherit; text-decoration: none; }
[data-theme="dark"] .settings-canon .wscredits { background: color-mix(in srgb, var(--green-500) 14%, var(--bg-surface)); border-color: color-mix(in srgb, var(--green-500) 30%, transparent); color: var(--green-300); }
.settings-canon .navgroup { margin-bottom: 14px; }
.settings-canon .navgroup .nl { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-400); padding: 6px 10px; }
.settings-canon .navitem { display: flex; align-items: center; gap: 11px; width: 100%; padding: 0 11px; height: 38px; border-radius: var(--r-md); border: none; background: transparent; cursor: pointer; color: var(--ink-700); font-size: 13.5px; font-weight: 600; text-align: left; font-family: inherit; text-decoration: none; }
.settings-canon .navitem:hover { background: var(--hover-surface); color: var(--ink-1000); }
.settings-canon .navitem.on { background: color-mix(in srgb, var(--green-500) 14%, var(--bg-surface)); color: var(--green-700); }
[data-theme="dark"] .settings-canon .navitem.on { color: var(--green-300); }
.settings-canon .navitem svg { width: 18px; height: 18px; flex-shrink: 0; }
.settings-canon .navitem .sb { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--ink-500); background: var(--ink-100); border-radius: var(--r-pill); padding: 1px 7px; }
.settings-canon .navfoot { border-top: 1px solid var(--hairline); padding-top: 10px; margin-top: 10px; }
.settings-canon .setpane { overflow-y: auto; background: var(--bg-soft); }
.settings-canon .pane { max-width: 680px; margin: 0 auto; padding: 40px 34px 64px; }
.settings-canon .pane-h { margin-bottom: 6px; display: flex; align-items: flex-start; gap: 14px; }
.settings-canon .pane-h .ph-l { flex: 1; }
.settings-canon .pane-h h2 { font-family: var(--font-display); font-size: 23px; font-weight: 800; letter-spacing: -.02em; color: var(--ink-1000); margin: 0; }
.settings-canon .pane-h .sub { font-size: 13px; color: var(--ink-600); margin-top: 6px; line-height: 1.5; }
.settings-canon .backlink { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-600); background: none; border: none; cursor: pointer; margin-bottom: 10px; padding: 0; font-family: inherit; }
.settings-canon .backlink:hover { color: var(--ink-1000); }
.settings-canon .backlink svg { width: 14px; height: 14px; }
.settings-canon .card { background: var(--bg-surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); margin-top: 16px; box-shadow: none; padding: 0; }
.settings-canon .card-h { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--hairline); font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-500); }
.settings-canon .card-h .r { margin-left: auto; font-family: var(--font-body); text-transform: none; letter-spacing: 0; display: flex; align-items: center; gap: 9px; font-weight: 600; }
.settings-canon .card-b { padding: 2px 20px; }
.settings-canon .card-b.pad { padding: 18px 20px; }
.settings-canon .cards2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.settings-canon .cards2 .card { margin-top: 0; }
.settings-canon .frow { display: flex; align-items: center; gap: 18px; padding: 15px 0; border-bottom: 1px solid var(--hairline); }
.settings-canon .frow:last-child { border-bottom: none; }
/* Reset all the typography leaking from the unscoped legacy `.fl`
   field-label rule earlier in this file (uppercase mono caps). Canon
   .frow .fl is just a layout container — its children .t and .h carry
   their own typography. */
.settings-canon .frow .fl { min-width: 0; flex: 1; font-size: inherit; font-weight: inherit; letter-spacing: normal; text-transform: none; color: inherit; margin: 0; }
.settings-canon .frow .fl .t { font-size: 13.5px; font-weight: 600; color: var(--ink-1000); }
.settings-canon .frow .fl .h { font-size: 12px; color: var(--ink-500); margin-top: 3px; line-height: 1.45; }
.settings-canon .frow .fc { flex-shrink: 0; display: flex; align-items: center; gap: 9px; }
.settings-canon .frow.col { flex-direction: column; align-items: stretch; gap: 10px; }
.settings-canon .frow.lnkrow { cursor: pointer; }
.settings-canon .frow.lnkrow:hover .t { color: var(--green-700); }
.settings-canon .frow.lnkrow .chev { color: var(--ink-400); width: 17px; height: 17px; }
.settings-canon .inp { height: 40px; padding: 0 13px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); font-size: 13.5px; color: var(--ink-1000); outline: none; min-width: 230px; transition: all var(--d-fast); font-family: inherit; }
.settings-canon .inp:focus { border-color: var(--green-500); box-shadow: var(--focus-ring); }
.settings-canon .inp::placeholder { color: var(--ink-400); }
.settings-canon .inp.ro { background: var(--ink-50); color: var(--ink-600); }
.settings-canon .inp.wide { width: 100%; min-width: 0; }
.settings-canon textarea.inp { height: auto; padding: 11px 13px; resize: vertical; }
.settings-canon .sw { position: relative; width: 42px; height: 24px; border-radius: var(--r-pill); background: var(--ink-100); border: 1px solid var(--hairline-strong); cursor: pointer; transition: all var(--d-fast); flex-shrink: 0; padding: 0; display: inline-block; }
.settings-canon .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: all var(--d-fast); }
.settings-canon .sw.on { background: var(--green-500); border-color: var(--green-500); }
.settings-canon .sw.on::after { left: 20px; }
.settings-canon .tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: var(--r-pill); }
.settings-canon .tag.ok { color: var(--green-700); background: var(--green-50); border: 1px solid var(--green-200); }
.settings-canon .tag.muted { color: var(--ink-600); background: var(--ink-100); }
.settings-canon .lnk { color: var(--green-700); font-weight: 600; cursor: pointer; font-size: 12.5px; background: none; border: none; padding: 0; font-family: inherit; text-decoration: none; }
.settings-canon .mrow { display: grid; grid-template-columns: minmax(0, 1fr) 118px 96px; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--hairline); }
.settings-canon .mrow:last-child { border-bottom: none; }
.settings-canon .mrow .cell { position: relative; min-width: 0; }
.settings-canon .mrow .cell.end { text-align: right; }
.settings-canon .who { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.settings-canon .who .av { width: 28px; height: 28px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.settings-canon .who .av img { width: 100%; height: 100%; object-fit: cover; }
.settings-canon .who .nm { font-weight: 600; color: var(--ink-1000); font-size: 13px; }
.settings-canon .who .em { font-size: 11px; color: var(--ink-500); }
.settings-canon .rolebtn { display: flex; align-items: center; justify-content: space-between; width: 100%; font-size: 11.5px; font-weight: 600; padding: 5px 10px; border-radius: var(--r-pill); color: var(--ink-700); background: var(--ink-100); border: none; cursor: pointer; font-family: inherit; }
.settings-canon .rolebtn:hover { background: var(--hover-surface); color: var(--ink-1000); }
.settings-canon .rolebtn svg { width: 12px; height: 12px; color: var(--ink-500); flex-shrink: 0; }
.settings-canon .rolebtn.static { cursor: default; }
.settings-canon .rolebtn.static:hover { background: var(--ink-100); color: var(--ink-700); }
.settings-canon .rolebtn.static svg { visibility: hidden; }
.settings-canon .canon-dots { background: none; border: none; cursor: pointer; color: var(--ink-400); display: inline-flex; padding: 4px; border-radius: var(--r-sm); }
.settings-canon .canon-dots:hover { background: var(--hover-surface); color: var(--ink-1000); }
.settings-canon .canon-dots svg { width: 16px; height: 16px; }
.settings-canon .subhead { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-400); padding: 14px 0 4px; border-bottom: 1px solid var(--hairline); }
.settings-canon .pn-canon { font-family: var(--font-display); font-size: 17px; font-weight: 800; color: var(--ink-1000); display: flex; align-items: center; gap: 9px; }
.settings-canon .pp { font-size: 12.5px; color: var(--ink-600); margin-top: 5px; }
.settings-canon .pp b { color: var(--ink-900); }
.settings-canon .usemeter { margin-top: 14px; }
.settings-canon .usemeter .ut { display: flex; font-size: 11.5px; color: var(--ink-600); margin-bottom: 6px; }
.settings-canon .usemeter .ut b { margin-left: auto; color: var(--ink-1000); }
.settings-canon .usemeter .bar { height: 6px; border-radius: 4px; background: var(--ink-100); overflow: hidden; }
.settings-canon .usemeter .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green-500), var(--green-600)); border-radius: 4px; }
.settings-canon .balnum { font-family: var(--font-display); font-weight: 800; font-size: 24px; color: var(--ink-1000); }
.settings-canon .balsub { font-size: 11.5px; color: var(--ink-500); margin-top: 4px; }
.settings-canon .lowwarn { display: flex; align-items: center; gap: 10px; margin-top: 13px; padding: 11px 13px; border-radius: var(--r-md); background: color-mix(in srgb, var(--danger) 7%, var(--bg-surface)); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); font-size: 12px; color: color-mix(in srgb, var(--danger) 70%, var(--ink-1000)); }
.settings-canon .lowwarn svg { width: 15px; height: 15px; flex-shrink: 0; }
.settings-canon .intg { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--hairline); }
.settings-canon .intg:last-child { border-bottom: none; }
.settings-canon .ilogo { width: 38px; height: 38px; border-radius: 9px; background: var(--ink-50); border: 1px solid var(--hairline); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.settings-canon .ilogo svg { width: 21px; height: 21px; }
.settings-canon .intg .it { flex: 1; min-width: 0; }
.settings-canon .intg .n { font-size: 13.5px; font-weight: 600; color: var(--ink-1000); }
.settings-canon .intg .d { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
/* Brand-context chips — canon spec uses smaller, softer chips than the
   generic `.chip` rule earlier in this file (which targets idea/format
   pickers with larger padding). Scoped so the two patterns don't collide. */
.settings-canon .chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.settings-canon .chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; min-height: 28px; line-height: 1; border-radius: var(--r-pill); background: var(--ink-50); border: 1px solid var(--hairline-strong); font-size: 12px; font-weight: 600; color: var(--ink-700); cursor: default; transition: none; box-shadow: none; }
.settings-canon .chip .x { cursor: pointer; color: var(--ink-500); display: inline-flex; align-items: center; justify-content: center; background: none; border: none; padding: 0; margin: 0; width: 14px; height: 14px; line-height: 1; box-shadow: none; }
.settings-canon .chip .x:hover { color: var(--ink-1000); }
.settings-canon .chip .x svg { width: 12px; height: 12px; display: block; }
.settings-canon .chip.add { background: transparent; border: 1px dashed var(--hairline-strong); color: var(--ink-600); cursor: text; padding: 5px 11px; }
.settings-canon .chip.add:hover { color: var(--ink-1000); border-color: var(--ink-1000); }
.settings-canon .chip.add svg { width: 13px; height: 13px; flex-shrink: 0; }
.settings-canon .chip.add input { border: none; background: transparent; outline: none; font: inherit; color: inherit; padding: 0; margin: 0; min-width: 0; width: 72px; }
.settings-canon .chip.add input::placeholder { color: var(--ink-500); font-weight: 600; }
.settings-canon .quiet-foot { margin-top: 54px; padding-top: 14px; border-top: 1px solid var(--hairline); font-size: 12px; color: var(--ink-400); display: flex; gap: 18px; }
.settings-canon .quiet-foot button { background: none; border: none; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.settings-canon .quiet-foot button:hover { color: var(--ink-700); text-decoration: underline; }
.settings-canon .note { font-size: 12px; color: var(--ink-500); margin-top: 14px; line-height: 1.5; display: flex; gap: 8px; align-items: flex-start; }
.settings-canon .note svg { width: 15px; height: 15px; color: var(--ink-400); flex-shrink: 0; margin-top: 1px; }
@media (max-width: 860px) {
  .settings-canon { grid-template-columns: 1fr; }
  .settings-canon .setnav { border-right: none; border-bottom: 1px solid var(--hairline); }
  .settings-canon .cards2 { grid-template-columns: 1fr; }
}

/* ── Settings page shell — replaces the global Shell on /settings.
 * Canon (design/canon/settings.html) shows: minimal topbar (HEXCODED wordmark
 * + "/ Settings" crumb + Light/Dark switcher) + the .settings-canon two-col
 * grid below. No global app rail, no brand-picker pill, no credits pill in
 * the topbar — credits live in the nav .wscredits row instead. */
.settings-shell { display: flex; flex-direction: column; height: 100vh; background: var(--bg-canvas); }
/* Override the later .topbar rules (sticky + 14px 28px padding) for the
   settings shell. Canon spec: fixed 56px height, 22px padding, sits at the
   top of the flex column with flex-shrink: 0 so the .settings-canon below
   absorbs the rest. */
.settings-shell .topbar {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  border-bottom: 1px solid var(--hairline);
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  position: relative;
  top: auto;
  z-index: 20;
}
.settings-shell .topbar .wm { font-size: 16px; color: var(--ink-1000); }
.settings-shell .topbar .crumb { font-size: 13.5px; font-weight: 600; color: var(--ink-600); display: flex; align-items: center; gap: 9px; }
.settings-shell .topbar .crumb .sl { color: var(--ink-400); }
.settings-shell .topbar .spacer { flex: 1; }
.settings-shell .topbar .theme-switcher button { display: inline-flex; align-items: center; gap: 5px; }
.settings-shell .settings-canon { flex: 1; min-height: 0; }
/* === end settings canon === */

/* === Actors Library — synced from design/canon/actors-library.html ===
   Additive only. Mirrors the canon DOM verbatim and is the source of
   styling for /app/actors/page.jsx. Token aliases (--green-*, --ink-*,
   --bg-*, --r-*, --d-*, --media-well, --sel-bg, --accent-soft/border,
   --hairline*) resolve against the existing :root layer above.

   Overlay classes are prefixed `.actors-` to avoid collision with the
   pre-existing `.sheet` rules earlier in this file (which model a
   different sheet shape used by other pages). */

/* Page-scoped scroll layout — only .gridcol scrolls. */
.appscroll { flex: 1; overflow: hidden; min-height: 0; }
.pageinner { max-width: 1200px; margin: 0 auto; padding: 26px 30px 0; height: 100%; display: flex; flex-direction: column; min-height: 0; }
.gridcol { overflow-y: auto; min-height: 0; padding-bottom: 34px; }

.pagehead { display: flex; align-items: flex-start; gap: 16px; }
.pagehead .ph-t { font-family: var(--font-display); font-size: 27px; font-weight: 800; letter-spacing: -.03em; color: var(--ink-1000); margin: 0; }
.pagehead .ph-s { font-size: 13.5px; color: var(--ink-600); margin: 7px 0 0; line-height: 1.55; max-width: 64ch; }
.pagehead .ph-actions { margin-left: auto; flex-shrink: 0; }

.controls { display: flex; align-items: center; gap: 13px; margin: 20px 0 16px; }
.searchbox { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 13px; border: 1px solid var(--hairline-strong); border-radius: var(--r-pill); background: var(--bg-surface); width: 280px; }
.searchbox svg { width: 15px; height: 15px; color: var(--ink-400); flex-shrink: 0; }
.searchbox input { flex: 1; border: none; background: transparent; outline: none; font-size: 13px; font-family: inherit; color: var(--ink-900); min-width: 0; }
.searchbox input::placeholder { color: var(--ink-400); }

.count { font-size: 12.5px; color: var(--ink-500); }
.count b { color: var(--ink-800); font-weight: 600; }

.sortwrap { position: relative; }
.sortbtn { display: inline-flex; align-items: center; gap: 6px; height: 40px; font-size: 12.5px; font-weight: 600; color: var(--ink-700); border: 1px solid var(--hairline-strong); border-radius: var(--r-pill); padding: 0 14px; background: var(--bg-surface); cursor: pointer; }
.sortbtn svg { width: 14px; height: 14px; color: var(--ink-400); }
.sortmenu { position: absolute; right: 0; top: 46px; min-width: 184px; background: var(--bg-surface); border: 1px solid var(--hairline-strong); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 5px; z-index: 30; display: none; }
.sortmenu.on { display: block; }
.sortmenu button { display: flex; width: 100%; padding: 9px 11px; border: none; background: none; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 600; color: var(--ink-700); text-align: left; cursor: pointer; }
.sortmenu button:hover { background: var(--hover-surface); color: var(--ink-1000); }

.trust { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-600); line-height: 1.45; }
.trust svg { width: 14px; height: 14px; color: var(--green-600); flex-shrink: 0; }
.trust b { color: var(--ink-800); font-weight: 600; }

.split { display: grid; grid-template-columns: 194px 1fr; gap: 26px; align-items: stretch; flex: 1; min-height: 0; }

.filtcol { overflow-y: auto; min-height: 0; padding-bottom: 18px; }
.fhead { display: flex; align-items: center; margin-bottom: 15px; }
.fhead .fttl { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-500); }
.fhead .clr { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--green-700); background: none; border: none; cursor: pointer; }
.fgroup { margin-bottom: 18px; }
.fl { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-400); margin-bottom: 9px; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { font-size: 11.5px; font-weight: 500; color: var(--ink-700); border: 1px solid var(--hairline-strong); background: var(--bg-surface); border-radius: var(--r-pill); padding: 6px 12px; cursor: pointer; }
.fchip:hover { border-color: var(--green-400); }
.fchip.on { border-color: var(--green-500); background: var(--sel-bg, var(--accent-soft)); color: var(--green-700); font-weight: 600; }

.grid5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 1240px) { .grid5 { grid-template-columns: repeat(4, 1fr); } }

/* Actor card — outlined, ♥-only per ADR-0031. */
.acard { position: relative; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); overflow: hidden; padding: 0; text-align: left; transition: border-color var(--d-fast), box-shadow var(--d-fast), transform var(--d-fast); display: block; min-width: 0; }
.acard:hover { border-color: var(--green-400); }
.acard.clickable { cursor: pointer; }
.acard .face { position: relative; aspect-ratio: 3/4; background: var(--media-well, #0a0a0c); overflow: hidden; display: block; }
.acard .face img { width: 100%; height: 100%; object-fit: cover; }
.acard .own { display: none; }

.fav { position: absolute; top: 9px; right: 9px; z-index: 3; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.42); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--d-fast), transform var(--d-fast); border: none; cursor: pointer; }
.acard:hover .fav { opacity: 1; }
.fav:hover { transform: scale(1.08); }
.fav svg { color: #fff; }
.fav.on { opacity: 1; background: rgba(0,0,0,.58); }

.cardplay { position: absolute; top: 9px; left: 9px; z-index: 3; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.42); backdrop-filter: blur(4px); color: #fff; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--d-fast); }
.acard:hover .cardplay { opacity: 1; }

.cardview { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 3; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; border-radius: var(--r-pill); background: rgba(0,0,0,.62); backdrop-filter: blur(6px); color: #fff; font-size: 11px; font-weight: 700; opacity: 0; transform: translateY(5px); transition: opacity var(--d-fast), transform var(--d-fast); }
.acard:hover .cardview { opacity: 1; transform: none; }

.aname { display: flex; align-items: center; gap: 6px; padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--ink-1000); min-width: 0; }
.aname .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aname .badge { margin-left: auto; flex-shrink: 0; }

.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 9px; font-weight: 700; border-radius: var(--r-pill); padding: 2px 7px; white-space: nowrap; }
.badge svg { width: 9px; height: 9px; }
.badge.ai    { background: var(--ink-100); color: var(--ink-600); }
.badge.gen   { background: var(--ink-100); color: var(--ink-600); }
.badge.clone { background: var(--ink-100); color: var(--ink-600); }
.badge.human { background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-200); }

/* Actors overlay system — prefixed to avoid `.sheet` / `.scrim` collisions. */
.actors-scrim { position: fixed; inset: 0; z-index: 100; background: color-mix(in srgb, var(--ink-1000) 45%, transparent); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; padding: 24px; }
.actors-scrim.on { display: flex; }
.actors-sheet { width: 760px; max-width: 100%; max-height: 90vh; overflow: auto; background: var(--bg-surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--shadow-xl); animation: actors-rise var(--d-base) var(--ease-out); position: relative; }
@keyframes actors-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.sheet-x { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--hairline-strong); background: var(--bg-surface); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-600); z-index: 3; cursor: pointer; }

/* Create chooser sheet (three flows: Generate · Upload · Clone). */
.create-sheet { width: 560px; padding: 30px 30px 26px; }
.create-sheet h3 { font-family: var(--font-display); font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin: 0; color: var(--ink-1000); }
.create-sheet .csub { font-size: 13px; color: var(--ink-600); margin: 8px 0 22px; line-height: 1.5; }
.cgroup-label { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-400); margin: 18px 0 9px; display: flex; align-items: center; gap: 7px; }
.cgroup-label:first-of-type { margin-top: 2px; }
.cgroup-label .gx { color: var(--green-700); }
.cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mcard { display: flex; flex-direction: column; gap: 9px; padding: 15px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); text-align: left; transition: all var(--d-fast); text-decoration: none; color: inherit; cursor: pointer; font: inherit; }
.mcard:hover { border-color: var(--green-400); box-shadow: var(--shadow-sm); }
.mcard .mi { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--green-600); display: flex; align-items: center; justify-content: center; }
.mcard .mn { font-size: 13.5px; font-weight: 700; color: var(--ink-1000); }
.mcard .md { font-size: 11.5px; color: var(--ink-500); line-height: 1.45; }
.mcard.wide { flex-direction: row; align-items: center; gap: 14px; }
.mcard.wide .ctxt2 { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mcard.wide .car { margin-left: auto; color: var(--ink-400); flex-shrink: 0; }

/* Creator profile modal — only Verified actors open this shape. */
.cmodal-sheet { width: 740px; max-width: 100%; max-height: 90vh; overflow: auto; background: var(--bg-surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--shadow-xl); position: relative; animation: actors-rise var(--d-base) var(--ease-out); }
.cprofile { display: grid; grid-template-columns: 300px 1fr; align-items: stretch; }
@media (max-width: 640px) { .cprofile { grid-template-columns: 1fr; } }
.cp2-media { position: relative; background: var(--media-well, #0a0a0c); min-height: 300px; }
.cp2-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cp2-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.cp2-play .pp { width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); color: var(--ink-1000); }
.cp2-info { padding: 26px 28px 28px; min-width: 0; }
.cp2-name { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--ink-1000); display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.cp2-verif { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--green-700); background: var(--green-50); border: 1px solid var(--green-200); border-radius: var(--r-pill); padding: 3px 9px; }
.cp2-lic { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-500); margin-top: 9px; }
.cp2-lic svg { color: var(--green-600); }
.cp2-bio { font-size: 13px; color: var(--ink-700); line-height: 1.6; margin: 15px 0 0; max-width: 52ch; }
.cp2-stats { display: flex; gap: 24px; margin-top: 16px; }
.cp2-stats .v { font-family: var(--font-display); font-size: 17px; font-weight: 800; color: var(--ink-1000); }
.cp2-stats .k { font-size: 11px; color: var(--ink-500); }
.cp2-sec { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-400); margin: 22px 0 10px; }
.cp2-social { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); margin-bottom: 8px; text-decoration: none; color: var(--ink-900); max-width: 380px; }
.cp2-social:hover { border-color: var(--green-400); }
.cp2-social .si { width: 34px; height: 34px; border-radius: 9px; background: var(--ink-100); color: var(--ink-700); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cp2-social .sh { font-size: 13px; font-weight: 600; display: block; }
.cp2-social .sm { font-size: 11px; color: var(--ink-500); }
.cp2-social .sv { margin-left: auto; color: var(--green-600); display: inline-flex; }
.cp2-fav { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px; margin-top: 24px; border-radius: var(--r-pill); border: 1px solid var(--hairline-strong); background: var(--bg-surface); font-size: 13.5px; font-weight: 600; color: var(--ink-800); cursor: pointer; }
.cp2-fav.on { color: var(--green-700); border-color: var(--green-400); background: var(--accent-soft); }
.cp2-fav.on svg { fill: var(--green-600); }
.cp2-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--hairline-strong); background: color-mix(in srgb, var(--bg-surface) 82%, transparent); backdrop-filter: blur(6px); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-700); z-index: 4; cursor: pointer; }
/* === end actors library === */

/* === HexCoded Canon DS v1.0 — synced 2026-06-14 (additive overlay) === */
/* ADR-0007: scope canon styles to .hexwm so they cannot leak into legacy chrome.
   isolation:isolate creates a new stacking context; z-index:0 anchors it. */
.hexwm { isolation: isolate; z-index: 0; }

/* ════════════════════════════════════════════════════════════════
   CANON HOME — additive overlay synced from design/canon/home.html
   Marker: CANON_HOME_OVERLAY_V1 — do not delete existing rules.
   ════════════════════════════════════════════════════════════════ */

/* Canon variant of choose-grid: 4-up launcher (was 3-up legacy). */
.choose-grid.is-canon { grid-template-columns: repeat(4, 1fr); gap: 13px; max-width: none; }
.choose-grid.is-canon .choose-tile { padding: 19px 17px 16px; }
.choose-grid.is-canon .choose-tile .ti { width: 42px; height: 42px; margin-bottom: 13px; }
.choose-grid.is-canon .choose-tile .ti svg { width: 20px; height: 20px; }
.choose-grid.is-canon .choose-tile .tn { font-size: 16px; }
.choose-grid.is-canon .choose-tile .tx { font-size: 11.5px; }

/* "Fastest" pill — top-right on the From a link tile. */
.choose-tile .fastest {
  position: absolute; right: 13px; top: 15px;
  font-family: var(--font-mono);
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--green-700);
  background: var(--green-100);
  border-radius: var(--r-pill);
  padding: 3px 8px;
}
[data-theme="dark"] .choose-tile .fastest { color: var(--green-300); }

/* "Describe a custom video →" line below the launcher grid. */
.custom-line { margin-top: 18px; font-size: 13px; color: var(--ink-600); }
.custom-line a {
  color: var(--green-600); font-weight: 600; text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
[data-theme="dark"] .custom-line a { color: var(--green-300); }
.custom-line a svg { width: 13px; height: 13px; }

/* "Start with a template" strip — always-on (ADR-0029). */
.below { margin-top: 40px; }
/* Auto-sliding marquee — mirrors landing's "Real or AI. Always your
   product." strip. `.tpl-track` holds the CANON_TEMPLATES list DOUBLED;
   translating from 0 → -50% loops seamlessly because the second half is
   identical to the first. Fade masks on both edges hide the wrap seam. */
.tpl-marquee {
  overflow: hidden;
  position: relative;
  margin-top: 8px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.tpl-track {
  display: flex;
  gap: 12px;
  width: max-content;
  animation: tpl-marq 48s linear infinite;
  padding: 4px 0 12px;
}
.tpl-marquee:hover .tpl-track { animation-play-state: paused; }
.tpl-track > .tpl { flex: 0 0 160px; }
@keyframes tpl-marq {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .tpl-track { animation: none; }
}
.tpl {
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-surface);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: transform var(--d-base), box-shadow var(--d-base), border-color var(--d-base);
  text-decoration: none;
  color: inherit;
  display: block;
}
.tpl:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--green-400); }
.tpl .tthumb { position: relative; aspect-ratio: 9 / 13; background: var(--media-well, #0a0a0c); }
.tpl .tthumb .grade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.55)); }
.tpl .tthumb .tcap {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800; font-size: 13px; line-height: 1.2; letter-spacing: -0.01em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}
.tpl .tthumb .use {
  position: absolute; left: 50%; top: 42%;
  transform: translate(-50%, -50%) scale(0.92);
  opacity: 0;
  transition: opacity var(--d-fast), transform var(--d-fast);
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; color: var(--ink-1000);
  background: rgba(255, 255, 255, 0.94);
  border-radius: var(--r-pill);
  padding: 7px 14px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.tpl:hover .use { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.tpl .tfoot { padding: 9px 12px 11px; font-size: 11px; color: var(--ink-500); }
.tg-a { background: linear-gradient(160deg, #13321f, #0a0a0c 75%); }
.tg-b { background: linear-gradient(160deg, #1a1410, #0a0a0c); }
.tg-c { background: linear-gradient(160deg, #101a2e, #0a0a0c); }
.tg-d { background: linear-gradient(160deg, #2e1018, #0a0a0c); }
.tg-e { background: linear-gradient(160deg, #231030, #0a0a0c); }

@media (max-width: 1080px) {
  .choose-grid.is-canon { grid-template-columns: repeat(2, 1fr); }
  .tplrow { grid-template-columns: repeat(3, 1fr); }
}
/* === end CANON_HOME_OVERLAY_V1 === */

/* ════ AUTH (Clerk-style centered card) — canon onboarding.html lines 65-96 ════ */
.authwrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  background:
    radial-gradient(120% 90% at 50% -10%, color-mix(in srgb, var(--green-500) 9%, transparent) 0%, transparent 52%),
    var(--bg-canvas);
}
.authwrap.hidden { display: none; }

.brandmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  margin-bottom: 22px;
  /* ADR-0007: ensure .hexwm wordmark stacking context is isolated within brandmark */
  isolation: isolate;
}
.brandmark .logo {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-green-soft);
}
.brandmark .logo svg { width: 24px; height: 24px; }
.brandmark .wm { font-size: 25px; }

/* .authcard is now a transparent centering wrapper — Clerk's own card
   chrome (themed via clerkAppearance) is the single visible card surface.
   Previously .authcard ALSO painted bg+border+shadow, which created a
   nested card-in-a-card visual when Clerk's <SignIn /> rendered inside. */
.authcard {
  width: 404px;
  max-width: 100%;
  background: transparent;
  border: none;
  border-radius: var(--r-lg);
  box-shadow: none;
  padding: 0;
  animation: authrise var(--d-base) var(--ease-out);
}
.authcard-wide {
  width: 520px;
  max-width: 100%;
  background: transparent;
  border: none;
  border-radius: var(--r-lg);
  box-shadow: none;
  padding: 0;
  animation: authrise var(--d-base) var(--ease-out);
}
@keyframes authrise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.secured {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
  font-size: 10px;
  color: var(--ink-400);
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.secured svg { width: 12px; height: 12px; }

/* Manual sign-up ↔ sign-in switch link (rendered by sign-in / sign-up
   page.jsx underneath the Clerk card). Exists because Clerk's built-in
   `footerAction` element does not render when the Clerk backend has
   Restrictions active — we render our own so new-user discovery works
   regardless. Sits inside .authcard so it inherits the same width. */
.auth-switch {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-600);
}
.auth-switch__link {
  color: var(--green-600);
  font-weight: 600;
  text-decoration: none;
}
.auth-switch__link:hover,
.auth-switch__link:focus { text-decoration: underline; }
/* === end HexCoded Canon DS v1.0 overlay === */

/* === URL → Ad canon wizard (ADR-0033) === */
.canon-wiz-overlay{
  position:fixed; inset:0; z-index:1000;
  /* Canon .popup-scrim — tinted + glassmorphism blur on the page behind. */
  background:rgba(0,0,0,.45) !important;
  backdrop-filter: blur(8px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(8px) saturate(120%) !important;
  display:flex; align-items:center; justify-content:center;
  overflow:auto;
  padding:24px;
}
.canon-wiz-panel{
  width:min(1180px,94vw);
  margin:auto;
  background:var(--bg-surface,#fff);
  border:1px solid var(--hairline, rgba(0,0,0,.08));
  border-radius:18px;
  box-shadow:0 30px 80px rgba(0,0,0,.10);
  padding:20px 22px;
  display:flex; flex-direction:column; gap:14px;
}
.canon-wiz-h{
  font-family:var(--font-display);
  font-size:22px; font-weight:800; margin:0 0 6px;
  color:var(--ink-1000);
}
.canon-wiz-foot{
  display:flex; align-items:center; gap:10px;
  padding-top:14px; margin-top:auto;
  border-top:1px solid var(--hairline, rgba(0,0,0,.08));
}
.canon-wiz-foot .spacer{ flex:1; }

/* ST-A footer indicator */
.wiz-step-mini{
  display:inline-flex; align-items:center; gap:10px;
  font-size:11.5px; color:var(--ink-500);
}
.wiz-step-mini .wiz-step-dots{ display:inline-flex; gap:5px; }
.wiz-step-mini .wiz-step-dots i{
  width:6px; height:6px; border-radius:50%;
  background:var(--ink-300, #d0d4dc);
  display:inline-block; transition:all .25s;
}
.wiz-step-mini .wiz-step-dots i.on{
  background:var(--green-500, #22c55e);
  width:17px; border-radius:3px;
}
.wiz-step-mini b{ color:var(--ink-700); font-weight:600; }

/* Auto-set green banner */
.wz-auto{
  display:flex; align-items:center; gap:8px;
  font-size:12px; color:var(--green-700, #15803d);
  background:var(--green-50, #f0fdf4);
  border:1px solid var(--green-200, #bbf7d0);
  border-radius:10px; padding:9px 13px; margin-bottom:6px;
}

/* RX-1 (locked) */
.rx-cols{
  display:grid; grid-template-columns:minmax(0,0.92fr) minmax(0,1.08fr);
  min-height:520px; border:1px solid var(--hairline);
  border-radius:14px; overflow:hidden;
}
@media(max-width:820px){ .rx-cols{ grid-template-columns:1fr; } }
.rx-lft{ padding:18px 30px; display:flex; flex-direction:column; justify-content:center; }
.rx-mk{
  width:50px; height:50px; border-radius:14px;
  background:linear-gradient(135deg,var(--green-400,#4ade80),var(--green-600,#16a34a));
  display:flex; align-items:center; justify-content:center;
  color:#fff; margin-bottom:14px;
}
.rx-big{
  font-family:var(--font-display); font-size:30px; font-weight:800;
  letter-spacing:-.03em; line-height:1.05; color:var(--ink-1000); margin:0;
}
.rx-lead{
  font-size:13.5px; color:var(--ink-600);
  margin:12px 0 0; line-height:1.55; max-width:380px;
}
.rx-fmts{ display:flex; gap:7px; margin-top:12px; flex-wrap:wrap; }
.rx-fmts span{
  font-size:10.5px; font-weight:700; font-family:var(--font-mono);
  letter-spacing:.03em; color:var(--ink-600);
  background:var(--ink-100,#f1f3f6); padding:4px 9px; border-radius:99px;
}
.rx-field{
  display:flex; align-items:center; gap:10px;
  height:54px; padding:0 6px 0 14px;
  border:1.5px solid var(--hairline-strong, rgba(0,0,0,.18));
  border-radius:13px; background:var(--bg-surface,#fff);
  margin-top:18px; transition:border-color .15s, box-shadow .15s;
}
.rx-field:focus-within{
  border-color:var(--green-500,#22c55e);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--green-500) 12%,transparent);
}
.rx-field>svg{ color:var(--ink-400); flex-shrink:0; }
.rx-field input{
  flex:1; border:none; background:transparent; outline:none;
  font-size:15px; font-family:inherit; color:var(--ink-1000); min-width:0;
}
.rx-field input::placeholder{ color:var(--ink-400); }
.rx-go{
  width:40px; height:40px; border-radius:10px; border:none;
  background:var(--ink-100); color:var(--ink-500);
  display:inline-flex; align-items:center; justify-content:center;
  cursor:pointer; flex-shrink:0; transition:all .15s;
}
.rx-field:focus-within .rx-go{
  background:linear-gradient(135deg,var(--green-500,#22c55e),var(--green-600,#16a34a));
  color:#fff;
}
.rx-orpick{ display:flex; align-items:center; margin-top:16px; font-size:12px; }
.rx-orpick .l{ font-weight:600; color:var(--ink-600); }
.rx-orpick .all{
  margin-left:auto; color:var(--ink-400); font-weight:600;
  display:inline-flex; align-items:center; gap:3px; cursor:pointer;
}
.rx-thumbs{ display:grid; grid-template-columns:repeat(4,1fr); gap:9px; margin-top:10px; }
.rx-pth{
  position:relative; border-radius:11px; overflow:hidden;
  aspect-ratio:1/1; background:var(--ink-100); cursor:pointer;
  border:1px solid var(--hairline-strong, rgba(0,0,0,.15)); padding:0;
}
.rx-pth.on{
  border-color:var(--green-500,#22c55e);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--green-500) 14%,transparent);
}
.rx-pth .nm{
  position:absolute; left:0; right:0; bottom:0;
  padding:10px 7px 5px; font-size:9px; font-weight:700; color:#fff;
  background:linear-gradient(transparent,rgba(0,0,0,.72));
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:left;
}
.rx-show{
  position:relative; overflow:hidden;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(165deg,color-mix(in srgb,var(--green-500) 9%,var(--bg-soft)),var(--bg-soft));
}
.rx-adf{
  position:relative; width:220px; aspect-ratio:9/16;
  border-radius:22px; overflow:hidden; background:#081109;
  box-shadow:0 30px 70px rgba(0,0,0,.28);
}
.rx-adf .mesh{ position:absolute; inset:0; background:radial-gradient(120% 75% at 50% 0%,#1f4630,#081109 72%); }
.rx-adf .blob{ position:absolute; border-radius:50%; filter:blur(40px); opacity:.5; }
.rx-adf .b1{ width:62%; height:30%; left:-10%; top:16%; background:#22C55E; }
.rx-adf .b2{ width:55%; height:28%; right:-12%; bottom:20%; background:#0d6b3a; opacity:.6; }
.rx-adf .ar{
  position:absolute; right:11px; top:11px;
  font-family:var(--font-mono); font-size:9px; font-weight:700; color:#fff;
  background:rgba(0,0,0,.45); padding:3px 7px; border-radius:99px; z-index:2;
}
.rx-adf .cap{
  position:absolute; left:15px; right:15px; bottom:22px;
  font-family:var(--font-display); font-weight:900; font-size:17px;
  line-height:1.15; color:#fff; text-shadow:0 2px 14px rgba(0,0,0,.6); z-index:2;
}
.rx-adf .cap em{ font-style:normal; color:#5ef08f; }
.rx-adf .play{
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  width:44px; height:44px; border-radius:50%; background:rgba(255,255,255,.92);
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 8px 24px rgba(0,0,0,.3); z-index:2; color:#0b0b0f;
}

/* FMT-6 grid (6 portrait video posters) */
.wiz-fmt-grid{
  display:grid; grid-template-columns:repeat(6,1fr); gap:14px;
}
@media(max-width:1000px){ .wiz-fmt-grid{ grid-template-columns:repeat(3,1fr); } }
@media(max-width:680px){  .wiz-fmt-grid{ grid-template-columns:repeat(2,1fr); } }
.wiz-fmt-tile{
  position:relative; border:none; background:transparent; cursor:pointer;
  padding:0; text-align:left; display:block; min-width:0;
}
.wiz-fmt-thumb{
  position:relative; display:block; aspect-ratio:9/16;
  background:var(--media-well, #111);
  overflow:hidden; border-radius:14px;
  border:2px solid transparent;
  box-shadow:0 1px 2px rgba(0,0,0,.06);
  transition:transform .15s, box-shadow .15s;
}
.wiz-fmt-tile:hover .wiz-fmt-thumb{
  box-shadow:0 8px 24px rgba(0,0,0,.16);
  transform:translateY(-2px);
}
.wiz-fmt-tile.on .wiz-fmt-thumb{
  border-color:var(--green-500,#22c55e);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--green-500) 16%,transparent),0 4px 14px rgba(0,0,0,.10);
}
.wiz-fmt-rec{
  position:absolute; top:8px; left:8px; z-index:2;
  font-family:var(--font-mono); font-size:8.5px; font-weight:700;
  letter-spacing:.04em; text-transform:uppercase; color:#fff;
  background:linear-gradient(135deg,var(--green-500,#22c55e),var(--green-600,#16a34a));
  padding:3px 8px; border-radius:99px;
}
.wiz-fmt-play{
  position:absolute; left:50%; top:50%;
  transform:translate(-50%,-50%) scale(.9);
  width:38px; height:38px; border-radius:50%;
  background:rgba(255,255,255,.92);
  display:flex; align-items:center; justify-content:center;
  opacity:0; transition:all .15s; z-index:2; color:#111;
  box-shadow:0 4px 14px rgba(0,0,0,.18);
}
.wiz-fmt-tile:hover .wiz-fmt-play{ opacity:1; transform:translate(-50%,-50%) scale(1); }
.wiz-fmt-meta{ display:block; padding:9px 2px 0; }
.wiz-fmt-n{
  font-size:12.5px; font-weight:700; color:var(--ink-1000);
  display:flex; align-items:center; gap:5px; flex-wrap:wrap;
}
.wiz-fmt-s{
  display:block; font-size:11px; color:var(--ink-500);
  margin-top:2px; line-height:1.35;
}
.wiz-fmt-tick{
  width:15px; height:15px; border-radius:50%;
  background:var(--green-500,#22c55e); color:#fff;
  display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;
}

/* Coded step actor summary */
.canon-actor-summary{ padding:6px 0; }
.canon-actor-card{
  display:flex; align-items:center; gap:14px;
  padding:14px; border:1px solid var(--hairline);
  border-radius:14px; background:var(--bg-surface,#fff);
}
.canon-actor-face{
  width:56px; height:56px; border-radius:50%;
  background:linear-gradient(135deg,#22c55e,#0e2a1a);
}
.canon-actor-meta{ display:flex; flex-direction:column; gap:4px; }
.canon-actor-name{ font-weight:700; color:var(--ink-1000); font-size:14px; }

/* wiz-cost pill inside the HexCode-it button */
.wiz-cost{
  font-family:var(--font-mono); font-size:11px; font-weight:600;
  background:rgba(255,255,255,.16); border-radius:99px;
  padding:1px 8px; margin-left:6px;
}

/* G-H Generating (canon, locked) */
.canon-gh{
  margin:auto; padding:40px 20px;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
}
.canon-gh-frame{
  position:relative; border-radius:18px; overflow:hidden;
  background:var(--media-well, #0b0b0f);
  width:188px; aspect-ratio:9/16;
}
.canon-gh-mesh{
  position:absolute; inset:0;
  background:radial-gradient(120% 90% at 50% 0%,#0e2a1a,#07120c 72%);
}
.canon-gh-shimmer{
  position:absolute; inset:0;
  background:linear-gradient(100deg,transparent 30%,rgba(134,239,172,.12) 50%,transparent 70%);
  animation:canon-gh-shz 2.4s linear infinite;
}
@keyframes canon-gh-shz{
  0%{ transform:translateX(-100%); }
  100%{ transform:translateX(100%); }
}
.canon-gh-wm{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
}
.canon-hexwm{
  font-family:var(--font-display, 'Outfit', sans-serif);
  font-size:15px; font-weight:900; letter-spacing:.06em;
  color:rgba(255,255,255,.9);
  text-shadow:0 0 18px rgba(94,240,143,.32);
  animation:canon-gh-breath 2.6s ease-in-out infinite;
}
@keyframes canon-gh-breath{
  0%,100%{ opacity:.65; transform:scale(1); }
  50%{ opacity:1; transform:scale(1.04); }
}
.canon-gh-ring{
  position:relative; width:48px; height:48px; margin:16px auto 0;
}
.canon-gh-ring svg{ width:48px; height:48px; display:block; }
.canon-gh-num{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:11px;
  color:var(--ink-900); font-variant-numeric:tabular-nums;
}
.canon-gh-line{
  text-align:center; margin-top:12px;
  font-size:13.5px; font-weight:600; color:var(--ink-1000);
}
.canon-gh-sub{
  text-align:center; margin-top:5px;
  font-size:11.5px; color:var(--ink-500); line-height:1.5;
}

/* link-q ghost button (canon shared) */
.link-q{
  background:none; border:none; color:var(--ink-500);
  font-size:12px; font-weight:500;
  display:inline-flex; align-items:center; gap:6px; padding:0;
  cursor:pointer;
}
.link-q:hover{ color:var(--ink-700); }
/* === end URL → Ad canon wizard === */

/* === CANON_MARKER_TEMPLATES_V1 — templates page overlay (canon: design/canon/templates.html) === */
[data-canon-templates="v1"] { overflow-y: auto; flex: 1; }
.canon-tpl-inner { max-width: 1080px; margin: 0 auto; padding: 26px 30px 70px; }
.canon-tpl-head { display: flex; flex-direction: column; }
.canon-tpl-head h1 { font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin: 0; color: var(--ink-1000); }
.canon-tpl-head .sub { font-size: 13px; color: var(--ink-600); margin: 6px 0 0; line-height: 1.5; }

.canon-tpl-toolbar { display: flex; align-items: center; gap: 10px; margin-top: 16px; position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg-canvas) 90%, transparent); backdrop-filter: blur(10px); padding: 10px 0; }
.canon-tpl-search { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 16px; border: 1px solid var(--hairline-strong); border-radius: var(--r-pill); background: var(--bg-surface); flex: 1; max-width: 460px; }
.canon-tpl-search:focus-within { border-color: var(--green-500); box-shadow: var(--focus-ring); }
.canon-tpl-search svg { color: var(--ink-400); flex-shrink: 0; }
.canon-tpl-search input { flex: 1; border: none; outline: none; background: transparent; font-size: 14px; color: var(--ink-1000); min-width: 0; }
.canon-tpl-search input::placeholder { color: var(--ink-400); }

.canon-tpl-favtog { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border: 1px solid var(--hairline-strong); border-radius: var(--r-pill); background: var(--bg-surface); font-size: 12.5px; font-weight: 600; color: var(--ink-700); cursor: pointer; }
.canon-tpl-favtog.on { border-color: var(--green-500); background: color-mix(in srgb, var(--green-500) 9%, var(--bg-surface)); color: var(--green-700); }
.canon-tpl-favtog.on svg { fill: var(--green-600); color: var(--green-600); }

.canon-tpl-dd { position: relative; flex-shrink: 0; }
.canon-tpl-ddbtn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border: 1px solid var(--hairline-strong); border-radius: var(--r-pill); background: var(--bg-surface); font-size: 12.5px; font-weight: 600; color: var(--ink-800); cursor: pointer; }
.canon-tpl-ddbtn .k { color: var(--ink-500); font-weight: 500; }
.canon-tpl-ddmenu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 160px; background: var(--bg-surface); border: 1px solid var(--hairline-strong); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 5px; z-index: 40; }
.canon-tpl-ddopt { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: 13px; color: var(--ink-800); }
.canon-tpl-ddopt:hover { background: color-mix(in srgb, var(--ink-1000) 6%, transparent); }
.canon-tpl-ddopt .ck { color: var(--green-600); opacity: 0; }
.canon-tpl-ddopt.on .ck { opacity: 1; }
.canon-tpl-ddopt.on { color: var(--green-700); font-weight: 600; }

.canon-tpl-wrap { display: grid; grid-template-columns: 198px 1fr; gap: 24px; margin-top: 20px; }
.canon-tpl-filters { position: sticky; top: 78px; align-self: start; }
.canon-tpl-filters .fgroup { margin-bottom: 20px; }
.canon-tpl-filters .fgl { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); margin-bottom: 9px; }
.canon-tpl-filters .fopt { display: flex; align-items: center; gap: 9px; padding: 6px 4px; font-size: 13px; color: var(--ink-700); cursor: pointer; }
.canon-tpl-filters .fopt:hover { color: var(--ink-1000); }
.canon-tpl-filters .fopt .bx { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--hairline-strong); display: inline-flex; align-items: center; justify-content: center; color: transparent; flex-shrink: 0; }
.canon-tpl-filters .fopt.on .bx { background: var(--green-500); border-color: var(--green-500); color: #fff; }
.canon-tpl-filters .fopt .ct { margin-left: auto; font-size: 11px; color: var(--ink-400); }
.canon-tpl-filters .fpills { display: flex; gap: 7px; flex-wrap: wrap; }
.canon-tpl-filters .fpill { padding: 6px 12px; border: 1px solid var(--hairline-strong); border-radius: var(--r-pill); font-size: 12px; font-weight: 600; color: var(--ink-700); cursor: pointer; }
.canon-tpl-filters .fpill.on { border-color: var(--green-500); background: color-mix(in srgb, var(--green-500) 9%, var(--bg-surface)); color: var(--green-700); }

.canon-tpl-gridhead { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; }
.canon-tpl-gridhead .gc { font-size: 13px; color: var(--ink-600); }
.canon-tpl-gridhead .gc b { color: var(--ink-1000); }
.canon-tpl-gridhead .clr { font-size: 12px; font-weight: 600; color: var(--green-700); cursor: pointer; margin-left: auto; }

.canon-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.canon-tpl-empty { border: 1px dashed var(--hairline-strong); border-radius: var(--r-lg); padding: 36px; text-align: center; color: var(--ink-500); font-size: 13px; }

.canon-tpl-tile { position: relative; border-radius: 13px; overflow: hidden; cursor: pointer; background: #0a0a0c; aspect-ratio: 9 / 16; box-shadow: var(--shadow-xs); transition: all var(--d-base); }
.canon-tpl-tile:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.canon-tpl-tile .scene { position: absolute; inset: 0; }
.canon-tpl-tile .obj { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); width: 42%; height: 38%; border-radius: 9px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); }
.canon-tpl-tile .grad { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.18) 0%, transparent 30%, transparent 55%, rgba(0,0,0,0.72) 100%); }
.canon-tpl-tile .cat { position: absolute; left: 9px; top: 9px; font-size: 9.5px; font-weight: 700; font-family: var(--font-mono); letter-spacing: 0.03em; color: #fff; background: rgba(0,0,0,0.42); backdrop-filter: blur(5px); padding: 3px 8px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 5px; }
.canon-tpl-tile .fmt { position: absolute; right: 9px; top: 9px; font-size: 9px; font-weight: 700; font-family: var(--font-mono); color: #fff; background: rgba(0,0,0,0.42); padding: 2px 7px; border-radius: var(--r-pill); }
.canon-tpl-tile .newb { position: absolute; right: 9px; top: 30px; font-size: 8.5px; font-weight: 700; font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; color: #fff; background: linear-gradient(135deg, var(--green-500), var(--green-600)); padding: 2px 7px; border-radius: var(--r-pill); }
.canon-tpl-tile .fav { position: absolute; right: 8px; bottom: 46px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,0.45); backdrop-filter: blur(5px); border: none; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: all var(--d-fast); }
.canon-tpl-tile:hover .fav { opacity: 1; }
.canon-tpl-tile .fav.on { opacity: 1; background: var(--green-500); }
.canon-tpl-tile .fav.on svg { fill: #fff; }
.canon-tpl-tile .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,0.9); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--d-fast); color: #111; }
.canon-tpl-tile:hover .play { opacity: 1; }
.canon-tpl-tile .meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 11px; }
.canon-tpl-tile .nm { font-size: 12.5px; font-weight: 700; color: #fff; line-height: 1.25; text-shadow: 0 1px 6px rgba(0,0,0,0.5); }
.canon-tpl-tile .swap { font-size: 10px; color: rgba(255,255,255,0.82); margin-top: 3px; display: inline-flex; align-items: center; gap: 4px; }

/* 760×600 input sheet */
.canon-tpl-sheetwrap { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.5); z-index: 95; padding: 20px; }
.canon-tpl-sheet { position: relative; width: 760px; height: 600px; max-width: 100%; max-height: 90vh; overflow: hidden; background: var(--bg-surface); border: 1px solid var(--hairline); border-radius: var(--r-xl); box-shadow: var(--shadow-xl); display: grid; grid-template-columns: 280px 1fr; }
.canon-tpl-sheet.solo { grid-template-columns: 1fr; }
.canon-tpl-sheet .prev { background: #0a0a0c; position: relative; }
.canon-tpl-sheet .prev .scene { position: absolute; inset: 0; }
.canon-tpl-sheet .prev .obj { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); width: 44%; height: 40%; border-radius: 9px; box-shadow: 0 14px 36px rgba(0,0,0,0.5); }
.canon-tpl-sheet .prev .grad { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.7)); }
.canon-tpl-sheet .prev .cap { position: absolute; left: 14px; right: 14px; bottom: 14px; color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 15px; text-shadow: 0 1px 8px rgba(0,0,0,0.6); }
.canon-tpl-sheet .body { padding: 22px 24px; overflow-y: auto; }
.canon-tpl-sheet .sx { position: absolute; right: 14px; top: 14px; border: none; background: rgba(0,0,0,0.4); color: #fff; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 5; }
.canon-tpl-sheet .cat2 { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--green-700); display: inline-flex; gap: 5px; align-items: center; }
.canon-tpl-sheet h3 { font-family: var(--font-display); font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin: 7px 0 0; color: var(--ink-1000); }
.canon-tpl-sheet .desc { font-size: 13px; color: var(--ink-600); margin-top: 7px; line-height: 1.5; }
.canon-tpl-sheet .swaplab { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-500); margin: 22px 0 10px; }
.canon-tpl-sheet .slot { display: flex; align-items: center; gap: 12px; padding: 12px 13px; border: 1.5px dashed var(--hairline-strong); border-radius: var(--r-md); margin-bottom: 9px; cursor: pointer; transition: all var(--d-fast); }
.canon-tpl-sheet .slot:hover { border-color: var(--green-500); background: color-mix(in srgb, var(--green-500) 9%, var(--bg-surface)); }
.canon-tpl-sheet .slot.filled { border-style: solid; border-color: var(--green-500); background: color-mix(in srgb, var(--green-500) 9%, var(--bg-surface)); }
.canon-tpl-sheet .slot .si { width: 38px; height: 38px; border-radius: 9px; background: var(--ink-50); border: 1px solid var(--hairline); display: flex; align-items: center; justify-content: center; color: var(--ink-500); flex-shrink: 0; }
.canon-tpl-sheet .slot .sw { flex: 1; min-width: 0; }
.canon-tpl-sheet .slot .st2 { display: block; font-size: 13px; font-weight: 600; color: var(--ink-1000); }
.canon-tpl-sheet .slot .sh { display: block; font-size: 11.5px; color: var(--ink-500); margin-top: 2px; }
.canon-tpl-sheet .slot .sa { flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--green-700); white-space: nowrap; }
.canon-tpl-sheet .slot .ok { display: inline-flex; align-items: center; gap: 5px; color: var(--green-700); font-weight: 600; font-size: 12px; flex-shrink: 0; }
.canon-tpl-sheet .scriptbox { width: 100%; min-height: 120px; padding: 11px 13px; border: 1.5px dashed var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); font-family: inherit; font-size: 13px; line-height: 1.55; color: var(--ink-1000); outline: none; resize: none; transition: all var(--d-fast); }
.canon-tpl-sheet .scriptbox:focus { border-color: var(--green-500); border-style: solid; box-shadow: var(--focus-ring); }
.canon-tpl-sheet .scriptrow { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.canon-tpl-sheet .scriptrow .hint { font-size: 11px; color: var(--ink-500); }
.canon-tpl-sheet .taps { font-size: 11.5px; color: var(--ink-500); margin-top: 14px; display: flex; align-items: center; gap: 7px; }
.canon-tpl-sheet .taps svg { color: var(--green-600); }
.canon-tpl-sheet .cta { margin-top: 18px; }

.canon-tpl-sheet .genwrap { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.canon-tpl-sheet .gring { position: relative; width: 128px; height: 128px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.canon-tpl-sheet .gring::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--bg-surface); }
.canon-tpl-sheet .gring .gpct { position: relative; z-index: 2; font-family: var(--font-display); font-weight: 800; font-size: 24px; color: var(--ink-1000); }
.canon-tpl-sheet .gbrand { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #222, #d50032); color: #fff; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; animation: canonTplBreath 2.2s ease-in-out infinite; }
@keyframes canonTplBreath { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.9); opacity: 0.7; } }
.canon-tpl-sheet .gt { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--ink-1000); }
.canon-tpl-sheet .gs { font-size: 12px; color: var(--ink-500); margin-top: -8px; }
.canon-tpl-sheet .donewrap { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.canon-tpl-sheet .dplayer { position: relative; border-radius: 14px; overflow: hidden; background: #0a0a0c; box-shadow: var(--shadow-lg); }
.canon-tpl-sheet .dplayer .scene { position: absolute; inset: 0; }
.canon-tpl-sheet .dplayer .obj { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); width: 44%; height: 40%; border-radius: 9px; }
.canon-tpl-sheet .dplayer .grad { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.7)); }
.canon-tpl-sheet .dplayer .playc { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,0.92); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md); color: #111; }
.canon-tpl-sheet .dplayer .dur { position: absolute; right: 9px; bottom: 9px; font-size: 9px; font-weight: 700; font-family: var(--font-mono); color: #fff; background: rgba(0,0,0,0.45); padding: 2px 7px; border-radius: var(--r-pill); }
.canon-tpl-sheet .drow { display: flex; gap: 10px; }

@media (max-width: 1040px) {
  .canon-tpl-wrap { grid-template-columns: 1fr; }
  .canon-tpl-filters { position: static; }
  .canon-tpl-sheet { grid-template-columns: 1fr; }
  .canon-tpl-sheet .prev { min-height: 200px; }
}
/* === end CANON_MARKER_TEMPLATES_V1 === */

/* === CANON_MARKER_PROJECTS_V1 — projects page overlay (canon: design/canon/projects.html, ADR-0043) === */
/* Scoped via .prf- + .canon- prefixes to avoid clashing with existing rules. */

/* ── List view (PR-F pure ledger) ───────────────────────────────── */
.prf-page { max-width: 1180px; width: 100%; margin: 0 auto; padding: 32px 36px 90px; }
.prf-ptitle { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 24px; }
.prf-tl { min-width: 0; }
.prf-tl h1 {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 800; letter-spacing: -0.03em;
  margin: 0; color: var(--ink-1000);
}
.prf-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--green-700);
  margin-bottom: 6px;
}
.prf-srch {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: var(--r-pill, 999px);
  border: 1px solid var(--hairline-strong, rgba(0,0,0,0.12));
  background: var(--bg-surface);
  color: var(--ink-500); font-size: 12.5px; min-width: 200px;
}
.prf-srch svg { flex-shrink: 0; }
.prf-srch input {
  border: none; background: transparent; outline: none;
  font: inherit; color: var(--ink-900); width: 100%;
}
.prf-srch input::placeholder { color: var(--ink-500); }

.prf-ledger { border-top: 1px solid var(--hairline); }
.prf-lrow {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  padding: 13px 6px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  transition: background var(--d-fast, 0.15s);
}
.prf-lrow:hover { background: var(--hover-surface-2, rgba(0,0,0,0.04)); }
.prf-lt {
  width: 52px; height: 36px;
  border-radius: var(--r-sm, 8px);
  background: var(--media-well, #0a0a0c);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs, 0 1px 2px rgba(0,0,0,0.05));
}
.prf-th-a { background: linear-gradient(150deg, #13321f, #0a0a0c 70%); }
.prf-th-b { background: linear-gradient(150deg, #1a1410, #0a0a0c); }
.prf-th-c { background: linear-gradient(150deg, #101a2e, #0a0a0c); }
.prf-th-d { background: linear-gradient(150deg, #2e1018, #0a0a0c); }
.prf-th-e { background: linear-gradient(150deg, #231030, #0a0a0c); }

.prf-lname {
  font-size: 14px; font-weight: 700;
  color: var(--ink-1000); letter-spacing: -0.01em;
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prf-lname input {
  font: inherit; color: inherit;
  border: none; background: var(--bg-surface); outline: none;
  border-radius: var(--r-sm, 8px);
  box-shadow: 0 0 0 2px var(--accent-border, rgba(34,197,94,0.5));
  padding: 2px 8px; width: 60%; min-width: 180px;
}
.prf-lcount { font-size: 12.5px; color: var(--ink-500); flex-shrink: 0; }
.prf-dots {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none; background: transparent;
  color: var(--ink-500);
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity var(--d-fast, 0.15s), background var(--d-fast, 0.15s);
  flex-shrink: 0;
  cursor: pointer;
}
.prf-lrow:hover .prf-dots,
.prf-dots.open { opacity: 1; }
.prf-dots:hover,
.prf-dots.open { background: var(--hover-surface-2, rgba(0,0,0,0.04)); color: var(--ink-900); }

.prf-chev {
  color: var(--ink-400, rgba(0,0,0,0.3));
  flex-shrink: 0;
  display: inline-flex;
}

.prf-rowmenu {
  position: absolute; right: 34px; top: 46px;
  z-index: 30; min-width: 168px;
  background: var(--bg-surface);
  border: 1px solid var(--hairline-strong, rgba(0,0,0,0.12));
  border-radius: var(--r-md, 12px);
  box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,0.18));
  padding: 6px;
}
.prf-mi {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px;
  border: none; background: transparent;
  border-radius: var(--r-sm, 8px);
  font-size: 12.5px; font-weight: 600;
  color: var(--ink-700); text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.prf-mi:hover { background: var(--hover-surface-2, rgba(0,0,0,0.04)); color: var(--ink-1000); }
.prf-mi svg { color: var(--ink-500); flex-shrink: 0; }
.prf-mi-danger { color: var(--danger, #ef4444); }
.prf-mi-danger svg { color: var(--danger, #ef4444); }

.prf-empty {
  padding: 64px 0; text-align: center;
  color: var(--ink-500); font-size: 13.5px;
}
.prf-empty b { color: var(--ink-700); }

/* ── Detail view (canon video grid + PD-A sheet) ───────────────── */
.canon-proj-page { max-width: 1180px; width: 100%; margin: 0 auto; padding: 32px 36px 90px; }
.canon-ptitle { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 24px; }
.canon-tl { min-width: 0; }
.canon-tl h1 {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 800; letter-spacing: -0.03em;
  margin: 0; color: var(--ink-1000);
  outline: none;
  border-radius: var(--r-sm, 8px);
}
.canon-tl h1:focus { background: var(--hover-surface-2, rgba(0,0,0,0.04)); box-shadow: 0 0 0 2px var(--accent-border, rgba(34,197,94,0.5)); }
.canon-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--green-700);
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.canon-back {
  font-family: var(--font-body); letter-spacing: 0; text-transform: none;
  font-size: 11.5px; font-weight: 600;
  color: var(--ink-500);
  background: none; border: none; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 3px;
}
.canon-back:hover { color: var(--green-600); }
.canon-sub { font-size: 13px; color: var(--ink-500); margin-top: 6px; }
.canon-srch {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: var(--r-pill, 999px);
  border: 1px solid var(--hairline-strong, rgba(0,0,0,0.12));
  background: var(--bg-surface);
  color: var(--ink-500); font-size: 12.5px; min-width: 200px;
}
.canon-srch input {
  border: none; background: transparent; outline: none;
  font: inherit; color: var(--ink-900); width: 100%;
}
.canon-srch input::placeholder { color: var(--ink-500); }

.canon-empty {
  padding: 64px 0; text-align: center;
  color: var(--ink-500); font-size: 13.5px;
}
.canon-empty b { color: var(--ink-700); }

.canon-video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1080px) { .canon-video-grid { grid-template-columns: repeat(2, 1fr); } }
.canon-vc {
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg, 16px);
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs, 0 1px 2px rgba(0,0,0,0.05));
  cursor: pointer;
  transition: all var(--d-base, 0.2s);
}
.canon-vc:hover {
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,0.12));
  transform: translateY(-2px);
  border-color: var(--green-400);
}
.canon-vthumb {
  position: relative;
  aspect-ratio: 9 / 12;
  background: var(--media-well, #0a0a0c);
}
.canon-vthumb video,
.canon-vthumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.canon-grade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 38%, rgba(0,0,0,0.5));
  pointer-events: none;
}
.canon-vcap {
  position: absolute; left: 11px; right: 11px; bottom: 11px;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800; font-size: 13px; line-height: 1.25;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
  z-index: 1;
}
.canon-stagepill {
  position: absolute; left: 10px; top: 10px;
  font-size: 10px; font-weight: 700;
  padding: 4px 9px;
  border-radius: var(--r-pill, 999px);
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  backdrop-filter: blur(6px);
  z-index: 2;
}
.canon-stagepill .canon-d {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--warning, #f59e0b);
  animation: canon-proj-pulse 1.2s infinite;
}
@keyframes canon-proj-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.canon-playbadge {
  position: absolute; right: 10px; bottom: 10px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  color: var(--ink-1000);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm, 0 2px 6px rgba(0,0,0,0.12));
  z-index: 2;
}
.canon-playbadge svg { margin-left: 2px; }
.canon-vfoot { padding: 10px 13px 12px; }
.canon-vtool {
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--green-700);
}
.canon-vmeta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 4px;
  font-size: 11px; color: var(--ink-500);
}
.canon-vmeta .canon-when { margin-left: auto; }

.canon-th-a { background: linear-gradient(150deg, #13321f, #0a0a0c 70%); }
.canon-th-b { background: linear-gradient(150deg, #1a1410, #0a0a0c); }
.canon-th-c { background: linear-gradient(150deg, #101a2e, #0a0a0c); }
.canon-th-d { background: linear-gradient(150deg, #2e1018, #0a0a0c); }
.canon-th-e { background: linear-gradient(150deg, #231030, #0a0a0c); }

/* ── PD-A New-video sheet (canon, ADR-0038) ───────────────────── */
.canon-ovl {
  position: fixed; inset: 0;
  background: rgba(10,10,12,0.38);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 60;
}
.canon-ovl.open { display: flex; }
.canon-sheet {
  width: 740px; max-width: 92%;
  background: var(--bg-surface);
  border: 1px solid var(--hairline-strong, rgba(0,0,0,0.12));
  border-radius: var(--r-xl, 20px);
  box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,0.18));
  padding: 26px 28px 28px;
}
.canon-sh-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--green-700);
}
.canon-sh-head { display: flex; align-items: flex-start; gap: 12px; margin-top: 6px; }
.canon-sh-head h2 {
  font-family: var(--font-display);
  font-size: 21px; font-weight: 800; letter-spacing: -0.02em;
  margin: 0; color: var(--ink-1000);
}
.canon-sh-sub { font-size: 13px; color: var(--ink-600); margin-top: 5px; }
.canon-x {
  margin-left: auto;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--hairline-strong, rgba(0,0,0,0.12));
  background: var(--bg-surface);
  color: var(--ink-600);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.canon-choose-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 13px;
  margin-top: 20px;
}
@media (max-width: 1080px) { .canon-choose-grid { grid-template-columns: 1fr; } }
.canon-choose-tile {
  position: relative; text-align: left; cursor: pointer;
  display: flex; flex-direction: column;
  padding: 19px 17px 16px;
  border-radius: var(--r-lg, 16px);
  border: 1px solid var(--hairline-strong, rgba(0,0,0,0.12));
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs, 0 1px 2px rgba(0,0,0,0.05));
  transition: transform var(--d-base, 0.2s), box-shadow var(--d-base, 0.2s), border-color var(--d-base, 0.2s), background var(--d-base, 0.2s);
  color: inherit; text-decoration: none;
}
.canon-choose-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,0.12));
  border-color: var(--green-400);
  background: color-mix(in srgb, var(--green-500) 4%, var(--bg-surface));
}
.canon-ti {
  width: 42px; height: 42px;
  border-radius: var(--r-md, 12px);
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  color: #fff;
  box-shadow: var(--shadow-green-soft, 0 8px 20px rgba(34,197,94,0.2));
  margin-bottom: 13px;
}
.canon-tn {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--ink-1000);
}
.canon-tx {
  font-size: 11.5px; color: var(--ink-500);
  margin-top: 4px; line-height: 1.45;
}
.canon-fastest {
  position: absolute; right: 13px; top: 15px;
  font-family: var(--font-mono);
  font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--green-700);
  background: var(--green-100, rgba(34,197,94,0.12));
  border-radius: var(--r-pill, 999px);
  padding: 3px 8px;
}
.canon-custom-line { margin-top: 18px; font-size: 13px; color: var(--ink-600); }
.canon-custom-line a {
  color: var(--green-600); font-weight: 600;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
/* === end CANON_MARKER_PROJECTS_V1 === */

/* ============================================================
   HexCoded Canon DS v1.0 — surface-specific CSS
   Extracted from design/canon/*.html on 2026-06-14.
   Append-only overlay. Rules later in this block win via cascade.
   ============================================================ */

/* ════════════════════════════════════════
   SURFACE: onboarding.html
   ════════════════════════════════════════ */

/* ---- onboarding.html :: style block 0 ---- */
/* ── DS ALIAS LAYER — verbatim from the locked reference (ADR-0002). Pure var()/color-mix; no token hex. ── */
:root{
  --font-display:var(--amp-hexcoded-font-display); --font-body:var(--amp-hexcoded-font-body); --font-mono:var(--amp-hexcoded-font-mono);
  --green-50:var(--amp-hexcoded-theme-color-accent-whisper); --green-100:var(--amp-hexcoded-color-green-100);
  --green-200:color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 28%,var(--amp-hexcoded-color-white));
  --green-300:var(--amp-hexcoded-theme-color-accent-light); --green-400:color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 72%,var(--amp-hexcoded-color-white));
  --green-500:var(--amp-hexcoded-theme-color-accent); --green-600:var(--amp-hexcoded-theme-color-accent-deep);
  --green-700:color-mix(in srgb,var(--amp-hexcoded-theme-color-accent-deep) 80%,var(--amp-hexcoded-color-black));
  --green-800:color-mix(in srgb,var(--amp-hexcoded-theme-color-accent-deep) 62%,var(--amp-hexcoded-color-black));
  --ink-0:var(--amp-hexcoded-theme-color-bg-elev); --ink-50:var(--amp-hexcoded-theme-color-bg); --ink-100:var(--amp-hexcoded-theme-color-bg-soft);
  --ink-400:color-mix(in srgb,var(--amp-hexcoded-theme-color-bg-elev) 58%,var(--amp-hexcoded-theme-color-text-primary));
  --ink-500:var(--amp-hexcoded-theme-color-text-tertiary);
  --ink-600:color-mix(in srgb,var(--amp-hexcoded-theme-color-text-tertiary) 60%,var(--amp-hexcoded-theme-color-text-primary));
  --ink-700:var(--amp-hexcoded-theme-color-text-secondary);
  --ink-800:color-mix(in srgb,var(--amp-hexcoded-theme-color-text-secondary) 45%,var(--amp-hexcoded-theme-color-text-primary));
  --ink-900:color-mix(in srgb,var(--amp-hexcoded-theme-color-text-primary) 88%,var(--amp-hexcoded-theme-color-bg-elev));
  --ink-1000:var(--amp-hexcoded-theme-color-text-primary);
  --bg-canvas:var(--amp-hexcoded-theme-color-bg); --bg-surface:var(--amp-hexcoded-theme-color-bg-elev); --bg-soft:var(--amp-hexcoded-theme-color-bg-soft);
  --hairline:color-mix(in srgb,var(--amp-hexcoded-theme-color-border) 60%,transparent); --hairline-strong:var(--amp-hexcoded-theme-color-border);
  --glass-bg-strong:color-mix(in srgb,var(--amp-hexcoded-theme-color-bg-elev) 88%,transparent); --glass-blur:blur(20px) saturate(180%);
  --shadow-xs:var(--amp-hexcoded-shadow-1); --shadow-sm:var(--amp-hexcoded-shadow-2); --shadow-md:var(--amp-hexcoded-shadow-3); --shadow-lg:var(--amp-hexcoded-shadow-4); --shadow-xl:var(--amp-hexcoded-shadow-5);
  --shadow-green-soft:0 8px 20px color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 14%,transparent); --shadow-green:0 12px 32px color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 24%,transparent),0 4px 8px color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 12%,transparent);
  --r-sm:var(--amp-hexcoded-radius-md); --r-md:var(--amp-hexcoded-radius-lg); --r-lg:var(--amp-hexcoded-radius-xl); --r-xl:var(--amp-hexcoded-radius-2xl); --r-pill:var(--amp-hexcoded-radius-full);
  --ease-out:var(--amp-hexcoded-motion-ease); --d-fast:var(--amp-hexcoded-motion-d-fast); --d-base:var(--amp-hexcoded-motion-d-base); --d-slow:var(--amp-hexcoded-motion-d-slow);
  --accent-soft:color-mix(in srgb,var(--green-500) 9%,var(--bg-surface)); --accent-border:color-mix(in srgb,var(--green-500) 30%,var(--hairline));
  --accent-chip-bg:var(--green-100); --accent-chip-ink:var(--green-700); --sel-bg:var(--accent-soft); --sel-border:var(--green-500); --sel-ring-2:0 0 0 2px color-mix(in srgb,var(--green-500) 16%,transparent);
  --focus-ring:0 0 0 3px color-mix(in srgb,var(--green-500) 14%,transparent); --media-well:#0a0a0c; --seg-track:var(--ink-100); --seg-thumb:var(--bg-surface);
  --danger:var(--amp-hexcoded-status-danger); --hover-surface:color-mix(in srgb,var(--ink-1000) 6%,transparent);
}
[data-theme="dark"]{ --seg-track:var(--bg-surface); --accent-chip-bg:color-mix(in srgb,var(--green-500) 16%,var(--bg-surface)); --accent-chip-ink:var(--green-300); }
*,*::before,*::after{ box-sizing:border-box; } html,body{ height:100%; margin:0; }
body{ font-family:var(--font-body); color:var(--ink-900); background:var(--bg-canvas); -webkit-font-smoothing:antialiased; }
button{ font-family:inherit; }
.hexwm{ position:relative; display:inline-block; isolation:isolate; font-family:Outfit,sans-serif; font-weight:900; letter-spacing:-0.025em; line-height:1; color:var(--ink-1000); }
.hexwm::before,.hexwm::after,.hexwm .ph{ content:attr(data-text); position:absolute; left:0; top:0; color:#22C55E; z-index:-1; }
.hexwm::before{ transform:translate(1px,1px); opacity:.85; --ph:.85; animation:hexph 3s ease-in-out infinite; }
.hexwm .ph{ transform:translate(2px,2px); opacity:.55; --ph:.55; animation:hexph 3s ease-in-out infinite .1s; }
.hexwm::after{ transform:translate(3px,3px); opacity:.32; --ph:.32; animation:hexph 3s ease-in-out infinite .2s; }
@keyframes hexph{ 0%,100%{opacity:var(--ph,.85)} 50%{opacity:calc(var(--ph,.85)*.4)} }
@media (prefers-reduced-motion:reduce){ .hexwm::before,.hexwm::after,.hexwm .ph{animation:none!important} }
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:7px; height:40px; padding:0 16px; border-radius:var(--r-pill); font-size:13.5px; font-weight:600; border:1px solid var(--hairline-strong); background:var(--bg-surface); color:var(--ink-800); cursor:pointer; transition:all var(--d-fast); white-space:nowrap; }
.btn:hover{ background:var(--ink-100); color:var(--ink-1000); } .btn svg{ width:15px; height:15px; }
.btn-primary{ background:linear-gradient(135deg,var(--amp-hexcoded-theme-color-accent),var(--amp-hexcoded-theme-color-accent-deep)); color:#fff; border:none; box-shadow:var(--shadow-green-soft); }
.btn-primary:hover{ background:linear-gradient(135deg,var(--amp-hexcoded-theme-color-accent-deep),var(--green-700)); color:#fff; box-shadow:var(--shadow-green); }
.btn-primary:disabled{ opacity:.5; cursor:not-allowed; box-shadow:none; }
.btn-ghost{ border:1px solid transparent; background:transparent; color:var(--ink-700); } .btn-ghost:hover{ background:var(--ink-100); color:var(--ink-1000); }
.btn-lg{ height:48px; padding:0 22px; font-size:14.5px; } .btn-block{ width:100%; }
.theme-switcher{ display:inline-flex; align-items:center; background:var(--seg-track); border-radius:var(--r-pill); padding:3px; gap:2px; }
.theme-switcher button{ border:none; background:transparent; cursor:pointer; border-radius:var(--r-pill); font-weight:600; color:var(--ink-600); padding:6px 11px; font-size:11.5px; }
.theme-switcher button.on{ background:var(--seg-thumb); color:var(--ink-1000); box-shadow:var(--shadow-xs); }

/* ════ AUTH (Clerk-style centered card) ════ */
.authwrap{ min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:40px 20px; position:relative;
  background:radial-gradient(120% 90% at 50% -10%,color-mix(in srgb,var(--green-500) 9%,transparent) 0%,transparent 52%),var(--bg-canvas); }
.authwrap.hidden{ display:none; }
.auth-corner{ position:absolute; top:20px; right:22px; }
.brandmark{ display:flex; flex-direction:column; align-items:center; gap:13px; margin-bottom:22px; }
.brandmark .logo{ width:48px; height:48px; border-radius:var(--r-md); background:linear-gradient(135deg,var(--green-500),var(--green-700)); color:#fff; display:flex; align-items:center; justify-content:center; box-shadow:var(--shadow-green-soft); }
.brandmark .logo svg{ width:24px; height:24px; }
.brandmark .wm{ font-size:25px; }
/* .authcard is intentionally a transparent centering wrapper — Clerk's
   own card (themed via clerkAppearance) is the SINGLE visible card. The
   old chromed rule was duplicated from the canon overlay and caused a
   nested card-in-a-card visual. */
.authcard{ width:404px; max-width:100%; background:transparent; border:none; border-radius:var(--r-lg); box-shadow:none; padding:0; animation:rise var(--d-base) var(--ease-out); }
@keyframes rise{ from{opacity:0; transform:translateY(8px)} to{opacity:1; transform:none} }
.authcard h1{ font-family:var(--font-display); font-size:21px; font-weight:800; letter-spacing:-0.02em; text-align:center; margin:0; color:var(--ink-1000); }
.authcard .sub{ text-align:center; font-size:13px; color:var(--ink-600); margin:8px 0 22px; line-height:1.5; }
.authcard .sub b{ color:var(--ink-900); font-weight:600; }
.obtn{ display:flex; align-items:center; justify-content:center; gap:11px; height:48px; padding:0 18px; border-radius:var(--r-md); border:1.5px solid var(--hairline-strong); background:var(--bg-surface); cursor:pointer; width:100%; font-size:14px; font-weight:600; color:var(--ink-1000); transition:all var(--d-fast); }
.obtn:hover{ border-color:var(--green-400); box-shadow:var(--shadow-sm); }
.obtn .gmark{ width:18px; height:18px; flex-shrink:0; }
.auth-or{ display:flex; align-items:center; gap:12px; margin:16px 0; color:var(--ink-400); font-size:11px; font-weight:600; letter-spacing:0.04em; text-transform:uppercase; } .auth-or::before,.auth-or::after{ content:""; flex:1; height:1px; background:var(--hairline); }
.flabel{ font-size:11.5px; font-weight:600; color:var(--ink-700); margin-bottom:7px; }
.field{ display:flex; align-items:center; gap:9px; height:48px; padding:0 14px; border:1.5px solid var(--hairline-strong); border-radius:var(--r-md); background:var(--bg-surface); transition:all var(--d-fast); }
.field:focus-within{ border-color:var(--green-500); box-shadow:var(--focus-ring); } .field svg{ width:17px; height:17px; color:var(--ink-400); flex-shrink:0; }
.field input{ flex:1; border:none; background:transparent; outline:none; font-family:inherit; font-size:14px; color:var(--ink-1000); } .field input::placeholder{ color:var(--ink-400); }
.authfoot{ text-align:center; font-size:12.5px; color:var(--ink-600); margin-top:20px; }
.authfoot a{ color:var(--green-700); font-weight:600; cursor:pointer; text-decoration:none; } .authfoot a:hover{ text-decoration:underline; }
.tinynote{ font-size:11px; color:var(--ink-500); margin-top:16px; line-height:1.5; text-align:center; } .tinynote a{ color:var(--green-700); text-decoration:none; }
.secured{ display:flex; align-items:center; justify-content:center; gap:6px; margin-top:22px; font-size:10px; color:var(--ink-400); font-family:var(--font-mono); font-weight:600; letter-spacing:0.06em; text-transform:uppercase; } .secured svg{ width:12px; height:12px; }
/* OTP */
.otpgrid{ display:flex; gap:9px; justify-content:center; margin:6px 0 6px; }
.otpbox{ width:46px; height:54px; border:1.5px solid var(--hairline-strong); border-radius:var(--r-md); background:var(--bg-surface); text-align:center; font-family:var(--font-display); font-weight:800; font-size:22px; color:var(--ink-1000); outline:none; transition:all var(--d-fast); }
.otpbox:focus{ border-color:var(--green-500); box-shadow:var(--focus-ring); } .otpbox.filled{ border-color:var(--green-400); background:var(--accent-soft); }
.resend{ text-align:center; font-size:12px; color:var(--ink-500); margin-top:14px; } .resend a{ color:var(--green-700); font-weight:600; cursor:pointer; }
.backlink{ display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:600; color:var(--ink-600); background:none; border:none; cursor:pointer; margin-bottom:4px; } .backlink:hover{ color:var(--ink-1000); } .backlink svg{ width:14px; height:14px; }

/* ════ FIRST-RUN HOME (app shell) ════ */
.app{ display:none; height:100vh; grid-template-columns:220px 1fr; } .app.on{ display:grid; animation:fadein var(--d-slow) var(--ease-out); }
@keyframes fadein{ from{opacity:0} to{opacity:1} }
.rail{ background:var(--glass-bg-strong); backdrop-filter:var(--glass-blur); border-right:1px solid var(--hairline); display:flex; flex-direction:column; padding:16px 12px; gap:4px; }
.rail-logo{ display:flex; align-items:center; padding:4px 8px 14px; } .rail-logo .hexwm{ font-size:17px; }
.rail-item{ display:flex; align-items:center; gap:12px; padding:0 11px; height:40px; border-radius:var(--r-md); border:none; background:transparent; cursor:pointer; color:var(--ink-600); font-size:13.5px; font-weight:600; text-align:left; } .rail-item:hover{ background:var(--hover-surface); color:var(--ink-1000); } .rail-item.on{ background:color-mix(in srgb,var(--green-500) 15%,var(--bg-surface)); color:var(--green-700); } [data-theme="dark"] .rail-item.on{ color:var(--green-300); } .rail-item svg{ width:19px; height:19px; }
.rail-tools{ margin-top:12px; } .tools-lab{ font-family:var(--font-mono); font-size:9px; font-weight:700; letter-spacing:0.12em; text-transform:uppercase; color:var(--ink-400); padding:4px 11px; } .rail-sp{ flex:1; } .rail-foot{ padding-top:8px; border-top:1px solid var(--hairline); }
.appmain{ display:flex; flex-direction:column; min-width:0; overflow:hidden; }
.apphdr{ height:58px; flex-shrink:0; display:flex; align-items:center; gap:12px; padding:0 18px; border-bottom:1px solid var(--hairline); background:var(--glass-bg-strong); }
.apphdr .sp{ flex:1; }
.credits{ display:inline-flex; align-items:center; gap:7px; padding:7px 13px; border-radius:var(--r-pill); background:var(--green-50); border:1px solid var(--green-200); font-size:12.5px; font-weight:600; color:var(--green-800); } .credits .coin{ color:var(--green-600); } .credits .muted{ color:var(--green-700); opacity:.8; font-weight:500; }
.acct{ display:inline-flex; align-items:center; gap:8px; padding:5px 11px 5px 6px; border-radius:var(--r-pill); border:1px solid var(--hairline); background:var(--bg-surface); cursor:pointer; } .acct .adot{ width:26px; height:26px; border-radius:50%; background:linear-gradient(135deg,var(--green-400),var(--green-700)); color:#fff; font-weight:700; font-size:12px; display:inline-flex; align-items:center; justify-content:center; } .acct .av{ font-size:12.5px; font-weight:600; color:var(--ink-900); max-width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .acct svg{ width:15px; height:15px; color:var(--ink-500); }
.appscroll{ flex:1; overflow-y:auto; } .pageinner{ max-width:1000px; margin:0 auto; padding:34px 30px 56px; }
.hc-hero{ position:relative; overflow:hidden; border-radius:var(--r-xl); padding:38px 40px 32px; border:1px solid var(--hairline); background:radial-gradient(120% 140% at 12% -10%,color-mix(in srgb,var(--green-500) 22%,transparent) 0%,transparent 46%),radial-gradient(100% 130% at 96% 8%,color-mix(in srgb,var(--green-500) 14%,transparent) 0%,transparent 50%),var(--bg-surface); box-shadow:var(--shadow-sm); }
.hc-eyebrow{ display:inline-flex; align-items:center; gap:8px; font-family:var(--font-mono); font-size:10px; font-weight:700; letter-spacing:0.12em; text-transform:uppercase; color:var(--green-700); } .hc-eyebrow .pulse{ width:7px; height:7px; border-radius:50%; background:var(--green-500); animation:hcp 2.2s ease-out infinite; } @keyframes hcp{ 0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--green-500) 45%,transparent)} 70%{box-shadow:0 0 0 9px transparent} 100%{box-shadow:0 0 0 0 transparent} }
.hc-hero h1{ font-family:var(--font-display); font-size:34px; font-weight:800; letter-spacing:-0.035em; line-height:1.05; margin:14px 0 0; color:var(--ink-1000); max-width:18ch; } .hc-hero h1 em{ font-style:normal; background:linear-gradient(120deg,var(--green-500),var(--green-700)); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
.hc-hero .lede{ font-size:14px; color:var(--ink-600); margin:13px 0 0; max-width:54ch; line-height:1.55; }
.seclabel{ font-family:var(--font-mono); font-size:10px; font-weight:700; letter-spacing:0.1em; text-transform:uppercase; color:var(--ink-500); margin:30px 0 14px; display:flex; align-items:center; gap:10px; } .seclabel .gl{ flex:1; height:1px; background:var(--hairline); }
.startgrid{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.startcard{ display:flex; flex-direction:column; gap:11px; padding:22px; border:1px solid var(--hairline); border-radius:var(--r-lg); background:var(--bg-surface); box-shadow:var(--shadow-xs); cursor:pointer; transition:all var(--d-base); text-align:left; }
.startcard:hover{ box-shadow:var(--shadow-md); transform:translateY(-2px); border-color:var(--green-400); }
.startcard .si{ width:42px; height:42px; border-radius:var(--r-md); background:var(--accent-soft); border:1px solid var(--accent-border); color:var(--green-600); display:flex; align-items:center; justify-content:center; } .startcard .si svg{ width:21px; height:21px; }
.startcard .st{ font-size:15px; font-weight:700; color:var(--ink-1000); } .startcard .sd{ font-size:12.5px; color:var(--ink-600); line-height:1.5; margin-top:-4px; }
.startcard .go{ margin-top:2px; display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:600; color:var(--green-700); } .startcard .go svg{ width:14px; height:14px; }
.emptystate{ border:1px dashed var(--hairline-strong); border-radius:var(--r-lg); padding:38px 24px; text-align:center; background:var(--bg-surface); }
.emptystate .ei{ width:44px; height:44px; border-radius:var(--r-md); background:var(--ink-100); color:var(--ink-400); display:inline-flex; align-items:center; justify-content:center; margin-bottom:12px; } .emptystate .ei svg{ width:22px; height:22px; }
.emptystate .et{ font-size:14px; font-weight:700; color:var(--ink-900); } .emptystate .ed{ font-size:12.5px; color:var(--ink-500); margin-top:5px; }
/* toast */
.toast{ position:fixed; left:50%; bottom:24px; transform:translateX(-50%) translateY(20px); opacity:0; z-index:90; display:flex; align-items:center; gap:13px; max-width:430px; padding:14px 18px; border-radius:var(--r-lg); background:var(--ink-1000); color:var(--ink-0); box-shadow:var(--shadow-xl); transition:all var(--d-base) var(--ease-out); } [data-theme="dark"] .toast{ background:var(--bg-surface); color:var(--ink-1000); border:1px solid var(--hairline-strong); } .toast.on{ opacity:1; transform:translateX(-50%) translateY(0); }
.toast .tic{ width:34px; height:34px; border-radius:50%; background:linear-gradient(135deg,var(--green-500),var(--green-700)); color:#fff; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; } .toast .tic svg{ width:18px; height:18px; } .toast .tt{ font-size:13px; font-weight:700; } .toast .ts{ font-size:11.5px; opacity:.8; margin-top:2px; }
@media (max-width:720px){ .startgrid{ grid-template-columns:1fr; } .app{ grid-template-columns:1fr; } .rail{ display:none; } }

/* ════════════════════════════════════════
   SURFACE: home.html
   ════════════════════════════════════════ */

/* ---- home.html :: style block 0 ---- */
/* ════════════════════════════════════════════════════════════════
   HOME — CANON. Locked: H-B ranked launcher hero (ADR-0023) +
   "Start with a template" strip below it, ALWAYS — one state, no
   project cards on Home; Projects owns all status (ADR-0029,
   supersedes 0028's two-state rule).
   ════════════════════════════════════════════════════════════════ */
/* ░ DS ALIAS LAYER — copied verbatim from url-to-ad-assembled.html (§4c) ░ */
:root {
  --font-display: var(--amp-hexcoded-font-display);
  --font-body:    var(--amp-hexcoded-font-body);
  --font-mono:    var(--amp-hexcoded-font-mono);
  --green-50:  var(--amp-hexcoded-theme-color-accent-whisper);
  --green-100: var(--amp-hexcoded-color-green-100);
  --green-200: color-mix(in srgb, var(--amp-hexcoded-theme-color-accent) 28%, var(--amp-hexcoded-color-white));
  --green-300: var(--amp-hexcoded-theme-color-accent-light);
  --green-400: color-mix(in srgb, var(--amp-hexcoded-theme-color-accent) 72%, var(--amp-hexcoded-color-white));
  --green-500: var(--amp-hexcoded-theme-color-accent);
  --green-600: var(--amp-hexcoded-theme-color-accent-deep);
  --green-700: color-mix(in srgb, var(--amp-hexcoded-theme-color-accent-deep) 80%, var(--amp-hexcoded-color-black));
  --green-800: color-mix(in srgb, var(--amp-hexcoded-theme-color-accent-deep) 62%, var(--amp-hexcoded-color-black));
  --ink-100:  var(--amp-hexcoded-theme-color-bg-soft);
  --ink-400:  color-mix(in srgb, var(--amp-hexcoded-theme-color-bg-elev) 58%, var(--amp-hexcoded-theme-color-text-primary));
  --ink-500:  var(--amp-hexcoded-theme-color-text-tertiary);
  --ink-600:  color-mix(in srgb, var(--amp-hexcoded-theme-color-text-tertiary) 60%, var(--amp-hexcoded-theme-color-text-primary));
  --ink-700:  var(--amp-hexcoded-theme-color-text-secondary);
  --ink-900:  color-mix(in srgb, var(--amp-hexcoded-theme-color-text-primary) 88%, var(--amp-hexcoded-theme-color-bg-elev));
  --ink-1000: var(--amp-hexcoded-theme-color-text-primary);
  --bg-canvas:   var(--amp-hexcoded-theme-color-bg);
  --bg-surface:  var(--amp-hexcoded-theme-color-bg-elev);
  --bg-soft:     var(--amp-hexcoded-theme-color-bg-soft);
  --hairline:        color-mix(in srgb, var(--amp-hexcoded-theme-color-border) 60%, transparent);
  --hairline-strong: var(--amp-hexcoded-theme-color-border);
  --glass-bg-strong: color-mix(in srgb, var(--amp-hexcoded-theme-color-bg-elev) 88%, transparent);
  --glass-blur:      blur(20px) saturate(180%);
  --shadow-xs: var(--amp-hexcoded-shadow-1);
  --shadow-sm: var(--amp-hexcoded-shadow-2);
  --shadow-md: var(--amp-hexcoded-shadow-3);
  --shadow-green:      0 12px 32px color-mix(in srgb, var(--amp-hexcoded-theme-color-accent) 24%, transparent), 0 4px 8px color-mix(in srgb, var(--amp-hexcoded-theme-color-accent) 12%, transparent);
  --shadow-green-soft: 0 8px 20px color-mix(in srgb, var(--amp-hexcoded-theme-color-accent) 14%, transparent);
  --r-sm:   var(--amp-hexcoded-radius-md);
  --r-md:   var(--amp-hexcoded-radius-lg);
  --r-lg:   var(--amp-hexcoded-radius-xl);
  --r-xl:   var(--amp-hexcoded-radius-2xl);
  --r-pill: var(--amp-hexcoded-radius-full);
  --d-fast:     var(--amp-hexcoded-motion-d-fast);
  --d-base:     var(--amp-hexcoded-motion-d-base);
  --warning: var(--amp-hexcoded-status-warning);
  --accent-soft:        color-mix(in srgb, var(--green-500) 9%, var(--bg-surface));
  --accent-soft-strong: color-mix(in srgb, var(--green-500) 15%, var(--bg-surface));
  --accent-border:      color-mix(in srgb, var(--green-500) 30%, var(--hairline));
  --hover-surface-2: color-mix(in srgb, var(--ink-1000) 4%, transparent);
  --media-well: #0a0a0c;
}
*,*::before,*::after{box-sizing:border-box;}
html,body{height:100%;}
body{margin:0;font-family:var(--font-body);color:var(--ink-900);background:var(--bg-canvas);font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased;}
button{font-family:inherit;cursor:pointer;}
a{color:inherit;}

/* ── PHANTOM wordmark (exact render-ds spec — do not modify) ── */
.hexwm{position:relative;display:inline-block;font-family:var(--font-display);font-weight:900;letter-spacing:-.025em;color:var(--ink-1000);z-index:0;isolation:isolate;}
.hexwm::before,.hexwm::after,.hexwm .ph{content:attr(data-text);position:absolute;left:0;top:0;color:#22C55E;z-index:-1;}
.hexwm::before{transform:translate(1px,1px);opacity:.85;--ph:.85;animation:hexph 3s ease-in-out infinite;}
.hexwm .ph{transform:translate(2px,2px);opacity:.55;--ph:.55;animation:hexph 3s ease-in-out infinite .1s;}
.hexwm::after{transform:translate(3px,3px);opacity:.32;--ph:.32;animation:hexph 3s ease-in-out infinite .2s;}
@keyframes hexph{0%,100%{opacity:var(--ph,.85);}50%{opacity:calc(var(--ph,.85)*.4);}}
@media (prefers-reduced-motion:reduce){.hexwm::before,.hexwm::after,.hexwm .ph{animation:none;}}

/* ════ APP SHELL ════ */
.app{display:grid;grid-template-columns:236px 1fr;height:100vh;}
.rail{border-right:1px solid var(--hairline);background:var(--bg-surface);display:flex;flex-direction:column;padding:18px 12px 14px;overflow-y:auto;}
.rail-logo{display:block;padding:4px 10px 18px;text-decoration:none;}
.rail-logo .hexwm{font-size:19px;}
.rail-item{display:flex;align-items:center;gap:11px;width:100%;padding:9px 12px;border-radius:var(--r-md);border:none;background:transparent;color:var(--ink-700);font-size:13.5px;font-weight:600;text-align:left;transition:background var(--d-fast),color var(--d-fast);}
.rail-item:hover{background:var(--hover-surface-2);}
.rail-item.on{background:var(--accent-soft-strong);color:var(--green-700);}
.rail-item svg{width:18px;height:18px;flex-shrink:0;}
.rail-item .rl-s{display:block;font-size:10.5px;font-weight:500;color:var(--ink-500);margin-top:1px;}
.tools-lab{font-family:var(--font-mono);font-size:9.5px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-400);padding:18px 12px 7px;}
.rail-spacer{flex:1;}
.rail-foot{border-top:1px solid var(--hairline);padding-top:10px;margin-top:10px;display:flex;flex-direction:column;gap:2px;}

/* ════ MAIN + HEADER ════ */
.main{display:flex;flex-direction:column;min-width:0;overflow-y:auto;}
.hdr{position:sticky;top:0;z-index:20;height:58px;flex-shrink:0;display:flex;align-items:center;gap:14px;padding:0 22px;background:var(--glass-bg-strong);backdrop-filter:var(--glass-blur);-webkit-backdrop-filter:var(--glass-blur);border-bottom:1px solid var(--hairline);justify-content:flex-end;}
.brand-pick{display:inline-flex;align-items:center;gap:9px;padding:6px 11px 6px 7px;border-radius:var(--r-pill);border:1px solid var(--hairline);background:var(--bg-surface);transition:all var(--d-fast);}
.brand-pick:hover{background:var(--hover-surface-2);border-color:var(--hairline-strong);}
.brand-pick .bdot{width:26px;height:26px;border-radius:50%;background:linear-gradient(135deg,var(--green-400),var(--green-700));color:#fff;font-weight:700;font-size:12px;display:inline-flex;align-items:center;justify-content:center;}
.brand-pick .blab{display:flex;flex-direction:column;line-height:1.1;text-align:left;}
.brand-pick .blab .k{font-size:9px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-500);}
.brand-pick .blab .v{font-size:12.5px;font-weight:600;color:var(--ink-900);}
.brand-pick svg{width:15px;height:15px;color:var(--ink-500);}
.credits{display:inline-flex;align-items:center;gap:7px;padding:7px 13px;border-radius:var(--r-pill);background:var(--green-50);border:1px solid var(--green-200);font-size:12.5px;font-weight:600;color:var(--green-800);}
.credits .coin{color:var(--green-600);}
.credits .muted{color:var(--green-700);font-weight:500;opacity:.8;}
.theme-ic{width:32px;height:32px;border-radius:50%;border:1px solid var(--hairline-strong);background:var(--bg-surface);color:var(--ink-700);font-size:14px;display:inline-flex;align-items:center;justify-content:center;}
.page{max-width:1180px;width:100%;margin:0 auto;padding:32px 36px 90px;}

/* ════ HERO — H-B locked (ADR-0023) ════ */
.hc-hero{position:relative;overflow:hidden;border-radius:var(--r-xl);padding:50px 46px 44px;border:1px solid var(--hairline);background:radial-gradient(120% 140% at 12% -10%,color-mix(in srgb,var(--green-500) 22%,transparent) 0%,transparent 46%),radial-gradient(100% 130% at 96% 8%,color-mix(in srgb,var(--green-500) 14%,transparent) 0%,transparent 50%),var(--bg-surface);box-shadow:var(--shadow-sm);}
.hc-hero::after{content:"";position:absolute;inset:0;pointer-events:none;background:radial-gradient(60% 80% at 80% 120%,color-mix(in srgb,var(--green-500) 10%,transparent),transparent 70%);opacity:.9;animation:hc-drift 14s ease-in-out infinite alternate;}
@keyframes hc-drift{from{transform:translate3d(-3%,2%,0) scale(1);}to{transform:translate3d(4%,-3%,0) scale(1.08);}}
@media (prefers-reduced-motion:reduce){.hc-hero::after,.choose-tile{animation:none!important;transition:none!important;}}
.hc-hero>*{position:relative;z-index:1;}
.hc-eyebrow{display:inline-flex;align-items:center;gap:8px;font-family:var(--font-mono);font-size:10.5px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--green-700);}
[data-theme="dark"] .hc-eyebrow{color:var(--green-300);}
.hc-eyebrow .pulse{width:7px;height:7px;border-radius:50%;background:var(--green-500);box-shadow:0 0 0 0 color-mix(in srgb,var(--green-500) 50%,transparent);animation:hc-pulse 2.2s ease-out infinite;}
@keyframes hc-pulse{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--green-500) 45%,transparent);}70%{box-shadow:0 0 0 9px transparent;}100%{box-shadow:0 0 0 0 transparent;}}
@media (prefers-reduced-motion:reduce){.hc-eyebrow .pulse{animation:none;}}
.hc-hero h1{font-family:var(--font-display);font-size:44px;font-weight:800;letter-spacing:-.035em;line-height:1.05;margin:16px 0 0;color:var(--ink-1000);max-width:18ch;}
.hc-hero h1 em{font-style:normal;background:linear-gradient(120deg,var(--green-500),var(--green-700));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;}
.hc-hero .lede{font-size:15px;color:var(--ink-600);margin:16px 0 0;max-width:56ch;line-height:1.6;}
.hc-speed{display:inline-flex;align-items:center;gap:7px;margin-top:18px;padding:6px 13px;border-radius:var(--r-pill);background:var(--accent-soft);border:1px solid var(--accent-border);font-size:12.5px;font-weight:600;color:var(--green-700);}
[data-theme="dark"] .hc-speed{color:var(--green-300);}
.hc-speed svg{width:14px;height:14px;}
.choose-q{display:flex;align-items:center;gap:9px;margin:32px 0 14px;font-family:var(--font-display);font-size:18px;font-weight:700;letter-spacing:-.01em;color:var(--ink-1000);}
.choose-q .qn{width:24px;height:24px;border-radius:50%;background:var(--accent-soft-strong);color:var(--green-700);font-family:var(--font-mono);font-size:12px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;}
[data-theme="dark"] .choose-q .qn{color:var(--green-300);}
.choose-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:13px;}
.choose-tile{position:relative;text-align:left;cursor:pointer;display:flex;flex-direction:column;padding:19px 17px 16px;border-radius:var(--r-lg);border:1px solid var(--hairline-strong);background:var(--bg-surface);box-shadow:var(--shadow-xs);transition:transform var(--d-base),box-shadow var(--d-base),border-color var(--d-base),background var(--d-base);}
.choose-tile:hover{transform:translateY(-3px);box-shadow:var(--shadow-md);border-color:var(--green-400);background:color-mix(in srgb,var(--green-500) 4%,var(--bg-surface));}
.choose-tile .ti{width:42px;height:42px;border-radius:var(--r-md);display:inline-flex;align-items:center;justify-content:center;background:linear-gradient(135deg,var(--green-500),var(--green-700));color:#fff;box-shadow:var(--shadow-green-soft);margin-bottom:13px;}
.choose-tile .ti svg{width:20px;height:20px;}
.choose-tile .tn{font-family:var(--font-display);font-size:16px;font-weight:700;letter-spacing:-.01em;color:var(--ink-1000);}
.choose-tile .tx{font-size:11.5px;color:var(--ink-500);margin-top:4px;line-height:1.45;}
.choose-tile .fastest{position:absolute;right:13px;top:15px;font-family:var(--font-mono);font-size:8.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--green-700);background:var(--green-100);border-radius:var(--r-pill);padding:3px 8px;}
.custom-line{margin-top:18px;font-size:13px;color:var(--ink-600);}
.custom-line a{color:var(--green-600);font-weight:600;text-decoration:none;display:inline-flex;align-items:center;gap:4px;}
[data-theme="dark"] .custom-line a{color:var(--green-300);}
.custom-line a svg{width:13px;height:13px;}

/* ════ BELOW THE HERO ════ */
.below{margin-top:40px;}
.sec-label{font-family:var(--font-mono);font-size:10.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-500);margin:0 0 16px;display:flex;align-items:center;gap:10px;}
.sec-label .gl{flex:1;height:1px;background:var(--hairline);}
.sec-label .more{font-family:var(--font-body);font-size:12px;font-weight:600;letter-spacing:0;text-transform:none;color:var(--green-600);cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;gap:3px;}
[data-theme="dark"] .sec-label .more{color:var(--green-300);}
.sec-label .more svg{width:13px;height:13px;}
.sec-label .note{font-family:var(--font-body);font-weight:600;font-size:11.5px;letter-spacing:0;text-transform:none;color:var(--ink-500);margin-left:2px;}

/* E1 template strip — LOCKED label "Start with a template", no browse-all link (ADR-0028/0029) */
.tplrow{display:grid;grid-template-columns:repeat(8,1fr);gap:12px;}
.tpl{border:1px solid var(--hairline);border-radius:var(--r-lg);overflow:hidden;background:var(--bg-surface);cursor:pointer;box-shadow:var(--shadow-xs);transition:all var(--d-base);}
.tpl:hover{transform:translateY(-3px);box-shadow:var(--shadow-md);border-color:var(--green-400);}
.tpl .tthumb{position:relative;aspect-ratio:9/13;background:var(--media-well);}
.tpl .tthumb .grade{position:absolute;inset:0;background:linear-gradient(180deg,transparent 35%,rgba(0,0,0,.55));}
.tpl .tthumb .tcap{position:absolute;left:10px;right:10px;bottom:10px;color:#fff;font-family:var(--font-display);font-weight:800;font-size:13px;line-height:1.2;letter-spacing:-.01em;text-shadow:0 2px 10px rgba(0,0,0,.6);}
.tpl .tthumb .use{position:absolute;left:50%;top:42%;transform:translate(-50%,-50%) scale(.92);opacity:0;transition:all var(--d-fast);display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:700;color:var(--ink-1000);background:rgba(255,255,255,.94);border-radius:var(--r-pill);padding:7px 14px;box-shadow:var(--shadow-sm);white-space:nowrap;}
.tpl:hover .use{opacity:1;transform:translate(-50%,-50%) scale(1);}
.tpl .tfoot{padding:9px 12px 11px;font-size:11px;color:var(--ink-500);}
.tg-a{background:linear-gradient(160deg,#13321f,#0a0a0c 75%);}
.tg-b{background:linear-gradient(160deg,#1a1410,#0a0a0c);}
.tg-c{background:linear-gradient(160deg,#101a2e,#0a0a0c);}
.tg-d{background:linear-gradient(160deg,#2e1018,#0a0a0c);}
.tg-e{background:linear-gradient(160deg,#231030,#0a0a0c);}

@media(max-width:1080px){.choose-grid{grid-template-columns:repeat(2,1fr);}.tplrow{grid-template-columns:repeat(3,1fr);}.app{grid-template-columns:200px 1fr;}}

/* ════════════════════════════════════════
   SURFACE: settings.html
   ════════════════════════════════════════ */

/* ---- settings.html :: style block 0 ---- */
/* ── DS ALIAS LAYER — verbatim from canon (ADR-0002). Pure var()/color-mix; no token hex. ── */
:root{
  --font-display:var(--amp-hexcoded-font-display); --font-body:var(--amp-hexcoded-font-body); --font-mono:var(--amp-hexcoded-font-mono);
  --green-50:var(--amp-hexcoded-theme-color-accent-whisper); --green-100:var(--amp-hexcoded-color-green-100);
  --green-200:color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 28%,var(--amp-hexcoded-color-white));
  --green-300:var(--amp-hexcoded-theme-color-accent-light); --green-400:color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 72%,var(--amp-hexcoded-color-white));
  --green-500:var(--amp-hexcoded-theme-color-accent); --green-600:var(--amp-hexcoded-theme-color-accent-deep);
  --green-700:color-mix(in srgb,var(--amp-hexcoded-theme-color-accent-deep) 80%,var(--amp-hexcoded-color-black));
  --green-800:color-mix(in srgb,var(--amp-hexcoded-theme-color-accent-deep) 62%,var(--amp-hexcoded-color-black));
  --ink-0:var(--amp-hexcoded-theme-color-bg-elev); --ink-50:var(--amp-hexcoded-theme-color-bg); --ink-100:var(--amp-hexcoded-theme-color-bg-soft);
  --ink-400:color-mix(in srgb,var(--amp-hexcoded-theme-color-bg-elev) 58%,var(--amp-hexcoded-theme-color-text-primary));
  --ink-500:var(--amp-hexcoded-theme-color-text-tertiary);
  --ink-600:color-mix(in srgb,var(--amp-hexcoded-theme-color-text-tertiary) 60%,var(--amp-hexcoded-theme-color-text-primary));
  --ink-700:var(--amp-hexcoded-theme-color-text-secondary);
  --ink-800:color-mix(in srgb,var(--amp-hexcoded-theme-color-text-secondary) 45%,var(--amp-hexcoded-theme-color-text-primary));
  --ink-900:color-mix(in srgb,var(--amp-hexcoded-theme-color-text-primary) 88%,var(--amp-hexcoded-theme-color-bg-elev));
  --ink-1000:var(--amp-hexcoded-theme-color-text-primary);
  --bg-canvas:var(--amp-hexcoded-theme-color-bg); --bg-surface:var(--amp-hexcoded-theme-color-bg-elev); --bg-soft:var(--amp-hexcoded-theme-color-bg-soft);
  --hairline:color-mix(in srgb,var(--amp-hexcoded-theme-color-border) 60%,transparent); --hairline-strong:var(--amp-hexcoded-theme-color-border);
  --glass-bg-strong:color-mix(in srgb,var(--amp-hexcoded-theme-color-bg-elev) 88%,transparent); --glass-blur:blur(20px) saturate(180%);
  --shadow-xs:var(--amp-hexcoded-shadow-1); --shadow-sm:var(--amp-hexcoded-shadow-2); --shadow-md:var(--amp-hexcoded-shadow-3); --shadow-lg:var(--amp-hexcoded-shadow-4); --shadow-xl:var(--amp-hexcoded-shadow-5);
  --shadow-green-soft:0 8px 20px color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 14%,transparent); --shadow-green:0 12px 32px color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 24%,transparent),0 4px 8px color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 12%,transparent);
  --r-sm:var(--amp-hexcoded-radius-md); --r-md:var(--amp-hexcoded-radius-lg); --r-lg:var(--amp-hexcoded-radius-xl); --r-xl:var(--amp-hexcoded-radius-2xl); --r-pill:var(--amp-hexcoded-radius-full);
  --ease-out:var(--amp-hexcoded-motion-ease); --d-fast:var(--amp-hexcoded-motion-d-fast); --d-base:var(--amp-hexcoded-motion-d-base); --d-slow:var(--amp-hexcoded-motion-d-slow);
  --accent-soft:color-mix(in srgb,var(--green-500) 9%,var(--bg-surface)); --accent-border:color-mix(in srgb,var(--green-500) 30%,var(--hairline));
  --accent-chip-bg:var(--green-100); --accent-chip-ink:var(--green-700); --sel-bg:var(--accent-soft); --sel-border:var(--green-500); --sel-ring-2:0 0 0 2px color-mix(in srgb,var(--green-500) 16%,transparent);
  --focus-ring:0 0 0 3px color-mix(in srgb,var(--green-500) 14%,transparent); --media-well:#0a0a0c; --seg-track:var(--ink-100); --seg-thumb:var(--bg-surface);
  --danger:var(--amp-hexcoded-status-danger); --hover-surface:color-mix(in srgb,var(--ink-1000) 6%,transparent);
}
[data-theme="dark"]{ --seg-track:var(--bg-surface); --accent-chip-bg:color-mix(in srgb,var(--green-500) 16%,var(--bg-surface)); --accent-chip-ink:var(--green-300); }
*,*::before,*::after{ box-sizing:border-box; } html,body{ height:100%; margin:0; }
body{ font-family:var(--font-body); color:var(--ink-900); background:var(--bg-canvas); -webkit-font-smoothing:antialiased; }
button,input,textarea,select{ font-family:inherit; }
.hexwm{ position:relative; display:inline-block; font-family:Outfit,sans-serif; font-weight:900; letter-spacing:-0.025em; line-height:1; color:var(--ink-1000); isolation:isolate; }
.hexwm::before,.hexwm::after,.hexwm .ph{ content:attr(data-text); position:absolute; left:0; top:0; color:#22C55E; z-index:-1; }
.hexwm::before{ transform:translate(1px,1px); opacity:.85; --ph:.85; animation:hexph 3s ease-in-out infinite; }
.hexwm .ph{ transform:translate(2px,2px); opacity:.55; --ph:.55; animation:hexph 3s ease-in-out infinite .1s; }
.hexwm::after{ transform:translate(3px,3px); opacity:.32; --ph:.32; animation:hexph 3s ease-in-out infinite .2s; }
@keyframes hexph{ 0%,100%{opacity:var(--ph,.85)} 50%{opacity:calc(var(--ph,.85)*.4)} }
@media (prefers-reduced-motion:reduce){ .hexwm::before,.hexwm::after,.hexwm .ph{animation:none!important} }
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:7px; height:38px; padding:0 15px; border-radius:var(--r-pill); font-size:13px; font-weight:600; border:1px solid var(--hairline-strong); background:var(--bg-surface); color:var(--ink-800); cursor:pointer; transition:all var(--d-fast); white-space:nowrap; }
.btn:hover{ background:var(--ink-100); color:var(--ink-1000); } .btn svg{ width:15px; height:15px; }
.btn-primary{ background:linear-gradient(135deg,var(--amp-hexcoded-theme-color-accent),var(--amp-hexcoded-theme-color-accent-deep)); color:#fff; border:none; box-shadow:var(--shadow-green-soft); }
.btn-primary:hover{ background:linear-gradient(135deg,var(--amp-hexcoded-theme-color-accent-deep),var(--green-700)); color:#fff; box-shadow:var(--shadow-green); }
.btn-primary:disabled{ opacity:.45; cursor:not-allowed; box-shadow:none; }
.btn-ghost{ border:1px solid transparent; background:transparent; color:var(--ink-700); } .btn-ghost:hover{ background:var(--ink-100); color:var(--ink-1000); }
.btn-sm{ height:31px; padding:0 12px; font-size:12px; } .btn-lg{ height:46px; padding:0 20px; font-size:14px; }
.btn-danger{ color:#fff; background:var(--danger); border:none; } .btn-danger:hover{ filter:brightness(.94); color:#fff; } .btn-danger:disabled{ opacity:.4; cursor:not-allowed; }
.theme-switcher{ display:inline-flex; align-items:center; background:var(--seg-track); border-radius:var(--r-pill); padding:3px; gap:2px; }
.theme-switcher button{ border:none; background:transparent; cursor:pointer; border-radius:var(--r-pill); font-weight:600; color:var(--ink-600); padding:6px 11px; font-size:11.5px; }
.theme-switcher button.on{ background:var(--seg-thumb); color:var(--ink-1000); box-shadow:var(--shadow-xs); }

/* ════ SHELL ════ */
.shell{ height:100vh; display:flex; flex-direction:column; }
.topbar{ height:56px; flex-shrink:0; display:flex; align-items:center; gap:12px; padding:0 22px; border-bottom:1px solid var(--hairline); background:var(--glass-bg-strong); backdrop-filter:var(--glass-blur); z-index:20; }
.topbar .wm{ font-size:16px; } .topbar .crumb{ font-size:13.5px; font-weight:600; color:var(--ink-600); display:flex; align-items:center; gap:9px; } .topbar .crumb .sl{ color:var(--ink-400); } .topbar .spacer{ flex:1; }
.setwrap{ flex:1; display:grid; grid-template-columns:286px 1fr; min-height:0; }
.setnav{ border-right:1px solid var(--hairline); padding:18px 16px 16px; overflow-y:auto; background:var(--bg-surface); display:flex; flex-direction:column; }
.navsp{ flex:1; }
.wsswitch{ position:relative; }
.wsbtn{ display:flex; align-items:center; gap:10px; width:100%; padding:9px 11px; border:1px solid var(--hairline); border-radius:var(--r-md); background:var(--bg-surface); cursor:pointer; text-align:left; transition:all var(--d-fast); }
.wsbtn:hover{ border-color:var(--hairline-strong); background:var(--ink-50); }
.wsbtn .bd{ width:30px; height:30px; border-radius:8px; background:linear-gradient(135deg,var(--green-400),var(--green-700)); color:#fff; font-weight:700; font-size:13px; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
.wsbtn .bl{ display:flex; flex-direction:column; line-height:1.15; min-width:0; } .wsbtn .bl .k{ font-size:9px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-500); } .wsbtn .bl .v{ font-size:13.5px; font-weight:700; color:var(--ink-1000); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .wsbtn .cv{ margin-left:auto; color:var(--ink-500); width:16px; height:16px; flex-shrink:0; }
.wsmenu{ display:none; position:absolute; top:calc(100% + 6px); left:0; right:0; background:var(--bg-surface); border:1px solid var(--hairline-strong); border-radius:var(--r-md); box-shadow:var(--shadow-lg); padding:6px; z-index:40; }
.wsmenu.on{ display:block; animation:pop var(--d-fast) var(--ease-out); } @keyframes pop{ from{opacity:0; transform:translateY(-4px)} to{opacity:1; transform:none} }
.wsmenu .mh{ font-size:9px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-500); padding:6px 8px 4px; }
.wsmenu .mi{ display:flex; align-items:center; gap:9px; padding:8px; border-radius:var(--r-sm); cursor:pointer; } .wsmenu .mi:hover{ background:var(--hover-surface); } .wsmenu .mi .bd{ width:24px; height:24px; border-radius:6px; font-size:11px; background:linear-gradient(135deg,var(--green-400),var(--green-700)); color:#fff; font-weight:700; display:inline-flex; align-items:center; justify-content:center; }
.wsmenu .mi .nm{ font-size:13px; font-weight:600; color:var(--ink-1000); } .wsmenu .mi .ds{ font-size:10.5px; color:var(--ink-500); }
.wsmenu .mi.on{ background:var(--accent-soft); } .wsmenu .add{ display:flex; align-items:center; gap:8px; padding:8px; border-top:1px solid var(--hairline); margin-top:4px; color:var(--green-700); font-size:12.5px; font-weight:600; cursor:pointer; } .wsmenu .add svg{ width:15px; height:15px; }
.wscredits{ display:flex; align-items:center; gap:8px; margin:11px 2px 18px; padding:9px 12px; border-radius:var(--r-pill); background:var(--green-50); border:1px solid var(--green-200); font-size:12.5px; font-weight:600; color:var(--green-800); } .wscredits .coin{ color:var(--green-600); } .wscredits .muted{ color:var(--green-700); opacity:.8; font-weight:500; } .wscredits .add{ margin-left:auto; color:var(--green-700); cursor:pointer; font-weight:700; }
.navgroup{ margin-bottom:14px; } .nl{ font-family:var(--font-mono); font-size:9px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--ink-400); padding:6px 10px; }
.navitem{ display:flex; align-items:center; gap:11px; width:100%; padding:0 11px; height:38px; border-radius:var(--r-md); border:none; background:transparent; cursor:pointer; color:var(--ink-700); font-size:13.5px; font-weight:600; text-align:left; }
.navitem:hover{ background:var(--hover-surface); color:var(--ink-1000); } .navitem.on{ background:color-mix(in srgb,var(--green-500) 14%,var(--bg-surface)); color:var(--green-700); } [data-theme="dark"] .navitem.on{ color:var(--green-300); } .navitem svg{ width:18px; height:18px; flex-shrink:0; } .navitem .sb{ margin-left:auto; font-size:10px; font-weight:700; color:var(--ink-500); background:var(--ink-100); border-radius:var(--r-pill); padding:1px 7px; }
.navfoot{ border-top:1px solid var(--hairline); padding-top:10px; margin-top:10px; }

/* pane */
.setpane{ overflow-y:auto; background:var(--bg-soft); }
.pane{ max-width:680px; margin:0 auto; padding:40px 34px 64px; animation:fade var(--d-base) var(--ease-out); } @keyframes fade{ from{opacity:0; transform:translateY(6px)} to{opacity:1; transform:none} }
.pane-h{ margin-bottom:6px; display:flex; align-items:flex-start; gap:14px; } .pane-h .ph-l{ flex:1; } .pane-h h2{ font-family:var(--font-display); font-size:23px; font-weight:800; letter-spacing:-.02em; color:var(--ink-1000); margin:0; } .pane-h .sub{ font-size:13px; color:var(--ink-600); margin-top:6px; line-height:1.5; }
.backlink{ display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:600; color:var(--ink-600); background:none; border:none; cursor:pointer; margin-bottom:10px; padding:0; } .backlink:hover{ color:var(--ink-1000); } .backlink svg{ width:14px; height:14px; }

/* ── THE CARD (registry-surface container law: ONE quiet style, no shadows, no nesting) ── */
.card{ background:var(--bg-surface); border:1px solid var(--hairline); border-radius:var(--r-lg); margin-top:16px; }
.card-h{ display:flex; align-items:center; gap:10px; padding:12px 20px; border-bottom:1px solid var(--hairline); font-family:var(--font-mono); font-size:10px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-500); }
.card-h .r{ margin-left:auto; font-family:var(--font-body); text-transform:none; letter-spacing:0; display:flex; align-items:center; gap:9px; font-weight:600; }
.card-b{ padding:2px 20px; }
.card-b.pad{ padding:18px 20px; }
.cards2{ display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:16px; } .cards2 .card{ margin-top:0; }
.frow{ display:flex; align-items:center; gap:18px; padding:15px 0; border-bottom:1px solid var(--hairline); }
.frow:last-child{ border-bottom:none; } .frow .fl{ min-width:0; flex:1; } .frow .fl .t{ font-size:13.5px; font-weight:600; color:var(--ink-1000); } .frow .fl .h{ font-size:12px; color:var(--ink-500); margin-top:3px; line-height:1.45; } .frow .fc{ flex-shrink:0; display:flex; align-items:center; gap:9px; }
.frow.col{ flex-direction:column; align-items:stretch; gap:10px; }
.frow.lnkrow{ cursor:pointer; } .frow.lnkrow:hover .t{ color:var(--green-700); } .frow.lnkrow .chev{ color:var(--ink-400); width:17px; height:17px; }
.inp{ height:40px; padding:0 13px; border:1px solid var(--hairline-strong); border-radius:var(--r-md); background:var(--bg-surface); font-size:13.5px; color:var(--ink-1000); outline:none; min-width:230px; transition:all var(--d-fast); } .inp:focus{ border-color:var(--green-500); box-shadow:var(--focus-ring); } .inp::placeholder{ color:var(--ink-400); } .inp.ro{ background:var(--ink-50); color:var(--ink-600); }
.inp.wide{ width:100%; min-width:0; }
textarea.inp{ height:auto; padding:11px 13px; resize:vertical; }
.sw{ position:relative; width:42px; height:24px; border-radius:var(--r-pill); background:var(--ink-100); border:1px solid var(--hairline-strong); cursor:pointer; transition:all var(--d-fast); flex-shrink:0; } .sw::after{ content:""; position:absolute; top:2px; left:2px; width:18px; height:18px; border-radius:50%; background:#fff; box-shadow:var(--shadow-xs); transition:all var(--d-fast); } .sw.on{ background:var(--green-500); border-color:var(--green-500); } .sw.on::after{ left:20px; }
.tbl{ width:100%; border-collapse:collapse; font-size:13px; } .tbl th{ text-align:left; font-size:9.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-500); padding:11px 8px; border-bottom:1px solid var(--hairline); } .tbl td{ padding:12px 8px; border-bottom:1px solid var(--hairline); color:var(--ink-900); vertical-align:middle; } .tbl tr:last-child td{ border-bottom:none; }
.tag{ display:inline-flex; align-items:center; font-size:11px; font-weight:600; padding:3px 9px; border-radius:var(--r-pill); } .tag.ok{ color:var(--green-700); background:var(--green-50); border:1px solid var(--green-200); } .tag.muted{ color:var(--ink-600); background:var(--ink-100); }
.lnk{ color:var(--green-700); font-weight:600; cursor:pointer; font-size:12.5px; }

/* ── MEMBERS: one strict grid — Person · Role(118) · Actions(96) — shared by members + pending ── */
.mrow{ display:grid; grid-template-columns:minmax(0,1fr) 118px 96px; gap:12px; align-items:center; padding:11px 0; border-bottom:1px solid var(--hairline); }
.mrow:last-child{ border-bottom:none; }
.mrow .cell{ position:relative; min-width:0; } .mrow .cell.end{ text-align:right; }
.who{ display:inline-flex; align-items:center; gap:10px; min-width:0; } .who .av{ width:28px; height:28px; border-radius:50%; color:#fff; font-weight:700; font-size:11px; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; } .who .nm{ font-weight:600; color:var(--ink-1000); font-size:13px; } .who .em{ font-size:11px; color:var(--ink-500); }
.rolebtn{ display:flex; align-items:center; justify-content:space-between; width:100%; font-size:11.5px; font-weight:600; padding:5px 10px; border-radius:var(--r-pill); color:var(--ink-700); background:var(--ink-100); border:none; cursor:pointer; } .rolebtn:hover{ background:var(--hover-surface); color:var(--ink-1000); } .rolebtn svg{ width:12px; height:12px; color:var(--ink-500); flex-shrink:0; }
.rolebtn.static{ cursor:default; } .rolebtn.static:hover{ background:var(--ink-100); color:var(--ink-700); } .rolebtn.static svg{ visibility:hidden; }
.dots{ background:none; border:none; cursor:pointer; color:var(--ink-400); display:inline-flex; padding:4px; border-radius:var(--r-sm); } .dots:hover{ background:var(--hover-surface); color:var(--ink-1000); } .dots svg{ width:16px; height:16px; }
.subhead{ font-family:var(--font-mono); font-size:9px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-400); padding:14px 0 4px; border-bottom:1px solid var(--hairline); }
.menu{ position:absolute; z-index:60; min-width:230px; background:var(--bg-surface); border:1px solid var(--hairline-strong); border-radius:var(--r-md); box-shadow:var(--shadow-lg); padding:5px; animation:pop var(--d-fast) var(--ease-out); }
.menu .mi{ display:flex; flex-direction:column; gap:2px; padding:8px 10px; border-radius:var(--r-sm); cursor:pointer; } .menu .mi:hover{ background:var(--hover-surface); } .menu .mi .mt{ font-size:12.5px; font-weight:600; color:var(--ink-1000); display:flex; align-items:center; gap:7px; } .menu .mi .mt svg{ width:13px; height:13px; color:var(--green-600); } .menu .mi .md{ font-size:11px; color:var(--ink-500); line-height:1.4; }
.menu .mi.sel .mt{ color:var(--green-700); } .menu .mi.danger .mt{ color:var(--danger); }
.menu .msep{ height:1px; background:var(--hairline); margin:4px 6px; }

/* billing */
.pn{ font-family:var(--font-display); font-size:17px; font-weight:800; color:var(--ink-1000); display:flex; align-items:center; gap:9px; } .pp{ font-size:12.5px; color:var(--ink-600); margin-top:5px; } .pp b{ color:var(--ink-900); }
.usemeter{ margin-top:14px; } .usemeter .ut{ display:flex; font-size:11.5px; color:var(--ink-600); margin-bottom:6px; } .usemeter .ut b{ margin-left:auto; color:var(--ink-1000); } .usemeter .bar{ height:6px; border-radius:4px; background:var(--ink-100); overflow:hidden; } .usemeter .bar i{ display:block; height:100%; background:linear-gradient(90deg,var(--green-500),var(--green-600)); border-radius:4px; }
.balnum{ font-family:var(--font-display); font-weight:800; font-size:24px; color:var(--ink-1000); } .balsub{ font-size:11.5px; color:var(--ink-500); margin-top:4px; }
.lowwarn{ display:flex; align-items:center; gap:10px; margin-top:13px; padding:11px 13px; border-radius:var(--r-md); background:color-mix(in srgb,var(--danger) 7%,var(--bg-surface)); border:1px solid color-mix(in srgb,var(--danger) 25%,transparent); font-size:12px; color:color-mix(in srgb,var(--danger) 70%,var(--ink-1000)); } .lowwarn svg{ width:15px; height:15px; flex-shrink:0; }
/* integrations — list rows inside one card (grid rejected in review) */
.intg{ display:flex; align-items:center; gap:13px; padding:13px 0; border-bottom:1px solid var(--hairline); } .intg:last-child{ border-bottom:none; }
.ilogo{ width:38px; height:38px; border-radius:9px; background:var(--ink-50); border:1px solid var(--hairline); display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; } .ilogo svg{ width:21px; height:21px; }
.intg .it{ flex:1; min-width:0; } .intg .n{ font-size:13.5px; font-weight:600; color:var(--ink-1000); } .intg .d{ font-size:12px; color:var(--ink-500); margin-top:2px; }
/* brand */
.logo-up{ display:flex; align-items:center; gap:16px; } .logo-box{ width:64px; height:64px; border-radius:var(--r-md); background:var(--ink-50); border:1px solid var(--hairline); display:flex; align-items:center; justify-content:center; font-family:Georgia,'Times New Roman',serif; font-weight:600; font-size:21px; color:var(--ink-1000); flex-shrink:0; }
.swrow{ display:inline-flex; gap:9px; align-items:center; } .sw-c{ width:30px; height:30px; border-radius:8px; border:1px solid var(--hairline-strong); cursor:pointer; } .sw-c.add{ background:transparent; border:1px dashed var(--hairline-strong); color:var(--ink-500); display:inline-flex; align-items:center; justify-content:center; } .sw-c.add svg{ width:14px; height:14px; }
.chips{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; } .chip{ display:inline-flex; align-items:center; gap:8px; padding:6px 11px; border-radius:var(--r-pill); background:var(--ink-50); border:1px solid var(--hairline-strong); font-size:12px; font-weight:600; color:var(--ink-700); } .chip .x{ cursor:pointer; color:var(--ink-500); display:inline-flex; } .chip .x svg{ width:12px; height:12px; } .chip.add{ background:transparent; border:1px dashed var(--hairline-strong); color:var(--ink-600); cursor:pointer; } .chip.add svg{ width:13px; height:13px; }
.misscard{ border-color:var(--accent-border); } .misscard .card-h{ border-bottom-color:var(--accent-border); color:var(--green-700); }
.misscount{ font-size:11px; font-weight:700; color:var(--green-700); background:var(--green-50); border:1px solid var(--green-200); border-radius:var(--r-pill); padding:3px 10px; }
.bsetup{ margin-top:16px; border:1px solid var(--hairline); border-radius:var(--r-lg); background:var(--bg-surface); padding:38px 36px; text-align:center; }
.bsetup .bi{ width:54px; height:54px; border-radius:var(--r-md); margin:0 auto 16px; background:linear-gradient(135deg,var(--green-500),var(--green-700)); color:#fff; display:flex; align-items:center; justify-content:center; box-shadow:var(--shadow-green-soft); } .bsetup .bi svg{ width:25px; height:25px; }
.bsetup .bt{ font-family:var(--font-display); font-size:19px; font-weight:800; color:var(--ink-1000); letter-spacing:-.02em; }
.bsetup .bs{ font-size:13px; color:var(--ink-600); margin:9px auto 20px; line-height:1.55; max-width:42ch; }
.bsetup .brow{ display:flex; gap:9px; max-width:430px; margin:0 auto; } .bsetup .brow .inp{ flex:1; min-width:0; height:46px; }
.bsetup .manual{ display:inline-block; margin-top:16px; font-size:12px; color:var(--ink-500); cursor:pointer; } .bsetup .manual:hover{ color:var(--ink-800); text-decoration:underline; }
.bbuild{ max-width:340px; margin:6px auto 0; text-align:left; }
.bbuild .li{ display:flex; align-items:center; gap:11px; padding:8px 2px; opacity:.35; transition:opacity var(--d-base); } .bbuild .li.on{ opacity:1; }
.bbuild .li .lc{ width:22px; height:22px; border-radius:50%; flex-shrink:0; border:1.5px solid var(--hairline-strong); display:inline-flex; align-items:center; justify-content:center; color:var(--ink-400); transition:all var(--d-base); } .bbuild .li .lc svg{ width:12px; height:12px; }
.bbuild .li.on .lc{ border-color:var(--green-500); background:var(--green-500); color:#fff; } .bbuild .li.busy .lc{ border-color:var(--green-400); border-top-color:transparent; background:transparent; color:transparent; animation:spin .7s linear infinite; }
.bbuild .li .lt{ font-size:13px; font-weight:600; color:var(--ink-1000); } .bbuild .li .ls{ font-size:11px; color:var(--ink-500); }
@keyframes spin{ to{transform:rotate(360deg)} }
.quiet-foot{ margin-top:54px; padding-top:14px; border-top:1px solid var(--hairline); font-size:12px; color:var(--ink-400); display:flex; gap:18px; }
.quiet-foot span{ cursor:pointer; } .quiet-foot span:hover{ color:var(--ink-700); text-decoration:underline; }
.note{ font-size:12px; color:var(--ink-500); margin-top:14px; line-height:1.5; display:flex; gap:8px; align-items:flex-start; } .note svg{ width:15px; height:15px; color:var(--ink-400); flex-shrink:0; margin-top:1px; }
/* sheet/modal */
.sheetwrap{ position:fixed; inset:0; display:none; align-items:center; justify-content:center; background:rgba(0,0,0,.42); z-index:95; padding:20px; } .sheetwrap.on{ display:flex; }
.sheet{ width:520px; max-width:100%; max-height:88vh; overflow-y:auto; background:var(--bg-surface); border:1px solid var(--hairline); border-radius:var(--r-lg); box-shadow:var(--shadow-xl); padding:24px 26px; animation:pop var(--d-base) var(--ease-out); }
.sheet .sh{ display:flex; align-items:center; margin-bottom:4px; } .sheet .sh .t{ font-family:var(--font-display); font-size:18px; font-weight:800; color:var(--ink-1000); } .sheet .sh .x{ margin-left:auto; border:none; background:transparent; cursor:pointer; color:var(--ink-500); padding:4px; } .sheet .sh .x svg{ width:18px; height:18px; }
.sheet .ss{ font-size:12.5px; color:var(--ink-600); margin-bottom:18px; line-height:1.5; }
.plancards{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.plancard{ position:relative; border:1.5px solid var(--hairline-strong); border-radius:var(--r-md); padding:18px; background:var(--bg-surface); text-align:left; }
.plancard.rec{ border-color:var(--sel-border); box-shadow:var(--sel-ring-2); }
.plancard .rectag{ position:absolute; top:-9px; left:14px; font-size:9px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:#fff; background:linear-gradient(135deg,var(--green-500),var(--green-600)); padding:3px 9px; border-radius:var(--r-pill); }
.plancard .pn2{ font-size:14px; font-weight:700; color:var(--ink-1000); } .plancard .pr{ font-family:var(--font-display); font-size:24px; font-weight:800; color:var(--ink-1000); margin-top:7px; } .plancard .pr span{ font-size:12px; font-weight:600; color:var(--ink-500); font-family:var(--font-body); }
.plancard ul{ list-style:none; padding:0; margin:12px 0 14px; } .plancard li{ font-size:12px; color:var(--ink-700); padding:3px 0; display:flex; gap:7px; align-items:center; } .plancard li svg{ width:12px; height:12px; color:var(--green-600); flex-shrink:0; }
.packs{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px; }
.pack{ border:1.5px solid var(--hairline-strong); border-radius:var(--r-md); padding:14px 12px; background:var(--bg-surface); cursor:pointer; text-align:center; transition:all var(--d-fast); }
.pack:hover{ border-color:var(--green-400); } .pack.on{ border-color:var(--sel-border); background:var(--sel-bg); box-shadow:var(--sel-ring-2); }
.pack .pc{ font-family:var(--font-display); font-weight:800; font-size:17px; color:var(--ink-1000); } .pack .pd{ font-size:11px; color:var(--ink-500); margin-top:3px; } .pack .pb{ font-size:10px; font-weight:700; color:var(--green-700); margin-top:4px; }
.toast{ position:fixed; left:50%; bottom:24px; transform:translateX(-50%) translateY(20px); opacity:0; z-index:110; display:flex; align-items:center; gap:11px; padding:13px 17px; border-radius:var(--r-lg); background:var(--ink-1000); color:var(--ink-0); box-shadow:var(--shadow-xl); transition:all var(--d-base) var(--ease-out); } [data-theme="dark"] .toast{ background:var(--bg-surface); color:var(--ink-1000); border:1px solid var(--hairline-strong); } .toast.on{ opacity:1; transform:translateX(-50%) translateY(0); } .toast .tic{ width:28px; height:28px; border-radius:50%; background:linear-gradient(135deg,var(--green-500),var(--green-700)); color:#fff; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; } .toast .tic svg{ width:15px; height:15px; } .toast .tt{ font-size:13px; font-weight:600; }
.demopill{ font-size:10px; font-weight:600; color:var(--ink-400); border:1px dashed var(--hairline-strong); border-radius:var(--r-pill); padding:3px 9px; cursor:pointer; flex-shrink:0; } .demopill:hover{ color:var(--ink-700); }
@media (max-width:860px){ .setwrap{ grid-template-columns:1fr; } .setnav{ border-right:none; border-bottom:1px solid var(--hairline); } .cards2,.plancards,.packs{ grid-template-columns:1fr; } }

/* ════════════════════════════════════════
   SURFACE: templates.html
   ════════════════════════════════════════ */

/* ---- templates.html :: style block 0 ---- */
/* ── DS ALIAS LAYER — verbatim from canon (ADR-0002). Pure var()/color-mix; no token hex. ── */
:root{
  --font-display:var(--amp-hexcoded-font-display); --font-body:var(--amp-hexcoded-font-body); --font-mono:var(--amp-hexcoded-font-mono);
  --green-50:var(--amp-hexcoded-theme-color-accent-whisper); --green-100:var(--amp-hexcoded-color-green-100);
  --green-200:color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 28%,var(--amp-hexcoded-color-white));
  --green-300:var(--amp-hexcoded-theme-color-accent-light); --green-400:color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 72%,var(--amp-hexcoded-color-white));
  --green-500:var(--amp-hexcoded-theme-color-accent); --green-600:var(--amp-hexcoded-theme-color-accent-deep);
  --green-700:color-mix(in srgb,var(--amp-hexcoded-theme-color-accent-deep) 80%,var(--amp-hexcoded-color-black));
  --green-800:color-mix(in srgb,var(--amp-hexcoded-theme-color-accent-deep) 62%,var(--amp-hexcoded-color-black));
  --ink-0:var(--amp-hexcoded-theme-color-bg-elev); --ink-50:var(--amp-hexcoded-theme-color-bg); --ink-100:var(--amp-hexcoded-theme-color-bg-soft);
  --ink-400:color-mix(in srgb,var(--amp-hexcoded-theme-color-bg-elev) 58%,var(--amp-hexcoded-theme-color-text-primary));
  --ink-500:var(--amp-hexcoded-theme-color-text-tertiary);
  --ink-600:color-mix(in srgb,var(--amp-hexcoded-theme-color-text-tertiary) 60%,var(--amp-hexcoded-theme-color-text-primary));
  --ink-700:var(--amp-hexcoded-theme-color-text-secondary);
  --ink-800:color-mix(in srgb,var(--amp-hexcoded-theme-color-text-secondary) 45%,var(--amp-hexcoded-theme-color-text-primary));
  --ink-900:color-mix(in srgb,var(--amp-hexcoded-theme-color-text-primary) 88%,var(--amp-hexcoded-theme-color-bg-elev));
  --ink-1000:var(--amp-hexcoded-theme-color-text-primary);
  --bg-canvas:var(--amp-hexcoded-theme-color-bg); --bg-surface:var(--amp-hexcoded-theme-color-bg-elev); --bg-soft:var(--amp-hexcoded-theme-color-bg-soft);
  --hairline:color-mix(in srgb,var(--amp-hexcoded-theme-color-border) 60%,transparent); --hairline-strong:var(--amp-hexcoded-theme-color-border);
  --glass-bg-strong:color-mix(in srgb,var(--amp-hexcoded-theme-color-bg-elev) 88%,transparent); --glass-blur:blur(20px) saturate(180%);
  --shadow-xs:var(--amp-hexcoded-shadow-1); --shadow-sm:var(--amp-hexcoded-shadow-2); --shadow-md:var(--amp-hexcoded-shadow-3); --shadow-lg:var(--amp-hexcoded-shadow-4); --shadow-xl:var(--amp-hexcoded-shadow-5);
  --shadow-green-soft:0 8px 20px color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 14%,transparent); --shadow-green:0 12px 32px color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 24%,transparent),0 4px 8px color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 12%,transparent);
  --r-sm:var(--amp-hexcoded-radius-md); --r-md:var(--amp-hexcoded-radius-lg); --r-lg:var(--amp-hexcoded-radius-xl); --r-xl:var(--amp-hexcoded-radius-2xl); --r-pill:var(--amp-hexcoded-radius-full);
  --ease-out:var(--amp-hexcoded-motion-ease); --d-fast:var(--amp-hexcoded-motion-d-fast); --d-base:var(--amp-hexcoded-motion-d-base); --d-slow:var(--amp-hexcoded-motion-d-slow);
  --accent-soft:color-mix(in srgb,var(--green-500) 9%,var(--bg-surface)); --accent-border:color-mix(in srgb,var(--green-500) 30%,var(--hairline));
  --accent-chip-bg:var(--green-100); --accent-chip-ink:var(--green-700); --sel-bg:var(--accent-soft); --sel-border:var(--green-500); --sel-ring-2:0 0 0 2px color-mix(in srgb,var(--green-500) 16%,transparent);
  --focus-ring:0 0 0 3px color-mix(in srgb,var(--green-500) 14%,transparent); --media-well:#0a0a0c; --seg-track:var(--ink-100); --seg-thumb:var(--bg-surface);
  --danger:var(--amp-hexcoded-status-danger); --hover-surface:color-mix(in srgb,var(--ink-1000) 6%,transparent);
}
[data-theme="dark"]{ --seg-track:var(--bg-surface); --accent-chip-bg:color-mix(in srgb,var(--green-500) 16%,var(--bg-surface)); --accent-chip-ink:var(--green-300); }
*,*::before,*::after{ box-sizing:border-box; } html,body{ height:100%; margin:0; }
body{ font-family:var(--font-body); color:var(--ink-900); background:var(--bg-canvas); -webkit-font-smoothing:antialiased; }
button,input,textarea,select{ font-family:inherit; }
.hexwm{ position:relative; display:inline-block; font-family:Outfit,sans-serif; font-weight:900; letter-spacing:-0.025em; line-height:1; color:var(--ink-1000); isolation:isolate; }
.hexwm::before,.hexwm::after,.hexwm .ph{ content:attr(data-text); position:absolute; left:0; top:0; color:#22C55E; z-index:-1; }
.hexwm::before{ transform:translate(1px,1px); opacity:.85; --ph:.85; animation:hexph 3s ease-in-out infinite; }
.hexwm .ph{ transform:translate(2px,2px); opacity:.55; --ph:.55; animation:hexph 3s ease-in-out infinite .1s; }
.hexwm::after{ transform:translate(3px,3px); opacity:.32; --ph:.32; animation:hexph 3s ease-in-out infinite .2s; }
@keyframes hexph{ 0%,100%{opacity:var(--ph,.85)} 50%{opacity:calc(var(--ph,.85)*.4)} }
@media (prefers-reduced-motion:reduce){ .hexwm::before,.hexwm::after,.hexwm .ph{animation:none!important} }
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:7px; height:38px; padding:0 15px; border-radius:var(--r-pill); font-size:13px; font-weight:600; border:1px solid var(--hairline-strong); background:var(--bg-surface); color:var(--ink-800); cursor:pointer; transition:all var(--d-fast); white-space:nowrap; }
.btn:hover{ background:var(--ink-100); color:var(--ink-1000); } .btn svg{ width:15px; height:15px; }
.btn-primary{ background:linear-gradient(135deg,var(--amp-hexcoded-theme-color-accent),var(--amp-hexcoded-theme-color-accent-deep)); color:#fff; border:none; box-shadow:var(--shadow-green-soft); }
.btn-primary:hover{ background:linear-gradient(135deg,var(--amp-hexcoded-theme-color-accent-deep),var(--green-700)); color:#fff; }
.btn-lg{ height:46px; padding:0 20px; font-size:14px; }
.theme-switcher{ display:inline-flex; align-items:center; background:var(--seg-track); border-radius:var(--r-pill); padding:3px; gap:2px; }
.theme-switcher button{ border:none; background:transparent; cursor:pointer; border-radius:var(--r-pill); font-weight:600; color:var(--ink-600); padding:6px 11px; font-size:11.5px; }
.theme-switcher button.on{ background:var(--seg-thumb); color:var(--ink-1000); box-shadow:var(--shadow-xs); }

/* board chrome */

/* shell */
.shell{ height:100vh; display:grid; grid-template-columns:212px 1fr; }
.rail{ background:var(--glass-bg-strong); backdrop-filter:var(--glass-blur); border-right:1px solid var(--hairline); display:flex; flex-direction:column; padding:16px 12px; gap:3px; }
.rail-logo{ display:flex; align-items:center; padding:4px 8px 14px; } .rail-logo .hexwm{ font-size:16px; }
.rail-item{ display:flex; align-items:center; gap:11px; padding:0 11px; height:38px; border-radius:var(--r-md); border:none; background:transparent; cursor:pointer; color:var(--ink-600); font-size:13.5px; font-weight:600; text-align:left; } .rail-item:hover{ background:var(--hover-surface); color:var(--ink-1000); } .rail-item.on{ background:color-mix(in srgb,var(--green-500) 14%,var(--bg-surface)); color:var(--green-700); } [data-theme="dark"] .rail-item.on{ color:var(--green-300); } .rail-item svg{ width:18px; height:18px; flex-shrink:0; }
.rail-sp{ flex:1; } .rail-foot{ border-top:1px solid var(--hairline); padding-top:8px; }
.main{ display:flex; flex-direction:column; min-width:0; overflow:hidden; }
.hdr{ height:56px; flex-shrink:0; display:flex; align-items:center; gap:12px; padding:0 22px; border-bottom:1px solid var(--hairline); background:var(--glass-bg-strong); }
.hdr .sp{ flex:1; }
.wschip{ display:inline-flex; align-items:center; gap:9px; padding:5px 12px 5px 6px; border-radius:var(--r-pill); border:1px solid var(--hairline); background:var(--bg-surface); }
.wschip .bd{ width:26px; height:26px; border-radius:7px; background:linear-gradient(135deg,#222,#d50032); color:#fff; font-weight:800; font-size:11px; display:inline-flex; align-items:center; justify-content:center; }
.wschip .bl{ display:flex; flex-direction:column; line-height:1.15; } .wschip .k{ font-size:8.5px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-500); } .wschip .v{ font-size:12.5px; font-weight:700; color:var(--ink-900); letter-spacing:.02em; }
.credits{ display:inline-flex; align-items:center; gap:7px; padding:6px 12px; border-radius:var(--r-pill); background:var(--green-50); border:1px solid var(--green-200); font-size:12px; font-weight:600; color:var(--green-800); } .credits .coin{ color:var(--green-600); }
.scroll{ flex:1; overflow-y:auto; } .inner{ max-width:1080px; margin:0 auto; padding:26px 30px 70px; }
.page-h{ display:flex; align-items:flex-end; gap:14px; } .page-h .l{ flex:1; } .page-h h1{ font-family:var(--font-display); font-size:26px; font-weight:800; letter-spacing:-.03em; margin:0; color:var(--ink-1000); }
.page-h .sub{ font-size:13px; color:var(--ink-600); margin-top:6px; line-height:1.5; }

/* search (shared) */
.search{ display:flex; align-items:center; gap:10px; height:42px; padding:0 16px; border:1px solid var(--hairline-strong); border-radius:var(--r-pill); background:var(--bg-surface); } .search:focus-within{ border-color:var(--green-500); box-shadow:var(--focus-ring); } .search svg{ width:17px; height:17px; color:var(--ink-400); flex-shrink:0; } .search input{ flex:1; border:none; outline:none; background:transparent; font-size:14px; color:var(--ink-1000); min-width:0; } .search input::placeholder{ color:var(--ink-400); }
/* custom sort dropdown (native select rejected — looked broken) */
.dd{ position:relative; flex-shrink:0; }
.ddbtn{ display:inline-flex; align-items:center; gap:7px; height:38px; padding:0 14px; border:1px solid var(--hairline-strong); border-radius:var(--r-pill); background:var(--bg-surface); font-size:12.5px; font-weight:600; color:var(--ink-800); cursor:pointer; } .ddbtn:hover{ border-color:var(--green-400); } .ddbtn .k{ color:var(--ink-500); font-weight:500; } .ddbtn svg{ width:14px; height:14px; color:var(--ink-500); }
.ddmenu{ display:none; position:absolute; right:0; top:calc(100% + 6px); min-width:160px; background:var(--bg-surface); border:1px solid var(--hairline-strong); border-radius:var(--r-md); box-shadow:var(--shadow-lg); padding:5px; z-index:40; } .ddmenu.on{ display:block; }
.ddopt{ display:flex; align-items:center; gap:9px; padding:8px 10px; border-radius:var(--r-sm); cursor:pointer; font-size:13px; color:var(--ink-800); } .ddopt:hover{ background:var(--hover-surface); } .ddopt .ck{ width:14px; height:14px; color:var(--green-600); opacity:0; } .ddopt.on .ck{ opacity:1; } .ddopt.on{ color:var(--green-700); font-weight:600; }
.favtog{ display:inline-flex; align-items:center; gap:7px; height:38px; padding:0 14px; border:1px solid var(--hairline-strong); border-radius:var(--r-pill); background:var(--bg-surface); font-size:12.5px; font-weight:600; color:var(--ink-700); cursor:pointer; } .favtog svg{ width:15px; height:15px; } .favtog.on{ border-color:var(--sel-border); background:var(--sel-bg); color:var(--green-700); } .favtog.on svg{ fill:var(--green-600); color:var(--green-600); }

/* tiles (shared) */
.tile{ position:relative; border-radius:13px; overflow:hidden; cursor:pointer; background:var(--media-well); aspect-ratio:9/16; box-shadow:var(--shadow-xs); transition:all var(--d-base); }
.tile:hover{ box-shadow:var(--shadow-lg); transform:translateY(-2px); }
.tile .scene{ position:absolute; inset:0; }
.tile .obj{ position:absolute; left:50%; top:46%; transform:translate(-50%,-50%); width:42%; height:38%; border-radius:9px; box-shadow:0 12px 30px rgba(0,0,0,.45); }
.tile .grad{ position:absolute; inset:0; background:linear-gradient(180deg,rgba(0,0,0,.18) 0%,transparent 30%,transparent 55%,rgba(0,0,0,.72) 100%); }
.tile .cat{ position:absolute; left:9px; top:9px; font-size:9.5px; font-weight:700; font-family:var(--font-mono); letter-spacing:.03em; color:#fff; background:rgba(0,0,0,.42); backdrop-filter:blur(5px); padding:3px 8px; border-radius:var(--r-pill); display:inline-flex; align-items:center; gap:5px; } .tile .cat svg{ width:11px; height:11px; }
.tile .fmt{ position:absolute; right:9px; top:9px; font-size:9px; font-weight:700; font-family:var(--font-mono); color:#fff; background:rgba(0,0,0,.42); padding:2px 7px; border-radius:var(--r-pill); }
.tile .newb{ position:absolute; right:9px; top:30px; font-size:8.5px; font-weight:700; font-family:var(--font-mono); letter-spacing:.04em; text-transform:uppercase; color:#fff; background:linear-gradient(135deg,var(--green-500),var(--green-600)); padding:2px 7px; border-radius:var(--r-pill); }
.tile .fav{ position:absolute; right:8px; bottom:46px; width:30px; height:30px; border-radius:50%; background:rgba(0,0,0,.45); backdrop-filter:blur(5px); border:none; color:#fff; display:flex; align-items:center; justify-content:center; cursor:pointer; opacity:0; transition:all var(--d-fast); }
.tile:hover .fav{ opacity:1; } .tile .fav svg{ width:15px; height:15px; } .tile .fav.on{ opacity:1; background:var(--green-500); } .tile .fav.on svg{ fill:#fff; }
.tile .play{ position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:42px; height:42px; border-radius:50%; background:rgba(255,255,255,.9); display:flex; align-items:center; justify-content:center; opacity:0; transition:opacity var(--d-fast); } .tile:hover .play{ opacity:1; } .tile .play svg{ width:18px; height:18px; color:#111; margin-left:2px; }
.tile .scan{ position:absolute; left:0; right:0; height:40%; background:linear-gradient(180deg,transparent,color-mix(in srgb,var(--green-400) 22%,transparent),transparent); opacity:0; }
.tile .meta{ position:absolute; left:0; right:0; bottom:0; padding:10px 11px; }
.tile .nm{ font-size:12.5px; font-weight:700; color:#fff; line-height:1.25; text-shadow:0 1px 6px rgba(0,0,0,.5); }
.tile .swap{ font-size:10px; color:rgba(255,255,255,.82); margin-top:3px; display:inline-flex; align-items:center; gap:4px; } .tile .swap svg{ width:10px; height:10px; }
/* v2-only hover affordances */
.tile.canva:hover .scan{ opacity:1; animation:scanm 1.7s ease-in-out infinite; } @keyframes scanm{ 0%{transform:translateY(-40%)} 100%{transform:translateY(260%)} }
.tile.canva .prev{ position:absolute; left:8px; bottom:46px; font-size:9px; font-weight:700; font-family:var(--font-mono); color:#fff; background:rgba(0,0,0,.5); padding:3px 8px; border-radius:var(--r-pill); display:inline-flex; gap:4px; align-items:center; opacity:0; } .tile.canva:hover .prev{ opacity:1; } .tile.canva .prev svg{ width:9px; height:9px; }
.tile.canva .use{ position:absolute; left:11px; right:11px; bottom:42px; opacity:0; transition:all var(--d-fast); } .tile.canva:hover .use{ opacity:1; bottom:46px; } .tile.canva .use .b{ display:flex; align-items:center; justify-content:center; gap:6px; background:#fff; color:var(--ink-1000); font-size:11.5px; font-weight:700; padding:8px; border-radius:var(--r-pill); box-shadow:var(--shadow-md); } .tile.canva .use .b svg{ width:13px; height:13px; }

/* trending / shelf row */
.shelf{ margin-top:22px; } .shelf-h{ display:flex; align-items:baseline; gap:10px; margin-bottom:11px; } .shelf-h .st{ font-family:var(--font-display); font-size:15.5px; font-weight:800; color:var(--ink-1000); letter-spacing:-.01em; } .shelf-h .sc{ font-size:11.5px; color:var(--ink-500); }
.row{ display:flex; gap:13px; overflow-x:auto; padding-bottom:6px; } .row::-webkit-scrollbar{ height:6px; } .row::-webkit-scrollbar-thumb{ background:var(--hairline-strong); border-radius:var(--r-pill); }
.row .tile{ flex:0 0 150px; }

/* V1 — left filter rail + grid */
.btwrap{ display:grid; grid-template-columns:198px 1fr; gap:24px; margin-top:20px; }
.filters{ position:sticky; top:78px; align-self:start; }
.fgroup{ margin-bottom:20px; } .fgl{ font-family:var(--font-mono); font-size:9.5px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-500); margin-bottom:9px; }
.fopt{ display:flex; align-items:center; gap:9px; padding:6px 4px; font-size:13px; color:var(--ink-700); cursor:pointer; } .fopt:hover{ color:var(--ink-1000); } .fopt .bx{ width:16px; height:16px; border-radius:5px; border:1.5px solid var(--hairline-strong); display:inline-flex; align-items:center; justify-content:center; color:transparent; flex-shrink:0; } .fopt.on .bx{ background:var(--green-500); border-color:var(--green-500); color:#fff; } .fopt .bx svg{ width:11px; height:11px; } .fopt .ct{ margin-left:auto; font-size:11px; color:var(--ink-400); }
.fpills{ display:flex; gap:7px; flex-wrap:wrap; } .fpill{ padding:6px 12px; border:1px solid var(--hairline-strong); border-radius:var(--r-pill); font-size:12px; font-weight:600; color:var(--ink-700); cursor:pointer; } .fpill.on{ border-color:var(--sel-border); background:var(--sel-bg); color:var(--green-700); }
.gridhead{ display:flex; align-items:center; gap:12px; margin-bottom:13px; } .gridhead .gc{ font-size:13px; color:var(--ink-600); } .gridhead .gc b{ color:var(--ink-1000); } .gridhead .clr{ font-size:12px; font-weight:600; color:var(--green-700); cursor:pointer; }
.tgrid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:14px; }
.empty{ border:1px dashed var(--hairline-strong); border-radius:var(--r-lg); padding:36px; text-align:center; color:var(--ink-500); font-size:13px; }
.toolbar{ display:flex; align-items:center; gap:10px; margin-top:16px; position:sticky; top:0; z-index:30; background:color-mix(in srgb,var(--bg-canvas) 90%,transparent); backdrop-filter:blur(10px); padding:10px 0; } .toolbar .search{ flex:1; max-width:460px; } .toolbar .sp{ flex:1; }

/* V2 — Canva/Adobe: top search + sticky category bar + collections + bigger grid */
.catbar{ position:sticky; top:0; z-index:20; background:color-mix(in srgb,var(--bg-canvas) 92%,transparent); backdrop-filter:blur(8px); padding:12px 0 11px; margin-top:4px; display:flex; align-items:center; gap:9px; overflow-x:auto; } .catbar::-webkit-scrollbar{ display:none; }
.cchip{ display:inline-flex; align-items:center; gap:7px; padding:8px 14px; border-radius:var(--r-pill); border:1px solid var(--hairline-strong); background:var(--bg-surface); cursor:pointer; font-size:12.5px; font-weight:600; color:var(--ink-700); white-space:nowrap; transition:all var(--d-fast); } .cchip svg{ width:14px; height:14px; } .cchip:hover{ border-color:var(--green-400); color:var(--ink-1000); } .cchip.on{ border-color:transparent; background:var(--ink-1000); color:var(--ink-0); } .cchip .sep{ width:1px; height:18px; background:var(--hairline); }
.catbar .fmtmini{ margin-left:auto; display:flex; gap:6px; flex-shrink:0; }
.collrow{ display:flex; gap:13px; overflow-x:auto; padding-bottom:6px; margin-top:6px; } .collrow::-webkit-scrollbar{ height:6px; } .collrow::-webkit-scrollbar-thumb{ background:var(--hairline-strong); border-radius:var(--r-pill); }
.coll{ flex:0 0 230px; height:118px; border-radius:13px; position:relative; overflow:hidden; cursor:pointer; box-shadow:var(--shadow-xs); transition:all var(--d-base); } .coll:hover{ box-shadow:var(--shadow-md); transform:translateY(-2px); }
.coll .cg{ position:absolute; inset:0; } .coll .cov{ position:absolute; inset:0; background:linear-gradient(120deg,rgba(0,0,0,.55),rgba(0,0,0,.15)); }
.coll .ct2{ position:absolute; left:13px; bottom:12px; right:13px; } .coll .cn{ font-family:var(--font-display); font-weight:800; font-size:15px; color:#fff; text-shadow:0 1px 6px rgba(0,0,0,.5); } .coll .cc{ font-size:10.5px; color:rgba(255,255,255,.85); margin-top:2px; }
.tgridBig{ display:grid; grid-template-columns:repeat(auto-fill,minmax(176px,1fr)); gap:16px; margin-top:14px; }

/* use-template sheet */
.sheetwrap{ position:fixed; inset:0; display:none; align-items:center; justify-content:center; background:rgba(0,0,0,.5); z-index:95; padding:20px; } .sheetwrap.on{ display:flex; }
/* ONE uniform popup envelope — 760×600 for EVERY template (matches the product-wide popup shell) */
.sheet{ width:760px; height:600px; max-width:100%; max-height:90vh; overflow:hidden; background:var(--bg-surface); border:1px solid var(--hairline); border-radius:var(--r-xl); box-shadow:var(--shadow-xl); display:grid; grid-template-columns:280px 1fr; animation:pop var(--d-base) var(--ease-out); }
.sheet.solo{ grid-template-columns:1fr; }
/* script input (Testimonial / Podcast — the only user input is the words) */
.scriptbox{ width:100%; min-height:120px; padding:11px 13px; border:1.5px dashed var(--hairline-strong); border-radius:var(--r-md); background:var(--bg-surface); font-family:inherit; font-size:13px; line-height:1.55; color:var(--ink-1000); outline:none; resize:none; transition:all var(--d-fast); } .scriptbox:focus{ border-color:var(--green-500); border-style:solid; box-shadow:var(--focus-ring); } .scriptbox::placeholder{ color:var(--ink-400); }
.scriptrow{ display:flex; align-items:center; gap:10px; margin-top:9px; } .scriptrow .hint{ font-size:11px; color:var(--ink-500); }
/* generating stage (locked G-H: brand breath + ring + moving %) */
.genwrap{ height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px; }
.gring{ position:relative; width:128px; height:128px; border-radius:50%; display:flex; align-items:center; justify-content:center; }
.gring::after{ content:""; position:absolute; inset:10px; border-radius:50%; background:var(--bg-surface); }
.gring .gpct{ position:relative; z-index:2; font-family:var(--font-display); font-weight:800; font-size:24px; color:var(--ink-1000); }
.gbrand{ width:34px; height:34px; border-radius:9px; background:linear-gradient(135deg,#222,#d50032); color:#fff; font-weight:800; font-size:14px; display:flex; align-items:center; justify-content:center; animation:gbreath 2.2s ease-in-out infinite; }
@keyframes gbreath{ 0%,100%{ transform:scale(1); opacity:1 } 50%{ transform:scale(.9); opacity:.7 } }
.gt{ font-family:var(--font-display); font-weight:800; font-size:17px; color:var(--ink-1000); } .gs{ font-size:12px; color:var(--ink-500); margin-top:-8px; }
/* result stage (locked R-E: just the player) */
.donewrap{ height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px; }
.dplayer{ position:relative; border-radius:14px; overflow:hidden; background:var(--media-well); box-shadow:var(--shadow-lg); }
.drow{ display:flex; gap:10px; }
@keyframes pop{ from{opacity:0; transform:translateY(8px) scale(.99)} to{opacity:1; transform:none} }
.sheet .prev{ background:var(--media-well); position:relative; } .sheet .prev .scene{ position:absolute; inset:0; } .sheet .prev .obj{ position:absolute; left:50%; top:46%; transform:translate(-50%,-50%); width:44%; height:40%; border-radius:9px; box-shadow:0 14px 36px rgba(0,0,0,.5); } .sheet .prev .grad{ position:absolute; inset:0; background:linear-gradient(180deg,transparent 60%,rgba(0,0,0,.7)); } .sheet .prev .cap{ position:absolute; left:14px; right:14px; bottom:14px; color:#fff; font-family:var(--font-display); font-weight:800; font-size:15px; text-shadow:0 1px 8px rgba(0,0,0,.6); }
.sheet .body{ padding:22px 24px; overflow-y:auto; }
.sheet .sx{ position:absolute; right:14px; top:14px; border:none; background:rgba(0,0,0,.4); color:#fff; width:28px; height:28px; border-radius:50%; cursor:pointer; display:flex; align-items:center; justify-content:center; } .sheet .sx svg{ width:15px; height:15px; }
.sheet .cat2{ font-family:var(--font-mono); font-size:10px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--green-700); display:inline-flex; gap:5px; align-items:center; } .sheet .cat2 svg{ width:12px; height:12px; }
.sheet h3{ font-family:var(--font-display); font-size:20px; font-weight:800; letter-spacing:-.02em; margin:7px 0 0; color:var(--ink-1000); }
.sheet .desc{ font-size:13px; color:var(--ink-600); margin-top:7px; line-height:1.5; }
.swaplab{ font-family:var(--font-mono); font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-500); margin:22px 0 10px; }
.slot{ display:flex; align-items:center; gap:12px; padding:12px 13px; border:1.5px dashed var(--hairline-strong); border-radius:var(--r-md); margin-bottom:9px; cursor:pointer; transition:all var(--d-fast); } .slot:hover{ border-color:var(--green-400); background:var(--accent-soft); } .slot .si{ width:38px; height:38px; border-radius:9px; background:var(--ink-50); border:1px solid var(--hairline); display:flex; align-items:center; justify-content:center; color:var(--ink-500); flex-shrink:0; } .slot .si svg{ width:18px; height:18px; } .slot .sw{ flex:1; min-width:0; } .slot .st2{ display:block; font-size:13px; font-weight:600; color:var(--ink-1000); } .slot .sh{ display:block; font-size:11.5px; color:var(--ink-500); margin-top:2px; } .slot .sa{ flex-shrink:0; font-size:12px; font-weight:600; color:var(--green-700); white-space:nowrap; }
.slot.filled{ border-style:solid; border-color:var(--green-400); background:var(--accent-soft); } .slot .ok{ display:inline-flex; align-items:center; gap:5px; color:var(--green-700); font-weight:600; font-size:12px; flex-shrink:0; } .slot .ok svg{ width:14px; height:14px; }
.mini{ display:flex; gap:9px; padding:2px 2px 12px; }
.mface{ flex:1; border:1.5px solid var(--hairline-strong); border-radius:var(--r-md); padding:10px 8px; text-align:center; cursor:pointer; transition:all var(--d-fast); background:var(--bg-surface); } .mface:hover{ border-color:var(--green-400); }
.mface .av{ width:40px; height:40px; border-radius:50%; margin:0 auto 7px; border:2px solid rgba(0,0,0,.08); } .mface .mn{ font-size:11.5px; font-weight:600; color:var(--ink-900); } .mface .ms{ font-size:9.5px; color:var(--ink-500); }
.toast{ position:fixed; left:50%; bottom:24px; transform:translateX(-50%) translateY(20px); opacity:0; z-index:110; display:flex; align-items:center; gap:11px; padding:13px 17px; border-radius:var(--r-lg); background:var(--ink-1000); color:var(--ink-0); box-shadow:var(--shadow-xl); transition:all var(--d-base) var(--ease-out); } [data-theme="dark"] .toast{ background:var(--bg-surface); color:var(--ink-1000); border:1px solid var(--hairline-strong); } .toast.on{ opacity:1; transform:translateX(-50%) translateY(0); } .toast .tic{ width:28px; height:28px; border-radius:50%; background:linear-gradient(135deg,var(--green-500),var(--green-700)); color:#fff; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; } .toast .tic svg{ width:15px; height:15px; } .toast .tt{ font-size:13px; font-weight:600; }
.taps{ font-size:11.5px; color:var(--ink-500); margin-top:14px; display:flex; align-items:center; gap:7px; } .taps svg{ width:14px; height:14px; color:var(--green-600); }
.sheet .cta{ margin-top:18px; }
@media (max-width:1040px){ .btwrap{ grid-template-columns:1fr; } .filters{ position:static; } .sheet{ grid-template-columns:1fr; } .sheet .prev{ min-height:200px; } }

/* ════════════════════════════════════════
   SURFACE: actors-library.html
   ════════════════════════════════════════ */

/* ---- actors-library.html :: style block 0 ---- */
/* ════ DS ALIAS LAYER — verbatim from canon/onboarding.html (§4c). ════ */
:root{
  --font-display:var(--amp-hexcoded-font-display); --font-body:var(--amp-hexcoded-font-body); --font-mono:var(--amp-hexcoded-font-mono);
  --green-50:var(--amp-hexcoded-theme-color-accent-whisper); --green-100:var(--amp-hexcoded-color-green-100);
  --green-200:color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 28%,var(--amp-hexcoded-color-white));
  --green-300:var(--amp-hexcoded-theme-color-accent-light); --green-400:color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 72%,var(--amp-hexcoded-color-white));
  --green-500:var(--amp-hexcoded-theme-color-accent); --green-600:var(--amp-hexcoded-theme-color-accent-deep);
  --green-700:color-mix(in srgb,var(--amp-hexcoded-theme-color-accent-deep) 80%,var(--amp-hexcoded-color-black));
  --green-800:color-mix(in srgb,var(--amp-hexcoded-theme-color-accent-deep) 62%,var(--amp-hexcoded-color-black));
  --ink-0:var(--amp-hexcoded-theme-color-bg-elev); --ink-50:var(--amp-hexcoded-theme-color-bg); --ink-100:var(--amp-hexcoded-theme-color-bg-soft);
  --ink-300:color-mix(in srgb,var(--amp-hexcoded-theme-color-bg-elev) 80%,var(--amp-hexcoded-theme-color-text-primary));
  --ink-400:color-mix(in srgb,var(--amp-hexcoded-theme-color-bg-elev) 58%,var(--amp-hexcoded-theme-color-text-primary));
  --ink-500:var(--amp-hexcoded-theme-color-text-tertiary);
  --ink-600:color-mix(in srgb,var(--amp-hexcoded-theme-color-text-tertiary) 60%,var(--amp-hexcoded-theme-color-text-primary));
  --ink-700:var(--amp-hexcoded-theme-color-text-secondary);
  --ink-800:color-mix(in srgb,var(--amp-hexcoded-theme-color-text-secondary) 45%,var(--amp-hexcoded-theme-color-text-primary));
  --ink-900:color-mix(in srgb,var(--amp-hexcoded-theme-color-text-primary) 88%,var(--amp-hexcoded-theme-color-bg-elev));
  --ink-1000:var(--amp-hexcoded-theme-color-text-primary);
  --bg-canvas:var(--amp-hexcoded-theme-color-bg); --bg-surface:var(--amp-hexcoded-theme-color-bg-elev); --bg-soft:var(--amp-hexcoded-theme-color-bg-soft);
  --hairline:color-mix(in srgb,var(--amp-hexcoded-theme-color-border) 60%,transparent); --hairline-strong:var(--amp-hexcoded-theme-color-border);
  --glass-bg-strong:color-mix(in srgb,var(--amp-hexcoded-theme-color-bg-elev) 88%,transparent); --glass-blur:blur(20px) saturate(180%);
  --shadow-xs:var(--amp-hexcoded-shadow-1); --shadow-sm:var(--amp-hexcoded-shadow-2); --shadow-md:var(--amp-hexcoded-shadow-3); --shadow-lg:var(--amp-hexcoded-shadow-4); --shadow-xl:var(--amp-hexcoded-shadow-5);
  --shadow-green-soft:0 8px 20px color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 14%,transparent); --shadow-green:0 12px 32px color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 24%,transparent),0 4px 8px color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 12%,transparent);
  --r-sm:var(--amp-hexcoded-radius-md); --r-md:var(--amp-hexcoded-radius-lg); --r-lg:var(--amp-hexcoded-radius-xl); --r-xl:var(--amp-hexcoded-radius-2xl); --r-pill:var(--amp-hexcoded-radius-full);
  --ease-out:var(--amp-hexcoded-motion-ease); --d-fast:var(--amp-hexcoded-motion-d-fast); --d-base:var(--amp-hexcoded-motion-d-base); --d-slow:var(--amp-hexcoded-motion-d-slow);
  --accent-soft:color-mix(in srgb,var(--green-500) 9%,var(--bg-surface)); --accent-border:color-mix(in srgb,var(--green-500) 30%,var(--hairline));
  --sel-bg:var(--accent-soft);
  --focus-ring:0 0 0 3px color-mix(in srgb,var(--green-500) 14%,transparent); --media-well:#0a0a0c; --seg-track:var(--ink-100); --seg-thumb:var(--bg-surface);
  --danger:var(--amp-hexcoded-status-danger); --hover-surface:color-mix(in srgb,var(--ink-1000) 6%,transparent);
}
[data-theme="dark"]{ --seg-track:var(--bg-surface); }
*,*::before,*::after{ box-sizing:border-box; } html,body{ height:100%; margin:0; }
body{ font-family:var(--font-body); color:var(--ink-900); background:var(--bg-canvas); -webkit-font-smoothing:antialiased; }
button{ font-family:inherit; cursor:pointer; }
img{ display:block; }
.hexwm{ position:relative; display:inline-block; isolation:isolate; font-family:Outfit,sans-serif; font-weight:900; letter-spacing:-0.025em; line-height:1; color:var(--ink-1000); }
.hexwm::before,.hexwm::after,.hexwm .ph{ content:attr(data-text); position:absolute; left:0; top:0; color:#22C55E; z-index:-1; }
.hexwm::before{ transform:translate(1px,1px); opacity:.85; --ph:.85; animation:hexph 3s ease-in-out infinite; }
.hexwm .ph{ transform:translate(2px,2px); opacity:.55; --ph:.55; animation:hexph 3s ease-in-out infinite .1s; }
.hexwm::after{ transform:translate(3px,3px); opacity:.32; --ph:.32; animation:hexph 3s ease-in-out infinite .2s; }
@keyframes hexph{ 0%,100%{opacity:var(--ph,.85)} 50%{opacity:calc(var(--ph,.85)*.4)} }
@media (prefers-reduced-motion:reduce){ .hexwm::before,.hexwm::after,.hexwm .ph{animation:none!important} }

.btn{ display:inline-flex; align-items:center; justify-content:center; gap:7px; height:40px; padding:0 16px; border-radius:var(--r-pill); font-size:13.5px; font-weight:600; border:1px solid var(--hairline-strong); background:var(--bg-surface); color:var(--ink-800); transition:all var(--d-fast); white-space:nowrap; }
.btn:hover{ background:var(--ink-100); color:var(--ink-1000); } .btn svg{ width:15px; height:15px; }
.btn-primary{ background:linear-gradient(135deg,var(--amp-hexcoded-theme-color-accent),var(--amp-hexcoded-theme-color-accent-deep)); color:#fff; border:none; box-shadow:var(--shadow-green-soft); }
.btn-primary:hover{ background:linear-gradient(135deg,var(--amp-hexcoded-theme-color-accent-deep),var(--green-700)); color:#fff; box-shadow:var(--shadow-green); }
.btn-primary:disabled{ opacity:.5; cursor:not-allowed; box-shadow:none; }
.btn-sm{ height:34px; padding:0 13px; font-size:12.5px; }
.theme-switcher{ display:inline-flex; align-items:center; background:var(--seg-track); border-radius:var(--r-pill); padding:3px; gap:2px; }
.theme-switcher button{ border:none; background:transparent; border-radius:var(--r-pill); font-weight:600; color:var(--ink-600); padding:6px 11px; font-size:11.5px; }
.theme-switcher button.on{ background:var(--seg-thumb); color:var(--ink-1000); box-shadow:var(--shadow-xs); }

/* ════ APP SHELL — verbatim from canon/onboarding.html, + collapse + Actors ════ */
.app{ display:grid; height:100vh; grid-template-columns:220px 1fr; transition:grid-template-columns var(--d-base) var(--ease-out); }
.app.railmin{ grid-template-columns:64px 1fr; }
.rail{ background:var(--glass-bg-strong); backdrop-filter:var(--glass-blur); border-right:1px solid var(--hairline); display:flex; flex-direction:column; padding:16px 12px; gap:4px; min-width:0; }
.rail-logo{ display:flex; align-items:center; gap:6px; padding:4px 6px 14px; } .rail-logo .hexwm{ font-size:17px; }
.app.railmin .rail-logo .hexwm{ display:none; }
.rail-collapse{ margin-left:auto; width:30px; height:30px; border-radius:var(--r-sm); border:none; background:transparent; color:var(--ink-500); display:inline-flex; align-items:center; justify-content:center; } .rail-collapse:hover{ background:var(--hover-surface); color:var(--ink-1000); } .rail-collapse svg{ width:17px; height:17px; }
.app.railmin .rail-logo{ justify-content:center; }
.rail-item{ display:flex; align-items:center; gap:12px; padding:0 11px; height:40px; border-radius:var(--r-md); border:none; background:transparent; color:var(--ink-600); font-size:13.5px; font-weight:600; text-align:left; }
.app.railmin .rail-item{ justify-content:center; padding:0; gap:0; }
.app.railmin .rail-item .lbl,.app.railmin .tools-lab{ display:none; }
.rail-item:hover{ background:var(--hover-surface); color:var(--ink-1000); } .rail-item.on{ background:color-mix(in srgb,var(--green-500) 15%,var(--bg-surface)); color:var(--green-700); } [data-theme="dark"] .rail-item.on{ color:var(--green-300); } .rail-item svg{ width:19px; height:19px; flex-shrink:0; }
.rail-tools{ margin-top:12px; } .tools-lab{ font-family:var(--font-mono); font-size:9px; font-weight:700; letter-spacing:0.12em; text-transform:uppercase; color:var(--ink-400); padding:4px 11px; } .rail-sp{ flex:1; } .rail-foot{ padding-top:8px; border-top:1px solid var(--hairline); }
.appmain{ display:flex; flex-direction:column; min-width:0; min-height:0; overflow:hidden; }
.apphdr{ height:58px; flex-shrink:0; display:flex; align-items:center; gap:12px; padding:0 18px; border-bottom:1px solid var(--hairline); background:var(--glass-bg-strong); }
.apphdr .sp{ flex:1; }
.credits{ display:inline-flex; align-items:center; gap:7px; padding:7px 13px; border-radius:var(--r-pill); background:var(--green-50); border:1px solid var(--green-200); font-size:12.5px; font-weight:600; color:var(--green-800); } .credits .coin{ color:var(--green-600); } .credits .muted{ color:var(--green-700); opacity:.8; font-weight:500; }
.acct{ display:inline-flex; align-items:center; gap:8px; padding:5px 11px 5px 6px; border-radius:var(--r-pill); border:1px solid var(--hairline); background:var(--bg-surface); } .acct .adot{ width:26px; height:26px; border-radius:50%; background:linear-gradient(135deg,var(--green-400),var(--green-700)); color:#fff; font-weight:700; font-size:12px; display:inline-flex; align-items:center; justify-content:center; } .acct .av{ font-size:12.5px; font-weight:600; color:var(--ink-900); max-width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .acct svg{ width:15px; height:15px; color:var(--ink-500); }
.appscroll{ flex:1; overflow:hidden; min-height:0; } .pageinner{ max-width:1200px; margin:0 auto; padding:26px 30px 0; height:100%; display:flex; flex-direction:column; min-height:0; }
/* APP MODEL: only the grid scrolls; page controls (search·sort·filters·New actor) stay put */
.gridcol{ overflow-y:auto; min-height:0; padding-bottom:34px; }

/* ════ ACTORS LIBRARY (V1) ════ */
.pagehead{ display:flex; align-items:flex-start; gap:16px; }
.pagehead .ph-t{ font-family:var(--font-display); font-size:27px; font-weight:800; letter-spacing:-.03em; color:var(--ink-1000); margin:0; }
.pagehead .ph-s{ font-size:13.5px; color:var(--ink-600); margin:7px 0 0; line-height:1.55; max-width:64ch; }
.pagehead .ph-actions{ margin-left:auto; flex-shrink:0; }
.controls{ display:flex; align-items:center; gap:13px; margin:20px 0 16px; }
.searchbox{ display:flex; align-items:center; gap:8px; height:40px; padding:0 13px; border:1px solid var(--hairline-strong); border-radius:var(--r-pill); background:var(--bg-surface); width:280px; }
.searchbox svg{ width:15px; height:15px; color:var(--ink-400); flex-shrink:0; }
.searchbox input{ flex:1; border:none; background:transparent; outline:none; font-size:13px; font-family:inherit; color:var(--ink-900); min-width:0; } .searchbox input::placeholder{ color:var(--ink-400); }
.count{ font-size:12.5px; color:var(--ink-500); } .count b{ color:var(--ink-800); font-weight:600; }
.sortbtn{ display:inline-flex; align-items:center; gap:6px; height:40px; font-size:12.5px; font-weight:600; color:var(--ink-700); border:1px solid var(--hairline-strong); border-radius:var(--r-pill); padding:0 14px; background:var(--bg-surface); } .sortbtn svg{ width:14px; height:14px; color:var(--ink-400); }
.trust{ display:inline-flex; align-items:center; gap:8px; font-size:12px; color:var(--ink-600); line-height:1.45; } .trust svg{ width:14px; height:14px; color:var(--green-600); flex-shrink:0; } .trust b{ color:var(--ink-800); font-weight:600; }
.split{ display:grid; grid-template-columns:194px 1fr; gap:26px; align-items:stretch; flex:1; min-height:0; }
.filtcol{ overflow-y:auto; min-height:0; padding-bottom:18px; }
.fhead{ display:flex; align-items:center; margin-bottom:15px; } .fhead .fttl{ font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-500); } .fhead .clr{ margin-left:auto; font-size:11px; font-weight:600; color:var(--green-700); background:none; border:none; }
.fgroup{ margin-bottom:18px; } .fl{ font-size:10px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--ink-400); margin-bottom:9px; }
.fchips{ display:flex; flex-wrap:wrap; gap:6px; }
.fchip{ font-size:11.5px; font-weight:500; color:var(--ink-700); border:1px solid var(--hairline-strong); background:var(--bg-surface); border-radius:var(--r-pill); padding:6px 12px; }
.fchip:hover{ border-color:var(--green-400); } .fchip.on{ border-color:var(--green-500); background:var(--sel-bg); color:var(--green-700); font-weight:600; }
.grid5{ display:grid; grid-template-columns:repeat(5,1fr); gap:14px; }
@media(max-width:1240px){ .grid5{ grid-template-columns:repeat(4,1fr); } }

.acard{ position:relative; border:1px solid var(--hairline-strong); border-radius:var(--r-md); background:var(--bg-surface); overflow:hidden; padding:0; text-align:left; transition:border-color var(--d-fast),box-shadow var(--d-fast),transform var(--d-fast); display:block; min-width:0; }
.acard:hover{ border-color:var(--green-400); }
.acard .face{ position:relative; aspect-ratio:3/4; background:var(--media-well); overflow:hidden; display:block; } .acard .face img{ width:100%; height:100%; object-fit:cover; }
.acard .own{ display:none; }
.fav{ position:absolute; top:9px; right:9px; z-index:3; width:30px; height:30px; border-radius:50%; background:rgba(0,0,0,.42); backdrop-filter:blur(4px); display:flex; align-items:center; justify-content:center; opacity:0; transition:opacity var(--d-fast),transform var(--d-fast); }
.acard:hover .fav{ opacity:1; } .fav:hover{ transform:scale(1.08); } .fav svg{ width:15px; height:15px; color:#fff; fill:none; } .fav.on{ opacity:1; background:rgba(0,0,0,.58); } .fav.on svg{ fill:#fff; }
.fplay{ position:absolute; inset:0; display:flex; align-items:flex-end; justify-content:flex-start; padding:10px; opacity:0; transition:opacity var(--d-fast); background:linear-gradient(to top,rgba(0,0,0,.4),transparent 55%); }
.acard:hover .fplay{ opacity:1; } .fplay .pb{ display:inline-flex; align-items:center; gap:6px; background:rgba(0,0,0,.62); backdrop-filter:blur(6px); color:#fff; font-size:10px; font-weight:700; border-radius:99px; padding:5px 11px; } .fplay svg{ width:11px; height:11px; fill:#fff; color:#fff; }
.aname{ display:flex; align-items:center; gap:6px; padding:10px 12px; font-size:13px; font-weight:600; color:var(--ink-1000); min-width:0; } .aname .nm{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .aname .badge{ margin-left:auto; flex-shrink:0; }
.acard.create{ border-style:dashed; background:var(--bg-canvas); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; min-height:100%; color:var(--ink-700); } .acard.create:hover{ transform:translateY(-2px); }
.acard.create .ic{ width:44px; height:44px; border-radius:50%; background:var(--green-50); color:var(--green-600); display:flex; align-items:center; justify-content:center; } .acard.create .ic svg{ width:21px; height:21px; }
.acard.create .t{ font-size:13px; font-weight:700; color:var(--ink-1000); } .acard.create .d{ font-size:10.5px; color:var(--ink-500); }
.badge{ display:inline-flex; align-items:center; gap:3px; font-size:9px; font-weight:700; border-radius:var(--r-pill); padding:2px 7px; white-space:nowrap; } .badge svg{ width:9px; height:9px; }
.badge.ai{ background:var(--ink-100); color:var(--ink-600); } .badge.gen{ background:var(--ink-100); color:var(--ink-600); } .badge.clone{ background:var(--ink-100); color:var(--ink-600); }
.badge.human{ background:var(--green-50); color:var(--green-700); border:1px solid var(--green-200); }

/* ════ overlays ════ */
.scrim{ position:fixed; inset:0; z-index:100; background:color-mix(in srgb,var(--ink-1000) 45%,transparent); backdrop-filter:blur(3px); display:none; align-items:center; justify-content:center; padding:24px; } .scrim.on{ display:flex; }
.sheet{ width:760px; max-width:100%; max-height:90vh; overflow:auto; background:var(--bg-surface); border:1px solid var(--hairline); border-radius:var(--r-lg); box-shadow:var(--shadow-xl); animation:rise var(--d-base) var(--ease-out); position:relative; }
@keyframes rise{ from{opacity:0; transform:translateY(10px)} to{opacity:1; transform:none} }
.sheet-x{ position:absolute; top:16px; right:16px; width:34px; height:34px; border-radius:50%; border:1px solid var(--hairline-strong); background:var(--bg-surface); display:inline-flex; align-items:center; justify-content:center; color:var(--ink-600); z-index:3; } .sheet-x svg{ width:16px; height:16px; }
/* actor detail */
.adetail{ display:grid; grid-template-columns:288px 1fr; } @media(max-width:680px){ .adetail{ grid-template-columns:1fr; } }
.ad-face{ position:relative; background:var(--media-well); aspect-ratio:3/4; } .ad-face img{ width:100%; height:100%; object-fit:cover; }
.ad-face .play{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; } .ad-face .play .pp{ width:56px; height:56px; border-radius:50%; background:rgba(255,255,255,.92); display:flex; align-items:center; justify-content:center; box-shadow:var(--shadow-lg); } .ad-face .play .pp svg{ width:23px; height:23px; fill:var(--ink-1000); margin-left:2px; }
.ad-body{ padding:28px 30px; } .ad-name{ font-family:var(--font-display); font-size:24px; font-weight:800; letter-spacing:-.02em; color:var(--ink-1000); display:flex; align-items:center; gap:10px; } .ad-meta{ font-size:12.5px; color:var(--ink-600); margin-top:9px; line-height:1.55; }
.ad-langs{ display:flex; gap:6px; margin-top:15px; flex-wrap:wrap; } .ad-langs .lg{ font-size:11px; font-weight:600; color:var(--ink-700); border:1px solid var(--hairline-strong); border-radius:var(--r-pill); padding:4px 11px; }
.ad-licence{ display:flex; gap:9px; margin-top:17px; padding:13px 15px; border:1px solid var(--green-200); background:var(--green-50); border-radius:var(--r-md); font-size:12px; color:var(--green-800); line-height:1.5; }
[data-theme="dark"] .ad-licence{ background:color-mix(in srgb,var(--green-500) 12%,var(--bg-surface)); } .ad-licence svg{ width:16px; height:16px; color:var(--green-600); flex-shrink:0; margin-top:1px; }
.ad-cta{ display:flex; align-items:center; gap:10px; margin-top:23px; flex-wrap:wrap; }
.ad-manage{ margin-top:19px; padding-top:17px; border-top:1px solid var(--hairline); display:flex; gap:8px; flex-wrap:wrap; }
.minibtn{ display:inline-flex; align-items:center; gap:6px; height:36px; padding:0 13px; border-radius:var(--r-pill); border:1px solid var(--hairline-strong); background:var(--bg-surface); font-size:12px; font-weight:600; color:var(--ink-700); } .minibtn:hover{ background:var(--ink-100); color:var(--ink-1000); } .minibtn svg{ width:14px; height:14px; } .minibtn.danger:hover{ color:var(--danger); border-color:color-mix(in srgb,var(--danger) 40%,var(--hairline-strong)); }
/* create chooser — name + description on SEPARATE lines (DESIGN.md tool-row law) */
.create-sheet{ width:560px; padding:30px 30px 26px; }
.create-sheet h3{ font-family:var(--font-display); font-size:21px; font-weight:800; letter-spacing:-.02em; margin:0; color:var(--ink-1000); }
.create-sheet .csub{ font-size:13px; color:var(--ink-600); margin:8px 0 22px; line-height:1.5; }
.copt{ display:flex; align-items:center; gap:15px; padding:17px; border:1px solid var(--hairline-strong); border-radius:var(--r-md); background:var(--bg-surface); text-align:left; width:100%; margin-bottom:11px; transition:all var(--d-fast); }
.copt:hover{ border-color:var(--green-400); box-shadow:var(--shadow-sm); }
.copt .ci{ width:46px; height:46px; border-radius:var(--r-md); background:var(--accent-soft); border:1px solid var(--accent-border); color:var(--green-600); display:flex; align-items:center; justify-content:center; flex-shrink:0; } .copt .ci svg{ width:22px; height:22px; }
.copt .ctxt{ display:flex; flex-direction:column; gap:4px; min-width:0; }
.copt .cn{ font-size:14.5px; font-weight:700; color:var(--ink-1000); line-height:1.3; } .copt .cd{ font-size:12px; color:var(--ink-500); line-height:1.5; }
.copt .car{ margin-left:auto; color:var(--ink-400); align-self:center; } .copt .car svg{ width:18px; height:18px; }
/* grouped chooser — AI actors (Generate · Upload) + From a real person (Clone) */
.cgroup-label{ font-family:var(--font-mono); font-size:9.5px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-400); margin:18px 0 9px; display:flex; align-items:center; gap:7px; }
.cgroup-label:first-of-type{ margin-top:2px; } .cgroup-label .gx{ width:12px; height:12px; color:var(--green-700); }
.cgrid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.mcard{ display:flex; flex-direction:column; gap:9px; padding:15px; border:1px solid var(--hairline-strong); border-radius:var(--r-md); background:var(--bg-surface); text-align:left; transition:all var(--d-fast); }
.mcard:hover{ border-color:var(--green-400); box-shadow:var(--shadow-sm); }
.mcard .mi{ width:40px; height:40px; border-radius:var(--r-md); background:var(--accent-soft); border:1px solid var(--accent-border); color:var(--green-600); display:flex; align-items:center; justify-content:center; } .mcard .mi svg{ width:20px; height:20px; }
.mcard .mn{ font-size:13.5px; font-weight:700; color:var(--ink-1000); } .mcard .md{ font-size:11.5px; color:var(--ink-500); line-height:1.45; }
.mcard.wide{ flex-direction:row; align-items:center; gap:14px; }
.mcard.wide .ctxt2{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.mcard.wide .car{ margin-left:auto; color:var(--ink-400); flex-shrink:0; } .mcard.wide .car svg{ width:18px; height:18px; }

/* ════ wizard (Generate / Clone flows) ════ */
.wiz{ width:680px; }
.wiz-head{ padding:24px 28px 0; }
.wiz-eyebrow{ display:inline-flex; align-items:center; gap:7px; font-family:var(--font-mono); font-size:10px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--green-700); } .wiz-eyebrow svg{ width:13px; height:13px; }
.wiz-title{ font-family:var(--font-display); font-size:21px; font-weight:800; letter-spacing:-.02em; color:var(--ink-1000); margin:9px 0 3px; }
.wiz-sub{ font-size:12.5px; color:var(--ink-600); line-height:1.5; }
.wiz-dots{ display:flex; gap:6px; margin:16px 0 0; } .wiz-dots .d{ height:4px; flex:1; border-radius:99px; background:var(--ink-100); } .wiz-dots .d.on{ background:var(--green-500); } .wiz-dots .d.done{ background:var(--green-300); }
.wiz-body{ padding:20px 28px 8px; min-height:200px; }
.wiz-foot{ display:flex; align-items:center; gap:10px; padding:16px 28px 22px; border-top:1px solid var(--hairline); margin-top:8px; } .wiz-foot .sp{ flex:1; } .wiz-foot .fcost{ font-size:12px; color:var(--ink-500); } .wiz-foot .fcost b{ color:var(--ink-800); }
.wlab{ font-size:12px; font-weight:600; color:var(--ink-800); margin-bottom:8px; display:block; }
.wtext{ width:100%; min-height:96px; border:1.5px solid var(--hairline-strong); border-radius:var(--r-md); background:var(--bg-surface); padding:13px 14px; font-family:inherit; font-size:13.5px; color:var(--ink-1000); resize:vertical; outline:none; line-height:1.55; } .wtext:focus{ border-color:var(--green-500); box-shadow:var(--focus-ring); } .wtext::placeholder{ color:var(--ink-400); }
.winput{ width:100%; height:46px; border:1.5px solid var(--hairline-strong); border-radius:var(--r-md); background:var(--bg-surface); padding:0 14px; font-family:inherit; font-size:14px; color:var(--ink-1000); outline:none; } .winput:focus{ border-color:var(--green-500); box-shadow:var(--focus-ring); }
.wqrow{ display:flex; flex-wrap:wrap; gap:18px; margin-top:18px; } .wqg .wql{ font-size:10px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--ink-400); margin-bottom:7px; display:block; }
.wnote{ display:flex; align-items:center; gap:8px; margin-top:18px; font-size:12px; color:var(--ink-500); } .wnote svg{ width:14px; height:14px; color:var(--green-600); }
.wopts{ display:grid; grid-template-columns:repeat(4,1fr); gap:11px; } @media(max-width:620px){ .wopts{ grid-template-columns:repeat(2,1fr); } }
.wopt{ position:relative; border:1.5px solid var(--hairline-strong); border-radius:var(--r-md); overflow:hidden; padding:0; background:var(--media-well); aspect-ratio:3/4; } .wopt img{ width:100%; height:100%; object-fit:cover; } .wopt:hover{ border-color:var(--green-400); }
.wopt.on{ border-color:var(--green-500); box-shadow:0 0 0 3px color-mix(in srgb,var(--green-500) 16%,transparent); } .wopt .tick{ position:absolute; top:7px; right:7px; width:20px; height:20px; border-radius:50%; background:var(--green-500); color:#fff; display:none; align-items:center; justify-content:center; } .wopt.on .tick{ display:flex; } .wopt .tick svg{ width:12px; height:12px; }
.wpick{ display:flex; gap:16px; align-items:center; } .wpick .pf{ width:96px; aspect-ratio:3/4; border-radius:var(--r-md); overflow:hidden; background:var(--media-well); flex-shrink:0; } .wpick .pf img{ width:100%; height:100%; object-fit:cover; }
.wchoice{ display:grid; grid-template-columns:1fr 1fr; gap:12px; } @media(max-width:620px){ .wchoice{ grid-template-columns:1fr; } }
.wbig{ display:flex; flex-direction:column; gap:9px; padding:20px; border:1.5px solid var(--hairline-strong); border-radius:var(--r-md); background:var(--bg-surface); text-align:left; transition:all var(--d-fast); }
.wbig:hover{ border-color:var(--green-400); box-shadow:var(--shadow-sm); } .wbig.on{ border-color:var(--green-500); background:var(--sel-bg); }
.wbig .bi{ width:42px; height:42px; border-radius:var(--r-md); background:var(--accent-soft); border:1px solid var(--accent-border); color:var(--green-600); display:flex; align-items:center; justify-content:center; } .wbig .bi svg{ width:21px; height:21px; }
.wbig .bn{ font-size:14px; font-weight:700; color:var(--ink-1000); } .wbig .bd{ font-size:12px; color:var(--ink-500); line-height:1.45; }
.wdrop{ border:1.5px dashed var(--hairline-strong); border-radius:var(--r-md); padding:30px 20px; text-align:center; background:var(--bg-canvas); } .wdrop .di{ width:46px; height:46px; border-radius:50%; background:var(--green-50); color:var(--green-600); display:inline-flex; align-items:center; justify-content:center; margin-bottom:11px; } .wdrop .di svg{ width:22px; height:22px; } .wdrop .dt{ font-size:13.5px; font-weight:700; color:var(--ink-1000); } .wdrop .dd{ font-size:12px; color:var(--ink-500); margin-top:4px; }
.wtips{ margin-top:16px; display:grid; gap:8px; } .wtip{ display:flex; align-items:center; gap:9px; font-size:12px; color:var(--ink-600); } .wtip svg{ width:15px; height:15px; color:var(--green-600); flex-shrink:0; }
.wcheck{ display:flex; gap:11px; align-items:flex-start; padding:15px; border:1.5px solid var(--hairline-strong); border-radius:var(--r-md); background:var(--bg-surface); cursor:pointer; } .wcheck.on{ border-color:var(--green-500); background:var(--sel-bg); }
.wcheck .box{ width:20px; height:20px; border-radius:6px; border:1.5px solid var(--hairline-strong); display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-top:1px; color:#fff; } .wcheck.on .box{ background:var(--green-500); border-color:var(--green-500); } .wcheck .box svg{ width:13px; height:13px; opacity:0; } .wcheck.on .box svg{ opacity:1; } .wcheck .ct{ font-size:12.5px; color:var(--ink-800); line-height:1.5; }
.wbuild{ text-align:center; padding:14px 0 8px; } .wring{ width:96px; height:96px; margin:0 auto 16px; position:relative; } .wring svg{ transform:rotate(-90deg); } .wring .pc{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-family:var(--font-display); font-weight:800; font-size:20px; color:var(--ink-1000); }
.wbuild .bt{ font-size:16px; font-weight:700; color:var(--ink-1000); } .wbuild .bd{ font-size:12.5px; color:var(--ink-600); margin-top:7px; line-height:1.55; max-width:42ch; margin-left:auto; margin-right:auto; }
/* toast */
.toast{ position:fixed; left:50%; bottom:24px; transform:translateX(-50%) translateY(20px); opacity:0; z-index:120; display:flex; align-items:center; gap:13px; max-width:440px; padding:14px 18px; border-radius:var(--r-lg); background:var(--ink-1000); color:var(--ink-0); box-shadow:var(--shadow-xl); transition:all var(--d-base) var(--ease-out); } [data-theme="dark"] .toast{ background:var(--bg-surface); color:var(--ink-1000); border:1px solid var(--hairline-strong); } .toast.on{ opacity:1; transform:translateX(-50%) translateY(0); }
.toast .tic{ width:34px; height:34px; border-radius:50%; background:linear-gradient(135deg,var(--green-500),var(--green-700)); color:#fff; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; } .toast .tic svg{ width:18px; height:18px; } .toast .tt{ font-size:13px; font-weight:700; } .toast .ts{ font-size:11.5px; opacity:.8; margin-top:2px; }
@media (max-width:860px){ .app{ grid-template-columns:1fr; } .rail{ display:none; } .appscroll{ overflow-y:auto; } .pageinner{ height:auto; display:block; } .split{ display:block; } .filtcol,.gridcol{ overflow:visible; } }
/* ── sort menu ── */
.sortwrap{ position:relative; }
.sortmenu{ position:absolute; right:0; top:46px; min-width:184px; background:var(--bg-surface); border:1px solid var(--hairline-strong); border-radius:var(--r-md); box-shadow:var(--shadow-lg); padding:5px; z-index:30; display:none; }
.sortmenu.on{ display:block; }
.sortmenu button{ display:flex; width:100%; padding:9px 11px; border:none; background:none; border-radius:var(--r-sm); font-size:12.5px; font-weight:600; color:var(--ink-700); text-align:left; } .sortmenu button:hover{ background:var(--hover-surface); color:var(--ink-1000); }
/* ── on-card actions (replace the detail dialog) ── */
.fplay{ display:none; }
.carduse{ position:absolute; left:8px; right:8px; bottom:8px; z-index:3; display:inline-flex; align-items:center; justify-content:center; gap:6px; height:32px; border:none; border-radius:var(--r-pill); background:linear-gradient(135deg,var(--green-500),var(--green-600)); color:#fff; font-size:11.5px; font-weight:700; opacity:0; transform:translateY(5px); transition:opacity var(--d-fast),transform var(--d-fast); } .carduse svg{ width:13px; height:13px; }
.acard:hover .carduse{ opacity:1; transform:none; }
.cardmanage{ position:absolute; top:9px; right:45px; z-index:3; width:30px; height:30px; border-radius:50%; background:rgba(0,0,0,.42); backdrop-filter:blur(4px); color:#fff; border:none; display:flex; align-items:center; justify-content:center; opacity:0; transition:opacity var(--d-fast); } .cardmanage svg{ width:15px; height:15px; } .acard:hover .cardmanage{ opacity:1; }
/* play affordance (only actors with a video) · clickable cue (only Verified/human actors) */
.cardplay{ position:absolute; top:9px; left:9px; z-index:3; width:30px; height:30px; border-radius:50%; background:rgba(0,0,0,.42); backdrop-filter:blur(4px); color:#fff; display:flex; align-items:center; justify-content:center; opacity:0; transition:opacity var(--d-fast); } .cardplay svg{ width:14px; height:14px; fill:#fff; } .acard:hover .cardplay{ opacity:1; }
.acard.clickable{ cursor:pointer; }
.cardview{ position:absolute; left:8px; right:8px; bottom:8px; z-index:3; display:inline-flex; align-items:center; justify-content:center; gap:6px; height:30px; border-radius:var(--r-pill); background:rgba(0,0,0,.62); backdrop-filter:blur(6px); color:#fff; font-size:11px; font-weight:700; opacity:0; transform:translateY(5px); transition:opacity var(--d-fast),transform var(--d-fast); } .cardview svg{ width:13px; height:13px; } .acard:hover .cardview{ opacity:1; transform:none; }
/* ── generate results ── */
.genres{ display:grid; grid-template-columns:repeat(2,1fr); gap:12px; } .genres.one{ grid-template-columns:1fr; max-width:220px; }
.genitem{ display:flex; flex-direction:column; gap:8px; }
.genitem .gf{ position:relative; aspect-ratio:3/4; border-radius:var(--r-md); overflow:hidden; background:var(--media-well); } .genitem .gf img{ width:100%; height:100%; object-fit:cover; }
.genitem .gx{ position:absolute; top:7px; right:7px; width:26px; height:26px; border-radius:50%; background:rgba(0,0,0,.55); color:#fff; border:none; display:flex; align-items:center; justify-content:center; } .genitem .gx svg{ width:13px; height:13px; }
.genitem .gn{ height:38px; }
/* ── creator profile (shared content; 3 shapes: modal · expand-in-place · full page) ── */
.cprofile{ display:grid; grid-template-columns:300px 1fr; align-items:stretch; }
@media(max-width:640px){ .cprofile{ grid-template-columns:1fr; } }
.cp2-media{ position:relative; background:var(--media-well); min-height:300px; }
.cp2-media img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.cp2-play{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; } .cp2-play .pp{ width:54px; height:54px; border-radius:50%; background:rgba(255,255,255,.92); display:flex; align-items:center; justify-content:center; box-shadow:var(--shadow-lg); } .cp2-play .pp svg{ width:22px; height:22px; fill:var(--ink-1000); margin-left:2px; }
.cp2-info{ padding:26px 28px 28px; min-width:0; }
.cp2-name{ font-family:var(--font-display); font-size:24px; font-weight:800; letter-spacing:-.02em; color:var(--ink-1000); display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.cp2-verif{ display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:700; color:var(--green-700); background:var(--green-50); border:1px solid var(--green-200); border-radius:var(--r-pill); padding:3px 9px; } .cp2-verif svg{ width:12px; height:12px; }
.cp2-lic{ display:flex; align-items:center; gap:7px; font-size:12px; color:var(--ink-500); margin-top:9px; } .cp2-lic svg{ width:14px; height:14px; color:var(--green-600); }
.cp2-bio{ font-size:13px; color:var(--ink-700); line-height:1.6; margin:15px 0 0; max-width:52ch; }
.cp2-stats{ display:flex; gap:24px; margin-top:16px; } .cp2-stats .v{ font-family:var(--font-display); font-size:17px; font-weight:800; color:var(--ink-1000); } .cp2-stats .k{ font-size:11px; color:var(--ink-500); }
.cp2-sec{ font-family:var(--font-mono); font-size:9px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-400); margin:22px 0 10px; }
.cp2-social{ display:flex; align-items:center; gap:11px; padding:11px 12px; border:1px solid var(--hairline-strong); border-radius:var(--r-md); margin-bottom:8px; text-decoration:none; color:var(--ink-900); max-width:380px; } .cp2-social:hover{ border-color:var(--green-400); }
.cp2-social .si{ width:34px; height:34px; border-radius:9px; background:var(--ink-100); color:var(--ink-700); display:flex; align-items:center; justify-content:center; flex-shrink:0; } .cp2-social .si svg{ width:18px; height:18px; }
.cp2-social .sh{ font-size:13px; font-weight:600; display:block; } .cp2-social .sm{ font-size:11px; color:var(--ink-500); }
.cp2-social .sv{ margin-left:auto; color:var(--green-600); display:inline-flex; } .cp2-social .sv svg{ width:16px; height:16px; }
.cp2-fav{ display:inline-flex; align-items:center; justify-content:center; gap:8px; height:44px; padding:0 22px; margin-top:24px; border-radius:var(--r-pill); border:1px solid var(--hairline-strong); background:var(--bg-surface); font-size:13.5px; font-weight:600; color:var(--ink-800); cursor:pointer; } .cp2-fav svg{ width:16px; height:16px; } .cp2-fav.on{ color:var(--green-700); border-color:var(--green-400); background:var(--accent-soft); } .cp2-fav.on svg{ fill:var(--green-600); }
.cp2-x{ position:absolute; top:14px; right:14px; width:34px; height:34px; border-radius:50%; border:1px solid var(--hairline-strong); background:color-mix(in srgb,var(--bg-surface) 82%,transparent); backdrop-filter:blur(6px); display:inline-flex; align-items:center; justify-content:center; color:var(--ink-700); z-index:4; } .cp2-x svg{ width:16px; height:16px; }
/* shape: modal (center popup) */
.cmodal-sheet{ width:740px; max-width:100%; max-height:90vh; overflow:auto; background:var(--bg-surface); border:1px solid var(--hairline); border-radius:var(--r-lg); box-shadow:var(--shadow-xl); position:relative; animation:rise var(--d-base) var(--ease-out); }
/* shape: expand-in-place (spans the grid) */
.acard-expand{ grid-column:1 / -1; position:relative; border:1px solid var(--green-400); border-radius:var(--r-md); background:var(--bg-surface); overflow:hidden; box-shadow:var(--shadow-md); animation:expandin var(--d-base) var(--ease-out); }
@keyframes expandin{ from{opacity:0; transform:translateY(-6px)} to{opacity:1; transform:none} }
/* shape: full page */
.cpage{ position:fixed; inset:0; z-index:120; background:var(--bg-canvas); overflow-y:auto; display:none; } .cpage.on{ display:block; animation:rise var(--d-base) var(--ease-out); }
.cpage-top{ height:56px; display:flex; align-items:center; padding:0 22px; border-bottom:1px solid var(--hairline); background:var(--glass-bg-strong); position:sticky; top:0; z-index:2; }
.cpage-back{ display:inline-flex; align-items:center; gap:7px; font-size:13px; font-weight:600; color:var(--ink-700); background:none; border:none; cursor:pointer; } .cpage-back svg{ width:16px; height:16px; }
.cpage-inner{ max-width:940px; margin:0 auto; padding:32px 30px 60px; }
.cpage-inner .cprofile{ grid-template-columns:360px 1fr; border:1px solid var(--hairline); border-radius:var(--r-lg); overflow:hidden; }
/* shape switcher (review aid) */
.shapeswitch{ position:fixed; left:50%; bottom:20px; transform:translateX(-50%); z-index:135; display:flex; align-items:center; gap:6px; padding:7px 9px 7px 15px; background:var(--ink-1000); color:var(--ink-0); border-radius:var(--r-pill); box-shadow:var(--shadow-xl); font-size:12px; }
[data-theme="dark"] .shapeswitch{ background:var(--bg-surface); color:var(--ink-1000); border:1px solid var(--hairline-strong); }
.shapeswitch .ss-l{ opacity:.65; font-weight:500; margin-right:3px; }
.shapeswitch button{ border:none; background:transparent; color:inherit; opacity:.55; font-size:12px; font-weight:700; padding:6px 12px; border-radius:var(--r-pill); cursor:pointer; } .shapeswitch button.on{ opacity:1; background:linear-gradient(135deg,var(--green-500),var(--green-600)); color:#fff; }

/* ════════════════════════════════════════
   SURFACE: common/generating-results.html
   ════════════════════════════════════════ */

/* ---- common/generating-results.html :: style block 0 ---- */
/* ════ DS ALIAS LAYER — copied verbatim from the render-ds reference (§4c) ════ */
:root{
  --font-display:var(--amp-hexcoded-font-display); --font-body:var(--amp-hexcoded-font-body); --font-mono:var(--amp-hexcoded-font-mono);
  --green-50:var(--amp-hexcoded-theme-color-accent-whisper); --green-100:var(--amp-hexcoded-color-green-100);
  --green-200:color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 28%,var(--amp-hexcoded-color-white));
  --green-400:color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 72%,var(--amp-hexcoded-color-white));
  --green-500:var(--amp-hexcoded-theme-color-accent); --green-600:var(--amp-hexcoded-theme-color-accent-deep);
  --green-700:color-mix(in srgb,var(--amp-hexcoded-theme-color-accent-deep) 80%,var(--amp-hexcoded-color-black));
  --ink-0:var(--amp-hexcoded-theme-color-bg-elev); --ink-50:var(--amp-hexcoded-theme-color-bg); --ink-100:var(--amp-hexcoded-theme-color-bg-soft);
  --ink-300:color-mix(in srgb,var(--amp-hexcoded-theme-color-bg-elev) 80%,var(--amp-hexcoded-theme-color-text-primary));
  --ink-400:color-mix(in srgb,var(--amp-hexcoded-theme-color-bg-elev) 58%,var(--amp-hexcoded-theme-color-text-primary));
  --ink-500:var(--amp-hexcoded-theme-color-text-tertiary);
  --ink-600:color-mix(in srgb,var(--amp-hexcoded-theme-color-text-tertiary) 60%,var(--amp-hexcoded-theme-color-text-primary));
  --ink-700:var(--amp-hexcoded-theme-color-text-secondary);
  --ink-900:color-mix(in srgb,var(--amp-hexcoded-theme-color-text-primary) 88%,var(--amp-hexcoded-theme-color-bg-elev));
  --ink-1000:var(--amp-hexcoded-theme-color-text-primary);
  --bg-canvas:var(--amp-hexcoded-theme-color-bg); --bg-surface:var(--amp-hexcoded-theme-color-bg-elev);
  --bg-elevated:var(--amp-hexcoded-theme-color-bg-elev);
  --hairline:color-mix(in srgb,var(--amp-hexcoded-theme-color-border) 60%,transparent); --hairline-strong:var(--amp-hexcoded-theme-color-border);
  --shadow-xs:var(--amp-hexcoded-shadow-1); --shadow-md:var(--amp-hexcoded-shadow-3); --shadow-xl:var(--amp-hexcoded-shadow-5);
  --shadow-green-soft:0 8px 20px color-mix(in srgb,var(--amp-hexcoded-theme-color-accent) 14%,transparent);
  --r-sm:var(--amp-hexcoded-radius-md); --r-md:var(--amp-hexcoded-radius-lg); --r-lg:var(--amp-hexcoded-radius-xl); --r-pill:var(--amp-hexcoded-radius-full);
  --d-fast:var(--amp-hexcoded-motion-d-fast);
  --media-well:#0a0a0c;
}
*,*::before,*::after{box-sizing:border-box;}
body{margin:0;font-family:var(--font-body);color:var(--ink-900);background:var(--bg-canvas);}
button{font-family:inherit;cursor:pointer;}
.hexwm{position:relative;display:inline-block;font-family:var(--font-display),Outfit,sans-serif;font-weight:900;letter-spacing:-.025em;color:var(--ink-1000);z-index:0;isolation:isolate;}
.hexwm::before,.hexwm::after,.hexwm .ph{content:attr(data-text);position:absolute;left:0;top:0;color:#22C55E;z-index:-1;}
.hexwm::before{transform:translate(1px,1px);opacity:.85;--ph:.85;animation:hexph 3s ease-in-out infinite;}
.hexwm .ph{transform:translate(2px,2px);opacity:.55;--ph:.55;animation:hexph 3s ease-in-out infinite .1s;}
.hexwm::after{transform:translate(3px,3px);opacity:.32;--ph:.32;animation:hexph 3s ease-in-out infinite .2s;}
@keyframes hexph{0%,100%{opacity:var(--ph,.85);}50%{opacity:calc(var(--ph,.85)*.4);}}
@media (prefers-reduced-motion:reduce){.hexwm::before,.hexwm::after,.hexwm .ph{animation:none;}}

.topbar{position:sticky;top:0;z-index:50;display:flex;align-items:center;gap:16px;padding:14px 28px;background:color-mix(in srgb,var(--bg-surface) 88%,transparent);backdrop-filter:blur(20px) saturate(180%);border-bottom:1px solid var(--hairline);}
.topbar .hexwm{font-size:20px;}
.topbar .tag{font-family:var(--font-mono);font-size:10px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--green-700);background:var(--green-50);border:1px solid var(--green-200);border-radius:var(--r-pill);padding:4px 10px;}
.topbar .lock{font-family:var(--font-mono);font-size:10px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:#fff;background:var(--green-600);border-radius:var(--r-pill);padding:4px 10px;}
.topbar .spacer{flex:1;}
.theme-ic{width:32px;height:32px;border-radius:50%;border:1px solid var(--hairline-strong);background:var(--bg-surface);color:var(--ink-700);font-size:14px;display:inline-flex;align-items:center;justify-content:center;}

.intro{max-width:920px;margin:0 auto;padding:30px 28px 4px;}
.intro h1{font-size:24px;font-weight:700;letter-spacing:-.03em;margin:0 0 8px;}
.intro h1 em{font-style:normal;color:var(--green-600);}
.intro p{font-size:14px;color:var(--ink-600);line-height:1.55;margin:0;max-width:760px;}
.intro .used{margin-top:12px;font-size:12px;color:var(--ink-500);}
.intro .used b{color:var(--ink-700);font-family:var(--font-mono);font-size:10px;letter-spacing:.06em;text-transform:uppercase;}

.spec{max-width:920px;margin:0 auto;padding:14px 28px 80px;}
.pair{display:grid;gap:22px;grid-template-columns:1fr 1fr;align-items:start;}
@media(max-width:760px){.pair{grid-template-columns:1fr;}}
.unit{background:var(--bg-surface);border:1px solid var(--hairline);border-radius:var(--r-lg);box-shadow:var(--shadow-md);padding:24px 20px 26px;}
.ulabel{display:flex;align-items:baseline;gap:9px;margin-bottom:18px;}
.ulabel .uk{font-family:var(--font-mono);font-size:10px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--green-600);}
.ulabel .un{font-size:14px;font-weight:700;color:var(--ink-1000);}
.ulabel .ut{font-size:11.5px;color:var(--ink-500);}

/* ── generating (G-H) ── */
.genframe{position:relative;border-radius:18px;overflow:hidden;background:var(--media-well);margin:0 auto;width:188px;aspect-ratio:9/16;}
.genframe .mesh{position:absolute;inset:0;background:radial-gradient(120% 90% at 50% 0%,#0e2a1a,#07120c 72%);}
.genframe .shimmer{position:absolute;inset:0;background:linear-gradient(100deg,transparent 30%,rgba(134,239,172,.12) 50%,transparent 70%);animation:shz 2.4s linear infinite;}
@keyframes shz{0%{transform:translateX(-100%);}100%{transform:translateX(100%);}}
.genframe .wm{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;}
.genframe .wm .hexwm{font-size:15px;color:#fff;}
.ring{position:relative;width:48px;height:48px;margin:16px auto 0;}
.ring svg{width:48px;height:48px;transform:rotate(-90deg);display:block;}
.ring circle{fill:none;stroke-width:6;}
.ring .ring-bg{stroke:var(--ink-100);}
.ring .ring-fg{stroke:var(--green-500);stroke-linecap:round;stroke-dasharray:201.06;stroke-dashoffset:201.06;transition:stroke-dashoffset .25s linear;}
.ring .ring-num{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-family:var(--font-body);font-weight:700;font-size:11px;color:var(--ink-900);font-variant-numeric:tabular-nums;}
.gline{text-align:center;margin-top:12px;font-size:13.5px;font-weight:600;color:var(--ink-1000);}
.gsub{text-align:center;margin-top:5px;font-size:11.5px;color:var(--ink-500);line-height:1.5;}

/* ── results (R-E) ── */
.player{position:relative;border-radius:18px;overflow:hidden;background:var(--media-well);box-shadow:var(--shadow-xl);margin:0 auto;width:212px;aspect-ratio:9/16;}
.player img.bgimg{width:100%;height:100%;object-fit:cover;display:block;position:absolute;inset:0;}
.player .grade{position:absolute;inset:0;background:linear-gradient(0deg,rgba(0,0,0,.55),transparent 45%);}
.player .cap{position:absolute;left:12px;right:12px;bottom:42px;text-align:center;font-family:var(--font-display),Outfit;font-weight:900;font-size:13.5px;letter-spacing:-.02em;color:#fff;line-height:1.25;text-shadow:1px 1px 0 rgba(34,197,94,.85),2px 2px 0 rgba(34,197,94,.45);}
.player .sup{position:absolute;left:12px;bottom:12px;background:rgba(255,255,255,.94);border-radius:7px;padding:4px 9px;font-size:9.5px;font-weight:700;color:#111;}
.racts{display:flex;align-items:center;gap:9px;justify-content:center;margin-top:16px;}
.ra{display:inline-flex;align-items:center;gap:7px;padding:9px 14px;border-radius:var(--r-pill);border:1px solid var(--hairline-strong);background:var(--bg-surface);font-size:12.5px;font-weight:600;color:var(--ink-700);}
.ra svg{width:15px;height:15px;}
.ra.dl{background:linear-gradient(135deg,var(--green-500),var(--green-600));color:#fff;border:none;box-shadow:var(--shadow-green-soft);}
.link-q{background:none;border:none;color:var(--ink-500);font-size:12px;font-weight:500;display:inline-flex;align-items:center;gap:6px;padding:0;}
.link-q svg{width:14px;height:14px;}

/* ════════════════════════════════════════
   SURFACE: projects.html
   ════════════════════════════════════════ */

/* ---- projects.html :: style block 0 ---- */
/* ════════════════════════════════════════════════════════════════
   PROJECTS — CANON. Locked: project = a named folder of videos from
   ANY tool (ADR-0036) · list = PR-F pure ledger, thumb·name·count
   only, hover ⋯ Rename/Archive, newest-first, search, auto-naming
   (ADR-0040/0043) · detail = video grid, Generating is the only
   in-flight state · "New video" = PD-A sheet w/ canon H-B start
   tiles verbatim, NO drafts (ADR-0038).
   OPEN (0043): is-it-done home · failed-render UX · timestamps inside.
   ════════════════════════════════════════════════════════════════ */
/* ░ DS ALIAS LAYER — copied verbatim from canon/home.html (§4c) ░ */
:root {
  --font-display: var(--amp-hexcoded-font-display);
  --font-body:    var(--amp-hexcoded-font-body);
  --font-mono:    var(--amp-hexcoded-font-mono);
  --green-50:  var(--amp-hexcoded-theme-color-accent-whisper);
  --green-100: var(--amp-hexcoded-color-green-100);
  --green-200: color-mix(in srgb, var(--amp-hexcoded-theme-color-accent) 28%, var(--amp-hexcoded-color-white));
  --green-300: var(--amp-hexcoded-theme-color-accent-light);
  --green-400: color-mix(in srgb, var(--amp-hexcoded-theme-color-accent) 72%, var(--amp-hexcoded-color-white));
  --green-500: var(--amp-hexcoded-theme-color-accent);
  --green-600: var(--amp-hexcoded-theme-color-accent-deep);
  --green-700: color-mix(in srgb, var(--amp-hexcoded-theme-color-accent-deep) 80%, var(--amp-hexcoded-color-black));
  --green-800: color-mix(in srgb, var(--amp-hexcoded-theme-color-accent-deep) 62%, var(--amp-hexcoded-color-black));
  --ink-100:  var(--amp-hexcoded-theme-color-bg-soft);
  --ink-400:  color-mix(in srgb, var(--amp-hexcoded-theme-color-bg-elev) 58%, var(--amp-hexcoded-theme-color-text-primary));
  --ink-500:  var(--amp-hexcoded-theme-color-text-tertiary);
  --ink-600:  color-mix(in srgb, var(--amp-hexcoded-theme-color-text-tertiary) 60%, var(--amp-hexcoded-theme-color-text-primary));
  --ink-700:  var(--amp-hexcoded-theme-color-text-secondary);
  --ink-900:  color-mix(in srgb, var(--amp-hexcoded-theme-color-text-primary) 88%, var(--amp-hexcoded-theme-color-bg-elev));
  --ink-1000: var(--amp-hexcoded-theme-color-text-primary);
  --bg-canvas:   var(--amp-hexcoded-theme-color-bg);
  --bg-surface:  var(--amp-hexcoded-theme-color-bg-elev);
  --bg-soft:     var(--amp-hexcoded-theme-color-bg-soft);
  --hairline:        color-mix(in srgb, var(--amp-hexcoded-theme-color-border) 60%, transparent);
  --hairline-strong: var(--amp-hexcoded-theme-color-border);
  --glass-bg-strong: color-mix(in srgb, var(--amp-hexcoded-theme-color-bg-elev) 88%, transparent);
  --glass-blur:      blur(20px) saturate(180%);
  --shadow-xs: var(--amp-hexcoded-shadow-1);
  --shadow-sm: var(--amp-hexcoded-shadow-2);
  --shadow-md: var(--amp-hexcoded-shadow-3);
  --shadow-lg: var(--amp-hexcoded-shadow-4);
  --shadow-green:      0 12px 32px color-mix(in srgb, var(--amp-hexcoded-theme-color-accent) 24%, transparent), 0 4px 8px color-mix(in srgb, var(--amp-hexcoded-theme-color-accent) 12%, transparent);
  --shadow-green-soft: 0 8px 20px color-mix(in srgb, var(--amp-hexcoded-theme-color-accent) 14%, transparent);
  --r-sm:   var(--amp-hexcoded-radius-md);
  --r-md:   var(--amp-hexcoded-radius-lg);
  --r-lg:   var(--amp-hexcoded-radius-xl);
  --r-xl:   var(--amp-hexcoded-radius-2xl);
  --r-pill: var(--amp-hexcoded-radius-full);
  --d-fast:     var(--amp-hexcoded-motion-d-fast);
  --d-base:     var(--amp-hexcoded-motion-d-base);
  --danger:  var(--amp-hexcoded-status-danger);
  --warning: var(--amp-hexcoded-status-warning);
  --accent-soft:        color-mix(in srgb, var(--green-500) 9%, var(--bg-surface));
  --accent-soft-strong: color-mix(in srgb, var(--green-500) 15%, var(--bg-surface));
  --accent-border:      color-mix(in srgb, var(--green-500) 30%, var(--hairline));
  --hover-surface-2: color-mix(in srgb, var(--ink-1000) 4%, transparent);
  --media-well: #0a0a0c;
}
*,*::before,*::after{box-sizing:border-box;}
html,body{height:100%;}
body{margin:0;font-family:var(--font-body);color:var(--ink-900);background:var(--bg-canvas);font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased;}
button{font-family:inherit;cursor:pointer;}
a{color:inherit;}

/* ── PHANTOM wordmark (exact render-ds spec — do not modify) ── */
.hexwm{position:relative;display:inline-block;font-family:var(--font-display);font-weight:900;letter-spacing:-.025em;color:var(--ink-1000);z-index:0;isolation:isolate;}
.hexwm::before,.hexwm::after,.hexwm .ph{content:attr(data-text);position:absolute;left:0;top:0;color:#22C55E;z-index:-1;}
.hexwm::before{transform:translate(1px,1px);opacity:.85;--ph:.85;animation:hexph 3s ease-in-out infinite;}
.hexwm .ph{transform:translate(2px,2px);opacity:.55;--ph:.55;animation:hexph 3s ease-in-out infinite .1s;}
.hexwm::after{transform:translate(3px,3px);opacity:.32;--ph:.32;animation:hexph 3s ease-in-out infinite .2s;}
@keyframes hexph{0%,100%{opacity:var(--ph,.85);}50%{opacity:calc(var(--ph,.85)*.4);}}
@media (prefers-reduced-motion:reduce){.hexwm::before,.hexwm::after,.hexwm .ph{animation:none;}}

/* ════ APP SHELL — copied verbatim from canon/home.html ════ */
.app{display:grid;grid-template-columns:236px 1fr;height:100vh;}
.rail{border-right:1px solid var(--hairline);background:var(--bg-surface);display:flex;flex-direction:column;padding:18px 12px 14px;overflow-y:auto;}
.rail-logo{display:block;padding:4px 10px 18px;text-decoration:none;}
.rail-logo .hexwm{font-size:19px;}
.rail-item{display:flex;align-items:center;gap:11px;width:100%;padding:9px 12px;border-radius:var(--r-md);border:none;background:transparent;color:var(--ink-700);font-size:13.5px;font-weight:600;text-align:left;transition:background var(--d-fast),color var(--d-fast);}
.rail-item:hover{background:var(--hover-surface-2);}
.rail-item.on{background:var(--accent-soft-strong);color:var(--green-700);}
.rail-item svg{width:18px;height:18px;flex-shrink:0;}
.rail-item .rl-s{display:block;font-size:10.5px;font-weight:500;color:var(--ink-500);margin-top:1px;}
.tools-lab{font-family:var(--font-mono);font-size:9.5px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-400);padding:18px 12px 7px;}
.rail-spacer{flex:1;}
.rail-foot{border-top:1px solid var(--hairline);padding-top:10px;margin-top:10px;display:flex;flex-direction:column;gap:2px;}

/* ════ MAIN + HEADER — copied verbatim from canon/home.html ════ */
.main{display:flex;flex-direction:column;min-width:0;overflow-y:auto;}
.hdr{position:sticky;top:0;z-index:20;height:58px;flex-shrink:0;display:flex;align-items:center;gap:14px;padding:0 22px;background:var(--glass-bg-strong);backdrop-filter:var(--glass-blur);-webkit-backdrop-filter:var(--glass-blur);border-bottom:1px solid var(--hairline);justify-content:flex-end;}
.brand-pick{display:inline-flex;align-items:center;gap:9px;padding:6px 11px 6px 7px;border-radius:var(--r-pill);border:1px solid var(--hairline);background:var(--bg-surface);transition:all var(--d-fast);}
.brand-pick:hover{background:var(--hover-surface-2);border-color:var(--hairline-strong);}
.brand-pick .bdot{width:26px;height:26px;border-radius:50%;background:linear-gradient(135deg,var(--green-400),var(--green-700));color:#fff;font-weight:700;font-size:12px;display:inline-flex;align-items:center;justify-content:center;}
.brand-pick .blab{display:flex;flex-direction:column;line-height:1.1;text-align:left;}
.brand-pick .blab .k{font-size:9px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-500);}
.brand-pick .blab .v{font-size:12.5px;font-weight:600;color:var(--ink-900);}
.brand-pick svg{width:15px;height:15px;color:var(--ink-500);}
.credits{display:inline-flex;align-items:center;gap:7px;padding:7px 13px;border-radius:var(--r-pill);background:var(--green-50);border:1px solid var(--green-200);font-size:12.5px;font-weight:600;color:var(--green-800);}
.credits .coin{color:var(--green-600);}
.credits .muted{color:var(--green-700);font-weight:500;opacity:.8;}
.theme-ic{width:32px;height:32px;border-radius:50%;border:1px solid var(--hairline-strong);background:var(--bg-surface);color:var(--ink-700);font-size:14px;display:inline-flex;align-items:center;justify-content:center;}
.page{max-width:1180px;width:100%;margin:0 auto;padding:32px 36px 90px;}

/* ════ TITLE ROW (list + detail) ════ */
.ptitle{display:flex;align-items:flex-end;gap:14px;margin-bottom:24px;}
.ptitle .tl{min-width:0;}
.ptitle .tl h1{font-family:var(--font-display);font-size:32px;font-weight:800;letter-spacing:-.03em;margin:0;color:var(--ink-1000);}
.ptitle .tl h1[contenteditable]{outline:none;border-radius:var(--r-sm);}
.ptitle .tl h1[contenteditable]:focus{background:var(--hover-surface-2);box-shadow:0 0 0 2px var(--accent-border);}
.ptitle .tl .eyebrow{font-family:var(--font-mono);font-size:10px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--green-700);margin-bottom:6px;display:flex;align-items:center;gap:8px;}
.ptitle .tl .eyebrow a{font-family:var(--font-body);letter-spacing:0;text-transform:none;font-size:11.5px;font-weight:600;color:var(--ink-500);text-decoration:none;display:inline-flex;align-items:center;gap:3px;cursor:pointer;}
.ptitle .tl .eyebrow a:hover{color:var(--green-600);}
.ptitle .tl .eyebrow a svg{width:12px;height:12px;}
.ptitle .tl .sub{font-size:13px;color:var(--ink-500);margin-top:6px;}
.ptitle .sp{flex:1;}
.srch{display:inline-flex;align-items:center;gap:8px;padding:9px 14px;border-radius:var(--r-pill);border:1px solid var(--hairline-strong);background:var(--bg-surface);color:var(--ink-500);font-size:12.5px;min-width:200px;}
.srch svg{width:14px;height:14px;flex-shrink:0;}
.srch input{border:none;background:transparent;outline:none;font:inherit;color:var(--ink-900);width:100%;}
.srch input::placeholder{color:var(--ink-500);}
.btn-primary{display:inline-flex;align-items:center;gap:7px;padding:11px 20px;border-radius:var(--r-md);border:none;font-size:14px;font-weight:700;background:linear-gradient(135deg,var(--amp-hexcoded-theme-color-accent),var(--amp-hexcoded-theme-color-accent-deep));color:var(--amp-hexcoded-color-white);box-shadow:var(--shadow-green-soft);cursor:pointer;flex-shrink:0;}
.btn-primary:hover{background:linear-gradient(135deg,var(--amp-hexcoded-theme-color-accent-deep),var(--green-700));color:var(--amp-hexcoded-color-white);box-shadow:var(--shadow-green);}
.btn-primary svg{width:15px;height:15px;}

/* ════ LEDGER — PR-F locked (ADR-0043) ════ */
.ledger{border-top:1px solid var(--hairline);}
.lrow{position:relative;display:flex;align-items:center;gap:16px;padding:13px 6px;border-bottom:1px solid var(--hairline);cursor:pointer;transition:background var(--d-fast);}
.lrow:hover{background:var(--hover-surface-2);}
.lrow .lt{width:52px;height:36px;border-radius:var(--r-sm);background:var(--media-well);flex-shrink:0;box-shadow:var(--shadow-xs);}
.lrow .lname{font-size:14px;font-weight:700;color:var(--ink-1000);letter-spacing:-.01em;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.lrow .lname input{font:inherit;color:inherit;border:none;background:var(--bg-surface);outline:none;border-radius:var(--r-sm);box-shadow:0 0 0 2px var(--accent-border);padding:2px 8px;width:60%;min-width:180px;}
.lrow .lcount{font-size:12.5px;color:var(--ink-500);flex-shrink:0;}
.lrow .dots{width:30px;height:30px;border-radius:50%;border:none;background:transparent;color:var(--ink-500);display:inline-flex;align-items:center;justify-content:center;opacity:0;transition:opacity var(--d-fast),background var(--d-fast);flex-shrink:0;}
.lrow:hover .dots,.lrow .dots.open{opacity:1;}
.lrow .dots:hover,.lrow .dots.open{background:var(--hover-surface-2);color:var(--ink-900);}
.lrow .dots svg{width:16px;height:16px;}
.lrow .chev{color:var(--ink-400);flex-shrink:0;display:inline-flex;}
.lrow .chev svg{width:15px;height:15px;}
.rowmenu{position:absolute;right:34px;top:46px;z-index:30;min-width:168px;background:var(--bg-surface);border:1px solid var(--hairline-strong);border-radius:var(--r-md);box-shadow:var(--shadow-lg);padding:6px;}
.rowmenu .mi{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border:none;background:transparent;border-radius:var(--r-sm);font-size:12.5px;font-weight:600;color:var(--ink-700);text-align:left;}
.rowmenu .mi:hover{background:var(--hover-surface-2);color:var(--ink-1000);}
.rowmenu .mi svg{width:14px;height:14px;color:var(--ink-500);}
.rowmenu .mi.danger{color:var(--danger);}
.rowmenu .mi.danger svg{color:var(--danger);}
.empty{padding:64px 0;text-align:center;color:var(--ink-500);font-size:13.5px;}
.empty b{color:var(--ink-700);}

/* ════ DETAIL — video grid (ADR-0038/0040: Generating is the only in-flight state) ════ */
.vgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;}
.vc{border:1px solid var(--hairline);border-radius:var(--r-lg);overflow:hidden;background:var(--bg-surface);box-shadow:var(--shadow-xs);cursor:pointer;transition:all var(--d-base);}
.vc:hover{box-shadow:var(--shadow-md);transform:translateY(-2px);border-color:var(--green-400);}
.vc .vthumb{position:relative;aspect-ratio:9/16;background:var(--media-well);}
.vc .vthumb .grade{position:absolute;inset:0;background:linear-gradient(180deg,transparent 38%,rgba(0,0,0,.5));}
.vc .vthumb .vcap{position:absolute;left:11px;right:11px;bottom:11px;color:#fff;font-family:var(--font-display);font-weight:800;font-size:13px;line-height:1.25;letter-spacing:-.01em;text-shadow:0 2px 10px rgba(0,0,0,.6);}
.stagepill{position:absolute;left:10px;top:10px;font-size:10px;font-weight:700;padding:4px 9px;border-radius:var(--r-pill);display:inline-flex;align-items:center;gap:5px;background:rgba(0,0,0,.55);color:#fff;backdrop-filter:blur(6px);}
.stagepill .d{width:7px;height:7px;border-radius:50%;background:var(--warning);animation:pulse 1.2s infinite;}
@keyframes pulse{0%,100%{opacity:1;}50%{opacity:.35;}}
.playbadge{position:absolute;right:10px;bottom:10px;width:32px;height:32px;border-radius:50%;background:rgba(255,255,255,0.92);color:#111;display:inline-flex;align-items:center;justify-content:center;box-shadow:var(--shadow-sm);}
.playbadge svg{width:15px;height:15px;margin-left:2px;}
.vc .vfoot{padding:10px 13px 12px;}
.vc .vtool{font-family:var(--font-mono);font-size:9px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--green-700);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.vc .vmeta{display:flex;align-items:center;gap:8px;margin-top:4px;font-size:11px;color:var(--ink-500);}
.vc .vmeta .when{margin-left:auto;}
.th-a{background:linear-gradient(150deg,#13321f,#0a0a0c 70%);}
.th-b{background:linear-gradient(150deg,#1a1410,#0a0a0c);}
.th-c{background:linear-gradient(150deg,#101a2e,#0a0a0c);}
.th-d{background:linear-gradient(150deg,#2e1018,#0a0a0c);}
.th-e{background:linear-gradient(150deg,#231030,#0a0a0c);}

/* ════ NEW-VIDEO SHEET — PD-A locked (ADR-0038); tiles verbatim from canon/home.html ════ */
.ovl{position:fixed;inset:0;background:rgba(10,10,12,.38);backdrop-filter:blur(3px);display:none;align-items:center;justify-content:center;z-index:60;}
.ovl.open{display:flex;}
.sheet{width:740px;max-width:92%;background:var(--bg-surface);border:1px solid var(--hairline-strong);border-radius:var(--r-xl);box-shadow:var(--shadow-lg);padding:26px 28px 28px;}
.sheet .sh-eyebrow{font-family:var(--font-mono);font-size:10px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--green-700);}
.sheet .sh-head{display:flex;align-items:flex-start;gap:12px;margin-top:6px;}
.sheet h2{font-family:var(--font-display);font-size:21px;font-weight:800;letter-spacing:-.02em;margin:0;color:var(--ink-1000);}
.sheet .sh-sub{font-size:13px;color:var(--ink-600);margin-top:5px;}
.sheet .x{margin-left:auto;width:32px;height:32px;border-radius:50%;border:1px solid var(--hairline-strong);background:var(--bg-surface);color:var(--ink-600);display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;}
.sheet .x svg{width:15px;height:15px;}
.sheet .choose-grid{grid-template-columns:repeat(2,1fr);margin-top:20px;}
/* choose-tile — canon/home.html verbatim */
.choose-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:13px;}
.choose-tile{position:relative;text-align:left;cursor:pointer;display:flex;flex-direction:column;padding:19px 17px 16px;border-radius:var(--r-lg);border:1px solid var(--hairline-strong);background:var(--bg-surface);box-shadow:var(--shadow-xs);transition:transform var(--d-base),box-shadow var(--d-base),border-color var(--d-base),background var(--d-base);}
.choose-tile:hover{transform:translateY(-3px);box-shadow:var(--shadow-md);border-color:var(--green-400);background:color-mix(in srgb,var(--green-500) 4%,var(--bg-surface));}
.choose-tile .ti{width:42px;height:42px;border-radius:var(--r-md);display:inline-flex;align-items:center;justify-content:center;background:linear-gradient(135deg,var(--green-500),var(--green-700));color:#fff;box-shadow:var(--shadow-green-soft);margin-bottom:13px;}
.choose-tile .ti svg{width:20px;height:20px;}
.choose-tile .tn{font-family:var(--font-display);font-size:16px;font-weight:700;letter-spacing:-.01em;color:var(--ink-1000);}
.choose-tile .tx{font-size:11.5px;color:var(--ink-500);margin-top:4px;line-height:1.45;}
.choose-tile .fastest{position:absolute;right:13px;top:15px;font-family:var(--font-mono);font-size:8.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--green-700);background:var(--green-100);border-radius:var(--r-pill);padding:3px 8px;}
.custom-line{margin-top:18px;font-size:13px;color:var(--ink-600);}
.custom-line a{color:var(--green-600);font-weight:600;text-decoration:none;display:inline-flex;align-items:center;gap:4px;}
[data-theme="dark"] .custom-line a{color:var(--green-300);}
.custom-line a svg{width:13px;height:13px;}

@media(max-width:1080px){.app{grid-template-columns:200px 1fr;}.vgrid{grid-template-columns:repeat(2,1fr);}.sheet .choose-grid{grid-template-columns:1fr;}}

/* ── Project detail page — new semantic CSS classes (desktop base) ── */
/* BriefStrip outer scroll container */
.brief-strip-body { padding: 0 28px 40px; overflow-y: auto; flex: 1; }
/* Back breadcrumb link */
.brief-strip-back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-500); text-decoration: none; padding-top: 8px; margin-bottom: 12px; margin-top: 4px; }
/* Title row — flex row with spacer that pushes the button right */
.brief-strip-title-row { display: flex; align-items: flex-start; margin-bottom: 24px; }
/* h1 */
.brief-strip-h1 { margin: 0; font-size: 28px; font-weight: 800; color: var(--ink-900); line-height: 1.2; }
/* New video button */
.brief-strip-new-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--green-500); color: #fff; padding: 10px 20px; border-radius: var(--r-pill); font-weight: 700; font-size: 14px; text-decoration: none; }
.brief-strip-new-btn:hover { background: var(--green-600); }
/* Video grid — auto-fill, minmax(160px) = matches the previous inline style */
.brief-vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
/* Back bar — strip above the canvas when a brief is selected */
.brief-back-bar { display: flex; align-items: center; gap: 10px; padding: 8px 24px; background: var(--bg-page, transparent); }
.brief-back-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; background: transparent; border: 1px solid var(--hairline); color: var(--ink-700); font-size: 12.5px; cursor: pointer; font-family: inherit; }
.brief-back-btn:hover { background: var(--hover-surface); }
.brief-back-label { font-size: 12px; color: var(--ink-500); }

/* ════════════════════════════════════════
   SURFACE: url-to-ad.html
   ════════════════════════════════════════ */

/* ---- url-to-ad.html :: style block 0 ---- */
/* ════════════════════════════════════════════════════════════════
   ░ DS ALIAS LAYER (the ONLY :root block) ░
   Re-skins the entire render onto the real HexCoded design system.
   Every base token (--green-*, --ink-*, --bg-*, --hairline*, --glass-*,
   --shadow-*, --r-*, --d-*, --ease-*, --font-*, --danger/--warning)
   is aliased to the closest --amp-hexcoded-* DS token via var() — NO
   hardcoded color values. The DS tokens already flip under
   [data-theme="dark"], so light + dark both cascade automatically.
   In-between ink/border steps with no clean DS equivalent are derived
   with color-mix() between two DS theme tokens that BOTH flip with the
   theme (bg-elev = light pole, text-primary = dark pole), so the ramp
   inverts correctly in dark mode.
   ════════════════════════════════════════════════════════════════ */
:root {
  /* ── Type ── */
  --font-display: var(--amp-hexcoded-font-display);
  --font-body:    var(--amp-hexcoded-font-body);
  --font-mono:    var(--amp-hexcoded-font-mono);

  /* ── Green / accent scale ── DS theme accent (#22C55E) + foundation green ramp.
     The base uses 50→800; anchor the key steps to the DS theme accent tokens,
     fill the rest from the DS green/emerald foundation ramp. */
  --green-50:  var(--amp-hexcoded-theme-color-accent-whisper);  /* #DCFCE7 */
  --green-100: var(--amp-hexcoded-color-green-100);             /* #D1FAE5 */
  --green-200: color-mix(in srgb, var(--amp-hexcoded-theme-color-accent) 28%, var(--amp-hexcoded-color-white));
  --green-300: var(--amp-hexcoded-theme-color-accent-light);    /* #86EFAC */
  --green-400: color-mix(in srgb, var(--amp-hexcoded-theme-color-accent) 72%, var(--amp-hexcoded-color-white));
  --green-500: var(--amp-hexcoded-theme-color-accent);          /* #22C55E PRIMARY */
  --green-600: var(--amp-hexcoded-theme-color-accent-deep);     /* #16A34A DEEP */
  --green-700: color-mix(in srgb, var(--amp-hexcoded-theme-color-accent-deep) 80%, var(--amp-hexcoded-color-black));
  --green-800: color-mix(in srgb, var(--amp-hexcoded-theme-color-accent-deep) 62%, var(--amp-hexcoded-color-black));

  /* ── Ink scale ──
     Poles that flip with the theme:
       LIGHT pole  = --amp-hexcoded-theme-color-bg-elev (#FFF light / #1C1C22 dark)
       DARK  pole  = --amp-hexcoded-theme-color-text-primary (#0B0B0F light / #FAFAFA dark)
     so a mix of the two inverts correctly between themes. Where the DS has a
     clean flipping equivalent we alias it directly. */
  --ink-0:    var(--amp-hexcoded-theme-color-bg-elev);          /* surface white / inverse */
  --ink-50:   var(--amp-hexcoded-theme-color-bg);               /* #FAFAFA / #0B0B0F */
  --ink-100:  var(--amp-hexcoded-theme-color-bg-soft);          /* #F5F5F7 / #15151B */
  --ink-200:  color-mix(in srgb, var(--amp-hexcoded-theme-color-bg-elev) 88%, var(--amp-hexcoded-theme-color-text-primary));
  --ink-300:  color-mix(in srgb, var(--amp-hexcoded-theme-color-bg-elev) 80%, var(--amp-hexcoded-theme-color-text-primary));
  --ink-400:  color-mix(in srgb, var(--amp-hexcoded-theme-color-bg-elev) 58%, var(--amp-hexcoded-theme-color-text-primary));
  --ink-500:  var(--amp-hexcoded-theme-color-text-tertiary);    /* #86868B both themes */
  --ink-600:  color-mix(in srgb, var(--amp-hexcoded-theme-color-text-tertiary) 60%, var(--amp-hexcoded-theme-color-text-primary));
  --ink-700:  var(--amp-hexcoded-theme-color-text-secondary);   /* #3B3B42 / #C8C8CD */
  --ink-800:  color-mix(in srgb, var(--amp-hexcoded-theme-color-text-secondary) 45%, var(--amp-hexcoded-theme-color-text-primary));
  --ink-900:  color-mix(in srgb, var(--amp-hexcoded-theme-color-text-primary) 88%, var(--amp-hexcoded-theme-color-bg-elev));
  --ink-1000: var(--amp-hexcoded-theme-color-text-primary);     /* #0B0B0F / #FAFAFA */

  /* ── Backgrounds ── */
  --bg-canvas:   var(--amp-hexcoded-theme-color-bg);            /* page */
  --bg-surface:  var(--amp-hexcoded-theme-color-bg-elev);       /* cards/inputs */
  --bg-elevated: var(--amp-hexcoded-theme-color-bg-elev);
  --bg-soft:     var(--amp-hexcoded-theme-color-bg-soft);

  /* ── Hairlines / borders ── */
  --hairline:        color-mix(in srgb, var(--amp-hexcoded-theme-color-border) 60%, transparent);
  --hairline-strong: var(--amp-hexcoded-theme-color-border);

  /* ── Glass ── derived from the elevated surface (flips with theme) ── */
  --glass-bg:        color-mix(in srgb, var(--amp-hexcoded-theme-color-bg-elev) 72%, transparent);
  --glass-bg-strong: color-mix(in srgb, var(--amp-hexcoded-theme-color-bg-elev) 88%, transparent);
  --glass-blur:      blur(20px) saturate(180%);

  /* ── Shadows ── DS foundation elevation ramp + accent glows ── */
  --shadow-xs: var(--amp-hexcoded-shadow-1);
  --shadow-sm: var(--amp-hexcoded-shadow-2);
  --shadow-md: var(--amp-hexcoded-shadow-3);
  --shadow-lg: var(--amp-hexcoded-shadow-4);
  --shadow-xl: var(--amp-hexcoded-shadow-5);
  --shadow-green:      0 12px 32px color-mix(in srgb, var(--amp-hexcoded-theme-color-accent) 24%, transparent), 0 4px 8px color-mix(in srgb, var(--amp-hexcoded-theme-color-accent) 12%, transparent);
  --shadow-green-soft: 0 8px 20px color-mix(in srgb, var(--amp-hexcoded-theme-color-accent) 14%, transparent);

  /* ── Radii ── */
  --r-xs:   var(--amp-hexcoded-radius-sm);    /* 4px */
  --r-sm:   var(--amp-hexcoded-radius-md);    /* 8px */
  --r-md:   var(--amp-hexcoded-radius-lg);    /* 12px */
  --r-lg:   var(--amp-hexcoded-radius-xl);    /* 16px — DS Card radius */
  --r-xl:   var(--amp-hexcoded-radius-2xl);   /* 24px */
  --r-pill: var(--amp-hexcoded-radius-full);

  /* ── Motion ── */
  --ease-out:   var(--amp-hexcoded-motion-ease);
  --d-fast:     var(--amp-hexcoded-motion-d-fast);
  --d-base:     var(--amp-hexcoded-motion-d-base);
  --d-slow:     var(--amp-hexcoded-motion-d-slow);
  --d-stately:  var(--amp-hexcoded-motion-duration-lazy);

  /* ── Status ── */
  --danger:  var(--amp-hexcoded-status-danger);
  --warning: var(--amp-hexcoded-status-warning);

  /* ════════════════════════════════════════════════════════════════
     ░ CANONICAL COMPONENT PRIMITIVES ░  — defined ONCE, referenced
     everywhere. Every selected tile/card/chip/row, every accent-soft
     surface, every warning treatment, every focus ring and segmented
     control reads off THESE tokens, so a change propagates uniformly
     and the per-screen copies can no longer drift apart. All values
     flip correctly between light + dark (they derive from the green
     theme accent + theme bg/text poles, never from a frozen hex).
     ════════════════════════════════════════════════════════════════ */
  /* accent-soft surface (the green-tinted "note"/"selected" fill) */
  --accent-soft:        color-mix(in srgb, var(--green-500) 9%, var(--bg-surface));
  --accent-soft-strong: color-mix(in srgb, var(--green-500) 15%, var(--bg-surface));
  --accent-border:      color-mix(in srgb, var(--green-500) 30%, var(--hairline));
  --accent-ink:         var(--green-700);
  /* accent CHIP/badge/tick fill (the small green-100 wells) — flips with theme */
  --accent-chip-bg:  var(--green-100);
  --accent-chip-ink: var(--accent-ink);
  /* selected state — used by EVERY pickable tile/card/chip/row */
  --sel-border: var(--green-500);
  --sel-ring:   0 0 0 3px color-mix(in srgb, var(--green-500) 14%, transparent);
  --sel-ring-2: 0 0 0 2px color-mix(in srgb, var(--green-500) 16%, transparent);
  --sel-bg:     var(--accent-soft);
  /* focus ring for fields / editable surfaces */
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--green-500) 14%, transparent);
  /* neutral hover surface (readable in BOTH themes — never white-on-white) */
  --hover-surface:   color-mix(in srgb, var(--ink-1000) 6%, transparent);
  --hover-surface-2: color-mix(in srgb, var(--ink-1000) 4%, transparent);
  /* warning ink + soft fill (flips: dark uses the lighter status token) */
  --warn-ink:    color-mix(in srgb, var(--warning) 78%, var(--ink-1000));
  --warn-soft:   color-mix(in srgb, var(--warning) 12%, var(--bg-surface));
  --warn-border: color-mix(in srgb, var(--warning) 32%, transparent);
  /* info ink + soft fill (used by gate notes / proof tags) */
  --info-ink:    color-mix(in srgb, var(--amp-hexcoded-status-info) 72%, var(--ink-1000));
  --info-soft:   color-mix(in srgb, var(--amp-hexcoded-status-info) 14%, var(--bg-surface));
  --info-border: color-mix(in srgb, var(--amp-hexcoded-status-info) 30%, transparent);
  /* danger soft fill */
  --danger-soft:   color-mix(in srgb, var(--danger) 9%, var(--bg-surface));
  --danger-soft-2: color-mix(in srgb, var(--danger) 14%, var(--bg-surface));
  --danger-border: color-mix(in srgb, var(--danger) 30%, transparent);
  /* media wells (video thumbs) — a near-black that stays consistent */
  --media-well: #0a0a0c;
  /* segmented control (mode-toggle / tabs / theme-switcher / script-tabs) */
  --seg-track: var(--ink-100);
  --seg-thumb: var(--bg-surface);
}
[data-theme="dark"] {
  --warn-ink:  var(--warning);
  --accent-chip-bg:  color-mix(in srgb, var(--green-500) 16%, var(--bg-surface));
  --accent-chip-ink: var(--green-300);
  --info-ink:  #7db4ff;
  --seg-track: var(--bg-elevated);
}
/* ════════════════════════════════════════════════════════════════
   HEXCODED · Tool 1 · URL → Ad · DEFINITIVE rebuild
   Shell: thin icon rail (hover-expands flyout + pin) LEFT, numbered
   checklist beside it, carousel CENTER, right editor drawer.
   STATE: setup (editable) → after HexCode it → VIEW-ONLY; only
   "Open Editor" on a finished video; "New video" unlocks fresh setup.
   STRICT: link the HexCoded DS (../styles/hexcoded-ds.css); the only
   :root is the DS alias layer above (var(--amp-hexcoded-*), no hardcoded
   colors); var(--token) everywhere; zero inline on*; one popup pattern,
   fixed size, internal scroll; no nested <button> (role="button" rows).
   ════════════════════════════════════════════════════════════════ */
html, body { height: 100%; margin: 0; overflow: hidden; }
/* Global page background — same green-tinted radial wash the landing
   .canvas uses, applied at the body level so every interior page
   (pricing, settings, projects, library, etc.) inherits it instead of
   sitting on flat --bg-canvas. `background-attachment: fixed` keeps the
   gradient viewport-anchored so it doesn't scroll with inner containers. */
body {
  height: 100vh;
  font-family: var(--font-body);
  color: var(--ink-900);
  background:
    radial-gradient(1400px 700px at 50% -8%,
      color-mix(in srgb, var(--green-500) 10%, transparent), transparent 60%),
    radial-gradient(900px 500px at 92% 40%,
      color-mix(in srgb, var(--green-500) 6%, transparent), transparent 65%),
    var(--bg-canvas);
  background-attachment: fixed, fixed, fixed;
}
*, *::before, *::after { box-sizing: border-box; }
button { font-family: inherit; }

/* ════════════════════════════════════════════════════════════════
   ░ SHARED-COMPONENT LAYER ░ — canonical, token-driven primitives.
   Each pattern below is defined ONCE; the per-screen component classes
   later in this sheet OPT IN via these helpers + the --sel-*/--accent-*
   tokens, so selected states, hovers, segmented controls and fields
   stay pixel-identical and can't drift. (No class renames — purely
   additive consolidation on top of the existing markup.)
   ════════════════════════════════════════════════════════════════ */

/* — Canonical SELECTED state for any pickable tile/card/chip/row — */
.is-pickable { transition: border-color var(--d-fast), box-shadow var(--d-fast), background var(--d-fast); }
.is-pickable.on,
.subj-tile.on, .pg-card.on, .fmt-tile.on, .stage-card.on, .broll-tile.on,
.ref-tile.on, .tile.on, .idea-card.on, .insight-card.on, .cast2-row.on,
.making-pill.on, .rg-thumb.on, .chip.on {
  border-color: var(--sel-border);
}

/* — Canonical SEGMENTED CONTROL (mode/theme/tabs/script-tabs) — */
.seg-track, .mode-toggle, .theme-switcher, .tabs, .script-tabs {
  display: inline-flex; align-items: center;
  background: var(--seg-track); border-radius: var(--r-pill); padding: 3px; gap: 2px;
}
.seg-track > button, .mode-toggle button, .theme-switcher button, .tabs button, .script-tabs button {
  border: none; background: transparent; cursor: pointer; border-radius: var(--r-pill);
  font-weight: 600; color: var(--ink-600);
  display: inline-flex; align-items: center; gap: 6px;
  transition: background var(--d-fast), color var(--d-fast), box-shadow var(--d-fast);
}
.seg-track > button.on, .mode-toggle button.on, .theme-switcher button.on, .tabs button.on, .script-tabs button.on {
  background: var(--seg-thumb); color: var(--ink-1000); box-shadow: var(--shadow-xs);
}

/* — Canonical FIELD shell (input-line / guide-box / ask-box) — */
.field-line { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 6px 0 13px;
  border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface);
  transition: border-color var(--d-fast), box-shadow var(--d-fast); }
.field-line:focus-within { border-color: var(--green-500); box-shadow: var(--focus-ring); }
.field-line input { flex: 1; border: none; background: transparent; outline: none;
  font-family: inherit; font-size: 13.5px; color: var(--ink-900); }
.field-line input::placeholder { color: var(--ink-400); }

/* — Canonical ACCENT-SOFT note surface (the green "info"/callout fill) — */
.accent-note { background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: var(--r-md); }

/* — Canonical NEUTRAL note surface (grey informational fill) — */
.neutral-note { background: var(--ink-50); border: 1px solid var(--hairline); }
[data-theme="dark"] .neutral-note { background: var(--bg-elevated); }

/* ── APP GRID ──────────────────────────────────────────────────── */
.app { height: 100vh; display: grid; grid-template-columns: 56px 1fr; transition: grid-template-columns var(--d-base) var(--ease-out); }
/* Both pin (sticky/click) and hover (transient, when not pinned) PUSH the layout:
   the rail column grows 56px→220px, so the checklist panel shifts right (no overlay). */
.app[data-railpin="true"], .app[data-railhover="true"] { grid-template-columns: 220px 1fr; }
.app > * { min-width: 0; min-height: 0; }

/* ── ICON RAIL (push-expands the grid; pin = sticky, hover = transient) ── */
.rail {
  position: relative; z-index: 60;
  background: var(--glass-bg-strong); backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--hairline);
  display: flex; flex-direction: column; align-items: stretch;
  padding: 12px 8px; gap: 4px; overflow: visible;
  width: 56px; transition: width var(--d-base) var(--ease-out), padding var(--d-base) var(--ease-out);
}
.app[data-railpin="true"] .rail, .app[data-railhover="true"] .rail { width: 220px; padding: 16px 12px; }
.rail-logo { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; text-decoration: none; }
/* H monogram (collapsed rail) — clean Outfit 900 in brand green · NO box, NO favicon styling.
   Matches brand-hexcoded favicon (single "H", fill #22C55E). The Phantom shadow stays subtle. */
.rail-logo .mark {
  width: 34px; height: 34px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; box-shadow: none; border: none; border-radius: 0;
}
.rail-logo .mark .hexwm { font-size: 26px; color: var(--green-500); }
/* expanded rail shows the full HEXCODED wordmark only — collapse the standalone H mark */
.app[data-railpin="true"] .rail-logo .mark, .app[data-railhover="true"] .rail-logo .mark { width: 0; opacity: 0; overflow: hidden; }
.rail-logo .wm { display: inline-flex; align-items: center; white-space: nowrap; opacity: 0; max-width: 0; transition: opacity var(--d-base), max-width var(--d-base); overflow: hidden; }
.app[data-railpin="true"] .rail-logo .wm, .app[data-railhover="true"] .rail-logo .wm { max-width: 200px; }
.app[data-railpin="true"] .rail-logo .wm, .app[data-railhover="true"] .rail-logo .wm { opacity: 1; }
.rail-logo .wm .hexwm { font-size: 19px; }
/* collapsed rail: center the H monogram so it lines up with the centered nav icons below */
.app:not([data-railpin="true"]):not([data-railhover="true"]) .rail-logo { justify-content: center; padding-left: 0; padding-right: 0; }
.app:not([data-railpin="true"]):not([data-railhover="true"]) .rail-logo .mark .hexwm { font-size: 21px; }

/* ── PHANTOM wordmark · inline HTML/CSS text (Outfit 900, green stepped shadow) ──
   data-text holds the word; an inner <span class="ph"></span> is the middle layer.
   Main text flips light/dark (text-primary); the 3 phantom layers stay green #22C55E. */
.hexwm {
  position: relative; display: inline-block;
  font-family: var(--amp-hexcoded-font-display), Outfit, sans-serif;
  font-weight: 900; letter-spacing: -0.025em; line-height: 1;
  color: var(--amp-hexcoded-theme-color-text-primary);
}
.hexwm::before, .hexwm::after, .hexwm .ph { content: attr(data-text); position: absolute; left: 0; top: 0; color: #22C55E; z-index: -1; }
.hexwm::before { transform: translate(1px,1px); opacity: .85; --ph: .85; animation: hexph 3s ease-in-out infinite; }
.hexwm .ph { transform: translate(2px,2px); opacity: .55; --ph: .55; animation: hexph 3s ease-in-out infinite .1s; }
.hexwm::after { transform: translate(3px,3px); opacity: .32; --ph: .32; animation: hexph 3s ease-in-out infinite .2s; }
@keyframes hexph { 0%,100% { opacity: var(--ph,.85); } 50% { opacity: calc(var(--ph,.85)*.4); } }
@media (prefers-reduced-motion: reduce) { .hexwm::before, .hexwm::after, .hexwm .ph { animation: none; } }
/* ── nav items — ALL identical shape (height 40px, single 19px icon) ── */
.rail-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 0 11px; height: 40px; border-radius: var(--r-md); border: none; background: transparent;
  cursor: pointer; color: var(--ink-600); transition: background var(--d-fast), color var(--d-fast);
  text-align: left; width: 100%; white-space: nowrap;
}
.rail-item:hover { background: var(--hover-surface); color: var(--ink-1000); }
.rail-item.on { background: var(--accent-soft-strong); color: var(--accent-ink); }
[data-theme="dark"] .rail-item.on { color: var(--green-300); }
.rail-item svg { width: 19px; height: 19px; flex-shrink: 0; stroke-width: 2; }
.rail-item .rl { display: flex; flex-direction: column; line-height: 1.2; opacity: 0; max-width: 0; overflow: hidden; transition: opacity var(--d-base); }
.rail-item .rl .rl-t { font-size: 13.5px; font-weight: 600; }
.rail-item .rl .rl-s { font-size: 10.5px; font-weight: 500; color: var(--ink-500); }
.rail-item.on .rl .rl-s { color: color-mix(in srgb, var(--accent-ink) 70%, transparent); }
.app[data-railpin="true"] .rail-item .rl, .app[data-railhover="true"] .rail-item .rl { opacity: 1; max-width: 200px; }

/* ── TOOLS group label — a calm mono caption, zero width when collapsed ── */
.rail-tools { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.rail-tools .tools-lab { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-400); padding: 4px 11px; opacity: 0; max-width: 0; white-space: nowrap; overflow: hidden; transition: opacity var(--d-base); }
.app[data-railpin="true"] .rail-tools .tools-lab, .app[data-railhover="true"] .rail-tools .tools-lab { opacity: 1; max-width: 200px; }
/* collapsed: a thin divider stands in for the label so the group still reads as separate */
.app:not([data-railpin="true"]):not([data-railhover="true"]) .rail-tools { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hairline); }

.rail-spacer { flex: 1; }
.rail-foot { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 1px solid var(--hairline); }
/* ── collapse / expand control — a deliberate, tidy chevron toggle ── */
.rail-pin { display: inline-flex; align-items: center; gap: 12px; padding: 0 11px; height: 40px; border-radius: var(--r-md); border: none; background: transparent; cursor: pointer; color: var(--ink-500); font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: background var(--d-fast), color var(--d-fast); width: 100%; }
.rail-pin:hover { background: var(--hover-surface); color: var(--ink-900); }
.rail-pin .pinic { width: 24px; height: 24px; flex-shrink: 0; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-500); transition: color var(--d-fast); }
.rail-pin:hover .pinic { color: var(--ink-900); }
.rail-pin .pinic svg { width: 18px; height: 18px; stroke-width: 2; }
.rail-pin .rl { opacity: 0; max-width: 0; overflow: hidden; transition: opacity var(--d-base); }
.app[data-railpin="true"] .rail-pin .rl, .app[data-railhover="true"] .rail-pin .rl { opacity: 1; max-width: 140px; }

/* ════ COLLAPSED RAIL: labels/wordmark take ZERO width — every row is a clean
   40px square with one centred icon. ════ */
.app:not([data-railpin="true"]):not([data-railhover="true"]) .rail-item,
.app:not([data-railpin="true"]):not([data-railhover="true"]) .rail-pin { justify-content: center; padding: 0; gap: 0; }
.app:not([data-railpin="true"]):not([data-railhover="true"]) .rail-logo { gap: 0; }
.app:not([data-railpin="true"]):not([data-railhover="true"]) .rail-item .rl,
.app:not([data-railpin="true"]):not([data-railhover="true"]) .rail-pin .rl { max-width: 0; padding: 0; }

/* ── MAIN COLUMN ───────────────────────────────────────────────── */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100vh; overflow: hidden; position: relative; z-index: 1; }

/* ── HEADER ────────────────────────────────────────────────────── */
.hdr { height: 58px; flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 0 18px; background: var(--glass-bg-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-bottom: 1px solid var(--hairline); }
.hdr.is-page { justify-content: flex-end; }
.proj-name { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: var(--r-md); border: 1px solid transparent; cursor: text; font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -0.02em; color: var(--ink-1000); background: transparent; transition: all var(--d-fast); max-width: 280px; }
.proj-name:hover { background: var(--hover-surface); border-color: var(--hairline); }
.proj-name:focus { outline: none; background: var(--bg-surface); border-color: var(--green-400); box-shadow: var(--sel-ring); }
.hdr .spacer { flex: 1; }
.brand-pick { display: inline-flex; align-items: center; gap: 9px; padding: 6px 11px 6px 7px; border-radius: var(--r-pill); border: 1px solid var(--hairline); background: var(--bg-surface); cursor: pointer; transition: all var(--d-fast); }
.brand-pick:hover { background: var(--hover-surface-2); border-color: var(--hairline-strong); }
.brand-pick .bdot { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--green-400), var(--green-700)); color: #fff; font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.brand-pick .blab { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.brand-pick .blab .k { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-500); }
.brand-pick .blab .v { font-size: 12.5px; font-weight: 600; color: var(--ink-900); }
.brand-pick svg { width: 15px; height: 15px; color: var(--ink-500); }
.mode-control { display: flex; align-items: center; gap: 8px; }
.mode-toggle button { padding: 6px 13px; font-size: 12.5px; }
.mode-toggle button svg { width: 14px; height: 14px; }
.tipwrap { position: relative; display: inline-flex; }
.info-i { width: 17px; height: 17px; border-radius: 50%; border: 1.4px solid var(--ink-400); color: var(--ink-500); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; cursor: help; font-family: var(--font-mono); }
.tipwrap:hover .info-i { border-color: var(--green-500); color: var(--green-600); }
.tip { position: absolute; top: calc(100% + 9px); right: -6px; width: 290px; z-index: 80; background: var(--ink-1000); color: var(--ink-0); padding: 13px 15px; border-radius: var(--r-md); font-size: 12px; font-weight: 400; line-height: 1.55; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transform: translateY(-5px); transition: opacity var(--d-fast), transform var(--d-fast); }
[data-theme="dark"] .tip { background: var(--bg-elevated); color: var(--ink-900); border: 1px solid var(--hairline-strong); }
.tip b { color: var(--green-400); font-weight: 700; }
[data-theme="dark"] .tip b { color: var(--green-500); }
.tip::before { content: ''; position: absolute; top: -6px; right: 12px; width: 12px; height: 12px; background: inherit; transform: rotate(45deg); }
.tipwrap:hover .tip { opacity: 1; pointer-events: auto; transform: translateY(0); }
.credits { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: var(--r-pill); background: var(--green-50); border: 1px solid var(--green-200); font-size: 12.5px; font-weight: 600; color: var(--green-800); }
[data-theme="dark"] .credits { background: rgba(34,197,94,0.1); }
.credits .coin { color: var(--green-600); }
.credits .muted { color: var(--green-700); font-weight: 500; opacity: 0.8; }
.theme-switcher button { padding: 6px 11px; font-size: 11.5px; gap: 5px; }

/* ── shared buttons ────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 600; border: 1px solid var(--hairline-strong); background: var(--bg-surface); color: var(--ink-800); cursor: pointer; transition: all var(--d-fast); white-space: nowrap; }
/* secondary/default: light hover surface, ink text stays dark + readable (both themes) */
.btn:hover { background: var(--ink-100); border-color: var(--ink-300); color: var(--ink-1000); }
.btn svg { width: 15px; height: 15px; }
/* DS refinement — primary CTA reads directly off the HexCoded DS accent.
   Text is ALWAYS white (forced, not via theme-flipping inverse token), so a green
   button never shows white-on-white. Hover = slightly DARKER green, white text kept. */
.btn-primary { background: linear-gradient(135deg, var(--amp-hexcoded-theme-color-accent), var(--amp-hexcoded-theme-color-accent-deep)); color: var(--amp-hexcoded-color-white); border: none; box-shadow: var(--shadow-green-soft); }
.btn-primary:hover { background: linear-gradient(135deg, var(--amp-hexcoded-theme-color-accent-deep), var(--green-700)); color: var(--amp-hexcoded-color-white); box-shadow: var(--shadow-green); }
.btn-ghost { border: 1px solid transparent; background: transparent; color: var(--ink-700); }
.btn-ghost:hover { background: var(--ink-100); color: var(--ink-1000); }
.btn-secondary { background: var(--bg-surface); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 12.5px; }
.btn-loading { opacity: 0.6; pointer-events: none; }

/* ── PAGE VIEWS ────────────────────────────────────────────────── */
.view { display: none; flex: 1; overflow-y: auto; min-height: 0; }
.view.on { display: block; }
#viewWork { overflow: hidden; }
#viewWork.on { display: flex; flex-direction: column; }
.page-inner { max-width: 1320px; margin: 0 auto; padding: 32px 28px 60px; }
.page-h { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 26px; }
.page-h .eyebrow { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--green-700); }
.page-h h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; margin: 7px 0 0; }
.page-h h1 em { font-style: normal; color: var(--green-600); }
.page-h .sub { font-size: 14.5px; color: var(--ink-600); margin-top: 8px; max-width: 560px; line-height: 1.55; }
.page-h .spacer { flex: 1; }
.np-hero { display: flex; align-items: center; gap: 16px; padding: 20px 22px; border-radius: var(--r-xl); cursor: pointer; background: linear-gradient(135deg, rgba(34,197,94,0.1), rgba(34,197,94,0.03)); border: 1px solid var(--green-200); transition: all var(--d-base); margin-bottom: 34px; }
.np-hero:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: var(--green-400); }
[data-theme="dark"] .np-hero { border-color: rgba(34,197,94,0.25); }
.np-hero .np-ic { width: 46px; height: 46px; border-radius: var(--r-md); background: linear-gradient(135deg, var(--green-500), var(--green-700)); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--shadow-green-soft); }
.np-hero .np-t { font-size: 16px; font-weight: 700; color: var(--ink-1000); }
.np-hero .np-s { font-size: 13px; color: var(--ink-600); margin-top: 2px; }
.np-hero .np-go { margin-left: auto; color: var(--green-600); }
.sec-label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.sec-label .gl { flex: 1; height: 1px; background: var(--hairline); }
.sec-label .more { font-family: var(--font-body); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--green-600); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 3px; }
[data-theme="dark"] .sec-label .more { color: var(--green-300); }
.sec-label .more svg { width: 13px; height: 13px; }

/* ════ HOME · "Spotlight" hero + the Product/Service/Place chooser ════ */
.hc-wrap { padding-top: 32px; }
.hc-hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl);
  padding: 52px 48px 46px; border: 1px solid var(--hairline);
  background:
    radial-gradient(120% 140% at 12% -10%, color-mix(in srgb, var(--green-500) 22%, transparent) 0%, transparent 46%),
    radial-gradient(100% 130% at 96% 8%, color-mix(in srgb, var(--green-500) 14%, transparent) 0%, transparent 50%),
    var(--bg-surface);
  box-shadow: var(--shadow-sm);
}
.hc-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 80% at 80% 120%, color-mix(in srgb, var(--green-500) 10%, transparent), transparent 70%); opacity: 0.9; animation: hc-drift 14s ease-in-out infinite alternate; }
@keyframes hc-drift { from { transform: translate3d(-3%, 2%, 0) scale(1); } to { transform: translate3d(4%, -3%, 0) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .hc-hero::after, .choose-tile, .choose-tile .arr { animation: none !important; transition: none !important; } }
.hc-hero > * { position: relative; z-index: 1; }
.hc-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--green-700); }
[data-theme="dark"] .hc-eyebrow { color: var(--green-300); }
.hc-eyebrow .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green-500); box-shadow: 0 0 0 0 color-mix(in srgb, var(--green-500) 50%, transparent); animation: hc-pulse 2.2s ease-out infinite; }
@keyframes hc-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green-500) 45%, transparent); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .hc-eyebrow .pulse { animation: none; } }
.hc-hero h1 { font-family: var(--font-display); font-size: 46px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; margin: 16px 0 0; color: var(--ink-1000); max-width: 18ch; }
.hc-hero h1 em { font-style: normal; background: linear-gradient(120deg, var(--green-500), var(--green-700)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hc-hero .lede { font-size: 15px; color: var(--ink-600); margin: 16px 0 0; max-width: 56ch; line-height: 1.6; }
.hc-speed { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; padding: 6px 13px; border-radius: var(--r-pill); background: var(--accent-soft); border: 1px solid var(--accent-border); font-size: 12.5px; font-weight: 600; color: var(--green-700); }
[data-theme="dark"] .hc-speed { color: var(--green-300); }
.hc-speed svg { width: 14px; height: 14px; }
.choose-q { display: flex; align-items: center; gap: 9px; margin: 32px 0 14px; font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink-1000); }
.choose-q .qn { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft-strong); color: var(--green-700); font-family: var(--font-mono); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
[data-theme="dark"] .choose-q .qn { color: var(--green-300); }
.choose-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 760px; }
.choose-tile { position: relative; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 0; padding: 20px 18px 18px; border-radius: var(--r-lg); border: 1px solid var(--hairline-strong); background: var(--bg-surface); box-shadow: var(--shadow-xs); transition: transform var(--d-base), box-shadow var(--d-base), border-color var(--d-base), background var(--d-base); }
.choose-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--green-400); background: color-mix(in srgb, var(--green-500) 4%, var(--bg-surface)); }
.choose-tile:focus-visible { outline: none; box-shadow: var(--sel-ring); border-color: var(--green-500); }
.choose-tile .ti { width: 46px; height: 46px; border-radius: var(--r-md); display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--green-500), var(--green-700)); color: #fff; box-shadow: var(--shadow-green-soft); margin-bottom: 15px; }
.choose-tile .ti svg { width: 22px; height: 22px; }
.choose-tile .tn { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink-1000); }
.choose-tile .tx { font-size: 12.5px; color: var(--ink-500); margin-top: 4px; line-height: 1.45; }
.choose-tile .arr { position: absolute; right: 16px; top: 20px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--green-600); display: inline-flex; align-items: center; justify-content: center; opacity: 0; transform: translateX(-4px); transition: opacity var(--d-fast), transform var(--d-fast); }
[data-theme="dark"] .choose-tile .arr { color: var(--green-300); }
.choose-tile:hover .arr { opacity: 1; transform: translateX(0); }
.choose-tile .arr svg { width: 15px; height: 15px; }
.hc-recent { margin-top: 40px; }

.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 18px; }
/* self-created draft cards (concept, not rendered — no video per the motion-graphic law) */
.pcard.draft .thumb { background: linear-gradient(150deg, #1a1410, #0a0a0c); }
.pcard.draft .draft-mesh { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--green-500) 24%, transparent), transparent 62%); }
.pcard.draft .mg-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 22px 22px; }
.pcard.draft .draft-cap { position: absolute; left: 12px; right: 12px; bottom: 12px; color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 14px; line-height: 1.2; letter-spacing: -0.01em; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.pcard .thumb .stagepill .d.draft { background: var(--ink-300); }
.draft-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.draft-cost { font-family: var(--font-mono); font-size: 11px; color: var(--ink-500); }
.draft-make { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--green-500), var(--green-600)); border: none; border-radius: var(--r-pill); padding: 6px 12px; cursor: pointer; transition: filter var(--d-fast); }
.draft-make:hover { filter: brightness(1.06); }
.draft-make svg { width: 13px; height: 13px; }
.pcard { border: 1px solid var(--hairline); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-surface); cursor: pointer; transition: all var(--d-base); box-shadow: var(--shadow-xs); }
.pcard:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--hairline-strong); }
.pcard .thumb { position: relative; aspect-ratio: 16/10; background: var(--media-well); overflow: hidden; }
.pcard .thumb video { width: 100%; height: 100%; object-fit: cover; }
.pcard .thumb .grade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.45)); }
.pcard .thumb .stagepill { position: absolute; left: 10px; top: 10px; font-size: 10px; font-weight: 700; padding: 4px 9px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 5px; background: rgba(0,0,0,0.55); color: #fff; backdrop-filter: blur(6px); }
.pcard .thumb .stagepill .d { width: 7px; height: 7px; border-radius: 50%; }
.pcard .thumb .stagepill .d.ready { background: var(--green-400); }
.pcard .thumb .stagepill .d.gen { background: var(--warning); animation: pulse 1.2s infinite; }
.pcard .thumb .stagepill .d.review { background: #ff9f0a; }
.pcard .thumb .stagepill .d.failed { background: var(--danger); }
.pcard .thumb .stagepill .d.setup { background: var(--ink-400); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.pcard .thumb .playbadge { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.92); color: #111; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.pcard .thumb .playbadge svg { width: 16px; height: 16px; margin-left: 2px; }
.pcard .pc-body { padding: 13px 15px 15px; }
.pcard .pc-tool { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green-700); }
.pcard .pc-name { font-size: 15px; font-weight: 700; color: var(--ink-1000); margin: 4px 0 2px; }
.pcard .pc-sub { font-size: 12px; color: var(--ink-500); }
.pcard .pc-meta { display: flex; align-items: center; gap: 8px; margin-top: 11px; font-size: 11px; color: var(--ink-500); }
.pcard .pc-meta .when { margin-left: auto; }
.proj-list { display: flex; flex-direction: column; gap: 8px; }
.prow { display: flex; align-items: center; gap: 16px; padding: 13px 16px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); cursor: pointer; transition: all var(--d-fast); }
.prow:hover { border-color: var(--hairline-strong); box-shadow: var(--shadow-xs); }
.prow .pr-thumb { width: 64px; height: 40px; border-radius: var(--r-sm); overflow: hidden; flex-shrink: 0; background: var(--media-well); }
.prow .pr-thumb video { width: 100%; height: 100%; object-fit: cover; }
.prow .pr-name { font-size: 14px; font-weight: 600; color: var(--ink-1000); }
.prow .pr-sub { font-size: 12px; color: var(--ink-500); margin-top: 1px; }
.prow .pr-stage { margin-left: auto; font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 6px; }
.prow .pr-stage .d { width: 7px; height: 7px; border-radius: 50%; }
.pr-stage.ready { background: var(--green-50); color: var(--green-700); } .pr-stage.ready .d { background: var(--green-500); }
.pr-stage.gen { background: var(--warn-soft); color: var(--warn-ink); } .pr-stage.gen .d { background: var(--warning); animation: pulse 1.2s infinite; }
[data-theme="dark"] .pr-stage.gen { color: var(--warning); }
.pr-stage.review { background: var(--warn-soft); color: var(--warn-ink); } .pr-stage.review .d { background: #ff9f0a; }
.pr-stage.failed { background: var(--danger-soft); color: var(--danger); } .pr-stage.failed .d { background: var(--danger); }
.pr-stage.setup { background: var(--ink-100); color: var(--ink-600); } .pr-stage.setup .d { background: var(--ink-400); }
.prow .pr-when { font-size: 11px; color: var(--ink-400); width: 64px; text-align: right; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.lib-card { border: 1px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; background: var(--bg-surface); cursor: pointer; transition: all var(--d-base); }
.lib-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.lib-card .lc-thumb { position: relative; aspect-ratio: 9/16; background: var(--media-well); }
.lib-card .lc-thumb video { width: 100%; height: 100%; object-fit: cover; }
.lib-card .lc-badge { position: absolute; right: 8px; top: 8px; font-size: 9px; font-weight: 700; padding: 3px 7px; border-radius: var(--r-pill); background: var(--green-600); color: #fff; display: inline-flex; align-items: center; gap: 4px; }
.lib-card .lc-badge.flag { background: #ff9f0a; }
.lib-card .lc-badge svg { width: 10px; height: 10px; }
.lib-card .lc-body { padding: 9px 11px 11px; }
.lib-card .lc-n { font-size: 12px; font-weight: 600; color: var(--ink-900); }
.lib-card .lc-s { font-size: 10.5px; color: var(--ink-500); margin-top: 2px; }
.stub-note { font-size: 12.5px; color: var(--ink-500); background: var(--ink-50); border: 1px dashed var(--hairline-strong); border-radius: var(--r-md); padding: 14px 16px; line-height: 1.55; margin-top: 8px; }
[data-theme="dark"] .stub-note { background: var(--bg-elevated); }
.stub-note b { color: var(--ink-800); }

/* ═══ ASSET LIBRARY — browse surface (built on shared primitives) ═══ */
.lib-count { font-size: 12px; font-weight: 600; color: var(--ink-500); background: var(--ink-50); border: 1px solid var(--hairline); border-radius: var(--r-pill); padding: 6px 13px; white-space: nowrap; }
[data-theme="dark"] .lib-count { background: var(--bg-elevated); }
.lib-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.lib-toolbar .lib-search { flex: 1; }
.lib-search-clear { border: none; background: transparent; cursor: pointer; color: var(--ink-400); width: 30px; height: 30px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lib-search-clear:hover { background: var(--ink-100); color: var(--ink-700); }
.lib-search-clear svg { width: 14px; height: 14px; }

.lib-filterbar { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 14px 0 4px; margin-bottom: 22px; border-bottom: 1px solid var(--hairline); }
.lib-fgroup { display: flex; flex-direction: column; gap: 6px; padding-bottom: 14px; }
.lib-fgl { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-400); }
.lib-filterbar .chip { padding: 6px 11px; font-size: 12px; }

.lib-group { margin-bottom: 30px; }
.lib-group .sec-label .g-n { background: var(--ink-100); color: var(--ink-600); font-size: 10px; padding: 1px 7px; border-radius: var(--r-pill); }
[data-theme="dark"] .lib-group .sec-label .g-n { background: var(--bg-elevated); }

/* grid card — reuses .lib-card shell, .thumb pattern from home cards */
.lib-card .thumb { position: relative; aspect-ratio: 9/16; background: var(--media-well); overflow: hidden; }
.lib-card .thumb.sq { aspect-ratio: 1/1; }
.lib-card .thumb.wide { aspect-ratio: 16/9; }
.lib-card .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-card .lc-grade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,0.18), transparent 30%, transparent 70%, rgba(0,0,0,0.28)); }
.lib-card .lc-like { position: absolute; left: 8px; top: 8px; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,0.92); color: var(--green-600); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.lib-card .lc-like.off { color: var(--ink-500); }
.lib-card .lc-like svg { width: 12px; height: 12px; }
.lib-card .lc-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) scale(0.9); width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.92); color: var(--ink-1000); display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: all var(--d-fast); box-shadow: var(--shadow-md); }
.lib-card .lc-play svg { width: 16px; height: 16px; }
.lib-card:hover .lc-play { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.lib-card .lc-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-size: 10px; color: var(--ink-400); }
.lib-card .lc-meta .when { flex-shrink: 0; }

/* list view */
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-row { display: grid; grid-template-columns: 56px 1fr auto auto auto; align-items: center; gap: 14px; padding: 8px 14px 8px 8px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); cursor: pointer; transition: all var(--d-fast); }
.lib-row:hover { border-color: var(--green-300); box-shadow: var(--shadow-sm); }
.lib-row .lr-thumb { position: relative; width: 56px; aspect-ratio: 9/16; border-radius: var(--r-sm); overflow: hidden; background: var(--media-well); }
.lib-row .lr-thumb video { width: 100%; height: 100%; object-fit: cover; }
.lib-row .lr-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; opacity: 0; transition: opacity var(--d-fast); }
.lib-row .lr-play svg { width: 14px; height: 14px; }
.lib-row:hover .lr-play { opacity: 1; }
.lib-row .lr-n { font-size: 13px; font-weight: 600; color: var(--ink-900); display: flex; align-items: center; gap: 7px; }
.lib-row .lr-like { color: var(--green-600); display: inline-flex; }
.lib-row .lr-like svg { width: 13px; height: 13px; }
.lib-row .lr-s { font-size: 11.5px; color: var(--ink-500); margin-top: 2px; }
.lib-row .lr-proj { font-size: 11.5px; color: var(--ink-600); white-space: nowrap; }
.lib-row .lr-when { font-size: 11px; color: var(--ink-400); white-space: nowrap; width: 72px; text-align: right; }
@media (max-width: 720px) { .lib-row { grid-template-columns: 56px 1fr auto; } .lib-row .lr-proj, .lib-row .lr-when { display: none; } }

/* empty state */
.lib-empty { text-align: center; padding: 60px 24px; max-width: 460px; margin: 0 auto; }
.lib-empty .le-ic { width: 54px; height: 54px; border-radius: 50%; background: var(--ink-50); border: 1px solid var(--hairline); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px; color: var(--ink-400); }
[data-theme="dark"] .lib-empty .le-ic { background: var(--bg-elevated); }
.lib-empty .le-ic svg { width: 24px; height: 24px; }
.lib-empty .le-t { font-size: 17px; font-weight: 700; color: var(--ink-900); letter-spacing: -0.01em; }
.lib-empty .le-s { font-size: 13px; color: var(--ink-500); line-height: 1.55; margin: 8px 0 20px; }

/* asset detail popup */
.asset-detail { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 26px; align-items: start; }
.asset-detail .ad-left { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.asset-detail .ad-left .res-player { width: 100%; max-width: 280px; }
.asset-detail .ad-left .res-player.ar-9x16 { aspect-ratio: 9/16; height: auto; }
.asset-detail .ad-left .res-player.ar-1x1 { aspect-ratio: 1/1; height: auto; }
.asset-detail .ad-left .res-player.ar-16x9 { aspect-ratio: 16/9; height: auto; }
.asset-detail .ad-likebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.asset-detail .ad-likebar .ra-btn { height: 32px; padding: 0 12px; }
.asset-detail .ad-sec { margin-bottom: 22px; }
.asset-detail .ad-sec:last-child { margin-bottom: 0; }
.asset-detail .ad-h { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); margin-bottom: 12px; display: flex; align-items: center; gap: 9px; }
.asset-detail .ad-h-n { background: var(--ink-100); color: var(--ink-600); font-size: 10px; padding: 1px 7px; border-radius: var(--r-pill); }
[data-theme="dark"] .asset-detail .ad-h-n { background: var(--bg-elevated); }

.asset-act { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 13px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); cursor: pointer; transition: all var(--d-fast); margin-bottom: 8px; }
.asset-act:hover { border-color: var(--green-300); background: var(--ink-50); }
[data-theme="dark"] .asset-act:hover { background: var(--bg-elevated); }
.asset-act .aa-ic { width: 32px; height: 32px; flex-shrink: 0; border-radius: var(--r-sm); background: var(--green-50); color: var(--green-700); display: inline-flex; align-items: center; justify-content: center; }
[data-theme="dark"] .asset-act .aa-ic { background: rgba(34,197,94,0.12); color: var(--green-300); }
.asset-act .aa-ic svg { width: 16px; height: 16px; }
.asset-act .aa-tx { flex: 1; display: flex; flex-direction: column; }
.asset-act .aa-n { font-size: 13px; font-weight: 600; color: var(--ink-900); }
.asset-act .aa-s { font-size: 11.5px; color: var(--ink-500); margin-top: 1px; }
.asset-act .aa-go { width: 15px; height: 15px; color: var(--ink-400); flex-shrink: 0; }

.ver-list { display: flex; flex-direction: column; gap: 8px; }
.ver-row { display: flex; align-items: center; gap: 11px; padding: 8px; border: 1px solid var(--hairline); border-radius: var(--r-sm); background: var(--bg-surface); }
.ver-row.current { border-color: var(--green-200); background: var(--green-50); }
[data-theme="dark"] .ver-row.current { background: rgba(34,197,94,0.07); border-color: rgba(34,197,94,0.25); }
.ver-row .ver-thumb { width: 34px; aspect-ratio: 9/16; border-radius: var(--r-xs); overflow: hidden; background: var(--media-well); flex-shrink: 0; }
.ver-row .ver-thumb video { width: 100%; height: 100%; object-fit: cover; }
.ver-row .ver-tx { flex: 1; display: flex; flex-direction: column; }
.ver-row .ver-v { font-size: 12px; font-weight: 700; color: var(--ink-900); display: flex; align-items: center; gap: 7px; }
.ver-row .ver-tag { font-size: 8.5px; font-weight: 700; color: var(--green-700); background: var(--green-100); padding: 1px 6px; border-radius: var(--r-pill); }
[data-theme="dark"] .ver-row .ver-tag { background: rgba(34,197,94,0.15); color: var(--green-300); }
.ver-row .ver-lbl { font-size: 11px; color: var(--ink-500); margin-top: 1px; }
.ver-row .btn-sm { flex-shrink: 0; }

.rights-card { border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 14px 15px; background: var(--bg-surface); }
.rights-head { margin-bottom: 12px; }
.rights-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: var(--r-pill); background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-200); }
[data-theme="dark"] .rights-pill { background: rgba(34,197,94,0.1); color: var(--green-300); }
.rights-pill.off { background: var(--warn-soft); color: var(--warn-ink); border-color: var(--warn-border); }
.rights-pill svg { width: 13px; height: 13px; }
.rights-grid { display: flex; flex-direction: column; gap: 0; }
.rights-row { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--hairline); font-size: 12.5px; }
.rights-row:first-child { border-top: none; }
.rights-row .rr-k { width: 100px; flex-shrink: 0; color: var(--ink-500); font-weight: 600; }
.rights-row .rr-v { color: var(--ink-900); }
.rights-note { display: flex; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--ink-50); font-size: 11.5px; color: var(--ink-600); line-height: 1.5; }
[data-theme="dark"] .rights-note { background: var(--bg-elevated); }
.rights-note svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--ink-400); margin-top: 1px; }
@media (max-width: 760px) { .asset-detail { grid-template-columns: 1fr; } .asset-detail .ad-left .res-player { max-width: 220px; } }

/* ── WORK AREA ─────────────────────────────────────────────────── */
.work { flex: 1; display: grid; grid-template-columns: 332px minmax(0,1fr) 0px; min-height: 0; overflow: hidden; transition: grid-template-columns var(--d-slow) var(--ease-out); }
.work > * { min-width: 0; min-height: 0; }
.work[data-editor-open="true"] { grid-template-columns: 332px minmax(0,1fr) 420px; }

/* ── LEFT · NUMBERED CHECKLIST ─────────────────────────────────── */
.inputs { border-right: 1px solid var(--hairline); background: var(--bg-surface); display: flex; flex-direction: column; overflow: hidden; }
.inputs-scroll { flex: 1; overflow-y: auto; padding: 16px 14px 12px; }
.inputs-foot { flex-shrink: 0; border-top: 1px solid var(--hairline); background: var(--glass-bg-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); padding: 12px 14px 14px; }
/* view-only banner after generation */
/* More settings — collapsible group in the checklist */
.more-toggle { width: 100%; display: flex; align-items: center; gap: 11px; padding: 12px 10px; margin-top: 10px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); cursor: pointer; text-align: left; transition: background var(--d-fast), border-color var(--d-fast); }
.more-toggle:hover { background: var(--hover-surface-2); border-color: var(--hairline-strong); }
.more-toggle .mt-ic { width: 30px; height: 30px; flex-shrink: 0; border-radius: var(--r-sm); background: var(--ink-100); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-600); }
.more-toggle .mt-ic svg { width: 15px; height: 15px; }
.more-toggle .mt-tx { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.more-toggle .mt-t { font-size: 13px; font-weight: 600; color: var(--ink-1000); }
.more-toggle .mt-s { font-size: 11px; line-height: 1.4; color: var(--ink-500); }
.more-toggle .mt-chev { flex-shrink: 0; color: var(--ink-400); transition: transform var(--d-base); }
.more-toggle .mt-chev svg { width: 16px; height: 16px; }
.more-toggle.open .mt-chev { transform: rotate(180deg); }
.more-body { padding-top: 4px; }
.ck-row.ck-static { cursor: default; }
.ck-step { display: inline-flex; align-items: center; gap: 3px; background: var(--seg-track); border-radius: var(--r-pill); padding: 3px; flex-shrink: 0; }
.ck-step .cks-btn { width: 26px; height: 26px; border: none; border-radius: 50%; background: var(--bg-surface); box-shadow: var(--shadow-xs); color: var(--ink-800); font-size: 15px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: color var(--d-fast); }
.ck-step .cks-btn:hover { color: var(--green-600); }
.ck-step .cks-n { min-width: 22px; text-align: center; font-size: 13px; font-weight: 700; color: var(--ink-1000); }
.viewonly-bar { display: none; align-items: center; gap: 10px; padding: 11px 13px; margin-bottom: 12px; border-radius: var(--r-md); background: var(--ink-50); border: 1px solid var(--hairline); }
.work[data-locked="true"] .viewonly-bar { display: flex; }
[data-theme="dark"] .viewonly-bar { background: var(--bg-elevated); }
.viewonly-bar .lock-ic { color: var(--ink-500); flex-shrink: 0; } .viewonly-bar .lock-ic svg { width: 16px; height: 16px; }
.viewonly-bar .vb-tx { flex: 1; min-width: 0; }
.viewonly-bar .vb-t { font-size: 12px; font-weight: 700; color: var(--ink-900); }
.viewonly-bar .vb-s { font-size: 10.5px; color: var(--ink-500); margin-top: 1px; line-height: 1.4; }
.ck-progress { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.work[data-locked="true"] .ck-progress { display: none; }
.ck-progress .ck-bar { flex: 1; height: 6px; border-radius: var(--r-pill); background: var(--ink-200); overflow: hidden; }
.ck-progress .ck-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--green-400), var(--green-600)); transition: width var(--d-base) var(--ease-out); }
.ck-progress .ck-lbl { font-size: 11.5px; font-weight: 600; color: var(--green-700); white-space: nowrap; }
.ck-group { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-500); padding: 0 8px; margin: 16px 0 6px; display: flex; align-items: center; gap: 8px; }
.ck-group:first-of-type { margin-top: 2px; }
.ck-group .gline { flex: 1; height: 1px; background: var(--hairline); }
.ck-row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 10px; border-radius: var(--r-md); border: 1px solid transparent; background: transparent; cursor: pointer; text-align: left; transition: background var(--d-fast), border-color var(--d-fast); margin-bottom: 2px; }
.ck-row:hover { background: var(--hover-surface-2); border-color: var(--hairline); }
.work[data-locked="true"] .ck-row { cursor: default; }
.work[data-locked="true"] .ck-row:hover { background: transparent; border-color: transparent; }
.ck-tick { width: 23px; height: 23px; flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 11px; font-weight: 700; background: var(--accent-chip-bg); color: var(--accent-chip-ink); border: 1.5px solid transparent; transition: all var(--d-fast); }
.ck-tick svg { width: 13px; height: 13px; }
.ck-tick.todo { background: var(--bg-surface); border-color: var(--ink-300); color: var(--ink-400); }
.ck-tx { flex: 1; min-width: 0; }
.ck-nm { display: block; font-size: 13px; font-weight: 600; color: var(--ink-900); letter-spacing: -0.01em; }
.ck-nm .opt { font-size: 9.5px; font-weight: 600; color: var(--ink-400); margin-left: 5px; }
.ck-vl { display: block; font-size: 11.5px; color: var(--ink-500); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck-go { color: var(--ink-400); display: inline-flex; }
.work[data-locked="true"] .ck-go { display: none; }
.ck-go svg { width: 15px; height: 15px; }
/* cost strip */
.gen-cost { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.gen-cost .gen-cost-num { display: flex; align-items: baseline; gap: 6px; }
.gen-cost .csn { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink-1000); font-family: var(--font-display); }
.gen-cost .csu { font-size: 11.5px; color: var(--ink-500); font-weight: 500; }
.gen-cost .spacer { flex: 1; }
.gen-cost .cs-detail { font-size: 11px; color: var(--green-600); font-weight: 600; cursor: pointer; background: none; border: none; }
.gen-cost .cs-detail:hover { text-decoration: underline; }
#generateBtn { width: 100%; height: 46px; }
#newVideoBtn { width: 100%; height: 46px; display: none; }
.work[data-locked="true"] #generateBtn { display: none; }
.work[data-locked="true"] #newVideoBtn { display: inline-flex; }
.work[data-locked="true"] .gen-cost { display: none; }
.credit-short { display: none; align-items: center; gap: 8px; margin-bottom: 11px; padding: 9px 11px; border-radius: var(--r-md); background: var(--warn-soft); border: 1px solid var(--warn-border); }
.inputs-foot[data-short="true"] .credit-short { display: flex; }
.work[data-locked="true"] .credit-short { display: none !important; }
.credit-short .cs-warn { flex: 1; font-size: 11.5px; font-weight: 600; color: var(--warn-ink); }

/* ── CENTER · CANVAS ───────────────────────────────────────────── */
.canvas { position: relative; overflow: hidden; display: flex; flex-direction: column; background: radial-gradient(1200px 600px at 50% -10%, rgba(34,197,94,0.05), transparent 60%), var(--bg-canvas); }
.canvas-bar { height: 46px; flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--hairline); background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.canvas-bar .ctitle { font-size: 12.5px; font-weight: 600; color: var(--ink-700); display: flex; align-items: center; gap: 8px; }
.canvas-bar .ctitle .dotgrn { width: 7px; height: 7px; border-radius: 50%; background: var(--green-500); }
.canvas-bar .spacer { flex: 1; }
.canvas-bar .ar-pill { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; color: var(--ink-700); padding: 4px 9px; border-radius: var(--r-pill); border: 1px solid var(--hairline-strong); background: var(--bg-surface); }
/* align-items: safe center → centers when it fits, but falls back to start (top reachable +
   scrollable) when the viewport is too short. Avoids the flex-center clip that hid the frame. */
.canvas-stage { flex: 1; overflow: auto; display: flex; align-items: safe center; justify-content: center; padding: 28px; position: relative; }
/* the player frame — reshapes to aspect */
.frame { position: relative; background: var(--media-well); overflow: hidden; border-radius: var(--r-xl); box-shadow: var(--shadow-xl); border: 1px solid rgba(255,255,255,0.06); transition: width var(--d-stately) var(--ease-out), height var(--d-stately) var(--ease-out); }
.frame.ar-9x16 { width: 322px; height: 572px; }
/* ── BRANDED MOTION-GRAPHIC preview (no photo, no video) — animated green mesh ──
   Shared by the setup PREVIEW (.frame) and the GENERATING screen (.gen-frame). */
.frame .mg-mesh, .gen-frame .mg-mesh { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(120% 90% at 50% 0%, #0e2a1a, #07120c 70%); }
.frame .mg-blob, .gen-frame .mg-blob { position: absolute; border-radius: 50%; filter: blur(34px); opacity: 0.85; mix-blend-mode: screen; }
.frame .mg-blob.b1, .gen-frame .mg-blob.b1 { width: 62%; height: 42%; left: -12%; top: 6%; background: radial-gradient(circle, #22C55E, transparent 68%); animation: mgFloat1 9s ease-in-out infinite; }
.frame .mg-blob.b2, .gen-frame .mg-blob.b2 { width: 70%; height: 50%; right: -18%; top: 28%; background: radial-gradient(circle, #16A34A, transparent 70%); animation: mgFloat2 11s ease-in-out infinite; }
.frame .mg-blob.b3, .gen-frame .mg-blob.b3 { width: 56%; height: 40%; left: 12%; bottom: -8%; background: radial-gradient(circle, #86EFAC, transparent 72%); opacity: 0.55; animation: mgFloat3 13s ease-in-out infinite; }
@keyframes mgFloat1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(18%,12%) scale(1.18); } }
@keyframes mgFloat2 { 0%,100% { transform: translate(0,0) scale(1.05); } 50% { transform: translate(-14%,-10%) scale(0.9); } }
@keyframes mgFloat3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(10%,-14%) scale(1.2); } }
.frame .mg-grid, .gen-frame .mg-grid { position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(34,197,94,0.10) 1px, transparent 1px), linear-gradient(90deg, rgba(34,197,94,0.10) 1px, transparent 1px); background-size: 26px 26px; mask-image: radial-gradient(120% 90% at 50% 30%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(120% 90% at 50% 30%, #000 30%, transparent 75%); }
.frame .mg-scan { position: absolute; left: 0; right: 0; height: 30%; top: -30%; pointer-events: none; background: linear-gradient(180deg, transparent, rgba(34,197,94,0.14), transparent); animation: mgScan 3.6s linear infinite; }
@keyframes mgScan { 0% { top: -30%; } 100% { top: 100%; } }
/* shimmer particles — fine drifting green specks for a premium, alive feel */
.frame .mg-spark, .gen-frame .mg-spark { position: absolute; inset: 0; pointer-events: none; opacity: 0.9; mix-blend-mode: screen;
  background-image:
    radial-gradient(1.4px 1.4px at 18% 24%, rgba(134,239,172,0.9), transparent 60%),
    radial-gradient(1.2px 1.2px at 62% 12%, rgba(34,197,94,0.85), transparent 60%),
    radial-gradient(1.6px 1.6px at 80% 46%, rgba(134,239,172,0.8), transparent 60%),
    radial-gradient(1.2px 1.2px at 34% 64%, rgba(34,197,94,0.8), transparent 60%),
    radial-gradient(1.5px 1.5px at 70% 80%, rgba(134,239,172,0.85), transparent 60%),
    radial-gradient(1.2px 1.2px at 12% 86%, rgba(34,197,94,0.75), transparent 60%);
  animation: mgSpark 6s ease-in-out infinite; }
@keyframes mgSpark { 0%,100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-10px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .frame .mg-blob, .frame .mg-scan, .frame .mg-spark, .gen-frame .mg-spark, .gen-frame .mg-blob, .gen-frame .mg-scan { animation: none; } }
.prev-badge { position:absolute; left:50%; top:14px; transform:translateX(-50%); z-index:6; display:inline-flex; align-items:center; gap:6px; font-family:var(--font-mono); font-size:10px; font-weight:700; letter-spacing:0.05em; text-transform:uppercase; color:#fff; background:rgba(0,0,0,0.55); padding:5px 11px; border-radius:var(--r-pill); backdrop-filter:blur(6px); }
.prev-badge svg { width:13px; height:13px; }
.frame.ar-1x1  { width: 470px; height: 470px; }
.frame.ar-4x5  { width: 424px; height: 530px; }
.frame.ar-16x9 { width: 680px; height: 382px; }
.frame video.fv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--media-well); }
.frame .grade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(160deg, rgba(34,197,94,0.06), transparent 38%), linear-gradient(0deg, rgba(0,0,0,0.5), transparent 52%); }
.ov-cap { position: absolute; left: 16px; right: 16px; bottom: 70px; text-align: center; pointer-events: none; transition: all var(--d-base); }
.ov-cap .line { display: inline-block; font-family: var(--amp-hexcoded-font-display), Outfit, sans-serif; font-weight: 900; font-size: 17px; letter-spacing: -0.02em; color: #fff; line-height: 1.18; padding: 2px 6px;
  /* PHANTOM stepped green shadow (1/2/3px · 85/55/32%) — breathes on a 3s cycle */
  text-shadow: 1px 1px 0 rgba(34,197,94,0.85), 2px 2px 0 rgba(34,197,94,0.55), 3px 3px 0 rgba(34,197,94,0.32), 0 2px 12px rgba(0,0,0,0.6);
  animation: capPhantom 3s ease-in-out infinite; }
@keyframes capPhantom { 0%,100% { text-shadow: 1px 1px 0 rgba(34,197,94,0.85), 2px 2px 0 rgba(34,197,94,0.55), 3px 3px 0 rgba(34,197,94,0.32), 0 2px 12px rgba(0,0,0,0.6); } 50% { text-shadow: 1px 1px 0 rgba(34,197,94,0.34), 2px 2px 0 rgba(34,197,94,0.22), 3px 3px 0 rgba(34,197,94,0.13), 0 2px 12px rgba(0,0,0,0.6); } }
@media (prefers-reduced-motion: reduce) { .ov-cap .line { animation: none; } }
.ov-cap .line em { font-style: normal; color: var(--green-300); }
.ov-cap.pos-top { bottom: auto; top: 24px; } .ov-cap.pos-mid { bottom: auto; top: 46%; } .ov-cap.pos-bot { bottom: 70px; }
.ov-cap.clean .line { background: rgba(0,0,0,0.5); border-radius: 6px; } .ov-cap.minimal .line { font-weight: 600; font-size: 14px; }
.ov-cap.off { display: none; }
.ov-super { position: absolute; left: 16px; bottom: 18px; pointer-events: none; }
.ov-super .card { background: rgba(255,255,255,0.94); border-radius: var(--r-md); padding: 7px 12px; box-shadow: 0 8px 20px rgba(0,0,0,0.3); font-size: 11.5px; font-weight: 700; color: var(--ink-1000); }
.ov-super.off { display: none; }
.ov-cast { position: absolute; left: 14px; top: 48px; pointer-events: none; }
.ov-cast .card { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.45); backdrop-filter: blur(8px); border-radius: var(--r-pill); padding: 4px 12px 4px 4px; }
.ov-cast .card img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.ov-cast .card .nm { font-size: 11px; font-weight: 600; color: #fff; }
.ov-cast .card .badge { font-size: 8px; font-weight: 700; color: #fff; background: var(--green-600); padding: 2px 5px; border-radius: var(--r-xs); }
.ov-cast.off { display: none; }
/* custom scrubber */
.scrub { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px 12px; background: linear-gradient(0deg, rgba(0,0,0,0.7), transparent); display: flex; align-items: center; gap: 11px; opacity: 0; transition: opacity var(--d-base); z-index: 5; }
.frame:hover .scrub, .frame.scrubshow .scrub { opacity: 1; }
.scrub .pp { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; border: none; background: rgba(255,255,255,0.92); color: var(--ink-1000); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.scrub .pp svg { width: 16px; height: 16px; }
.scrub .track { flex: 1; height: 5px; border-radius: var(--r-pill); background: rgba(255,255,255,0.28); cursor: pointer; position: relative; }
.scrub .track .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--r-pill); background: var(--green-400); width: 0%; }
.scrub .track .knob { position: absolute; top: 50%; transform: translate(-50%,-50%); width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.5); left: 0%; }
.scrub .tlabel { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; color: #fff; white-space: nowrap; min-width: 74px; text-align: right; }
.frame-hint { position: absolute; left: 50%; bottom: -32px; transform: translateX(-50%); font-size: 11.5px; color: var(--ink-500); white-space: nowrap; }

/* ── EMPTY / FIRST-RUN ─────────────────────────────────────────── */
.empty-stage { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: var(--bg-canvas); padding: 24px; }
.empty-stage.off { display: none; }
.empty-card { max-width: 560px; text-align: center; }
.empty-card .eyebrow { display: inline-block; margin-bottom: 14px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--green-700); background: var(--green-50); border: 1px solid var(--green-200); border-radius: var(--r-pill); padding: 5px 12px; }
[data-theme="dark"] .empty-card .eyebrow { background: rgba(34,197,94,0.1); }
.empty-card h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.12; margin: 0 0 12px; }
.empty-card h1 em { font-style: normal; color: var(--green-600); }
.empty-card .lead { font-size: 15px; color: var(--ink-600); line-height: 1.55; max-width: 460px; margin: 0 auto 26px; }
.empty-card .start-btn { margin: 0 auto; }

/* ── GENERATION (cinematic single-stage, plain grey, correct aspect) ── */
.gen-stage { position: absolute; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 18px; padding: 30px; background: var(--bg-soft); }
[data-theme="dark"] .gen-stage { background: var(--bg-canvas); }
.gen-stage.on { display: flex; }
.gen-frame { position: relative; background: #16161a; border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-xl); border: 1px solid var(--hairline); transition: width var(--d-stately) var(--ease-out), height var(--d-stately) var(--ease-out); }
.gen-frame.ar-9x16 { width: 216px; height: 384px; }
.gen-frame.ar-1x1  { width: 320px; height: 320px; }
.gen-frame.ar-4x5  { width: 288px; height: 360px; }
.gen-frame.ar-16x9 { width: 440px; height: 248px; }
.gen-frame .mg-mesh { transform: scale(1.04); filter: saturate(0.9); transition: transform 1.1s, filter 1.1s; }
.gen-frame[data-phase="build"] .mg-mesh, .gen-frame[data-phase="caption"] .mg-mesh, .gen-frame[data-phase="done"] .mg-mesh { transform: scale(1); filter: saturate(1.05); }
.gen-frame .brandtint { position: absolute; inset: 0; background: linear-gradient(150deg, rgba(34,197,94,0.28), transparent 48%), linear-gradient(0deg, rgba(0,0,0,0.55), transparent 55%); opacity: 0.35; transition: opacity 1s; }
.gen-frame[data-phase="caption"] .brandtint, .gen-frame[data-phase="done"] .brandtint { opacity: 1; }
.gen-frame .scanline { position: absolute; left: 0; right: 0; height: 32%; background: linear-gradient(180deg, transparent, rgba(34,197,94,0.16), transparent); top: -32%; animation: scan 2.4s linear infinite; pointer-events: none; }
@keyframes scan { 0% { top: -32%; } 100% { top: 100%; } }
.gen-frame .grain { position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px); background-size: 3px 3px; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
/* G-H locked: the brand breathes while it renders — Phantom wordmark, no engine/jargon chrome */
.gen-frame .gen-wm { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.gen-frame .gen-wm .hexwm { font-size: 24px; color: #fff; }
.gen-frame .ar-tag { position: absolute; right: 10px; top: 10px; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; color: #fff; background: rgba(0,0,0,0.5); padding: 3px 8px; border-radius: var(--r-pill); }
.gen-info { width: 100%; max-width: 460px; text-align: center; }
.gen-info .gt { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink-1000); }
.gen-info .gs { font-size: 12.5px; color: var(--ink-600); margin-top: 3px; line-height: 1.5; }
.gen-ring { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 14px 0 12px; }
.gen-ring .ring { width: 44px; height: 44px; flex-shrink: 0; }
.gen-ring .pct { font-size: 20px; font-weight: 800; font-family: var(--font-display); color: var(--ink-1000); }
.gen-checks { display: inline-flex; flex-direction: column; gap: 7px; text-align: left; }
.gen-check { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-400); opacity: 0.4; transition: all var(--d-base); }
.gen-check.in { opacity: 1; }
.gen-check.ok { color: var(--ink-800); }
.gen-check .cdot { width: 17px; height: 17px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--ink-300); display: inline-flex; align-items: center; justify-content: center; }
.gen-check.ok .cdot { background: var(--green-500); border-color: var(--green-500); }
.gen-check .cdot svg { width: 11px; height: 11px; color: #fff; }
.gen-batchnote { font-size: 11.5px; color: var(--ink-500); }
/* ── BATCH / COMPARE progress grid — per-item status (some Ready, some Generating, one Failed) ── */
.gen-batchgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; width: 100%; max-width: 460px; }
.gbi { border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); overflow: hidden; text-align: left; }
.gbi .gbi-vid { position: relative; aspect-ratio: 16/10; background: var(--media-well); overflow: hidden; }
.gbi .gbi-vid .ph-mesh { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 0%, #0e2a1a, #07120c 70%); opacity: .9; }
.gbi .gbi-vid video { width: 100%; height: 100%; object-fit: cover; }
.gbi .gbi-spin { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.gbi .gbi-spin .sp { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,0.25); border-top-color: var(--green-400); animation: tspin .8s linear infinite; }
@keyframes tspin { to { transform: rotate(360deg); } }
.gbi .gbi-fx { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--danger); }
.gbi .gbi-fx svg { width: 22px; height: 22px; }
.gbi .gbi-body { padding: 7px 9px 8px; display: flex; align-items: center; gap: 6px; }
.gbi .gbi-n { font-size: 11px; font-weight: 600; color: var(--ink-1000); flex: 1; min-width: 0; }
.gbi .gbi-st { font-size: 9.5px; font-weight: 700; letter-spacing: 0.03em; padding: 2px 7px; border-radius: var(--r-pill); white-space: nowrap; }
.gbi .gbi-st.ready { background: var(--green-50); color: var(--green-700); }
[data-theme="dark"] .gbi .gbi-st.ready { background: color-mix(in srgb, var(--green-500) 14%, transparent); color: var(--green-300); }
.gbi .gbi-st.gen { background: var(--warn-soft); color: var(--warn-ink); }
.gbi .gbi-st.fail { background: var(--danger-soft); color: var(--danger); }
.gbi.is-fail { border-color: var(--danger-border); }
.gbi.is-ready { border-color: var(--green-300); }
/* background-run reassurance + notify affordance (behavioural copy; full notif UI later) */
.gen-bg { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 16px; padding: 11px 14px; border-radius: var(--r-md); background: var(--ink-50); border: 1px solid var(--hairline); max-width: 460px; }
[data-theme="dark"] .gen-bg { background: var(--bg-elevated); }
.gen-bg > i { color: var(--green-600); flex-shrink: 0; width: 16px; height: 16px; }
.gen-bg .gen-bg-tx { flex: 1; min-width: 180px; font-size: 11.5px; line-height: 1.45; color: var(--ink-600); text-align: left; }
.gen-bg .gen-bg-eta { display: inline-block; font-weight: 700; color: var(--green-700); }
[data-theme="dark"] .gen-bg .gen-bg-eta { color: var(--green-300); }
.gen-bg .gen-bg-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: var(--r-pill); border: 1px solid var(--hairline-strong); background: var(--bg-surface); cursor: pointer; font-size: 11.5px; font-weight: 600; color: var(--ink-800); transition: all var(--d-fast); }
.gen-bg .gen-bg-btn:hover { background: var(--ink-100); color: var(--ink-1000); border-color: var(--ink-300); }
.gen-bg .gen-bg-btn svg { width: 13px; height: 13px; }
.gen-bg .gen-bg-btn.ghost { border-color: transparent; background: transparent; color: var(--ink-500); }
.gen-bg .gen-bg-btn.ghost:hover { background: var(--ink-100); color: var(--ink-1000); }

/* ── RESULTS (responsive: gallery on large, centered on small) ──── */
.results-stage { position: absolute; inset: 0; z-index: 30; display: none; flex-direction: column; }
.results-stage.on { display: flex; }
.results-head { flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 13px 22px; border-bottom: 1px solid var(--hairline); background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.results-head .rh-t { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.results-head .rh-s { font-size: 12px; color: var(--ink-500); margin-top: 1px; }
.results-head .spacer { flex: 1; }
.res-body { flex: 1; overflow: hidden; display: flex; min-height: 0; min-width: 0; }
/* gallery rail (large) */
.res-gallery { width: 218px; flex-shrink: 0; border-right: 1px solid var(--hairline); overflow-y: auto; padding: 14px; background: var(--bg-surface); }
.res-gallery .rg-label { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-500); margin-bottom: 11px; }
.rg-thumb { position: relative; width: 100%; border: 1.5px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; background: var(--bg-surface); cursor: pointer; margin-bottom: 9px; transition: all var(--d-fast); padding: 0; text-align: left; display: block; }
.rg-thumb:hover { border-color: var(--ink-300); }
.rg-thumb.on { border-color: var(--green-500); box-shadow: var(--sel-ring); }
.rg-thumb .rt-vid { position: relative; aspect-ratio: 16/10; background: var(--media-well); overflow: hidden; }
.rg-thumb .rt-vid video { width: 100%; height: 100%; object-fit: cover; }
.rg-thumb .rt-grade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.45)); pointer-events: none; }
.rg-thumb .rt-eng { position: absolute; left: 7px; top: 7px; font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; color: #fff; background: rgba(0,0,0,0.55); padding: 2px 7px; border-radius: var(--r-pill); backdrop-filter: blur(4px); }
.rg-thumb .rt-body { padding: 7px 9px 9px; }
.rg-thumb .rt-look { font-size: 11.5px; font-weight: 700; color: var(--ink-1000); }
.rg-thumb .rt-meta { font-size: 10px; color: var(--ink-500); margin-top: 1px; }
/* detail / player area — scrolls when content exceeds the viewport.
   justify-content:flex-start (not center) so the TOP stays reachable when overflowing;
   auto-margins on the inner block keep it visually centred when there IS room. */
.res-detail { flex: 1; min-width: 0; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 14px; padding: 22px; background: radial-gradient(700px 360px at 50% 0%, rgba(34,197,94,0.05), transparent 60%), var(--bg-soft); }
.res-detail > :first-child { margin-top: auto; }
.res-detail > :last-child { margin-bottom: auto; }
[data-theme="dark"] .res-detail { background: radial-gradient(700px 360px at 50% 0%, rgba(34,197,94,0.07), transparent 60%), var(--bg-canvas); }
.res-counter { font-size: 11.5px; font-weight: 600; color: var(--ink-500); }
.res-counter b { color: var(--ink-900); }
.res-eng { font-size: 11.5px; font-weight: 600; color: var(--ink-600); }
.res-eng .cl-eng { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--green-700); background: var(--green-50); padding: 3px 8px; border-radius: var(--r-pill); margin-left: 4px; }
[data-theme="dark"] .res-eng .cl-eng { background: rgba(34,197,94,0.12); color: var(--green-300); }
/* result player frame — scales to FIT the available height/width (never overflows).
   aspect-ratio holds the shape; max-height caps it to the viewport so the full video +
   controls stay reachable; the .res-detail container scrolls if anything still spills. */
.res-player { position: relative; flex-shrink: 0; border-radius: var(--r-lg); overflow: hidden; background: var(--media-well); box-shadow: var(--shadow-xl); border: 1px solid rgba(255,255,255,0.06);
  aspect-ratio: 9 / 16; height: min(448px, 62vh); width: auto; max-width: 100%; }
.res-player.ar-1x1  { aspect-ratio: 1 / 1;  height: min(380px, 62vh); }
.res-player.ar-4x5  { aspect-ratio: 4 / 5;  height: min(400px, 62vh); }
.res-player.ar-16x9 { aspect-ratio: 16 / 9; height: auto; width: min(520px, 100%); max-height: 62vh; }
.res-player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.res-player .pl-grade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(160deg, rgba(34,197,94,0.05), transparent 40%), linear-gradient(0deg, rgba(0,0,0,0.45), transparent 50%); }
.res-player .pl-cap { position: absolute; left: 14px; right: 14px; bottom: 56px; text-align: center; pointer-events: none; }
.res-player .pl-cap .ln { display: inline-block; font-weight: 800; font-size: 15px; color: #fff; line-height: 1.2; text-shadow: 0 2px 10px rgba(0,0,0,0.6); padding: 2px 6px; }
.res-player .pl-cap .ln em { font-style: normal; color: var(--green-300); }
.res-player .pl-vbadge { position: absolute; left: 12px; top: 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 9.5px; font-weight: 700; padding: 4px 9px; border-radius: var(--r-pill); background: rgba(255,255,255,0.92); color: var(--green-700); box-shadow: var(--shadow-sm); }
.res-player .pl-vbadge.flag { color: var(--warn-ink); }
.res-player .pl-vbadge svg { width: 11px; height: 11px; }
.res-nav { display: flex; align-items: center; gap: 12px; max-width: 100%; }
.cnav { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--hairline); background: var(--bg-surface); cursor: pointer; color: var(--ink-700); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--shadow-sm); transition: all var(--d-fast); }
.cnav:hover { background: var(--ink-50); border-color: var(--hairline-strong); }
.cnav:disabled { opacity: 0.3; cursor: default; }
.cnav svg { width: 18px; height: 18px; }
.res-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ra-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: var(--r-pill); border: 1px solid var(--hairline); background: var(--bg-surface); cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-700); transition: all var(--d-fast); }
/* secondary result actions: keep dark ink text on a light hover bg (both themes) */
.ra-btn:hover { background: var(--ink-100); border-color: var(--hairline-strong); color: var(--ink-1000); }
.ra-btn svg { width: 15px; height: 15px; }
.ra-btn.like.on { background: var(--green-50); border-color: var(--green-300); color: var(--green-700); }
.ra-btn.like.on:hover { background: var(--green-100); color: var(--green-800); }
[data-theme="dark"] .ra-btn.like.on { background: rgba(34,197,94,0.1); color: var(--green-300); }
.ra-btn.dislike.on { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }
.ra-btn.dislike.on:hover { background: var(--danger-soft-2); color: var(--danger); }
/* primary result action (Open Editor): white text on green, hover = darker green */
.ra-btn.primary { background: linear-gradient(135deg, var(--green-500), var(--green-600)); color: var(--amp-hexcoded-color-white); border: none; box-shadow: var(--shadow-green-soft); }
.ra-btn.primary:hover { background: linear-gradient(135deg, var(--green-600), var(--green-700)); color: var(--amp-hexcoded-color-white); box-shadow: var(--shadow-green); }
.dots { display: flex; gap: 6px; justify-content: center; }
.dots .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-300); cursor: pointer; transition: all var(--d-fast); border: none; padding: 0; }
.dots .dot.on { background: var(--green-500); width: 22px; border-radius: var(--r-pill); }
.qc-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: var(--r-pill); background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-200); }
[data-theme="dark"] .qc-pill { background: rgba(34,197,94,0.1); color: var(--green-300); }
.qc-pill svg { width: 13px; height: 13px; }
.qc-pill.flag { background: var(--warn-soft); color: var(--warn-ink); border-color: var(--warn-border); }
[data-theme="dark"] .qc-pill.flag { color: var(--warning); }
.qc-pill.fail { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.dots .dot.fail { background: var(--danger); }

/* ── gallery thumb status badges (Ready winner / Review / Failed / Dismissed) ── */
.rg-thumb .rt-st { position: absolute; right: 7px; top: 7px; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; box-shadow: var(--shadow-sm); }
.rg-thumb .rt-st svg { width: 12px; height: 12px; }
.rg-thumb .rt-st.win { background: var(--green-500); }
.rg-thumb .rt-st.rev { background: #ff9f0a; }
.rg-thumb .rt-st.fail { background: var(--danger); }
.rg-thumb .rt-st.dim { background: var(--ink-400); }
.rg-thumb.is-fail { border-color: var(--danger-border); }
.rg-thumb.is-dim { opacity: 0.5; }
.rg-thumb .rt-failmesh { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--danger) 22%, #16161a), #0b0b0d 75%); }
.rg-thumb .rt-failic { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: color-mix(in srgb, var(--danger) 80%, #fff); }
.rg-thumb .rt-failic svg { width: 22px; height: 22px; }

/* ── FAILED RENDER card (center detail) ── */
.res-player.is-fail { background: var(--bg-surface); border: 1px dashed var(--danger-border); box-shadow: none; display: flex; align-items: center; justify-content: center; }
.fail-card { text-align: center; padding: 22px 20px; max-width: 280px; }
.fail-card .fail-ic { width: 52px; height: 52px; border-radius: 50%; background: var(--danger-soft); color: var(--danger); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.fail-card .fail-ic svg { width: 26px; height: 26px; }
.fail-card .fail-ic.retry { background: var(--accent-soft); }
.fail-card .fail-ic.retry .sp { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--green-500) 28%, transparent); border-top-color: var(--green-500); animation: tspin .8s linear infinite; }
.fail-card .fail-t { font-size: 16px; font-weight: 700; color: var(--ink-1000); letter-spacing: -0.01em; }
.fail-card .fail-s { font-size: 12.5px; color: var(--ink-600); margin-top: 6px; line-height: 1.5; }
.fail-card .fail-s b { color: var(--ink-1000); }
.fail-card .fail-acts { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

/* ── NEEDS-REVIEW banner (center detail) ── */
.review-banner { display: flex; gap: 11px; align-items: flex-start; max-width: 460px; padding: 13px 15px; border-radius: var(--r-md); background: var(--warn-soft); border: 1px solid var(--warn-border); }
.review-banner .rb-ic { width: 30px; height: 30px; border-radius: 50%; background: #ff9f0a; color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.review-banner .rb-ic svg { width: 16px; height: 16px; }
.review-banner .rb-t { font-size: 13px; font-weight: 700; color: var(--warn-ink); }
.review-banner .rb-s { font-size: 12px; color: var(--ink-700); margin-top: 3px; line-height: 1.5; }

/* ── COMPARE · winner + dismiss ── */
.res-player.is-winner { box-shadow: 0 0 0 3px var(--green-500), var(--shadow-xl); }
.res-player .pl-vbadge.win { background: var(--green-500); color: #fff; }
.ra-btn.primary.is-winner { background: linear-gradient(135deg, var(--green-600), var(--green-700)); }
.compare-hint { display: flex; align-items: flex-start; gap: 8px; max-width: 460px; font-size: 11.5px; color: var(--ink-600); line-height: 1.5; padding: 0 6px; }
.compare-hint svg { width: 14px; height: 14px; color: var(--green-600); flex-shrink: 0; margin-top: 1px; }
[data-theme="dark"] .compare-hint svg { color: var(--green-300); }

/* responsive: collapse gallery rail at small center widths */
.res-body[data-compact="true"] .res-gallery { display: none; }

/* ── RIGHT · EDITOR DRAWER ─────────────────────────────────────── */
.editor { background: var(--bg-surface); border-left: 1px solid var(--hairline); display: flex; flex-direction: column; overflow: hidden; }
.work[data-editor-open="false"] .editor { display: none; }
.editor-head { flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--hairline); background: var(--glass-bg-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.editor-head .eh-t { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; }
.editor-head .eh-s { font-size: 11px; color: var(--ink-500); }
.editor-head .eh-close { margin-left: auto; width: 30px; height: 30px; border-radius: var(--r-sm); border: 1px solid var(--hairline); background: var(--bg-surface); cursor: pointer; color: var(--ink-600); display: inline-flex; align-items: center; justify-content: center; }
.editor-head .eh-close:hover { background: var(--ink-100); }
.editor-head .eh-close svg { width: 15px; height: 15px; }
.editor-scroll { flex: 1; overflow-y: auto; padding: 16px; }
.st-sec { margin-bottom: 22px; }
.st-sec .st-h { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.st-sec .st-h .gl { flex: 1; height: 1px; background: var(--hairline); }
.ed-player { position: relative; aspect-ratio: 9/16; max-width: 218px; margin: 0 auto 6px; border-radius: var(--r-md); overflow: hidden; background: var(--media-well); box-shadow: var(--shadow-md); }
.ed-player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tool-row { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); cursor: pointer; margin-bottom: 7px; transition: all var(--d-fast); }
.tool-row:hover { border-color: var(--hairline-strong); box-shadow: var(--shadow-xs); }
.tool-row .tr-ic { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--ink-100); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--ink-700); }
[data-theme="dark"] .tool-row .tr-ic { background: var(--bg-elevated); }
.tool-row .tr-ic svg { width: 16px; height: 16px; }
.tool-row .tr-tx { flex: 1; min-width: 0; }
.tool-row .tr-name { display: block; font-size: 13px; font-weight: 600; color: var(--ink-900); }
.tool-row .tr-sub { display: block; font-size: 11px; color: var(--ink-500); margin-top: 1px; }
.cbadge { font-family: var(--font-mono); font-size: 10px; font-weight: 700; padding: 4px 8px; border-radius: var(--r-pill); white-space: nowrap; flex-shrink: 0; background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-200); }
[data-theme="dark"] .cbadge { background: rgba(34,197,94,0.1); }
.qc-grp { margin-bottom: 14px; }
.qc-grp .qg-h { font-size: 11px; font-weight: 700; color: var(--ink-700); margin-bottom: 7px; display: flex; align-items: center; gap: 7px; }
.qc-check { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border: 1px solid var(--hairline); border-radius: var(--r-sm); margin-bottom: 6px; background: var(--bg-surface); }
.qc-check .qc-ic { width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.qc-check .qc-ic svg { width: 11px; height: 11px; color: #fff; }
.qc-check.pass .qc-ic { background: var(--green-500); }
.qc-check.flag .qc-ic { background: var(--warning); }
.qc-check .qc-nm { font-size: 12px; font-weight: 600; color: var(--ink-900); }
.qc-check .qc-det { font-size: 11px; color: var(--ink-500); margin-top: 2px; line-height: 1.4; }
.qc-check .qc-miss { font-size: 10.5px; color: var(--green-700); font-weight: 600; cursor: pointer; margin-top: 4px; display: inline-block; }
.qc-check .qc-miss:hover { text-decoration: underline; }
.ask-box { border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); padding: 12px; }
.ask-box textarea { width: 100%; border: none; resize: none; background: transparent; font-family: inherit; font-size: 13px; color: var(--ink-900); outline: none; min-height: 48px; }
.ask-box textarea::placeholder { color: var(--ink-400); }
.ask-foot { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.ask-chip { font-size: 11px; font-weight: 600; padding: 5px 11px; border-radius: var(--r-pill); border: 1px solid var(--hairline); background: var(--bg-surface); cursor: pointer; color: var(--ink-700); }
.ask-chip:hover { border-color: var(--green-300); color: var(--green-700); }
.export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.export-tile { padding: 12px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); cursor: pointer; text-align: center; transition: all var(--d-fast); }
.export-tile:hover { border-color: var(--green-300); }
.export-tile .et-ic { font-size: 20px; } .export-tile .et-n { font-size: 12px; font-weight: 600; color: var(--ink-900); margin-top: 5px; } .export-tile .et-s { font-size: 10px; color: var(--ink-500); }

/* ── TOOL PICKER (New project → choose a tool first) ── */
.tp-hero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--r-xl); cursor: pointer; background: linear-gradient(135deg, rgba(34,197,94,0.12), rgba(34,197,94,0.03)); border: 1.5px solid var(--green-300); transition: all var(--d-base); }
.tp-hero:hover { box-shadow: var(--shadow-md); border-color: var(--green-500); transform: translateY(-1px); }
[data-theme="dark"] .tp-hero { border-color: rgba(34,197,94,0.35); }
.tp-hero .tp-ic { width: 48px; height: 48px; border-radius: var(--r-md); background: linear-gradient(135deg, var(--green-500), var(--green-700)); color: var(--amp-hexcoded-color-white); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--shadow-green-soft); }
.tp-hero .tp-ic svg { width: 24px; height: 24px; }
.tp-hero .tp-tx { flex: 1; min-width: 0; }
.tp-hero .tp-t { font-size: 16px; font-weight: 800; color: var(--ink-1000); letter-spacing: -0.01em; display: flex; align-items: center; gap: 9px; }
.tp-hero .tp-now { font-size: 9px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--amp-hexcoded-color-white); background: var(--green-600); padding: 3px 8px; border-radius: var(--r-pill); }
.tp-hero .tp-s { font-size: 12.5px; color: var(--ink-600); margin-top: 3px; line-height: 1.45; }
.tp-hero .tp-go { margin-left: auto; color: var(--green-600); flex-shrink: 0; }
.tp-soon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tp-soon { position: relative; overflow: hidden; text-align: left; width: 100%; padding: 13px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-soft); cursor: default; transition: border-color var(--d-fast); }
.tp-soon:hover { border-color: var(--hairline-strong); }
/* shimmer removed — the coming-soon cards stay quiet so the live URL→Ad hero leads the eye */
.tp-soon::after { display: none; }
@keyframes tpShimmer { 0% { left: -60%; } 60%,100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) { .tp-soon::after { animation: none; } }
.tp-soon .tps-head { display: flex; align-items: center; gap: 9px; }
.tp-soon .tps-ic { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--ink-100); color: var(--ink-500); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-theme="dark"] .tp-soon .tps-ic { background: var(--bg-elevated); }
.tp-soon .tps-ic svg { width: 16px; height: 16px; }
.tp-soon .tps-n { font-size: 13px; font-weight: 700; color: var(--ink-800); }
.tp-soon .tps-tag { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 8.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-500); background: var(--ink-100); padding: 3px 7px; border-radius: var(--r-pill); flex-shrink: 0; }
[data-theme="dark"] .tp-soon .tps-tag { background: var(--bg-elevated); }
.tp-soon .tps-tag svg { width: 9px; height: 9px; }
.tp-soon .tps-s { font-size: 11px; color: var(--ink-500); margin-top: 6px; line-height: 1.4; }
.tp-soon .tps-want { margin-top: 9px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: var(--r-pill); border: 1px dashed var(--green-300); background: var(--green-50); color: var(--green-700); cursor: pointer; font-size: 11px; font-weight: 700; transition: background var(--d-fast); }
[data-theme="dark"] .tp-soon .tps-want { background: rgba(34,197,94,0.1); color: var(--green-300); border-color: rgba(34,197,94,0.35); }
.tp-soon .tps-want:hover { background: var(--green-100); }
[data-theme="dark"] .tp-soon .tps-want:hover { background: rgba(34,197,94,0.18); }
.tp-soon .tps-want svg { width: 12px; height: 12px; }
.tp-soon .tps-want.on { border-style: solid; background: var(--green-500); color: var(--amp-hexcoded-color-white); }
.tp-soon .tps-req { margin-top: 9px; display: none; }
.tp-soon .tps-req.open { display: block; }

/* ════════════════════════════════════════════════════════════════
   ONE REUSABLE POPUP — fixed outer size; internal scroll; airy base
   ════════════════════════════════════════════════════════════════ */
.popup-scrim { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.45); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; padding: 28px; }
.popup-scrim.on { display: flex; }
.popup { width: 600px; max-width: 94vw; height: 600px; max-height: 90vh; background: var(--bg-surface); border: 1px solid var(--hairline); border-radius: var(--r-xl); box-shadow: var(--shadow-xl); display: flex; flex-direction: column; overflow: hidden; }
.popup.wide { width: 760px; }
.popup.narrow { width: 520px; }
.popup-head { flex-shrink: 0; padding: 24px 28px 18px; border-bottom: 1px solid var(--hairline); display: flex; align-items: flex-start; gap: 14px; }
.popup-head .ph-txt { flex: 1; min-width: 0; }
.popup-head .ph-eyebrow { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--green-600); }
.popup-head h3 { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; margin: 5px 0 0; }
.popup-head p { font-size: 12.5px; color: var(--ink-500); margin: 4px 0 0; line-height: 1.45; }
.popup-head .px { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--hairline); background: var(--bg-surface); cursor: pointer; color: var(--ink-600); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.popup-head .px:hover { background: var(--ink-100); }
.popup-head .px svg { width: 16px; height: 16px; }
.popup-body { flex: 1; overflow-y: auto; padding: 22px 28px; min-height: 0; }
.popup-foot { flex-shrink: 0; padding: 14px 28px; border-top: 1px solid var(--hairline); display: flex; align-items: center; gap: 10px; background: var(--glass-bg-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.popup-foot .spacer { flex: 1; }
.popup-foot .foot-note { font-size: 11.5px; color: var(--ink-500); display: inline-flex; align-items: center; gap: 6px; }
.popup-foot .foot-note svg { width: 13px; height: 13px; color: var(--ink-400); }
.popup-foot .foot-note.warn { color: var(--warn-ink); }

/* generic popup fragments */
.psub { font-size: 12.5px; color: var(--ink-500); margin: 0 0 16px; line-height: 1.5; }
.psub b { color: var(--ink-900); font-weight: 600; }
.flabel { font-size: 12px; font-weight: 700; letter-spacing: -0.005em; color: var(--ink-800); margin: 18px 0 9px; display: flex; align-items: center; gap: 7px; }
.flabel:first-child { margin-top: 0; }
.flabel .fopt { font-size: 9.5px; font-weight: 600; color: var(--ink-400); }
.flabel .clearbtn { margin-left: auto; font-size: 10.5px; font-weight: 600; color: var(--ink-500); background: none; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.flabel .clearbtn:hover { color: var(--danger); } .flabel .clearbtn svg { width: 12px; height: 12px; }
.chiprow { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: var(--r-pill); border: 1px solid var(--hairline-strong); background: var(--bg-surface); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-700); transition: all var(--d-fast); }
.chip:hover { border-color: var(--green-300); }
.chip.on { border-color: var(--sel-border); background: var(--sel-bg); color: var(--accent-ink); }
[data-theme="dark"] .chip.on { color: var(--green-300); }
.chip.dim { opacity: 0.42; cursor: not-allowed; }
.chip.dim:hover { border-color: var(--hairline-strong); }
.gated-note { font-size: 11.5px; color: var(--warn-ink); background: var(--warn-soft); border: 1px solid var(--warn-border); border-radius: var(--r-sm); padding: 9px 12px; line-height: 1.45; margin-top: 10px; }
.gated-note.info { color: var(--info-ink); background: var(--info-soft); border-color: var(--info-border); }
[data-theme="dark"] .gated-note { color: var(--warning); }
.input-line { display: flex; align-items: center; gap: 8px; padding: 0 6px 0 13px; height: 42px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); transition: border-color var(--d-fast), box-shadow var(--d-fast); }
.input-line:focus-within { border-color: var(--green-500); box-shadow: var(--focus-ring); }
.input-line input { flex: 1; border: none; background: transparent; outline: none; font-family: inherit; font-size: 13.5px; color: var(--ink-900); }
.input-line input::placeholder { color: var(--ink-400); }
.input-line .ic { color: var(--ink-400); } .input-line .ic svg { width: 16px; height: 16px; }
.input-line .go, .guide-box .gb-go { width: 30px; height: 30px; border-radius: var(--r-sm); border: none; background: var(--accent-soft); color: var(--accent-ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background var(--d-fast); }
.input-line .go:hover, .guide-box .gb-go:hover { background: var(--accent-soft-strong); } .input-line .go svg, .guide-box .gb-go svg { width: 15px; height: 15px; }
[data-theme="dark"] .input-line .go, [data-theme="dark"] .guide-box .gb-go { color: var(--green-300); }
.inote { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border-radius: var(--r-md); background: var(--ink-50); border: 1px solid var(--hairline); font-size: 12px; color: var(--ink-600); line-height: 1.45; }
[data-theme="dark"] .inote { background: var(--bg-elevated); }
.inote .ii { width: 17px; height: 17px; flex-shrink: 0; border-radius: 50%; border: 1.4px solid var(--ink-400); color: var(--ink-500); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); margin-top: 1px; }
.inote b { color: var(--ink-900); font-weight: 600; }
.sec-lab { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); margin: 0 0 10px; display: flex; align-items: center; gap: 9px; }
.sec-lab .gl { flex: 1; height: 1px; background: var(--hairline); }
.gate-note { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 600; color: var(--info-ink); background: var(--info-soft); padding: 4px 9px; border-radius: var(--r-pill); }
.gate-note svg { width: 11px; height: 11px; }

/* PILL stepper */
.stepper { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--hairline-strong); border-radius: var(--r-pill); padding: 4px; }
.stepper button { width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--ink-100); cursor: pointer; font-size: 17px; font-weight: 700; color: var(--ink-700); }
.stepper button:hover { background: var(--ink-200); }
.stepper .n { min-width: 36px; text-align: center; font-size: 18px; font-weight: 700; font-family: var(--font-display); }

/* SUBJECT (advertising) tiles */
.subj-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.subj-tile { padding: 18px 14px; border: 1.5px solid var(--hairline); border-radius: var(--r-lg); cursor: pointer; text-align: center; background: var(--bg-surface); transition: all var(--d-base); }
.subj-tile:hover { border-color: var(--green-400); box-shadow: var(--shadow-sm); }
.subj-tile.on { border-color: var(--sel-border); box-shadow: var(--sel-ring-2); background: var(--sel-bg); }
.subj-tile .si { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: var(--r-md); background: var(--ink-100); color: var(--ink-700); display: inline-flex; align-items: center; justify-content: center; }
.subj-tile.on .si { background: var(--accent-chip-bg); color: var(--accent-chip-ink); }
[data-theme="dark"] .subj-tile .si { background: var(--bg-elevated); }
.subj-tile .si svg { width: 22px; height: 22px; }
.subj-tile .t { font-size: 14px; font-weight: 700; color: var(--ink-1000); }
.subj-tile .d { font-size: 11px; color: var(--ink-500); margin-top: 3px; line-height: 1.4; }
.subj-detect { font-size: 11.5px; color: var(--accent-ink); background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: var(--r-sm); padding: 9px 12px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
[data-theme="dark"] .subj-detect { color: var(--green-300); }

/* product gallery / link */
.tabs { margin-bottom: 16px; }
.tabs button { padding: 7px 15px; font-size: 12.5px; }
.pg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pg-card { position: relative; border: 1.5px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; cursor: pointer; background: var(--bg-surface); transition: all var(--d-fast); }
.pg-card:hover { border-color: var(--green-300); }
.pg-card.on { border-color: var(--green-500); box-shadow: var(--sel-ring-2); }
.pg-card .check { position: absolute; right: 7px; top: 7px; width: 20px; height: 20px; border-radius: 50%; background: var(--green-600); color: #fff; font-size: 11px; display: none; align-items: center; justify-content: center; z-index: 2; }
.pg-card.on .check { display: inline-flex; }
.pg-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.pg-card .meta { padding: 8px 10px; } .pg-card .meta .nm { font-size: 12px; font-weight: 600; color: var(--ink-900); } .pg-card .meta .pr { font-size: 11px; color: var(--green-700); font-weight: 600; }
.pg-detected { display: flex; gap: 14px; margin-top: 16px; padding: 14px; border: 1px solid var(--accent-border); border-radius: var(--r-md); background: var(--accent-soft); }
.pg-detected img { width: 88px; height: 88px; border-radius: var(--r-sm); object-fit: cover; flex-shrink: 0; }
.pg-detected .dhead { font-size: 11px; font-weight: 700; color: var(--green-700); display: flex; align-items: center; gap: 6px; }
.pg-detected .dname { font-size: 15px; font-weight: 700; color: var(--ink-1000); margin: 4px 0 2px; }
.pg-detected .dprice { font-size: 12px; color: var(--ink-600); }
.pg-detected .dnotes { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.pg-detected .dnotes span { font-size: 10px; font-weight: 600; color: var(--ink-700); background: var(--bg-surface); border: 1px solid var(--hairline); border-radius: var(--r-pill); padding: 2px 8px; }

/* making pills */
.making-pills { display: flex; gap: 10px; margin-bottom: 18px; }
.making-pill { flex: 1; padding: 16px; border: 1.5px solid var(--hairline); border-radius: var(--r-lg); cursor: pointer; text-align: center; transition: all var(--d-base); background: var(--bg-surface); }
.making-pill:hover { border-color: var(--green-400); }
.making-pill.on { border-color: var(--sel-border); background: var(--sel-bg); }
.making-pill .mp-t { font-size: 14px; font-weight: 700; color: var(--ink-1000); }
.making-pill .mp-d { font-size: 11px; color: var(--ink-500); margin-top: 4px; line-height: 1.4; }
.count-row { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--ink-50); }
[data-theme="dark"] .count-row { background: var(--bg-elevated); }
.count-row .cr-tx { flex: 1; } .count-row .cr-t { font-size: 13px; font-weight: 700; color: var(--ink-900); } .count-row .cr-s { font-size: 11px; color: var(--ink-500); margin-top: 2px; }

/* FRAME steps + live preview + PRO reveal */
.frame-live { display: grid; grid-template-columns: 1fr 200px; gap: 22px; align-items: start; }
.frame-steps { display: flex; flex-direction: column; gap: 16px; }
.fstep .sl { font-size: 13px; font-weight: 700; color: var(--ink-1000); display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.fstep .sl .sval { font-size: 11px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft-strong); padding: 2px 8px; border-radius: var(--r-pill); }
[data-theme="dark"] .fstep .sl .sval { color: var(--green-300); }
.fstep .sh { font-size: 11.5px; color: var(--ink-500); margin-bottom: 8px; }
.frame-phone { position: relative; background: var(--media-well); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); margin: 0 auto; transition: aspect-ratio var(--d-base), max-width var(--d-base); }
.frame-phone video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame-phone .ftag { position: absolute; right: 8px; top: 8px; font-family: var(--font-mono); font-size: 9px; font-weight: 700; color: #fff; background: rgba(0,0,0,0.5); padding: 3px 7px; border-radius: var(--r-pill); }
.frame-phone .fcap { position: absolute; left: 10px; right: 10px; bottom: 16px; text-align: center; color: #fff; font-weight: 800; font-size: 14px; text-shadow: 0 2px 8px rgba(0,0,0,0.7); }
.frame-livenote { font-size: 11px; color: var(--ink-500); text-align: center; margin-top: 10px; }
.mode-banner { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: var(--r-md); margin-bottom: 16px; font-size: 12px; line-height: 1.45; }
.mode-banner.guided { background: var(--ink-50); border: 1px solid var(--hairline); color: var(--ink-600); }
[data-theme="dark"] .mode-banner.guided { background: var(--bg-elevated); }
.mode-banner.pro { background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--green-800); }
[data-theme="dark"] .mode-banner.pro { color: var(--green-300); }
.mode-banner svg { width: 16px; height: 16px; flex-shrink: 0; } .mode-banner b { font-weight: 700; }
.pro-reveal { margin-top: 18px; border: 1px solid var(--accent-border); border-radius: var(--r-md); background: var(--accent-soft); padding: 16px; }
.pro-reveal .prh { font-size: 11px; font-weight: 700; color: var(--green-700); display: flex; align-items: center; gap: 7px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--font-mono); }
.pro-reveal .prs { font-size: 11.5px; color: var(--ink-600); margin-bottom: 14px; line-height: 1.45; }

/* INSIGHT → IDEA left-rail (gallery Area 1, Variant 1) */
.i2-split { display: grid; grid-template-columns: 0.92fr 1.08fr; gap: 16px; align-items: start; }
.i2-split > * { min-width: 0; }
.i2-col-lab { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); margin: 0 0 9px; display: flex; align-items: center; gap: 8px; }
.i2-col-lab .gl { flex: 1; height: 1px; background: var(--hairline); }
.i2-rail { display: flex; flex-direction: column; gap: 8px; }
.insight-card { position: relative; text-align: left; cursor: pointer; width: 100%; border: 1px solid var(--accent-border); border-radius: var(--r-lg); padding: 13px 14px; background: linear-gradient(140deg, var(--accent-soft), var(--bg-surface)); transition: border-color var(--d-fast), box-shadow var(--d-fast); }
.insight-card:hover { border-color: var(--green-300); }
.insight-card.on { border-color: var(--sel-border); box-shadow: var(--sel-ring); }
.insight-card .in-kicker { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--green-700); }
[data-theme="dark"] .insight-card .in-kicker { color: var(--green-400); }
.insight-card .in-kicker svg { width: 11px; height: 11px; }
.insight-card .in-quote { font-family: var(--font-display); font-weight: 700; font-size: 14px; line-height: 1.32; letter-spacing: -0.01em; color: var(--ink-1000); margin: 8px 0 10px; }
.insight-card .in-quote .qm { color: var(--green-500); }
.insight-card .in-prov { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 600; color: var(--green-800); background: var(--bg-surface); border: 1px solid var(--green-200); border-radius: var(--r-pill); padding: 4px 9px; }
[data-theme="dark"] .insight-card .in-prov { color: var(--green-300); background: rgba(0,0,0,0.22); border-color: rgba(34,197,94,0.25); }
.insight-card .in-prov .pv-ic { font-size: 11px; line-height: 1; }
.insight-card .in-ideacount { position: absolute; top: 12px; right: 12px; font-size: 9.5px; font-weight: 700; font-family: var(--font-mono); color: var(--ink-400); }
.insight-card.on .in-ideacount { color: var(--green-600); }
.ideas-panel { display: none; }
.ideas-panel.on { display: block; }
.idea-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.idea-card { position: relative; text-align: left; padding: 11px 13px; border: 1.5px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); cursor: pointer; transition: border-color var(--d-fast), box-shadow var(--d-fast), background var(--d-fast); width: 100%; }
.idea-card:hover { border-color: var(--ink-300); box-shadow: var(--shadow-xs); }
.idea-card.on { border-color: var(--sel-border); background: var(--sel-bg); box-shadow: var(--sel-ring); }
.idea-card .ic-tag { display: inline-flex; align-items: center; font-size: 9px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 7px; border-radius: var(--r-pill); margin-bottom: 6px; }
.ic-tag.proof { background: var(--info-soft); color: var(--info-ink); }
.ic-tag.benefit { background: var(--accent-chip-bg); color: var(--accent-chip-ink); }
.ic-tag.myth { background: #fff4e0; color: var(--warn-ink); }
.ic-tag.asmr { background: #f0e6ff; color: #7c3aed; }
.ic-tag.gifting { background: #ffe6f0; color: #be185d; }
.ic-tag.occasion { background: #e0f2f1; color: #00695c; }
[data-theme="dark"] .ic-tag.myth { background: var(--warn-soft); color: var(--warning); }
[data-theme="dark"] .ic-tag.asmr { background: rgba(124,58,237,0.22); color: #c4a3ff; }
[data-theme="dark"] .ic-tag.gifting { background: rgba(190,24,93,0.24); color: #ff9ec4; }
[data-theme="dark"] .ic-tag.occasion { background: rgba(0,105,92,0.3); color: #80cbc4; }
.idea-card .ic-title { font-size: 13px; font-weight: 700; color: var(--ink-1000); letter-spacing: -0.01em; padding-right: 18px; }
.idea-card .ic-line { font-size: 11px; color: var(--ink-500); margin-top: 3px; line-height: 1.4; }
.idea-card .ic-check { position: absolute; top: 11px; right: 11px; width: 16px; height: 16px; border-radius: 50%; background: var(--green-500); color: #fff; display: none; align-items: center; justify-content: center; }
.idea-card.on .ic-check { display: inline-flex; }
.idea-card .ic-check svg { width: 10px; height: 10px; }
.gen-chip { display: inline-flex; align-items: center; gap: 7px; margin-top: 9px; padding: 7px 13px; border-radius: var(--r-pill); border: 1px dashed var(--green-300); background: var(--green-50); color: var(--green-700); cursor: pointer; font-size: 12px; font-weight: 600; transition: background var(--d-fast); }
[data-theme="dark"] .gen-chip { background: rgba(34,197,94,0.1); color: var(--green-300); border-color: rgba(34,197,94,0.35); }
.gen-chip:hover { background: var(--green-100); }
.gen-chip svg { width: 13px; height: 13px; }
.idea-write { position: relative; text-align: left; width: 100%; margin-top: 8px; padding: 11px 13px; border: 1.5px dashed var(--hairline-strong); border-radius: var(--r-md); background: transparent; cursor: pointer; transition: border-color var(--d-fast), background var(--d-fast); display: flex; align-items: center; gap: 9px; }
.idea-write:hover { border-color: var(--green-300); background: var(--accent-soft); }
.idea-write .iw-ic { width: 26px; height: 26px; border-radius: var(--r-sm); background: var(--ink-100); color: var(--ink-600); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-theme="dark"] .idea-write .iw-ic { background: var(--bg-elevated); }
.idea-write .iw-ic svg { width: 14px; height: 14px; }
.idea-write .iw-tx { font-size: 12.5px; font-weight: 600; color: var(--ink-800); }
.idea-write .iw-sub { font-size: 10.5px; color: var(--ink-500); margin-top: 1px; }
.guide-box { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 0 6px 0 13px; height: 42px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); transition: border-color var(--d-fast), box-shadow var(--d-fast); }
.guide-box:focus-within { border-color: var(--green-500); box-shadow: var(--focus-ring); }
.guide-box svg.lead { width: 15px; height: 15px; color: var(--green-600); flex-shrink: 0; }
.guide-box input { flex: 1; border: none; background: transparent; outline: none; font-family: inherit; font-size: 13px; color: var(--ink-900); }
.guide-box input::placeholder { color: var(--ink-400); }

/* FORMAT & STAGING — format-first auto-preset (gallery Area 2, Option C) */
.fmt-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.fmt-tile { position: relative; text-align: left; padding: 13px; border: 1.5px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); cursor: pointer; transition: all var(--d-fast); }
.fmt-tile:hover { border-color: var(--ink-300); }
.fmt-tile.on { border-color: var(--sel-border); background: var(--sel-bg); box-shadow: var(--sel-ring); }
.fmt-tile.dim { opacity: 0.42; cursor: not-allowed; }
.fmt-tile .ft-ic { width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--ink-100); color: var(--ink-700); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 9px; font-size: 16px; }
[data-theme="dark"] .fmt-tile .ft-ic { background: var(--bg-elevated); }
.fmt-tile.on .ft-ic { background: var(--accent-chip-bg); color: var(--accent-chip-ink); }
.fmt-tile .ft-name { font-size: 13px; font-weight: 700; color: var(--ink-1000); }
.fmt-tile .ft-sub { font-size: 11px; color: var(--ink-500); margin-top: 2px; line-height: 1.4; }
.autopreset { display: flex; align-items: center; gap: 11px; margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--accent-border); background: var(--accent-soft); }
.autopreset .ap-thumb { width: 52px; height: 33px; flex-shrink: 0; border-radius: var(--r-sm); overflow: hidden; background: var(--media-well); }
.autopreset .ap-thumb video { width: 100%; height: 100%; object-fit: cover; }
.autopreset .ap-tx { flex: 1; min-width: 0; }
.autopreset .ap-lab { font-size: 12.5px; font-weight: 700; color: var(--ink-1000); letter-spacing: -0.005em; }
.autopreset .ap-lab .ap-name { color: var(--green-800); }
[data-theme="dark"] .autopreset .ap-lab .ap-name { color: var(--green-300); }
.autopreset .ap-sub { font-size: 10.5px; color: var(--ink-500); margin-top: 2px; display: inline-flex; align-items: center; gap: 7px; }
.autopreset .ap-sub .ap-auto { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--green-700); }
[data-theme="dark"] .autopreset .ap-sub .ap-auto { color: var(--green-400); }
.autopreset .ap-sub .ap-auto svg { width: 11px; height: 11px; }
.ap-change { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; padding: 8px 13px; border-radius: var(--r-pill); border: 1px solid var(--hairline-strong); background: var(--bg-surface); color: var(--ink-800); cursor: pointer; font-size: 12px; font-weight: 600; white-space: nowrap; transition: all var(--d-fast); }
.ap-change:hover { border-color: var(--green-300); }
.ap-change svg { width: 13px; height: 13px; }
.preset-reveal { display: none; margin-top: 14px; }
.preset-reveal.open { display: block; }
.preset-reveal .pr-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.preset-reveal .pr-title { font-size: 12px; font-weight: 700; color: var(--ink-900); }
.preset-back { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: var(--r-pill); border: 1px solid var(--hairline); background: var(--bg-surface); color: var(--ink-600); cursor: pointer; font-size: 11px; font-weight: 600; transition: all var(--d-fast); }
.preset-back:hover { background: var(--hover-surface-2); }
.preset-back svg { width: 12px; height: 12px; }
.stage-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.stage-card { position: relative; text-align: left; border: 1.5px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; background: var(--bg-surface); cursor: pointer; transition: all var(--d-fast); padding: 0; }
.stage-card:hover { border-color: var(--ink-300); box-shadow: var(--shadow-xs); }
.stage-card.on { border-color: var(--green-500); box-shadow: var(--sel-ring); }
.stage-card .sc-vid { position: relative; aspect-ratio: 16/11; background: var(--media-well); overflow: hidden; }
.stage-card .sc-vid video { width: 100%; height: 100%; object-fit: cover; }
.stage-card .sc-grade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.45)); pointer-events: none; }
.stage-card .sc-play { position: absolute; right: 8px; bottom: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,0.92); color: var(--ink-1000); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.stage-card .sc-play svg { width: 12px; height: 12px; margin-left: 1px; }
.stage-card .sc-check { position: absolute; left: 8px; top: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--green-500); color: #fff; display: none; align-items: center; justify-content: center; }
.stage-card.on .sc-check { display: inline-flex; }
.stage-card .sc-check svg { width: 11px; height: 11px; }
.stage-card .sc-body { padding: 8px 10px 10px; }
.stage-card .sc-name { font-size: 12px; font-weight: 700; color: var(--ink-1000); }
.stage-card .sc-desc { font-size: 10px; color: var(--ink-500); margin-top: 1px; line-height: 1.3; }

/* SCRIPT — auto structure, fit meter, over-length block */
.script-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 11px 13px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--ink-50); margin-bottom: 14px; font-size: 12px; }
[data-theme="dark"] .script-bar { background: var(--bg-elevated); }
.script-bar .seg { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-600); }
.script-bar .seg b { color: var(--ink-900); }
.script-fit { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.script-fit .meter { width: 90px; height: 7px; border-radius: var(--r-pill); background: var(--ink-200); overflow: hidden; }
.script-fit .meter span { display: block; height: 100%; background: var(--green-500); transition: width var(--d-base); }
.script-fit.over .meter span { background: var(--danger); }
.script-fit .txt { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--ink-600); }
.script-fit.over .txt { color: var(--danger); }
.script-overbar { display: none; align-items: center; gap: 10px; padding: 10px 13px; border-radius: var(--r-md); background: var(--danger-soft); border: 1px solid var(--danger-border); margin-bottom: 14px; }
.script-overbar.on { display: flex; }
.script-overbar .so-msg { flex: 1; font-size: 12px; font-weight: 600; color: var(--danger); }
.script-tabs { margin-bottom: 14px; flex-wrap: wrap; }
.script-tabs button { padding: 6px 12px; font-size: 11.5px; }
.script-beats { display: flex; flex-direction: column; gap: 9px; }
.script-beat { border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 11px 13px; background: var(--bg-surface); }
.script-beat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.script-beat-name { font-size: 12px; font-weight: 700; color: var(--ink-900); }
.script-beat-tag { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 6px; border-radius: var(--r-xs); background: var(--accent-chip-bg); color: var(--accent-chip-ink); }
.script-beat-head .secs { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--green-600); font-weight: 700; }
.script-line { font-size: 13px; line-height: 1.5; color: var(--ink-800); outline: none; border-radius: var(--r-sm); padding: 4px 6px; margin: 0 -6px; }
.script-line[contenteditable]:focus { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--green-300); }

/* B-ROLL */
.broll-banner { font-size: 11.5px; color: var(--ink-600); line-height: 1.5; padding: 11px 13px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--ink-50); margin-bottom: 14px; }
[data-theme="dark"] .broll-banner { background: var(--bg-elevated); }
.broll-banner b { color: var(--ink-900); }
.broll-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.broll-tile { position: relative; border: 1.5px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; cursor: pointer; background: var(--media-well); transition: all var(--d-fast); }
.broll-tile:hover { border-color: var(--green-300); }
.broll-tile.on { border-color: var(--green-500); box-shadow: var(--sel-ring-2); }
.broll-tile video { width: 100%; aspect-ratio: 9/16; object-fit: cover; display: block; }
.broll-tile .bt-check { position: absolute; right: 6px; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--green-600); color: #fff; font-size: 11px; display: none; align-items: center; justify-content: center; z-index: 2; }
.broll-tile.on .bt-check { display: inline-flex; }
.broll-tile .bt-play { position: absolute; left: 6px; bottom: 28px; width: 24px; height: 24px; border-radius: 50%; border: none; background: rgba(255,255,255,0.9); color: var(--ink-1000); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.broll-tile .bt-play svg { width: 11px; height: 11px; margin-left: 1px; }
.broll-tile .bt-n { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 7px 6px; background: linear-gradient(180deg, transparent, rgba(0,0,0,0.82)); color: #fff; font-size: 10px; font-weight: 600; }
.broll-tile .bt-cost { position: absolute; left: 6px; top: 6px; font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; color: #fff; background: rgba(34,197,94,0.85); padding: 2px 6px; border-radius: var(--r-pill); }
.broll-upload { border: 1.5px dashed var(--hairline-strong); border-radius: var(--r-md); padding: 20px; text-align: center; cursor: pointer; }
.broll-upload:hover { border-color: var(--green-400); }
.broll-upload .bu-t { font-size: 13px; font-weight: 600; color: var(--ink-800); }
.broll-upload .bu-s { font-size: 11px; color: var(--ink-500); margin-top: 5px; line-height: 1.5; }
.broll-cap { font-size: 11px; color: var(--ink-500); margin-top: 12px; display: flex; align-items: center; gap: 7px; }
.broll-cap.full { color: var(--warn-ink); }

/* CAST (gallery Area 3 cleaner) */
.cast2-note { display: flex; gap: 11px; padding: 12px 14px; border: 1px solid var(--accent-border); border-radius: var(--r-md); background: var(--accent-soft); margin-bottom: 16px; }
.cast2-note .cn-ic { color: var(--green-600); flex-shrink: 0; margin-top: 1px; } .cast2-note .cn-ic svg { width: 17px; height: 17px; }
.cast2-note .cn-t { font-size: 12.5px; font-weight: 700; color: var(--ink-1000); }
.cast2-note .cn-m { font-size: 11.5px; color: var(--ink-600); margin-top: 2px; line-height: 1.45; }
.cast2-note .cn-m b { color: var(--green-700); font-weight: 700; } [data-theme="dark"] .cast2-note .cn-m b { color: var(--green-400); }
.cast2-shell { display: grid; grid-template-columns: 168px 1fr; gap: 18px; height: 312px; }
.cast2-shell > * { min-width: 0; }
.cast2-rail { border-right: 1px solid var(--hairline); padding-right: 16px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.cast2-rail .c2-rh { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); padding: 2px 10px 8px; }
.cast2-railitem { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 11px; border-radius: var(--r-md); border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-700); font-size: 12.5px; font-weight: 600; transition: background var(--d-fast), color var(--d-fast); }
.cast2-railitem:hover { background: var(--hover-surface-2); }
.cast2-railitem.on { background: var(--accent-soft-strong); color: var(--accent-ink); } [data-theme="dark"] .cast2-railitem.on { color: var(--green-300); }
.cast2-railitem svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--ink-500); }
.cast2-railitem.on svg { color: var(--green-600); } [data-theme="dark"] .cast2-railitem.on svg { color: var(--green-400); }
.cast2-railitem .c2-ct { margin-left: auto; font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: var(--ink-400); }
.cast2-railitem.on .c2-ct { color: var(--green-600); }
.cast2-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding-right: 4px; }
.cast2-row { display: grid; grid-template-columns: 42px minmax(0,1fr) auto 32px 82px; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--bg-surface); cursor: pointer; width: 100%; text-align: left; transition: border-color var(--d-fast), box-shadow var(--d-fast), background var(--d-fast); }
.cast2-row:hover { border-color: var(--green-300); }
.cast2-row.on { border-color: var(--sel-border); box-shadow: var(--sel-ring); background: var(--sel-bg); }
.cast2-row.gated { opacity: 0.55; cursor: not-allowed; }
.cast2-row.gated:hover { border-color: var(--hairline); }
.c2-av { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--ink-100); box-shadow: 0 0 0 1px var(--hairline) inset; }
[data-theme="dark"] .c2-av { background: var(--bg-elevated); }
.c2-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c2-av.nobody { display: inline-flex; align-items: center; justify-content: center; color: var(--ink-500); }
.c2-av.nobody svg { width: 19px; height: 19px; }
.c2-who { min-width: 0; }
.c2-who .c2-nm { font-size: 13px; font-weight: 700; color: var(--ink-1000); letter-spacing: -0.01em; display: flex; align-items: center; gap: 7px; }
.c2-who .c2-vibe { font-size: 11px; color: var(--ink-500); margin-top: 2px; line-height: 1.35; }
.c2-badge { font-size: 8px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 6px; border-radius: var(--r-xs); white-space: nowrap; }
.c2-badge.default { color: var(--accent-chip-ink); background: var(--accent-chip-bg); }
.c2-badge.real { color: #fff; background: var(--green-600); }
.c2-badge.blocked { color: var(--ink-600); background: var(--ink-100); }
[data-theme="dark"] .c2-badge.blocked { color: var(--ink-400); background: var(--bg-elevated); }
.c2-lang { font-size: 10px; font-weight: 600; color: var(--ink-600); background: var(--ink-100); padding: 4px 9px; border-radius: var(--r-pill); white-space: nowrap; }
[data-theme="dark"] .c2-lang { background: var(--bg-elevated); }
.c2-voice { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--hairline-strong); background: var(--bg-surface); cursor: pointer; color: var(--green-700); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all var(--d-fast); }
.c2-voice:hover { background: var(--green-50); border-color: var(--green-300); }
[data-theme="dark"] .c2-voice { color: var(--green-400); }
.c2-voice svg { width: 15px; height: 15px; }
.c2-voice.playing { background: var(--green-500); color: #fff; border-color: var(--green-500); }
.c2-voice-ph { width: 32px; height: 32px; flex-shrink: 0; }
.c2-cost { text-align: right; }
.c2-cost .c2-amt { font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.c2-cost.free .c2-amt { color: var(--green-700); } [data-theme="dark"] .c2-cost.free .c2-amt { color: var(--green-400); }
.c2-cost.paid .c2-amt { color: var(--ink-900); }
.c2-cost.gated .c2-amt { color: var(--ink-400); }
.c2-cost .c2-unit { display: block; font-size: 9px; font-weight: 500; color: var(--ink-500); margin-top: 1px; }

/* on-screen text preview */
.ontext-grid { display: grid; grid-template-columns: 210px 1fr; gap: 20px; }
.ontext-preview { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.ontext-frame { position: relative; width: 188px; aspect-ratio: 9/16; background: var(--media-well); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.ontext-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ontext-frame .otc { position: absolute; left: 10px; right: 10px; text-align: center; color: #fff; font-weight: 800; font-size: 13px; text-shadow: 0 2px 8px rgba(0,0,0,0.7); }
.ontext-frame .otc.pos-top { top: 18px; } .ontext-frame .otc.pos-mid { top: 46%; } .ontext-frame .otc.pos-bot { bottom: 50px; }
.ontext-frame .otc.clean { background: rgba(0,0,0,0.5); border-radius: 6px; padding: 3px; } .ontext-frame .otc.minimal { font-weight: 600; font-size: 12px; }
.ontext-frame .ots { position: absolute; left: 10px; bottom: 14px; background: rgba(255,255,255,0.94); color: var(--ink-1000); font-size: 10px; font-weight: 700; padding: 5px 9px; border-radius: var(--r-sm); }
.ontext-pnote { font-size: 10.5px; color: var(--ink-500); }
.ontext-controls { min-width: 0; }

/* audience / music tiles */
.tilegrid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.tile { padding: 13px; border: 1px solid var(--hairline); border-radius: var(--r-md); cursor: pointer; transition: all var(--d-fast); background: var(--bg-surface); display: flex; gap: 11px; align-items: flex-start; }
.tile:hover { border-color: var(--green-300); } .tile.on { border-color: var(--sel-border); background: var(--sel-bg); }
.tile .te { font-size: 21px; flex-shrink: 0; }
.tile .tt { font-size: 13px; font-weight: 700; color: var(--ink-1000); }
.tile .td { font-size: 11px; color: var(--ink-500); margin-top: 2px; line-height: 1.4; }
.tile .tplay { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--hairline); background: var(--bg-surface); cursor: pointer; color: var(--green-700); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; margin-left: auto; }
.tile .tplay svg { width: 12px; height: 12px; }
.music-rec { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--accent-border); border-radius: var(--r-md); background: var(--accent-soft); margin-bottom: 14px; }
.music-rec .mr-play { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--green-600); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.music-rec .mr-play svg { width: 15px; height: 15px; }
.music-rec .mr-t { font-size: 12.5px; font-weight: 700; color: var(--ink-1000); }
.music-rec .mr-s { font-size: 11px; color: var(--ink-600); }
.music-rec .mr-tag { margin-left: auto; font-size: 9px; font-weight: 700; color: var(--green-700); background: var(--bg-surface); padding: 3px 7px; border-radius: var(--r-pill); border: 1px solid var(--green-200); }

/* reference / space */
.ref-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.ref-tile { position: relative; border: 1.5px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; cursor: pointer; background: var(--media-well); }
.ref-tile:hover { border-color: var(--green-300); }
.ref-tile.on { border-color: var(--green-500); box-shadow: var(--sel-ring-2); }
.ref-tile video { width: 100%; aspect-ratio: 9/16; object-fit: cover; display: block; }
.ref-tile .rt-n { position: absolute; left: 0; right: 0; bottom: 0; padding: 11px 7px 6px; background: linear-gradient(180deg, transparent, rgba(0,0,0,0.82)); color: #fff; font-size: 10px; font-weight: 600; }
.ref-tile .rt-check { position: absolute; right: 6px; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--green-600); color: #fff; font-size: 11px; display: none; align-items: center; justify-content: center; z-index: 2; }
.ref-tile.on .rt-check { display: inline-flex; }
.space-upload { border: 1.5px dashed var(--hairline-strong); border-radius: var(--r-md); padding: 22px; text-align: center; cursor: pointer; margin-bottom: 14px; }
.space-upload:hover { border-color: var(--green-400); }
.space-upload .su-ic { color: var(--green-600); } .space-upload .su-ic svg { width: 26px; height: 26px; }
.space-upload .su-t { font-size: 13px; font-weight: 700; color: var(--ink-900); margin-top: 8px; }
.space-upload .su-s { font-size: 11px; color: var(--ink-500); margin-top: 4px; line-height: 1.5; }

/* breakdown / topup / cost-confirm */
.kv-list { display: flex; flex-direction: column; gap: 2px; }
.kv-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--hairline); }
.kv-row:last-child { border-bottom: none; }
.kv-row .kv-k { font-size: 13px; color: var(--ink-700); } .kv-row .kv-k .kv-s { display: block; font-size: 11px; color: var(--ink-500); }
.kv-row .kv-v { margin-left: auto; font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--ink-1000); }
.kv-total { display: flex; align-items: center; margin-top: 8px; padding-top: 12px; border-top: 2px solid var(--hairline-strong); }
.kv-total .kt-k { font-size: 14px; font-weight: 700; } .kv-total .kt-v { margin-left: auto; font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--green-700); }
.pack-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.pack { position: relative; padding: 16px; border: 1.5px solid var(--hairline); border-radius: var(--r-md); cursor: pointer; text-align: center; transition: all var(--d-fast); }
.pack:hover { border-color: var(--green-400); } .pack.best { border-color: var(--green-500); }
.pack .best-tag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font-size: 9px; font-weight: 700; color: #fff; background: var(--green-600); padding: 2px 9px; border-radius: var(--r-pill); }
.pack .pk-cr { font-size: 20px; font-weight: 800; font-family: var(--font-display); color: var(--ink-1000); } .pack .pk-pr { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.confirm-cost { text-align: center; padding: 12px 0 4px; }
.confirm-cost .cc-big { font-family: var(--font-display); font-size: 44px; font-weight: 800; color: var(--green-700); letter-spacing: -0.03em; }
.confirm-cost .cc-u { font-size: 13px; color: var(--ink-500); margin-top: 2px; }
.confirm-cost .cc-bal { font-size: 12px; color: var(--ink-600); margin-top: 14px; }
.confirm-cost .cc-bal b { color: var(--ink-900); }
.confirm-line { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--ink-50); border: 1px solid var(--hairline); margin-bottom: 14px; font-size: 12.5px; color: var(--ink-700); line-height: 1.5; }
[data-theme="dark"] .confirm-line { background: var(--bg-elevated); }
.confirm-line svg { width: 18px; height: 18px; color: var(--green-600); flex-shrink: 0; }
.confirm-line b { color: var(--ink-900); }

/* cascade confirm */
.cascade-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.cascade-row { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); }
.cascade-row .cr-ic { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cascade-row .cr-ic svg { width: 14px; height: 14px; }
.cascade-row.will .cr-ic { background: var(--warn-soft); color: var(--warn-ink); }
.cascade-row.may .cr-ic { background: var(--ink-100); color: var(--ink-600); } [data-theme="dark"] .cascade-row.may .cr-ic { background: var(--bg-elevated); }
.cascade-row.keep .cr-ic { background: var(--accent-chip-bg); color: var(--accent-chip-ink); }
.cascade-row .cr-tx { flex: 1; min-width: 0; }
.cascade-row .cr-n { font-size: 13px; font-weight: 700; color: var(--ink-900); }
.cascade-row .cr-d { font-size: 11px; color: var(--ink-500); margin-top: 1px; }
.cascade-row .cr-tag { font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 8px; border-radius: var(--r-pill); white-space: nowrap; }
.cascade-row.will .cr-tag { background: var(--warn-soft); color: var(--warn-ink); }
.cascade-row.may .cr-tag { background: var(--ink-100); color: var(--ink-600); } [data-theme="dark"] .cascade-row.may .cr-tag { background: var(--bg-elevated); }
.cascade-row.keep .cr-tag { background: var(--accent-chip-bg); color: var(--accent-chip-ink); }

/* clone capture flow */
.clone-steps { display: flex; flex-direction: column; gap: 12px; }
.clone-step { display: flex; gap: 13px; align-items: flex-start; padding: 14px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); }
.clone-step .cs-n { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-chip-bg); color: var(--accent-chip-ink); font-family: var(--font-mono); font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.clone-step .cs-t { font-size: 13px; font-weight: 700; color: var(--ink-900); }
.clone-step .cs-d { font-size: 11.5px; color: var(--ink-500); margin-top: 2px; line-height: 1.45; }
.consent-box { display: flex; gap: 10px; align-items: flex-start; padding: 13px; border: 1px solid var(--accent-border); border-radius: var(--r-md); background: var(--accent-soft); margin-top: 14px; }
.consent-box .cb-check { width: 20px; height: 20px; border-radius: var(--r-xs); border: 1.5px solid var(--green-500); flex-shrink: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--bg-surface); }
.consent-box .cb-check.on { background: var(--green-500); }
.consent-box .cb-check svg { width: 13px; height: 13px; opacity: 0; } .consent-box .cb-check.on svg { opacity: 1; }
.consent-box .cb-tx { font-size: 11.5px; color: var(--ink-700); line-height: 1.5; }

/* compare-looks explainer */
.compare-note { display: flex; gap: 11px; padding: 13px 14px; border: 1px solid var(--accent-border); border-radius: var(--r-md); background: var(--accent-soft); margin-bottom: 14px; }
.compare-note svg { width: 18px; height: 18px; color: var(--green-600); flex-shrink: 0; margin-top: 1px; }
.compare-note .cmn-t { font-size: 12.5px; font-weight: 700; color: var(--ink-1000); }
.compare-note .cmn-m { font-size: 11.5px; color: var(--ink-600); margin-top: 2px; line-height: 1.45; }
.eng-list { display: flex; flex-direction: column; gap: 7px; }
.eng-row { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); }
.eng-row .er-d { width: 22px; height: 22px; border-radius: 50%; background: var(--accent-chip-bg); color: var(--accent-chip-ink); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; } .eng-row .er-d svg { width: 13px; height: 13px; }
.eng-row .er-n { font-size: 13px; font-weight: 600; color: var(--ink-900); } .eng-row .er-note { font-size: 11px; color: var(--ink-500); margin-left: auto; }

/* brand dropdown */
.dd { position: fixed; z-index: 1100; min-width: 252px; background: var(--bg-elevated); border: 1px solid var(--hairline); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 6px; display: none; }
.dd.on { display: block; }
.dd .dd-h { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); padding: 7px 10px 4px; }
.dd-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); cursor: pointer; }
.dd-item:hover { background: var(--hover-surface); }
.dd-item .ddot { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, var(--green-400), var(--green-700)); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.dd-item .ddn { font-size: 13px; font-weight: 600; color: var(--ink-900); } .dd-item .dds { font-size: 11px; color: var(--ink-500); }
.dd-item.on { background: var(--accent-soft-strong); }
.dd-add { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: var(--r-sm); cursor: pointer; color: var(--green-700); font-size: 12.5px; font-weight: 600; border-top: 1px solid var(--hairline); margin-top: 4px; }
.dd-add:hover { background: var(--green-50); } .dd-add svg { width: 14px; height: 14px; }

/* toast / coach */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); z-index: 1500; opacity: 0; pointer-events: none; transition: all var(--d-base) var(--ease-out); }
.toast-wrap.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast { display: inline-flex; align-items: center; gap: 9px; background: var(--ink-1000); color: var(--ink-0); padding: 11px 18px; border-radius: var(--r-pill); box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 600; }
[data-theme="dark"] .toast { background: var(--bg-elevated); color: var(--ink-900); border: 1px solid var(--hairline); }
.toast .ind { width: 8px; height: 8px; border-radius: 50%; background: var(--green-500); }
.coach { position: fixed; top: 70px; left: 50%; transform: translateX(-50%) translateY(-12px); z-index: 1400; background: var(--bg-surface); border: 1px solid var(--green-200); border-radius: var(--r-pill); box-shadow: var(--shadow-lg); padding: 10px 16px; font-size: 12.5px; color: var(--ink-800); display: none; align-items: center; gap: 9px; }
.coach.on { display: inline-flex; }
.coach .c-ic { color: var(--green-600); } .coach .c-ic svg { width: 15px; height: 15px; }

@media (max-width: 1180px) { .frame-live { grid-template-columns: 1fr; } }

/* ════════════════════════════════════════════════════════════════
   ░ ONBOARDING + BRAND KIT ░ — ADDITIVE. Built strictly on the shared
   tokens/primitives above (--sel-*, --accent-*, .btn, .chip, .field,
   .subj-tile/.input-line, .seg-track). No new colour values; all flips
   with the theme via the existing tokens.
   ════════════════════════════════════════════════════════════════ */

/* — Full-screen onboarding shell — */
.ob-wrap { max-width: 760px; margin: 0 auto; padding: 30px 32px 64px; }
.ob-steps { display: flex; align-items: center; gap: 0; margin: 4px 0 30px; }
.ob-steps .ob-step { display: flex; align-items: center; gap: 9px; }
.ob-steps .ob-num { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; font-family: var(--font-mono);
  border: 1.5px solid var(--hairline-strong); background: var(--bg-surface); color: var(--ink-500);
  transition: all var(--d-fast); }
.ob-steps .ob-num svg { width: 14px; height: 14px; }
.ob-steps .ob-lbl { font-size: 12px; font-weight: 600; color: var(--ink-500); white-space: nowrap; }
.ob-steps .ob-line { flex: 1; height: 1.5px; background: var(--hairline); margin: 0 12px; min-width: 18px; }
.ob-step.done .ob-num { background: var(--green-500); border-color: var(--green-500); color: var(--amp-hexcoded-color-white); }
.ob-step.done .ob-lbl { color: var(--ink-700); }
.ob-step.cur .ob-num { border-color: var(--sel-border); background: var(--sel-bg); color: var(--accent-ink); box-shadow: var(--sel-ring-2); }
.ob-step.cur .ob-lbl { color: var(--ink-1000); }
.ob-step.done + .ob-line { background: var(--green-400); }

.ob-pane { display: none; }
.ob-pane.on { display: block; animation: obIn var(--d-base) var(--ease-out); }
@keyframes obIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.ob-eyebrow { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--green-700); }
.ob-h { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; margin: 8px 0 0; color: var(--ink-1000); }
.ob-h em { font-style: normal; color: var(--green-600); }
.ob-sub { font-size: 14px; color: var(--ink-600); margin-top: 9px; line-height: 1.55; max-width: 560px; }
.ob-foot { display: flex; align-items: center; gap: 10px; margin-top: 30px; }
.ob-foot .spacer { flex: 1; }

/* welcome hero badge */
.ob-welcome-badge { width: 64px; height: 64px; border-radius: var(--r-lg); margin-bottom: 18px;
  background: linear-gradient(135deg, var(--green-500), var(--green-700)); color: var(--amp-hexcoded-color-white);
  display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-green-soft); }
.ob-welcome-badge svg { width: 30px; height: 30px; }
.ob-bullets { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 12px; }
.ob-bullets li { display: flex; align-items: flex-start; gap: 11px; font-size: 13.5px; color: var(--ink-700); }
.ob-bullets li .bi { width: 26px; height: 26px; border-radius: var(--r-sm); flex-shrink: 0;
  background: var(--accent-chip-bg); color: var(--accent-chip-ink); display: inline-flex; align-items: center; justify-content: center; }
.ob-bullets li .bi svg { width: 15px; height: 15px; }
.ob-bullets li b { color: var(--ink-1000); font-weight: 600; }

/* connect options (step 2) — reuse subj-tile look, full-width rows */
.ob-connect { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.ob-conn-tile { display: flex; align-items: center; gap: 15px; padding: 16px 18px;
  border: 1.5px solid var(--hairline); border-radius: var(--r-lg); background: var(--bg-surface);
  cursor: pointer; text-align: left; width: 100%; transition: all var(--d-base); }
.ob-conn-tile:hover { border-color: var(--green-400); box-shadow: var(--shadow-sm); }
.ob-conn-tile.on { border-color: var(--sel-border); box-shadow: var(--sel-ring-2); background: var(--sel-bg); }
.ob-conn-tile .ci { width: 44px; height: 44px; border-radius: var(--r-md); flex-shrink: 0;
  background: var(--ink-100); color: var(--ink-700); display: inline-flex; align-items: center; justify-content: center; }
.ob-conn-tile.on .ci { background: var(--accent-chip-bg); color: var(--accent-chip-ink); }
.ob-conn-tile .ci svg { width: 22px; height: 22px; }
.ob-conn-tile .ct-t { font-size: 14.5px; font-weight: 700; color: var(--ink-1000); }
.ob-conn-tile .ct-s { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.ob-conn-tile .ct-go { margin-left: auto; flex-shrink: 0; color: var(--ink-400); }
.ob-conn-tile.on .ct-go { color: var(--green-600); }
.ob-conn-tile .ct-go svg { width: 18px; height: 18px; }
.ob-conn-url { margin-top: 12px; display: none; }
.ob-conn-url.on { display: block; }

/* scanning → confirmation */
.ob-scan { margin-top: 22px; padding: 22px; border: 1px solid var(--accent-border); border-radius: var(--r-lg);
  background: var(--accent-soft); display: none; align-items: center; gap: 15px; }
.ob-scan.on { display: flex; }
.ob-scan .scan-sp { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%;
  border: 3px solid var(--accent-border); border-top-color: var(--green-500); animation: spin 0.8s linear infinite; }
.ob-scan.done .scan-sp { border: none; background: var(--green-500); color: var(--amp-hexcoded-color-white); display: inline-flex; align-items: center; justify-content: center; animation: none; }
.ob-scan.done .scan-sp svg { width: 19px; height: 19px; }
.ob-scan .scan-t { font-size: 13.5px; font-weight: 700; color: var(--ink-1000); }
.ob-scan .scan-s { font-size: 12px; color: var(--ink-600); margin-top: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* — BRAND KIT (shared by onboarding step 3 + Settings → Brand Kit) — */
.bk { display: flex; flex-direction: column; gap: 22px; }
.bk-block { border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--bg-surface); padding: 18px 20px; }
.bk-block .bk-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.bk-block .bk-title { font-size: 13.5px; font-weight: 700; color: var(--ink-1000); }
.bk-block .bk-hint { font-size: 11.5px; color: var(--ink-500); margin-left: auto; text-align: right; }
.bk-block .bk-spacer { flex: 1; }

/* logo */
.bk-logo-row { display: flex; align-items: center; gap: 16px; }
.bk-logo-prev { width: 76px; height: 76px; border-radius: var(--r-md); flex-shrink: 0;
  border: 1px solid var(--hairline); background: var(--ink-50); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.bk-logo-prev img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.bk-logo-prev .lw { font-family: var(--font-display); font-weight: 900; font-size: 22px; letter-spacing: -0.02em; color: var(--ink-1000); }
.bk-logo-meta .lm-d { font-size: 12px; color: var(--ink-500); margin-top: 2px; }

/* color swatches */
.bk-swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.bk-swatch { display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer; border: none; background: transparent; padding: 0; }
.bk-swatch .sw-chip { width: 52px; height: 52px; border-radius: var(--r-md); border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-xs); position: relative; transition: transform var(--d-fast), box-shadow var(--d-fast); }
.bk-swatch:hover .sw-chip { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.bk-swatch.on .sw-chip { box-shadow: var(--sel-ring), var(--shadow-sm); }
.bk-swatch .sw-edit { position: absolute; right: 3px; bottom: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(255,255,255,0.92); color: #111; display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--d-fast); }
.bk-swatch:hover .sw-edit { opacity: 1; }
.bk-swatch .sw-edit svg { width: 10px; height: 10px; }
.bk-swatch .sw-hex { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; color: var(--ink-600); }
.bk-swatch .sw-role { font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-500); }

/* fonts */
.bk-fonts { display: flex; flex-wrap: wrap; gap: 10px; }
.bk-font { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md); background: var(--bg-surface); }
.bk-font .bf-spec { font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-500); }
.bk-font .bf-name { font-size: 15px; font-weight: 700; color: var(--ink-1000); }
.bk-font .bf-name.serif { font-family: var(--font-display); }
.bk-font .bf-change { font-size: 11.5px; font-weight: 600; color: var(--green-700); border: none; background: transparent; cursor: pointer; padding: 4px 6px; border-radius: var(--r-sm); }
.bk-font .bf-change:hover { background: var(--green-50); }

/* tone of voice — segmented cards */
.bk-tones { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.bk-tone { text-align: left; padding: 13px 15px; border: 1.5px solid var(--hairline); border-radius: var(--r-md);
  background: var(--bg-surface); cursor: pointer; transition: all var(--d-fast); }
.bk-tone:hover { border-color: var(--green-400); }
.bk-tone.on { border-color: var(--sel-border); box-shadow: var(--sel-ring-2); background: var(--sel-bg); }
.bk-tone .bt-t { font-size: 13.5px; font-weight: 700; color: var(--ink-1000); display: flex; align-items: center; gap: 7px; }
.bk-tone.on .bt-t .bt-ck { color: var(--green-600); }
.bk-tone .bt-ck { color: transparent; } .bk-tone .bt-ck svg { width: 14px; height: 14px; }
.bk-tone .bt-s { font-size: 11.5px; color: var(--ink-500); margin-top: 3px; line-height: 1.4; }

/* do-not-say chips */
.bk-dns { display: flex; flex-direction: column; gap: 14px; }
.bk-dns-group .dns-lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-500); margin-bottom: 8px; }
.bk-dns-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dns-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 8px 6px 12px; border-radius: var(--r-pill);
  border: 1px solid var(--danger-border); background: var(--danger-soft); color: var(--warn-ink); font-size: 12.5px; font-weight: 600; }
.dns-chip .x { width: 18px; height: 18px; border-radius: 50%; border: none; background: transparent; color: inherit; opacity: 0.6;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dns-chip .x:hover { opacity: 1; background: var(--hover-surface); }
.dns-chip .x svg { width: 12px; height: 12px; }
.dns-add { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 12px; border-radius: var(--r-pill);
  border: 1px dashed var(--hairline-strong); background: transparent; }
.dns-add input { border: none; background: transparent; outline: none; font-family: inherit; font-size: 12.5px; color: var(--ink-900); width: 120px; }
.dns-add input::placeholder { color: var(--ink-400); }
.dns-add .add-go { width: 22px; height: 22px; border-radius: 50%; border: none; background: var(--accent-soft); color: var(--accent-ink);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dns-add .add-go svg { width: 13px; height: 13px; }

/* connected channels (brand-kit view) */
.bk-channels { display: flex; flex-direction: column; gap: 10px; }
.bk-chan { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-surface); }
.bk-chan .chn-ic { width: 34px; height: 34px; border-radius: var(--r-sm); flex-shrink: 0; background: var(--ink-100); color: var(--ink-700); display: inline-flex; align-items: center; justify-content: center; }
.bk-chan .chn-ic svg { width: 17px; height: 17px; }
.bk-chan .chn-n { font-size: 13px; font-weight: 700; color: var(--ink-1000); }
.bk-chan .chn-s { font-size: 11.5px; color: var(--ink-500); margin-top: 1px; }
.bk-chan .chn-state { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; }
.bk-chan .chn-state.connected { color: var(--green-700); }
.bk-chan .chn-state.connected svg { width: 14px; height: 14px; }
.bk-chan .chn-state.off { color: var(--ink-500); }

/* settings nav links (reuse for Brand Kit entry) */
.set-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; max-width: 560px; }
.set-link { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--hairline);
  border-radius: var(--r-lg); background: var(--bg-surface); cursor: pointer; text-align: left; width: 100%; transition: all var(--d-base); }
.set-link:hover { border-color: var(--green-400); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.set-link.disabled { cursor: default; opacity: 0.62; } .set-link.disabled:hover { transform: none; box-shadow: none; border-color: var(--hairline); }
.set-link .sl-ic { width: 42px; height: 42px; border-radius: var(--r-md); flex-shrink: 0; background: var(--accent-chip-bg); color: var(--accent-chip-ink); display: inline-flex; align-items: center; justify-content: center; }
.set-link.disabled .sl-ic { background: var(--ink-100); color: var(--ink-500); }
.set-link .sl-ic svg { width: 21px; height: 21px; }
/* the text column: title + subtitle must STACK (they were inline → ran together) */
.set-link > span:nth-of-type(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.set-link .sl-t { font-size: 14.5px; font-weight: 700; color: var(--ink-1000); display: block; }
.set-link .sl-s { font-size: 12px; line-height: 1.45; color: var(--ink-500); display: block; }
.set-link .sl-go { margin-left: auto; color: var(--ink-400); flex-shrink: 0; } .set-link .sl-go svg { width: 18px; height: 18px; }
.set-link .sl-tag { display: inline-block; margin-left: 8px; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-500); background: var(--ink-100); border-radius: var(--r-pill); padding: 2px 7px; vertical-align: middle; }
[data-theme="dark"] .set-link .sl-tag { background: var(--bg-elevated); }

/* ════ SETTINGS · two-pane (full single-brand + AGENCY coverage) ════ */
.set2 { display: grid; grid-template-columns: 234px 1fr; gap: 0; border: 1px solid var(--hairline); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-surface); box-shadow: var(--shadow-xs); min-height: 560px; }
.set2-nav { border-right: 1px solid var(--hairline); padding: 14px; background: var(--bg-soft); }
.set2-nav .nl { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-400); padding: 6px 11px 8px; }
.set2-item { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: var(--r-md); border: none; background: transparent; cursor: pointer; color: var(--ink-700); width: 100%; text-align: left; font-size: 13.5px; font-weight: 600; transition: background var(--d-fast), color var(--d-fast); }
.set2-item svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--ink-500); transition: color var(--d-fast); }
.set2-item:hover { background: var(--hover-surface); color: var(--ink-1000); }
.set2-item.on { background: var(--accent-soft-strong); color: var(--accent-ink); }
.set2-item.on svg { color: var(--green-600); }
[data-theme="dark"] .set2-item.on, [data-theme="dark"] .set2-item.on svg { color: var(--green-300); }
.set2-item .badge2 { margin-left: auto; font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--green-700); padding: 2px 7px; border-radius: var(--r-pill); border: 1px solid var(--green-200); background: var(--green-50); }
[data-theme="dark"] .set2-item .badge2 { color: var(--green-300); background: color-mix(in srgb, var(--green-500) 12%, transparent); border-color: color-mix(in srgb, var(--green-500) 26%, transparent); }
.set2-sep { height: 1px; background: var(--hairline); margin: 10px 6px; }
.set2-pane { padding: 28px 30px; overflow-y: auto; }
.set2-pane .ph { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 24px; }
.set2-pane .ph .phi { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--green-600); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-theme="dark"] .set2-pane .ph .phi { color: var(--green-300); }
.set2-pane .ph .phi svg { width: 21px; height: 21px; }
.set2-pane .ph h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin: 0; color: var(--ink-1000); display: flex; align-items: center; gap: 9px; }
.set2-pane .ph h2 .b2 { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--green-700); padding: 3px 8px; border-radius: var(--r-pill); background: var(--green-50); border: 1px solid var(--green-200); }
[data-theme="dark"] .set2-pane .ph h2 .b2 { color: var(--green-300); background: color-mix(in srgb, var(--green-500) 12%, transparent); border-color: color-mix(in srgb, var(--green-500) 26%, transparent); }
.set2-pane .ph .psub { font-size: 13px; color: var(--ink-600); margin-top: 4px; line-height: 1.5; max-width: 520px; }
.set-card { border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--bg-surface); overflow: hidden; box-shadow: var(--shadow-xs); }
.set-card + .set-card { margin-top: 16px; }
.set-row { display: flex; align-items: center; gap: 15px; padding: 16px 18px; transition: background var(--d-fast); }
.set-row + .set-row { border-top: 1px solid var(--hairline); }
.set-row.click { cursor: pointer; }
.set-row.click:hover { background: var(--hover-surface-2); }
.set-row .ri { width: 38px; height: 38px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--green-600); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-theme="dark"] .set-row .ri { color: var(--green-300); }
.set-row .ri svg { width: 18px; height: 18px; }
.set-row .ri.brandmark { color: #fff; background: linear-gradient(135deg, var(--green-400), var(--green-700)); font-weight: 700; font-size: 13px; }
.set-row .rt { min-width: 0; flex: 1; }
.set-row .rt .rn { font-size: 14px; font-weight: 600; color: var(--ink-1000); display: inline-flex; align-items: center; gap: 8px; }
.set-row .rt .rd { font-size: 12.5px; color: var(--ink-500); margin-top: 2px; line-height: 1.45; }
.set-row .rv { margin-left: auto; display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
.set-row .rv .val { font-size: 12.5px; color: var(--ink-600); font-weight: 500; }
.set-row .rv .chev { color: var(--ink-400); display: inline-flex; }
.set-row .rv .chev svg { width: 17px; height: 17px; }
.chip-pill { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: var(--r-pill); background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-200); white-space: nowrap; }
[data-theme="dark"] .chip-pill { background: color-mix(in srgb, var(--green-500) 12%, transparent); color: var(--green-300); border-color: color-mix(in srgb, var(--green-500) 26%, transparent); }
.chip-pill.current { background: var(--green-500); color: #fff; border-color: transparent; }
.pane-cap { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); margin: 28px 0 13px; }
.pane-cap:first-child { margin-top: 0; }
.add-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border: 1px dashed var(--hairline-strong); border-radius: var(--r-md); background: transparent; color: var(--green-700); font-size: 13.5px; font-weight: 600; cursor: pointer; width: 100%; transition: background var(--d-fast), border-color var(--d-fast); margin-top: 14px; text-align: left; text-decoration: none; }
[data-theme="dark"] .add-row { color: var(--green-300); }
.add-row:hover { background: var(--accent-soft); border-color: var(--green-400); }
.add-row .ai { width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--accent-border); background: var(--accent-soft); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.add-row .ai svg { width: 16px; height: 16px; }
.add-row .at { display: flex; flex-direction: column; line-height: 1.25; }
.add-row .ad { font-size: 11.5px; font-weight: 500; color: var(--ink-500); margin-top: 1px; }
.paste-site { display: flex; align-items: center; gap: 9px; height: 46px; padding: 0 8px 0 15px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); margin-top: 14px; transition: border-color var(--d-fast), box-shadow var(--d-fast); }
.paste-site:focus-within { border-color: var(--green-500); box-shadow: var(--sel-ring); }
.paste-site .lk { color: var(--ink-400); display: inline-flex; flex-shrink: 0; }
.paste-site .lk svg { width: 17px; height: 17px; }
.paste-site input { flex: 1; border: none; background: transparent; outline: none; font-family: inherit; font-size: 13.5px; color: var(--ink-1000); }
.paste-site input::placeholder { color: var(--ink-400); }
/* tables (billing usage, members) */
.tbl-wrap { border: 1px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl thead th { text-align: left; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-500); padding: 11px 16px; background: var(--bg-soft); border-bottom: 1px solid var(--hairline); white-space: nowrap; }
table.tbl tbody td { padding: 13px 16px; border-top: 1px solid var(--hairline); color: var(--ink-800); vertical-align: middle; }
table.tbl tbody tr:first-child td { border-top: none; }
table.tbl .cell-brand { display: inline-flex; align-items: center; gap: 10px; }
table.tbl .cell-brand .bd { width: 26px; height: 26px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
table.tbl .cell-brand .nm { font-weight: 600; color: var(--ink-1000); }
table.tbl .num { font-family: var(--font-mono); font-weight: 600; color: var(--ink-900); }
table.tbl .cell-member { display: inline-flex; align-items: center; gap: 11px; }
table.tbl .cell-member .av { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--green-400), var(--green-700)); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
table.tbl .cell-member .mn { font-weight: 600; color: var(--ink-1000); }
table.tbl .cell-member .me { font-size: 11.5px; color: var(--ink-500); }
.tbl-foot { padding: 13px 16px; border-top: 1px solid var(--hairline); background: var(--bg-soft); font-size: 12px; color: var(--ink-600); display: flex; align-items: center; gap: 8px; }
.tbl-foot .num { font-family: var(--font-mono); font-weight: 700; color: var(--ink-1000); }
.tbl-foot .spacer { flex: 1; }
.role { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: var(--r-pill); border: 1px solid var(--hairline-strong); color: var(--ink-700); background: var(--bg-surface); white-space: nowrap; }
.role.admin { color: var(--green-700); border-color: var(--green-200); background: var(--green-50); }
[data-theme="dark"] .role.admin { color: var(--green-300); background: color-mix(in srgb, var(--green-500) 12%, transparent); border-color: color-mix(in srgb, var(--green-500) 26%, transparent); }
.brand-access { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.ba-tag { font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-pill); background: var(--ink-100); color: var(--ink-700); border: 1px solid var(--hairline); white-space: nowrap; }
.ba-tag.all { background: var(--accent-soft); color: var(--green-700); border-color: var(--accent-border); }
[data-theme="dark"] .ba-tag.all { color: var(--green-300); }
.plan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.plan-card { position: relative; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); padding: 16px 15px; cursor: pointer; transition: border-color var(--d-fast), box-shadow var(--d-fast), transform var(--d-fast); }
.plan-card:hover { border-color: var(--green-400); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.plan-card.on { border-color: var(--green-500); box-shadow: var(--sel-ring); background: color-mix(in srgb, var(--green-500) 5%, var(--bg-surface)); }
.plan-card .pn { font-size: 13px; font-weight: 700; color: var(--ink-1000); }
.plan-card .pp { font-family: var(--font-display); font-size: 19px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink-1000); margin-top: 7px; }
.plan-card .pp small { font-family: var(--font-body); font-size: 11px; font-weight: 500; color: var(--ink-500); }
.plan-card .pd { font-size: 11px; color: var(--ink-500); margin-top: 6px; line-height: 1.4; }
.plan-card .pcur { position: absolute; top: 12px; right: 12px; font-size: 9px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--green-700); }
[data-theme="dark"] .plan-card .pcur { color: var(--green-300); }
.plan-card.on .pcur { display: inline-flex; align-items: center; gap: 4px; }
.plan-card:not(.on) .pcur { display: none; }
.plan-card .pcur svg { width: 11px; height: 11px; }
.cred-hero { display: flex; align-items: center; gap: 18px; padding: 20px 22px; border-radius: var(--r-md); background: linear-gradient(135deg, color-mix(in srgb, var(--green-500) 14%, var(--bg-surface)), color-mix(in srgb, var(--green-500) 3%, var(--bg-surface))); border: 1px solid var(--green-200); }
[data-theme="dark"] .cred-hero { border-color: color-mix(in srgb, var(--green-500) 26%, transparent); }
.cred-hero .cc { width: 50px; height: 50px; border-radius: var(--r-md); background: linear-gradient(135deg, var(--green-500), var(--green-700)); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--shadow-green-soft); }
.cred-hero .cc svg { width: 24px; height: 24px; }
.cred-hero .cv { font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink-1000); line-height: 1; }
.cred-hero .cl { font-size: 12.5px; color: var(--ink-600); margin-top: 5px; }
.cred-hero .cspacer { flex: 1; }
.toggle { width: 40px; height: 24px; border-radius: var(--r-pill); background: var(--green-500); position: relative; flex-shrink: 0; border: none; cursor: pointer; padding: 0; transition: background var(--d-fast); }
.toggle::after { content: ""; position: absolute; top: 3px; left: 19px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: left var(--d-fast); }
.toggle.off { background: var(--ink-300); }
.toggle.off::after { left: 3px; }
.notif-tbl thead th.ch { text-align: center; width: 86px; }
.notif-tbl tbody td.ch { text-align: center; }
.notif-tbl tbody td .toggle { margin: 0 auto; }
.notif-tbl tbody td.evt .en { font-weight: 600; color: var(--ink-1000); }
.notif-tbl tbody td.evt .ed { font-size: 11.5px; color: var(--ink-500); margin-top: 2px; }
.lang-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.lang-tag { font-size: 12px; font-weight: 500; padding: 6px 13px; border-radius: var(--r-pill); background: var(--ink-100); color: var(--ink-700); border: 1px solid var(--hairline); cursor: pointer; transition: all var(--d-fast); }
.lang-tag.on { background: var(--green-50); color: var(--green-700); border-color: var(--green-200); }
[data-theme="dark"] .lang-tag.on { background: color-mix(in srgb, var(--green-500) 12%, transparent); color: var(--green-300); border-color: color-mix(in srgb, var(--green-500) 26%, transparent); }
.lang-tag.add { background: transparent; border-style: dashed; color: var(--ink-500); display: inline-flex; align-items: center; gap: 5px; }
.lang-tag.add svg { width: 13px; height: 13px; }
.voice-tbl td .sel { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--hairline-strong); background: var(--bg-surface); font-size: 12.5px; font-weight: 600; color: var(--ink-800); cursor: pointer; }
.voice-tbl td .sel svg { width: 14px; height: 14px; color: var(--ink-400); }
@media (max-width: 1180px) { .plan-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 920px) { .set2 { grid-template-columns: 1fr; } .set2-nav { border-right: none; border-bottom: 1px solid var(--hairline); } }

/* back link (brand-kit view header) */
.bk-back { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-600);
  border: none; background: transparent; cursor: pointer; padding: 4px 0; }
.bk-back:hover { color: var(--ink-1000); } .bk-back svg { width: 15px; height: 15px; }

@media (max-width: 640px) { .bk-tones { grid-template-columns: 1fr; } .ob-steps .ob-lbl { display: none; } }

/* ---- url-to-ad.html :: style block 1 ---- */
.x-qlist{display:flex;flex-direction:column;gap:9px}
.x-qrow{display:flex;gap:12px;align-items:flex-start;padding:13px 14px;border:1px solid var(--hairline-strong);border-radius:var(--r-md);background:var(--bg-surface);cursor:pointer;transition:border-color var(--d-fast),background var(--d-fast)}
.x-qrow:hover{border-color:var(--green-400)}
.x-qrow.on{border-color:var(--green-500);background:var(--sel-bg)}
.x-qrow .x-qt{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.x-qrow .x-ttl{font-size:13.5px;font-weight:600;color:var(--ink-1000);line-height:1.35}
.x-qrow .x-sub{font-size:11.5px;color:var(--ink-500);line-height:1.45}
.x-qradio{width:19px;height:19px;border-radius:50%;border:1.5px solid var(--ink-300);flex-shrink:0;margin-top:1px}
.x-qrow.on .x-qradio{border-color:var(--green-500);background:var(--green-500);box-shadow:inset 0 0 0 3px var(--bg-surface)}
.x-scrmeta{display:flex;align-items:center;gap:8px;font-size:11px;color:var(--ink-500);margin-bottom:11px}
.x-scrmeta svg{width:13px;height:13px;color:var(--green-600)}
.x-scrmeta .dot{color:var(--ink-300)}
.x-scrmeta.over{color:var(--danger)}
.x-scrblock{border:1px solid var(--hairline-strong);border-radius:var(--r-md);padding:15px 16px;font-size:13.5px;line-height:1.75;color:var(--ink-900);background:var(--bg-surface);outline:none}
.x-scrblock:hover,.x-scrblock:focus{border-color:var(--green-400)}
.x-chips{display:flex;gap:7px;margin-top:11px;flex-wrap:wrap}
.x-chip{font-size:11px;font-weight:500;color:var(--ink-600);border:1px solid var(--hairline-strong);background:var(--bg-surface);border-radius:var(--r-pill);padding:5px 11px;cursor:pointer}
.x-chip:hover{border-color:var(--green-400);color:var(--green-700)}
.x-aidock{display:flex;align-items:center;gap:9px;margin-top:13px;height:42px;padding:0 6px 0 14px;border:1px solid var(--hairline-strong);border-radius:var(--r-pill);background:var(--bg-surface)}
.x-aidock>svg{width:15px;height:15px;color:var(--green-600);flex-shrink:0}
.x-aidock input{flex:1;border:none;background:transparent;outline:none;font-size:12.5px;font-family:inherit;color:var(--ink-900);min-width:0}
.x-aidock input::placeholder{color:var(--ink-400)}
.x-aigo{width:30px;height:30px;border-radius:50%;border:none;background:var(--green-500);color:#fff;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;cursor:pointer}
.x-aigo svg{width:14px;height:14px}
.x-vgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
@media(max-width:900px){.x-vgrid{grid-template-columns:repeat(2,1fr)}}
.x-vtile{border:1px solid var(--hairline-strong);border-radius:var(--r-md);background:var(--bg-surface);overflow:hidden;cursor:pointer;padding:0;text-align:left;transition:border-color var(--d-fast);min-width:0;display:block}
.x-vtile:hover{border-color:var(--green-400)}
.x-vtile.on{border-color:var(--green-500);background:var(--sel-bg)}
.x-vtile.dim{opacity:.45}
.x-vthumb{position:relative;display:block;aspect-ratio:9/12;background:var(--media-well);overflow:hidden}
.x-vthumb video,.x-vthumb img{width:100%;height:100%;object-fit:cover;display:block}
.x-vplay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity var(--d-fast);background:rgba(0,0,0,.3)}
.x-vtile:hover .x-vplay{opacity:1}
.x-vplay .pb{display:inline-flex;align-items:center;gap:6px;background:rgba(0,0,0,.65);backdrop-filter:blur(6px);color:#fff;font-size:10px;font-weight:700;border-radius:99px;padding:6px 12px}
.x-vplay svg{width:12px;height:12px;fill:#fff;color:#fff}
.x-vmeta{display:block;padding:11px 13px}
.x-vn{font-size:12.5px;font-weight:600;color:var(--ink-1000);display:flex;align-items:center;gap:6px}
.x-vs{display:block;font-size:10.5px;color:var(--ink-500);margin-top:2px;line-height:1.35}
.x-vtick{display:none;width:15px;height:15px;border-radius:50%;background:var(--green-500);color:#fff;align-items:center;justify-content:center}
.x-vtile.on .x-vtick{display:inline-flex}
.x-vtick svg{width:9px;height:9px}
.vs-group{border:1px solid var(--hairline-strong);border-radius:var(--r-md);background:var(--bg-surface);padding:13px 14px;margin-bottom:9px}
.vs-h{display:flex;align-items:center;gap:8px;margin-bottom:11px}
.vs-t{font-size:13px;font-weight:600;color:var(--ink-1000)}
.vs-auto{margin-left:auto;font-size:10px;color:var(--ink-500);display:inline-flex;align-items:center;gap:4px}
.vs-auto svg{width:11px;height:11px;color:var(--green-600)}
.vs-row{display:flex;gap:9px;align-items:flex-end}
.vs-ctrl{flex:1;min-width:0}
.vs-ctrl.wide{flex:1.5}
.vs-k{font-size:10px;font-weight:600;color:var(--ink-500);margin-bottom:5px}
.vs-dd{position:relative;display:flex;align-items:center;justify-content:space-between;gap:8px;height:38px;padding:0 11px;border:1px solid var(--hairline-strong);border-radius:var(--r-sm);background:var(--bg-surface);cursor:pointer;transition:border-color var(--d-fast)}
.vs-dd:hover{border-color:var(--green-400)}
.vs-dd .vs-v{font-size:12.5px;font-weight:600;color:var(--ink-1000)}
.vs-dd svg{width:14px;height:14px;color:var(--ink-400);flex-shrink:0}
.vs-menu{position:absolute;left:0;right:0;top:calc(100% + 4px);background:var(--bg-surface);border:1px solid var(--hairline-strong);border-radius:var(--r-sm);box-shadow:var(--shadow-md);z-index:30;overflow:hidden;display:none}
.vs-dd.open .vs-menu{display:block}
.vs-menu button{display:flex;width:100%;align-items:center;padding:9px 11px;border:none;background:none;font-size:12px;font-weight:500;color:var(--ink-900);text-align:left;cursor:pointer}
.vs-menu button:hover{background:var(--ink-50)}
.vs-menu button.sel{color:var(--green-700);font-weight:600}
.vs-len{display:flex;align-items:center;gap:9px;height:38px;padding:0 11px;border:1px solid var(--hairline-strong);border-radius:var(--r-sm);background:var(--bg-surface)}
.vs-len input[type=range]{flex:1;accent-color:var(--green-500);min-width:0}
.vs-lv{font-family:var(--font-mono);font-size:11.5px;font-weight:600;color:var(--ink-1000);min-width:26px;text-align:right}
.vs-note{font-size:9.5px;color:var(--ink-400);margin-top:4px}
.inputs-foot{flex-wrap:wrap}
.x-credline{width:100%;text-align:center;font-size:11.5px;color:var(--ink-500);margin-top:2px}
.x-cred{font-family:var(--font-mono);font-weight:600;color:var(--ink-700)}

/* ---- url-to-ad.html :: style block 2 ---- */
/* ADR-0008 polish */
.link-q{background:none;border:none;color:var(--ink-500);font-size:12px;font-weight:500;display:inline-flex;align-items:center;gap:6px;cursor:pointer;padding:0}
.link-q:hover{color:var(--green-600)}
.link-q svg{width:14px;height:14px}
.more-toggle{background:transparent;border-color:transparent;box-shadow:none}
.more-toggle:hover{background:var(--ink-50)}
.more-toggle.open{background:transparent;border-color:transparent}
.more-body .ck-tick{background:var(--ink-100);border-color:transparent;color:var(--ink-500)}
.x-msnote{display:flex;align-items:center;gap:7px;font-size:11px;color:var(--ink-500);padding:2px 2px 10px}
.x-msnote svg{width:13px;height:13px;color:var(--green-600)}
.x-langrow{display:flex;align-items:center;gap:12px;padding:11px 14px;border:1px solid var(--hairline-strong);border-radius:var(--r-md);background:var(--bg-surface);margin-bottom:9px}
.x-langrow .xl-t{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.x-langrow .xl-n{font-size:13px;font-weight:600;color:var(--ink-1000)}
.x-langrow .xl-s{font-size:10.5px;color:var(--ink-500)}
.x-langrow .xl-dd{min-width:118px;flex-shrink:0}

/* ---- url-to-ad.html :: style block 3 ---- */
/* ADR-0010 */
.sc-vid img{width:100%;height:100%;object-fit:cover;display:block}
.x-genstage{border-style:dashed!important}
.x-genstage .sc-vid.gen{display:flex;align-items:center;justify-content:center;background:var(--green-50);color:var(--green-600);aspect-ratio:16/10}
.x-genstage .sc-vid.gen svg{width:22px;height:22px}
/* link popup: suggestions + all-products */
.x-sugg{display:flex;flex-direction:column;gap:6px;margin-top:8px}
.x-srow{display:flex;align-items:center;gap:11px;padding:8px 10px;border:1px solid var(--hairline-strong);border-radius:var(--r-md);background:var(--bg-surface);cursor:pointer;text-align:left;transition:border-color var(--d-fast)}
.x-srow:hover{border-color:var(--green-400)}
.x-srow img{width:34px;height:34px;border-radius:7px;object-fit:cover;flex-shrink:0}
.x-srow .sn{font-size:12.5px;font-weight:600;color:var(--ink-1000);flex:1}
.x-srow .sp2{font-size:11px;color:var(--ink-500)}
/* AC4 actors */
.xc-shell{display:flex;gap:0;border:1px solid var(--hairline);border-radius:var(--r-md);overflow:hidden;min-height:420px}
.xc-filters{flex:0 0 198px;border-right:1px solid var(--hairline);padding:14px;overflow:auto;max-height:480px}
.xc-search{display:flex;align-items:center;gap:8px;height:34px;padding:0 10px;border:1px solid var(--hairline-strong);border-radius:var(--r-sm);background:var(--bg-surface)}
.xc-search svg{width:13px;height:13px;color:var(--ink-400);flex-shrink:0}
.xc-search input{flex:1;border:none;background:transparent;outline:none;font-size:12px;font-family:inherit;color:var(--ink-900);min-width:0}
.xc-fg{margin-top:15px}
.xc-fl{font-size:9.5px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--ink-400);margin-bottom:7px}
.xc-chips{display:flex;flex-wrap:wrap;gap:6px}
.xc-chip{font-size:11px;font-weight:500;color:var(--ink-700);border:1px solid var(--hairline-strong);background:var(--bg-surface);border-radius:var(--r-pill);padding:5px 10px;cursor:pointer;transition:all var(--d-fast)}
.xc-chip:hover{border-color:var(--green-400)}
.xc-chip.on{border-color:var(--green-500);background:var(--sel-bg);color:var(--green-700);font-weight:600}
.xc-main{flex:1;padding:14px;min-width:0;overflow:auto;max-height:480px}
.xc-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
@media(max-width:900px){.xc-grid{grid-template-columns:repeat(2,1fr)}}
.xc-card{border:1px solid var(--hairline-strong);border-radius:var(--r-md);background:var(--bg-surface);overflow:hidden;cursor:pointer;padding:0;text-align:left;transition:border-color var(--d-fast);min-width:0;display:block}
.xc-card:hover{border-color:var(--green-400)}
.xc-card.on{border-color:var(--green-500);box-shadow:0 0 0 3px color-mix(in srgb,var(--green-500) 14%,transparent)}
.xc-card.dim{opacity:.45}
.xc-face{position:relative;display:block;aspect-ratio:3/4;background:var(--media-well);overflow:hidden}
.xc-face img{width:100%;height:100%;object-fit:cover;display:block}
.xc-face.none{display:flex;align-items:center;justify-content:center;background:var(--ink-100);color:var(--ink-400)}
.xc-face.none svg{width:24px;height:24px}
.xc-play{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity var(--d-fast);background:rgba(0,0,0,.3)}
.xc-card:hover .xc-play{opacity:1}
.xc-play .pb{display:inline-flex;align-items:center;gap:6px;background:rgba(0,0,0,.65);backdrop-filter:blur(6px);color:#fff;font-size:10px;font-weight:700;border-radius:99px;padding:6px 12px}
.xc-play svg{width:12px;height:12px;fill:#fff;color:#fff}
.xc-name{display:flex;align-items:center;gap:6px;padding:9px 11px;font-size:12.5px;font-weight:600;color:var(--ink-1000)}
.xc-badge{font-size:9px;font-weight:600;border-radius:var(--r-pill);padding:1px 7px}
.xc-badge.ai{background:var(--ink-100);color:var(--ink-600)}
.xc-badge.real{background:var(--green-50);color:var(--green-700);border:1px solid var(--green-200)}
.xc-badge.clone{background:#EFF6FF;color:#1D4ED8}
.xc-tick{display:none;width:14px;height:14px;border-radius:50%;background:var(--green-500);color:#fff;align-items:center;justify-content:center;margin-left:auto}
.xc-card.on .xc-tick{display:inline-flex}
.xc-tick svg{width:8px;height:8px}
.xc-card.create{border-style:dashed;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:var(--ink-600);background:var(--bg-canvas);min-height:100%}
.xc-cic{width:40px;height:40px;border-radius:50%;background:var(--green-50);color:var(--green-600);display:flex;align-items:center;justify-content:center}
.xc-cic svg{width:18px;height:18px}
.xc-ct{font-size:12px;font-weight:600;color:var(--ink-1000)}
.xc-empty{padding:30px;text-align:center;font-size:12px;color:var(--ink-500)}

/* ---- url-to-ad.html :: style block 4 ---- */
/* ADR-0011 */
.theme-ic{width:34px;height:34px;border-radius:50%;border:1px solid var(--hairline-strong);background:var(--bg-surface);color:var(--ink-700);font-size:15px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:all var(--d-fast)}
.theme-ic:hover{border-color:var(--green-400);color:var(--green-700)}
.popup[data-popup-type="cast"]{width:min(1240px,95vw);max-width:95vw}
.popup[data-popup-type="cast"] .popup-body{max-height:calc(90vh - 200px)}
.xc-shell{min-height:56vh;border:none}
.xc-filters{flex-basis:216px;padding:18px;max-height:calc(90vh - 230px)}
.xc-main{padding:18px;max-height:calc(90vh - 230px)}
.xc-grid{grid-template-columns:repeat(5,1fr);gap:12px}
@media(max-width:1100px){.xc-grid{grid-template-columns:repeat(3,1fr)}}
.xc-name{padding:10px 12px 4px;flex-wrap:wrap}
.xc-card{border-radius:12px}
.xc-subn{display:block;font-size:10px;color:var(--ink-500);padding:0 12px 10px}
.xc-card .xc-name:last-child{padding-bottom:10px}

/* ---- url-to-ad.html :: style block 5 ---- */
/* ADR-0013 — Actors taller takeover + Human creators + Format bigger */
.popup[data-popup-type="cast"]{width:min(1180px,94vw);max-width:94vw;height:min(860px,90vh);display:flex;flex-direction:column;overflow:hidden}
.popup[data-popup-type="cast"] .popup-body{flex:1;min-height:0;max-height:none;overflow-y:auto;overflow-x:hidden;padding:0}
.xc-shell{height:100%;min-height:0;border:none;border-top:1px solid var(--hairline)}
.xc-filters{flex-basis:212px;max-height:none;overflow:auto;padding:18px}
.xc-main{max-height:none;height:100%;overflow:auto;padding:18px}
.xc-grid{grid-template-columns:repeat(5,1fr);gap:12px}
@media(max-width:1100px){.xc-grid{grid-template-columns:repeat(3,1fr)}}
.xc-face{aspect-ratio:4/5}
.xc-meta{display:block}
.xc-name{padding:9px 12px 2px;display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:12.5px;font-weight:600;color:var(--ink-1000)}
.xc-badge.human{background:var(--green-50);color:var(--green-700);border:1px solid var(--green-200)}
.xc-foot{display:flex;align-items:center;gap:12px;padding:0 12px 10px;flex-wrap:wrap}
.xc-voice{display:inline-flex;align-items:center;gap:4px;font-size:10.5px;font-weight:600;color:var(--ink-600);background:none;border:none;padding:0;cursor:pointer}
.xc-voice svg{width:12px;height:12px}
.xc-voice:hover{color:var(--green-700)}
.xc-prof{display:inline-flex;align-items:center;gap:4px;font-size:10.5px;font-weight:600;color:var(--green-700);text-decoration:none}
.xc-prof svg{width:11px;height:11px}
.xc-prof:hover{text-decoration:underline}
.xc-subn{font-size:10px;color:var(--ink-500);padding:0}
/* Format popup — bigger (try) */
.popup[data-popup-type="format"]{width:min(1040px,92vw);max-width:92vw}
.popup[data-popup-type="format"] .popup-body{max-height:80vh;overflow:auto}
.popup[data-popup-type="format"] .x-vgrid{grid-template-columns:repeat(3,1fr);gap:14px}
.popup[data-popup-type="format"] .x-vthumb{aspect-ratio:4/5}

/* ---- url-to-ad.html :: style block 6 ---- */
.popup[data-popup-type="wizard"]{width:min(1180px,94vw);max-width:94vw;height:min(860px,90vh);display:flex;flex-direction:column}
.popup[data-popup-type="wizard"] .popup-body{flex:1;min-height:0;max-height:none;overflow:auto;padding:0 26px}
.popup[data-popup-type="wizard"] .popup-foot{flex-wrap:wrap}
.wz-steps{display:flex;align-items:center;padding:6px 0 18px;position:sticky;top:0;background:var(--bg-surface);z-index:2}
.wz-step{display:flex;align-items:center;gap:8px}
.wz-num{width:24px;height:24px;border-radius:50%;border:1.5px solid var(--hairline-strong);display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;color:var(--ink-500);background:var(--bg-surface)}
.wz-num svg{width:12px;height:12px}
.wz-step.on .wz-num{border-color:var(--green-500);background:var(--green-500);color:#fff}
.wz-step.done .wz-num{border-color:var(--green-500);background:var(--green-50);color:var(--green-700)}
.wz-lbl{font-size:12.5px;font-weight:600;color:var(--ink-500)}
.wz-step.on .wz-lbl,.wz-step.done .wz-lbl{color:var(--ink-1000)}
.wz-line{flex:1;height:1.5px;background:var(--hairline);margin:0 12px;min-width:20px}
.wz-body{padding-bottom:24px}
.wz-note{font-size:12.5px;color:var(--ink-600);margin:4px 0 16px;line-height:1.5}
.wz-auto{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--green-700);background:var(--green-50);border:1px solid var(--green-200);border-radius:var(--r-md);padding:9px 13px;margin-bottom:16px}
.wz-auto svg{width:14px;height:14px;flex-shrink:0}
/* FMT-6 (locked) — borderless portrait video posters, title+desc below */
.wz-fgrid{display:grid;grid-template-columns:repeat(6,1fr);gap:14px}
@media(max-width:1000px){.wz-fgrid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:680px){.wz-fgrid{grid-template-columns:repeat(2,1fr)}}
.wz-ftile{position:relative;border:none;border-radius:0;overflow:visible;background:transparent;cursor:pointer;padding:0;text-align:left;display:block;min-width:0}
.wz-ftile.dim{opacity:.5}
.wz-fthumb{position:relative;display:block;aspect-ratio:9/16;background:var(--media-well);overflow:hidden;border-radius:14px;border:2px solid transparent;box-shadow:var(--shadow-sm);transition:box-shadow var(--d-base),transform var(--d-base)}
.wz-ftile:hover .wz-fthumb{box-shadow:var(--shadow-lg);transform:translateY(-2px)}
.wz-ftile.on .wz-fthumb{border-color:var(--green-500);box-shadow:0 0 0 3px color-mix(in srgb,var(--green-500) 16%,transparent),var(--shadow-md)}
.wz-fthumb img{width:100%;height:100%;object-fit:cover;display:block}
.wz-frec{position:absolute;top:8px;left:8px;z-index:2;font-family:var(--font-mono);font-size:8.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#fff;background:linear-gradient(135deg,var(--green-500),var(--green-600));padding:3px 8px;border-radius:var(--r-pill)}
.wz-fmute{position:absolute;top:8px;right:8px;width:24px;height:24px;border-radius:50%;background:rgba(0,0,0,.4);backdrop-filter:blur(6px);color:#fff;display:flex;align-items:center;justify-content:center;z-index:2}
.wz-fmute svg{width:12px;height:12px}
.wz-fplay{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(.9);width:38px;height:38px;border-radius:50%;background:rgba(255,255,255,.92);display:flex;align-items:center;justify-content:center;opacity:0;transition:all var(--d-fast);z-index:2;box-shadow:var(--shadow-md)}
.wz-fplay svg{width:16px;height:16px;color:#111;margin-left:2px}
.wz-ftile:hover .wz-fplay{opacity:1;transform:translate(-50%,-50%) scale(1)}
.wz-fmeta{display:block;padding:9px 2px 0}
.wz-fn{font-size:12.5px;font-weight:700;color:var(--ink-1000);display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.wz-fs{display:block;font-size:11px;color:var(--ink-500);margin-top:2px;line-height:1.35}
.wz-ftick{display:none;width:15px;height:15px;border-radius:50%;background:var(--green-500);color:#fff;align-items:center;justify-content:center;flex-shrink:0}
.wz-ftile.on .wz-ftick{display:inline-flex}
.wz-ftick svg{width:9px;height:9px}
.wz-cgrid{grid-template-columns:repeat(5,1fr)}
@media(max-width:1100px){.wz-cgrid{grid-template-columns:repeat(3,1fr)}}
.wz-cost{font-family:var(--font-mono);font-size:11px;font-weight:600;opacity:.9;background:rgba(255,255,255,.16);border-radius:99px;padding:1px 8px;margin-left:6px;display:inline-flex;align-items:center;gap:4px;min-width:36px;justify-content:center;transition:opacity .18s ease-out}
.wz-cost--loading{opacity:.55}

/* ---- url-to-ad.html :: style block 7 ---- */
.wz-hero{padding:14px 0 4px}
.wz-herolabel{font-size:13px;color:var(--ink-600);margin-bottom:12px;line-height:1.5}
.wz-herofield{display:flex;align-items:center;gap:12px;height:66px;padding:0 8px 0 18px;border:1.5px solid var(--hairline-strong);border-radius:14px;background:var(--bg-surface);transition:border-color var(--d-fast),box-shadow var(--d-fast)}
.wz-herofield:focus-within{border-color:var(--green-500);box-shadow:0 0 0 3px color-mix(in srgb,var(--green-500) 12%,transparent)}
.wz-herofield>svg{width:20px;height:20px;color:var(--ink-400);flex-shrink:0}
.wz-herofield input{flex:1;border:none;background:transparent;outline:none;font-size:17px;font-family:inherit;color:var(--ink-1000);min-width:0}
.wz-herofield input::placeholder{color:var(--ink-400)}
.wz-herogo{width:44px;height:44px;border-radius:11px;border:none;background:linear-gradient(135deg,var(--green-500),var(--green-600));color:#fff;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;cursor:pointer}
.wz-herogo svg{width:18px;height:18px}
.wz-recent-lab{font-family:var(--font-mono);font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-400);margin:24px 0 11px}
.wz-recent{display:grid;grid-template-columns:repeat(6,1fr);gap:10px}
@media(max-width:900px){.wz-recent{grid-template-columns:repeat(4,1fr)}}
.wz-rcard{border:1px solid var(--hairline-strong);border-radius:10px;overflow:hidden;background:var(--bg-surface);cursor:pointer;padding:0;text-align:left;display:block;transition:border-color var(--d-fast);min-width:0}
.wz-rcard:hover{border-color:var(--green-400)}
.wz-rcard.on{border-color:var(--green-500);box-shadow:0 0 0 3px color-mix(in srgb,var(--green-500) 14%,transparent)}
.wz-rthumb{display:block;aspect-ratio:1/1;background:var(--ink-100);overflow:hidden}
.wz-rthumb img{width:100%;height:100%;object-fit:cover;display:block}
.wz-rn{display:block;font-size:10.5px;font-weight:600;color:var(--ink-1000);padding:6px 8px 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ---- url-to-ad.html :: style block 8 ---- */
/* link · format share ONE envelope with the wizard/cast popups (1180×860) */
.popup[data-popup-type="link"]{width:min(1180px,94vw);max-width:94vw;height:min(860px,90vh);display:flex;flex-direction:column}
.popup[data-popup-type="format"]{width:min(1180px,94vw);max-width:94vw;height:min(860px,90vh);display:flex;flex-direction:column}
.popup[data-popup-type="format"] .wz-fgrid{grid-template-columns:repeat(6,1fr)}
@media(max-width:1000px){.popup[data-popup-type="format"] .wz-fgrid{grid-template-columns:repeat(3,1fr)}}
/* casting room inside the wizard step */
.wz-body .xc-shell{min-height:48vh;height:auto}
.wz-body .xc-filters{max-height:none}
.wz-body .xc-main{max-height:none}

/* ---- url-to-ad.html :: style block 9 ---- */
/* ST-A (locked) — footer step indicator */
.wz-stepmini{display:inline-flex;align-items:center;gap:10px;font-size:11.5px;color:var(--ink-500)}
.wz-stepmini .d{display:inline-flex;gap:5px}
.wz-stepmini .d i{width:6px;height:6px;border-radius:50%;background:var(--ink-300);display:inline-block;transition:all var(--d-base)}
.wz-stepmini .d i.on{background:var(--green-500);width:17px;border-radius:3px}
.wz-stepmini b{color:var(--ink-700);font-weight:600}
/* RX-1 (locked, ADR-0028) — showcase hero on wizard step 1 */
.wz-body.rx{padding-bottom:0}
.rx-cols{display:grid;grid-template-columns:minmax(0,0.92fr) minmax(0,1.08fr);min-height:600px;border:1px solid var(--hairline);border-radius:var(--r-lg);overflow:hidden}
.rx-lft{padding:10px 36px;display:flex;flex-direction:column;justify-content:center;overflow:hidden}
.rx-mk{width:50px;height:50px;border-radius:14px;background:linear-gradient(135deg,var(--green-400),var(--green-600));box-shadow:var(--shadow-green-soft);display:flex;align-items:center;justify-content:center;color:#fff;margin-bottom:18px}
.rx-mk svg{width:25px;height:25px}
.rx-big{font-family:var(--font-display);font-size:32px;font-weight:800;letter-spacing:-.03em;line-height:1.05;color:var(--ink-1000);margin:0}
.rx-lead{font-size:13.5px;color:var(--ink-600);margin:12px 0 0;line-height:1.55;max-width:380px}
.rx-fmts{display:flex;gap:7px;margin-top:13px;flex-wrap:wrap}
.rx-fmts span{font-size:10.5px;font-weight:700;font-family:var(--font-mono);letter-spacing:.03em;color:var(--ink-600);background:var(--ink-100);padding:4px 9px;border-radius:var(--r-pill)}
.rx-field{display:flex;align-items:center;gap:11px;height:56px;padding:0 8px 0 16px;border:1.5px solid var(--hairline-strong);border-radius:14px;background:var(--bg-surface);box-shadow:var(--shadow-xs);margin-top:22px;transition:border-color var(--d-fast),box-shadow var(--d-fast)}
.rx-field:focus-within{border-color:var(--green-500);box-shadow:0 0 0 3px color-mix(in srgb,var(--green-500) 12%,transparent)}
.rx-field>svg{width:19px;height:19px;color:var(--ink-400);flex-shrink:0}
.rx-field input{flex:1;border:none;background:transparent;outline:none;font-size:15px;font-family:inherit;color:var(--ink-1000);min-width:0}
.rx-field input::placeholder{color:var(--ink-400)}
.rx-go{width:42px;height:42px;border-radius:10px;border:none;background:var(--ink-100);color:var(--ink-500);display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;cursor:pointer;transition:all var(--d-fast)}
.rx-field:focus-within .rx-go{background:linear-gradient(135deg,var(--green-500),var(--green-600));color:#fff}
.rx-go svg{width:17px;height:17px}
.rx-orpick{display:flex;align-items:center;margin-top:18px;font-size:12px}
.rx-orpick .l{font-weight:600;color:var(--ink-600)}
.rx-orpick .all{margin-left:auto;color:var(--ink-400);font-weight:600;display:inline-flex;align-items:center;gap:3px;cursor:pointer}
.rx-orpick .all svg{width:13px;height:13px}
/* Scroll wrapper — constrains height, the grid inside keeps full gap */
.rx-thumbs-wrap{max-height:256px;overflow-y:auto;overflow-x:hidden;margin-top:11px;scrollbar-width:none}
.rx-thumbs-wrap::-webkit-scrollbar{display:none}
.rx-thumbs{display:grid;grid-template-columns:repeat(4,1fr);gap:9px}
.rx-pth{position:relative;border-radius:11px;overflow:hidden;aspect-ratio:1/1;background:var(--ink-100);cursor:pointer;border:1px solid var(--hairline-strong);padding:0}
.rx-pth:hover{border-color:var(--green-400)}
.rx-pth.on{border-color:var(--green-500);box-shadow:0 0 0 3px color-mix(in srgb,var(--green-500) 14%,transparent)}
.rx-pth img{width:100%;height:100%;object-fit:cover;display:block}
.rx-pth .nm{position:absolute;left:0;right:0;bottom:0;padding:10px 7px 5px;font-size:9px;font-weight:700;color:#fff;background:linear-gradient(transparent,rgba(0,0,0,.72));white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left}
.rx-show{position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;background:linear-gradient(165deg,color-mix(in srgb,var(--green-500) 9%,var(--bg-soft)),var(--bg-soft));padding:24px 0}
.rx-show::before{content:"";position:absolute;inset:0;background-image:radial-gradient(circle,color-mix(in srgb,var(--ink-1000) 5%,transparent) 1px,transparent 1px);background-size:20px 20px;opacity:.5}
.rx-adf{position:relative;width:min(250px,40%);aspect-ratio:9/16;max-height:calc(100% - 48px);border-radius:24px;overflow:hidden;background:#081109;box-shadow:0 30px 70px rgba(0,0,0,.28),0 6px 18px rgba(0,0,0,.16);border:1px solid rgba(255,255,255,.06)}
.rx-adf .mesh{position:absolute;inset:0;background:radial-gradient(120% 75% at 50% 0%,#1f4630,#081109 72%)}
.rx-adf .blob{position:absolute;border-radius:50%;filter:blur(44px);opacity:.5}
.rx-adf .b1{width:62%;height:30%;left:-10%;top:16%;background:#22C55E}
.rx-adf .b2{width:55%;height:28%;right:-12%;bottom:20%;background:#0d6b3a;opacity:.6}
.rx-adf .who{position:absolute;left:12px;top:12px;display:flex;align-items:center;gap:7px;background:rgba(0,0,0,.4);backdrop-filter:blur(6px);padding:3px 10px 3px 3px;border-radius:var(--r-pill);z-index:2}
.rx-adf .who img{width:22px;height:22px;border-radius:50%}
.rx-adf .who span{font-size:10.5px;font-weight:600;color:#fff}
.rx-adf .ar{position:absolute;right:11px;top:11px;font-family:var(--font-mono);font-size:9px;font-weight:700;color:#fff;background:rgba(0,0,0,.45);padding:3px 7px;border-radius:var(--r-pill);z-index:2}
.rx-adf .cap{position:absolute;left:15px;right:15px;bottom:22px;font-family:var(--font-display);font-weight:900;font-size:18px;line-height:1.15;color:#fff;text-shadow:0 2px 14px rgba(0,0,0,.6);z-index:2}
.rx-adf .cap em{font-style:normal;color:#5ef08f}
.rx-adf .play{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:46px;height:46px;border-radius:50%;background:rgba(255,255,255,.92);display:flex;align-items:center;justify-content:center;box-shadow:0 8px 24px rgba(0,0,0,.3);z-index:2}
.rx-adf .play svg{width:19px;height:19px;color:#0b0b0f;margin-left:2px}
@media(max-width:820px){.rx-cols{grid-template-columns:1fr}.rx-show{min-height:300px}}

/* ============================================================
   end canon surface CSS
   ============================================================ */

/* ============================================================
   POST-CANON MEDIA FIT — 2026-06-14
   Canon HTMLs paint .vthumb / .tthumb backgrounds via gradients
   (.th-a..e mock data). The live web JSX renders real <img>/<video>
   inside .vthumb. Without an absolute-fill rule the media renders at
   intrinsic size and blows out the aspect-ratio:9/12 box, making cards
   viewport-tall and pushing the page title off-screen.
   ============================================================ */
.vc .vthumb { position: relative; overflow: hidden; }
.vc .vthumb > img,
.vc .vthumb > video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  z-index: 1;
}
.vc .vthumb .grade,
.vc .vthumb .stagepill,
.vc .vthumb .playbadge,
.vc .vthumb .vcap { z-index: 2; }

.tpl .tthumb { position: relative; overflow: hidden; }
.tpl .tthumb > img,
.tpl .tthumb > video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
/* Format chip pinned top-right on the template thumbnail. Mirrors the
   `.fmt` chip on hexcoded.ai's "Real or AI. Always your product." strip.
   z-index sits above .grade + video so it stays legible while the
   thumbnail loops. */
.tpl .tthumb .tfmt {
  position: absolute; right: 9px; top: 9px; z-index: 3;
  font-size: 9px; font-weight: 700; font-family: var(--font-mono);
  color: #fff; background: rgba(0, 0, 0, 0.55);
  padding: 3px 8px; border-radius: var(--r-pill);
  letter-spacing: 0.02em; white-space: nowrap;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.tpl .tthumb .grade,
.tpl .tthumb .tcap,
.tpl .tthumb .use { z-index: 2; }

.lrow .lt { position: relative; overflow: hidden; }
.lrow .lt > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* end POST-CANON MEDIA FIT */

/* === Wizard CSS gap fill — 2026-06-14 (canon-gh, canon-wiz, canon-actor) === */
/* Defensive overlay: re-asserts the canon-* class rules used by app/briefs/new/page.jsx.
   Mined from design/canon/common/generating-results.html (G-H "brand breath + ring")
   and design/canon/url-to-ad.html (wizard shell, actor card).
   JSX class names are the source of truth — rule bodies copied verbatim from canon and
   re-prefixed with `canon-` where the canon HTML uses bare class names (e.g. .gh-frame -> .canon-gh-frame).
   Appended after the primary block so this overlay survives any earlier edits. */

/* Wizard shell (url-to-ad.html, lines ~265-330) */
.canon-wiz-overlay{
  position:fixed; inset:0; z-index:1000;
  /* Canon .popup-scrim — tinted + glassmorphism blur on the page behind. */
  background:rgba(0,0,0,.45) !important;
  backdrop-filter: blur(8px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(8px) saturate(120%) !important;
  display:flex; align-items:center; justify-content:center;
  overflow:auto;
  padding:24px;
}
.canon-wiz-panel{
  width:min(1180px,94vw);
  margin:auto;
  background:var(--bg-surface,#fff);
  border:1px solid var(--hairline, rgba(0,0,0,.08));
  border-radius:18px;
  box-shadow:0 30px 80px rgba(0,0,0,.10);
  padding:20px 22px;
  display:flex; flex-direction:column; gap:14px;
}
.canon-wiz-h{
  font-family:var(--font-display);
  font-size:22px; font-weight:800; margin:0 0 6px;
  color:var(--ink-1000);
}
.canon-wiz-foot{
  display:flex; align-items:center; gap:10px;
  padding-top:14px; margin-top:auto;
  border-top:1px solid var(--hairline, rgba(0,0,0,.08));
}
.canon-wiz-foot .spacer{ flex:1; }

/* G-H Generating (generating-results.html, lines 73-87) — canon- prefixed */
.canon-gh{
  margin:auto; padding:40px 20px;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
}
.canon-gh-frame{
  position:relative; border-radius:18px; overflow:hidden;
  background:var(--media-well, #0b0b0f);
  width:188px; aspect-ratio:9/16;
}
.canon-gh-mesh{
  position:absolute; inset:0;
  background:radial-gradient(120% 90% at 50% 0%,#0e2a1a,#07120c 72%);
}
.canon-gh-shimmer{
  position:absolute; inset:0;
  background:linear-gradient(100deg,transparent 30%,rgba(134,239,172,.12) 50%,transparent 70%);
  animation:canon-gh-shz 2.4s linear infinite;
}
@keyframes canon-gh-shz{
  0%{ transform:translateX(-100%); }
  100%{ transform:translateX(100%); }
}
.canon-gh-wm{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
}
.canon-hexwm{
  font-family:var(--font-display, 'Outfit', sans-serif);
  font-size:15px; font-weight:900; letter-spacing:.06em;
  color:rgba(255,255,255,.9);
  text-shadow:0 0 18px rgba(94,240,143,.32);
  animation:canon-gh-breath 2.6s ease-in-out infinite;
}
@keyframes canon-gh-breath{
  0%,100%{ opacity:.65; transform:scale(1); }
  50%{ opacity:1; transform:scale(1.04); }
}
.canon-gh-ring{
  position:relative; width:48px; height:48px; margin:16px auto 0;
}
.canon-gh-ring svg{ width:48px; height:48px; display:block; }
.canon-gh-num{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:11px;
  color:var(--ink-900); font-variant-numeric:tabular-nums;
}
.canon-gh-line{
  text-align:center; margin-top:12px;
  font-size:13.5px; font-weight:600; color:var(--ink-1000);
}
.canon-gh-sub{
  text-align:center; margin-top:5px;
  font-size:11.5px; color:var(--ink-500); line-height:1.5;
}

/* Coded-step actor card (url-to-ad.html, "Pick an actor" step) */
.canon-actor-summary{ padding:6px 0; }
.canon-actor-card{
  display:flex; align-items:center; gap:14px;
  padding:14px; border:1px solid var(--hairline);
  border-radius:14px; background:var(--bg-surface,#fff);
}
.canon-actor-face{
  width:56px; height:56px; border-radius:50%;
  background:linear-gradient(135deg,#22c55e,#0e2a1a);
}
.canon-actor-meta{ display:flex; flex-direction:column; gap:4px; }
.canon-actor-name{ font-weight:700; color:var(--ink-1000); font-size:14px; }
/* === end wizard gap fill === */

/* === RX-1 canon overlay — 2026-06-15 === */
/* Canon RX-1 (locked, ADR-0028): header bar (URL→AD tag + close),
   precise panel sizing (~1180x860), .who avatar inside .rx-adf, and
   minor parity tweaks vs the earlier first-pass rules. Additive only —
   later rules win over the duplicate block at L8591+. */

/* Canon glassmorphism scrim — matches design/canon/url-to-ad.html .popup-scrim
   (rgba(0,0,0,.45) + backdrop-filter blur 4px). Page behind the modal is
   tinted AND blurred. */
.canon-wiz-overlay[data-canon-step="1"]{
  background:rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items:center;
  padding:24px;
}
/* Locked panel dimensions for ALL wizard steps (1, 2, 3) — same width
   + height across the flow so the modal doesn't grow / shrink as the user
   advances steps. Was inconsistent: Step 1 had its own size, Steps 2-3
   used the base panel sizing. */
.canon-wiz-overlay[data-canon-step="1"] .canon-wiz-panel,
.canon-wiz-overlay[data-canon-step="2"] .canon-wiz-panel,
.canon-wiz-overlay[data-canon-step="3"] .canon-wiz-panel,
.canon-wiz-overlay[data-canon-step="picker"] .canon-wiz-panel {
  width: min(1180px, 86vw);
  height: min(820px, 86vh);
  max-height: 86vh;
  padding: 28px 28px 20px;
  gap: 14px;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.30);
}
/* Semantic-neutral picker value — for tools that open the ActorPicker /
   ProductPicker outside URL→Ad's wizard chain (Composer, Talking Actors).
   Same scrim + centered-panel look as steps 2/3 without pretending to be
   a wizard step. Prefer this over data-canon-step="3" for new callers. */
.canon-wiz-overlay[data-canon-step="picker"]{
  background:rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items:center;
  padding:24px;
}
/* Step 1 uses 0-padding because its RX-1 markup includes its own
   header/body/footer with full-bleed columns. */
.canon-wiz-overlay[data-canon-step="1"] .canon-wiz-panel {
  padding: 0;
  gap: 0;
}
.canon-wiz-overlay[data-canon-step="1"] .wiz-step-rx1{
  display:flex; flex-direction:column;
  height:100%;
}
.canon-wiz-overlay[data-canon-step="1"] .rx-cols{
  flex:1; min-height:0;
  border:none; border-radius:0;
  border-top:1px solid var(--hairline, rgba(0,0,0,.08));
  border-bottom:1px solid var(--hairline, rgba(0,0,0,.08));
}
.canon-wiz-overlay[data-canon-step="1"] .canon-wiz-foot{
  padding:14px 24px;
  margin:0;
  border-top:none;
}

/* Header bar — URL → AD tag (left) + circular close (right) */
.rx-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 22px;
  background:var(--bg-surface, #fff);
}
.rx-tag{
  font-family:var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size:12.5px;
  font-weight:800;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--green-600, #16a34a);
}
.rx-close{
  width:32px; height:32px; border-radius:50%;
  border:1px solid var(--hairline-strong, rgba(0,0,0,.12));
  background:var(--bg-surface, #fff);
  color:var(--ink-600, #555);
  display:inline-flex; align-items:center; justify-content:center;
  cursor:pointer;
  transition:background var(--d-fast,.15s), color var(--d-fast,.15s);
}
.rx-close:hover{
  background:var(--ink-100, #f1f3f5);
  color:var(--ink-1000, #111);
}

/* Avatar pill (canon: top-left of the ad frame) */
.rx-adf .who{
  position:absolute; left:12px; top:12px;
  display:flex; align-items:center; gap:7px;
  background:rgba(0,0,0,.4);
  backdrop-filter:blur(6px);
  padding:3px 10px 3px 3px;
  border-radius:99px;
  z-index:2;
}
.rx-adf .who img{
  width:22px; height:22px; border-radius:50%;
  display:block;
}
.rx-adf .who span{
  font-size:10.5px; font-weight:600; color:#fff;
}

/* Play glyph centring inside .play (canon nudges 2px right) */
.rx-adf .play svg{ margin-left:2px; }

/* Footer helper text */
.canon-wiz-foot .foot-note{
  display:inline-flex; align-items:center; gap:6px;
  font-size:13px; color:var(--ink-500, #6b7280);
}
.canon-wiz-foot .foot-note svg{ color:var(--green-500, #22c55e); }
/* === end RX-1 overlay === */

/* ============================================================
   Pick-an-actor Step 3 (canon FMT-6 actor library) — 2026-06-15
   Full-grid replacement for the prior slim summary stub.
   ============================================================ */
.cp-actor-layout {
  display: flex;
  gap: 22px;
  margin-top: 14px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.cp-actor-rail {
  flex: 0 0 200px;
  display: flex; flex-direction: column; gap: 14px;
  padding-right: 8px;
  overflow-y: auto;
}
.cp-actor-search {
  display: flex; align-items: center; gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--ink-500);
}
.cp-actor-search input,
.wiz-step-coded .cp-actor-search input[type="text"] {
  flex: 1;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  height: auto !important;
  font-size: 13px;
  color: var(--ink-1000);
}
.wiz-step-coded .cp-actor-search input[type="text"]:focus {
  box-shadow: none !important;
  border: none !important;
}
.cp-actor-section {
  font-family: var(--font-mono, monospace);
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-500);
  margin-top: 4px;
}
.cp-actor-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.cp-actor-pill {
  font-size: 12px; font-weight: 500;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--bg-surface);
  color: var(--ink-700);
  cursor: pointer;
  transition: all 0.12s ease;
}
.cp-actor-pill:hover { border-color: var(--ink-300); }
.cp-actor-pill.on {
  background: var(--green-50, #ecfdf5);
  border-color: var(--green-500, #22c55e);
  color: var(--green-700, #15803d);
  font-weight: 600;
}

.cp-actor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  grid-auto-rows: max-content;
  gap: 16px;
  padding-right: 8px;
  padding-bottom: 12px;
  align-content: start;
  overflow-y: auto;
  overflow-x: hidden;
  /* flex:1 works because .cp-actor-layout is now a flex container.
     The grid fills the remaining width and scrolls within the panel
     height set by min-height:0 + overflow:hidden on the parent. */
  flex: 1;
  min-width: 0;
  scrollbar-width: thin;
}
.cp-actor-card {
  position: relative;
  display: flex; flex-direction: column;
  border: 1.5px solid var(--hairline);
  border-radius: 14px;
  background: var(--bg-surface);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  padding: 0;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.cp-actor-card:hover {
  border-color: var(--ink-300);
  transform: translateY(-1px);
}
.cp-actor-card.on {
  border-color: var(--green-500, #22c55e);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-500, #22c55e) 18%, transparent);
}

/* Create / Upload tiles — dashed border, centered icon */
.cp-actor-card.cp-create,
.cp-actor-card.cp-upload {
  border-style: dashed;
  align-items: center; justify-content: center;
  /* Match the photo height + meta height so create tile is same size
     as real actor cards: 180px photo + ~50px meta ≈ 230px total. */
  height: 230px;
  gap: 12px;
  padding: 18px;
}
.cp-actor-card.cp-create:hover,
.cp-actor-card.cp-upload:hover {
  border-color: var(--green-500, #22c55e);
  background: var(--green-50, #ecfdf5);
}
.cp-create-icon {
  width: 44px; height: 44px; border-radius: 999px;
  background: var(--green-100, #d1fae5);
  color: var(--green-700, #15803d);
  display: flex; align-items: center; justify-content: center;
}
.cp-create-label {
  font-size: 13px; font-weight: 600;
  color: var(--ink-900);
}

/* Real actor cards */
.cp-actor-thumb {
  position: relative;
  width: 100%;
  /* Fixed height so every card has the same photo area regardless of
     grid column width. flex-shrink:0 prevents it from collapsing
     inside a flex/grid item. */
  height: 180px;
  flex-shrink: 0;
  background: var(--ink-100);
  overflow: hidden;
}
.cp-actor-thumb img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block;
}
.cp-actor-thumb-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 700;
  color: var(--ink-400);
  background: var(--ink-100);
}
.cp-actor-tick {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--green-500, #22c55e);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.cp-actor-voice-badge {
  position: absolute; right: 10px; bottom: 10px;
  width: 32px; height: 32px;
  border-radius: 999px;
  background: rgba(255,255,255,0.96);
  color: var(--ink-900, #111827);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: background 0.12s, transform 0.12s;
  z-index: 3;  /* above the <img> (z:1 in cp-actor-thumb stack) */
  pointer-events: auto;
}
.cp-actor-voice-badge svg { width: 14px; height: 14px; }
.cp-actor-voice-badge:hover {
  background: var(--green-500, #22c55e);
  color: #fff;
  transform: scale(1.08);
}
.cp-actor-voice-badge:active {
  transform: scale(0.96);
}
.cp-actor-meta {
  padding: 10px 12px 12px;
}
.cp-actor-name {
  display: flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 700;
  color: var(--ink-1000);
  white-space: nowrap; overflow: hidden;
}
.cp-actor-name > span:first-child {
  overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
/* Inline voice icon — pure ghost icon. No background, no border, no
   button chrome at all. Just the Volume2 glyph in muted ink, sitting
   right of the AI badge. Color shifts on hover; no scale, no box. */
.cp-actor-voice-inline {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  width: auto; height: auto;
  border: none !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  color: var(--ink-500, #6b7280);
  cursor: pointer;
  padding: 2px;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  transition: color 0.12s;
}
.cp-actor-voice-inline:hover {
  background: transparent !important;
  color: var(--green-600, #16a34a);
}
.cp-actor-voice-inline:focus,
.cp-actor-voice-inline:focus-visible {
  outline: none;
  background: transparent !important;
  box-shadow: none !important;
}
.cp-actor-badge {
  font-size: 9.5px; font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--ink-100);
  color: var(--ink-600);
  letter-spacing: 0.04em;
}
/* Clean subtle text — looks like a label, not a chunky button. Still
   clickable (cursor:pointer + subtle hover). The visual play affordance
   is the speaker badge on the photo. */
.cp-actor-voice {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px;
  color: var(--ink-500, #6b7280);
  background: transparent;
  border: none;
  padding: 0;
  margin-top: 3px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.12s;
}
.cp-actor-voice:hover {
  color: var(--green-700, #15803d);
}

@media (max-width: 1080px) {
  .cp-actor-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 880px) {
  .cp-actor-layout { flex-direction: column; }
  .cp-actor-rail { flex: none; }
  .cp-actor-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
/* Step 3 wrapper — flex column that fills the panel so the grid can scroll. */
.wiz-step-coded {
  display: flex; flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  gap: 14px;
}
/* Loading skeletons — shown until creators API resolves. */
.cp-actor-card.cp-skeleton {
  cursor: default;
  border-color: var(--hairline);
  pointer-events: none;
}
.cp-actor-card.cp-skeleton:hover { transform: none; border-color: var(--hairline); }
.cp-skeleton-thumb {
  aspect-ratio: 3 / 4;
  background: linear-gradient(
    90deg,
    var(--ink-100, #f3f4f6) 0%,
    var(--ink-200, #e5e7eb) 50%,
    var(--ink-100, #f3f4f6) 100%
  );
  background-size: 200% 100%;
  animation: cp-skeleton-shimmer 1.4s ease-in-out infinite;
}
.cp-skeleton-line {
  height: 11px;
  width: 70%;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    var(--ink-100, #f3f4f6) 0%,
    var(--ink-200, #e5e7eb) 50%,
    var(--ink-100, #f3f4f6) 100%
  );
  background-size: 200% 100%;
  animation: cp-skeleton-shimmer 1.4s ease-in-out infinite;
  margin: 4px 0 6px;
}
@keyframes cp-skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/* Step 2 (Pick a format) layout — fills the panel; footer pinned to
   the bottom via margin-top:auto on .canon-wiz-foot. */
.wiz-step-format {
  display: flex; flex-direction: column;
  flex: 1; min-height: 0;
  overflow: hidden;
  gap: 10px;
}
.wiz-step-format .canon-wiz-head {
  flex-shrink: 0;
}
.wiz-step-format .wz-fgrid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  padding-bottom: 4px;
}
.wiz-step-format .canon-wiz-foot {
  flex-shrink: 0;
  margin-top: 0;
}
/* Step 3 already has .wiz-step-coded with flex:1 layout (line 9147);
   ensure its footer also pins to the bottom. */
.wiz-step-coded .canon-wiz-foot {
  margin-top: auto;
}
/* Step 2 + Step 3 header row — title left, close button right. */
.canon-wiz-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.canon-wiz-head .canon-wiz-h { margin: 0; flex: 1; }
.canon-wiz-close-btn {
  width: 32px; height: 32px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--bg-surface, #fff);
  color: var(--ink-700, #374151);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.canon-wiz-close-btn:hover {
  background: var(--ink-100, #f3f4f6);
  border-color: var(--ink-300);
  color: var(--ink-900);
}
/* === end Pick-an-actor === */

/* ============================================================
   CreateAiActorPanel form polish — 2026-06-15
   The panel uses generic <label>/<select>/<textarea>/<input> tags;
   styled them in canon DS treatment so the form looks intentional
   inside the wizard panel.
   ============================================================ */
/* Section headings */
.wiz-step-coded h3,
.wiz-step-coded h4 {
  font-family: var(--font-display, Outfit, sans-serif);
  font-size: 15px; font-weight: 700;
  color: var(--ink-1000, #0b0b0f);
  margin: 18px 0 10px;
  letter-spacing: -0.01em;
}
/* Field group spacing */
.wiz-step-coded label {
  display: block;
  font-size: 12.5px; font-weight: 500;
  color: var(--ink-500, #6b7280);
  margin: 10px 0 6px;
}
/* Inputs / selects / textareas — canon pill-ish chrome */
.wiz-step-coded input[type="text"],
.wiz-step-coded input[type="email"],
.wiz-step-coded select,
.wiz-step-coded textarea {
  width: 100%;
  border: 1px solid var(--hairline, rgba(0,0,0,0.08));
  border-radius: 10px;
  background: var(--bg-surface, #fff);
  color: var(--ink-1000, #0b0b0f);
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  appearance: none;
  -webkit-appearance: none;
}
.wiz-step-coded textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.wiz-step-coded input:focus,
.wiz-step-coded select:focus,
.wiz-step-coded textarea:focus {
  border-color: var(--green-500, #22c55e);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-500, #22c55e) 14%, transparent);
}
/* Custom chevron on selects (since appearance:none removes native) */
.wiz-step-coded select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 36px;
  cursor: pointer;
}
/* Persona grid: two cols on rows that have two fields side-by-side.
   The CreateAiActorPanel uses a plain wrapper for these — give a two-col
   grid wherever a sibling pair appears via the existing class hooks. */
.wiz-step-coded .grid2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
/* Helper text under inputs */
.wiz-step-coded .help,
.wiz-step-coded .input-help,
.wiz-step-coded p.small {
  font-size: 11.5px;
  color: var(--ink-500, #6b7280);
  margin: 4px 0 0;
}
/* Consent block — give it a soft canvas */
.wiz-step-coded .consent-block {
  background: var(--bg-soft, #f7f8fa);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 18px;
}
/* === end CreateAiActorPanel polish === */

/* ============================================================
   Nested "Create actor" popup — sits ON TOP of the wizard overlay
   (z:1100 > wizard's z:1000). Smaller card so the form reads as
   a focused dialog instead of stretching across the wizard panel.
   ============================================================ */
.cp-create-scrim {
  position: fixed; inset: 0;
  z-index: 1100;
  background: rgba(0,0,0,0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  overflow: auto;
}
.cp-create-card {
  position: relative;
  width: min(620px, 92vw);
  max-height: 90dvh;
  background: var(--bg-surface, #fff);
  border: 1px solid var(--hairline, rgba(0,0,0,0.08));
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.28);
  padding: 28px 28px 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cp-create-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--bg-surface, #fff);
  color: var(--ink-700, #374151);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.12s, border-color 0.12s;
  z-index: 1;
}
.cp-create-close:hover {
  background: var(--ink-100, #f3f4f6);
  border-color: var(--ink-300);
}
/* The form inside the nested card uses the same .wiz-step-coded scoped
   styles already defined above (since CreateAiActorPanel renders inside).
   Re-scope by adding the same selectors here so plain labels/inputs in
   the popup get the canon treatment even without .wiz-step-coded ancestor. */
.cp-create-card h3,
.cp-create-card h4 {
  font-family: var(--font-display, Outfit, sans-serif);
  font-size: 15px; font-weight: 700;
  color: var(--ink-1000, #0b0b0f);
  margin: 18px 0 10px;
  letter-spacing: -0.01em;
}
.cp-create-card label {
  display: block;
  font-size: 12.5px; font-weight: 500;
  color: var(--ink-500, #6b7280);
  margin: 10px 0 6px;
}
.cp-create-card input[type="text"],
.cp-create-card input[type="email"],
.cp-create-card select,
.cp-create-card textarea {
  width: 100%;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--bg-surface, #fff);
  color: var(--ink-1000, #0b0b0f);
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  appearance: none;
  -webkit-appearance: none;
}
.cp-create-card textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.cp-create-card input:focus,
.cp-create-card select:focus,
.cp-create-card textarea:focus {
  border-color: var(--green-500, #22c55e);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-500, #22c55e) 14%, transparent);
}
.cp-create-card select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 36px;
  cursor: pointer;
}
/* === end nested Create-actor popup === */

/* ============================================================
   Canon full-page Generating view — replaces the small portal
   overlay with a sidebar (inputs summary) + main (phone + ring +
   notify/leave bar) layout matching canon Image #53.
   ============================================================ */
.canon-gen-shell {
  width: 100vw; height: 100vh;
  background: var(--bg-soft, #f7f8fa);
  display: grid;
  grid-template-columns: 320px 1fr;
  position: relative;
}
.canon-gen-sidebar {
  background: var(--bg-surface, #fff);
  border-right: 1px solid var(--hairline);
  padding: 28px 22px;
  display: flex; flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}
.canon-gen-projhead {
  font-family: var(--font-display, Outfit, sans-serif);
  font-weight: 800; font-size: 18px;
  color: var(--ink-1000);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.canon-gen-progress-bar {
  position: relative;
  height: 6px; border-radius: 999px;
  background: var(--ink-100, #f3f4f6);
  overflow: visible;
}
.canon-gen-progress-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 100%;
  background: var(--green-500, #22c55e);
  border-radius: 999px;
}
.canon-gen-progress-label {
  position: absolute; right: 0; top: -22px;
  font-size: 12px; font-weight: 600;
  color: var(--ink-700);
}
.canon-gen-items {
  display: flex; flex-direction: column;
  gap: 4px;
  margin-top: 12px;
}
.canon-gen-item {
  display: flex; align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--green-500, #22c55e) 6%, transparent);
  cursor: pointer;
  transition: background 0.12s;
}
.canon-gen-item:hover {
  background: color-mix(in srgb, var(--green-500, #22c55e) 10%, transparent);
}
.canon-gen-item-more {
  background: var(--ink-100, #f3f4f6);
}
.canon-gen-item-more:hover {
  background: var(--ink-200, #e5e7eb);
}
.canon-gen-item-check,
.canon-gen-item-icon {
  width: 22px; height: 22px; border-radius: 999px;
  background: var(--green-500, #22c55e);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.canon-gen-item-more .canon-gen-item-icon {
  background: var(--bg-surface);
  color: var(--ink-700);
  border: 1px solid var(--hairline);
}
.canon-gen-item-body {
  flex: 1; min-width: 0;
}
.canon-gen-item-name {
  font-size: 14px; font-weight: 700;
  color: var(--ink-1000);
  margin-bottom: 2px;
}
.canon-gen-item-value {
  font-size: 12.5px; color: var(--ink-500);
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.canon-gen-item-more .canon-gen-item-value { white-space: normal; line-height: 1.4; }

.canon-gen-main {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px;
  position: relative;
  overflow: hidden;
}
.canon-gen-banner {
  position: absolute; top: 18px; left: 20px;
  font-size: 13px; font-weight: 600;
  color: var(--ink-700);
  display: inline-flex; align-items: center; gap: 8px;
}
.canon-gen-banner-dot {
  width: 10px; height: 10px; border-radius: 999px;
  background: var(--green-500, #22c55e);
  animation: canon-gen-pulse 1.6s ease-in-out infinite;
}
@keyframes canon-gen-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.8); }
}
.canon-gh-frame-large {
  width: min(280px, 30vw);
  aspect-ratio: 9 / 16;
  margin: 0 auto 24px;
  position: relative;
}
.canon-gh-frame-large .canon-gh-time {
  position: absolute; top: 14px; right: 14px;
  font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,0.92);
  background: rgba(0,0,0,0.4);
  padding: 3px 9px;
  border-radius: 999px;
}
.canon-gh-stepdots {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600;
  color: var(--ink-700);
  margin-bottom: 18px;
}
.canon-gh-stepdots .dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--ink-200, #e5e7eb);
  display: inline-block;
}
.canon-gh-stepdots .dot.on {
  width: 22px; background: var(--green-500, #22c55e);
}
.canon-gh-ring-large {
  width: 64px; height: 64px;
  position: relative;
  margin-bottom: 10px;
  display: inline-flex; align-items: center; justify-content: center;
}
.canon-gh-ring-large svg { width: 100%; height: 100%; }
.canon-gh-ring-large .canon-gh-num {
  position: absolute;
  font-size: 18px; font-weight: 700;
  color: var(--ink-1000);
}
.canon-gen-main .canon-gh-line {
  font-family: var(--font-display, Outfit, sans-serif);
  font-size: 26px; font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-1000);
  margin-bottom: 4px;
}
.canon-gen-main .canon-gh-sub {
  font-size: 14px; color: var(--ink-500);
  margin-bottom: 30px;
}
.canon-gen-bgbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  font-size: 13px; color: var(--ink-700);
  max-width: 720px; width: 100%;
  box-shadow: var(--shadow-sm, 0 4px 12px rgba(0,0,0,0.06));
}
.canon-gen-bgbar .spacer { flex: 1; }
.canon-gen-bgbar-icon {
  width: 32px; height: 32px; border-radius: 999px;
  background: var(--ink-100); color: var(--ink-700);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.canon-gen-bgbar-text { flex: 1; line-height: 1.45; }

@media (max-width: 900px) {
  .canon-gen-shell { grid-template-columns: 1fr; }
  .canon-gen-sidebar { display: none; }
}
/* Center the play badge on the .vc card thumb (was bottom-right per
   canon defaults; moving to center for stronger visual affordance). */
.vc .vthumb .playbadge {
  right: auto;
  bottom: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.92);
  color: #111;
  box-shadow: 0 6px 18px rgba(0,0,0,0.28);
}
.vc .vthumb .playbadge svg {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}
.vc:hover .vthumb .playbadge {
  transform: translate(-50%, -50%) scale(1.06);
}
/* The .th-a..e canon gradients are dark — applied to the whole .vc
   card. That bled into .vfoot (the footer area below the thumb), giving
   a dark band even in light theme. Force .vfoot to use the surface bg
   regardless of the parent's .th-* gradient. */
.vc .vfoot {
  background: var(--bg-surface, #fff);
  color: var(--ink-1000);
  border-top: 1px solid var(--hairline);
}
[data-theme="dark"] .vc .vfoot {
  background: var(--bg-elevated, #161620);
  color: var(--ink-100);
}
/* Portal wrapper — full-viewport, on top of everything. */
.canon-gen-portal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: var(--bg-soft, #f7f8fa);
}
/* ============================================================
   Custom in-app confirmation dialog — replaces native window.confirm
   ============================================================ */
.confirm-scrim {
  position: fixed; inset: 0;
  z-index: 1200;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.confirm-card {
  width: min(440px, 92vw);
  background: var(--bg-surface, #fff);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.28);
  padding: 24px 26px 20px;
}
.confirm-title {
  font-family: var(--font-display, Outfit, sans-serif);
  font-size: 18px; font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink-1000);
  margin-bottom: 10px;
}
.confirm-body {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-700);
  margin-bottom: 20px;
}
.confirm-body b { color: var(--ink-1000); font-weight: 700; }
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
/* === end confirm === */

/* ============================================================
   Theme segmented toggle — pill with Light / Dark side-by-side.
   One source of truth for the whole site (TopBar + auth corner +
   /actors header + anywhere ThemeToggle is mounted).
   ============================================================ */
.theme-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--ink-100, #f3f4f6);
  border: 1px solid var(--hairline);
}
.theme-seg-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-500, #6b7280);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
.theme-seg-btn:hover { color: var(--ink-800, #1f2937); }
.theme-seg-btn.on {
  background: var(--bg-surface, #fff);
  color: var(--ink-1000, #0b0b0f);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
[data-theme="dark"] .theme-seg {
  background: var(--bg-elevated, rgba(255,255,255,0.05));
}
[data-theme="dark"] .theme-seg-btn.on {
  background: var(--ink-200, rgba(255,255,255,0.12));
  color: var(--ink-100, #f3f4f6);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
/* === end theme segmented toggle === */

/* ============================================================
   Clerk overrides — hide the "Last used" badge on social auth
   buttons. Clerk remembers the prior method via cookie/localStorage
   and surfaces it as a hint; for our minimal-chrome aesthetic it's
   visual noise on the sign-in card.
   ============================================================ */
.cl-internalSocialButtons__lastUsedHint,
.cl-internalSocialButtonsBlockButton__lastAuthenticationStrategy,
[data-clerk-element="socialButtonsBlockButton__lastUsed"],
[data-clerk-last-used-strategy] {
  display: none !important;
}
/* === end Clerk overrides === */

/* ============================================================
   /actors loading + empty states
   ============================================================ */
.actors-empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--ink-500);
  border: 1.5px dashed var(--hairline);
  border-radius: 16px;
  background: var(--bg-soft, #f7f8fa);
}
.actors-empty b { display: block; font-size: 16px; color: var(--ink-1000); margin-bottom: 6px; }
.actors-empty div { font-size: 13.5px; line-height: 1.5; }
.actors-empty-cta {
  margin-top: 18px;
  display: inline-flex; align-items: center; gap: 6px;
}

/* Skeleton card — same outline as .acard so the layout doesn't jump. */
.acard.sk-card {
  cursor: default;
  pointer-events: none;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-surface);
}
.sk-face {
  aspect-ratio: 3 / 4;
  background: linear-gradient(
    90deg,
    var(--ink-100, #f3f4f6) 0%,
    var(--ink-200, #e5e7eb) 50%,
    var(--ink-100, #f3f4f6) 100%
  );
  background-size: 200% 100%;
  animation: actors-sk-shimmer 1.4s ease-in-out infinite;
}
.sk-meta { padding: 10px 12px 12px; }
.sk-name, .sk-badge {
  height: 11px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    var(--ink-100, #f3f4f6) 0%,
    var(--ink-200, #e5e7eb) 50%,
    var(--ink-100, #f3f4f6) 100%
  );
  background-size: 200% 100%;
  animation: actors-sk-shimmer 1.4s ease-in-out infinite;
}
.sk-name { width: 60%; margin-bottom: 6px; }
.sk-badge { width: 30%; height: 9px; }
@keyframes actors-sk-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/* === end /actors states === */

/* ============================================================
   Shared Add-an-actor chooser popup (used by /actors + briefs/new).
   Sits inside .cp-create-card; .add-actor-card lets us tune size.
   ============================================================ */
.add-actor-card { padding: 32px 30px 30px; }
.add-actor-title {
  font-family: var(--font-display, Outfit, sans-serif);
  font-size: 22px; font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--ink-1000);
}
.add-actor-sub {
  font-size: 13.5px;
  color: var(--ink-500);
  line-height: 1.5;
  margin: 0 0 22px;
}
.add-actor-section {
  font-family: var(--font-mono, monospace);
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-500);
  margin: 4px 0 10px;
}
.add-actor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.add-actor-card-tile {
  display: flex; flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 20px 18px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--bg-surface, #fff);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.12s, box-shadow 0.12s;
}
.add-actor-card-tile:hover {
  border-color: var(--green-500, #22c55e);
  background: var(--green-50, #ecfdf5);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(34,197,94,0.10);
}
.add-actor-tile-ic {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--green-100, #d1fae5);
  color: var(--green-700, #15803d);
  display: inline-flex; align-items: center; justify-content: center;
}
.add-actor-tile-nm {
  font-size: 15px; font-weight: 700;
  color: var(--ink-1000);
  letter-spacing: -0.01em;
}
.add-actor-tile-ds {
  font-size: 12.5px;
  color: var(--ink-500);
  line-height: 1.5;
}
[data-theme="dark"] .add-actor-card-tile:hover {
  background: rgba(34, 197, 94, 0.08);
  border-color: var(--green-500);
}
[data-theme="dark"] .add-actor-tile-ic {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green-500);
}
@media (max-width: 560px) {
  .add-actor-grid { grid-template-columns: 1fr; }
}
/* === end add-actor chooser === */

/* === end canon Generating === */

/* ═══════════════════════════════════════════════════════════════════
   URL → Ad v2 workspace
   3-column workspace: thin canon rail (Shell) · middle 5-step sidebar
   (Product · Format · Actor · Seconds · Quality) · right "Your videos" feed.
   Imported verbatim-in-spirit from design/canon/url-to-ad-v2.html (x-v2).
   ═══════════════════════════════════════════════════════════════════ */

/* The page fills the .main height; the v2 grid is the workspace body.
   FIX: the v2 view is a flex column so the 58px header stays fixed and the
   workspace body fills the REST of the viewport. Previously .view was a
   block scroll container and .v2wrap took height:100% (the full view height)
   ON TOP of the header — making the page one header-height too tall and
   pushing the pinned "HexCode it" button below the fold. */
.view.on.view-v2 { display: flex; flex-direction: column; overflow: hidden; }
.view-v2 .v2wrap { height: auto; flex: 1 1 auto; min-height: 0; }
.v2wrap { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.v2feed { display: grid; grid-template-columns: 332px minmax(0, 1fr); flex: 1; min-width: 0; min-height: 0; overflow: hidden; }
@media (max-width: 760px) { .v2feed { grid-template-columns: 1fr; overflow: auto; } }

/* middle sidebar — the 5 steps + Generate */
.v2-side { display: flex; flex-direction: column; border-right: 1px solid var(--hairline); background: var(--bg-surface); min-height: 0; overflow: hidden; }
.v2-side-scroll { flex: 1; overflow: auto; padding: 16px 12px 12px; }
.v2-side-h { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-400); padding: 2px 12px 10px; }
.v2step { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 12px; border: none; background: none; border-radius: var(--r-md); cursor: pointer; text-align: left; font-family: inherit; transition: background var(--d-fast); }
.v2step:hover { background: color-mix(in srgb, var(--ink-1000) 4%, transparent); }
.v2step .ic { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--ink-300); color: var(--ink-500); font-size: 12px; font-weight: 700; }
.v2step.set .ic { border-color: var(--green-500); background: var(--green-50); color: var(--green-700); }
.v2step .ic svg { width: 14px; height: 14px; }
.v2step .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.v2step .nm { font-size: 13.5px; font-weight: 600; color: var(--ink-1000); }
.v2step .vl { font-size: 11.5px; color: var(--ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2step.set .vl { color: var(--ink-700); }
.v2step .ch { flex-shrink: 0; color: var(--ink-300); display: flex; }
.v2step .ch svg { width: 16px; height: 16px; }
.v2setblock { margin: 10px 12px 4px; padding: 15px 0 2px; border-top: 1px solid var(--hairline); }
.v2setrow { margin-bottom: 16px; }
.v2setrow:last-child { margin-bottom: 4px; }
.v2setrow .k { display: flex; align-items: center; justify-content: space-between; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-400); margin-bottom: 9px; }
.v2setrow .k b { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--ink-1000); letter-spacing: 0; }
.v2setrow .k .v2ar { font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-400); }
.v2setrow input[type=range] { width: 100%; accent-color: var(--green-500); }
.v2-seg { display: flex; gap: 6px; }
.v2-seg button { flex: 1; height: 32px; border: 1px solid var(--hairline-strong); border-radius: var(--r-sm); background: var(--bg-surface); font-family: var(--font-body); font-size: 11.5px; font-weight: 700; color: var(--ink-600); cursor: pointer; transition: all var(--d-fast); }
.v2-seg button:hover:not(.dis) { border-color: var(--green-400); }
.v2-seg button.on { border-color: var(--green-500); background: var(--green-50); color: var(--green-700); }
.v2-seg button.dis { opacity: .45; cursor: not-allowed; }

/* v2 popup Length+Quality footer chip (canon .qchip, ADR-0079a) — a compact
   popover that replaces the rejected full-width strip. Reuses .v2-seg inside. */
.qwrap { position: relative; display: inline-flex; }
.qchip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border: 1px solid var(--hairline-strong); border-radius: var(--r-pill); background: var(--bg-surface); font-size: 12px; font-weight: 600; color: var(--ink-700); cursor: pointer; transition: border-color var(--d-fast), color var(--d-fast); }
.qchip:hover { border-color: var(--green-400); color: var(--green-700); }
.qchip > svg { width: 14px; height: 14px; color: var(--ink-400); }
.qchip .v { font-family: var(--font-mono); font-weight: 700; color: var(--ink-1000); }
.qchip .cv { display: inline-flex; }
.qchip .cv svg { width: 15px; height: 15px; color: var(--ink-400); transition: transform var(--d-fast); }
.qwrap.open .cv svg { transform: rotate(180deg); }
.qpop { position: absolute; bottom: calc(100% + 9px); left: 0; width: 258px; background: var(--bg-surface); border: 1px solid var(--hairline-strong); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 14px 15px; z-index: 60; display: none; }
.qwrap.open .qpop { display: block; }
.qrow { margin-bottom: 14px; }
.qrow:last-of-type { margin-bottom: 6px; }
.qk { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-400); margin-bottom: 9px; display: flex; justify-content: space-between; }
.qk b { font-family: var(--font-mono); font-size: 12px; color: var(--ink-1000); letter-spacing: 0; }
.qar { font-family: var(--font-mono); font-size: 11px; color: var(--ink-400); letter-spacing: 0; }
.qlen input[type=range] { width: 100%; accent-color: var(--green-500); }
.qnote { font-size: 10px; color: var(--ink-400); line-height: 1.5; margin-top: 9px; }
.qseg { display: flex; gap: 6px; }
.qseg button { flex: 1; height: 32px; border: 1px solid var(--hairline-strong); border-radius: 8px; background: var(--bg-surface); font-family: var(--font-body); font-size: 11.5px; font-weight: 700; color: var(--ink-600); cursor: pointer; transition: all var(--d-fast); }
.qseg button:hover:not(.dis) { border-color: var(--green-400); }
.qseg button.on { border-color: var(--green-500); background: var(--green-50); color: var(--green-700); }
.qseg button.dis { opacity: .45; cursor: not-allowed; }
.v2-side-foot { padding: 13px 14px 16px; border-top: 1px solid var(--hairline); }
.v2-gen { width: 100%; justify-content: center; }
.v2-gencred { text-align: center; font-size: 11px; color: var(--ink-500); margin-top: 8px; }
.v2-gencred b { font-family: var(--font-mono); font-weight: 600; color: var(--ink-700); }
.v2-gen[disabled] { opacity: .55; cursor: not-allowed; }

/* right "Your videos" column */
.v2-videos { overflow: auto; background: var(--bg-canvas); min-width: 0; padding: 28px 30px 60px; }
.v2feed-head { margin-bottom: 20px; }
.v2feed-h-t { font-family: var(--font-display); font-size: 21px; font-weight: 800; letter-spacing: -.02em; color: var(--ink-1000); }
.v2feed-h-s { font-size: 13px; color: var(--ink-500); margin-top: 3px; }
.v2feed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(186px, 1fr)); gap: 16px; }
.v2card { position: relative; aspect-ratio: 9/16; border-radius: 16px; overflow: hidden; border: 1px solid var(--hairline-strong); background: var(--media-well); cursor: pointer; padding: 0; display: block; text-align: left; min-width: 0; transition: box-shadow var(--d-base), transform var(--d-base); }
.v2card.ready:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.v2card video, .v2card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.v2card.new { border: 1.5px dashed var(--green-500); background: var(--green-50); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; }
.v2card.new:hover { background: color-mix(in srgb, var(--green-500) 13%, var(--bg-surface)); }
[data-theme="dark"] .v2card.new { background: color-mix(in srgb, var(--green-500) 11%, var(--bg-surface)); }
.v2new-ic { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--green-400), var(--green-600)); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-green-soft); }
.v2new-ic svg { width: 23px; height: 23px; }
.v2new-t { font-size: 14.5px; font-weight: 800; color: var(--ink-1000); }
.v2new-s { font-size: 11px; color: var(--ink-500); max-width: 84%; text-align: center; line-height: 1.4; }
.v2card.rendering { background: linear-gradient(162deg, #15281c, #0d1812); display: flex; align-items: center; justify-content: center; cursor: default; border-color: var(--hairline); }
.v2card.failed { background: var(--bg-soft); display: flex; align-items: center; justify-content: center; cursor: default; border-color: var(--hairline-strong); }
.v2rend { display: flex; flex-direction: column; align-items: center; gap: 13px; text-align: center; padding: 0 16px; }
.v2spin { width: 32px; height: 32px; border-radius: 50%; border: 3px solid rgba(255,255,255,.16); border-top-color: #5fe49a; animation: v2rot .9s linear infinite; }
@keyframes v2rot { to { transform: rotate(360deg); } }
.v2rt { font-size: 12.5px; font-weight: 700; color: #d6f2e2; }
.v2rs { font-size: 10.5px; color: #86b59a; line-height: 1.4; }
.v2fail { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 0 16px; color: var(--ink-600); }
.v2fail svg { width: 24px; height: 24px; color: var(--warn-ink, #b45309); }
.v2fail .ft { font-size: 12.5px; font-weight: 700; color: var(--ink-900); }
.v2fail .fs { font-size: 10.5px; color: var(--ink-500); line-height: 1.4; }
.v2play { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) scale(.9); width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center; opacity: 0; transition: all var(--d-fast); box-shadow: var(--shadow-md); z-index: 2; }
.v2play svg { width: 17px; height: 17px; color: #111; margin-left: 2px; }
.v2card.ready:hover .v2play { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.v2done { position: absolute; top: 9px; left: 9px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; font-size: 9px; font-weight: 800; letter-spacing: .02em; color: #fff; background: var(--green-500); padding: 3px 8px; border-radius: 99px; }
.v2done svg { width: 10px; height: 10px; }
.v2meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 12px 11px; background: linear-gradient(transparent, rgba(0,0,0,.8)); z-index: 2; }
.v2mn { display: block; font-size: 12.5px; font-weight: 700; color: #fff; }
.v2ms { display: block; font-size: 10.5px; color: rgba(255,255,255,.82); margin-top: 1px; line-height: 1.35; }

/* v2 popup — product / format / actor pickers (reuses the cp-create scrim) */
.v2pop-urlrow { display: flex; flex-direction: column; gap: 7px; }
.v2pop-saved { margin-top: 18px; }
.v2pop-saved-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 10px; }
.v2prod { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); overflow: hidden; cursor: pointer; text-align: left; padding: 0; transition: border-color var(--d-fast), box-shadow var(--d-fast); }
.v2prod:hover { border-color: var(--green-400); box-shadow: var(--shadow-sm); }
.v2prod.on { border-color: var(--green-500); box-shadow: 0 0 0 1px var(--green-500); }
.v2prod-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: var(--media-well); display: block; }
.v2prod-tx { padding: 8px 10px; }
.v2prod-nm { font-size: 12px; font-weight: 700; color: var(--ink-1000); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2prod-dm { font-size: 10.5px; color: var(--ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.v2fmt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.v2fmt { display: flex; flex-direction: column; gap: 3px; padding: 14px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); cursor: pointer; text-align: left; transition: border-color var(--d-fast), background var(--d-fast); }
.v2fmt:hover { border-color: var(--green-400); }
.v2fmt.on { border-color: var(--green-500); background: var(--green-50); }
.v2fmt-nm { font-size: 13.5px; font-weight: 700; color: var(--ink-1000); }
.v2fmt-sub { font-size: 11px; color: var(--ink-500); line-height: 1.4; }

.v2actor-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.v2actor-tab { height: 30px; padding: 0 13px; border-radius: var(--r-pill); border: 1px solid var(--hairline-strong); background: var(--bg-surface); font-size: 12px; font-weight: 600; color: var(--ink-600); cursor: pointer; transition: all var(--d-fast); }
.v2actor-tab.on { border-color: var(--green-500); background: var(--green-50); color: var(--green-700); }
/* Actor picker — canon casting rows (.cast2-row): avatar · who · lang · check. */
.v2actor-list { display: flex; flex-direction: column; gap: 8px; }
.v2actor-row { display: grid; grid-template-columns: 44px minmax(0,1fr) auto 22px; align-items: center; gap: 12px; padding: 9px 13px; border: 1px solid var(--hairline-strong); border-radius: var(--r-lg); background: var(--bg-surface); cursor: pointer; width: 100%; text-align: left; transition: border-color var(--d-fast), box-shadow var(--d-fast), background var(--d-fast); }
.v2actor-row:hover { border-color: var(--green-400); }
.v2actor-row.on { border-color: var(--green-500); box-shadow: 0 0 0 1px var(--green-500); background: var(--green-50); }
.v2ar-av { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--bg-soft); box-shadow: 0 0 0 1px var(--hairline) inset; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-400); }
.v2ar-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.v2ar-who { min-width: 0; }
.v2ar-nm { display: block; font-size: 13px; font-weight: 700; color: var(--ink-1000); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2ar-vibe { display: block; font-size: 11px; color: var(--ink-500); margin-top: 2px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2ar-lang { font-size: 10px; font-weight: 600; color: var(--ink-600); background: var(--ink-100); padding: 4px 9px; border-radius: var(--r-pill); white-space: nowrap; }
[data-theme="dark"] .v2ar-lang { background: var(--bg-elevated); }
.v2ar-check { width: 20px; height: 20px; border-radius: 50%; background: var(--green-500); color: #fff; display: none; align-items: center; justify-content: center; flex-shrink: 0; }
.v2actor-row.on .v2ar-check { display: inline-flex; }

/* Format poster tiles (Q4 / ADR-0080) — gradient placeholder until real art. */
.v2fmt { padding: 10px; gap: 6px; }
.v2fmt-poster { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: var(--bg-soft); }
.v2fmt-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Actor poster grid (Q6 / ADR-0080) — the two modes stay as rows, the actors
   render as a face-forward card grid. */
.v2actor-modes { display: flex; flex-direction: column; gap: 8px; }
.v2actor-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.v2actor-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); cursor: pointer; text-align: left; transition: border-color var(--d-fast), box-shadow var(--d-fast); }
.v2actor-card:hover { border-color: var(--green-400); }
.v2actor-card.on { border-color: var(--green-500); box-shadow: 0 0 0 1px var(--green-500); }
.v2ac-face { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 3 / 4; border-radius: 7px; overflow: hidden; background: var(--bg-soft); color: var(--ink-400); }
.v2ac-face img { width: 100%; height: 100%; object-fit: cover; }
.v2ac-nm { font-size: 12px; font-weight: 700; color: var(--ink-1000); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2ac-lang { font-size: 10px; color: var(--ink-500); }
.v2ac-check { position: absolute; top: 7px; right: 7px; width: 18px; height: 18px; border-radius: 50%; background: var(--green-500); color: #fff; display: none; align-items: center; justify-content: center; }
.v2actor-card.on .v2ac-check { display: inline-flex; }
.v2actor-card.add .v2ac-face { border: 1px dashed var(--hairline-strong); background: transparent; }
.v2actor-addrow { display: grid; grid-template-columns: 44px minmax(0,1fr); align-items: center; gap: 12px; padding: 9px 13px; border: 1.5px dashed var(--green-400); border-radius: var(--r-lg); background: var(--green-50); cursor: pointer; width: 100%; text-align: left; }
.v2actor-addrow .v2ar-av.addic { background: transparent; box-shadow: none; color: var(--green-700); }
.v2actor-addrow .v2ar-nm { color: var(--green-700); }

/* v2 popup scroll body — bound height so long grids scroll inside the card */
.v2pop-body { max-height: 60vh; overflow-y: auto; margin: 4px -4px 0; padding: 0 4px; }

/* Cancel-pending banner shown on Settings → Billing when the sub has a
   period_end cancellation scheduled. */
.cancel-pending-banner {
  margin-top: 8px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--amber, #f59e0b) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--amber, #f59e0b) 32%, transparent);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink-700);
  line-height: 1.5;
}
.cancel-pending-banner b { color: var(--ink-1000); font-weight: 700; }

/* .tag.warn variant for the "Cancelling" state chip on the plan card. */
.tag.warn {
  background: color-mix(in srgb, var(--amber, #f59e0b) 18%, transparent);
  color: color-mix(in srgb, var(--amber, #f59e0b) 90%, var(--ink-1000));
}

/* Credits pill in its 0-balance "Subscribe" state — links to /pricing (TopBar). */
.credits-sub { cursor: pointer; gap: 5px; transition: box-shadow var(--d-fast), transform var(--d-fast); }
.credits-sub:hover { box-shadow: var(--shadow-green-soft); transform: translateY(-1px); }
.credits-sub .sub-word { font-weight: 700; color: var(--green-800); }

/* Utility spinner class used by inline "Redirecting…" states on CTAs.
   Piggybacks on the existing `spin` keyframes defined below. */
.animate-spin { animation: spin 1s linear infinite; }

/* === Video feed card play overlay === */
.vfc-play-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.vfc-play-overlay:hover { background: rgba(0,0,0,0.3); }
.vfc-play-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.92);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.vfc-play-overlay:hover .vfc-play-btn { opacity: 1; }
@keyframes vfc-spin { to { transform: rotate(360deg); } }

/* === Shared empty state === */
.pg-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  gap: 12px;
  min-height: 320px;
}
.pg-empty-icon {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: var(--ink-100);
  color: var(--ink-400);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.pg-empty-h {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.01em;
}
.pg-empty-s {
  font-size: 13.5px;
  color: var(--ink-500);
  max-width: 340px;
  line-height: 1.55;
  margin-bottom: 4px;
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE LAYOUT — mobile-first breakpoints
   Mobile  : max-width 768px
   Tablet  : 769px – 1024px
   Desktop : 1025px+ (existing layout, no overrides needed)
   ══════════════════════════════════════════════════════════════════ */

/* ── Hamburger button — only visible on mobile ── */
.rail-hamburger {
  display: none;
  position: fixed;
  top: 9px;
  left: 12px;
  z-index: 110;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--ink-700);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background var(--d-fast), color var(--d-fast);
}
.rail-hamburger:hover { background: var(--hover-surface); color: var(--ink-1000); }

/* ── Backdrop for mobile nav overlay ── */
.rail-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  /* Above the URL→AD wizard overlay (z:1000) so the mobile nav always wins
     when both are open — was 90, which left the rail dimmed behind the
     wizard's translucent scrim. */
  z-index: 1090;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* ════ TABLET (769px – 1024px): full sidebar with labels ════ */
/* On iPad the rail always shows icon + label — same as desktop. */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Keep the expanded 220px rail — no icon-only collapse on tablet */
  .app,
  .app[data-railpin="true"],
  .app[data-railhover="true"] {
    grid-template-columns: 220px 1fr;
  }
  .rail,
  .app[data-railpin="true"] .rail {
    width: 220px;
    padding: 16px 12px;
  }
}

/* ════ MOBILE (max-width 768px): hidden sidebar overlay ════ */
@media (max-width: 768px) {
  /* Show the hamburger button */
  .rail-hamburger { display: inline-flex; }

  /* Show backdrop when nav is open */
  .app[data-mobile-nav="open"] .rail-backdrop { display: block; }

  /* App grid: single column, full width */
  .app,
  .app[data-railpin="true"],
  .app[data-railhover="true"] {
    grid-template-columns: 1fr;
  }

  /* Rail: fixed overlay, off-screen by default
     top:0 + bottom:0 spans full viewport without 100vh/100dvh quirks (iOS-safe).
     !important on background + backdrop-filter:none to neutralise the desktop
     .rail rule's glass background, which was bleeding the page through on
     dark-mode pages with non-default backgrounds (e.g. URL→AD wizard). */
  .rail,
  .app[data-railpin="true"] .rail,
  .app[data-railhover="true"] .rail {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    /* Above the URL→AD wizard portal (z:1000) so mobile nav always sits
     on top — paired with .rail-backdrop z:1090 below the rail. */
    z-index: 1100;
    width: 260px;
    padding: 16px 12px;
    background: var(--bg-surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-right: 1px solid var(--hairline);
    box-shadow: 4px 0 24px rgba(0,0,0,0.25);
    transform: translateX(-100%);
    transition: transform var(--d-base) var(--ease-out);
  }
  /* High-specificity override — guarantees the rail surface wins against
     the desktop .rail glass rule. Sets ONLY bg/filter, never transform. */
  html body .app .rail.rail-mobile-open {
    background: var(--bg-surface) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Open state: slide in — match all pin/hover variants to win specificity */
  .rail.rail-mobile-open,
  .app[data-railpin="true"] .rail.rail-mobile-open,
  .app[data-railhover="true"] .rail.rail-mobile-open {
    transform: translateX(0);
  }

  /* Always show labels in mobile overlay (rail is expanded) */
  .rail.rail-mobile-open .rail-item .rl,
  .app[data-railpin="true"] .rail.rail-mobile-open .rail-item .rl { opacity: 1; max-width: 200px; }
  .rail.rail-mobile-open .rail-tools .tools-lab,
  .app[data-railpin="true"] .rail.rail-mobile-open .rail-tools .tools-lab { opacity: 1; max-width: 200px; }
  .rail.rail-mobile-open .rail-logo .mark { width: 0; opacity: 0; overflow: hidden; }
  .rail.rail-mobile-open .rail-logo .wm { opacity: 1; max-width: 200px; }
  .rail.rail-mobile-open .rail-item,
  .app[data-railpin="true"] .rail.rail-mobile-open .rail-item { justify-content: flex-start; padding: 0 11px; gap: 12px; }
  .rail.rail-mobile-open .rail-logo { justify-content: flex-start; padding-left: 6px; gap: 10px; }
  .rail.rail-mobile-open .rail-tools { margin-top: 14px; padding-top: 0; border-top: none; }

  /* Collapsed rail (not open): hide the rail label artifacts */
  .app:not([data-railpin="true"]) .rail:not(.rail-mobile-open),
  .app[data-railpin="true"] .rail:not(.rail-mobile-open) {
    /* keep the collapsed styles but hide off-screen */
    width: 260px;
  }

  /* Main column: full width, no left offset */
  .main { width: 100%; min-height: 0; }

  /* Header: reduce height slightly on mobile, allow wrapping */
  .hdr {
    height: auto;
    min-height: 58px;
    padding: 0 12px 0 64px; /* 64px left to clear the hamburger */
    flex-wrap: wrap;
    gap: 8px;
  }
  .hdr.is-page { padding-left: 64px; }

  /* Page inner: reduce padding on mobile */
  .page-inner { padding: 16px 14px 40px; }

  /* Library grid: 2 columns on mobile. Use minmax(0, 1fr) so an intrinsic
     video/image width inside a card can't expand the column past 50%
     of the container (the default 1fr resolves to minmax(auto, 1fr),
     which means tracks can grow beyond their share to accommodate
     min-content — that was what made one card wider than the other). */
  .lib-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  /* === Library page: prevent horizontal overflow ===
     Without overflow-x:hidden on the view container, anything wider than
     the viewport (e.g. an oversized grid cell) lets the user scroll the
     whole page sideways, leaving the header text clipped at the left
     edge. */
  .view {
    overflow-x: hidden;
  }
  .page-inner {
    overflow-x: hidden;
    max-width: 100%;
    box-sizing: border-box;
  }
  /* The .page-h flex row's first child holds the title + sub text. Without
     min-width:0 a long .sub paragraph can push the row beyond the
     container width on small phones. */
  .page-h > div { min-width: 0; max-width: 100%; }
  .page-h .sub { max-width: 100%; }

  /* Projects ledger: rows stack nicely already (flex) — just reduce padding */
  .lrow { padding: 10px 4px; gap: 10px; }
  .lrow .lt { width: 44px; height: 30px; }

  /* ── Actors page — mobile ── */

  /* Actors scroll layout: allow natural height on mobile */
  .appscroll { overflow-y: auto; }
  .pageinner { height: auto; display: block; padding: 16px 14px 40px; }

  /* Page header: stack heading and actions, reduce font size */
  .pagehead { flex-wrap: wrap; gap: 10px; }
  .pagehead .ph-t { font-size: 24px; }
  .pagehead .ph-s { font-size: 13px; margin-top: 4px; }
  .pagehead .ph-actions { margin-left: 0; width: 100%; }
  .pagehead .ph-actions .btn { width: 100%; justify-content: center; height: 44px; }

  /* Controls row: search full-width, count inline */
  .controls { flex-wrap: wrap; gap: 10px; margin: 14px 0 12px; }
  .searchbox { width: 100%; }

  /* Actors split layout: stack filter rail above grid */
  .split { display: flex; flex-direction: column; gap: 0; }

  /* Filter column: becomes a compact horizontal chip strip */
  .filtcol {
    overflow-y: visible;
    max-height: none;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--hairline);
    margin-bottom: 14px;
  }

  /* Hide the "Filters" heading and trust badge on mobile — chips speak for themselves */
  .filtcol .fhead { display: none; }
  .filtcol .trust { display: none; }

  /* Filter group: make label inline with chips */
  .filtcol .fgroup {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .filtcol .fgroup::-webkit-scrollbar { display: none; }

  /* Filter group label: show inline, no block stacking */
  .filtcol .fl {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-400);
    margin-bottom: 0;
  }

  /* Chips row: horizontal scroll, no wrap */
  .filtcol .fchips {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .filtcol .fchips::-webkit-scrollbar { display: none; }

  /* Chip: ensure 44px min touch height, no shrink */
  .fchip { min-height: 36px; padding: 8px 14px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }

  /* Actor grid: 2 columns on mobile instead of 5 */
  .grid5 { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Gridcol: allow natural scroll on mobile */
  .gridcol { overflow: visible; min-height: 0; }

  /* Actors empty state: reduced padding */
  .actors-empty { padding: 36px 16px; }

  /* Actor card name area: slightly tighter on mobile */
  .aname { font-size: 12px; padding: 8px 10px; }

  /* Creator profile modal: sheet from bottom on mobile */
  .cmodal-sheet { width: 100%; max-height: 96vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .scrim.on { align-items: flex-end; padding: 0; }
  .cp2-info { padding: 18px 18px 24px; }
  .cp2-name { font-size: 20px; }
  .cp2-bio { font-size: 12.5px; }
  .cp2-social { max-width: 100%; }

  /* pg-empty: reduce padding */
  .pg-empty { padding: 40px 16px; min-height: 200px; }

  /* Credits pill: hide label text on mobile */
  .credits .credits-label { display: none; }

  /* WorkspaceMenu: hide the text label on mobile, show avatar only */
  .hx-ws-menu-wrap .brand-pick .blab { display: none; }

  /* touch-friendly rail items */
  .rail-item { height: 44px; }

  /* ── Library page — mobile ── */

  /* Page header: stack heading and count badge vertically */
  .page-h { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 18px; }
  .page-h h1 { font-size: 24px; }
  .page-h .sub { font-size: 13px; margin-top: 4px; }
  .page-h .spacer { display: none; }
  .lib-count { align-self: flex-start; }

  /* Toolbar: search + project picker stay in same row on all screen sizes */
  .lib-toolbar { flex-direction: row; gap: 8px; margin-bottom: 8px; flex-wrap: nowrap; }
  .lib-toolbar .lib-search { flex: 1; min-width: 0; }

  /* Filter bar */
  .lib-filterbar { gap: 8px; padding: 8px 0 4px; margin-bottom: 12px; }
  .lib-filter-select-btn { min-height: 44px; font-size: 13px; padding: 0 12px; }
  .lib-filter-reset { min-height: 44px; padding: 0 12px; font-size: 13px; }

  /* Project dropdown: anchor to left edge */
  .lib-proj-picker { flex-shrink: 0; }
  .lib-proj-dropdown { left: 0; right: auto; min-width: 200px; }

  /* ── Projects list page — mobile ── */

  /* ptitle: wrap so search + button stack below the heading */
  .ptitle { flex-wrap: wrap; gap: 10px; margin-bottom: 18px; align-items: flex-start; }
  /* title block takes full row */
  .ptitle .tl { flex: 0 0 100%; }
  /* hide the spacer — wrapping handles layout */
  .ptitle .sp { display: none; }
  /* h1: reduced size on mobile */
  .ptitle .tl h1 { font-size: 24px; }
  /* search bar: grow to fill remaining row */
  .srch { flex: 1; min-width: 0; }
  /* new project button: 44px touch target */
  .ptitle .btn-primary.btn-sm { min-height: 44px; padding: 0 16px; }
  /* ledger rows: dots button gets proper touch target */
  .lrow .dots { width: 44px; height: 44px; opacity: 1; }

  /* ── Project detail page — mobile ── */

  /* BriefStrip body: reduce horizontal padding */
  .brief-strip-body { padding: 0 14px 32px; overflow-y: auto; flex: 1; }
  /* Back link */
  .brief-strip-back {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 13px; color: var(--ink-500); text-decoration: none;
    padding-top: 8px; margin-bottom: 12px; margin-top: 4px;
  }
  /* Title row: allow button to sit flush after the text block */
  .brief-strip-title-row {
    display: flex; align-items: flex-start;
    flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
  }
  /* h1: reduced size on mobile */
  .brief-strip-h1 { margin: 0; font-size: 22px; font-weight: 800; color: var(--ink-900); line-height: 1.2; }
  /* New video button: full width on mobile, 44px touch height */
  .brief-strip-new-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--green-500); color: #fff;
    padding: 12px 20px; border-radius: var(--r-pill);
    font-weight: 700; font-size: 14px; text-decoration: none;
    min-height: 44px; width: 100%; justify-content: center;
  }
  /* Video grid: 2 columns on mobile */
  .brief-vgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

  /* Back bar (inside brief canvas view) */
  .brief-back-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; background: var(--bg-page, transparent);
  }
  .brief-back-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 12px; border-radius: 8px;
    background: transparent; border: 1px solid var(--hairline);
    color: var(--ink-700); font-size: 13px; cursor: pointer;
    font-family: inherit; min-height: 44px;
  }
  .brief-back-label { font-size: 12px; color: var(--ink-500); }

  /* Work 3-panel: collapse to single column on mobile.
     !important overrides the inline gridTemplateColumns. */
  .work-detail { grid-template-columns: 1fr !important; }
  /* Hide the inputs sidebar on mobile */
  .work-detail .inputs { display: none; }

  /* Results head: tighter on mobile */
  .work-detail .results-head { padding: 10px 14px; }
  .work-detail .results-head .rh-t { font-size: 14px; }
  .work-detail .results-head .rh-s { font-size: 11px; }

  /* Results body: stack gallery + detail vertically */
  .work-detail .res-body { flex-direction: column; overflow: auto; }
  /* Gallery rail: horizontal scroll strip on mobile */
  .work-detail .res-gallery {
    width: 100%; height: auto;
    border-right: none; border-bottom: 1px solid var(--hairline);
    display: flex; flex-direction: row;
    overflow-x: auto; overflow-y: hidden;
    padding: 10px 12px; gap: 10px;
    scrollbar-width: none;
  }
  .work-detail .res-gallery::-webkit-scrollbar { display: none; }
  .work-detail .res-gallery .rg-label { display: none; }
  .work-detail .rg-thumb { width: 72px; flex-shrink: 0; margin-bottom: 0; }

  /* res-detail: less padding on mobile */
  .work-detail .res-detail { padding: 14px 12px; gap: 10px; }


  /* Action buttons: ensure 44px touch height */
  .work-detail .ra-btn { min-height: 44px; }
  .work-detail .cnav { width: 44px; height: 44px; }
}

/* ════ TABLET lib-grid: 3 columns ════ */
@media (min-width: 769px) and (max-width: 1024px) {
  .lib-grid { grid-template-columns: repeat(3, 1fr); }
  .grid5 { grid-template-columns: repeat(3, 1fr); }
  .page-inner { padding: 24px 20px 50px; }

  /* Actors page — tablet */
  .pageinner { padding: 20px 20px 0; }
  .pagehead .ph-t { font-size: 22px; }
  .split { grid-template-columns: 160px 1fr; gap: 18px; }

  /* Library page — tablet */
  .page-h h1 { font-size: 28px; }
  .lib-toolbar { gap: 10px; }

  /* ── Projects list page — tablet ── */
  .ptitle .tl h1 { font-size: 28px; }

  /* ── Project detail page — tablet ── */
  /* BriefStrip body: slightly reduced padding on tablet */
  .brief-strip-body { padding: 0 20px 36px; overflow-y: auto; flex: 1; }
  /* Video grid: auto-fill with min 140px — 3 cols on ~600–900px wide canvas */
  .brief-vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
  /* Work 3-panel: narrower inputs on tablet */
  .work-detail { grid-template-columns: 260px minmax(0,1fr) 0px !important; }
  .brief-strip-h1 { font-size: 26px; }
  .brief-strip-new-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--green-500); color: #fff;
    padding: 10px 20px; border-radius: var(--r-pill);
    font-weight: 700; font-size: 14px; text-decoration: none;
  }
}

/* ══════════════════════════════════════════════════════════════════
   SETTINGS PAGE — responsive
   Mobile  : max-width 768px  → nav becomes horizontal scroll tabs
   Tablet  : 769px – 1024px   → narrower sidebar
   ══════════════════════════════════════════════════════════════════ */

/* ════ SETTINGS TABLET (769px – 1024px) ════ */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Narrower sidebar on tablet */
  .settings-canon { grid-template-columns: 220px 1fr; }

  /* Slightly reduce pane padding */
  .settings-canon .pane { padding: 28px 22px 48px; max-width: 600px; }

  /* cards2: keep 2-col but tighter */
  .settings-canon .cards2 { gap: 10px; }
}

/* ════ SETTINGS MOBILE (max-width 768px) ════ */
@media (max-width: 768px) {
  /* Settings shell: auto height, no fixed 100vh since content may scroll */
  .settings-shell { height: auto; min-height: 100dvh; min-height: 100vh; }

  /* Topbar: reduce padding, keep crumb readable */
  .settings-shell .topbar {
    padding: 0 14px;
    gap: 8px;
  }
  .settings-shell .topbar .wm { font-size: 14px; }
  .settings-shell .topbar .crumb { font-size: 12px; }

  /* Settings canon: stack to single column */
  .settings-canon {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  /* ── Nav: horizontal scrollable tabs ── */
  .settings-canon .setnav {
    border-right: none;
    border-bottom: 1px solid var(--hairline);
    padding: 10px 12px 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Do NOT use flex column — override to row for tab layout */
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    /* Remove sticky height constraint */
    height: auto;
    min-height: 0;
  }
  .settings-canon .setnav::-webkit-scrollbar { display: none; }

  /* Hide workspace pill, credits, group labels, and navsp on mobile nav */
  .settings-canon .wsswitch,
  .settings-canon .wscredits,
  .settings-canon .navgroup .nl,
  .settings-canon .navfoot,
  .settings-canon .navsp { display: none; }

  /* navgroups: inline, no bottom margin */
  .settings-canon .navgroup {
    display: contents;
    margin-bottom: 0;
  }

  /* navitems: compact horizontal tab buttons */
  .settings-canon .navitem {
    display: inline-flex;
    width: auto;
    white-space: nowrap;
    height: 44px;
    padding: 0 14px;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    font-size: 13px;
    gap: 7px;
    flex-shrink: 0;
    align-items: center;
  }
  .settings-canon .navitem svg { width: 16px; height: 16px; }
  .settings-canon .navitem:hover { background: transparent; border-bottom-color: var(--hairline-strong); }
  .settings-canon .navitem.on {
    background: transparent;
    color: var(--green-700);
    border-bottom-color: var(--green-500);
  }
  /* Badge in tab: keep visible */
  .settings-canon .navitem .sb { margin-left: 4px; }

  /* Pane: full width, reduced padding */
  .settings-canon .setpane { overflow-y: visible; }
  .settings-canon .pane {
    max-width: 100%;
    padding: 20px 16px 48px;
  }

  /* Pane header: smaller h2 on mobile */
  .settings-canon .pane-h h2 { font-size: 20px; }
  .settings-canon .pane-h .sub { font-size: 12px; }

  /* cards2: stack to single column on mobile */
  .settings-canon .cards2 { grid-template-columns: 1fr; gap: 12px; }

  /* frow: stack label above control on mobile */
  .settings-canon .frow {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px 0;
  }
  .settings-canon .frow .fc {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  /* Inputs: full width on mobile */
  .settings-canon .inp { min-width: 0; width: 100%; }

  /* card header: allow wrapping on mobile */
  .settings-canon .card-h { flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
  .settings-canon .card-b { padding: 2px 16px; }
  .settings-canon .card-b.pad { padding: 14px 16px; }
}

/* ══════════════════════════════════════════════════════════════════
   PRICING & CHECKOUT — RESPONSIVE
   ══════════════════════════════════════════════════════════════════ */

/* ── Pricing page: plan-type tab row ── */
.pr-tabs-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.pr-kind-tabs {
  display: inline-flex;
  padding: 4px;
}
.pr-kind-tabs .method-tab {
  min-width: 100px;
  min-height: 44px;
  white-space: nowrap;
  padding-left: 18px;
  padding-right: 18px;
}

/* ── Pricing page: 4-column individual-plan grid (Basic / Starter / Pro / Max) ── */
.pr-cards-4col {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1200px;
  margin: 0 auto;
}
/* Legacy 3-col grid kept in case other surfaces still reference it. */
.pr-cards-3col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 900px;
  margin: 0 auto;
}

/* ── Pricing page: cycle toggle ── */
.pr-cycle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
}
.pr-cycle-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
}
.pr-cycle-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  min-height: 44px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  background: transparent;
  color: var(--ink-500);
  box-shadow: none;
  transition: all var(--d-fast);
}
.pr-cycle-btn.is-active {
  background: var(--bg-elevated);
  color: var(--ink-1000);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.pr-cycle-sav { margin-left: 6px; color: var(--green-600); font-weight: 700; }
.pr-cycle-sub { font-size: 12.5px; color: var(--ink-500); }

/* ── Pricing page: currency picker ("Prices in [country ⌄]") ── */
/* Composed of the shared <Select> component (see @/components/ui/Select) —
   the picker just provides the "Prices in" label + a width override. */
.cur-picker {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  max-width: 100%;
}
.cur-picker__label {
  font-size: 13px;
  color: var(--ink-500);
  font-weight: 500;
  white-space: nowrap;
  flex: 0 0 auto;
}
.cur-picker__select {
  min-width: 220px;
  flex: 0 1 auto;
}

/* Force visible scrollbar in Select popovers — WebKit auto-hides by
   default on macOS/iOS, which makes overflow'd option lists look like
   they've been truncated. Applied via the [data-hx-select-pop] attr
   the Select component sets so we don't touch other overflow'd elements. */
[data-hx-select-pop]::-webkit-scrollbar { width: 8px; }
[data-hx-select-pop]::-webkit-scrollbar-track { background: transparent; }
[data-hx-select-pop]::-webkit-scrollbar-thumb {
  background: var(--ink-400);
  border-radius: 999px;
  border: 2px solid var(--bg-surface);
}
[data-hx-select-pop]::-webkit-scrollbar-thumb:hover { background: var(--ink-500); }

/* Local-currency price on plan cards. USD footnote was removed 2026-07-11
   (redundant with the picker at the top which advertises the currency). */
.pr-price__local { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; color: var(--ink-1000); }

/* ── Checkout page: section title alias ── */
.co-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-1000);
  margin-bottom: 16px;
}

/* ════ TABLET (769px – 1024px): 2-col pricing cards ════ */
@media (min-width: 769px) and (max-width: 1024px) {
  .pr-cards-3col,
  .pr-cards-4col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 720px;
  }
}

/* ════ MOBILE (max-width 768px): pricing & checkout ════ */
@media (max-width: 768px) {
  /* Pricing tabs: stretch to full width */
  .pr-tabs-wrap { justify-content: stretch; }
  .pr-kind-tabs { display: flex; width: 100%; }
  .pr-kind-tabs .method-tab { flex: 1; min-width: unset; text-align: center; }

  /* Pricing card grid: 1 col on mobile */
  .pr-cards-3col,
  .pr-cards-4col { grid-template-columns: 1fr; max-width: 100%; }
  .pr-cards { grid-template-columns: 1fr; }

  /* Pricing card internals */
  .pr-card { min-height: unset; padding: 16px 14px 14px; }
  .pr-price { font-size: 22px; }

  /* Cycle toggle */
  .pr-cycle-btn { padding: 6px 12px; font-size: 12px; }
  .pr-cycle-sub { font-size: 12px; text-align: center; }

  /* Checkout: unstick order summary (sticky needs height context on mobile) */
  .co-summary { position: static; top: auto; padding: 16px 14px 14px; }

  /* Checkout: reduce section card padding */
  .co-section { padding: 16px 14px; }

  /* Checkout: ensure CTA button meets 44px touch target */
  .co-summary .btn { min-height: 44px; }
}

  /* quiet-foot: wrap on mobile */
  .settings-canon .quiet-foot { margin-top: 32px; flex-wrap: wrap; gap: 12px; }
  /* touch targets for quiet-foot buttons */
  .settings-canon .quiet-foot button { min-height: 44px; display: inline-flex; align-items: center; }
}

/* ════ HOME PAGE — responsive (mobile + tablet) ════ */

/* Tablet (769px – 1024px): tighten hero spacing. tplrow already collapses
   to 3-col via the existing @media (max-width: 1080px) rule above. */
@media (min-width: 769px) and (max-width: 1024px) {
  .hc-wrap { padding-top: 22px; }
  .hc-hero h1 { font-size: 36px; }
  .hc-hero .lede { font-size: 14px; max-width: 48ch; }
  .choose-q { margin: 24px 0 11px; font-size: 16px; }
  .below { margin-top: 28px; }
}

/* Mobile (max-width: 768px): hero stacks, template strip becomes
   a horizontal scroll carousel. */
@media (max-width: 768px) {
  /* ── hero section ── */
  .hc-wrap { padding-top: 16px; }
  .hc-hero h1 {
    font-size: 26px;
    letter-spacing: -0.025em;
    margin-top: 12px;
    max-width: none;
  }
  .hc-hero .lede { font-size: 13.5px; margin-top: 12px; max-width: none; }
  .hc-speed { margin-top: 14px; font-size: 11.5px; }
  .choose-q { margin: 22px 0 10px; font-size: 15px; }

  /* ── choose tiles: 1 column on mobile ── */
  .choose-grid.is-canon {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .choose-grid.is-canon .choose-tile { padding: 22px 20px 20px; min-height: 44px; }
  .choose-grid.is-canon .choose-tile .ti { width: 44px; height: 44px; margin-bottom: 14px; }
  .choose-grid.is-canon .choose-tile .tn { font-size: 18px; }
  .choose-grid.is-canon .choose-tile .tx { font-size: 13px; line-height: 1.5; }

  /* ── custom-line ── */
  .custom-line { margin-top: 14px; font-size: 12.5px; }

  /* ── template strip: horizontal scroll carousel ── */
  .below { margin-top: 28px; }
  .tplrow {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    /* Leading + trailing padding so the first card doesn't touch the
       left screen edge and the last card has breathing room on the
       right. scroll-padding aligns snap points with the inset. */
    padding: 4px 16px 12px;
    scroll-padding-left: 16px;
    /* grid-template-columns from outer rule doesn't apply to flex,
       but override just in case any inherited rule conflicts */
    grid-template-columns: none;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .tplrow::-webkit-scrollbar { height: 3px; }
  .tplrow::-webkit-scrollbar-thumb {
    background: var(--hairline-strong);
    border-radius: 2px;
  }
  .tpl {
    flex: 0 0 140px;
    scroll-snap-align: start;
  }
}

/* ════ ONBOARDING / AUTH — responsive (mobile) ════ */
@media (max-width: 768px) {
  /* authwrap: reduce padding, start-align so keyboard doesn't push
     content off screen */
  .authwrap {
    padding: 24px 16px 32px;
    justify-content: flex-start;
    min-height: 100dvh;
  }

  /* brandmark: tighter vertical gap and smaller wordmark */
  .brandmark { margin-bottom: 16px; gap: 10px; }
  .brandmark .wm { font-size: 21px; }

  /* authcard-wide: already max-width: 100%; ensure full width on mobile */
  .authcard-wide { width: 100%; }

  /* secured footer: less top whitespace */
  .secured { margin-top: 16px; }
}

/* ══════════════════════════════════════════════════════════════════
   CREDITS PAGE — /credits
   ══════════════════════════════════════════════════════════════════ */

.credits-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.credits-page-title {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-1000);
}
.credits-page-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.ledger-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--hairline);
  gap: 10px;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════════
   INVOICES PAGE — /billing/invoices
   ══════════════════════════════════════════════════════════════════ */

.inv-breadcrumb-link {
  color: var(--ink-500);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.inv-breadcrumb-link:hover { color: var(--ink-800); text-decoration: underline; }
.inv-dl-btn { min-height: 32px; }

/* ══════════════════════════════════════════════════════════════════
   SEATS PAGE — /billing/seats
   ══════════════════════════════════════════════════════════════════ */

.seats-wrap { max-width: 600px; }
.seats-page-h { margin-bottom: 20px; }
.seats-card { padding: 24px; margin-bottom: 16px; }

.seats-current-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.seats-current-icon { color: var(--ink-700); flex-shrink: 0; }
.seats-current-count { font-size: 14px; font-weight: 700; color: var(--ink-1000); }
.seats-current-price { font-size: 12.5px; color: var(--ink-500); }

.seats-stepper-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.seats-stepper-label { font-size: 13px; font-weight: 600; color: var(--ink-900); }
.seats-stepper-ctrl { display: inline-flex; align-items: center; gap: 8px; }
.seats-stepper-btn {
  width: 32px; height: 32px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  background: var(--bg-elevated);
  font-size: 18px; font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1;
  color: var(--ink-900);
}
.seats-stepper-btn:disabled { cursor: not-allowed; opacity: 0.4; }
.seats-stepper-input {
  width: 64px; height: 32px;
  text-align: center;
  font-size: 15px; font-weight: 700;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--ink-1000);
  font-family: inherit;
  -moz-appearance: textfield;
}
.seats-stepper-input::-webkit-inner-spin-button,
.seats-stepper-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.seats-recurring-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-700);
}

.seats-floor-hint {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-600);
}
.seats-floor-hint a { color: var(--ink-900); text-decoration: underline; }

.seats-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.seats-submit-btn { flex: 1; justify-content: center; }

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — credits + billing  (mobile 768px, tablet 769-1024px)
   ══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* Credits page header */
  .credits-page-title { font-size: 24px; }
  .credits-page-head { margin-bottom: 12px; }
  .credits-page-actions { width: 100%; justify-content: flex-end; }

  /* Ledger toolbar */
  .ledger-toolbar { padding: 10px 14px; gap: 8px; }

  /* Invoice table → card list */
  .inv-tbl { display: block; }
  .inv-tbl thead { display: none; }
  .inv-tbl tbody { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
  .inv-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    column-gap: 8px;
    row-gap: 4px;
    padding: 14px;
    border: 1px solid var(--hairline) !important;
    border-radius: var(--r-md);
    background: var(--bg-surface);
  }
  .inv-row td { padding: 0 !important; border: none !important; }
  .inv-cell-id {
    grid-column: 1; grid-row: 1;
    font-family: var(--font-mono) !important;
    font-size: 11.5px !important; font-weight: 700;
    color: var(--ink-500) !important;
  }
  .inv-cell-date {
    grid-column: 1; grid-row: 2;
    font-size: 13px !important; font-weight: 600;
    color: var(--ink-1000) !important;
    padding-top: 2px !important;
  }
  .inv-col-desc { display: none !important; }
  .inv-cell-amount {
    grid-column: 2; grid-row: 1 / 3;
    font-size: 15px !important; font-weight: 700;
    text-align: right !important;
    align-self: center;
    font-family: var(--font-mono) !important;
  }
  .inv-cell-status { grid-column: 1; grid-row: 3; padding-top: 8px !important; }
  .inv-cell-action {
    grid-column: 2; grid-row: 3;
    padding-top: 8px !important;
    text-align: right !important;
  }
  .inv-dl-btn { min-height: 44px; padding: 0 16px; }

  /* Seats */
  .seats-wrap { max-width: 100%; }
  .seats-card { padding: 16px; }
  .seats-stepper-btn { width: 44px; height: 44px; font-size: 20px; }
  .seats-stepper-input { height: 44px; font-size: 16px; width: 72px; }
  .seats-actions { flex-direction: column; }
  .seats-submit-btn { flex: none; width: 100%; }
  .seats-actions .btn-secondary { width: 100%; justify-content: center; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .credits-page-title { font-size: 28px; }
  .seats-stepper-btn { width: 38px; height: 38px; }
  .seats-stepper-input { height: 38px; }
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — shared components + url-to-ad wizard
   Breakpoint: 640px (matches --amp-breakpoint-sm token).
   All desktop behaviour above 640px is untouched.
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* ── Shell: single column, rail is a fixed overlay (handled by 768px block) ── */
  .app,
  .app[data-railpin="true"],
  .app[data-railhover="true"] {
    grid-template-columns: 1fr;
  }
  /* Rail stays as fixed overlay (not display:none) so hamburger menu works */

  /* ── Header: tighten horizontal padding, keep left clearance for hamburger ── */
  .hdr {
    padding: 0 12px 0 64px;
    gap: 8px;
  }
  .credits {
    padding: 5px 9px;
    font-size: 11px;
    gap: 5px;
  }
  .credits .muted { display: none; }
  .proj-name {
    font-size: 14px;
    max-width: 160px;
    padding: 5px 7px;
  }

  /* ── URL→Ad workspace: stack sidebar above video feed ── */
  .work {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr;
    overflow: auto;
  }
  /* Sidebar: fixed height on mobile, sits above the video feed */
  .inputs {
    border-right: none;
    border-bottom: 1px solid var(--hairline);
    max-height: 260px;
  }
  .inputs-scroll {
    padding: 12px 12px 8px;
  }
  .inputs-foot {
    padding: 10px 12px 12px;
  }
  /* VideoFeed canvas: reduce padding, allow scroll */
  .canvas {
    overflow-y: auto;
  }

  /* ── VideoFeed grid: 2 columns on mobile ── */
  .canvas > div[style*="grid-template-columns"] {
    /* override the JS inline style for the feed grid container */
  }
  /* The VideoFeed renders inline grid — override via class on the section */
  .canvas section,
  .canvas > section {
    padding: 16px 14px !important;
  }

  /* ── Canon wizard overlay: full-screen bottom sheet ──
     Anchored to the viewport bottom edge so no page content peeks
     through below the panel. Top has a small backdrop strip + rounded
     corners on the panel for the classic bottom-sheet look. */
  .canon-wiz-overlay,
  .canon-wiz-overlay[data-canon-step="1"] {
    padding: 0 !important;
    align-items: flex-end !important;
    /* Pin to viewport bottom regardless of iOS dvh wobble */
    justify-content: stretch !important;
  }
  /* Panel: bottom-sheet — sits flush against the viewport bottom edge
     with a small backdrop strip visible at the top (classic
     bottom-sheet look). Use calc(100dvh - 56px) so iOS dvh fluctuation
     can't leave any sliver of page at the bottom either. */
  .canon-wiz-overlay[data-canon-step="1"] .canon-wiz-panel,
  .canon-wiz-overlay[data-canon-step="2"] .canon-wiz-panel,
  .canon-wiz-overlay[data-canon-step="3"] .canon-wiz-panel,
  .canon-wiz-panel {
    width: 100% !important;
    height: calc(100dvh - 56px) !important;
    max-height: calc(100dvh - 56px) !important;
    border-radius: 18px 18px 0 0 !important;
    padding: 16px 16px 0 !important;
    margin: 0 !important;
  }
  .canon-wiz-overlay[data-canon-step="1"] .canon-wiz-panel {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
  }
  /* Step 1: full-height flex column, video on top, form below, footer pinned */
  .wiz-step-rx1 {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    overflow: hidden !important;
  }
  .wiz-step-rx1 .rx-head { flex-shrink: 0; padding: 12px 16px; }
  .wiz-step-rx1 .canon-wiz-foot { flex-shrink: 0; }
  /* Content area: video fills top, form sits at bottom */
  .rx-cols {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: unset !important;
    overflow: hidden !important;
    min-height: 0 !important;
    padding: 0;
  }
  /* Hide green area entirely */
  .rx-show { display: none !important; }
  .rx-adf { display: none !important; }
  /* Form: centred, full width, with subtitle + format tags visible */
  .rx-lft { padding: 0 20px; width: 100%; flex-shrink: 0; }
  .rx-big { font-size: 28px; margin: 0 0 10px; line-height: 1.15; }
  .rx-mk { display: none !important; }
  /* Show subtitle and format tags to fill the space */
  .rx-lead {
    display: block !important;
    font-size: 14px;
    color: var(--ink-600);
    margin-bottom: 16px;
    line-height: 1.5;
  }
  .rx-fmts {
    display: flex !important;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
  }
  .rx-field { margin-top: 0; }
  /* Wizard head and foot */
  .canon-wiz-h {
    font-size: 18px;
  }
  .canon-wiz-foot {
    flex-wrap: wrap;
    gap: 8px;
  }
  .canon-wiz-foot .spacer { display: none; }
  .canon-wiz-foot .btn-primary { flex: 1; justify-content: center; }

  /* ── ActorPicker: filter rail → horizontal scroll strip ── */
  .cp-actor-layout {
    flex-direction: column !important;
    gap: 12px;
  }
  .cp-actor-rail {
    flex: none !important;
    width: 100%;
    padding-right: 0;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    padding-bottom: 4px;
    /* Hide vertical scrollbar on the rail on mobile */
    scrollbar-width: none;
  }
  .cp-actor-rail::-webkit-scrollbar { display: none; }
  .cp-actor-search {
    flex: 0 0 180px;
    min-width: 140px;
  }
  /* Section labels hidden in horizontal layout — pills are self-explanatory */
  .cp-actor-section { display: none; }
  .cp-actor-pills {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    gap: 6px;
  }
  .cp-actor-pill {
    white-space: nowrap;
    flex-shrink: 0;
  }
  /* Actor grid: 2 columns on mobile */
  .cp-actor-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* ── AddActorPopup: full-screen modal ── */
  .cp-create-scrim {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .cp-create-card {
    width: 100% !important;
    max-height: 88dvh !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 24px 20px 20px !important;
  }
  .add-actor-card {
    padding: 24px 20px 20px !important;
  }
  /* Add actor tiles stack on mobile */
  .add-actor-grid {
    grid-template-columns: 1fr !important;
  }
  .add-actor-title {
    font-size: 18px;
  }

  /* ── MembersPanel: member rows stack to card layout ── */
  /* Both .settings-canon .mrow and bare .mrow */
  .mrow,
  .settings-canon .mrow {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto;
    gap: 6px !important;
    padding: 14px 0 !important;
    position: relative;
  }
  /* role button: align left, natural width */
  .mrow .cell:nth-child(2),
  .settings-canon .mrow .cell:nth-child(2) {
    display: flex;
    align-items: center;
  }
  .rolebtn,
  .settings-canon .rolebtn {
    width: auto !important;
    min-width: 96px;
  }
  /* Actions cell: absolute top-right */
  .mrow .cell.end,
  .settings-canon .mrow .cell.end {
    position: absolute !important;
    top: 14px;
    right: 0;
    text-align: right;
  }
  /* MembersPanel invite frow: wrap on mobile */
  .frow { flex-wrap: wrap; gap: 10px !important; }
  .frow .fc { width: 100%; flex-wrap: wrap; }
  /* Invite input: full width */
  .inp.wide { width: 100% !important; }

}

/* ── VideoFeed inline grid: 2 cols on mobile via container class ──
   The VideoFeed renders its grid as an inline style, so we add a
   helper class (canvas-grid) to the wrapper div to override it.
   Since we can't add a class to the inline style, we target the
   canvas section's direct grid child via CSS override. */
@media (max-width: 640px) {
  /* The VideoFeed grid is the direct div child of .canvas section */
  .canvas > section > div {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  /* Canvas section outer padding */
  .canvas > section {
    padding: 16px 14px 40px !important;
  }
}

/* === Rail mobile close button (inside rail header) === */
.rail-logo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.rail-close-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink-600);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--d-fast);
}
.rail-close-btn:hover { background: var(--ink-100); color: var(--ink-1000); }
@media (max-width: 768px) {
  .rail-close-btn { display: inline-flex; }
}

/* === QualityChip popup — mobile fix === */
@media (max-width: 768px) {
  .qpop {
    left: auto;
    right: 0;
    bottom: calc(100% + 6px);
    width: calc(100vw - 40px);
    max-width: 320px;
  }
}

/* === Mobile nav overlay — force expanded labels + fix logo row === */
@media (max-width: 768px) {
  /* Logo row: logo + close button side by side */
  .rail-logo-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 0 6px 10px !important;
    gap: 8px;
  }
  .rail-logo-row .rail-logo {
    flex: 1;
    padding: 4px 0 !important;
    width: auto !important;
    justify-content: flex-start !important;
  }

  /* When open: force all items to show labels (icon + text) */
  .rail.rail-mobile-open .rail-item {
    justify-content: flex-start !important;
    padding: 0 14px !important;
    gap: 14px !important;
    width: 100% !important;
  }
  .rail.rail-mobile-open .rail-item .rl {
    opacity: 1 !important;
    max-width: 200px !important;
    overflow: visible !important;
  }
  .rail.rail-mobile-open .rail-pin {
    display: none !important;
  }

  /* Rail width: wider on mobile overlay for comfortable tap targets */
  .rail.rail-mobile-open {
    width: 280px !important;
  }

  /* Logo wordmark: always show text in overlay */
  .rail.rail-mobile-open .rail-logo .wm {
    opacity: 1 !important;
    max-width: 200px !important;
  }
  .rail.rail-mobile-open .rail-logo .mark {
    display: none !important;
  }
}

/* === Settings page: setpane fills full height, no two-tone background === */
/* (height/overflow managed by the mobile block below) */

/* === URL→Ad page: hide inputs sidebar on mobile (New Video card does the same job) === */
@media (max-width: 768px) {
  .work .inputs {
    display: none !important;
  }
  .work {
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;
  }
  .work .canvas {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }
}

/* === Rail close button: absolute top-left, HEXCODED logo centred after it === */
.rail-close-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
}
/* Push rail-logo right so it clears the close button */
.rail.rail-mobile-open .rail-logo {
  padding-left: 56px !important;
}
/* (Previously had `.rail.rail-mobile-open { position: relative }` here to
   anchor the close button — but it was overriding `position: fixed` from
   the mobile rail rule, collapsing the rail to fit-content height in normal
   flow. position:fixed is *also* a positioning context for absolutely-
   positioned children, so the close button still anchors correctly.) */

/* Library card title/project line — single-line ellipsis so cards
   stay the same height. */
.lib-card .lc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lib-card .lc-proj {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === Mobile font size fixes — prevent oversized headings on small screens === */
@media (max-width: 768px) {
  /* Page h1s: cap at 22px on mobile */
  .brief-strip-h1,
  .brief-strip-body h1 { font-size: 22px !important; }

  /* Project detail title */
  .brief-strip-title-row h1 { font-size: 22px; }

  /* Settings headings */
  .pane-h h2 { font-size: 18px !important; }

  /* Library / credits / settings h1 */
  .page-h h1,
  .page-inner h1 { font-size: 22px; }

  /* Actors page heading */
  .pagehead h1,
  .ph-t { font-size: 22px !important; }

  /* Reduce hero text on home */
  .hc-hero h1 { font-size: 26px !important; }

  /* Project name in header */
  .proj-name { font-size: 15px !important; max-width: 140px; }

  /* Body/meta text: keep readable minimum */
  .page-h .sub,
  .pane-h .sub { font-size: 13px; }
}

@media (max-width: 640px) {
  /* Even tighter on very small phones */
  .brief-strip-h1 { font-size: 20px !important; }
  .hc-hero h1 { font-size: 22px !important; }
  .page-h h1 { font-size: 20px !important; }
}

/* === Library toolbar: force same row on all sizes === */
.lib-toolbar {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 10px !important;
}
.lib-toolbar .lib-search {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}
.lib-toolbar .lib-proj-picker {
  flex-shrink: 0 !important;
}

/* === URL→Ad header: mobile tweaks === */
@media (max-width: 768px) {
  /* Hide three-dot project menu on mobile */
  .hdr .proj-menu-wrap,
  .hdr [aria-label="Project options"] {
    display: none !important;
  }
  /* Smaller project name input */
  .proj-name {
    font-size: 13px !important;
    max-width: 160px !important;
    padding: 4px 8px !important;
  }
}

/* === Library dropdown: constrain to viewport, never overflow === */
@media (max-width: 768px) {
  .lib-proj-dropdown {
    left: auto !important;
    right: 0 !important;
    width: calc(100vw - 32px) !important;
    max-width: 320px !important;
  }
}

/* === TopBar: hide workspace avatar (A icon) on mobile === */
@media (max-width: 768px) {
  .hx-ws-menu-wrap { display: none !important; }
}

/* === Force project name input to compact size on mobile === */
@media (max-width: 768px) {
  input.proj-name {
    width: 130px !important;
    max-width: 130px !important;
    min-width: 0 !important;
    font-size: 13px !important;
    padding: 4px 8px !important;
  }
}

/* === Video feed grid === */
.vfeed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
@media (max-width: 768px) {
  .vfeed-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  /* Reduce canvas padding so grid has full room */
  .canvas {
    padding: 20px 16px !important;
  }
}

/* ===================================================================
   iOS / mobile browser fixes
   - 100dvh: dynamic viewport height — excludes browser toolbar on iOS
   - safe-area-inset-bottom: clears iPhone home indicator
   - -webkit-overflow-scrolling: touch momentum scroll in overflow containers
   =================================================================== */

/* body and app shell: use dynamic viewport height */
body { height: 100dvh; }
.app,
.app[data-railpin="true"],
.app[data-railhover="true"] { height: 100dvh; }
.main { height: 100dvh; }

/* Scrollable content: momentum scroll + safe area bottom padding */
.view.on {
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.appscroll {
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Auth pages: safe area */
.authwrap {
  padding-bottom: max(40px, env(safe-area-inset-bottom));
}

/* === Fix 2: Sign-up / Sign-in page centered on mobile === */
@media (max-width: 768px) {
  .authwrap {
    min-height: 100dvh;
    justify-content: center;
    padding: 24px 20px;
  }
  .authcard {
    width: 100%;
  }
}

/* === Fix 5: Project ID page — fix horizontal scroll on mobile === */
@media (max-width: 768px) {
  .brief-vgrid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    overflow: hidden;
    grid-auto-rows: 1fr;
  }
  /* Direct grid children (the CardLink wrapper, either <a> or <button>)
     fill their cell entirely so every card has identical width AND height. */
  .brief-vgrid > a,
  .brief-vgrid > button {
    width: 100%;
    height: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
  }
  /* Ensure project detail page doesn't overflow horizontally */
  .brief-strip-body {
    overflow-x: hidden;
    max-width: 100%;
  }
  .brief-strip-title-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .brief-strip-new-btn {
    font-size: 13px;
    padding: 8px 14px;
  }
  /* Video cards: equal width, no min-width overflow, stretch to cell */
  .vc {
    min-width: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }
  /* Footer pushes to the bottom so cards align even if .vthumb scales */
  .vc .vfoot { margin-top: auto; }
  /* Tool label and meta lines clamp so long format names don't push card
     height up — keeps grid rows uniform via grid-auto-rows: 1fr */
  .vc .vtool {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .vc .vmeta {
    white-space: nowrap;
    overflow: hidden;
  }
}

/* === Fix 6: Project detail — stack panels vertically on mobile === */
@media (max-width: 768px) {
  .view.on[data-project-detail] {
    overflow-y: auto;
  }
}

/* === HEXCODED wordmark in mobile header bar === */
.mobile-brand-mark {
  display: none;
  position: fixed;
  /* Align with hamburger: top:9px + center in 44px button = ~20px from top */
  top: 20px;
  left: 68px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink-1000);
  z-index: 105;
  pointer-events: none;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .mobile-brand-mark { display: block; }
  /* Logo hidden from nav overlay — it's in the header bar now */
  .rail.rail-mobile-open .rail-logo { display: none !important; }
  /* Add top padding to nav so first item clears the close button */
  .rail.rail-mobile-open { padding-top: 60px !important; }
}
/* Step 1 mobile: vertically center the content block within rx-cols */
@media (max-width: 768px) {
  .rx-cols { justify-content: center !important; }
  .rx-lft {
    padding: 24px 16px !important;
    width: 100%;
    flex-shrink: 0;
    justify-content: center !important;
  }
}

/* === Mobile: hide proj-name input on url-to-ad (HEXCODED in header, proj name not needed) === */
@media (max-width: 768px) {
  .hdr .proj-name,
  .hdr .proj-menu-wrap { display: none !important; }
}

/* === Step 1 mobile: URL→Ad product picker — horizontal scroll strip === */
@media (max-width: 768px) {
  .rx-thumbs-wrap {
    max-height: 160px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .rx-thumbs {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    flex-wrap: unset !important;
    overflow: visible !important;
    width: 100% !important;
  }
  .rx-pth {
    width: 100% !important;
    min-width: 0 !important;
    aspect-ratio: 1 !important;
    flex-shrink: unset !important;
  }
  .rx-pth .nm { font-size: 8px !important; padding: 2px 4px !important; }
  .rx-lead { display: none !important; }
  .rx-fmts span { font-size: 11px; padding: 3px 10px; }
  .rx-big { text-align: left; font-size: 26px !important; margin-bottom: 8px !important; }
  .rx-fmts { margin-bottom: 14px !important; }
  .rx-field { margin-top: 0 !important; margin-bottom: 12px !important; }
}

/* === Logo block: compact on ALL screens — hide header, show + hint === */
.bk-block:has(.bk-logo-prev) .bk-head { display: none !important; }
.bk-logo-prev { width: 48px !important; height: 48px !important; }
.bk-logo-prev .lw { font-size: 18px !important; }
.bk-logo-row {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  position: relative !important;
}
.bk-logo-row .bk-logo-meta { flex: 1; min-width: 0; }
.bk-logo-meta { font-size: 12px; }
.bk-logo-meta > div:first-child { font-size: 13px !important; }
.bk-logo-row::after {
  content: '+';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--hairline-strong);
  color: var(--ink-500);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 28px;
  text-align: center;
  background: var(--bg-surface);
  cursor: pointer;
}

/* === Dark mode: readOnly input should not go black === */
[data-theme="dark"] .settings-canon .inp.ro {
  background: var(--bg-elevated);
  color: var(--ink-600);
}

/* =====================================================================
   SETTINGS MOBILE — ONE CANONICAL BLOCK
   Replaces all previous conflicting settings mobile rules.
   Structure: .settings-shell (100dvh, flex col) >
              topbar + .settings-canon (flex:1) >
              .setnav (flex-shrink:0) + .setpane (flex:1, scroll)
   ===================================================================== */
@media (max-width: 768px) {
  /* 1. Shell: full height, column, overflow hidden */
  html body .settings-shell { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
  html body .settings-shell .settings-canon { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
  html body .settings-shell .settings-canon .setnav { flex-shrink: 0; }
  html body .settings-shell .settings-canon .setpane { flex: 1; height: 0; min-height: 0; overflow-y: scroll; -webkit-overflow-scrolling: touch; }

  /* 2. Pane content spacing */
  .settings-canon .pane { padding: 20px 16px 48px; max-width: 100%; }
  .settings-canon .pane-h h2 { font-size: 20px; }
  .settings-canon .pane-h .sub { font-size: 13px; }

  /* 3. Cards */
  .settings-canon .card { margin-top: 14px; }
  .settings-canon .card .card-h { padding: 10px 14px; font-size: 11px; }
  .settings-canon .card .card-b { padding: 0 14px; }

  /* 4. Form rows — stacked, with proper spacing */
  .settings-canon .frow {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 14px 0;
    border-bottom: 1px solid var(--hairline);
  }
  .settings-canon .frow:last-child { border-bottom: none; padding-bottom: 14px; }

  /* 5. Labels always visible */
  .settings-canon .frow .fl { display: flex !important; flex-direction: column; gap: 2px; opacity: 1 !important; visibility: visible !important; }
  .settings-canon .frow .fl .t { font-size: 13.5px; font-weight: 600; color: var(--ink-1000); }
  .settings-canon .frow .fl .h { font-size: 12px; color: var(--ink-500); }
  .settings-canon .frow .fc { justify-content: flex-start; flex-wrap: wrap; }

  /* 6. Inputs full width */
  .settings-canon .inp { min-width: 0; width: 100%; box-sizing: border-box; }

  /* 7. Cards2 single column */
  .settings-canon .cards2 { grid-template-columns: 1fr; gap: 10px; }

  /* 8. Hide Sign-out description on mobile (action-only row) */
  .settings-canon .frow.signout-row .fl .h { display: none; }

  /* 9. TaxBillingCard: hide on mobile (desktop billing detail only) */
  .settings-tax-billing-card { display: none; }

  /* 10. Brand kit: hide section hints, keep labels */
  .bk-block .bk-hint { display: none !important; }
}

/* === Hide fixed header elements when modal is open === */
body:has(.hx-modal-backdrop) .mobile-brand-mark,
body:has(.hx-modal-backdrop) .rail-hamburger {
  display: none !important;
}

/* === Project detail: restore overflow:hidden so internal res-detail scrolls correctly === */
@media (max-width: 768px) {
  .view.on:has(.res-detail) {
    overflow: hidden !important;
    height: 100% !important;
  }
}

/* === Project detail canvas: show video on mobile ===
   grid-template-rows:1fr gives the canvas cell the full grid height.
   Without explicit rows, grid items size to content → height:100% = 0. */
@media (max-width: 768px) {
  .work-detail {
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;  /* single row, fills all flex:1 space */
  }
  .work-detail .inputs { display: none !important; }
  .work-detail .canvas {
    min-height: 0;
    display: flex !important;
    flex-direction: column !important;
  }
  .work-detail .canvas-stage {
    flex: 1 !important;
    min-height: 0 !important;
    position: relative !important;
  }
}

/* === Project detail canvas: direct min-height bypasses all flex/grid chain issues === */
@media (max-width: 768px) {
  .work-detail .canvas-stage {
    /* 100dvh - hdr(58) - back-bar(44) - canvas-bar(46) - some gap = ~480px minimum */
    min-height: calc(100dvh - 160px) !important;
  }
}

/* === Project detail: fixed canvas on mobile — bypasses ALL parent height chains === */
@media (max-width: 768px) {
  /* Hide the left checklist sidebar entirely */
  .work-detail .inputs { display: none !important; }
  /* Canvas takes the entire remaining screen, fixed to viewport */
  .work-detail .canvas {
    position: fixed !important;
    top: 148px !important;   /* hdr(58) + back-bar(44) + canvas-bar(46) */
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: auto !important;
    z-index: 10 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  /* canvas-bar stays fixed at top of the canvas */
  .work-detail .canvas-bar {
    position: sticky !important;
    top: 0 !important;
    flex-shrink: 0 !important;
  }
  /* canvas-stage fills the fixed canvas */
  .work-detail .canvas-stage {
    flex: 1 !important;
    min-height: 0 !important;
    position: relative !important;
    overflow: hidden !important;
  }
  /* canvas-bar is part of the fixed canvas — adjust offset */
  .work-detail .canvas { top: 102px !important; } /* hdr(58) + back-bar(44) */
}

/* === Project detail mobile: flex column, hide sidebar, canvas fills space (CORRECT FIX) === */
@media (max-width: 768px) {
  /* Switch work-detail from CSS grid to flex column */
  .work-detail {
    display: flex !important;
    flex-direction: column !important;
    position: static !important;
  }
  /* Hide left sidebar and right editor */
  .work-detail .inputs,
  .work-detail .editor { display: none !important; }
  /* Canvas fills all remaining space */
  .work-detail .canvas {
    flex: 1 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    position: static !important;  /* undo the position:fixed from previous bad fix */
    top: auto !important;
    bottom: auto !important;
  }
  .work-detail .canvas-stage {
    flex: 1 !important;
    min-height: 0 !important;
    position: relative !important;
    overflow: hidden !important;
  }
}

/* === Project detail mobile: hide nav arrows + ads-ready header === */
@media (max-width: 768px) {
  .work-detail .res-nav { display: none !important; }
  .work-detail .results-head { display: none !important; }
}

/* === Canvas bar mobile: transparent, no border, sits on res-detail bg === */
@media (max-width: 768px) {
  .work-detail .canvas-bar {
    background: transparent !important;
    border-bottom: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* === Hide Verified badge on mobile project canvas — already shown elsewhere === */
@media (max-width: 768px) {
  .work-detail .res-player .pl-vbadge { display: none !important; }
}

/* === Project canvas-bar mobile: tighter top spacing === */
@media (max-width: 768px) {
  .work-detail .canvas-bar {
    height: auto !important;
    padding: 8px 18px !important;
    min-height: 36px !important;
  }
}

/* === Settings iOS: safe-area bottom padding so last content clears iPhone home indicator === */
@media (max-width: 768px) {
  html body .settings-shell .settings-canon .setpane {
    /* iOS Safari has both top URL bar and bottom toolbar; add ~120px clearance
       so the last visible row doesn't sit underneath the bottom chrome */
    padding-bottom: calc(120px + env(safe-area-inset-bottom)) !important;
  }
  /* Replace 100dvh with top:0+bottom:0 for iOS-safe full height — same pattern as rail */
  html body .settings-shell {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: auto !important;
  }
}

/* === URL→AD Step 1 mobile: video card on top, form + product picker below === */
@media (max-width: 768px) {
  /* Re-show the product picker (was hidden by an earlier mobile rule) */
  .wiz-step-rx1 .rx-orpick { display: flex !important; margin-top: 14px !important; }
  .wiz-step-rx1 .rx-thumbs-wrap {
    display: block !important;
    /* Card width = (100vw - 32px padding - 16px gaps) / 3.
       Cards are aspect-ratio:1, so card height ≈ same.
       1.5 rows = card * 1.5 + gap * 0.5 ≈ calc((100vw - 48px)/3 * 1.5 + 4px) */
    max-height: calc((100vw - 48px) / 3 * 1.5 + 4px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin-top: 10px !important;
  }
  /* 3 columns, ~0.25 peek of next row */
  .wiz-step-rx1 .rx-thumbs {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }
  /* rx-lft should scroll its content if it overflows */
  .wiz-step-rx1 .rx-lft {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 0 16px !important;
  }
}

/* === AddActor / CreateAiActor modal — full-modal scroll on mobile (not nested) === */
@media (max-width: 768px) {
  /* Container: allow scrolling on the card itself */
  .cp-create-card.add-actor-card,
  .cp-create-card {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-height: 92dvh !important;
    padding-bottom: calc(40px + env(safe-area-inset-bottom)) !important;
  }
  /* Form inside CreateAiActorPanel uses inline overflow:hidden — undo for mobile */
  .cp-create-card form,
  .cp-create-card form > div[style*="overflow"] {
    overflow: visible !important;
  }
  .cp-create-card form,
  .cp-create-card > div[style*="overflow"] {
    overflow: visible !important;
    min-height: 0 !important;
  }
}

/* === Asset preview modal: fit viewport, scroll body, never overflow off-screen ===
   iOS Safari sometimes mis-reports dvh when the URL/bottom bar is visible.
   Stack vh + dvh + a hard pixel ceiling so the modal can never extend past
   the system chrome. */
@media (max-width: 768px) {
  .hx-modal-backdrop {
    padding: 0 !important;
    align-items: flex-end !important;
  }
  .hx-modal {
    max-height: 88vh !important;
    max-height: 88dvh !important;
    width: 100% !important;
    border-radius: 18px 18px 0 0 !important;
    /* Reserve room for iOS bottom toolbar (~80px) */
    margin-bottom: 0 !important;
  }
  .hx-modal-head {
    padding: 14px 18px 12px !important;
    gap: 10px !important;
  }
  .hx-modal-title { font-size: 17px !important; line-height: 1.25 !important; }
  .hx-modal-sub { font-size: 12px !important; }
  .hx-modal-body {
    padding: 14px 18px calc(80px + env(safe-area-inset-bottom)) !important;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto !important;
  }
  /* Constrain video so the metadata + link stay above the iOS bottom bar
     even on shorter phones (iPhone SE: 667px tall → 88dvh ≈ 587px) */
  .hx-modal-body video {
    max-height: 38vh !important;
  }
}

/* === Hide floating Intercom widget when modals open (was overlapping submit btns) === */
body:has(.hx-modal-backdrop) .intercom-lightweight-app,
body:has(.hx-modal-backdrop) .intercom-launcher-frame,
body:has(.hx-modal-backdrop) #intercom-container,
body:has(.cp-create-scrim) .intercom-lightweight-app,
body:has(.cp-create-scrim) .intercom-launcher-frame,
body:has(.cp-create-scrim) #intercom-container {
  display: none !important;
}
@media (max-width: 768px) {
  /* On mobile, the launcher overlaps primary CTAs in fullscreen modals — hide it whenever a modal is up */
  body:has(.cp-create-scrim) iframe[name^="intercom"],
  body:has(.hx-modal-backdrop) iframe[name^="intercom"] {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   Brand pronunciation dictionary — DictionaryPane styles
   ═══════════════════════════════════════════════════════════ */

/* Spinner keyframe reused across pane */
@keyframes dict-spin { to { transform: rotate(360deg); } }
.spin { animation: dict-spin 0.8s linear infinite; }

/* Empty / loading state inside the card */
.dict-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--ink-500);
  font-size: 13px;
}

/* Table overrides scoped to the dictionary table */
.dict-tbl { margin: 0; }
.dict-tbl thead th:last-child { text-align: right; }
.dict-tbl tbody td:last-child { text-align: right; white-space: nowrap; }

/* Row action icon buttons — --ink-500 is #86868B in BOTH themes, which
 * disappears on a #0B0B0F dark background. Use --ink-700 as the base
 * (adapts to theme) and --ink-1000 on hover so the buttons are legible
 * everywhere. */
.dict-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: var(--r-sm);
  color: var(--ink-700);
  cursor: pointer;
  transition: background var(--d-fast), color var(--d-fast);
}
.dict-icon-btn:hover { background: var(--ink-100); color: var(--ink-1000); }
.dict-icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* "Suggest" AI button inside the modal label row */
.dict-suggest-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline-strong);
  background: var(--bg-surface);
  color: var(--ink-700);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--d-fast);
  margin-left: auto;
}
.dict-suggest-btn:hover:not(:disabled) {
  background: var(--ink-100);
  color: var(--ink-1000);
  border-color: var(--ink-300);
}

/* ============================================================ */
/* Custom Video Composer (added 2026-07-08) — mirrors canon HTML */
/* /Users/harish/Downloads/HexCoded-Custom-Video-Composer-PRD-2026-06-30/design/canon/custom-composer.html */
/* ============================================================ */

/* TOOL layout */
.tool-wrap{display:grid;grid-template-columns:392px 1fr;height:100%;min-height:0;}
@media(max-width:1080px){.tool-wrap{grid-template-columns:348px 1fr;}}
.toolkit{border-right:1px solid var(--hairline);background:var(--bg-surface);display:flex;flex-direction:column;min-height:0;}
.tk-scroll{flex:1;overflow-y:auto;padding:18px 20px 10px;}
.tk-h{display:flex;align-items:center;gap:8px;font-family:var(--font-mono);font-size:9px;font-weight:700;letter-spacing:.13em;text-transform:uppercase;color:var(--ink-400);margin:0 0 13px;}
.tk-seclab{display:flex;align-items:center;gap:8px;font-size:9px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-400);margin:0 0 9px;}
.tk-seclab .sp{flex:1;}
.tk-sec{margin-top:16px;}
.tk-optnote{font-size:10px;font-weight:500;color:var(--ink-400);text-transform:none;letter-spacing:0;margin-left:2px;}

/* description textarea */
.tk-script{border:1px solid var(--hairline-strong);border-radius:var(--r-md);background:var(--bg-surface);overflow:hidden;transition:box-shadow var(--d-fast),border-color var(--d-fast),background var(--d-fast);}
.tk-script:focus-within{border-color:var(--green-400);box-shadow:var(--focus-ring);}
/* Drag-and-drop affordance — dashed green outline + subtle tint while a file
   is being dragged over the description box. Fires only when refs<MAX.
   dragDepthRef in the component tracks nested enter/leave so we don't need
   pointer-events:none (which would break the drop event on child nodes). */
.tk-script.is-dragging{border:1px dashed var(--green-500);background:var(--green-50);box-shadow:var(--focus-ring);}
.descbox .sc-ed{outline:none;font-size:14.5px;color:var(--ink-900);line-height:1.6;padding:12px 13px 6px;min-height:94px;width:100%;border:none;resize:none;background:transparent;font-family:inherit;}
.sc-ed:empty::before{content:attr(data-ph);color:var(--ink-400);line-height:1.6;}
.sc-foot{display:flex;align-items:center;gap:8px;padding:7px 12px 8px;border-top:1px solid var(--hairline);}
.sc-foot .addref{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;color:var(--ink-600);background:none;border:none;padding:0;cursor:pointer;}
.sc-foot .addref:hover{color:var(--green-700);}
.sc-foot .addref svg{width:13px;height:13px;}
.sc-foot .scnt{margin-left:auto;font-size:10px;color:var(--ink-400);font-family:var(--font-mono);}

/* reference thumbnails */
.tk-refs{display:flex;flex-wrap:wrap;gap:8px;margin:10px 2px 0;}
.tk-refs:empty{display:none;}
.tk-refthumb{position:relative;width:46px;height:46px;border-radius:9px;overflow:hidden;border:1px solid var(--hairline-strong);flex:none;}
.tk-refthumb img{width:100%;height:100%;object-fit:cover;display:block;}
.tk-refthumb .x{position:absolute;top:2px;right:2px;width:16px;height:16px;border-radius:50%;background:rgba(8,10,14,.66);color:#fff;border:none;display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0;}
.tk-refthumb .x svg{width:9px;height:9px;}
.tk-refadd{width:46px;height:46px;border-radius:9px;border:1.5px dashed var(--hairline-strong);background:var(--bg-soft);color:var(--ink-500);display:flex;align-items:center;justify-content:center;cursor:pointer;flex:none;}
.tk-refadd:hover{border-color:var(--green-400);color:var(--green-600);}
.tk-refadd svg{width:16px;height:16px;}

/* actor / product / output rows */
.tk-actor{display:flex;align-items:center;gap:11px;width:100%;text-align:left;padding:10px 12px;border:1px solid var(--hairline-strong);border-radius:var(--r-md);background:var(--bg-surface);transition:all var(--d-fast);min-height:58px;}
.tk-actor:hover{border-color:var(--green-400);}
.tk-actor.set{border-color:var(--green-300);background:color-mix(in srgb,var(--green-500) 4%,var(--bg-surface));}
.tk-actor .n{flex:0 0 23px;height:23px;border-radius:50%;border:1.5px solid var(--hairline-strong);display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;color:var(--ink-500);}
.tk-actor .n svg{width:14px;height:14px;}
.tk-actor .av{flex:0 0 32px;width:32px;height:32px;border-radius:50%;overflow:hidden;background:var(--media-well);border:1.5px solid var(--green-300);}
.tk-actor .av img{width:100%;height:100%;object-fit:cover;}
.tk-actor .lab{flex:1;min-width:0;}
.tk-actor .lab .t{font-size:13px;font-weight:700;color:var(--ink-1000);display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
.tk-actor .lab .s{font-size:11px;color:var(--ink-500);margin-top:1px;}
.tk-actor .chev{color:var(--ink-400);display:flex;}
.tk-actor .chev svg{width:15px;height:15px;}
/* output row variant */
.tk-actor.outset{min-height:52px;}
.tk-actor.outset .n{border-style:solid;color:var(--green-600);}
.tk-actor.outset .lab .s{font-family:var(--font-mono);font-size:10.5px;}

/* direction chips row */
.dirrow{display:flex;flex-wrap:wrap;gap:8px;}
.dirchip{display:inline-flex;align-items:center;gap:7px;height:34px;max-width:100%;padding:0 13px;border-radius:var(--r-pill);border:1px solid var(--hairline-strong);background:var(--bg-surface);font-size:12px;font-weight:600;color:var(--ink-700);transition:all var(--d-fast);cursor:pointer;min-width:0;}
.dirchip .v{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;}
.dirchip .k{flex-shrink:0;}
.dirchip:hover{border-color:var(--green-400);background:var(--accent-soft);}
.dirchip svg{width:13px;height:13px;color:var(--ink-500);}
.dirchip .k{font-family:var(--font-mono);font-size:8.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-400);}
.dirchip.filled{border-color:var(--green-500);background:var(--accent-soft);color:var(--green-700);}
.dirchip.filled svg{color:var(--green-600);}
.dirchip.filled .k{color:var(--green-600);}

/* CTA footer */
.tk-cta{flex-shrink:0;padding:12px 20px 15px;border-top:1px solid var(--hairline);background:var(--glass-bg-strong);backdrop-filter:var(--glass-blur);}
.tk-btnrow{display:flex;gap:9px;}
.tk-btnrow .btn-block{height:46px;}

/* split CTA wrapper */
.genwrap2{position:relative;display:flex;flex:1;min-width:0;width:100%;}
.genwrap2 .btn-block{flex:1 1 auto;width:auto;min-width:0;border-radius:var(--r-pill) 0 0 var(--r-pill);}
.genwrap2 .btn-caret{flex:0 0 42px;width:42px;height:46px;padding:0;border-radius:0 var(--r-pill) var(--r-pill) 0;border-left:1px solid rgba(255,255,255,.28);}
.genwrap2 .btn-caret svg{width:15px;height:15px;}
.genwrap2 .btn-primary{box-shadow:none;}
.split-caret{flex:0 0 auto;}

/* mode menu row (DockModeRow + ModeMenuRow) */
.gm2{display:flex;gap:11px;padding:10px 11px;border-radius:var(--r-sm);cursor:pointer;outline:none;}
.gm2:hover{background:var(--accent-soft);}
.gm2 .gmi{width:30px;height:30px;border-radius:8px;background:var(--green-50);color:var(--green-600);display:grid;place-items:center;flex:none;}
.gm2 .gmi svg{width:16px;height:16px;}
.gm2 b{font-size:12.5px;color:var(--ink-1000);}
.gm2 p{margin:2px 0 0;font-size:11px;color:var(--ink-500);line-height:1.4;}

/* picker popup variant */
.popup.picker{width:min(1180px,94vw);height:min(860px,90vh);}
.popup.picker .popup-head{padding:20px 24px 12px;border-bottom:none;}
.popup.picker .popup-body{padding:4px 24px 26px;}
.popup.picker .popup-foot{padding:12px 24px;background:var(--bg-soft);}

/* picker tab bar + search */
.pk-bar{display:flex;align-items:center;gap:12px;margin:2px 0 16px;flex-wrap:wrap;}
.pk-tabs{display:inline-flex;gap:6px;background:var(--ink-100);border-radius:var(--r-pill);padding:3px;}
.pk-tabs button{border:none;background:transparent;border-radius:var(--r-pill);padding:7px 15px;font-size:12px;font-weight:600;color:var(--ink-600);transition:all var(--d-fast);cursor:pointer;font-family:inherit;}
.pk-tabs button.on{background:var(--bg-surface);color:var(--ink-1000);box-shadow:var(--shadow-xs);}
.pk-search{margin-left:auto;display:flex;align-items:center;gap:8px;height:36px;padding:0 12px;border:1px solid var(--hairline-strong);border-radius:var(--r-pill);background:var(--bg-surface);min-width:200px;}
.pk-search svg{width:14px;height:14px;color:var(--ink-400);flex-shrink:0;}
.pk-search input{flex:1;border:none;background:transparent;outline:none;font-size:12.5px;font-family:inherit;color:var(--ink-900);min-width:0;}

/* picker tile — special (Director's choice / Custom) */
.wz-ftile.special .wz-fthumb{background:linear-gradient(150deg,var(--accent-soft-strong),var(--bg-soft));border:2px dashed var(--accent-border);display:flex;align-items:center;justify-content:center;color:var(--green-600);box-shadow:none;}
.wz-ftile.special .wz-fthumb svg{width:30px;height:30px;}
.wz-ftile.special:hover .wz-fthumb{transform:translateY(-2px);border-color:var(--green-500);}

/* category badge on tile thumb */
.wz-fcat{position:absolute;top:8px;right:8px;z-index:2;font-family:var(--font-mono);font-size:8px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#fff;background:rgba(0,0,0,.45);backdrop-filter:blur(6px);padding:3px 7px;border-radius:var(--r-pill);}

/* step dots + label in popup footer (scoped to picker so URL→Ad's pill-dot is unaffected) */
.popup.picker .wz-stepmini{display:inline-flex;align-items:center;gap:8px;}
.popup.picker .wz-stepmini .d{display:inline-flex;gap:4px;}
.popup.picker .wz-stepmini .d i{width:6px;height:6px;border-radius:50%;background:var(--hairline-strong);display:block;transition:none;}
.popup.picker .wz-stepmini .d i.on{width:6px;background:var(--green-500);}
.popup.picker .wz-stepmini b{font-weight:700;color:var(--ink-800);font-size:11.5px;}

/* length/aspect/quality pill */
.gpill{display:inline-flex;align-items:center;gap:6px;font-family:var(--font-mono);font-size:11px;font-weight:600;color:var(--ink-700);background:var(--ink-100);border:1px solid var(--hairline);border-radius:99px;padding:6px 11px;cursor:pointer;}
.gpill svg{width:12px;height:12px;color:var(--green-600);}
.gpill:hover{border-color:var(--green-400);}

/* output popover (LengthFormatPopover) */
.outpop{position:fixed;z-index:1500;width:300px;background:var(--bg-surface);border:1px solid var(--hairline-strong);border-radius:14px;box-shadow:var(--shadow-xl);padding:15px 16px 14px;display:none;}
.outpop.on{display:block;}
.op-k{font-family:var(--font-mono);font-size:9.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-500);margin:0 0 9px;display:flex;align-items:center;justify-content:space-between;}
.op-k.mt{margin-top:16px;}
.op-v{font-family:var(--font-mono);font-size:12px;color:var(--ink-900);letter-spacing:0;}
.op-ratios{display:flex;flex-wrap:wrap;gap:7px;}
.op-ratio{display:inline-flex;align-items:center;gap:7px;padding:6px 11px;border:1px solid var(--hairline-strong);border-radius:var(--r-pill);background:var(--bg-surface);font-size:12px;font-weight:700;color:var(--ink-700);cursor:pointer;transition:all var(--d-fast);}
.op-ratio .ar{border:1.6px solid currentColor;border-radius:2px;opacity:.45;display:block;flex:none;}
.op-ratio:hover{border-color:var(--green-400);}
.op-ratio.on{border-color:var(--green-500);background:var(--accent-soft);color:var(--green-700);}
.op-ratio.on .ar{opacity:1;}
.op-note{font-size:10.5px;color:var(--ink-400);margin-top:11px;}

/* segmented control inside outpop (quality) */
.toolkit .seg,.popup.picker .seg{display:flex;background:var(--ink-100);border-radius:var(--r-pill);padding:3px;gap:2px;}
.toolkit .seg button,.popup.picker .seg button{flex:1;border:none;background:transparent;border-radius:var(--r-pill);padding:8px 0;font-size:12.5px;font-weight:600;color:var(--ink-600);transition:all var(--d-fast);cursor:pointer;font-family:inherit;}
.toolkit .seg button.on,.popup.picker .seg button.on{background:var(--bg-surface);color:var(--ink-1000);box-shadow:var(--shadow-xs);}

/* duration slider row */
.vs-len{display:flex;align-items:center;gap:12px;}
.vs-len input[type=range]{flex:1;accent-color:var(--green-500);min-width:0;height:4px;}

/* spacer utility */
.toolkit .spacer,.popup.picker .spacer{flex:1;}
.dict-suggest-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ════════════════════════════════════════════════════════════════
   CREATIVE STUDIO — cs- namespace (ADR-0112/0114, 2026-07-22)
   ════════════════════════════════════════════════════════════════ */

/* ── Canvas layout ── */
.cs-canvas { flex: 1; display: grid; grid-template-columns: 332px minmax(0, 1fr); min-width: 0; min-height: 0; overflow: hidden; }
.cs-side { display: flex; flex-direction: column; border-right: 1px solid var(--hairline); background: var(--bg-surface); min-height: 0; overflow: hidden; }
.cs-side-scroll { flex: 1; overflow-y: auto; padding: 18px 16px 12px; }
.cs-side-scroll::-webkit-scrollbar { width: 8px; }
.cs-side-scroll::-webkit-scrollbar-thumb { background: var(--ink-200); border-radius: 8px; }
.cs-feed { overflow-y: auto; background: var(--bg-canvas); min-width: 0; padding: 28px 30px 60px; }

/* ── Toolkit header: uppercase mono label + seg toggle ── */
.cs-toolkit-label { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-400); padding: 0 2px 12px; }

/* ── Mode toggle (Image / Video seg) ── */
.cs-mode-toggle { display: flex; align-items: center; background: var(--seg-track); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.cs-mode-toggle button { flex: 1; border: none; background: transparent; border-radius: var(--r-pill); font-weight: 600; color: var(--ink-600); display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 10px; font-size: 12.5px; cursor: pointer; transition: all var(--d-fast); font-family: inherit; }
.cs-mode-toggle button svg { width: 14px; height: 14px; }
.cs-mode-toggle button.on { background: var(--seg-thumb); color: var(--ink-1000); box-shadow: var(--shadow-xs); }

/* ── Sub-nav underline tabs ── */
.cs-subnav { display: flex; gap: 18px; border-bottom: 1px solid var(--hairline); padding: 0 2px; margin-top: 14px; }
.cs-subnav button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--ink-500); font-weight: 600; font-size: 12.5px; padding: 2px 0 9px; margin-bottom: -1px; cursor: pointer; transition: color var(--d-fast); font-family: inherit; }
.cs-subnav button:hover { color: var(--ink-800); }
.cs-subnav button.on { color: var(--ink-1000); border-bottom-color: var(--green-500); }
.cs-subnav button:disabled { opacity: .45; cursor: not-allowed; }

/* ── Section block ── */
.cs-sec { margin-top: 18px; }
.cs-seclab { display: flex; align-items: baseline; justify-content: space-between; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-400); margin: 0 2px 8px; }
.cs-seclab .lb-l { display: inline-flex; align-items: center; gap: 6px; }
.cs-seclab .val { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-1000); letter-spacing: 0; }
.cs-seclab .val.dim { color: var(--ink-400); }
.cs-seclab .dim { color: var(--ink-400); }
.cs-optnote { font-size: 10px; color: var(--ink-500); margin-top: 6px; padding: 0 2px; font-family: var(--font-mono); }

/* ── Model quiet row ── */
.cs-model-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 10px; border: none; background: none; border-radius: var(--r-md); cursor: pointer; text-align: left; transition: background var(--d-fast); font-family: inherit; }
.cs-model-row:hover { background: color-mix(in srgb, var(--ink-1000) 4%, transparent); }
.cs-model-row .tx { flex: 1; min-width: 0; }
.cs-model-row .nm { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-1000); }
.cs-model-row .vl { display: block; font-size: 11px; color: var(--ink-500); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-model-row .ch { flex-shrink: 0; color: var(--ink-300); display: flex; }
.cs-model-row .ch svg { width: 16px; height: 16px; }

/* ── Maker-mark icon square ── */
.cs-maker-mark { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; font-weight: 800; color: #fff; }
.cs-maker-mark.google { background: #5B21B6; }
.cs-maker-mark.bytedance { background: #1D4ED8; }
.cs-maker-mark.kling { background: #EA580C; }
.cs-maker-mark.openai { background: #0F766E; }
.cs-maker-mark.recraft { background: #7C3AED; }
.cs-maker-mark.bfl { background: #27272A; }
.cs-maker-mark.runway { background: #BE123C; }
.cs-maker-mark svg { width: 17px; height: 17px; }

/* ── Prompt box (borderless canon style) ── */
.cs-prompt-box { border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--bg-surface); overflow: hidden; transition: box-shadow var(--d-fast), border-color var(--d-fast); }
.cs-prompt-box:focus-within { border-color: var(--green-400); box-shadow: var(--focus-ring); }
.cs-prompt-box.is-dragging { border: 1px dashed var(--green-500); background: var(--green-50); box-shadow: var(--focus-ring); }
.cs-prompt-box textarea { outline: none; font-size: 13.5px; color: var(--ink-900); line-height: 1.6; padding: 11px 13px 6px; min-height: 80px; width: 100%; border: none; resize: none; background: transparent; font-family: inherit; }
.cs-prompt-box textarea::placeholder { color: var(--ink-400); }
.cs-prompt-foot { display: flex; align-items: center; gap: 7px; padding: 7px 12px 8px; border-top: 1px solid var(--hairline); }
.cs-addref { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--ink-600); background: none; border: none; padding: 0; cursor: pointer; font-family: inherit; }
.cs-addref:hover { color: var(--green-700); }
.cs-addref svg { width: 13px; height: 13px; }
.cs-addref:disabled { opacity: .45; cursor: not-allowed; }
.cs-refcnt { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-400); }
.cs-refcnt b { color: var(--ink-700); font-weight: 600; }

/* ── Frames grid (start + end frame upload cards side by side) ── */
.cs-frames-grid { display: flex; gap: 6px; }
.cs-frame-slot { flex: 1; display: flex; flex-direction: row; align-items: center; gap: 8px; border: 1.5px dashed var(--hairline-strong); border-radius: var(--r-md); padding: 8px 10px; cursor: pointer; background: var(--bg-surface); transition: border-color var(--d-fast), background var(--d-fast); text-align: left; min-width: 0; }
.cs-frame-slot:hover { border-color: var(--green-400); background: var(--accent-soft); }
.cs-frame-slot.filled { border-style: solid; border-color: var(--green-300); background: color-mix(in srgb, var(--green-500) 4%, var(--bg-surface)); }
.cs-frame-slot .fs-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; color: var(--ink-400); flex-shrink: 0; }
.cs-frame-slot .fs-icon svg { width: 14px; height: 14px; }
.cs-frame-slot .fs-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cs-frame-slot .fs-label { font-size: 12px; font-weight: 600; color: var(--ink-1000); line-height: 1.2; }
.cs-frame-slot .fs-sub { font-size: 10px; color: var(--ink-500); line-height: 1.2; }
.cs-frame-slot img { width: 32px; height: 32px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }

/* ── Tooltip primitive (src/components/ui/Tooltip.jsx) ── */
.tooltip-wrap .tooltip-pop {
  position: absolute; z-index: 100; pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: opacity var(--d-fast, .12s), visibility var(--d-fast, .12s), transform var(--d-fast, .12s);
  background: var(--ink-1000, #0b0b0f); color: var(--ink-inverse, #fff);
  font-family: var(--font-body, inherit); font-size: 11.5px; font-weight: 500; line-height: 1.4;
  /* Reset text styling inherited from callers (e.g. .cs-seclab is uppercase +
     letter-spaced; without these resets the tooltip renders SHOUTY). */
  text-transform: none; letter-spacing: normal; font-style: normal;
  padding: 7px 10px; border-radius: 6px; box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,.25));
  max-width: 220px; width: max-content; text-align: left; white-space: normal;
}
/* Anchor tooltips to the trigger's left edge, growing right — avoids left-
   viewport clipping when the trigger sits near the sidebar. */
.tooltip-wrap .tooltip-pop.tooltip-top    { bottom: calc(100% + 6px); left: 0; transform: translateY(4px); }
.tooltip-wrap .tooltip-pop.tooltip-bottom { top: calc(100% + 6px);    left: 0; transform: translateY(-4px); }
.tooltip-wrap .tooltip-pop.tooltip-right  { left: calc(100% + 6px);   top: 50%; transform: translate(-4px, -50%); }
.tooltip-wrap .tooltip-pop.tooltip-left   { right: calc(100% + 6px);  top: 50%; transform: translate(4px, -50%); }
.tooltip-wrap:hover .tooltip-pop.tooltip-top,
.tooltip-wrap:focus-within .tooltip-pop.tooltip-top,
.tooltip-wrap:hover .tooltip-pop.tooltip-bottom,
.tooltip-wrap:focus-within .tooltip-pop.tooltip-bottom { opacity: 1; visibility: visible; transform: translateY(0); }
.tooltip-wrap:hover .tooltip-pop.tooltip-right,
.tooltip-wrap:focus-within .tooltip-pop.tooltip-right,
.tooltip-wrap:hover .tooltip-pop.tooltip-left,
.tooltip-wrap:focus-within .tooltip-pop.tooltip-left { opacity: 1; visibility: visible; transform: translate(0, -50%); }

/* ── Length slider ── */
.cs-length-slider input[type=range] { width: 100%; accent-color: var(--green-500); margin: 2px 0 0; }
.cs-length-slider input[type=range]:disabled { opacity: .45; }
.cs-length-ticks { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 9px; color: var(--ink-400); margin-top: 2px; }

/* ── Aspect ratio dropdown ── */
.cs-aspdrop { position: relative; }
.cs-aspbtn { width: 100%; display: flex; align-items: center; gap: 9px; height: 35px; padding: 0 11px; border: 1px solid var(--hairline-strong); border-radius: var(--r-sm); background: var(--bg-surface); font-size: 12px; font-weight: 600; color: var(--ink-1000); cursor: pointer; font-family: inherit; transition: border-color var(--d-fast); }
.cs-aspbtn:hover { border-color: var(--green-400); }
.cs-aspbtn .cs-cd { margin-left: auto; color: var(--ink-400); display: flex; transition: transform .18s; }
.cs-aspbtn .cs-cd svg { width: 14px; height: 14px; }
.cs-aspdrop.open .cs-aspbtn .cs-cd { transform: rotate(180deg); }
.cs-aspmenu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--bg-surface); border: 1px solid var(--hairline-strong); border-radius: var(--r-md); padding: 5px; z-index: 40; display: none; box-shadow: var(--shadow-lg); max-height: 250px; overflow: auto; }
.cs-aspdrop.open .cs-aspmenu { display: block; }
.cs-aspitem { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 7px; font-size: 12px; font-weight: 500; color: var(--ink-700); cursor: pointer; border: none; background: none; width: 100%; text-align: left; font-family: inherit; }
.cs-aspitem:hover { background: var(--bg-soft); }
.cs-aspitem.on { color: var(--green-700); font-weight: 600; background: var(--green-50); }
.cs-aspitem .cs-ck { margin-left: auto; color: var(--green-600); display: none; }
.cs-aspitem.on .cs-ck { display: flex; }
.cs-aspitem .cs-ck svg { width: 13px; height: 13px; }

/* ── Quality pills (segmented) ── */
.cs-quality-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.cs-quality-pills button { flex: 1; min-width: 52px; height: 32px; border: 1px solid var(--hairline-strong); border-radius: var(--r-sm); background: var(--bg-surface); font-size: 11.5px; font-weight: 700; color: var(--ink-600); cursor: pointer; transition: all var(--d-fast); font-family: inherit; }
.cs-quality-pills button:hover:not(:disabled) { border-color: var(--green-400); }
.cs-quality-pills button.on { border-color: var(--green-500); background: var(--green-50); color: var(--green-700); }
.cs-quality-pills button:disabled { opacity: .4; cursor: not-allowed; }

/* ── Generate CTA footer ── */
.cs-side-foot { padding: 13px 16px 15px; border-top: 1px solid var(--hairline); background: var(--bg-surface); flex-shrink: 0; }
.cs-generate-btn { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: var(--r-pill); font-size: 14px; font-weight: 700; border: none; background: linear-gradient(135deg, var(--green-500), var(--green-600)); color: #fff; box-shadow: var(--shadow-green-soft); cursor: pointer; transition: box-shadow var(--d-fast), background var(--d-fast); font-family: inherit; }
.cs-generate-btn:hover:not(:disabled) { background: linear-gradient(135deg, var(--green-500), var(--green-700)); box-shadow: var(--shadow-green); }
/* Prompt-first CTA pattern (see TalkingActors "Pick an actor to start"): stay
   visually active/green when disabled so the button invites the missing input
   instead of looking dead. cursor:not-allowed still signals inertness. */
.cs-generate-btn:disabled { cursor: not-allowed; opacity: .92; box-shadow: none; }
.cs-generate-btn svg { width: 16px; height: 16px; }
.cs-credit-chip { font-family: var(--font-mono); font-size: 12px; font-weight: 600; opacity: .95; background: rgba(255,255,255,.18); border-radius: 99px; padding: 2px 10px; margin-left: 2px; }
.cs-generate-btn:disabled .cs-credit-chip { background: rgba(0,0,0,.08); }

/* ── Feed area ── */
.cs-feed-title { font-family: var(--font-display); font-size: 21px; font-weight: 800; letter-spacing: -.02em; color: var(--ink-1000); }
.cs-feed-sub { font-size: 12.5px; color: var(--ink-500); margin-top: 3px; }
.cs-feed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(186px, 1fr)); gap: 16px; margin-top: 20px; }

/* ── Creation card ── */
.cs-creation-card { position: relative; aspect-ratio: 9/16; border-radius: 16px; overflow: hidden; border: 1px solid var(--hairline-strong); background: var(--media-well); cursor: pointer; display: block; text-align: left; min-width: 0; transition: box-shadow var(--d-base), transform var(--d-base); }
.cs-creation-card video, .cs-creation-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-creation-card.ready:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

/* ── New-creation card ── */
.cs-new-creation { position: relative; aspect-ratio: 9/16; border-radius: 16px; overflow: hidden; border: 1.5px dashed var(--green-500); background: var(--green-50); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; cursor: pointer; min-width: 0; transition: background var(--d-fast); }
.cs-new-creation:hover { background: color-mix(in srgb, var(--green-500) 13%, var(--bg-surface)); }
.cs-new-ic { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--green-400), var(--green-600)); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-green-soft); }
.cs-new-ic svg { width: 22px; height: 22px; }
.cs-new-t { font-size: 14px; font-weight: 800; color: var(--ink-1000); }
.cs-new-s { font-size: 11px; color: var(--ink-500); max-width: 84%; text-align: center; line-height: 1.4; }

/* ── Card overlays ── */
.cs-kind { position: absolute; top: 9px; left: 9px; z-index: 2; font-family: var(--font-mono); font-size: 8.5px; font-weight: 600; background: rgba(0,0,0,.5); backdrop-filter: blur(6px); color: #fff; padding: 3px 8px; border-radius: 99px; }
.cs-dl { position: absolute; top: 8px; right: 8px; z-index: 3; width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center; opacity: 0; transform: scale(.9); transition: all var(--d-fast); border: none; box-shadow: var(--shadow-md); cursor: pointer; }
.cs-dl svg { width: 14px; height: 14px; color: #111; }
.cs-creation-card.ready:hover .cs-dl { opacity: 1; transform: scale(1); }
.cs-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 12px 11px; background: linear-gradient(transparent, rgba(0,0,0,.78)); z-index: 2; pointer-events: none; }
.cs-mn { display: block; font-size: 12px; font-weight: 700; color: #fff; }
.cs-ms { display: block; font-size: 9.5px; color: rgba(255,255,255,.82); margin-top: 1px; font-family: var(--font-mono); }

/* ── Rendering card ── */
.cs-rendering { background: linear-gradient(162deg, #15281c, #0d1812) !important; display: flex; align-items: center; justify-content: center; cursor: default; border-color: var(--hairline); }
.cs-rend { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 0 16px; }
.cs-spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255,255,255,.16); border-top-color: #5fe49a; animation: cs-rot .9s linear infinite; }
@keyframes cs-rot { to { transform: rotate(360deg); } }
.cs-rt { font-size: 12px; font-weight: 700; color: #d6f2e2; }
.cs-rs { font-size: 9.5px; color: #86b59a; font-family: var(--font-mono); }

/* ── Model picker MODAL ── */
.cs-model-modal { position: fixed; inset: 0; z-index: 1100; background: rgba(0,0,0,.42); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 26px; }
.cs-model-modal-panel { position: relative; width: min(520px, 94vw); max-height: min(680px, 88vh); background: var(--bg-surface); border: 1px solid var(--hairline); border-radius: var(--r-xl); box-shadow: var(--shadow-xl); display: flex; flex-direction: column; overflow: hidden; }
.cs-modal-hd { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--hairline); }
.cs-modal-eye { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--green-700); }
.cs-modal-tt { font-family: var(--font-display); font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: var(--ink-1000); margin-top: 3px; }
.cs-modal-x { margin-left: auto; width: 31px; height: 31px; border-radius: 50%; border: 1px solid var(--hairline); background: var(--bg-surface); color: var(--ink-600); display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; font-family: inherit; }
.cs-modal-x:hover { background: var(--ink-100); }
.cs-modal-x svg { width: 15px; height: 15px; }
.cs-modal-search { margin: 12px 20px 2px; display: flex; align-items: center; gap: 9px; background: var(--bg-soft); border: 1px solid var(--hairline-strong); border-radius: var(--r-sm); padding: 8px 11px; color: var(--ink-500); }
.cs-modal-search svg { width: 14px; height: 14px; flex-shrink: 0; }
.cs-modal-search input { border: 0; background: transparent; color: var(--ink-1000); font: inherit; font-size: 12.5px; width: 100%; outline: none; }
.cs-modal-body { flex: 1; overflow-y: auto; padding: 10px 12px 16px; min-height: 0; }

/* ── Model list items ── */
.cs-model-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px; border-radius: var(--r-md); border: none; background: none; cursor: pointer; transition: background var(--d-fast); font-family: inherit; }
.cs-model-item:hover { background: var(--bg-soft); }
.cs-model-item.on { background: var(--accent-soft); }
.cs-model-item .cs-radio { width: 17px; height: 17px; border-radius: 50%; border: 1.5px solid var(--hairline-strong); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cs-model-item.on .cs-radio { border-color: var(--green-500); }
.cs-model-item.on .cs-radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green-500); }
.cs-model-item .cs-mt { flex: 1; min-width: 0; }
.cs-model-item .cs-mn { display: block; font-size: 13px; font-weight: 700; color: var(--ink-1000); }
.cs-model-item .cs-ms { display: block; font-size: 11px; color: var(--ink-500); margin-top: 1px; }

/* ── ReferencePicker modal ── */
@keyframes rpk-pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.rpk-tabs { display: flex; gap: 2px; padding: 0 0 14px; border-bottom: 1px solid var(--hairline); margin-bottom: 16px; }
.rpk-tab { padding: 6px 13px; border-radius: var(--r-sm); border: none; background: none; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink-600); cursor: pointer; transition: background var(--d-fast), color var(--d-fast); font-family: inherit; }
.rpk-tab:hover:not(.disabled) { background: var(--bg-soft); color: var(--ink-900); }
.rpk-tab.on { background: var(--accent-soft); color: var(--green-700); font-weight: 700; }
.rpk-tab.disabled { opacity: .5; cursor: not-allowed; }
.rpk-body { min-height: 520px; max-height: 70vh; overflow-y: auto; }
.rpk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.rpk-tile { position: relative; aspect-ratio: 1; border-radius: 14px; border: 1.5px dashed var(--hairline-strong); background: var(--bg-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; transition: border-color var(--d-fast), background var(--d-fast), transform var(--d-fast); font-family: inherit; padding: 0; }
.rpk-tile--asset:hover, .rpk-tile--actor:hover { transform: translateY(-1px); }
.rpk-tile:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }
.rpk-tile--upload:hover:not(:disabled) { border-color: var(--green-400); background: var(--green-50); }
.rpk-tile--upload:disabled { opacity: .4; cursor: not-allowed; }
.rpk-tile--asset { border-style: solid; border-color: var(--hairline); }
.rpk-tile--asset:hover { border-color: var(--green-400); }
.rpk-tile--actor { border-style: solid; border-color: var(--hairline); }
.rpk-tile--actor:hover { border-color: var(--green-400); }
.rpk-tile--skeleton { aspect-ratio: 1; border-radius: 8px; border: none; cursor: default; }
.rpk-empty { font-size: 12.5px; color: var(--ink-400); padding: 28px 0; align-self: center; }
