



@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/jetbrains-mono-cyrillic-ext-d2c25018.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/jetbrains-mono-cyrillic-4188276a.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/jetbrains-mono-greek-0164d0c0.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/jetbrains-mono-vietnamese-61f80dfe.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/jetbrains-mono-latin-ext-d5f407e2.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/jetbrains-mono-latin-d3dcdccd.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(/assets/manrope-cyrillic-ext-347c589d.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(/assets/manrope-cyrillic-93bef303.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(/assets/manrope-greek-6b478f45.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(/assets/manrope-vietnamese-ddbf28ce.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(/assets/manrope-latin-ext-27eccb1f.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(/assets/manrope-latin-8bd97e6b.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/manrope-cyrillic-ext-347c589d.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/manrope-cyrillic-93bef303.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/manrope-greek-6b478f45.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/manrope-vietnamese-ddbf28ce.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/manrope-latin-ext-27eccb1f.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/manrope-latin-8bd97e6b.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}



:root {

  
  
  --bg-base: #121212;                       
  --bg-sidebar: #171717;                    
  --bg-popover: #1c1c1c;                    
  --bg-panel: #1c1c1c;                      
  --bg-card: rgba(28, 28, 28, 0.6);         
  --bg-card-strong: rgba(28, 28, 28, 0.84); 
  --bg-glass: rgba(18, 18, 18, 0.88);       
  --reel-dim: rgba(18, 18, 18, 0.7);        
  --reel-dim-light: rgba(18, 18, 18, 0.2);  
  --bg-surface: rgba(0, 0, 0, 0.18);        
  --bg-control: rgba(0, 0, 0, 0.2);         
  --bg-inset: rgba(0, 0, 0, 0.12);          
  --bg-code: rgba(0, 0, 0, 0.3);            
  --bg-video: #000;                         
  --bg-on-media: rgb(0 0 0 / .6);           
  --bg-on-media-hover: rgb(0 0 0 / .8);
  --bg-backdrop: rgba(8, 8, 8, 0.72);       
  --bg-shade: rgba(0, 0, 0, 0.54);          

  
  --fill-faint: rgba(255, 255, 255, 0.03);
  --fill-subtle: rgba(255, 255, 255, 0.04);
  --fill-soft: rgba(255, 255, 255, 0.06);
  --fill-medium: rgba(255, 255, 255, 0.08);
  --fill-strong: rgba(255, 255, 255, 0.12);
  --fill-heavy: rgba(255, 255, 255, 0.16);

  
  --bg-hover: rgba(71, 85, 105, 0.22);
  --bg-hover-strong: rgba(71, 85, 105, 0.3);
  --bg-accent-faint: rgba(71, 85, 105, 0.18); 

  
  --text-strong: #fff;                      
  --text-main: #f0f0f5;                     
  --text-body: #d4d4d8;                     
  --text-soft: #a1a1aa;
  --text-muted: #8b8b99;                    
  --text-faint: rgba(255, 255, 255, 0.38);  
  --text-reading: #e0e0e0;                  
  --text-reading-sidebar: #e0e0e0;          
  --text-timestamp: #a1a1aa;                
  
  --spoken-around: #8f8f8f;                 
  --spoken-around-time: #66666c;            
  --spoken-said: #fff;                      
  --spoken-glow: rgba(255, 255, 255, 0.75); 
  
  --text-on-color: #fff;
  --text-on-color-dark: #111827;            

  
  --border: rgba(255, 255, 255, 0.08);      
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-hover: rgba(255, 255, 255, 0.2);
  --border-strong: rgba(148, 163, 184, 0.42);
  --border-focus: rgba(148, 163, 184, 0.68);
  --handle: rgba(148, 163, 184, 0.55);      

  
  --accent: #475569;
  --accent-hover: #64748b;
  --accent-light: #94a3b8;                  
  --focus-ring: 2px solid var(--accent);

  
  --inverse-bg: #fff;
  --inverse-bg-hover: #f1f5f9;
  --inverse-text: #111827;
  --inverse-text-muted: #374151;
  --inverse-text-faint: #4b5563;
  --inverse-fill: rgba(17, 24, 39, 0.08);
  --inverse-fill-strong: rgba(17, 24, 39, 0.16);
  --inverse-border: #e2e8f0;
  --inverse-border-hover: #cbd5e1;

  
  --status-green: #10b981;
  --status-amber: #f59e0b;
  --status-red: #ef4444;
  --status-gray: #6b7280;
  
  --status-purple: #6b4cff;

  --success: var(--status-green);
  --success-text: #6ee7b7;
  --success-bg: rgba(16, 185, 129, 0.08);
  --success-bg-strong: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.38);
  --success-ring: rgba(16, 185, 129, 0.12);
  --success-pulse: rgba(16, 185, 129, 0.4);
  --success-pulse-end: rgba(16, 185, 129, 0);

  --warning: var(--status-amber);
  --warning-text: #fde3c0;
  --warning-bg: rgba(245, 158, 11, 0.08);
  --warning-bg-strong: rgba(245, 158, 11, 0.14);
  --warning-border: rgba(245, 158, 11, 0.38);
  --warning-solid: rgba(245, 158, 11, 0.9);

  --danger: var(--status-red);
  --danger-strong: #dc2626;                 
  --danger-text: #fca5a5;
  --danger-bg: rgba(239, 68, 68, 0.08);
  --danger-bg-strong: rgba(239, 68, 68, 0.14);
  --danger-border: rgba(239, 68, 68, 0.35);
  --danger-border-strong: rgba(239, 68, 68, 0.72);
  --danger-ring: rgba(239, 68, 68, 0.12);
  --danger-light-bg: #fee2e2;               
  --danger-light-border: #f87171;
  --danger-light-text: #991b1b;

  --neutral-ring: rgba(107, 114, 128, 0.14);

  
  --badge-pending: rgba(245, 158, 11, 0.8);
  --badge-working: rgba(107, 76, 255, 0.8);   
  --badge-done: rgba(16, 185, 129, 0.8);
  --badge-failed: rgba(239, 68, 68, 0.8);
  --badge-none: rgba(107, 114, 128, 0.8);

  
  
  --pill-collection: var(--status-green);
  --pill-collection-text: var(--success-text);
  --pill-collection-border: rgba(16, 185, 129, 0.5);
  --pill-collection-bg: var(--success-bg);
  --pill-youtube: #ff0000;
  --pill-youtube-border: rgba(255, 0, 0, 0.55);
  --pill-youtube-bg: rgba(255, 0, 0, 0.06);

  
  --tag-category: var(--status-amber);
  --tag-subject: #38bdf8;
  --tag-entity: #8b98ab;
  --tag-category-outline: rgba(245, 158, 11, 0.34);
  --tag-subject-outline: rgba(56, 189, 248, 0.34);
  --tag-entity-outline: rgba(139, 152, 171, 0.28);

  
  --chart-bar: #3987e5;

  
  --chart-ours: #3987e5;
  --chart-cloudflare: #d95926;
  --chart-both: #199e70;
  --chart-four: #c98500;
  --chart-five: #d55181;
  --chart-six: #9085e9;

  
  
  --landing-cta: var(--status-green);
  --landing-cta-hover: #34d399;
  --landing-cta-text: #03140d;

  
  --landing-topic-category-bg: rgba(245, 158, 11, 0.07);
  --landing-topic-subject-bg: rgba(56, 189, 248, 0.07);
  --landing-topic-entity-bg: rgba(139, 152, 171, 0.08);
  --landing-topic-work-border: rgba(16, 185, 129, 0.75);
  --landing-topic-work-bg: rgba(16, 185, 129, 0.1);

  
  --finder-window: #1e1e20;
  --finder-bar: #2a2a2d;
  --finder-bar-line: rgba(0, 0, 0, 0.5);
  --finder-text: #e5e5e7;
  --finder-text-muted: #98989d;
  --finder-close: #ff5f57;
  --finder-minimise: #febc2e;
  --finder-zoom: #28c840;
  --finder-folder-back: #3d8fe0;
  --finder-folder: #63b0f7;
  --finder-file: #f2f2f4;
  --finder-file-fold: #c9c9ce;

  
  --switch-track: rgba(148, 163, 184, 0.25);
  --switch-track-on: rgba(16, 185, 129, 0.55);
  --switch-knob: #f0f0f5;

  
  --wave-color: #d1d1d6;
  --wave-blend: screen;
  --wave-reel-opacity: 0.34;

  
  --drop-target-bg: rgba(16, 185, 129, 0.16);

  
  --avatar-gradient: linear-gradient(135deg, rgba(71, 85, 105, 0.95), rgba(16, 185, 129, 0.6));

  
  --toast-action-on-color: rgba(255, 255, 255, 0.24);
  --toast-action-on-color-hover: rgba(255, 255, 255, 0.4);

  
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-popover: 0 14px 32px rgba(0, 0, 0, 0.5);
  --shadow-dialog: 0 24px 80px rgba(0, 0, 0, 0.55);
  --shadow-paper: 0 28px 80px rgba(0, 0, 0, 0.35);
  --shadow-drag: 0 8px 20px rgba(0, 0, 0, 0.55);
  --shadow-sidebar-left: 18px 0 40px rgba(0, 0, 0, 0.34);
  --shadow-sidebar-right: -18px 0 40px rgba(0, 0, 0, 0.34);
  --shadow-toast: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-toast-close: 0 2px 6px rgba(0, 0, 0, 0.08);

  
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-brand: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', 'SF Mono', Menlo, Consolas, monospace;

  
  --font-reading: Charter, 'Bitstream Charter', 'Sitka Text', Cambria, Georgia, serif;
  
  --reading-size: 1.125rem;    
  --reading-leading: 1.6;
  --reading-tracking: -0.003em;
  
  --reading-gap: 1.4em;
  
  --reading-thicken: 0.25px;
  
  --reading-size-sidebar: 1.0625rem; 
  --timestamp-size: 0.85em;    
  
  --reading-title-size: 2rem;        
  --reading-heading-size: 1.5rem;    
  
  --sidebar-title-size: 1.1875rem;   
  --sidebar-heading-size: 1rem;      
  
  --sidebar-row-size: 0.9375rem;     
  --sidebar-open-row-size: 1.0625rem; 
  --sidebar-message-size: 1rem;      

  --font-3xs: 0.625rem;   
  --font-2xs: 0.6875rem;  
  --font-xs: 0.75rem;     
  --font-sm: 0.8125rem;   
  --font-base: 0.875rem;  
  --font-md: 1rem;        
  --font-lg: 1.25rem;     
  --font-xl: 1.5rem;      

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --leading-tight: 1.3;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;

  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.04em;

  
  --radius-xs: 4px;       
  --radius-sm: 6px;       
  --radius-md: 8px;       
  --radius-lg: 12px;      
  --radius-xl: 16px;      
  --radius-pill: 999px;   
  --radius-round: 50%;    

  
  --control-xs: 20px;     
  --control-sm: 28px;     
  --control-md: 36px;     
  --control-lg: 38px;     
  --icon-sm: 14px;
  --icon-md: 16px;
  --icon-lg: 18px;
  --icon-xl: 20px;

  
  --duration-fast: 0.12s;   
  --duration-base: 0.16s;
  --duration-slow: 0.2s;    
  --duration-slower: 0.28s; 
  --duration-arrive: 0.9s;  
  --duration-unfold: 0.8s;  

  
  --sidebar-width: 300px;
  --sidebar-collapsed-width: 52px;
  --right-sidebar-width: 0px;
  --right-sidebar-expanded-width: 300px;
  --sidebar-toggle-size: var(--control-md);
  --sidebar-toggle-icon-size: var(--icon-xl);
  --sidebar-toggle-mobile-size: 32px;
  --mobile-top-mask-height: 60px;
  
  --app-bar-height: 0px;
  
  --page-gutter: 24px;
  --phone-bar-left: max(var(--page-gutter), env(safe-area-inset-left, 0px));
  --phone-bar-right: max(var(--page-gutter), env(safe-area-inset-right, 0px));
  
  --phone-bar-middle: 33px;
  --phone-bar-top: calc(var(--phone-bar-middle) - var(--sidebar-toggle-mobile-size) / 2 + env(safe-area-inset-top, 0px) + var(--app-bar-height));
  
  --phone-bar-button-left: max(calc(16px + (var(--sidebar-toggle-size) - var(--sidebar-toggle-mobile-size)) / 2), env(safe-area-inset-left, 0px));
  --phone-bar-button-right: max(calc(16px + (var(--sidebar-toggle-size) - var(--sidebar-toggle-mobile-size)) / 2), env(safe-area-inset-right, 0px));

  
  --layer-page-reel: -1;              
  
  --layer-sheet-pill: 100;
  --layer-sheet-pill-line: 101;
  --layer-mobile-top-mask: 99;
  --layer-page-heading: 101;
  --layer-sidebar-button-wide-screen: 105;
  --layer-sidebar-shading: 110;
  --layer-sidebar: 120;
  --layer-sidebar-button-narrow-screen: 130;
  --layer-app-bar: 140;               
  --layer-popup: 150;
  --layer-tooltip: 200;
  --layer-dialog: 1000;
  --layer-video-being-dragged: 2000;
}


@media (max-width: 600px) {
  :root {
    --page-gutter: 16px;

    
    --font-sm: 0.875rem;    
    --font-base: 1rem;      
    --font-md: 1.125rem;    
    --font-lg: 1.375rem;    
    --font-xl: 1.625rem;    

    
    --reading-size: 1.25rem;   
    --reading-leading: 1.65;
    --reading-gap: 1.25em;
    --reading-size-sidebar: 1.125rem; 
    --reading-title-size: 1.75rem;    
    --reading-heading-size: 1.5rem;   
    --sidebar-title-size: 1.25rem;    
    --sidebar-heading-size: 1.125rem; 
    
    --sidebar-row-size: 1rem;         
    --sidebar-open-row-size: 1.1875rem; 
    --sidebar-message-size: 1.0625rem; 
  }
}


@media (min-width: 601px) {
  :root {
    --bg-base: #0e0e0e;
    --bg-sidebar: #131313;
    --bg-popover: #181818;
    --bg-panel: #181818;
    --bg-card: rgba(24, 24, 24, 0.6);
    --bg-card-strong: rgba(24, 24, 24, 0.84);
    --bg-glass: rgba(14, 14, 14, 0.88);
    --reel-dim: rgba(14, 14, 14, 0.7);
    --reel-dim-light: rgba(14, 14, 14, 0.2);
    --text-reading-sidebar: #d4d4d4;
  }
}



:root[data-theme="light"] {
  color-scheme: light;

  
  --bg-base: #fff;
  --bg-sidebar: #fff;
  --bg-popover: #fff;
  --bg-panel: #fff;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-card-strong: rgba(255, 255, 255, 0.92);
  --bg-glass: rgba(255, 255, 255, 0.88);
  --reel-dim: rgba(255, 255, 255, 0.7);
  --reel-dim-light: rgba(255, 255, 255, 0.2);
  --bg-surface: rgba(36, 36, 36, 0.03);
  --bg-control: rgba(36, 36, 36, 0.04);
  --bg-inset: rgba(36, 36, 36, 0.02);
  --bg-code: rgba(36, 36, 36, 0.06);
  --bg-backdrop: rgba(36, 36, 36, 0.35);
  --bg-shade: rgba(36, 36, 36, 0.3);

  
  --fill-faint: rgba(36, 36, 36, 0.02);
  --fill-subtle: rgba(36, 36, 36, 0.03);
  --fill-soft: rgba(36, 36, 36, 0.045);
  --fill-medium: rgba(36, 36, 36, 0.06);
  --fill-strong: rgba(36, 36, 36, 0.09);
  --fill-heavy: rgba(36, 36, 36, 0.12);

  --bg-hover: rgba(71, 85, 105, 0.1);
  --bg-hover-strong: rgba(71, 85, 105, 0.16);
  --bg-accent-faint: rgba(71, 85, 105, 0.1);

  
  
  --text-strong: #0b0b10;
  --text-main: #0b0b10;
  --text-body: #18181b;
  --text-soft: #404040;
  --text-muted: #525252;
  --text-faint: rgba(36, 36, 36, 0.6);
  
  --text-reading: #242424;
  --text-reading-sidebar: #242424;
  --text-timestamp: #8a8a8a;
  
  --spoken-around: #767676;
  --spoken-around-time: #b8b8b8;
  --spoken-said: #000;
  --spoken-glow: transparent;

  
  --border: rgba(36, 36, 36, 0.1);
  --border-medium: rgba(36, 36, 36, 0.16);
  --border-hover: rgba(36, 36, 36, 0.24);
  --border-strong: rgba(71, 85, 105, 0.45);
  --border-focus: rgba(71, 85, 105, 0.7);
  --handle: rgba(71, 85, 105, 0.5);

  
  --inverse-bg: #18181b;
  --inverse-bg-hover: #27272a;
  --inverse-text: #fff;
  --inverse-text-muted: #e4e4e7;
  --inverse-text-faint: #d4d4d8;
  --inverse-fill: rgba(255, 255, 255, 0.12);
  --inverse-fill-strong: rgba(255, 255, 255, 0.2);
  --inverse-border: #3f3f46;
  --inverse-border-hover: #52525b;

  
  --status-green: #059669;
  --status-amber: #d97706;
  --status-red: #dc2626;

  --success-text: #047857;
  --success-bg: rgba(5, 150, 105, 0.08);
  --success-bg-strong: rgba(5, 150, 105, 0.12);
  --success-border: rgba(5, 150, 105, 0.38);
  --success-ring: rgba(5, 150, 105, 0.14);
  --success-pulse: rgba(5, 150, 105, 0.35);
  --success-pulse-end: rgba(5, 150, 105, 0);

  --warning-text: #92400e;
  --warning-bg: rgba(217, 119, 6, 0.08);
  --warning-bg-strong: rgba(217, 119, 6, 0.14);
  --warning-border: rgba(217, 119, 6, 0.4);
  --warning-solid: rgba(217, 119, 6, 0.9);

  --danger-strong: #b91c1c;
  --danger-text: #b91c1c;
  --danger-bg: rgba(220, 38, 38, 0.07);
  --danger-bg-strong: rgba(220, 38, 38, 0.12);
  --danger-border: rgba(220, 38, 38, 0.35);
  --danger-border-strong: rgba(220, 38, 38, 0.7);
  --danger-ring: rgba(220, 38, 38, 0.12);

  
  --pill-collection-border: rgba(5, 150, 105, 0.5);
  --tag-subject: #0284c7;
  --tag-entity: #64748b;
  --tag-category-outline: rgba(217, 119, 6, 0.4);
  --tag-subject-outline: rgba(2, 132, 199, 0.38);
  --tag-entity-outline: rgba(100, 116, 139, 0.32);

  --switch-track: rgba(100, 116, 139, 0.3);
  --switch-track-on: rgba(16, 185, 129, 0.85);
  --switch-knob: #fff;

  --wave-color: #52525b;
  --wave-blend: multiply;
  --wave-reel-opacity: 0.1;

  
  --shadow-sm: 0 2px 6px rgba(36, 36, 36, 0.1);
  --shadow-md: 0 4px 14px rgba(36, 36, 36, 0.08);
  --shadow-lg: 0 10px 30px rgba(36, 36, 36, 0.1);
  --shadow-popover: 0 14px 32px rgba(36, 36, 36, 0.14);
  --shadow-dialog: 0 24px 80px rgba(36, 36, 36, 0.2);
  --shadow-paper: 0 28px 80px rgba(36, 36, 36, 0.12);
  --shadow-drag: 0 8px 20px rgba(36, 36, 36, 0.2);
  --shadow-sidebar-left: 18px 0 40px rgba(36, 36, 36, 0.08);
  --shadow-sidebar-right: -18px 0 40px rgba(36, 36, 36, 0.08);
}



* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}



html {
  background-color: var(--bg-base);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  
  touch-action: manipulation;
  
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  color: var(--text-main);
  font-size: var(--font-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

.offline-page {
  max-width: 640px;
  margin: 96px auto;
  padding: 24px;
}



.text-muted {
  color: var(--text-muted);
}

.text-sm {
  font-size: var(--font-sm);
}

.mt-4 {
  margin-top: 24px;
}


.go-to-video { color: inherit; text-decoration: none; }
a.go-to-video { cursor: pointer; }
a.go-to-video:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
  outline: none;
}
@media (hover: hover) {
  a.go-to-video:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
    outline: none;
  }
}


.is-fading-in {
  animation: page-fade-in var(--duration-slow) ease;
}

.is-fading-in.is-arriving {
  animation-duration: var(--duration-arrive);
}

@media (prefers-reduced-motion: reduce) {
  .is-fading-in {
    animation: none;
  }
}


button {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-main);
  font-family: inherit;
  font-weight: var(--font-weight-medium);
  
  line-height: normal;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--duration-slow) ease, border-color var(--duration-slow) ease, color var(--duration-slow) ease, opacity var(--duration-slow) ease;
}

button svg,
.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--text-on-color);
}

@media (hover: hover) {
  .btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
  }
}

.btn-secondary {
  background: var(--fill-soft);
  border-color: var(--border);
  color: var(--text-main);
}

@media (hover: hover) {
  .btn-secondary:hover:not(:disabled) {
    background: var(--fill-strong);
    border-color: var(--border-medium);
    color: var(--text-strong);
  }
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-main);
}

@media (hover: hover) {
  .btn-outline:hover:not(:disabled) {
    background: var(--fill-soft);
    border-color: var(--border-strong);
  }
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

@media (hover: hover) {
  .btn-ghost:hover:not(:disabled) {
    background: var(--fill-soft);
    color: var(--text-main);
  }
}

.btn-danger {
  background: var(--status-red);
  border-color: var(--status-red);
  color: var(--text-on-color);
}

@media (hover: hover) {
  .btn-danger:hover:not(:disabled) {
    background: var(--danger-strong);
    border-color: var(--danger-strong);
    color: var(--text-on-color);
  }
}

.btn-outline.btn-danger,
.btn-danger.btn-outline {
  background: transparent;
  border-color: var(--status-red);
  color: var(--status-red);
}

@media (hover: hover) {
  .btn-outline.btn-danger:hover:not(:disabled),
  .btn-danger.btn-outline:hover:not(:disabled) {
    background: var(--status-red);
    border-color: var(--status-red);
    color: var(--text-on-color);
  }
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.btn.is-pending,
.toast-action.is-pending {
  cursor: wait;
}

.icon-spin svg,
svg.icon-spin {
  animation: icon-spin 0.85s linear infinite;
}

@keyframes icon-spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-block {
  width: 100%;
}

.btn-fixed {
  width: 140px;
  flex-shrink: 0;
}

.btn-sm {
  min-height: 32px;
  padding: 7px 10px;
  font-size: var(--font-sm);
}



.icon-btn {
  --icon-btn-size: var(--control-md);
  --icon-btn-icon: var(--icon-xl);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: var(--icon-btn-size);
  height: var(--icon-btn-size);
  padding: 0;
  color: var(--text-main);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease, color var(--duration-fast) ease;
}

.icon-btn svg,
.icon-btn i {
  display: block;
  flex: 0 0 auto;
  width: var(--icon-btn-icon);
  height: var(--icon-btn-icon);
}

.icon-btn:focus-visible {
  color: var(--text-strong);
  background: var(--bg-hover);
  border-color: var(--border);
}

@media (hover: hover) {
  .icon-btn:hover {
    color: var(--text-strong);
    background: var(--bg-hover);
    border-color: var(--border);
  }
}

.icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.icon-btn.is-muted {
  color: var(--text-muted);
}

.icon-btn.is-muted:focus-visible {
  color: var(--text-strong);
}

@media (hover: hover) {
  .icon-btn.is-muted:hover {
    color: var(--text-strong);
  }
}

.icon-btn.is-filled {
  background: var(--fill-soft);
  border-color: var(--border);
}

.icon-btn.is-filled:focus-visible {
  background: var(--fill-strong);
}

@media (hover: hover) {
  .icon-btn.is-filled:hover {
    background: var(--fill-strong);
  }
}

.icon-btn.is-floating {
  background: var(--bg-card-strong);
  border-color: var(--border);
}

.icon-btn.is-floating:focus-visible {
  background: var(--bg-hover);
}

@media (hover: hover) {
  .icon-btn.is-floating:hover {
    background: var(--bg-hover);
  }
}

.icon-btn.is-round {
  border-radius: var(--radius-round);
}

.icon-btn.is-sm {
  --icon-btn-size: var(--control-sm);
  --icon-btn-icon: var(--icon-md);
  border-radius: var(--radius-sm);
}

.icon-btn.is-xs {
  --icon-btn-size: var(--control-xs);
  --icon-btn-icon: var(--icon-sm);
  border-radius: var(--radius-sm);
}

.icon-btn[hidden] {
  display: none;
}


input[type="text"],
input[type="email"],
input[type="search"],
select,
textarea {
  background: var(--bg-control);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  outline: none;
  transition: border-color var(--duration-slow) ease, box-shadow var(--duration-slow) ease, background var(--duration-slow) ease;
}

input[type="text"] {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  border-color: var(--border-strong);
}


input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}


.input-with-clear {
  position: relative;
  display: block;
  min-width: 0;
}

.input-with-clear > input {
  width: 100%;
  margin-bottom: 0;
  padding-right: 36px;
}

.input-clear-btn {
  --clear-size: var(--control-xs);
  --clear-icon: var(--icon-sm);
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--clear-size);
  height: var(--clear-size);
  padding: 0;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: var(--radius-round);
  cursor: pointer;
  transition: background var(--duration-slow) ease, color var(--duration-slow) ease;
}

.input-clear-btn:focus-visible {
  background: var(--fill-strong);
  color: var(--text-main);
  outline: none;
}

@media (hover: hover) {
  .input-clear-btn:hover {
    background: var(--fill-strong);
    color: var(--text-main);
    outline: none;
  }
}

.input-clear-btn svg,
.input-clear-btn i {
  width: var(--clear-icon);
  height: var(--clear-icon);
}

.input-clear-btn[hidden] {
  display: none;
}


.switch {
  position: relative;
  flex: 0 0 auto;
  display: block;
  width: 34px;
  height: 20px;
  padding: 2px;
  border-radius: var(--radius-pill);
  background: var(--switch-track);
  cursor: pointer;
  transition: background var(--duration-base) ease;
}

.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}


.switch > span {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-pill);
  background: var(--switch-knob);
  transform: translateX(0);
  transition: transform var(--duration-base) ease;
  pointer-events: none;
}

.switch.is-on,
.switch:has(input:checked) {
  background: var(--switch-track-on);
}

.switch.is-on > span,
.switch:has(input:checked) > span {
  transform: translateX(14px);
}

.switch:has(input:focus-visible) {
  box-shadow: 0 0 0 2px var(--accent-hover);
}


.status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--status-gray);
  box-shadow: 0 0 0 4px var(--neutral-ring);
}

.status-dot.is-active {
  background: var(--status-green);
  box-shadow: 0 0 0 4px var(--success-ring);
}

.status-dot.is-error {
  background: var(--status-red);
  box-shadow: 0 0 0 4px var(--danger-ring);
}

.status-dot.is-paused {
  background: var(--status-gray);
  box-shadow: 0 0 0 4px var(--neutral-ring);
}


.popover {
  padding: 6px;
  color: var(--text-main);
  background: var(--bg-popover);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover);
}

.popover[hidden] {
  display: none;
}


.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  color: var(--text-main);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--font-sm);
  text-align: left;
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}

.menu-item:focus-visible {
  background: var(--fill-medium);
  outline: none;
}

@media (hover: hover) {
  .menu-item:hover {
    background: var(--fill-medium);
    outline: none;
  }
}

.menu-item.is-selected {
  background: var(--fill-strong);
  color: var(--text-strong);
}

.menu-item.is-danger {
  color: var(--danger-text);
}

.menu-item svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}


.menu-search {
  width: 100%;
  margin: 0 0 6px;
  padding: 8px 10px;
  color: var(--text-main);
  background: var(--bg-control);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--font-sm);
}

.menu-search:focus {
  outline: none;
  border-color: var(--border-strong);
}



.custom-select-wrap {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
  padding: 0 10px 0 12px;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  height: 34px;
  font: inherit;
  font-size: var(--font-sm);
  transition: border-color var(--duration-slow), background var(--duration-slow);
}

.custom-select-wrap.is-open .custom-select-trigger {
  border-color: var(--border-hover);
}

@media (hover: hover) {
  .custom-select-trigger:hover {
    border-color: var(--border-hover);
  }
}

.custom-select-trigger svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform var(--duration-slow) ease;
}

.custom-select-wrap.is-open .custom-select-trigger svg {
  transform: rotate(180deg);
}

.custom-select-popover {
  position: absolute;
  z-index: 100;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 240px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--duration-base) ease, transform var(--duration-base) ease, visibility var(--duration-base);
}

.custom-select-wrap.is-open .custom-select-popover {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateY(0);
}


.custom-select-wrap.is-drop-up .custom-select-popover {
  top: auto;
  bottom: calc(100% + 4px);
  transform: translateY(4px);
}

.custom-select-wrap.is-drop-up.is-open .custom-select-popover {
  transform: translateY(0);
}


.custom-select-check {
  flex: 0 0 auto;
  width: 0.9rem;
  height: 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  position: relative;
}

.custom-select-option.is-selected .custom-select-check {
  background: var(--accent);
  border-color: var(--accent);
}


.custom-select-option.is-selected .custom-select-check::after {
  content: '';
  position: absolute;
  left: 0.28rem;
  top: 0.08rem;
  width: 0.22rem;
  height: 0.45rem;
  border: solid var(--text-strong);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}


.list-filter-bar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}


.list-filter-search {
  flex: 1 1 14rem;
  min-width: 0;
}


.list-filter-bar input[type="search"],
.list-filter-bar input[type="text"] {
  width: 100%;
  height: 34px;
  margin-bottom: 0;
  padding: 0 2.25rem 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  font: inherit;
  font-size: var(--font-sm);
}

.list-filter-bar input[type="search"]:focus-visible,
.list-filter-bar input[type="text"]:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 1px;
}

.list-filter-bar select,
.list-filter-bar .custom-select-wrap {
  flex: 1 1 9rem;
  min-width: 0;
}

.list-filter-bar .custom-select-trigger {
  width: 100%;
}


.list-filter-bar.is-compact {
  container-type: inline-size;
  gap: 0.375rem;
}


.list-filter-bar.is-compact .list-filter-search,
.list-filter-bar.is-compact select,
.list-filter-bar.is-compact .custom-select-wrap {
  flex: 1 1 100%;
}

.list-filter-bar.is-compact .custom-select-trigger,
.list-filter-bar.is-compact input {
  font-size: var(--font-sm);
}


@container (min-width: 22rem) {
  .list-filter-bar.is-compact select,
  .list-filter-bar.is-compact .custom-select-wrap {
    flex: 1 1 8rem;
  }
}


@container (min-width: 34rem) {
  .list-filter-bar.is-compact .list-filter-search {
    flex: 1 1 12rem;
  }

  .list-filter-bar.is-compact .custom-select-trigger,
  .list-filter-bar.is-compact input {
    font-size: var(--font-sm);
  }
}

.list-filter-bar .custom-select-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.list-filter-bar .custom-select-wrap.is-chosen .custom-select-trigger {
  color: var(--inverse-text);
  background: var(--inverse-bg);
  border-color: var(--inverse-bg);
}

.list-filter-bar .custom-select-wrap.is-chosen.is-open .custom-select-trigger {
  border-color: var(--inverse-bg);
}

@media (hover: hover) {
  .list-filter-bar .custom-select-wrap.is-chosen .custom-select-trigger:hover {
    border-color: var(--inverse-bg);
  }
}

.list-filter-bar .custom-select-wrap.is-chosen .custom-select-trigger svg {
  color: var(--inverse-text-muted);
}


.list-filter-bar .list-filter-search.is-chosen input[type="search"] {
  color: var(--inverse-text);
  background: var(--inverse-bg);
  border-color: var(--inverse-bg);
}

.list-filter-bar .list-filter-search.is-chosen input[type="search"]::placeholder {
  color: var(--inverse-text-faint);
}

.list-filter-bar .list-filter-search.is-chosen .input-clear-btn {
  color: var(--inverse-text-muted);
}

.list-filter-bar .list-filter-search.is-chosen .input-clear-btn:focus-visible {
  color: var(--inverse-text);
  background: var(--inverse-fill);
}

@media (hover: hover) {
  .list-filter-bar .list-filter-search.is-chosen .input-clear-btn:hover {
    color: var(--inverse-text);
    background: var(--inverse-fill);
  }
}


.ax-search { width: 100%; max-width: 20rem; height: 32px; margin: 0; padding: 0 .65rem; color: var(--text-main); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); font: inherit; font-size: var(--font-sm); }
.ax-search:focus-visible { outline: var(--focus-ring); }
.ax-filter-bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.ax-filter-bar .ax-search { flex: 1 1 14rem; max-width: none; }

.ax-filter-bar:has(.ax-filter-box + .ax-filter-box) .ax-search { flex-basis: 10rem; }
.ax-filter-box { flex: 0 1 13rem; min-width: 0; }

.ax-filter-bar .ax-toolbar { position: static; z-index: auto; flex: 0 1 auto; margin: 0; padding: 0; background: none; border: 0; }
.ax-filter-bar .ax-toolbar .ai-date-range-popover { left: auto; right: 0; }
.ax-filter-bar .ax-toolbar :is([id$="Bucket"], [id$="CompareCustomSelect"]) { display: none; }
.ax-show { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
.ax-show > span { color: var(--text-muted); font-size: var(--font-sm); }
.is-narrow .ax-filter-bar .ax-search { flex: 1 1 100%; }
@media (max-width: 760px) {
  .ax-filter-box { flex: 1 1 100%; }
  .ax-filter-bar .ax-toolbar { display: flex; flex: 1 1 auto; }
}


.card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-card);
}

.card h2 {
  margin-bottom: 8px;
  font-size: var(--font-lg);
}


.ax-card { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: .85rem; min-width: 0; padding: 1rem; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.ax-card-head { margin: 0; padding: 0; display: flex; flex-direction: row; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .5rem 1rem; }
.ax-card-head > div:first-child { flex: 1 1 16rem; min-width: 0; }
.ax-card-head h3 { margin: 0; color: var(--text-strong); font-size: var(--font-base); font-weight: var(--font-weight-medium); }
.ax-card-head p { margin: .2rem 0 0; color: var(--text-muted); font-size: var(--font-sm); max-width: 52rem; }
.ax-card-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.ax-card-tools .custom-select-wrap { width: auto; min-width: 12rem; }

@media (max-width: 760px) {
  .ax-card { padding: .85rem; }
  .ax-card-tools, .ax-card-tools .custom-select-wrap { width: 100%; }
  
  #settingsView .ax-card-tools .custom-select-popover { left: 0; right: auto; width: 100%; min-width: 0; max-width: 100%; }
}


.notice {
  --notice-bg: var(--fill-subtle);
  --notice-border: var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px 10px 16px;
  color: var(--text-main);
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-radius: var(--radius-lg);
  font-size: var(--font-sm);
}

.notice[hidden] {
  display: none;
}

.notice.is-danger {
  --notice-bg: var(--danger-bg);
  --notice-border: var(--danger-border);
}

.notice.is-warning {
  --notice-bg: var(--warning-bg);
  --notice-border: var(--warning-border);
}

.notice-action {
  flex: 0 0 auto;
  padding: 6px 9px;
  color: inherit;
  background: var(--fill-medium);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font: inherit;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
}

.notice-action:focus-visible {
  background: var(--fill-heavy);
}

@media (hover: hover) {
  .notice-action:hover {
    background: var(--fill-heavy);
  }
}


.status-chip,
.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  background: var(--fill-faint);
  font-size: var(--font-xs);
  line-height: 1;
  white-space: nowrap;
}

.status-chip[data-state="active"] {
  color: var(--status-green);
  border-color: var(--success-border);
  background: var(--success-bg);
}


.status-chip[data-state="archived"] {
  color: var(--status-amber);
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

.status-chip[data-state="redirected"],
.status-chip[data-state="filed"],
.status-chip[data-state="merged"] {
  color: var(--status-amber);
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

.status-chip[data-state="failed"],
.status-chip[data-state="rejected"] {
  color: var(--status-red);
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

.status-chip[data-state="completed"],
.status-chip[data-state="kept"] {
  color: var(--status-green);
  border-color: var(--success-border);
  background: var(--success-bg);
}

.status-chip[data-state="awaiting_review"],
.status-chip[data-state="pending"] {
  color: var(--status-amber);
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

.topic-chip {
  color: var(--text-main);
}


.ax-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.ax-chip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .35rem; max-width: 100%; padding: .2rem .35rem .2rem .6rem; color: var(--text-muted); background: var(--bg-surface); border: 1px solid var(--border-medium); border-radius: var(--radius-pill); font-size: var(--font-sm); }
.ax-chip strong { color: var(--text-main); font-weight: var(--font-weight-medium); overflow-wrap: anywhere; }
.ax-chip-is { padding: 0 .35rem; color: var(--text-soft); background: var(--bg-hover); border: 0; border-radius: var(--radius-md); font: inherit; cursor: pointer; }
.ax-chip-back { padding: .1rem .5rem; color: var(--text-main); background: var(--bg-hover); border: 0; border-radius: var(--radius-pill); font: inherit; cursor: pointer; }
.ax-chip-x { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; color: var(--text-muted); background: none; border: 0; border-radius: 50%; font-size: 1rem; line-height: 1; cursor: pointer; }
@media (hover: hover) {
  .ax-chip-x:hover {
    color: var(--text-strong);
    background: var(--bg-hover);
  }
}



.removal-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--layer-dialog);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-backdrop);
  backdrop-filter: blur(4px);
}


dialog.removal-dialog-overlay {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  overflow: auto;
  color: inherit;
}

dialog.removal-dialog-overlay:not([open]) {
  display: none;
}


dialog.removal-dialog-overlay::backdrop {
  background: transparent;
}

.removal-dialog {
  width: min(520px, 100%);
  
  margin: auto;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-dialog);
}

.removal-dialog-copy h2 {
  margin: 0 0 10px;
  font-size: var(--font-xl);
}

.removal-dialog-copy p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-sm);
  line-height: var(--leading-relaxed);
}


.removal-dialog-consequences {
  display: grid;
  gap: 8px;
  margin: 20px 0;
  padding-left: 20px;
  color: var(--text-muted);
  font-size: var(--font-sm);
  line-height: var(--leading-relaxed);
}

.removal-dialog-consequences li::marker {
  color: var(--text-muted);
}

.removal-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}


.app-dialog {
  position: fixed;
  inset: 0;
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  color: var(--text-main);
  background: var(--bg-sidebar);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-dialog);
}

.app-dialog::backdrop {
  background: var(--bg-backdrop);
  backdrop-filter: blur(4px);
}


.app-dialog[data-anchor="sidebar"] {
  width: min(520px, calc(100vw - var(--right-sidebar-width) - 48px));
  margin-right: calc(var(--right-sidebar-width) + 16px);
  margin-left: auto;
}


@media (max-width: 1200px) {
  .app-dialog[data-anchor="sidebar"] {
    width: min(680px, calc(100vw - 32px));
    margin-right: auto;
  }
}

.app-dialog form {
  display: grid;
  gap: 14px;
  max-height: calc(100dvh - 48px);
  padding: 20px;
  overflow-y: auto;
}

.app-dialog label {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.app-dialog input:not([type="checkbox"]):not([type="radio"]),
.app-dialog select,
.app-dialog textarea {
  width: 100%;
  margin: 0;
  padding: 9px 11px;
  color: var(--text-main);
  background: var(--bg-control);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
}


.regenerate-dialog-note {
  margin: -4px 0 0;
  color: var(--text-muted);
  font-size: var(--font-xs);
  line-height: var(--leading-normal);
}


.already-in-library-note {
  margin: -4px 0 0;
  color: var(--text-muted);
  font-size: var(--font-xs);
  line-height: var(--leading-normal);
}


.already-in-library-dialog .dialog-actions a.btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dialog-header h3 {
  margin: 0;
  font-size: var(--font-md);
}

.dialog-header p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: var(--font-sm);
  line-height: var(--leading-normal);
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}


@media (max-width: 640px) {
  :is(.app-dialog, .ai-admin-dialog) {
    inset: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px);
    overscroll-behavior: contain;
  }

  :is(.app-dialog, .ai-admin-dialog)[open] {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  :is(.app-dialog, .ai-admin-dialog) > :is(form, .tag-definition-form) {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding: 20px 20px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    outline: none;
  }

  :is(.app-dialog, .ai-admin-dialog) :is(.dialog-actions, .ai-dialog-actions) {
    position: sticky;
    z-index: 1;
    bottom: 0;
    margin: 0 -20px;
    padding: 12px 20px;
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border);
  }

  .removal-dialog-overlay {
    padding: 12px;
  }
}


.removal-dialog-link {
  align-self: flex-start;
  font-size: var(--font-sm);
  color: var(--accent);
  text-decoration: none;
}

.removal-dialog-link:focus-visible {
  text-decoration: underline;
}

@media (hover: hover) {
  .removal-dialog-link:hover {
    text-decoration: underline;
  }
}


.tag-dialog { display: grid; gap: 14px; }
.tag-dialog-field { display: grid; gap: 6px; color: var(--text-muted); font-size: var(--font-sm); }
.tag-dialog-field input, .tag-dialog-search { width: 100%; }
.tag-dialog-list {
  display: grid; align-content: start; gap: 2px; max-height: 18rem; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 6px; background: var(--bg-surface);
}
.tag-dialog-list > p { margin: 6px; }
.tag-dialog-row {
  display: flex; align-items: baseline; gap: 8px; width: 100%;
  padding: 7px 9px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none;
  text-align: left; color: var(--text-main); font: inherit; font-size: var(--font-sm); cursor: pointer;
}
.tag-dialog-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-dialog-row > small { margin-left: auto; color: var(--text-muted); flex: 0 0 auto; }
@media (hover: hover) {
  .tag-dialog-row:hover {
    background: var(--fill-subtle);
  }
}
.tag-dialog-row.is-chosen { border-color: var(--pill-collection-border); background: var(--pill-collection-bg); }
.tag-dialog-row.is-chosen > span { color: var(--pill-collection-text); }


.app-tooltip {
  position: fixed;
  z-index: var(--layer-tooltip);
  max-width: 340px;
  padding: 7px 10px;
  background: var(--bg-popover);
  color: var(--text-main);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
  font-size: var(--font-sm);
  line-height: var(--leading-tight);
  
  white-space: pre-line;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(2px);
  
  transition: opacity var(--duration-fast) ease, transform var(--duration-fast) ease, visibility var(--duration-fast);
}

.app-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .app-tooltip {
    transition: none;
  }
}



.toast-stack {
  position: fixed;
  top: calc(24px + var(--app-bar-height));
  right: 24px;
  width: min(560px, calc(100vw - 48px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: var(--layer-dialog);
  pointer-events: none;
}


.toast-stack[popover] {
  inset: auto;
  top: 24px;
  right: 24px;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: visible;
  background: transparent;
  color: inherit;
}

.toast-stack:popover-open {
  display: flex;
}

.toast {
  position: relative;
  max-width: min(560px, calc(100vw - 48px));
  background: var(--inverse-bg);
  color: var(--inverse-text);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  line-height: var(--leading-tight);
  transform: translateY(-100px);
  opacity: 0;
  transition: all var(--duration-slower) cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  box-shadow: var(--shadow-toast);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  background: var(--status-red);
  color: var(--text-on-color);
}

.toast.warning {
  background: var(--status-amber);
  color: var(--text-on-color-dark);
}

.toast.sticky {
  cursor: pointer;
}

.toast-close {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--inverse-border);
  border-radius: var(--radius-round);
  background: var(--inverse-bg);
  color: var(--accent-hover);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity var(--duration-slow) cubic-bezier(0.16, 1, 0.3, 1),
    transform var(--duration-slow) cubic-bezier(0.16, 1, 0.3, 1),
    background-color var(--duration-slow) ease,
    border-color var(--duration-slow) ease,
    color var(--duration-slow) ease;
  z-index: 10;
  box-shadow: var(--shadow-toast-close);
  padding: 0;
}

.toast:hover .toast-close {
  opacity: 1;
  transform: scale(1);
}

@media (hover: hover) {
  .toast-close:hover {
    background: var(--inverse-bg-hover);
    border-color: var(--inverse-border-hover);
    color: var(--inverse-text);
  }
}


.toast.error .toast-close {
  background: var(--inverse-bg);
  border-color: var(--danger-text);
  color: var(--danger);
}

@media (hover: hover) {
  .toast.error .toast-close:hover {
    background: var(--danger-light-bg);
    border-color: var(--danger-light-border);
    color: var(--danger-light-text);
  }
}

.toast-message {
  min-width: 0;
}

.toast-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toast-action {
  border: 0;
  border-radius: var(--radius-md);
  background: var(--inverse-fill);
  color: inherit;
  padding: 7px 10px;
  font: inherit;
  font-size: var(--font-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
}

.toast.error .toast-action {
  background: var(--toast-action-on-color);
}

.toast.warning .toast-action {
  background: var(--toast-action-on-color);
}

.toast-action:focus-visible {
  background: var(--inverse-fill-strong);
}

@media (hover: hover) {
  .toast-action:hover {
    background: var(--inverse-fill-strong);
  }
}

.toast.error .toast-action:focus-visible {
  background: var(--toast-action-on-color-hover);
}

@media (hover: hover) {
  .toast.error .toast-action:hover {
    background: var(--toast-action-on-color-hover);
  }
}

.toast.warning .toast-action:focus-visible {
  background: var(--toast-action-on-color-hover);
}

@media (hover: hover) {
  .toast.warning .toast-action:hover {
    background: var(--toast-action-on-color-hover);
  }
}



.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 8px 12px 9px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  font-size: var(--font-base);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: color var(--duration-base) ease, border-color var(--duration-base) ease;
}

@media (hover: hover) {
  .tab:hover {
    color: var(--text-main);
  }
}

.tab.is-active {
  color: var(--text-main);
  border-bottom-color: var(--accent-hover);
}



.status-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-lg);
  font-size: var(--font-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
}

.status-badge.icon-only {
  overflow: visible;
}

.status-attention-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-round);
  background: var(--status-red);
  border: 2px solid var(--bg-popover);
  box-shadow: 0 0 0 1px var(--border-hover);
}


.status-attention-dot.is-working {
  background: var(--status-purple);
}

.status-popover-wrap {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}

.status-popover-wrap .status-badge {
  pointer-events: auto;
}

.status-popover {
  position: absolute;
  z-index: 90;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  width: 100%;
  max-height: min(480px, calc(100dvh - 160px));
  overflow-y: auto;
  border: 1px solid var(--border-medium);
  border-radius:0 0 var(--radius-xl) var(--radius-xl);
  box-shadow: var(--shadow-popover);
  padding: 14px;
  color: var(--text-main);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--duration-base) ease, transform var(--duration-base) ease, visibility var(--duration-base);
  text-transform: none;
}

.status-popover-wrap.is-open .status-popover {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateY(0);
  background: var(--bg-popover);
  backdrop-filter: blur(40px) saturate(150%);
}

@media (hover: hover) {
  .status-popover-wrap:not(.is-hover-suppressed):has(.status-badge:hover) .status-popover,
  .status-popover-wrap:not(.is-hover-suppressed):has(.status-popover:hover) .status-popover {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translateY(0);
    background: var(--bg-popover);
    backdrop-filter: blur(40px) saturate(150%);
  }
}

.status-popover-title {
  font-size: var(--font-xs);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 10px;
  color: var(--text-main);
}

.status-log-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.status-log-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.status-log-dot {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: var(--radius-round);
  background: var(--text-muted);
}

.status-log-success .status-log-dot {
  background: var(--status-green);
}

.status-log-error .status-log-dot {
  background: var(--danger);
}

.status-log-working .status-log-dot {
  background: var(--status-purple);
}

.status-log-warning .status-log-dot {
  background: var(--warning);
}

.status-log-title {
  font-size: var(--font-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--leading-tight);
  color: var(--text-main);
}

.status-log-detail {
  margin-top: 2px;
  font-size: var(--font-xs);
  line-height: var(--leading-tight);
  color: var(--text-muted);
}


.status-log-technical {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: var(--font-3xs);
  line-height: 1.35;
  color: var(--text-faint);
  word-break: break-word;
}

.status-log-action {
  align-self: center;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--fill-medium);
  color: var(--text-main);
  padding: 5px 8px;
  font-size: var(--font-xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  cursor: pointer;
}


.status-log-item:has(> .status-log-link) {
  grid-template-columns: 9px minmax(0, 1fr);
}

.status-log-link {
  grid-column: 2;
  justify-self: start;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}

.status-log-action:focus-visible {
  background: var(--fill-heavy);
  border-color: var(--border-hover);
}

@media (hover: hover) {
  .status-log-action:hover {
    background: var(--fill-heavy);
    border-color: var(--border-hover);
  }
}

.status-badge.icon-only {
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-round);
}

.status-pending {
  background: var(--badge-pending);
  color: var(--text-on-color);
}

.status-processing {
  background: var(--badge-working);
  color: var(--text-on-color);
}

.status-completed {
  background: var(--badge-done);
  color: var(--text-on-color);
}

.status-failed {
  background: var(--badge-failed);
  color: var(--text-on-color);
}

.status-no_transcript,
.status-no_speech,
.status-not_found_yet {
  background: var(--badge-none);
  color: var(--text-on-color);
}


.row-actions {
  --row-action-size: 22px;
  --row-action-icon: 13px;
  display: none;
  flex: 0 0 auto;
  gap: 2px;
}

.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--row-action-size);
  height: var(--row-action-size);
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

@media (hover: hover) {
  .row-action:hover {
    color: var(--text-main);
    background: var(--fill-medium);
  }
}

.row-action:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 1px;
}

.row-action i,
.row-action svg {
  width: var(--row-action-icon);
  height: var(--row-action-icon);
}




.tags-tree-row.is-drop-target,
.topic-notepad-editor.is-drop-target {
  outline: 1px solid var(--status-green);
  background: var(--drop-target-bg);
}


.drag-picture {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--layer-video-being-dragged);
  pointer-events: none;
  padding: 8px 14px;
  color: var(--text-main);
  background: var(--bg-popover);
  border: 1px solid var(--status-green);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-drag);
  font-size: var(--font-sm);
}


.wordmark {
  --wordmark-icon: 0.588em;
  --wordmark-gap: 0.18em;
  --wordmark-shade: var(--accent-light);
  --wordmark-stroke: 2.3;
  display: inline-flex;
  
  align-items: baseline;
  gap: var(--wordmark-gap);
  color: var(--text-strong);
  font-family: var(--font-brand);
  font-size: var(--font-lg);
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.wordmark-icon {
  flex: none;
  width: var(--wordmark-icon);
  height: var(--wordmark-icon);
  color: var(--wordmark-shade);
  stroke-width: var(--wordmark-stroke);
  overflow: visible;
}

.wordmark-mind {
  font-weight: 300;
}

.wordmark-spool {
  font-weight: 700;
}



.install-app-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  background: var(--bg-card-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.install-app-row[data-install-app-place="sidebar"] {
  margin-bottom: 20px;
}

.install-app-row[data-install-app-place="sign-in"] {
  width: 100%;
  max-width: 440px;
  border-color: var(--border-medium);
}

.install-app-icon {
  flex: none;
  border-radius: 22%;
  box-shadow: 0 0 0 1px var(--border-medium);
}

.install-app-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  line-height: var(--leading-tight);
}

.install-app-name {
  color: var(--text-strong);
  font-family: var(--font-brand);
  font-weight: var(--font-weight-bold);
}

.install-app-subtitle {
  overflow: hidden;
  color: var(--text-muted);
  font-size: var(--font-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.install-app-button {
  flex: none;
  padding-inline: 14px;
  border-radius: var(--radius-pill);
}


:root.has-app-bar {
  --app-bar-height: 52px;
}

:root.has-app-bar body {
  padding-top: var(--app-bar-height);
}

.install-app-bar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: var(--layer-app-bar);
  height: var(--app-bar-height);
  gap: 12px;
  padding: 0 16px 0 12px;
  background: var(--bg-sidebar);
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

.install-app-bar .install-app-icon {
  width: 32px;
  height: 32px;
}

.install-app-bar-close {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  color: var(--text-muted);
  background: var(--bg-hover);
  border: 0;
  border-radius: var(--radius-round);
  cursor: pointer;
}

.install-app-bar-close:focus-visible {
  color: var(--text-strong);
  background: var(--bg-hover-strong);
}

@media (hover: hover) {
  .install-app-bar-close:hover {
    color: var(--text-strong);
    background: var(--bg-hover-strong);
  }
}


.opened-in-app-page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  font-family: var(--font-brand);
  text-align: center;
}

.opened-in-app-page h1 {
  margin: 8px 0 0;
  color: var(--text-strong);
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.opened-in-app-page p {
  margin: 0;
  color: var(--text-muted);
}



.settings-grid:has(> .ax-page:not([hidden])) {
  width: min(1400px, calc(100% - 48px));
  max-width: 1400px;
}

.ax-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; min-width: 0; }
.ax-page[hidden] { display: none; }
.ax-page .operations-heading { align-items: flex-start; margin-bottom: 0; }
.ax-heading-side { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .75rem; }
.ax-content { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; min-width: 0; transition: opacity var(--duration-base) ease; }
.ax-content.is-reading { opacity: .55; }
.ax-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; min-width: 0; }

.ax-note { margin: 0; color: var(--text-muted); font-size: var(--font-sm); max-width: 62rem; }
.ax-link { padding: 0; color: var(--text-main); background: none; border: 0; font: inherit; text-align: left; text-decoration: underline; text-decoration-color: var(--text-faint); text-underline-offset: 3px; cursor: pointer; }
@media (hover: hover) {
  .ax-link:hover {
    text-decoration-color: currentColor;
  }
}
.ax-person { overflow-wrap: anywhere; }
.ax-unseen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ax-only-mouse { display: none; }
@media (hover: hover) and (pointer: fine) { .ax-only-mouse { display: inline; } }


.ax-toolbar:not(.is-ready) { visibility: hidden; }
.ax-toolbar[hidden] { display: none; }
.ax-toolbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin: 0 -.5rem;
  padding: .5rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.ax-content > .ax-toolbar { margin: 0; }
.ax-toolbar .custom-select-wrap { flex: 0 1 auto; width: auto; min-width: 9rem; }
.ax-toolbar .ai-date-range-popover { top: calc(100% + .35rem); left: .5rem; right: auto; }


#settingsView .ax-toolbar .custom-select-wrap.is-chosen:not(#axPeriodCustomSelect, #opsPeriodCustomSelect, #aiPeriodCustomSelect, #videosPeriodCustomSelect) .custom-select-trigger,
#settingsView :is(#axPeriodCustomSelect, #opsPeriodCustomSelect, #aiPeriodCustomSelect):not([data-value="30"]) .custom-select-trigger,
#settingsView #videosPeriodCustomSelect:not([data-value="all"]) .custom-select-trigger { color: var(--inverse-text); background: var(--inverse-bg); border-color: var(--inverse-bg); }
#settingsView .ax-toolbar .custom-select-wrap.is-chosen:not(#axPeriodCustomSelect, #opsPeriodCustomSelect, #aiPeriodCustomSelect, #videosPeriodCustomSelect) .custom-select-trigger svg,
#settingsView :is(#axPeriodCustomSelect, #opsPeriodCustomSelect, #aiPeriodCustomSelect):not([data-value="30"]) .custom-select-trigger svg,
#settingsView #videosPeriodCustomSelect:not([data-value="all"]) .custom-select-trigger svg { color: var(--inverse-text-muted); }
.ax-switch-row { display: inline-flex; align-items: center; gap: .5rem; margin: 0; color: var(--text-soft); font-size: var(--font-sm); cursor: pointer; }
.ax-toolbar .ax-switch-row { margin-left: auto; padding: 0 .35rem; }

.ax-toggle { display: inline-flex; flex: 0 0 auto; padding: 2px; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-surface); }
.ax-toggle button { padding: .25rem .6rem; color: var(--text-muted); background: transparent; border: 0; border-radius: calc(var(--radius-md) - 2px); font: inherit; font-size: var(--font-sm); white-space: nowrap; cursor: pointer; }
@media (hover: hover) {
  .ax-toggle button:hover {
    color: var(--text-main);
  }
}
.ax-toggle button.is-active { color: var(--text-strong); background: var(--bg-hover); }

.ax-tabs { overflow-x: auto; scrollbar-width: none; }
.ax-tabs::-webkit-scrollbar { display: none; }
.ax-tabs .tab { flex: 0 0 auto; white-space: nowrap; }

.ax-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 1rem; min-width: 0; }
.ax-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; min-width: 0; }
.ax-grid-3 > :last-child:nth-child(3n+1) { grid-column: 1 / -1; }
@media (max-width: 1250px) {
  .ax-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ax-grid-3 > :last-child:nth-child(3n+1) { grid-column: auto; }
  .ax-grid-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.ax-small-multiples { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: 1.25rem 1.5rem; min-width: 0; }
.ax-hint { margin: -.4rem 0 0; color: var(--text-faint); font-size: var(--font-xs); }
.ax-insights { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; font-size: var(--font-sm); color: var(--text-body); }
.ax-insights li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .15rem 1rem; padding-bottom: .6rem; border-bottom: 1px solid var(--border); }
.ax-insights li:last-child { padding-bottom: 0; border-bottom: 0; }
.ax-insights span { flex: 1 1 16rem; }
.ax-more { justify-self: start; }
.ax-heading-side .btn { white-space: nowrap; }

@media (max-width: 760px) {
  .ax-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .settings-grid:has(> .ax-page:not([hidden])) { width: calc(100% - 24px); }
  .ax-toolbar { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
  .ax-toolbar .custom-select-wrap { width: 100%; min-width: 0; }
  .ax-toolbar .ax-toggle { display: flex; min-width: 0; }
  .ax-toolbar .ax-toggle button { flex: 1 1 auto; padding: .25rem .15rem; }
  #settingsView .ax-toolbar .custom-select-trigger { gap: .25rem; }
  .ax-toggle { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .ax-toggle::-webkit-scrollbar { display: none; }
  .ax-toolbar .ax-switch-row { grid-column: 1 / -1; margin-left: 0; }
  #axCompareCustomSelect .custom-select-popover, #axWhoCustomSelect .custom-select-popover, #opsCompareCustomSelect .custom-select-popover, #aiCompareCustomSelect .custom-select-popover, #videosCompareCustomSelect .custom-select-popover, #videosShelfCustomSelect .custom-select-popover, .ax-compare-controls .custom-select-popover { left: auto; right: 0; max-width: calc(100vw - 2.5rem); }
}


@media (max-width: 360px) {
  .ax-toolbar .ax-toggle { grid-column: 1 / -1; }
  .ax-toggle { flex-wrap: wrap; overflow-x: visible; }
}


@media (max-width: 760px) {
  .ax-page .operations-heading { flex-direction: column; align-items: stretch; gap: .75rem; }
  .ax-page .operations-heading .ax-heading-side { justify-content: flex-start; }
}



.ax-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.ax-tiles:has(> :nth-child(8)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 1200px) {
  .ax-tiles:has(> :nth-child(6):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.ax-tile { display: grid; align-content: start; gap: .3rem; min-width: 0; padding: .75rem .85rem; color: inherit; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius-lg); font: inherit; text-align: left; }
button.ax-tile { cursor: pointer; transition: border-color var(--duration-base) ease, background var(--duration-base) ease; }
@media (hover: hover) {
  button.ax-tile:hover {
    border-color: var(--border-strong);
  }
}
.ax-tile.is-selected { border-color: var(--text-soft); box-shadow: inset 0 0 0 1px var(--text-soft); }
.ax-tile-label { display: flex; align-items: baseline; min-width: 0; color: var(--text-muted); font-size: var(--font-sm); line-height: 1.3; }
.ax-tile > strong { color: var(--text-strong); font-size: 1.5rem; font-weight: var(--font-weight-semibold, 600); line-height: 1.2; overflow-wrap: anywhere; }
.ax-tile-foot { display: flex; align-items: center; gap: .6rem; min-height: 1.5rem; }
.ax-tile-note { color: var(--text-faint); font-size: var(--font-xs); line-height: 1.3; }
.ax-delta { display: inline-flex; flex: 0 0 auto; align-items: baseline; gap: .15rem; color: var(--text-muted); font-size: var(--font-sm); }
.ax-delta.is-good { color: var(--success-text); }
.ax-delta.is-bad { color: var(--danger-text); }
.ax-spark { display: block; flex: 1 1 auto; min-width: 0; height: 24px; }
.ax-spark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ax-spark .ax-line { stroke-width: 1.5; }

@media (max-width: 760px) {
  .ax-tiles, .ax-tiles:has(> :nth-child(8)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ax-tiles.is-tight > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .ax-tile > strong { font-size: 1.25rem; }
}



.ax-tone-ours { --series: var(--chart-ours); }
.ax-tone-cloudflare { --series: var(--chart-cloudflare); }
.ax-tone-both { --series: var(--chart-both); }
.ax-tone-four { --series: var(--chart-four); }
.ax-tone-five { --series: var(--chart-five); }
.ax-tone-six { --series: var(--chart-six); }
.ax-tone-muted { --series: var(--text-faint); }
.ax-tone-good { --series: var(--status-green); }
.ax-tone-warning { --series: var(--status-amber); }
.ax-tone-critical { --series: var(--status-red); }
.ax-part-ours { --series: var(--chart-ours); }
.ax-part-cloudflare { --series: var(--chart-cloudflare); }
.ax-part-good { --series: var(--status-green); }
.ax-part-warning { --series: var(--status-amber); }
.ax-part-critical { --series: var(--status-red); }
.ax-part-muted { --series: var(--text-faint); }

.ax-source { display: inline-block; flex: 0 0 auto; width: 8px; height: 8px; margin-right: .4rem; border-radius: 50%; background: var(--series); vertical-align: .05em; }

.ax-legend-line { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0; color: var(--text-muted); font-size: var(--font-sm); }
.ax-legend { display: inline-flex; flex-wrap: wrap; gap: .25rem .9rem; color: var(--text-muted); font-size: var(--font-xs); }
.ax-key { display: inline-flex; align-items: center; gap: .4rem; }
.ax-key::before { content: ""; flex: 0 0 auto; width: 14px; height: 2px; border-radius: 1px; background: var(--series); }
.ax-key.is-block::before { width: 10px; height: 10px; border-radius: 2px; }

.ax-chart { min-width: 0; margin: 0; }
.ax-chart figcaption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; margin-bottom: .6rem; }
.ax-chart-title { display: inline-flex; align-items: baseline; color: var(--text-soft); font-size: var(--font-sm); }
.ax-plot { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.ax-plot[data-clickable] { cursor: crosshair; }
.ax-plot:focus-visible { outline: var(--focus-ring); outline-offset: 4px; border-radius: 2px; }
.ax-grid { position: absolute; z-index: 1; left: 0; right: 0; border-top: 1px solid var(--border); pointer-events: none; }
.ax-grid em { position: absolute; top: 2px; left: 0; padding: 0 .2rem 0 0; background: var(--bg-panel); border-radius: 2px; color: var(--text-muted); font-size: var(--font-xs); font-style: normal; font-variant-numeric: tabular-nums; }
.ax-baseline { position: absolute; left: 0; right: 0; bottom: 0; border-top: 1px solid var(--border-medium); pointer-events: none; }
.ax-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ax-area { fill: var(--series); opacity: .1; stroke: none; }
.ax-line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ax-line.is-previous { stroke: var(--text-faint); stroke-width: 1.5; stroke-dasharray: 3 4; }
.ax-line.is-unfinished { stroke-dasharray: 2 6; }
.ax-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--series); box-shadow: 0 0 0 2px var(--bg-panel); transform: translate(-50%, 50%); pointer-events: none; }
.ax-dot.is-partial { background: var(--bg-panel); box-shadow: inset 0 0 0 2px var(--series), 0 0 0 2px var(--bg-panel); }
.ax-bars { position: absolute; inset: 0; display: flex; gap: 2px; pointer-events: none; }
.ax-bars.is-dense { gap: 1px; }
.ax-bars > span { position: relative; display: flex; flex: 1 1 0; flex-direction: column-reverse; align-items: center; min-width: 0; gap: 1px; }
.ax-bars i { display: block; flex: 0 0 auto; width: 100%; max-width: 24px; min-height: 2px; background: var(--series); }
.ax-bars i:last-of-type { border-radius: 4px 4px 0 0; }
.ax-bars.is-dense i:last-of-type { border-radius: 1px 1px 0 0; }
.ax-bars u { position: absolute; left: 50%; width: 100%; max-width: 24px; border-top: 2px solid var(--text-soft); transform: translateX(-50%); text-decoration: none; }
.ax-bars .is-partial i { opacity: .55; }
.ax-bars .is-hover i { filter: brightness(1.3); }
.ax-flag { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--text-soft); pointer-events: none; }
.ax-flag::before { content: ""; position: absolute; top: 0; left: -3px; width: 5px; height: 5px; border-radius: 50%; background: var(--text-soft); }
.ax-band { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--text-main) 14%, transparent); border-inline: 1px solid var(--text-soft); pointer-events: none; }
.ax-cross { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--text-soft); pointer-events: none; }
.ax-band[hidden], .ax-cross[hidden], .ax-tip[hidden] { display: none; }
.ax-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: var(--font-sm); text-align: center; pointer-events: none; }
.ax-ticks { position: relative; height: 1.4rem; margin-top: .3rem; }
.ax-tick { position: absolute; color: var(--text-muted); font-size: var(--font-xs); font-variant-numeric: tabular-nums; white-space: nowrap; transform: translateX(-50%); }
.ax-tick.is-first { transform: translateX(-15%); }
.ax-tick.is-last { transform: translateX(-85%); }
@media (max-width: 560px) {
  .ax-tick.is-odd { display: none; }
}


.ax-tip { position: fixed; z-index: var(--layer-tooltip); display: grid; gap: .25rem; min-width: 10rem; max-width: min(22rem, calc(100vw - 16px)); padding: .55rem .7rem; color: var(--text-body); background: var(--bg-popover); border: 1px solid var(--border-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-popover); font-size: var(--font-sm); pointer-events: none; }
.ax-tip-head { color: var(--text-muted); font-size: var(--font-xs); }
.ax-tip-row { display: flex; align-items: baseline; gap: .6rem; }
.ax-tip-row b { flex: 0 0 auto; color: var(--text-strong); font-weight: var(--font-weight-medium); font-variant-numeric: tabular-nums; }
.ax-tip-row.is-quiet, .ax-tip-row.is-quiet b { color: var(--text-muted); font-weight: 400; }
.ax-tip-mark { padding-top: .25rem; color: var(--text-soft); border-top: 1px solid var(--border); font-size: var(--font-xs); }



.ax-ranks { display: grid; gap: 2px; --series: var(--chart-ours); }
.ax-ranks.is-open { max-height: 24rem; overflow-y: auto; }
.ax-rank { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto 2.6rem; align-items: center; gap: .6rem; min-height: 30px; padding: .2rem .5rem; overflow: hidden; color: var(--text-body); background: none; border: 1px solid transparent; border-radius: var(--radius-md); font: inherit; font-size: var(--font-sm); text-align: left; cursor: pointer; }
@media (hover: hover) {
  .ax-rank:hover {
    background: var(--bg-hover);
  }
}
.ax-rank.is-selected { color: var(--text-strong); border-color: var(--text-soft); }
.ax-rank-bar { position: absolute; top: 0; bottom: 0; left: 0; background: color-mix(in srgb, var(--series) 22%, transparent); border-radius: var(--radius-md); }
.ax-rank-name { position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ax-rank-value { position: relative; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.ax-rank-share { position: relative; color: var(--text-muted); font-size: var(--font-xs); font-variant-numeric: tabular-nums; text-align: right; }
.ax-rank-more { justify-self: start; font-size: var(--font-sm); color: var(--text-muted); }



.data-table-wrap { width: 100%; max-width: 100%; min-width: 0; max-height: 32rem; margin-top: 1rem; overflow: auto; scrollbar-gutter: stable; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.data-table { width: max-content; min-width: 100%; border-collapse: collapse; font-size: var(--font-sm); }
.data-table th { position: sticky; top: 0; z-index: 1; text-align: left; color: var(--text-muted); background: var(--bg-sidebar); box-shadow: inset 0 -1px var(--border); }
.data-table th, .data-table td { padding: .6rem .55rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tr.is-error .ai-run-status { color: var(--danger); }

.ax-page .data-table-wrap { max-height: 34rem; margin-top: 0; }
.ax-status { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.ax-status i { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--series); }
.ax-empty-row { padding: 1.5rem; color: var(--text-muted); text-align: center; }
.ax-sort { display: inline-flex; align-items: center; gap: .25rem; padding: 0; color: inherit; background: none; border: 0; font: inherit; cursor: pointer; white-space: nowrap; }
.ax-sort.is-sorted { color: var(--text-main); }
@media (hover: hover) {
  .ax-sort:hover {
    color: var(--text-main);
  }
}
.ax-sort i { font-style: normal; }
.ax-row-link { cursor: pointer; }
@media (hover: hover) {
  .ax-row-link:hover td {
    background: var(--bg-hover);
  }
}

@media (hover: hover) {
  .ax-page .is-narrow .ax-row-link:hover td {
    background: none;
  }
}
.ax-row-link:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }
.ax-table td.ax-person, .ax-table td.ax-path, .ax-table td.ax-wrap { min-width: 12rem; max-width: 30rem; white-space: normal; overflow-wrap: anywhere; }
.ax-tag { display: inline-block; padding: 0 .35rem; color: var(--text-muted); border: 1px solid var(--border-medium); border-radius: var(--radius-md); font-size: var(--font-xs); }
.ax-total td { color: var(--text-strong); font-weight: var(--font-weight-medium); background: var(--bg-surface); }
.ax-column-picker { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .75rem; }
.ax-columns-button { display: block; margin-bottom: .6rem; font-size: var(--font-sm); }
.ax-pick { display: inline-flex; align-items: center; padding: .2rem .55rem; color: var(--text-muted); background: none; border: 1px solid var(--border); border-radius: var(--radius-pill); font: inherit; font-size: var(--font-xs); cursor: pointer; }
@media (hover: hover) {
  .ax-pick:hover {
    color: var(--text-main);
  }
}
.ax-pick.is-on { color: var(--text-strong); background: var(--bg-hover); border-color: var(--text-faint); }

.ax-page .ax-fit .data-table { width: 100%; min-width: 0; }
.ax-page .ax-fit .data-table th, .ax-page .ax-fit .data-table td { white-space: normal; }
.ax-page .is-narrow .ax-fit { overflow: visible; max-height: none; border: 0; }
.ax-page .is-narrow .ax-fit table, .ax-page .is-narrow .ax-fit tbody { display: block; }
.ax-page .is-narrow .ax-fit thead { display: none; }
.ax-page .is-narrow .ax-fit tr { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.ax-page .is-narrow .ax-fit tr:last-child { border-bottom: 0; }
.ax-page .is-narrow .ax-fit td { display: block; min-width: 0; max-width: none; padding: 0; border: 0; text-align: left; font-size: var(--font-sm); }
.ax-page .is-narrow .ax-fit td[data-label]:not(:first-child)::before { content: attr(data-label) " "; color: var(--text-muted); }
.ax-page .is-narrow .ax-fit td:first-child { flex: 1 1 100%; font-size: var(--font-md); }
.ax-page .is-narrow .ax-fit .shelves-actions-cell, .ax-page .is-narrow .ax-fit .ax-fit-buttons { flex: 1 1 100%; }
.is-narrow .shelves-actions, .is-narrow .ai-admin-model-actions { flex-wrap: wrap; justify-content: flex-start; }



.app-dialog.ax-panel { inset: 0 0 0 auto; width: min(600px, 100vw); max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; border-width: 0 0 0 1px; border-radius: 0; }
.app-dialog.ax-panel[open] { display: flex; flex-direction: column; overflow: hidden; animation: ax-panel-in var(--duration-base) ease; }
@keyframes ax-panel-in { from { opacity: 0; translate: 24px 0; } }
@media (prefers-reduced-motion: reduce) { .app-dialog.ax-panel[open] { animation: none; } }
.ax-panel-head { margin: 0; display: flex; flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.ax-panel-head h3 { margin: 0; color: var(--text-strong); font-size: var(--font-lg, 1rem); font-weight: var(--font-weight-medium); }
.ax-panel-close { flex: 0 0 auto; }
.ax-panel-body { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; flex: 1 1 auto; gap: 1.25rem; min-height: 0; padding: 1rem 1.25rem 1.5rem; overflow-y: auto; overscroll-behavior: contain; }
.ax-panel-body section { display: grid; gap: .5rem; min-width: 0; }
.ax-panel-body h4 { display: flex; align-items: baseline; margin: 0; color: var(--text-soft); font-size: var(--font-sm); font-weight: var(--font-weight-medium); }
.ax-panel-body p { margin: 0; font-size: var(--font-sm); }
.ax-panel-foot { padding: .75rem 1.25rem calc(.75rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); }
.ax-panel-foot .btn { width: 100%; }
.ax-minis { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .5rem; }
.ax-mini { display: grid; gap: .1rem; min-width: 0; padding: .5rem .65rem; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.ax-mini strong { color: var(--text-strong); font-size: var(--font-base); font-weight: var(--font-weight-medium); }
.ax-mini small { color: var(--text-muted); font-size: var(--font-xs); line-height: 1.3; }
.ax-panel-list { display: grid; margin: 0; padding: 0; list-style: none; font-size: var(--font-sm); color: var(--text-body); }
.ax-panel-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 28px; padding: .15rem 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.ax-panel-list li:last-child { border-bottom: 0; }
.ax-panel-list li > span:last-child, .ax-panel-list li > .ax-chip-x { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.ax-panel-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1.25rem; }
.ax-marker-form { display: flex; flex-direction: row; gap: .5rem; padding: 0; }
.app-dialog .ax-marker-form input:not([type="checkbox"]):not([type="radio"]) { flex: 1 1 auto; min-width: 0; margin: 0; }

@media (max-width: 640px) {
  .app-dialog.ax-panel { inset: auto 0 0 0; width: 100%; height: min(90dvh, 100%); max-height: 90dvh; border-width: 1px 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  @keyframes ax-panel-in { from { opacity: 0; translate: 0 24px; } }
}




.sidebar-backdrop {
  display: none;
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--right-sidebar-width);
  height: calc(100vh - var(--app-bar-height));
  height: calc(100dvh - var(--app-bar-height));
  transition: grid-template-columns var(--duration-slow) ease;
}


.sidebar {
  position: relative;
  width: var(--sidebar-width);
  height: calc(100vh - var(--app-bar-height));
  height: calc(100dvh - var(--app-bar-height));
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--duration-slow) ease, border-color var(--duration-slow) ease;
}

.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
  background: transparent;
  border-right-width: 0;
  border-right-color: transparent;
}

.sidebar-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  padding: 14px 16px 12px;
}


.mobile-sidebar-toggle {
  display: none;
}

@media (min-width: 1201px) {
  .sidebar-collapsed .mobile-sidebar-toggle {
    position: fixed;
    top: calc(14px + var(--app-bar-height));
    left: 16px;
    z-index: var(--layer-sidebar-button-wide-screen);
    display: inline-flex;
  }

  
  .sidebar-collapsed .sidebar .sidebar-toggle-btn {
    display: none;
  }

  
  .sidebar-collapsed:has(#appSidebar:not([data-view="dashboard"])) .sidebar-folded-back {
    position: fixed;
    top: calc(14px + var(--app-bar-height));
    left: calc(16px + var(--sidebar-toggle-size) + 8px);
    z-index: var(--layer-sidebar-button-wide-screen);
    display: inline-flex;
  }
}

.sidebar-folded-back,
.phone-bar-title,
.video-bar-title,
.settings-bar-title {
  display: none;
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  color: var(--text-strong);
  font-size: var(--font-md);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}


.sidebar-brand-back {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform var(--duration-base) ease, color var(--duration-base) ease;
}

.sidebar-brand.is-away:focus-visible .sidebar-brand-back {
  color: var(--text-strong);
  transform: translateX(-2px);
}

@media (hover: hover) {
  .sidebar-brand.is-away:hover .sidebar-brand-back {
    color: var(--text-strong);
    transform: translateX(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-brand-back {
    transition: none;
  }
}

.sidebar-brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-scroll-area {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 12px 16px 18px;
  overflow-y: auto;
}

.sidebar:not([data-view="settings"]) .sidebar-scroll-area {
  gap: 0;
}

.sidebar-footer {
  padding: 12px 16px 32px;
}

.sidebar-settings-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  color: var(--text-main);
  text-decoration: none;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  transition: all var(--duration-slow) ease;
  font-weight: var(--font-weight-medium);
}

.sidebar-settings-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-settings-link.active {
  color: var(--text-strong);
  background: var(--bg-hover-strong);
}

@media (hover: hover) {
  .sidebar-settings-link:hover {
    color: var(--text-strong);
    background: var(--bg-hover-strong);
  }
}

.sidebar-account-row,
.sidebar-account-link {
  display: flex;
  min-width: 0;
  align-items: center;
}

.sidebar-account-row {
  position: relative;
  gap: 8px;
}

.sidebar-account-link {
  flex: 1;
  gap: 10px;
  min-height: 44px;
  padding: 8px;
  color: var(--text-main);
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: background var(--duration-base) ease, color var(--duration-base) ease;
}

.sidebar-account-link:focus-visible {
  color: var(--text-strong);
  background: var(--bg-hover);
}

@media (hover: hover) {
  .sidebar-account-link:hover {
    color: var(--text-strong);
    background: var(--bg-hover);
  }
}

.sidebar-account-link.is-logged-out {
  border: 1px solid var(--border);
  background: var(--fill-faint);
}

.account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  color: var(--text-strong);
  background: var(--avatar-gradient);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-pill);
  font-size: var(--font-sm);
  font-weight: var(--font-weight-semibold);
}

.account-avatar img,
img.account-avatar {
  object-fit: cover;
}

.sidebar-account-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: var(--leading-tight);
}

.sidebar-account-title,
.sidebar-account-subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account-title {
  font-weight: var(--font-weight-semibold);
}

.sidebar-account-subtitle {
  color: var(--text-muted);
  font-size: var(--font-xs);
}

.sidebar-account-signout {
  --icon-btn-icon: var(--icon-lg);
}

.sidebar-logout-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 20;
  width: min(260px, calc(var(--sidebar-width) - 32px));
  padding: 12px;
}

.sidebar-logout-popover p {
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: var(--font-sm);
  line-height: var(--leading-normal);
}

.sidebar-logout-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.sidebar-logout-actions button {
  width: auto;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
}

.sidebar-logout-cancel {
  color: var(--text-main);
  background: var(--fill-soft);
  border: 1px solid var(--border);
}

.sidebar-logout-confirm {
  background: var(--danger-strong);
}

.sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: -3px;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  z-index: 5;
}

.sidebar-resize-handle::after {
  position: absolute;
  top: 0;
  right: 2px;
  bottom: 0;
  width: 1px;
  background: transparent;
  content: "";
  transition: background var(--duration-base) ease;
}

.sidebar-resizing .sidebar-resize-handle::after {
  background: var(--handle);
}

@media (hover: hover) {
  .sidebar-resize-handle:hover::after {
    background: var(--handle);
  }
}

.sidebar-resizing {
  cursor: col-resize;
  user-select: none;
}

.sidebar-resizing .layout,
.sidebar-resizing .sidebar {
  transition: none;
}

.sidebar-context-panel a {
  text-decoration: none;
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  transition: all var(--duration-slow) ease;
  font-weight: var(--font-weight-medium);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-context-panel a svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

@media (hover: hover) {
  .sidebar-context-panel a:hover {
    background: var(--bg-hover);
    color: var(--text-strong);
  }
}

.sidebar-panel {
  min-width: 0;
}

.sidebar-action-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  background: var(--bg-card-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.sidebar-action-card + .sidebar-action-card,
.sidebar-action-card + .manual-trigger {
  margin-top: 12px;
}


.sidebar-action-card.is-collapsed + .sidebar-action-card.is-collapsed {
  margin-top: 0;
}

.dashboard-sidebar-shell {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}


.dashboard-sidebar-controls {
  display: grid;
  gap: 10px;
  flex: 0 0 auto;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}


.dashboard-sidebar-all-row:empty {
  display: none;
}

.dashboard-playlist-list {
  display: grid;
  gap: 4px;
}

.dashboard-playlist-panel {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 4px 0 20px;
}


.sidebar-tool-tabs {
  margin: 0 -4px;
  padding: 0 4px;
}


.sidebar-settings-tab {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}


.sidebar-tool-tabs .tab.is-narrowing::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  vertical-align: middle;
  border-radius: var(--radius-round);
  background: var(--accent-hover);
}

.sidebar-tool-panel {
  padding-top: 4px;
}


.dashboard-sidebar-controls:not(.is-searching) .chosen-tag-add,
.dashboard-sidebar-controls:not(.is-searching) .dashboard-sidebar-chosen-tags:has(> .chosen-tag-add:only-child) {
  display: none;
}


.add-video-target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.add-video-target strong {
  color: var(--text-main);
  font-weight: var(--font-weight-semibold);
}

.manual-episode-picker:not([hidden]) {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.manual-episode-picker label {
  color: var(--text-muted);
  font-size: var(--font-xs);
}


.manual-video-preview.is-error .manual-video-preview-message {
  white-space: normal;
  overflow-wrap: anywhere;
}

.manual-video-preview {
  display: none;
}

.manual-video-preview.is-loading,
.manual-video-preview.is-error {
  display: block;
}

.manual-video-preview.is-ready {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.manual-video-preview-thumb {
  width: 76px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--fill-soft);
}

.manual-video-preview-copy {
  min-width: 0;
}

.manual-video-preview-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-main);
  font-size: var(--font-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--leading-tight);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.manual-video-preview-channel,
.manual-video-preview-message {
  margin-top: 3px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: var(--font-xs);
  line-height: var(--leading-tight);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-video-preview.is-error .manual-video-preview-message {
  color: var(--danger-text);
}


.manual-video-preview-already {
  margin-top: 4px;
  color: var(--status-amber);
  font-size: var(--font-xs);
  line-height: var(--leading-tight);
}

.dashboard-playlist-group {
  min-width: 0;
}

.dashboard-playlist-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  color: var(--text-main);
  background: transparent;
  border: 0;
  border-radius: var(--radius-md);
  text-align: left;
}

.dashboard-playlist-row:focus-visible {
  background: var(--bg-hover);
  color: var(--text-strong);
}

@media (hover: hover) {
  .dashboard-playlist-row:hover {
    background: var(--bg-hover);
    color: var(--text-strong);
  }
}

.dashboard-playlist-row.is-active {
  color: var(--inverse-text);
  background: var(--inverse-bg);
}

.dashboard-playlist-row.is-archived {
  color: var(--text-muted);
}

.dashboard-playlist-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: currentColor;
  opacity: 0.76;
}

button.dashboard-playlist-chevron {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
}

button.dashboard-playlist-chevron:focus-visible {
  color: var(--text-strong);
  background: var(--bg-hover-strong);
  opacity: 1;
}

@media (hover: hover) {
  button.dashboard-playlist-chevron:hover {
    color: var(--text-strong);
    background: var(--bg-hover-strong);
    opacity: 1;
  }
}

.dashboard-playlist-chevron svg {
  width: 17px;
  height: 17px;
}


.dashboard-playlist-row > .dashboard-playlist-chevron {
  align-self: stretch;
  width: 36px;
  height: auto;
  margin: -6px -6px -6px -8px;
}

.dashboard-playlist-name-wrap {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.dashboard-playlist-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: var(--font-weight-medium);
}

.dashboard-playlist-count {
  flex: 0 0 auto;
  min-width: 22px;
  padding: 3px 7px;
  color: var(--text-muted);
  background: var(--fill-soft);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  line-height: 1.1;
  text-align: center;
}

.dashboard-playlist-row.is-active .dashboard-playlist-count {
  color: var(--inverse-text-muted);
  background: var(--inverse-fill);
}

.dashboard-playlist-row-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}


.dashboard-sidebar-tree {
  padding-top: 12px;
}


.dashboard-sidebar-collapse-all {
  margin-left: auto;
  margin-block: min(0px, calc((24px - var(--icon-btn-size)) / 2));
  transition: opacity var(--duration-base) ease, visibility 0s, background var(--duration-fast) ease, color var(--duration-fast) ease;
}

.dashboard-sidebar-collapse-all.is-idle {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--duration-base) ease, visibility 0s linear var(--duration-base);
}

.dashboard-sidebar-tree-group + .dashboard-sidebar-tree-group {
  margin-top: 12px;
}

.dashboard-sidebar-tree-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 0 8px 4px;
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}


.dashboard-sidebar-group-add {
  opacity: 0;
  transition: opacity var(--duration-base) ease, color var(--duration-base) ease, background var(--duration-base) ease;
}


.dashboard-sidebar-group-add,
.dashboard-sidebar-collapse-all:last-child {
  margin-right: calc((8px - var(--icon-btn-size)) / 2);
}


.dashboard-sidebar-group-add svg,
.dashboard-sidebar-collapse-all svg {
  width: 13px;
  height: 13px;
}

.dashboard-sidebar-group-add:focus-visible,
.dashboard-sidebar-group-add.is-open { opacity: 1; }

@media (hover: hover) {
  .dashboard-sidebar-tree-group:hover .dashboard-sidebar-group-add {
    opacity: 1;
  }
}


.dashboard-sidebar-group-add.is-open {
  color: var(--pill-collection);
}
@media (hover: hover) {
  .dashboard-sidebar-group-add:hover {
    color: var(--pill-collection);
  }
}

.dashboard-sidebar-tree-children {
  margin-left: 10px;
}

.dashboard-sidebar-archive-children {
  margin-left: 18px;
}

.dashboard-sidebar-video-list {
  display: grid;
  gap: 4px;
  margin: 4px 0 8px 28px;
}

.dashboard-sidebar-video-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 40px;
  padding: 4px 6px;
  color: var(--text-main);
  background: transparent;
  border: 0;
  border-radius: var(--radius-md);
  text-align: left;
}

.dashboard-sidebar-video-row:focus-visible {
  background: var(--bg-hover);
  color: var(--text-strong);
}

@media (hover: hover) {
  .dashboard-sidebar-video-row:hover {
    background: var(--bg-hover);
    color: var(--text-strong);
  }
}

.dashboard-sidebar-video-row.is-active {
  color: var(--inverse-text);
  background: var(--inverse-bg);
}


.dashboard-sidebar-video-row.is-just-added {
  animation: sidebar-video-just-added 4s ease;
}

@keyframes sidebar-video-just-added {
  0%, 50% {
    color: var(--text-strong);
    background: var(--bg-hover);
  }
}

.dashboard-sidebar-video-row.is-active:focus-visible {
  color: var(--inverse-text);
  background: var(--inverse-bg);
}

@media (hover: hover) {
  .dashboard-sidebar-video-row.is-active:hover {
    color: var(--inverse-text);
    background: var(--inverse-bg);
  }
}


.dashboard-sidebar-video-row:focus-within .row-actions {
  display: flex;
}
@media (hover: hover) {
  .dashboard-sidebar-video-row:hover .row-actions {
    display: flex;
  }
}


.dashboard-sidebar-video-row .row-action {
  --row-action-size: 20px;
  --row-action-icon: 12px;
}


.dashboard-sidebar-video-row.is-active .row-action {
  color: var(--inverse-text-faint);
}

@media (hover: hover) {
  .dashboard-sidebar-video-row.is-active .row-action:hover {
    color: var(--inverse-text);
    background: var(--inverse-fill);
  }
}

.dashboard-sidebar-video-thumb {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--fill-subtle);
}

.dashboard-sidebar-video-thumb.is-placeholder {
  display: block;
}

.dashboard-sidebar-video-title {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-sidebar-video-loading {
  padding: 6px 8px;
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.sidebar-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-action-card h3 {
  margin-bottom: 0;
  color: var(--text-main);
  font-size: inherit;
  font-weight: var(--font-weight-medium);
  letter-spacing: normal;
  text-transform: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-action-card h3 svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-muted {
  color: var(--text-muted);
  font-size: var(--font-sm);
  line-height: var(--leading-normal);
}

.sidebar-collapsible-trigger {
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  padding: 0;
  color: inherit;
  font: inherit;
  outline: none;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-collapsible-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-card-title-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sidebar-card-collapsible-icon {
  display: flex;
  color: var(--text-muted);
  transition: all var(--duration-slow) ease;
  transform: rotate(90deg); 
  align-items: center;
}


.sidebar-action-card.is-collapsed {
  background: transparent;
  border-color: transparent;
  padding: 10px 16px;
  gap: 0;
  border-radius: var(--radius-md);
  transition: background var(--duration-slow) ease;
}

@media (hover: hover) {
  .sidebar-action-card.is-collapsed:hover {
    background: var(--bg-hover);
  }
}

.sidebar-action-card.is-collapsed .sidebar-card-heading {
  align-items: center;
}

.sidebar-action-card.is-collapsed .sidebar-card-heading h3 {
  color: var(--text-main);
  transition: color var(--duration-slow);
}

@media (hover: hover) {
  .sidebar-action-card.is-collapsed:hover .sidebar-card-heading h3 {
    color: var(--text-strong);
  }
}

.sidebar-action-card.is-collapsed .sidebar-card-collapsible-icon {
  opacity: 0;
  transform: translateX(-4px); 
}

@media (hover: hover) {
  .sidebar-action-card.is-collapsed:hover .sidebar-card-collapsible-icon {
    opacity: 1;
    transform: translateX(0);
  }
}

.sidebar-action-card.is-collapsed .sidebar-collapsible-content {
  display: none;
}

.sidebar-status-dot {
  margin-top: 6px;
}


.sidebar-card-value {
  color: var(--text-muted);
  font-size: var(--font-sm);
}


.sidebar-appearance-choice {
  display: flex;
}

.sidebar-appearance-choice button {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 4px;
}

.sidebar-appearance-choice svg {
  width: var(--icon-sm);
  height: var(--icon-sm);
  flex-shrink: 0;
}

.sidebar-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--text-main);
  background: var(--fill-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
}

.sidebar-toggle-row:focus-visible {
  background: var(--fill-medium);
}

@media (hover: hover) {
  .sidebar-toggle-row:hover {
    background: var(--fill-medium);
  }
}

.manual-trigger {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.manual-input-wrapper {
  position: relative;
  margin: 0;
}

.manual-input-wrapper input[type="text"] {
  width: 100%;
  margin-bottom: 0;
  padding-right: 40px;
}


.manual-input-clear {
  --clear-size: var(--control-sm);
  --clear-icon: var(--icon-md);
  right: 10px;
}

.manual-trigger h3,
.sidebar-context-panel h3 {
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-muted);
  margin-bottom: 12px;
}

.sidebar-context-panel {
  display: flex;
  flex-direction: column;
  gap: 0px;
}


.sidebar-collapsed .sidebar .sidebar-brand,
.sidebar-collapsed .sidebar .sidebar-scroll-area,
.sidebar-collapsed .sidebar .sidebar-footer,
.sidebar-collapsed .sidebar .sidebar-resize-handle {
  display: none;
}

.sidebar-collapsed .sidebar .sidebar-topbar {
  justify-content: center;
  padding: 12px 8px;
}


.waiting-changes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.waiting-changes[hidden] {
  display: none;
}

.waiting-changes-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-main);
}


.waiting-changes-count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--text-on-color);
  font-size: var(--font-xs);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.waiting-changes-note {
  margin: 0;
  font-size: var(--font-xs);
  line-height: 1.4;
  color: var(--text-muted);
}


#failuresPanel .waiting-changes-count {
  background: var(--danger);
}

.waiting-changes-link {
  display: inline-block;
  margin-top: 6px;
  font-size: var(--font-xs);
  color: var(--accent);
  text-decoration: none;
}

.waiting-changes-link:focus-visible {
  text-decoration: underline;
}

@media (hover: hover) {
  .waiting-changes-link:hover {
    text-decoration: underline;
  }
}

.waiting-changes-list {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--font-xs);
  line-height: 1.4;
  color: var(--text-main);
  
  overflow-wrap: anywhere;
}


.right-sidebar {
  position: relative;
  width: var(--right-sidebar-width);
  height: calc(100vh - var(--app-bar-height));
  height: calc(100dvh - var(--app-bar-height));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--text-main);
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border);
  transition: width var(--duration-slow) ease, border-color var(--duration-slow) ease;
}

body:not(.right-sidebar-active) .right-sidebar,
.right-sidebar-collapsed .right-sidebar {
  border-left-color: transparent;
}


.right-sidebar-brandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  padding: 14px 16px 12px;
}


.right-sidebar-topbar {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 20px 16px 12px;
}


.right-sidebar-video-tools {
  display: flex;
  flex: 0 0 auto;
  justify-content: center;
  min-width: var(--control-md);
}


.right-sidebar-dates-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.right-sidebar-dates-row.has-download {
  margin-right: calc(-1 * (var(--control-md) + 10px));
}

.right-sidebar-dates-row .card-meta-dates {
  flex: 1;
  min-width: 0;
  margin: 0;
}


.right-sidebar-dates-row .right-sidebar-download-btn {
  flex: none;
  margin-block: -8px;
}

.right-sidebar-heading {
  flex: 1;
  min-width: 0;
}

.right-sidebar-title {
  margin: 0;
  color: var(--text-main);
  font-size: var(--sidebar-title-size);
  font-weight: var(--font-weight-semibold);
  line-height: var(--leading-tight);
  overflow-wrap: anywhere;
  white-space: normal;
}


.right-sidebar-title.is-video-title {
  min-height: calc(2em * var(--leading-tight));
}


.right-sidebar-toggle-btn,
.right-sidebar-download-btn {
  position: relative;
}

.right-sidebar-toggle-btn svg {
  transform: translateY(1px);
}

.right-sidebar-download-btn {
  --icon-btn-icon: var(--icon-lg);
}


.right-sidebar-head {
  flex: 0 0 auto;
}

.right-sidebar-scroll-area {
  flex: 1;
  min-height: 0;
  padding: 8px 16px 16px;
  overflow-y: auto;
}

.right-sidebar-channel {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: var(--font-sm);
}


.right-sidebar-channel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.right-sidebar-channel-row.has-provider {
  margin-right: calc(-1 * (var(--control-md) + 10px));
}

.right-sidebar-channel-row .right-sidebar-channel {
  flex: 1;
  min-width: 0;
  margin: 0;
}


.right-sidebar-provider {
  flex: none;
  display: flex;
  justify-content: center;
  width: var(--control-md);
}

.right-sidebar-warning {
  margin: 6px 0 0;
  color: var(--danger-text);
  font-size: var(--font-sm);
  line-height: var(--leading-normal);
}

.right-sidebar-footer {
  position: relative;
  flex: 0 0 auto;
  padding: 14px 16px 18px;
  border-top: 1px solid var(--border);
}

.right-sidebar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}


.right-sidebar-video-tools > *,
.right-sidebar-footer {
  animation: page-fade-in var(--duration-slow) ease both;
}

@media (prefers-reduced-motion: reduce) {
  .right-sidebar-video-tools > *,
  .right-sidebar-footer {
    animation: none;
  }
}

.right-sidebar-actions .card-links {
  flex: 1 1 auto;
  gap: 8px;
  min-width: 0;
  padding-top: 0;
  border-top: 0;
}

.right-sidebar-actions .card-links a {
  gap: 4px;
  font-size: var(--font-xs);
}

.status-popover-wrap-right-sidebar {
  position: static;
  inset: auto;
  z-index: 12;
  flex: 0 0 auto;
  pointer-events: auto;
}

.status-popover-wrap-right-sidebar .status-badge {
  position: relative;
  right: auto;
  bottom: auto;
  pointer-events: auto;
}


.status-popover-wrap-right-sidebar .status-popover {
  top: calc(100% - 4px);
  right: 12px;
  bottom: auto;
  left: 12px;
  width: auto;
  max-height: min(480px, calc(100dvh - 200px));
  border-radius: var(--radius-xl);
  transform: translateY(-4px);
}

.status-popover-wrap-right-sidebar.is-open .status-popover {
  transform: translateY(0);
}

@media (hover: hover) {
  .status-popover-wrap-right-sidebar:not(.is-hover-suppressed):has(.status-badge:hover) .status-popover,
  .status-popover-wrap-right-sidebar:not(.is-hover-suppressed):has(.status-popover:hover) .status-popover {
    transform: translateY(0);
  }
}

.right-sidebar-resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -3px;
  z-index: 5;
  width: 6px;
  cursor: col-resize;
}

.right-sidebar-resize-handle::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 1px;
  background: transparent;
  content: "";
  transition: background var(--duration-base) ease;
}

.right-sidebar-resizing .right-sidebar-resize-handle::after {
  background: var(--handle);
}

@media (hover: hover) {
  .right-sidebar-resize-handle:hover::after {
    background: var(--handle);
  }
}

.right-sidebar-resizing {
  cursor: col-resize;
  user-select: none;
}

.right-sidebar-resizing .layout,
.right-sidebar-resizing .right-sidebar,
.right-sidebar-resizing .markdown-sidebar-toggle {
  transition: none;
}

@media (min-width: 1201px) {
  .right-sidebar-active:not(.right-sidebar-collapsed) .markdown-sidebar-toggle {
    display: none;
  }

  .right-sidebar-topbar,
  .right-sidebar-scroll-area,
  .right-sidebar-footer {
    box-sizing: border-box;
    width: var(--right-sidebar-expanded-width);
    min-width: var(--right-sidebar-expanded-width);
  }
}

@media (max-width: 1200px) {
  body.right-sidebar-open {
    overflow: hidden;
  }

  .right-sidebar-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity var(--duration-slow) ease;
  }

  .right-sidebar {
    position: fixed;
    top: var(--app-bar-height);
    right: 0;
    bottom: 0;
    z-index: var(--layer-sidebar);
    
    width: max(300px, 50vw);
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-sidebar-right);
    transform: translateX(100%);
    
    visibility: hidden;
    transition: transform var(--duration-slow) ease, visibility 0s linear var(--duration-slow);
  }

  .right-sidebar-open .right-sidebar {
    transform: translateX(0);
    visibility: visible;
    transition: transform var(--duration-slow) ease;
  }

  
  @media (max-width: 600px) {
    .right-sidebar {
      width: 100%;
      border-left: 0;
    }
  }

  .right-sidebar-resize-handle {
    display: none;
  }

  
  body .markdown-sidebar-toggle {
    --icon-btn-size: var(--sidebar-toggle-mobile-size);
    top: var(--phone-bar-top);
    right: var(--phone-bar-button-right);
    background: var(--bg-card-strong);
    border-color: var(--border);
  }

  
  body.right-sidebar-open:not(.right-sheet-sliding) .markdown-sidebar-toggle {
    display: none;
  }
}


@media (max-width: 600px) {
  
  body.right-sidebar-open.page-held {
    overflow: visible;
    background-color: var(--bg-sidebar);
  }

  
  body.right-sidebar-open.right-sheet {
    overflow: visible;
  }

  
  body.right-sheet-sliding > .layout {
    position: relative;
    overflow-x: clip;
  }

  
  html[data-video-scroll]:has(> body.page-held) {
    scroll-snap-type: none;
  }

  
  body.page-held .layout > main,
  body.right-sidebar-open.page-held :is(.layout > .sidebar, .sidebar-backdrop) {
    display: none;
  }

  .right-sheet .right-sidebar {
    --right-sidebar-foot-shown: var(--right-sidebar-foot-height, 0px);
    position: absolute;
    bottom: auto;
    left: 0;
    height: auto;
    
    min-height: calc(100lvh + 1px);
    padding-top: 0;
    padding-bottom: 0;
    overflow: visible;
    transform: none;
    
    transition: none;
  }

  
  .right-sheet .right-sidebar::before {
    content: "";
    position: absolute;
    right: 0;
    bottom: 100%;
    left: 0;
    height: 100lvh;
    background: var(--bg-sidebar);
    pointer-events: none;
  }

  
  .right-sheet .right-sidebar-head {
    position: relative;
    padding-top: var(--sheet-pill-room);
  }

  .right-sheet .right-sidebar-scroll-area {
    flex: none;
    padding-top: 8px;
    padding-bottom: calc(var(--right-sidebar-foot-height, 0px) + 16px);
    overflow: visible;
  }

  
  .right-sheet .right-sidebar-footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: var(--layer-sidebar);
    padding: 4px 16px calc(4px + env(safe-area-inset-bottom, 0px));
    background: var(--bg-sidebar);
    transition: transform var(--duration-base) ease;
  }

  
  .right-sheet .right-sidebar.is-foot-away {
    --right-sidebar-foot-shown: 0px;
  }

  
  .right-sheet .right-sidebar.is-foot-away .right-sidebar-footer,
  .right-sheet.topic-notes-expanded .right-sidebar-footer {
    display: none;
    transform: translateY(100%);
    transition: transform var(--duration-base) ease, display var(--duration-base) allow-discrete;
  }

  @starting-style {
    .right-sheet .right-sidebar-footer {
      transform: translateY(100%);
    }
  }

  
  body.right-sheet-sliding .right-sidebar {
    top: calc(var(--sheet-y, 0px) + var(--app-bar-height));
    
    min-height: calc(var(--sheet-top, 0px) + 100lvh);
    transform: translateX(0);
    transition: transform var(--duration-slow) ease;
  }

  body.right-sheet-sliding.right-sheet-out .right-sidebar {
    transform: translateX(100%);
  }

  body.right-sheet-sliding .right-sidebar-footer,
  body.right-sheet-sliding .right-sidebar.is-foot-away .right-sidebar-footer {
    position: absolute;
    top: calc(var(--sheet-top, 0px) + var(--sheet-view-height, 100dvh) - var(--right-sidebar-foot-height, 0px) - var(--app-bar-height));
    bottom: auto;
    
    transition: none;
  }

  
  .right-sheet .topic-fold-notes.is-expanded {
    position: fixed;
    top: var(--sheet-pill-bottom);
  }

  
  .right-sheet .topic-fold-notes.is-expanded .topic-notes-editor-body {
    overscroll-behavior: contain;
  }
}


.right-sidebar-video-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}



main {
  padding: 0 clamp(56px, 6vw, 96px) 120px;
  overflow-y: auto;
  overflow-anchor: none;
}


:root {
  
  --page-reel-dim: 0.22;
  --page-reel: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400' fill='none' stroke='%2394a3b8'%3E%3Cdefs%3E%3ClinearGradient id='f1' x2='1' gradientTransform='rotate(15 .5 .5)'%3E%3Cstop offset='.32' stop-color='%2394a3b8'/%3E%3Cstop offset='.5' stop-color='%2394a3b8' stop-opacity='.08'/%3E%3Cstop offset='.68' stop-color='%2394a3b8'/%3E%3C/linearGradient%3E%3ClinearGradient id='f2' x2='1' gradientTransform='rotate(60 .5 .5)'%3E%3Cstop offset='.32' stop-color='%2394a3b8'/%3E%3Cstop offset='.5' stop-color='%2394a3b8' stop-opacity='.08'/%3E%3Cstop offset='.68' stop-color='%2394a3b8'/%3E%3C/linearGradient%3E%3ClinearGradient id='f3' x2='1' gradientTransform='rotate(105 .5 .5)'%3E%3Cstop offset='.32' stop-color='%2394a3b8'/%3E%3Cstop offset='.5' stop-color='%2394a3b8' stop-opacity='.08'/%3E%3Cstop offset='.68' stop-color='%2394a3b8'/%3E%3C/linearGradient%3E%3ClinearGradient id='f4' x2='1' gradientTransform='rotate(150 .5 .5)'%3E%3Cstop offset='.32' stop-color='%2394a3b8'/%3E%3Cstop offset='.5' stop-color='%2394a3b8' stop-opacity='.08'/%3E%3Cstop offset='.68' stop-color='%2394a3b8'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg%3E%3Ccircle cx='200' cy='200' r='178' stroke-width='2' stroke='url(%23f1)'/%3E%3Ccircle cx='200' cy='200' r='164' stroke-opacity='0.5'/%3E%3Ccircle cx='200' cy='200' r='150' stroke-opacity='0.7' stroke='url(%23f2)'/%3E%3Ccircle cx='200' cy='200' r='136' stroke-opacity='0.5'/%3E%3Ccircle cx='200' cy='200' r='122' stroke-opacity='0.8' stroke='url(%23f3)'/%3E%3Ccircle cx='200' cy='200' r='108' stroke-opacity='0.5'/%3E%3Ccircle cx='200' cy='200' r='94' stroke='url(%23f4)'/%3E%3Ccircle cx='200' cy='200' r='38' stroke-width='2'/%3E%3Cpath d='M134 200A66 66 0 0 1 153.3 153.3M266 200A66 66 0 0 1 246.7 246.7' stroke-width='2' stroke-linecap='round'/%3E%3C/g%3E%3C/svg%3E");
}


@property --reel-turn {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

main::after {
  --reel-turn: inherit;
  content: '';
  position: fixed;
  top: calc(40px + var(--app-bar-height));
  right: calc(var(--right-sidebar-width) - 180px);
  z-index: var(--layer-page-reel);
  width: min(760px, 140vw);
  aspect-ratio: 1;
  background: var(--page-reel) no-repeat center / 100%;
  opacity: 0;
  pointer-events: none;
  transform: rotate(var(--reel-turn, 0deg));
  animation: reel-spin 1.6s linear infinite paused;
  transition: opacity var(--duration-slow) ease;
}


main:has(> #dashboardView:not([hidden]))::after,
main:has(> #settingsView:not([hidden]))::after {
  opacity: var(--page-reel-dim);
}

main:has(> #dashboardView:not([hidden]) #videoGrid.is-loading)::after,
main:has(> #settingsView.is-settling)::after,
main:has(.app-view-leaving)::after,
main:has(.app-view-entering)::after,
main:has(#markdownView.is-loading)::after {
  animation-play-state: running;
}


:root.is-checking-playlists main:has(> #dashboardView:not([hidden]))::after,
:root.is-checking-playlists main:has(> #settingsView:not([hidden]))::after,
:root.is-starting main:has(#dashboardView)::after,
main:has(> #dashboardView:not([hidden]) #videoGrid.is-loading)::after,
main:has(> #settingsView.is-settling)::after,
main:has(#markdownView.is-loading)::after {
  opacity: 1;
  animation-play-state: running;
  transition: opacity 0.7s ease-out;
}

:root.was-checking-playlists main:has(> #dashboardView:not([hidden]))::after,
:root.was-checking-playlists main:has(> #settingsView:not([hidden]))::after,
:root.was-loading main:has(#dashboardView)::after {
  animation-play-state: running;
  transition: opacity 1.2s ease-in-out;
}


.phone-bar-logo {
  display: none;
}

@keyframes reel-spin {
  to { rotate: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
  main::after {
    animation: none;
    transform: none;
  }
}

main::before {
  content: '';
  position: sticky;
  top: 0;
  display: block;
  height: 12px;
  background-color: var(--bg-base);
  z-index: var(--layer-page-heading);
  margin-bottom: -12px;
  pointer-events: none;
}

main>header,
#settingsView>header,
#markdownView {
  margin-top: 40px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

#dashboardView {
  margin-top: 0;
}


.dashboard-attention-filter,
.dashboard-needs-a-hand {
  margin: 28px 0 20px;
}


#dashboardView > :not(.markdown-sidebar-toggle),
#markdownView > :not(.markdown-sidebar-toggle) {
  opacity: 1;
  transition: opacity var(--duration-base) ease;
}


#markdownView > :not(.markdown-sidebar-toggle) {
  transition-duration: var(--duration-arrive);
}

#markdownView.app-view-leaving > :not(.markdown-sidebar-toggle) {
  transition-duration: var(--duration-base);
}

#dashboardView.app-view-leaving,
#markdownView.app-view-leaving,
#dashboardView.app-view-entering,
#markdownView.app-view-entering {
  pointer-events: none;
}

#dashboardView.app-view-leaving > :not(.markdown-sidebar-toggle),
#markdownView.app-view-leaving > :not(.markdown-sidebar-toggle),
#dashboardView.app-view-entering > :not(.markdown-sidebar-toggle),
#markdownView.app-view-entering > :not(.markdown-sidebar-toggle) {
  opacity: 0;
}

#markdownView.app-view-entering > .markdown-sidebar-toggle {
  pointer-events: auto;
}


#settingsView {
  transition: opacity var(--duration-slow) ease;
}

#settingsView.is-settling {
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  #dashboardView > *,
  #markdownView > *,
  #settingsView {
    transition: none;
  }
}

h1 {
  font-size: var(--font-xl);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-tight);
}

.dot {
  width: 8px;
  height: 8px;
  background: var(--status-green);
  border-radius: var(--radius-round);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 var(--success-pulse);
  }

  70% {
    box-shadow: 0 0 0 6px var(--success-pulse-end);
  }

  100% {
    box-shadow: 0 0 0 0 var(--success-pulse-end);
  }
}

@media (max-width: 1200px) {
  body.sidebar-open,
  body.right-sidebar-open {
    overflow: hidden;
  }

  
  .sidebar-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: var(--layer-sidebar-shading);
    display: block;
    background: var(--bg-shade);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--duration-slow) ease, visibility 0s linear var(--duration-slow);
  }

  .sidebar-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity var(--duration-slow) ease;
  }

  
  .layout {
    display: block;
    height: auto;
    min-height: calc(100vh - var(--app-bar-height));
    min-height: calc(100dvh - var(--app-bar-height));
  }

  .sidebar {
    position: fixed;
    top: var(--app-bar-height);
    bottom: 0;
    left: 0;
    z-index: var(--layer-sidebar);
    width: min(82vw, 300px);
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    background: transparent;
    border-right: 0;
    box-shadow: none;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform var(--duration-slow) ease, background var(--duration-slow) ease, box-shadow var(--duration-slow) ease, visibility 0s linear var(--duration-slow);
  }

  
  .sidebar:not([data-view="settings"]) {
    width: min(82vw, max(300px, 50vw));
  }

  .sidebar-resize-handle {
    display: none;
  }

  .sidebar-open .sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-sidebar-left);
    transform: translateX(0);
    visibility: visible;
    transition: transform var(--duration-slow) ease, background var(--duration-slow) ease, box-shadow var(--duration-slow) ease;
  }

  
  .dashboard-playlist-panel {
    padding-bottom: 12px;
    mask-image: linear-gradient(to bottom, transparent, black 16px, black calc(100% - 12px), transparent);
  }

  
  .sidebar:has(.dashboard-playlist-panel) .sidebar-scroll-area {
    padding-bottom: 0;
  }

  
  .sidebar:has(.dashboard-playlist-panel) .sidebar-footer {
    padding-top: 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  
  body:not(.sidebar-open) .sidebar .sidebar-brand,
  body:not(.sidebar-open) .sidebar .sidebar-scroll-area,
  body:not(.sidebar-open) .sidebar .sidebar-footer {
    display: none;
  }

  
  .mobile-sidebar-toggle {
    --icon-btn-size: var(--sidebar-toggle-mobile-size);
    position: fixed;
    display: inline-flex;
    top: var(--phone-bar-top);
    left: var(--phone-bar-button-left);
    z-index: var(--layer-sidebar-button-narrow-screen);
    transition: none;
  }

  
  body:is(.sidebar-open, .right-sidebar-open):not(.left-sheet-sliding, .right-sheet-sliding) .mobile-sidebar-toggle {
    display: none;
  }

  body:is(:not(.sidebar-open, .right-sidebar-open), .left-sheet-sliding, .right-sheet-sliding):has(#appSidebar:not([data-view="dashboard"])) .sidebar-folded-back {
    --icon-btn-size: var(--sidebar-toggle-mobile-size);
    position: fixed;
    top: var(--phone-bar-top);
    left: calc(var(--phone-bar-button-left) + var(--sidebar-toggle-mobile-size) + 8px);
    z-index: var(--layer-sidebar-button-narrow-screen);
    display: inline-flex;
  }

  body:is(:not(.sidebar-open, .right-sidebar-open), .left-sheet-sliding, .right-sheet-sliding):has(#appSidebar[data-view="dashboard"]) .phone-bar-title:not(:empty) {
    position: fixed;
    top: var(--phone-bar-top);
    left: calc(var(--phone-bar-button-left) + var(--sidebar-toggle-mobile-size) + 12px);
    right: calc(var(--phone-bar-button-right) + var(--sidebar-toggle-mobile-size) + 12px);
    z-index: var(--layer-sidebar-button-narrow-screen);
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--sidebar-toggle-mobile-size);
    margin: 0;
    color: var(--text-strong);
    font-size: var(--font-md);
    font-weight: var(--font-weight-semibold);
  }

  
  @media (max-width: 600px) {
    body:is(:not(.sidebar-open, .right-sidebar-open), .left-sheet-sliding, .right-sheet-sliding):has(#appSidebar[data-view="markdown"]) .video-bar-title:not(:empty) {
      position: fixed;
      top: var(--phone-bar-top);
      left: calc(var(--phone-bar-button-left) + var(--sidebar-toggle-mobile-size) + 12px);
      right: calc(var(--phone-bar-button-right) + var(--sidebar-toggle-mobile-size) + 12px);
      z-index: var(--layer-sidebar-button-narrow-screen);
      display: block;
      height: var(--sidebar-toggle-mobile-size);
      color: var(--text-strong);
      font-size: var(--font-md);
      font-weight: var(--font-weight-semibold);
      line-height: var(--sidebar-toggle-mobile-size);
    }

    
    body:has(#appSidebar:is([data-view="markdown"], [data-view="settings"])) .icon-btn.is-floating.sidebar-folded-back {
      display: none;
    }

    :root.is-starting .video-bar-title {
      visibility: hidden;
    }
  }

  
  .phone-bar-title,
  .video-bar-title,
  .settings-bar-title {
    padding-right: 16px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    white-space: nowrap;
    mask-image: linear-gradient(to right, black calc(100% - 16px), transparent);
  }

  .phone-bar-title::-webkit-scrollbar,
  .video-bar-title::-webkit-scrollbar,
  .settings-bar-title::-webkit-scrollbar {
    display: none;
  }

  
  :is(.phone-bar-title, .video-bar-title, .settings-bar-title).is-swiped {
    mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
  }

  
  :root.is-starting.shows-app-frame body:not(.sidebar-open, .right-sidebar-open) .phone-bar-logo {
    position: fixed;
    top: var(--phone-bar-top);
    right: calc(var(--phone-bar-button-right) + var(--sidebar-toggle-mobile-size) + 12px);
    left: calc(var(--phone-bar-button-left) + var(--sidebar-toggle-mobile-size) + 12px);
    z-index: var(--layer-sidebar-button-narrow-screen);
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--sidebar-toggle-mobile-size);
  }

  
  .phone-bar-logo svg {
    display: block;
    width: auto;
    height: calc(var(--font-lg) * 1.215);
  }

  
  .phone-bar-logo svg > path {
    fill: var(--text-strong);
  }

  :root.is-starting .phone-bar-title {
    visibility: hidden;
  }

  
  #settingsView .settings-page-title {
    display: none;
  }

  body:is(:not(.sidebar-open, .right-sidebar-open), .left-sheet-sliding, .right-sheet-sliding):has(#appSidebar[data-view="settings"]) .settings-bar-title:not(:empty) {
    position: fixed;
    top: var(--phone-bar-top);
    left: calc(var(--phone-bar-button-left) + 2 * var(--sidebar-toggle-mobile-size) + 20px);
    right: calc(var(--phone-bar-button-right) + 12px);
    z-index: var(--layer-sidebar-button-narrow-screen);
    display: flex;
    align-items: center;
    gap: 6px;
    height: var(--sidebar-toggle-mobile-size);
    color: var(--text-strong);
    font-size: var(--font-md);
    font-weight: var(--font-weight-semibold);
  }

  
  @media (max-width: 600px) {
    body:is(:not(.sidebar-open, .right-sidebar-open), .left-sheet-sliding, .right-sheet-sliding):has(#appSidebar[data-view="settings"]) .settings-bar-title:not(:empty) {
      left: calc(var(--phone-bar-button-left) + var(--sidebar-toggle-mobile-size) + 12px);
      right: calc(var(--phone-bar-button-right) + 12px);
    }
  }

  .settings-bar-page {
    flex: 0 0 auto;
    color: var(--text-muted);
  }

  .phone-bar-heading,
  .phone-bar-chips {
    flex: 0 0 auto;
  }

  .phone-bar-chips {
    display: flex;
    gap: 4px;
  }

  .phone-bar-chips .chosen-tag {
    flex: 0 0 auto;
    max-width: none;
    gap: 6px;
    padding: 3px 6px 3px 9px;
    font-weight: var(--font-weight-medium);
    cursor: pointer;
  }

  .phone-bar-chips .chosen-tag-close {
    flex: 0 0 auto;
    font-size: var(--font-sm);
    line-height: 1;
    opacity: 0.75;
  }

  body:not(.sidebar-open) .sidebar .sidebar-topbar {
    justify-content: flex-start;
    padding: 12px;
  }

  main {
    height: auto;
    padding:
      calc(var(--mobile-top-mask-height) + env(safe-area-inset-top, 0px))
      var(--phone-bar-right)
      calc(96px + env(safe-area-inset-bottom, 0px))
      var(--phone-bar-left);
    overflow: visible;
  }

  
  main::after {
    top: calc(var(--mobile-top-mask-height) + env(safe-area-inset-top, 0px) + 16px);
    right: -180px;
  }

  main:has(.app-view-entering)::after {
    opacity: var(--page-reel-dim);
  }

  
  .video-grid > .video-card,
  #settingsView:not([hidden], .is-settling) {
    animation: page-fade-in var(--duration-slow) ease both;
  }


  
  main::before {
    position: fixed;
    top: var(--app-bar-height);
    right: 0;
    left: 0;
    z-index: var(--layer-mobile-top-mask);
    display: block;
    height: calc(var(--mobile-top-mask-height) + env(safe-area-inset-top, 0px));
    margin: 0;
    background: var(--bg-base);
  }

  
  @media (display-mode: browser) {
    main::before {
      
      top: calc(env(safe-area-inset-top, 0px) + var(--phone-bar-middle) - (var(--mobile-top-mask-height) - 4px) / 2);
      right: 8px;
      left: 8px;
      height: calc(var(--mobile-top-mask-height) - 4px);
      border: 1px solid var(--border);
      border-radius: var(--radius-xl);
      
      background: var(--bg-card);
      backdrop-filter: blur(6px) saturate(1.4);
      -webkit-backdrop-filter: blur(6px) saturate(1.4);
    }
  }

  main>header,
  #markdownView {
    margin-top: 16px;
  }

  header {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: var(--font-lg);
  }

}


@media (max-width: 600px) {
  
  body.sidebar-open.page-held {
    overflow: visible;
    background-color: var(--bg-sidebar);
  }

  
  body.sidebar-open.left-sheet {
    overflow: visible;
  }

  
  body:is(.left-sheet-sliding, .right-sheet-sliding) {
    --layer-sidebar-button-narrow-screen: calc(var(--layer-sidebar) - 1);
  }

  
  body.page-held .sidebar-backdrop,
  body:is(.left-sheet, .right-sheet) .sidebar-backdrop {
    display: none;
  }

  .left-sheet .sidebar {
    position: absolute;
    bottom: auto;
    width: 100%;
    height: auto;
    
    min-height: calc(100lvh + 1px);
    
    padding-top: var(--sheet-pill-room);
    padding-bottom: 0;
    overflow: visible;
    border-right: 0;
    box-shadow: none;
    
    transform: none;
    
    transition: none;
  }

  
  .left-sheet .sidebar::before {
    content: "";
    position: absolute;
    right: 0;
    bottom: 100%;
    left: 0;
    height: 100lvh;
    background: var(--bg-sidebar);
    pointer-events: none;
  }

  
  body.left-sheet-sliding .sidebar {
    top: calc(var(--sheet-y, 0px) + var(--app-bar-height));
    
    min-height: calc(var(--sheet-top, 0px) + 100lvh);
    transform: translateX(0);
    transition: transform var(--duration-slow) ease;
  }

  body.left-sheet-sliding.left-sheet-out .sidebar {
    transform: translateX(-100%);
  }

  
  .sidebar :is(.sidebar-scroll-area, .dashboard-sidebar-shell, .dashboard-playlist-panel) {
    flex: none;
    overflow: visible;
  }

  
  .left-sheet .sidebar-scroll-area {
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  }

  
  .sidebar .dashboard-playlist-panel {
    mask-image: none;
  }

  
  .sidebar:has(.sidebar-settings-tab) .sidebar-footer {
    display: none;
  }

  
  .sidebar[data-view="settings"] .sidebar-topbar {
    order: -2;
  }

  .sidebar[data-view="settings"] .sidebar-footer {
    order: -1;
    padding: 4px 16px 0;
  }

  
  .sidebar[data-view="settings"] .sidebar-logout-popover {
    top: calc(100% + 10px);
    bottom: auto;
  }

  
  .sidebar[data-view="settings"] .sidebar-footer .install-app-row {
    display: none;
  }

  .sidebar-install-end {
    margin-top: 16px;
  }
}


@media (min-width: 601px) {
  .sidebar-settings-tab,
  .sidebar-install-end {
    display: none;
  }
}


.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding-top: 40px;
}


html:not(.shows-app-frame) .first-draw-only,
html.is-settings-page .sidebar-footer.first-draw-only {
  display: none;
}


html.is-settings-page.is-starting #dashboardRightSidebarToggle {
  display: none;
}

.video-load-sentinel {
  grid-column: 1 / -1;
  height: 1px;
}


.video-card {
  background: var(--bg-card);
  backdrop-filter: blur(1.5px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: visible;
  transition: border-color var(--duration-slow);
  display: flex;
  flex-direction: column;
  position: relative;
}

@media (hover: hover) {
  .video-card:hover {
    z-index: 20;
  }
}

.video-card.is-markdown-clickable {
  cursor: pointer;
}

.video-card.is-markdown-clickable:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

.video-card:has(.status-popover-wrap.is-open) {
  z-index: 80;
}

@media (hover: hover) {
  .video-card:has(.status-badge:hover),
  .video-card:has(.status-popover:hover) {
    z-index: 80;
  }
}

@media (hover: hover) and (pointer: fine) {
  .video-card:hover {
    border-color: var(--border-hover);
  }
}

.thumb-container {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-video);
  position: relative;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}


.thumb-container img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.card-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-weight: var(--font-weight-semibold);
  
  font-size: var(--font-md);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: var(--leading-tight);
  
  min-height: calc(2 * var(--leading-tight) * 1em);
}

.card-source-warning-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

.card-source-warning {
  margin: 0;
  color: var(--danger-text);
  font-size: var(--font-xs);
  line-height: 1.35;
}

.card-channel {
  color: var(--text-muted);
  font-size: var(--font-sm);
  margin-bottom: 16px;
}

.card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  
  margin-bottom: 10px;
}

.card-meta-row .card-channel {
  margin-bottom: 0;
}

.card-provider-link {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-sm);
  min-height: var(--control-sm);
  flex: 0 0 auto;
  
  margin-block: -4px;
  border-radius: var(--radius-xs);
  transition: color var(--duration-slow) ease;
}

.card-provider-link:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

.media-provider-icon {
  display: block;
  width: var(--icon-xl);
  height: var(--icon-xl);
  background-color: currentColor;
  mask: var(--provider-logo) center / contain no-repeat;
}
.media-provider-icon--youtube { --provider-logo: url("/icons/providers/youtube.svg"); }
.media-provider-icon--spotify { --provider-logo: url("/icons/providers/spotify.svg"); }
.media-provider-icon--vimeo { --provider-logo: url("/icons/providers/vimeo.svg"); }
.media-provider-icon--tiktok { --provider-logo: url("/icons/providers/tiktok.svg"); }
.media-provider-icon--instagram { --provider-logo: url("/icons/providers/instagram.svg"); }
.media-provider-icon--applepodcasts { --provider-logo: url("/icons/providers/applepodcasts.svg"); }
.media-provider-icon--rss { --provider-logo: url("/icons/providers/rss.svg"); }
.media-provider-icon--amazonmusic { --provider-logo: url("/icons/providers/amazonmusic.svg"); }
.media-provider-icon--audioboom { --provider-logo: url("/icons/providers/audioboom.svg"); }
.media-provider-icon--castbox { --provider-logo: url("/icons/providers/castbox.svg"); }
.media-provider-icon--castro { --provider-logo: url("/icons/providers/castro.svg"); }
.media-provider-icon--deezer { --provider-logo: url("/icons/providers/deezer.svg"); }
.media-provider-icon--iheartradio { --provider-logo: url("/icons/providers/iheartradio.svg"); }
.media-provider-icon--overcast { --provider-logo: url("/icons/providers/overcast.svg"); }
.media-provider-icon--pandora { --provider-logo: url("/icons/providers/pandora.svg"); }
.media-provider-icon--playerfm { --provider-logo: url("/icons/providers/playerfm.svg"); }
.media-provider-icon--pocketcasts { --provider-logo: url("/icons/providers/pocketcasts.svg"); }
.media-provider-icon--podcastaddict { --provider-logo: url("/icons/providers/podcastaddict.svg"); }
.media-provider-icon--spreaker { --provider-logo: url("/icons/providers/spreaker.svg"); }
.media-provider-icon--website { --provider-logo: url("/icons/providers/website.svg"); }

@media (hover: hover) {
  .card-provider-link:hover {
    color: var(--text-strong);
  }
}

.card-bottom {
  margin-top: auto;
}

.card-links {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}


.card-links a,
.card-links span {
  color: var(--text-main);
  text-decoration: none;
  font-size: var(--font-sm);
  font-weight: var(--font-weight-medium);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform var(--duration-slow) ease, color var(--duration-slow) ease;
}

@media (hover: none),
(pointer: coarse) {
  .card-links a,
  .card-links span,
  .card-provider-link {
    min-height: 36px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .card-links a:hover {
    color: var(--text-strong);
    transform: scale(1.05);
  }
}

.card-links a.disabled,
.card-links span.disabled {
  color: var(--text-muted);
  cursor: default;
}

.card-links a.has-error,
.card-links span.has-error {
  color: var(--status-red);
}


.card-links .is-icon-only {
  margin-left: auto;
  gap: 0;
}

.card-links .is-icon-only:focus-visible {
  outline: 2px solid var(--border-strong);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}


.card-meta-dates {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--text-muted);
  
  font-size: var(--font-2xs);
  
  margin-bottom: 16px;
}

.card-released,
.card-duration {
  white-space: nowrap;
}


.card-duration {
  font-variant-numeric: tabular-nums;
}


.right-sidebar-heading .card-meta-dates {
  margin-top: 0;
  margin-bottom: 0;
}


.dashboard-playlist-row:focus-within .row-actions {
  display: flex;
}
@media (hover: hover) {
  .dashboard-playlist-row:hover .row-actions {
    display: flex;
  }
}


.dashboard-playlist-row .row-action {
  --row-action-size: 20px;
  --row-action-icon: 13px;
}


.dashboard-playlist-row:not(:has(.dashboard-playlist-health-dot)) .row-actions {
  margin-right: calc((8px - 20px) / 2);
}



input.dashboard-playlist-rename-input {
  box-sizing: border-box;
  
  height: 22px;
  width: 100%;
  min-width: 0;
  padding: 0 5px;
  margin: 0;
  
  color: var(--inverse-text);
  background: var(--inverse-bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: 20px;
}

input.dashboard-playlist-rename-input:focus {
  outline: none;
  border-color: var(--accent);
}


.dashboard-playlist-name:has(.dashboard-playlist-rename-input) {
  overflow: visible;
}


[data-rename-collection] {
  cursor: text;
}

@keyframes page-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .video-grid > .video-card,
  #settingsView:not([hidden]) {
    animation: none;
  }
}


.thumb-container.is-portrait-thumbnail { background: var(--bg-video); }


.thumb-container.is-whole-thumbnail > img { object-fit: contain; }
.thumb-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.thumb-container .thumb-backdrop img {
  object-fit: cover;
  border-radius: 0;
  filter: blur(40px) brightness(.5);
  transform: scale(1.25);
}
.thumb-container.is-portrait-thumbnail img { object-fit: contain; }


.settings-grid {
  display: grid;
  gap: 32px;
  width: min(800px, calc(100% - 48px));
  max-width: 800px;
  min-width: 0;
  margin-top: 40px;
  margin-right: auto;
  margin-left: auto;
}


.settings-grid > *,
.ai-settings,
#aiOperationsStatus,
.cloud-usage-panel,
#cloudUsageStatus,
.cloud-usage-question > *,
#operationsContent {
  min-width: 0;
}


.settings-grid:has(> .topics-settings:not([hidden])) {
  width: min(1280px, calc(100% - 48px));
  max-width: 1280px;
}

.account-page {
  max-width: 720px;
}

.operations-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.operations-heading { margin-bottom: 1.5rem; }


.cloud-usage-panel {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.cloud-usage-panel > summary strong { font-size: var(--font-base); }
.cloud-usage-panel .ai-operations-body { margin-top: 1rem; }
.cloud-usage-problems li { overflow-wrap: anywhere; }
.cloud-usage-panel .ai-operations-filters { justify-content: space-between; margin-top: 0; }
.cloud-usage-panel .ai-operations-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.cloud-usage-question { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; margin-top: 1.75rem; }
.cloud-usage-question:first-of-type { margin-top: 0; }
.cloud-usage-question h4 { margin: 0; font-size: var(--font-base); }
.cloud-usage-answer { margin: 0; max-width: 46rem; line-height: 1.5; }
.cloud-usage-more > summary { width: fit-content; color: var(--text-muted); font-size: var(--font-sm); cursor: pointer; }
.cloud-usage-more[open] > summary { margin-bottom: .75rem; }
.cloud-usage-more .ai-operations-summary { margin-bottom: .75rem; }
.cloud-usage-devices td[rowspan] { vertical-align: top; }
.cloud-usage-devices .cloud-usage-day-start td { border-top: 1px solid var(--border-medium); }
.cloud-usage-none { color: var(--text-muted); }

.cloud-usage-check { display: flex; align-items: baseline; gap: .5rem; }
.cloud-usage-check .status-dot { flex: none; transform: translateY(-1px); }
.cloud-usage-check.is-warning strong { color: var(--status-amber); }

.cloud-usage-stretches.data-table { width: 100%; }
.cloud-usage-stretches td:not(.is-number) { white-space: normal; }
.cloud-usage-stretches .is-now td { font-weight: 600; }


.cloud-usage-chart { margin: .25rem 0 0; }
.cloud-usage-chart figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; margin-bottom: .35rem; color: var(--text-muted); font-size: var(--font-sm); }

.cloud-usage-chart-key { display: inline-flex; align-items: center; gap: .4rem; font-size: var(--font-xs); }
.cloud-usage-chart-key::before { content: ""; width: 16px; border-top: 1px solid var(--text-muted); }
.cloud-usage-chart-plot { position: relative; height: 160px; margin-top: 1.1rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border-medium); }
.cloud-usage-chart-top { position: absolute; top: -1.1rem; right: 0; color: var(--text-muted); font-size: var(--font-xs); font-variant-numeric: tabular-nums; }
.cloud-usage-chart-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.cloud-usage-chart-day { display: flex; flex: 1 1 0; align-items: flex-end; justify-content: center; height: 100%; min-width: 0; border-radius: 4px 4px 0 0; }
.cloud-usage-chart-day i { display: block; width: 100%; max-width: 24px; min-height: 1px; background: var(--chart-bar); border-radius: 4px 4px 0 0; }
.cloud-usage-chart-day:focus-visible i { filter: brightness(1.3); }
@media (hover: hover) {
  .cloud-usage-chart-day:hover i {
    filter: brightness(1.3);
  }
}
.cloud-usage-chart-day:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

.cloud-usage-chart-day.is-today i { opacity: .55; }
.cloud-usage-chart-free { position: absolute; z-index: 1; left: 0; right: 0; border-top: 1px solid var(--text-muted); pointer-events: none; }
.cloud-usage-chart-axis { display: flex; justify-content: space-between; margin-top: .35rem; color: var(--text-muted); font-size: var(--font-xs); }
.cloud-usage-panel .data-table-wrap { max-height: none; }
.ax-page .data-table .is-number,
.cloud-usage-panel .data-table .is-number { text-align: right; font-variant-numeric: tabular-nums; }
.cloud-usage-note { margin: 1rem 0 0; color: var(--text-muted); font-size: var(--font-sm); max-width: 46rem; }
.cloud-usage-problems { display: grid; gap: .35rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.cloud-usage-problems li { color: var(--status-amber); font-size: var(--font-sm); }
@media (max-width: 650px) {
  .cloud-usage-panel .ai-operations-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.operations-heading p { margin: .35rem 0 0; }


.operations-database {
  display: grid; gap: .2rem; margin-bottom: 1.5rem; overflow-wrap: anywhere;
  padding: .75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-surface);
}
.operations-database.is-live {
  border-color: var(--status-amber); background: var(--warning-bg);
}
.operations-database-warning { color: var(--status-amber); font-weight: var(--font-weight-semibold); }


.operations-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.5rem; padding: 0 .4rem; height: 1.5rem; border-radius: var(--radius-pill);
  background: var(--bg-control); color: var(--text-muted);
  font-size: var(--font-sm); font-weight: var(--font-weight-semibold);
}

.operations-failure-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.operations-failure {
  display: grid; grid-template-columns: auto 1fr auto; gap: .85rem; align-items: start;
  padding: .9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-surface);
}
.operations-failure.is-stopped {
  border-color: var(--danger-border); background: var(--danger-bg);
}
.operations-failure-icon { display: flex; padding-top: .1rem; color: var(--status-amber); }
.operations-failure.is-stopped .operations-failure-icon { color: var(--status-red); }
.operations-failure-body { min-width: 0; display: grid; gap: .25rem; }
.operations-failure-body p { margin: 0; }

.operations-failure-about {
  color: var(--text-main); font-weight: var(--font-weight-semibold);
  min-width: 0; overflow-wrap: anywhere;
}
.operations-failure-what { color: var(--text-muted); overflow-wrap: anywhere; }
.operations-failure-why { overflow-wrap: anywhere; }
.operations-failure-next { color: var(--text-muted); font-size: var(--font-sm); }
.operations-failure-reason {
  color: var(--text-muted); font-size: var(--font-xs); font-family: var(--font-mono);
  overflow-wrap: anywhere;
}
.operations-failure-actions { display: flex; flex-direction: column; gap: .4rem; }
.operations-failure-actions .btn { white-space: nowrap; }
@media (max-width: 720px) {
  .operations-failure { grid-template-columns: auto 1fr; }
  .operations-failure-actions { grid-column: 2; flex-direction: row; }
}


.ai-operations-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; }
.ai-operations-panel > summary::-webkit-details-marker { display: none; }
.ai-operations-panel > summary > span { display: grid; gap: .3rem; min-width: 0; }
.ai-operations-panel > summary strong { font-size: var(--font-lg); }
.ai-operations-panel > summary small { color: var(--text-muted); font-size: var(--font-sm); }
.ai-operations-panel > summary svg { flex: none; width: 18px; height: 18px; color: var(--text-muted); transition: transform var(--duration-base) ease; }
.ai-operations-panel[open] > summary svg { transform: rotate(180deg); }
.ai-operations-body { display: grid; gap: 1rem; margin-top: 1.5rem; }
.ai-operations-count { margin: 0; }


.topics-settings { min-width: 0; }
.topics-settings-panel { display: grid; gap: 1rem; padding: 1.1rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-surface); }
.topics-settings-panel + .topics-settings-panel { margin-top: 1rem; }

.topics-workbench + .topics-settings-panel { margin-top: 1.5rem; }

.topics-empty { padding: 1.4rem; text-align: center; }


#settingsView .custom-select-trigger {
  gap: .75rem;
  padding: 0 .5rem 0 .6rem;
  border-radius: var(--radius-sm);
  background: var(--bg-control);
  font-size: var(--font-sm);
}
#settingsView .custom-select-wrap.is-open .custom-select-trigger { border-color: var(--border-strong); }
@media (hover: hover) {
  #settingsView .custom-select-trigger:hover {
    border-color: var(--border-strong);
  }
}
#settingsView .custom-select-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#settingsView .custom-select-trigger svg { flex: 0 0 auto; }
#settingsView .custom-select-popover { min-width: 100%; width: max-content; max-width: 22rem; border-radius: var(--radius-sm); }


#settingsView .list-filter-bar .custom-select-wrap.is-chosen .custom-select-trigger {
  color: var(--inverse-text);
  background: var(--inverse-bg);
  border-color: var(--inverse-bg);
}
#settingsView .list-filter-bar .custom-select-wrap.is-chosen.is-open .custom-select-trigger { border-color: var(--inverse-bg); }
@media (hover: hover) {
  #settingsView .list-filter-bar .custom-select-wrap.is-chosen .custom-select-trigger:hover {
    border-color: var(--inverse-bg);
  }
}
#settingsView .list-filter-bar .custom-select-wrap.is-chosen .custom-select-trigger svg { color: var(--inverse-text-muted); }
#settingsView .custom-select-option { border-radius: var(--radius-sm); white-space: nowrap; }


.topics-history-filters .custom-select-wrap { flex: 0 0 auto; width: auto; min-width: 9rem; }
.ai-setting-row .custom-select-wrap { width: auto; min-width: 15rem; }

.ai-setting-row .custom-select-popover { left: auto; right: 0; }

.topics-workbench { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 1rem; margin-top: 1rem; align-items: start; }
.topics-catalog-list { display: grid; gap: .3rem; align-content: start; max-height: 34rem; overflow-y: auto; padding-right: .25rem; padding-bottom: .5rem; scrollbar-gutter: stable; }

.topics-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: .6rem; padding: .5rem .7rem; border: 1px solid transparent; border-radius: var(--radius-md); cursor: pointer; transition: background var(--duration-base) ease, border-color var(--duration-base) ease; }
@media (hover: hover) {
  .topics-row:hover {
    background: var(--fill-subtle);
  }
}
.topics-row.is-selected { border-color: var(--border-strong); background: var(--fill-soft); }

.topics-row:focus { outline: none; }
.topics-row:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: -2px; }

.topics-flag { display: inline-flex; align-items: center; color: var(--text-muted); }
.topics-flag svg { width: 15px; height: 15px; }
.topics-flag[data-tone="warn"] { color: var(--status-amber); }
.topics-flag[data-tone="merged"] { color: var(--status-amber); }
.topics-flag[data-tone="archived"],
.topics-flag[data-tone="quiet"] { color: var(--text-muted); opacity: .65; }

.topics-flag[data-tone="empty"] { color: var(--status-amber); }


.topics-duplicate-group { display: grid; gap: .5rem; padding: .85rem; border: 1px solid var(--warning-border); border-radius: var(--radius-md); background: var(--warning-bg); }
.topics-duplicate-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.topics-duplicate-head strong { color: var(--status-amber); font-size: var(--font-sm); }
.topics-duplicate { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: .75rem; padding: .65rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-control); }
.topics-duplicate > div:first-child { display: grid; gap: .2rem; min-width: 0; }
.topics-duplicate strong { font-size: var(--font-sm); font-weight: var(--font-weight-medium); }
.topics-duplicate small { color: var(--text-muted); font-size: var(--font-xs); }
.topics-duplicate p { margin: 0; color: var(--text-muted); font-size: var(--font-sm); line-height: var(--leading-normal); }
.topics-duplicate-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }

.topics-load-more, .ai-operations-more { width: 100%; margin-top: .35rem; }
.topics-load-more span, .ai-operations-more span { font-size: var(--font-xs); }

.topics-catalog-detail { position: sticky; top: 0; display: grid; align-content: start; gap: .9rem; padding: 1.1rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-surface); }

.topics-detail-note { margin: 0; color: var(--text-muted); font-size: var(--font-sm); line-height: var(--leading-normal); }


.topics-detail-facts { margin: 0; color: var(--text-muted); font-size: var(--font-sm); line-height: var(--leading-normal); }

.topics-term-group { display: grid; gap: .45rem; }
.topics-term-group > strong { font-size: var(--font-sm); }

.topics-term-list { display: flex; flex-wrap: wrap; gap: .35rem; max-height: 8.5rem; overflow-y: auto; padding-right: .25rem; scrollbar-gutter: stable; }


.topics-revision-list { display: grid; gap: .6rem; }

.topics-revision { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: .75rem; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-inset); font-size: var(--font-sm); }
.topics-revision > div { display: grid; gap: .2rem; min-width: 0; }
.topics-revision small { color: var(--text-muted); font-size: var(--font-xs); }
.topics-revision.is-undone { opacity: .6; }


.topics-disclosure-panel { padding: 0; }
.topics-disclosure-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem; cursor: pointer; list-style: none; }
.topics-disclosure-panel > summary::-webkit-details-marker { display: none; }
.topics-disclosure-panel > summary > span { display: grid; gap: .3rem; min-width: 0; }
.topics-disclosure-panel > summary small { color: var(--text-muted); font-size: var(--font-sm); }
.topics-disclosure-panel > summary svg { width: 18px; height: 18px; color: var(--text-muted); transition: transform var(--duration-base) ease; }
.topics-disclosure-panel[open] > summary svg { transform: rotate(180deg); }
.topics-disclosure-body { display: grid; gap: 1rem; padding: 0 1.1rem 1.1rem; border-top: 1px solid var(--border); }

.topics-history-filters { position: relative; display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.topics-history-filters select { min-width: 9rem; padding: .5rem .6rem; }

.topics-list-count { margin: 0; }

.topic-chip.is-removable { padding-right: 4px; }
.topic-chip.is-removable button { display: grid; place-items: center; width: 16px; height: 16px; padding: 0; border: 0; border-radius: var(--radius-round); background: var(--fill-medium); color: var(--text-muted); font: inherit; font-size: var(--font-xs); line-height: 1; cursor: pointer; }
@media (hover: hover) {
  .topic-chip.is-removable button:hover {
    background: var(--fill-heavy);
    color: var(--text-main);
  }
}

@media (max-width: 900px) {
  .topics-workbench { grid-template-columns: minmax(0, 1fr); }
  .topics-catalog-list { max-height: 22rem; }
  
  .topics-catalog-detail { position: static; }
}

.ai-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}

.ai-setting-row + .ai-setting-row { margin-top: .75rem; }
.ai-setting-row > span { display: grid; gap: .35rem; }
.ai-setting-row small { color: var(--text-muted); line-height: 1.4; }
.ai-setting-row select { min-width: 15rem; }

.ai-operations-summary { display: grid; width: 100%; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; }
.ai-operations-summary span { display: grid; gap: .25rem; padding: .85rem; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.ai-operations-summary strong { font-size: 1.1rem; }
.ai-operations-summary small { color: var(--text-muted); }

.ai-operations-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .75rem 0; }
.ai-operations-filters select { min-width: 0; }
.ai-operations-filters { position: relative; }
.ai-date-range-popover { position: absolute; z-index: 20; top: calc(100% + .35rem); right: 0; width: min(22rem, 100%); padding: .85rem; }
.ai-date-range-field { display: grid; gap: .4rem; color: var(--text-muted); font-size: var(--font-sm); }
.ai-date-range-field input { width: 100%; min-width: 0; margin-bottom: 0; cursor: pointer; color: var(--text-main); background: var(--bg-control); border-color: var(--border); }

.ai-date-range-hint { margin: 0 0 .5rem; font-size: var(--font-sm); color: var(--danger); }
.ai-date-range-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .75rem; }

.ai-dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }

#aiRemoveModelBtn { margin-right: auto; }
.ai-admin-section { display: grid; gap: 16px; }
.ai-admin-defaults { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ai-admin-defaults label { display: grid; gap: 5px; color: var(--text-muted); font-size: var(--font-sm); }
.ai-admin-defaults select { width: 100%; min-width: 0; }
.ai-admin-model-meta { display: grid; gap: 2px; }
.ai-admin-model-meta small { color: var(--text-muted); }
.ai-admin-model-tasks { display: flex; flex-wrap: wrap; gap: 5px; }
.ai-admin-model-actions { display: flex; flex-wrap: nowrap; gap: 6px; }
.ai-model-status,
.ai-model-task { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 8px; border: 1px solid var(--border); border-radius: var(--radius-pill); color: var(--text-muted); font-size: var(--font-xs); line-height: 1; }
.ai-admin-dialog { position: fixed; inset: 0; width: min(680px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 0; color: var(--text-main); background: var(--bg-sidebar); border: 1px solid var(--border-strong); border-radius: var(--radius-xl); box-shadow: var(--shadow-dialog); }
.ai-admin-dialog::backdrop { background: var(--bg-backdrop); backdrop-filter: blur(4px); }
.ai-admin-dialog form { display: grid; gap: 14px; padding: 20px; overflow-y: auto; max-height: calc(100dvh - 48px); }
.ai-admin-dialog label { display: grid; gap: 6px; color: var(--text-muted); }
.ai-admin-dialog input:not([type="checkbox"]), .ai-admin-dialog select, .ai-admin-dialog textarea { width: 100%; padding: 9px 11px; color: var(--text-main); background: var(--bg-control); border: 1px solid var(--border); border-radius: var(--radius-md); font: inherit; }
.ai-admin-dialog fieldset { display: flex; flex-wrap: wrap; gap: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.ai-admin-dialog fieldset label { display: flex; align-items: center; gap: 6px; color: var(--text-main); }
.ai-model-history { display: grid; gap: 7px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.ai-model-history h4, .ai-model-history p { margin: 0; }
.ai-model-history article { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 10px; color: var(--text-muted); font-size: var(--font-sm); }
.ai-prompt-dialog { width: min(960px, calc(100vw - 40px)); }
.ai-prompt-section,

.ai-prompt-test { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-surface); }
.ai-prompt-section > summary,
.ai-prompt-test > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; color: var(--text-main); font-weight: var(--font-weight-medium); cursor: pointer; list-style: none; }
.ai-prompt-section > summary::-webkit-details-marker,
.ai-prompt-test > summary::-webkit-details-marker { display: none; }
.ai-prompt-section > summary::after,
.ai-prompt-test > summary::after { content: '›'; margin-left: auto; color: var(--text-muted); font-size: var(--font-lg); transform: rotate(90deg); transition: transform var(--duration-base) ease; }
.ai-prompt-section[open] > summary::after,
.ai-prompt-test[open] > summary::after { transform: rotate(-90deg); }
.ai-prompt-section > summary small { margin-left: auto; color: var(--text-muted); font-size: var(--font-xs); font-weight: var(--font-weight-normal); }
.ai-prompt-section-body { display: grid; gap: 14px; padding: 0 14px 14px; border-top: 1px solid var(--border); }
.ai-prompt-section-body > :first-child { margin-top: 14px; }
.ai-prompt-test[open] { display: grid; gap: 12px; padding-bottom: 14px; }
.ai-prompt-test[open] > label,
.ai-prompt-test[open] > button,
.ai-prompt-test[open] > section { margin-right: 14px; margin-left: 14px; }
.ai-prompt-autosize { overflow-y: hidden; resize: vertical; }
.ai-prompt-test-result { display: grid; gap: 8px; margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-control); }
.ai-prompt-test-result[hidden] { display: none; }
.ai-prompt-test-result-heading,
.ai-prompt-test-result-heading > div,
.ai-prompt-comparison-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-prompt-test-result-heading > div { justify-content: flex-start; }
.ai-prompt-test-result p { margin: 0; }
.ai-prompt-test-result pre { margin: 0; white-space: pre-wrap; max-height: 280px; overflow: auto; color: var(--text-main); background: var(--bg-sidebar); padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.ai-prompt-test-matrix { padding: 0; }
.ai-prompt-test-matrix ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ai-prompt-test-matrix li { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-muted); font-size: var(--font-sm); }
.ai-prompt-test-state { white-space: nowrap; }
.ai-prompt-test-state[data-status="passed"] { color: var(--success); }
.ai-prompt-test-state[data-status="failed"] { color: var(--danger); }
.ai-prompt-publish-status { margin: 0; color: var(--success); text-align: right; }
.ai-prompt-comparison { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-control); }
.ai-prompt-comparison h4, .ai-prompt-comparison p { margin: 0; }
.ai-prompt-comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ai-prompt-comparison pre { min-width: 0; max-height: 240px; margin: 0; padding: 10px; overflow: auto; white-space: pre-wrap; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-sidebar); color: var(--text-main); }
.ai-prompt-history { display: grid; gap: 6px; }
.ai-prompt-history article { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; color: var(--text-muted); font-size: var(--font-sm); }
.ai-prompt-history-actions { display: flex; gap: 6px; }

@media (max-width: 650px) {
  .ai-setting-row { align-items: stretch; flex-direction: column; }
  .ai-setting-row select { width: 100%; min-width: 0; }
  .ai-operations-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-operations-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-admin-defaults { grid-template-columns: 1fr; }
  .ai-prompt-section > summary { align-items: flex-start; }
  .ai-prompt-section > summary small { display: none; }
  .ai-prompt-comparison-grid { grid-template-columns: 1fr; }
}


.videos-catalog-title {
  color: var(--text-main); font-weight: var(--font-weight-medium);
  display: flex; align-items: flex-start; gap: .4rem;
}

.videos-warning { display: inline-flex; flex: 0 0 auto; padding-top: .1rem; }
.videos-warning.is-stopped { color: var(--status-red); }
.videos-warning.is-waiting { color: var(--status-amber); }


.videos-needs-a-hand {
  margin: .3rem 0 0; font-size: var(--font-xs); line-height: 1.45;
}
.videos-needs-a-hand.is-stopped { color: var(--status-red); }
.videos-needs-a-hand.is-waiting { color: var(--status-amber); }


.status-popover-wrap-table { position: relative; inset: auto; display: inline-flex; }
.status-popover-wrap-table .status-badge { position: relative; bottom: auto; right: auto; }


.status-popover-wrap-table .status-popover {
  position: fixed;
  inset: auto;
  width: 24rem;
  max-width: min(24rem, calc(100vw - 1.5rem));
  overflow-y: auto;
  border-radius: var(--radius-xl);
}

.status-popover-wrap-table.is-open { z-index: var(--layer-popup); }
@media (hover: hover) {
  .status-popover-wrap-table:hover {
    z-index: var(--layer-popup);
  }
}

.videos-catalog-sub { color: var(--text-muted); font-size: var(--font-xs); }

.videos-catalog-when { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-muted); }

.videos-chip {
  display: inline-block; margin: 0 .25rem .25rem 0; padding: .1rem .45rem;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-pill);
  font-size: var(--font-xs); color: var(--text-muted);
}


.videos-shelf {
  display: inline-block; padding: .1rem .45rem; border-radius: var(--radius-pill);
  font-size: var(--font-xs); text-transform: capitalize;
  background: var(--success-bg-strong); color: var(--status-green);
}

.videos-shelf.is-archived { background: var(--warning-bg-strong); color: var(--status-amber); }

.videos-shelf.is-trashed { background: var(--danger-bg-strong); color: var(--status-red); }



.tags-row {
  display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: .6rem;
  width: 100%; padding: .5rem .7rem; text-align: left;
  border: 1px solid transparent; border-radius: var(--radius-md);
  background: transparent; color: inherit; font: inherit; cursor: pointer;
  transition: background var(--duration-base) ease, border-color var(--duration-base) ease;
}
@media (hover: hover) {
  .tags-row:hover {
    background: var(--fill-subtle);
  }
}
.tags-row.is-selected { border-color: var(--border-strong); background: var(--fill-soft); }
.tags-row:focus-visible { outline: var(--focus-ring); outline-offset: 1px; }
.tags-row-name { display: grid; gap: .1rem; min-width: 0; }
.tags-row-name small { color: var(--text-muted); font-size: var(--font-xs); }


.tags-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.tags-detail-head > div { min-width: 0; }
.tags-detail-head h3 { margin: 0; }
.tags-detail-head p { margin: .3rem 0 0; font-size: var(--font-sm); }

.tags-detail-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.tags-detail-block { margin-top: 1.2rem; }
.tags-detail-block h4 { margin: 0 0 .5rem; font-size: var(--font-sm); }
.tags-detail-list { display: grid; gap: .35rem; margin: 0; padding: 0; list-style: none; font-size: var(--font-sm); }
.tags-detail-list li { padding: .35rem .5rem; border-radius: var(--radius-sm); background: var(--fill-faint); }


#topicsCatalogListFilter { margin-top: 1rem; }
#tagsListFilter { margin: 1rem 0 .25rem; }


.topics-history-filters > .list-filter-bar,
.ai-operations-filters > .list-filter-bar { flex: 1 1 22rem; min-width: 0; }


.ai-operations-filters > .list-filter-bar > .custom-select-wrap { max-width: 15rem; }


@media (max-width: 600px) {
  .settings-grid > .card {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
  }

  .settings-grid > .card:not([hidden]) ~ .card:not([hidden]) {
    padding-top: 24px;
    border-top: 1px solid var(--border);
  }

  
  .ai-setting-row:has(> .switch) {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }

  .ai-setting-row + .ai-setting-row {
    margin-top: 0;
    border-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }

  .ai-setting-row:has(+ .ai-setting-row) {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  
  .topics-catalog-list,
  #tags-settings .tags-tree-panel {
    height: auto;
    max-height: none;
    overflow: visible;
  }
}




.ax-attention h3 { margin: 0; color: var(--text-strong); font-size: var(--font-base); font-weight: var(--font-weight-medium); }
.ax-attention-title { display: inline-flex; align-items: center; gap: .5rem; }
.ax-attention.is-asking { border-color: color-mix(in srgb, var(--status-red) 45%, var(--border)); }
.ax-attention .operations-count.is-stop { color: var(--text-on-color-dark); background: var(--status-red); }
.ax-full-check { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; }
.ax-full-check > div { flex: 1 1 24rem; min-width: 0; }
.ax-full-check h3 { margin: 0 0 .2rem; color: var(--text-strong); font-size: var(--font-base); font-weight: var(--font-weight-medium); }
.ax-page .operations-database { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .9rem; margin: 0; padding: .55rem .9rem; }

.ax-page .cloud-usage-panel { margin: 0; padding: 0; background: none; border: 0; }
.ax-page .cloud-usage-panel > summary { display: none; }
.ax-page .cloud-usage-panel .ai-operations-body { margin-top: 0; }
.ax-page .cloud-usage-question { display: grid; grid-template-columns: minmax(0, 1fr); gap: .85rem; padding: 1rem; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius-lg); }
@media (max-width: 760px) {
  .ax-full-check .btn { width: 100%; }
}


.ax-page .ai-admin-section[hidden] { display: none; }
.ai-configuration[hidden] { display: none; }
.ax-page .ai-configuration { align-items: start; }

.ax-card .ai-setting-row { padding: .75rem 0 0; background: none; border: 0; border-top: 1px solid var(--border); border-radius: 0; }
.ax-card .ai-setting-row + .ai-setting-row { margin-top: 0; }
.ax-card .ai-setting-row .custom-select-wrap { min-width: 0; width: 100%; }
#settingsView .ax-card .ai-setting-row .custom-select-popover,
#settingsView .ax-card .ai-admin-defaults .custom-select-popover { left: 0; right: auto; width: 100%; min-width: 0; max-width: 100%; }
.ai-configuration .ai-setting-row { flex-wrap: wrap; gap: .6rem 1.5rem; }
.ai-configuration .ai-setting-row > span { flex: 1 1 12rem; min-width: 0; }
.ax-failure-list { display: grid; margin: 0; padding: 0; list-style: none; }
.ax-failure-line { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .5rem 1rem; padding: .7rem 0; border-top: 1px solid var(--border); }
.ax-failure-line:first-child { padding-top: 0; border-top: 0; }
.ax-failure-line > div { flex: 1 1 18rem; min-width: 0; }
.ax-failure-line p { margin: 0; }
.ax-failure-what { color: var(--text-strong); font-size: var(--font-sm); }
.ax-failure-message { margin: .2rem 0; color: var(--text-body); font-size: var(--font-sm); overflow-wrap: anywhere; }
.ax-panel-body .ax-panel-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.ax-panel-body .ax-panel-actions .btn { flex: 0 0 auto; width: auto; }
.ax-page .ai-admin-model-meta code { overflow-wrap: anywhere; white-space: normal; }
.ax-page .pw-launch-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }



#videosToolbar.is-table #videosDateIsCustomSelect,
#videosToolbar.no-compare #videosCompareCustomSelect { display: none; }
.ax-page .videos-table td { vertical-align: middle; }

.videos-written-cell .card-links { flex-wrap: nowrap; gap: 10px; padding-top: 0; border-top: 0; }
.videos-written-cell .card-links .is-icon-only { margin-left: 0; }
.ax-page .videos-table .videos-written-cell { white-space: nowrap; }

.ax-page .is-narrow .videos-table td:not(:first-child) { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.ax-page .videos-table .videos-video-cell { min-width: 11rem; }
.ax-page .videos-table td[data-label="Playlists"] .videos-chip { white-space: normal; }
.ax-page .videos-table .videos-chip { white-space: nowrap; }
.videos-warning svg { width: 15px; height: 15px; }
.ax-unfinished-title { display: flex; align-items: center; gap: .4rem; margin: 0 0 .4rem; color: var(--text-body); font-size: var(--font-sm); font-weight: var(--font-weight-medium); }
.ax-unfinished-title svg { width: 15px; height: 15px; flex: 0 0 auto; }
.ax-unfinished-title.is-stopped svg { color: var(--status-red); }
.ax-unfinished-title.is-waiting svg { color: var(--status-amber); }
.ax-ranks + .ax-unfinished-title { margin-top: 1rem; }
.videos-panel-picture { display: block; width: 100%; max-width: 20rem; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-md); background: var(--bg-surface); }
.videos-panel-state { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.ax-panel-body .videos-needs-a-hand { margin: 0; font-size: var(--font-sm); }
.ax-page .videos-table .status-popover { white-space: normal; }



.ax-page .playlist-add-panel { margin: 0; padding: 1rem; background: var(--bg-panel); border-radius: var(--radius-lg); }
.ax-page .playlist-add-hint { margin-bottom: .6rem; }
.ax-page .shelves-table td { vertical-align: middle; }
.ax-page .shelves-table-wrap { max-height: none; }
.shelves-name-cell { min-width: 15rem; }
.shelves-name-wrap { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.shelves-picture { flex: 0 0 auto; }
.shelves-picture .playlist-thumb { display: flex; width: 72px; }
.shelves-name-text { min-width: 0; }
.shelves-name-line { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.shelves-name-line .playlist-name { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.shelves-name-line .status-dot { flex: 0 0 auto; }
.shelves-name-text .playlist-source-warning { margin: .15rem 0 0; font-size: var(--font-sm); white-space: normal; }
.shelves-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.shelves-actions:empty { display: none; }
.shelves-actions .btn { flex: 0 0 auto; min-width: 0; width: auto; }
.ax-panel-body .videos-panel-state { display: flex; }
.shelves-panel-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.shelves-panel-buttons .btn { width: auto; min-width: 0; }
.shelves-quiet .ax-link { text-align: left; overflow-wrap: anywhere; }

.ax-page .shelves-group-head td { padding-top: .85rem; padding-bottom: .35rem; }
.ax-page .shelves-group + .shelves-group .shelves-group-head td { border-top: 1px solid var(--border); }
.shelves-group-name { color: var(--text-strong); font-weight: var(--font-weight-medium); }
.shelves-group-count { margin-left: .35rem; color: var(--text-muted); }
.ax-page .shelves-table tr.is-in-group .shelves-name-cell { padding-left: 1.6rem; }
.ax-page .is-narrow .ax-fit tr.shelves-group-head { padding: 0; border-bottom: 0; }
.ax-page .is-narrow .ax-fit tr.shelves-group-head td { padding: .75rem 0 .1rem; }
.ax-page .is-narrow .ax-fit thead + .shelves-group tr.shelves-group-head td { padding-top: 0; }
.ax-page .is-narrow .ax-fit tr.is-in-group { padding-left: 1rem; }
.ax-page .is-narrow .ax-fit tr.is-in-group .shelves-name-cell { padding-left: 0; }
@media (max-width: 760px) {
  .shelves-settings .ax-tabs { gap: 0; }
  .shelves-settings .ax-tabs .tab { flex: 1 1 auto; padding-inline: .35rem; font-size: var(--font-sm); }
}

.ax-page .cloud-usage-panel .data-table-wrap { max-height: none; }



.connections-settings .ax-toolbar.no-compare [id$="CompareCustomSelect"] { display: none; }
.connections-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; min-width: 0; }
.connections-cards .connection-item { flex-direction: column; align-items: stretch; justify-content: space-between; gap: 1rem; min-width: 0; padding: 1rem; background: var(--bg-panel); border-radius: var(--radius-lg); }
.connections-cards .conn-info { flex: 0 1 auto; display: grid; gap: .35rem; }
.connections-cards .conn-info h3 { margin: 0; font-size: var(--font-md); }
.connections-cards .conn-info p { margin: 0; overflow-wrap: anywhere; }
.connections-cards .conn-title-group { margin: 0; padding-right: 0; }

.connections-cards .layout-setting { display: grid; grid-template-columns: auto minmax(0, 1fr); margin-top: .25rem; }
.connections-cards .layout-setting[hidden] { display: none; }
.connections-cards .layout-setting-label { min-width: 0; justify-self: start; line-height: var(--leading-normal); }
.connections-cards .layout-setting-note { grid-column: 2; }
.connections-cards .folder-sync-actions { flex-direction: row; flex-wrap: wrap; width: 100%; }
.connections-cards .folder-sync-actions .btn { flex: 1 1 8rem; width: auto; min-width: 0; justify-content: center; text-align: center; }
.connections-cards .folder-sync-actions .btn[hidden] { display: none; }

.connections-cards .folder-sync-actions:not(:has(.btn:not([hidden]))) { display: none; }
.connections-cards .cleanup-setting { flex-wrap: wrap; }
@media (max-width: 1180px) { .connections-cards { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 761px) { .connections-settings .ax-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }



.markdown-settings-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1rem; align-items: start; min-width: 0; }
.markdown-settings-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.markdown-settings-actions .btn[hidden] { display: none; }
.markdown-settings #markdownRerenderStatus:empty { display: none; }
.markdown-settings #markdownRerenderStatus { margin: 0; }
.markdown-sample { width: auto; max-width: none; max-height: 46rem; margin: 0; padding: 0 .25rem 0 0; overflow: auto; overflow-wrap: anywhere; display: grid; align-content: start; gap: .75rem; font-size: var(--font-sm); }
.markdown-sample h1 { margin: 0; font-size: var(--font-lg); line-height: 1.3; }
.markdown-sample h2 { margin: .75rem 0 .35rem; font-size: var(--font-base); }
.markdown-sample p { margin: 0 0 .5rem; }
.markdown-sample details { margin: 0; }
.markdown-sample-off { display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%; padding: .55rem .75rem; color: var(--text-muted); font-size: var(--font-sm); text-align: left; background: none; border: 1px dashed var(--border); border-radius: var(--radius-md); cursor: pointer; }
@media (hover: hover) {
  .markdown-sample-off:hover {
    color: var(--text-strong);
    border-color: var(--text-muted);
  }
}
@media (max-width: 900px) {
  .markdown-settings-grid { grid-template-columns: minmax(0, 1fr); }
  .markdown-sample { max-height: none; overflow: visible; }
}
@media (max-width: 760px) {
  .markdown-settings .ax-tiles > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .markdown-settings-actions .btn { flex: 1 1 100%; }
}
#markdownSample h1 { margin: 0; font-size: var(--font-lg); line-height: 1.3; }
#markdownSample h2 { margin: .75rem 0 .35rem; font-size: var(--font-base); }
#markdownSample details { margin: 0; padding: 0; }
#markdownSample details > summary { margin: 0; padding: .35rem 0; font-size: var(--font-base); }
#markdownSample p, #markdownSample li { font-size: var(--font-sm); line-height: var(--leading-normal); }
#markdownSample .markdown-details-content { padding-top: .35rem; }
.markdown-settings-actions .btn { flex: 1 1 auto; }
#settingsView #markdownSampleVideoCustomSelect .custom-select-popover { width: 100%; min-width: 0; max-width: 100%; }
#settingsView #markdownSampleVideoCustomSelect .custom-select-option { white-space: normal; overflow-wrap: anywhere; }



.tags-settings .ax-toolbar.no-compare [id$="CompareCustomSelect"] { display: none; }
.tags-tab { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; min-width: 0; }
.tags-tab[hidden] { display: none; }
.tags-tab .tag-standards-setting { margin: 0; padding: 0; background: none; border: 0; }
.tags-tab .topics-workbench { margin-top: 0; }
.tags-tab .tag-tree-hint { margin: 0; }
.tags-tab .topics-catalog-list,
.tags-tab .topics-catalog-detail { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius-lg); }
#tagsChangesPanel { margin: 0; padding: 1rem; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius-lg); }
#tagsChangesPanel > summary { pointer-events: none; list-style: none; }
#tagsChangesPanel > summary > i { display: none; }


@media (min-width: 761px) {
  #tags-settings .ax-heading-side { flex-wrap: nowrap; }
}
@media (max-width: 760px) {
  #tags-settings .tags-tab .tags-tree-panel { height: auto; min-height: 0; max-height: none; overflow: visible; contain: none; }
  #tags-settings .tags-tab .topics-catalog-detail { display: none; }
  .ax-panel-body > .topics-catalog-detail { background: none; border: 0; padding: 0; }
}


#account-settings.settings-grid { width: min(1400px, calc(100% - 48px)); max-width: 1400px; }
.account-page .ax-toolbar.no-compare [id$="CompareCustomSelect"] { display: none; }
.account-surface { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; min-width: 0; }
.account-surface .account-hero { margin: 0; padding: 1rem; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.account-surface .account-auth-options { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin: 0; min-width: 0; }
.account-surface .account-auth-option { min-width: 0; padding: 1rem; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow-wrap: anywhere; }
.account-surface .account-hero-copy, .account-surface .account-name-display { min-width: 0; }
.account-surface .account-hero-copy p { overflow-wrap: anywhere; }
.account-surface .account-name-display h2 { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .account-surface .account-name-display h2 { font-size: var(--font-md); }
}


.account-surface[hidden], .account-usage-tab[hidden] { display: none; }
.account-surface .account-auth-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-surface .account-auth-option:first-child { grid-column: 1 / -1; }
.account-usage-tab { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; min-width: 0; }
#account-settings .account-usage-tab .account-credit-usage { margin: 0; padding: 1rem; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius-lg); }
#account-settings .account-usage-tab .account-credit-usage > summary { display: none; }
#account-settings .account-usage-tab .ai-operations-body { margin: 0; padding: 0; border: 0; }
#account-settings .account-usage-tab .ai-operations-filters { margin-top: 0; }
#accountKeyEmpty[hidden] { display: none; }
@media (max-width: 900px) {
  .account-surface .account-auth-options { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  #account-settings.settings-grid { width: calc(100% - 24px); }
}
@media (max-width: 640px) {
  
  #account-settings .account-credit-usage-table { display: block; min-width: 0; }
  #account-settings .account-credit-usage-table thead { display: none; }
  #account-settings .account-credit-usage-table tbody { display: block; }
  #account-settings .account-credit-usage-table tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .9rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
  #account-settings .account-credit-usage-table td { display: block; padding: 0; border: 0; white-space: normal; text-align: left; }
  #account-settings .account-credit-usage-table td:nth-child(3) { flex: 1 1 100%; overflow-wrap: anywhere; }
  #account-settings .account-credit-usage-table td:nth-child(5)::before { content: "Left after "; color: var(--text-muted); }
  #account-settings .data-table-wrap { overflow: visible; border: 0; max-height: none; }
}




.analytics-settings .ax-ranks { --series: var(--chart-cloudflare); }


.ax-heat { display: grid; gap: 2px; min-width: 0; }
.ax-heat-row { display: grid; grid-template-columns: 2.1rem repeat(24, minmax(0, 1fr)); gap: 2px; align-items: center; }
.ax-heat-day { color: var(--text-muted); font-size: var(--font-xs); }
.ax-heat-cell { display: block; height: 18px; border-radius: 2px; background: color-mix(in srgb, var(--text-main) 5%, transparent); }
.ax-heat-cell[data-step="1"] { background: color-mix(in srgb, var(--series) 22%, transparent); }
.ax-heat-cell[data-step="2"] { background: color-mix(in srgb, var(--series) 40%, transparent); }
.ax-heat-cell[data-step="3"] { background: color-mix(in srgb, var(--series) 60%, transparent); }
.ax-heat-cell[data-step="4"] { background: color-mix(in srgb, var(--series) 80%, transparent); }
.ax-heat-cell[data-step="5"] { background: var(--series); }
.ax-heat-hours span { min-width: 0; color: var(--text-muted); font-size: var(--font-xs); white-space: nowrap; }
.ax-heat-scale { display: flex; align-items: center; justify-content: flex-end; gap: 2px; margin-top: .5rem; color: var(--text-muted); font-size: var(--font-xs); }
.ax-heat-scale .ax-heat-cell { width: 14px; height: 12px; }
.ax-heat-scale span:first-child { margin-right: .35rem; }
.ax-heat-scale span:last-child { margin-left: .35rem; }


.ax-scatter-dot { position: absolute; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; background: none; border: 0; border-radius: 50%; transform: translate(-50%, 50%); cursor: pointer; }
.ax-scatter-dot i { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--series); box-shadow: 0 0 0 2px var(--bg-panel); transition: transform var(--duration-base) ease; }
.ax-scatter-dot:focus-visible i { transform: scale(1.6); }
@media (hover: hover) {
  .ax-scatter-dot:hover i {
    transform: scale(1.6);
  }
}
.ax-scatter-x { display: flex; justify-content: space-between; gap: 1rem; margin-top: .35rem; color: var(--text-muted); font-size: var(--font-xs); }
.ax-verdict { margin: 0; color: var(--text-body); font-size: var(--font-base); }


.ax-segments { display: flex; gap: 2px; height: 28px; }
.ax-segment { display: flex; flex: 1 1 0; align-items: center; justify-content: center; min-width: 3px; overflow: hidden; color: var(--text-on-color); background: var(--series); font-size: var(--font-xs); font-weight: var(--font-weight-medium); }
.ax-segment:first-child { border-radius: 4px 0 0 4px; }
.ax-segment:last-child { border-radius: 0 4px 4px 0; }
.ax-segment:only-child { border-radius: 4px; }
.ax-segments + .ax-legend { margin-top: .5rem; }
.ax-split { display: grid; gap: .35rem; margin-bottom: .85rem; }
.ax-split:last-child { margin-bottom: 0; }
.ax-split-label { color: var(--text-soft); font-size: var(--font-sm); }

.ax-pivot-cell { --series: var(--chart-cloudflare); }
.ax-pivot-cell[data-step="1"] { background: color-mix(in srgb, var(--series) 12%, transparent); }
.ax-pivot-cell[data-step="2"] { background: color-mix(in srgb, var(--series) 24%, transparent); }
.ax-pivot-cell[data-step="3"] { background: color-mix(in srgb, var(--series) 38%, transparent); }
.ax-pivot-cell[data-step="4"] { background: color-mix(in srgb, var(--series) 54%, transparent); }
.ax-pivot-cell[data-step="5"] { background: color-mix(in srgb, var(--series) 70%, transparent); }


.ax-funnel { display: grid; gap: .6rem; }
.ax-step { display: grid; grid-template-columns: minmax(10rem, 18rem) minmax(0, 1fr) minmax(7rem, 10rem); align-items: center; gap: 1rem; }
.ax-step-text { display: grid; gap: .1rem; min-width: 0; }
.ax-step-text strong { color: var(--text-main); font-size: var(--font-sm); font-weight: var(--font-weight-medium); }
.ax-step-text small, .ax-step-number small { color: var(--text-muted); font-size: var(--font-xs); font-weight: 400; line-height: 1.3; }
.ax-step-track { height: 22px; border-radius: 0 4px 4px 0; background: color-mix(in srgb, var(--text-main) 4%, transparent); }
.ax-step-track span { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; background: color-mix(in srgb, var(--series) var(--step-strength, 100%), transparent); }
.ax-step-number { display: grid; color: var(--text-strong); font-size: var(--font-base); font-weight: var(--font-weight-medium); text-align: right; }
.ax-funnel-gap { display: flex; align-items: center; gap: .75rem; color: var(--text-faint); font-size: var(--font-xs); }
.ax-funnel-gap::after { content: ""; flex: 1; border-top: 1px dashed var(--border-medium); }

.ax-retention-wrap { overflow-x: auto; }
.ax-retention { width: 100%; min-width: 44rem; border-collapse: separate; border-spacing: 2px; font-size: var(--font-xs); --series: var(--chart-ours); }
.ax-retention th { padding: .25rem .4rem; color: var(--text-muted); font-weight: 400; text-align: center; white-space: nowrap; }
.ax-retention thead th:first-child, .ax-retention tbody th { text-align: left; }
.ax-retention .is-number { color: var(--text-soft); font-variant-numeric: tabular-nums; text-align: center; }
.ax-retention-cell { height: 26px; padding: 0 .25rem; color: var(--text-strong); background: color-mix(in srgb, var(--text-main) 4%, transparent); border-radius: 2px; font-variant-numeric: tabular-nums; text-align: center; }
.ax-retention-cell[data-step="1"] { background: color-mix(in srgb, var(--series) 20%, transparent); }
.ax-retention-cell[data-step="2"] { background: color-mix(in srgb, var(--series) 36%, transparent); }
.ax-retention-cell[data-step="3"] { background: color-mix(in srgb, var(--series) 54%, transparent); }
.ax-retention-cell[data-step="4"] { background: color-mix(in srgb, var(--series) 74%, transparent); }
.ax-retention-cell[data-step="5"] { background: var(--series); }


.ax-compare-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.ax-compare-controls label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; color: var(--text-muted); font-size: var(--font-sm); }
.ax-compare-controls .custom-select-wrap { width: auto; min-width: 13rem; }
.ax-suggestions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: .5rem; }
.ax-suggestion { display: grid; gap: .1rem; padding: .6rem .75rem; color: var(--text-main); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); font: inherit; font-size: var(--font-sm); text-align: left; cursor: pointer; }
@media (hover: hover) {
  .ax-suggestion:hover {
    border-color: var(--border-medium);
    background: var(--bg-hover);
  }
}
.ax-suggestion.is-active { border-color: var(--text-soft); }
.ax-suggestion small { color: var(--text-muted); font-size: var(--font-xs); }

@media (max-width: 760px) {
  .ax-compare-controls label { flex: 1 1 100%; min-width: 0; }
  .ax-compare-controls .custom-select-wrap { flex: 1 1 0; width: auto; min-width: 0; }
  .ax-step { grid-template-columns: minmax(0, 1fr) auto; gap: .25rem .75rem; }
  .ax-step-track { grid-column: 1 / -1; grid-row: 2; }
  .ax-heat-row { grid-template-columns: 1.8rem repeat(24, minmax(0, 1fr)); gap: 1px; }
  .ax-heat { gap: 1px; }
}

.account-hero {
  display: flex;
  align-items: center;
  gap: 16px;
}

.account-hero h2 {
  margin-bottom: 4px;
}

.account-hero-copy {
  flex: 1;
  min-width: 0;
}

.account-name-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.account-name-display h2 {
  margin: 0;
}


.account-icon-button {
  --icon-btn-icon: var(--icon-md);
}

.account-name-form {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-bottom: 0.25rem;
}

.account-name-input {
  flex: 1;
  height: 42px;
  margin: 0;
  padding: 6px 12px;
  font-size: var(--font-lg);
  font-weight: var(--font-weight-semibold);
}

.account-name-actions {
  position: relative;
  flex-shrink: 0;
  width: 140px;
  margin-right: 19px;
}

.account-save-name-button {
  width: 100%;
  height: 42px;
}

.account-cancel-edit-button {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  margin-top: 8px;
  padding: 8px 0;
  color: var(--text-muted);
  background: none;
  border: none;
  font-size: var(--font-sm);
  text-align: center;
  cursor: pointer;
}

.account-avatar-large {
  width: 54px;
  height: 54px;
  font-size: var(--font-lg);
}

.account-auth-options {
  display: grid;
  gap: 14px;
}

.account-auth-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--fill-faint);
}

.account-auth-debug {
  align-items: stretch;
}

.account-auth-debug > div {
  width: 100%;
}

.account-identity-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.account-identity-row {
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-inset);
}

.account-identity-provider {
  color: var(--text-main);
  font-weight: var(--font-weight-semibold);
}

.account-identity-email,
.account-identity-meta {
  min-width: 0;
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.account-identity-email {
  overflow-wrap: anywhere;
}

.account-provider-copy {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.account-provider-copy h3 {
  margin-bottom: 4px;
  font-size: var(--font-base);
}

.account-provider-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-accent-faint);
  font-weight: var(--font-weight-semibold);
}

.account-provider-icon svg {
  width: 18px;
  height: 18px;
}

.google-provider-icon {
  padding: 0;
  color: var(--text-strong);
  background: var(--inverse-bg);
  border-color: var(--border-hover);
}

@media (max-width: 760px) {
  .account-auth-option {
    align-items: stretch;
    flex-direction: column;
  }

  .account-identity-row {
    grid-template-columns: 1fr;
  }

  .account-name-form {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .account-name-actions {
    width: 100%;
    margin-right: 0;
    display: flex;
    flex-direction: column;
  }

  .account-cancel-edit-button {
    position: static;
    margin-top: 12px;
    margin-bottom: 8px;
    padding: 12px 0;
  }
}


.account-credits .account-provider-copy {
  align-items: flex-start;
}

.account-credits-balance {
  margin: 0 0 4px;
  color: var(--text-strong);
  font-size: var(--font-lg);
  font-weight: var(--font-weight-semibold);
}

.account-credits-warning {
  color: var(--danger);
}

.account-credits-request {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  justify-items: start;
}

.account-credits-request textarea {
  width: 100%;
  padding: 10px 12px;
  resize: vertical;
}

.account-credits-request-actions {
  display: flex;
  gap: 10px;
}


.account-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.account-card-head .account-provider-copy {
  flex: 1;
}

.account-pays-switch {
  flex-shrink: 0;
  margin-top: 2px;
}


.account-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  vertical-align: -2px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  opacity: 0.7;
  cursor: help;
  transition: opacity var(--duration-fast) ease, color var(--duration-fast) ease;
}

.account-info i,
.account-info svg {
  width: 14px;
  height: 14px;
}

.account-info:focus-visible {
  opacity: 1;
  color: var(--text-main);
}

@media (hover: hover) {
  .account-info:hover {
    opacity: 1;
    color: var(--text-main);
  }
}

.account-info:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 1px;
}


.account-ai-keys .account-provider-copy {
  align-items: flex-start;
}

.account-ai-key + .account-ai-key {
  margin-top: 12px;
}

.account-ai-key-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.account-ai-key-form {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  justify-items: start;
}

.account-ai-key-form input {
  width: 100%;
  padding: 10px 12px;
}



.account-credits,
.account-credits > div,
.account-ai-keys,
.account-ai-keys > div,
.account-credit-usage [data-credit-usage-list],
.account-own-key-usage [data-own-key-usage-list] {
  min-width: 0;
}

.account-credits > div,
.account-ai-keys > div {
  flex: 1;
}

.account-credit-usage {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.account-credit-usage > summary strong {
  font-size: var(--font-base);
}

.account-credit-usage .ai-operations-body {
  margin-top: 1rem;
}

.account-credit-usage-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}


.account-credit-usage-table {
  width: 100%;
}

.account-credit-usage-table td:nth-child(2),
.account-credit-usage-table td:nth-child(3) {
  white-space: normal;
}

.account-credit-usage-table td:nth-child(3) {
  min-width: 12rem;
}

.account-credit-usage-table .is-number {
  text-align: right;
}

.account-credit-usage-table td.is-used {
  color: var(--text-main);
}

.account-credit-usage-table td.is-added {
  color: var(--status-green);
}


.account-own-key-usage .data-table {
  width: 100%;
}




.sign-in-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: clamp(8px, 4vw, 48px) 0;
}

.sign-in-panel-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 440px;
  padding: 32px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  background: var(--bg-card-strong);
  box-shadow: var(--shadow-dialog);
  color: var(--text-body);
  font-family: var(--font-brand);
}

.sign-in-panel-intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sign-in-panel-intro h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: 1.875rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.025em;
}

.sign-in-panel-intro p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.sign-in-panel-intro strong {
  color: var(--text-strong);
}

.sign-in-panel-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.90625rem;
  line-height: 1.5;
}

.sign-in-panel-list li {
  display: flex;
  gap: 12px;
}


.sign-in-panel-list li::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border: 1.5px solid var(--accent-light);
  border-radius: var(--radius-round);
}

.sign-in-panel-rule {
  width: 100%;
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--border);
}

.sign-in-panel-agree {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: var(--font-base);
  line-height: 1.5;
  cursor: pointer;
}

.sign-in-panel-agree input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent-light);
}

.sign-in-panel-card a {
  color: var(--text-strong);
}

.sign-in-panel-card .btn {
  min-height: 46px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  font-weight: var(--font-weight-bold);
}

.sign-in-panel-card .btn:disabled {
  opacity: 0.45;
}

.sign-in-panel-google {
  gap: 10px;
  background: var(--inverse-bg);
  color: var(--inverse-text);
}

@media (hover: hover) {
  .sign-in-panel-google:hover:not(:disabled) {
    background: var(--inverse-bg-hover);
  }
}

.sign-in-panel-google svg {
  width: 18px;
  height: 18px;
}


.sign-in-panel-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.sign-in-panel-or::before,
.sign-in-panel-or::after {
  content: "";
  flex: 1 1 0;
  height: 1px;
  background: var(--border);
}

.sign-in-panel-email {
  display: flex;
  gap: 8px;
}

.sign-in-panel-email input {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 12px 14px;
  border-color: var(--fill-strong);
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
}

.sign-in-panel-email .btn {
  flex: none;
  white-space: nowrap;
}

.sign-in-panel-nowrap {
  white-space: nowrap;
}


.sign-in-panel-code {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sign-in-panel-digits {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.sign-in-panel-digit {
  flex: 1 1 0;
  min-width: 0;
  max-width: 44px;
  height: 56px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-control);
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  font-variant-numeric: tabular-nums;
  text-align: center;
  caret-color: var(--accent-light);
}

.sign-in-panel-digit:focus {
  border-color: var(--border-focus);
  outline: var(--focus-ring);
  outline-offset: 1px;
}

.sign-in-panel-digit:disabled {
  opacity: 0.6;
}

.sign-in-panel-digits-gap {
  flex: none;
  width: 10px;
  height: 2px;
  margin: 0 2px;
  border-radius: var(--radius-round);
  background: var(--fill-strong);
}

.sign-in-panel-code-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}


.sign-in-panel-resume {
  align-self: flex-start;
  margin-top: -8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-strong);
  font: inherit;
  font-size: var(--font-sm);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.sign-in-panel-note,
.sign-in-panel-fine,
.sign-in-panel-warning,
.sign-in-panel-error {
  margin: 0;
  font-size: var(--font-sm);
  line-height: 1.5;
}

.sign-in-panel-note {
  margin-top: -8px;
  color: var(--text-muted);
}

.sign-in-panel-fine {
  color: var(--text-faint);
  font-size: var(--font-xs);
}

.sign-in-panel-fine a {
  color: var(--text-muted);
}

.sign-in-panel-warning,
.sign-in-panel-error {
  color: var(--danger-text);
}


.grecaptcha-badge {
  visibility: hidden;
}

@media (max-width: 480px) {
  .sign-in-panel-card {
    padding: 24px 20px;
  }

  .sign-in-panel-email {
    flex-direction: column;
  }
}



body.is-signed-out .layout {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) 0;
}

body.is-signed-out #rightSidebar,
body.is-signed-out #dashboardRightSidebarToggle,
body.is-signed-out #createCollectionBtn,
body.is-signed-out #addYouTubePlaylistBtn,
body.is-signed-out #dashboardView > :not(.sign-in-panel) {
  display: none;
}

body.is-signed-out .sidebar-settings-link {
  opacity: 0.4;
  pointer-events: none;
}

.playlist-add-panel {
  margin: 20px 0 28px;
  padding: 16px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-slow) ease, box-shadow var(--duration-slow) ease;
}

.playlist-add-panel:focus-within,
.playlist-add-panel.has-preview {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 1px var(--border);
}

.playlist-add-hint {
  margin: 0 0 14px;
}

.add-playlist-form {
  position: relative;
  margin: 0;
}

.add-playlist-form input {
  width: 100%;
  padding: 14px 16px;
  padding-right: 48px;
  font-size: var(--font-sm);
  margin-bottom: 0;
  border-color: var(--border-strong);
  background: var(--bg-surface);
}


.playlist-input-clear {
  --clear-size: 32px;
  --clear-icon: var(--icon-lg);
  right: 10px;
}

.playlist-preview {
  margin-top: 14px;
}

.playlist-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-control);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.playlist-item.is-youtube-missing {
  border-color: var(--danger-border-strong);
  box-shadow: 0 0 0 1px var(--danger-border);
}

.playlist-item.is-disabled {
  opacity: 0.72;
}

.playlist-media {
  flex-shrink: 0;
}

.playlist-thumb {
  width: 128px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--fill-subtle);
}

.playlist-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.playlist-thumb-error {
  color: var(--danger-text);
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.playlist-content {
  min-width: 0;
  flex: 1;
}

.playlist-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.playlist-title-group {
  min-width: 0;
  flex: 1;
}

.playlist-name-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding-right: 32px;
}

.playlist-name {
  min-width: 0;
  font-weight: var(--font-weight-medium);
}

.playlist-description {
  margin: 8px 0 10px;
  color: var(--text-muted);
  font-size: var(--font-sm);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.playlist-source-warning {
  margin: 8px 0 10px;
  color: var(--danger-text);
  font-size: var(--font-sm);
  line-height: 1.45;
}


.playlist-note {
  margin: 8px 0 10px;
  line-height: 1.45;
}

.playlist-private-help {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: var(--font-sm);
  line-height: 1.5;
}

.playlist-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.playlist-meta span,
.playlist-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.playlist-meta svg,
.playlist-actions svg {
  width: 15px;
  height: 15px;
}

.playlist-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.playlist-toggle-btn {
  width: 140px;
  min-height: 38px;
}

.playlist-remove-btn {
  width: 140px;
  flex-shrink: 0;
}

.connection-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-control);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: background var(--duration-slow) ease;
}

.storage-setting {
  align-items: center;
}

.conn-info {
  min-width: 0;
  flex: 1;
}

.conn-title-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  width: 100%;
  padding-right: 32px;
}

.folder-sync-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}


.connection-rows {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.connection-rows[hidden] {
  display: none;
}

.connection-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-control);
}

.connection-row-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
  color: var(--text-main);
  font-size: var(--font-base);
  line-height: var(--leading-normal);
  overflow-wrap: anywhere;
}

.connection-row-name strong {
  font-weight: var(--font-weight-medium);
}


.connection-row-lines {
  display: grid;
  grid-column: 2 / -1;
  gap: 2px;
  color: var(--text-muted);
  font-size: var(--font-sm);
  line-height: var(--leading-normal);
}


.connection-more {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: var(--font-sm);
  line-height: var(--leading-normal);
}

.connection-more[hidden] {
  display: none;
}

.connection-more > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
}

.connection-more > summary::-webkit-details-marker {
  display: none;
}

.connection-more > summary::after {
  content: '›';
  color: var(--text-muted);
  font-size: var(--font-md);
  line-height: 1;
  transform: rotate(90deg);
  transition: transform var(--duration-base) ease;
}

.connection-more[open] > summary::after {
  transform: rotate(-90deg);
}

.connection-more-body {
  display: grid;
  gap: 6px;
  margin: 8px 0 4px;
  padding: 0;
}

.connection-more ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.connection-more strong {
  color: var(--text-main);
  font-weight: var(--font-weight-medium);
}


.layout-setting {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-size: var(--font-sm);
  color: var(--text-muted);
}
.layout-setting .setting-switch { flex-shrink: 0; }

.layout-setting-label {
  cursor: default;
  min-width: 207px;
}
.layout-setting-note {
  flex-basis: 100%;
  color: var(--warning);
  font-size: var(--font-xs);
  line-height: var(--leading-normal);
}

.cleanup-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-md);
  background: var(--danger-bg);
}

@media (max-width: 1200px) {
  
  .settings-grid,
  .settings-grid:has(> .topics-settings:not([hidden])) {
    width: 100%;
    margin-top: 16px;
    gap: 16px;
  }

  .add-playlist-form {
    flex-direction: column;
  }

  
  .add-playlist-form button:not(.input-clear-btn) {
    width: 100%;
    margin-right: 0;
  }

  .playlist-item {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .playlist-media,
  .playlist-thumb {
    width: 100%;
  }

  .playlist-title-row {
    flex-direction: column;
    align-items: stretch;
  }

  .playlist-name-group {
    padding-right: 0;
  }

  .playlist-actions {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }

  .playlist-toggle-btn,
  .playlist-remove-btn {
    width: auto;
    flex: 1;
    justify-content: center;
  }

  .connection-item {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .connection-item .conn-info {
    width: 100%;
  }

  .conn-title-group {
    padding-right: 0;
  }

  .folder-sync-actions {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }

  .folder-sync-actions .btn {
    flex: 1;
    text-align: center;
    justify-content: center;
  }
}


#collections-settings .add-playlist-form {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

#collections-settings .add-playlist-form input { padding-right: 16px; }


input.playlist-rename-input {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 4px 8px;
  color: var(--text-main);
  background: var(--bg-control);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: inherit;
}


.markdown-view {
  position: relative;
  display: none;
  background: var(--bg-card-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  min-height: 500px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}


.markdown-view {
  transition: background-color var(--duration-arrive) ease, border-color var(--duration-arrive) ease;
}

#markdownView:is(.app-view-entering, .app-view-leaving) {
  background-color: transparent;
  border-color: transparent;
}

#markdownView.app-view-leaving {
  transition-duration: var(--duration-base);
}

@media (max-width: 1200px) {
  .markdown-view {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius:0;
  }

  .markdown-view .markdown-body {
    background: var(--reel-dim);
    box-shadow: 0 0 32px 24px var(--reel-dim);
  }
}


@media (max-width: 600px) {
  .markdown-view .markdown-body {
    margin-inline: calc(-1 * var(--phone-bar-left)) calc(-1 * var(--phone-bar-right));
    padding-inline: var(--phone-bar-left) var(--phone-bar-right);
    background: linear-gradient(
      to bottom,
      transparent,
      var(--reel-dim-light) 160px,
      var(--reel-dim-light) 400px,
      var(--reel-dim) 1200px,
      var(--reel-dim) calc(100% - 96px),
      transparent
    );
    box-shadow: none;
  }
}


.markdown-body {
  color: var(--text-reading);
  font-size: var(--font-md);
  line-height: var(--leading-relaxed);
}


.markdown-body :is(p, li, blockquote) {
  font-family: var(--font-reading);
  font-size: var(--reading-size);
  line-height: var(--reading-leading);
  letter-spacing: var(--reading-tracking);
  -webkit-text-stroke: var(--reading-thicken) currentColor;
}


.markdown-sidebar-toggle {
  position: fixed;
  top: calc(14px + var(--app-bar-height));
  right: calc(var(--right-sidebar-width) + 16px);
  z-index: var(--layer-sidebar-button-wide-screen);
  transition: right var(--duration-slow) ease, background var(--duration-base) ease, border-color var(--duration-base) ease;
}

.markdown-body h1 {
  flex: 1;
  min-width: 0;
  font-size: var(--reading-title-size);
  line-height: var(--leading-tight);
  margin: 0;
  color: var(--text-strong);
}

.markdown-body h2 {
  font-size: var(--reading-heading-size);
  line-height: var(--leading-tight);
  margin-top: 32px;
  margin-bottom: 16px;
  color: var(--text-strong);
}

.markdown-body p {
  margin-bottom: var(--reading-gap);
}

.markdown-body a {
  color: var(--accent);
  text-decoration: none;
}

@media (hover: hover) {
  .markdown-body a:hover {
    text-decoration: underline;
  }
}

.markdown-body em {
  color: var(--text-muted);
  font-style: italic;
}


.markdown-body em a {
  color: var(--text-timestamp);
  font-size: var(--timestamp-size);
}


.markdown-body .transcript-translated-note {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin: 24px 0 16px;
  color: var(--text-muted);
  font: var(--font-sm) / var(--leading-tight) var(--font-sans);
}
.markdown-body .transcript-translated-note svg { flex: none; }

@media (hover: hover) {
  .markdown-body em a:hover {
    color: var(--text-body);
    
  }
}

.markdown-body img {
  max-width: 100%;
  border-radius: var(--radius-md);
  margin: 16px 0;
}

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}


main[data-video-scroll="entry"],
html[data-video-scroll="entry"] {
  scroll-snap-type: y mandatory;
}

.yt-player-snap-point {
  position: absolute;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}


.yt-player-sticky-wrapper {
  position: sticky;
  top: 12px;
  z-index: 100;
  background-color: transparent;
  padding-top: 12px;
  margin: 16px 0 64px;
  transition: background-color var(--duration-slower) ease, padding var(--duration-slower) ease, top var(--duration-slower) ease, margin-bottom var(--duration-slower) ease;
}

.yt-player-sticky-wrapper.is-stuck {
  background-color: var(--bg-sidebar);
  padding-top: 0;
  border-radius:0;
  margin-bottom: 96px;
  
}

.yt-player-sticky-wrapper.is-stuck.is-expanded {
  top: 12px;
}


#markdownView.app-view-entering :is(.yt-player-sticky-wrapper, .yt-player-container, .yt-player-collapsed-bar) {
  transition: none;
}


.yt-player-sticky-wrapper.is-waiting:not(.is-stuck) .yt-player-container {
  max-height: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
}

.yt-player-sticky-wrapper.is-waiting:not(.is-stuck) .yt-player-collapsed-bar {
  min-height: 54px;
  max-height: 56px;
  visibility: visible;
  border-width: 1px;
}


.yt-player-sticky-wrapper.is-unfolding .yt-player-container {
  transition:
    max-height var(--duration-unfold) cubic-bezier(0.33, 0, 0.2, 1),
    margin var(--duration-unfold) cubic-bezier(0.33, 0, 0.2, 1),
    transform var(--duration-unfold) cubic-bezier(0.33, 0, 0.2, 1),
    opacity var(--duration-arrive) ease calc(var(--duration-unfold) * 0.3);
}

.yt-player-sticky-wrapper.is-unfolding .yt-player-collapsed-bar {
  transition:
    max-height var(--duration-unfold) cubic-bezier(0.33, 0, 0.2, 1),
    min-height var(--duration-unfold) cubic-bezier(0.33, 0, 0.2, 1),
    border-width var(--duration-unfold) ease,
    opacity var(--duration-slower) ease,
    visibility var(--duration-unfold);
}

.yt-player-sticky-wrapper.is-unfolding:not(.is-stuck) .yt-player-collapsed-bar {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .yt-player-sticky-wrapper.is-unfolding :is(.yt-player-container, .yt-player-collapsed-bar) {
    transition: opacity var(--duration-arrive) ease;
  }
}


.yt-player-inner {
  position: relative;
  width: 100%;
}

.yt-player-sticky-wrapper.is-stuck.is-expanded .yt-player-inner {
  padding: 8px 8px 0;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover);
}

.yt-player-sticky-wrapper::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 124px;
  background: linear-gradient(to bottom, var(--bg-sidebar), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 2s ease;
}

.yt-player-sticky-wrapper.is-stuck::after {
  opacity: 1;
}

.yt-player-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-video);
  box-shadow: var(--shadow-lg);
  transition: max-height var(--duration-slower) ease, opacity var(--duration-slow) ease, transform var(--duration-slower) ease, margin var(--duration-slower) ease;
}

.yt-player-sticky-wrapper.is-stuck:not(.is-expanded) .yt-player-container {
  max-height: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
}

.yt-player-sticky-wrapper.is-stuck.is-expanded .yt-player-container,
.yt-player-sticky-wrapper:not(.is-stuck) .yt-player-container {
  
  max-height: var(--yt-player-height, 560px);
  opacity: 1;
  transform: translateY(0);
}

.yt-player-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}


.yt-player-collapsed-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
  padding: 0 10px;
  color: var(--text-main);
  background: var(--bg-popover);
  border: 0 solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover);
  transition: max-height var(--duration-slower) ease, min-height var(--duration-slower) ease, border-width var(--duration-slower) ease, visibility var(--duration-slower);
}

.yt-player-sticky-wrapper.is-stuck .yt-player-collapsed-bar {
  min-height: 54px;
  max-height: 56px;
  visibility: visible;
  border-width: 1px;
}

.yt-player-sticky-wrapper.is-stuck.is-expanded .yt-player-collapsed-bar {
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius:0 0 var(--radius-lg) var(--radius-lg);
  border-top: 0;
  box-shadow: none;
}

.yt-player-sticky-wrapper.is-stuck.is-expanded .yt-player-container {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.yt-player-waves {
  display: inline-flex;
  align-items: center;
  flex: 1 1 auto;
  justify-content: center;
  gap: 4px;
  height: 54px;
  min-width: 0;
  overflow: hidden;
}

.yt-player-siri-wave {
  display: block;
  width: 100%;
  height: 54px;
  min-width: 0;
  opacity: 0.85;
}

.yt-player-siri-wave canvas {
  display: block;
  width: 100%;
  height: 54px;
}

.yt-player-sticky-wrapper.is-expanded .yt-player-waves {
  opacity: 0;
}

.yt-player-waves.is-static-fallback::before {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  background: var(--text-body);
}


@property --tape-gap {
  syntax: '<length>';
  inherits: true;
  initial-value: 0px;
}

@property --tape-ends {
  syntax: '<length>';
  inherits: true;
  initial-value: 0px;
}

.yt-player-track {
  --tape-gap: 0px;
  --tape-ends: 0px;
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  align-self: stretch;
  min-width: 0;
  transition: --tape-gap var(--duration-slower) ease, --tape-ends var(--duration-slower) ease;
}

.yt-player-sticky-wrapper.is-reading-on.is-playing .yt-player-track {
  
  --tape-gap: 52px;
  --tape-ends: 36px;
}


.yt-player-siri-wave {
  -webkit-mask-image: linear-gradient(to right,
    transparent var(--tape-ends), black calc(var(--tape-ends) * 1.15),
    black calc(50% - var(--tape-gap) * 1.15), transparent calc(50% - var(--tape-gap)),
    transparent calc(50% + var(--tape-gap)), black calc(50% + var(--tape-gap) * 1.15),
    black calc(100% - var(--tape-ends) * 1.15), transparent calc(100% - var(--tape-ends)));
  mask-image: linear-gradient(to right,
    transparent var(--tape-ends), black calc(var(--tape-ends) * 1.15),
    black calc(50% - var(--tape-gap) * 1.15), transparent calc(50% - var(--tape-gap)),
    transparent calc(50% + var(--tape-gap)), black calc(50% + var(--tape-gap) * 1.15),
    black calc(100% - var(--tape-ends) * 1.15), transparent calc(100% - var(--tape-ends)));
}

.yt-player-deck {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--duration-slower) ease, visibility 0s linear var(--duration-slower);
}

.yt-player-sticky-wrapper.is-reading-on.is-playing .yt-player-deck {
  visibility: visible;
  opacity: 1;
  transition: opacity var(--duration-slower) ease, visibility 0s;
}

.yt-player-reel {
  display: flex;
  width: 26px;
  height: 26px;
  color: var(--wave-color);
  opacity: var(--wave-reel-opacity); 
  transform: scale(0.6);
  transition: transform var(--duration-slower) cubic-bezier(0.2, 0.8, 0.2, 1), opacity var(--duration-slower) ease;
}

.yt-player-reel-drawing {
  width: 100%;
  height: 100%;
  stroke-width: 1.2;
  animation: reel-spin 3.6s linear infinite paused;
}

.yt-player-sticky-wrapper.is-reading-on.is-playing .yt-player-reel {
  transform: scale(1);
}


.yt-player-sticky-wrapper.is-reading-on.is-playing:not(.is-expanded) .yt-player-reel-drawing {
  animation-play-state: running;
}


.yt-player-sticky-wrapper.is-expanded .yt-player-reel {
  opacity: 0;
}

.yt-player-sync.btn {
  min-height: var(--control-md);
  height: var(--control-md);
  width: 88px;
  padding: 0 12px;
  gap: 6px;
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  pointer-events: auto;
  transform: scale(0.94);
  transition: background var(--duration-slow) ease, border-color var(--duration-slow) ease, color var(--duration-slow) ease, transform var(--duration-slower) cubic-bezier(0.2, 0.8, 0.2, 1);
}

.yt-player-sticky-wrapper.is-reading-on.is-playing .yt-player-sync {
  transform: scale(1);
}

.yt-player-sync .yt-player-sync-arrow {
  width: var(--icon-sm);
  height: var(--icon-sm);
  transition: transform var(--duration-slower) ease;
}


.yt-player-sticky-wrapper[data-words="below"] .yt-player-sync-arrow {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .yt-player-reel-drawing {
    animation: none;
  }
}

.yt-player-expand-toggle svg {
  transition: transform var(--duration-slow) ease;
}

.yt-player-sticky-wrapper.is-expanded .yt-player-expand-toggle svg {
  transform: rotate(180deg);
}


.markdown-body :is(p, li) {
  transition: color var(--duration-slow) ease;
}

.markdown-body.is-playing-along :is(p, li) {
  color: var(--spoken-around);
}

::highlight(spoken-1) {
  color: color-mix(in oklab, var(--spoken-said) 12.5%, var(--spoken-around));
}

::highlight(spoken-2) {
  color: color-mix(in oklab, var(--spoken-said) 25%, var(--spoken-around));
}

::highlight(spoken-3) {
  color: color-mix(in oklab, var(--spoken-said) 37.5%, var(--spoken-around));
}

::highlight(spoken-4) {
  color: color-mix(in oklab, var(--spoken-said) 50%, var(--spoken-around));
}

::highlight(spoken-5) {
  color: color-mix(in oklab, var(--spoken-said) 62.5%, var(--spoken-around));
}

::highlight(spoken-6) {
  color: color-mix(in oklab, var(--spoken-said) 75%, var(--spoken-around));
}

::highlight(spoken-7) {
  color: color-mix(in oklab, var(--spoken-said) 87.5%, var(--spoken-around));
}

::highlight(spoken-8) {
  color: color-mix(in oklab, var(--spoken-said) 100%, var(--spoken-around));
}



.markdown-body:not(.is-playing-along) ::highlight(spoken-1) {
  color: color-mix(in oklab, var(--text-strong) 12.5%, var(--text-reading));
}

.markdown-body:not(.is-playing-along) ::highlight(spoken-2) {
  color: color-mix(in oklab, var(--text-strong) 25%, var(--text-reading));
}

.markdown-body:not(.is-playing-along) ::highlight(spoken-3) {
  color: color-mix(in oklab, var(--text-strong) 37.5%, var(--text-reading));
}

.markdown-body:not(.is-playing-along) ::highlight(spoken-4) {
  color: color-mix(in oklab, var(--text-strong) 50%, var(--text-reading));
}

.markdown-body:not(.is-playing-along) ::highlight(spoken-5) {
  color: color-mix(in oklab, var(--text-strong) 62.5%, var(--text-reading));
}

.markdown-body:not(.is-playing-along) ::highlight(spoken-6) {
  color: color-mix(in oklab, var(--text-strong) 75%, var(--text-reading));
}

.markdown-body:not(.is-playing-along) ::highlight(spoken-7) {
  color: color-mix(in oklab, var(--text-strong) 87.5%, var(--text-reading));
}

.markdown-body:not(.is-playing-along) ::highlight(spoken-8) {
  color: color-mix(in oklab, var(--text-strong) 100%, var(--text-reading));
}


.markdown-body.is-playing-along ::highlight(spoken-6) {
  text-shadow:
    0.1px 0 0 var(--spoken-said), -0.1px 0 0 var(--spoken-said),
    0 0 10px color-mix(in srgb, var(--spoken-glow) 25%, transparent);
}

.markdown-body.is-playing-along ::highlight(spoken-7) {
  text-shadow:
    0.18px 0 0 var(--spoken-said), -0.18px 0 0 var(--spoken-said),
    0 0 9px color-mix(in srgb, var(--spoken-glow) 45%, transparent);
}

.markdown-body.is-playing-along ::highlight(spoken-8) {
  text-shadow:
    0.25px 0 0 var(--spoken-said), -0.25px 0 0 var(--spoken-said),
    0 0 8px color-mix(in srgb, var(--spoken-glow) 70%, transparent),
    0 0 18px color-mix(in srgb, var(--spoken-glow) 40%, transparent);
}


.markdown-body em a {
  transition: color var(--duration-slow) ease;
}

.markdown-body.is-playing-along em a:not(.active-timestamp) {
  color: var(--spoken-around-time);
}


.markdown-body em a.active-timestamp {
  color: var(--text-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: color var(--duration-slow) ease;
}


.markdown-body em a[data-seek] {
  cursor: pointer;
}

@media (hover: hover) {
  .markdown-body em a[data-seek]:hover {
    color: var(--text-strong);
  }
}


@media (max-width: 1200px) {
  .yt-player-sticky-wrapper,
  .yt-player-sticky-wrapper.is-stuck.is-expanded {
    top: calc(var(--mobile-top-mask-height) + env(safe-area-inset-top, 0px));
  }
}


@media (max-width: 1200px) and (display-mode: browser) {
  
  .yt-player-sticky-wrapper,
  .yt-player-sticky-wrapper.is-stuck.is-expanded {
    top: calc(var(--mobile-top-mask-height) + env(safe-area-inset-top, 0px) + 8px);
  }

  .yt-player-sticky-wrapper.is-stuck:not(.is-expanded) {
    background-color: transparent;
  }

  .yt-player-sticky-wrapper.is-stuck:not(.is-expanded)::after {
    opacity: 0;
  }

  .yt-player-sticky-wrapper.is-stuck:not(.is-expanded) .yt-player-collapsed-bar {
    background: var(--bg-card);
    backdrop-filter: blur(6px) saturate(1.4);
    -webkit-backdrop-filter: blur(6px) saturate(1.4);
  }
}


@media (max-width: 600px) {
  .yt-player-sticky-wrapper {
    margin-inline: calc(8px - var(--page-gutter));
  }

  .yt-player-sticky-wrapper.is-stuck.is-expanded .yt-player-inner {
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius-xl);
  }

  .yt-player-sticky-wrapper .yt-player-collapsed-bar {
    border-radius: var(--radius-xl);
  }

  .yt-player-sticky-wrapper.is-stuck.is-expanded .yt-player-container {
    border-radius: 0;
  }

  .yt-player-sticky-wrapper.is-stuck.is-expanded .yt-player-collapsed-bar {
    border-radius: 0;
  }
}

.media-playback-notice { margin: 0; padding: 10px 16px; background: var(--bg-panel); color: var(--text-muted); font: 12px/1.5 var(--font-sans); }

.yt-player-container.media-audio-player > .media-playback-notice,
.yt-player-container.media-native-video > .media-playback-notice {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  width: fit-content;
  max-width: calc(100% - 24px);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-on-media);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--text-on-color);
  font: var(--font-sm) / 1.45 var(--font-sans);
  text-wrap: pretty;
}
.yt-player-container:has(> .media-playback-notice:not([hidden])) > .media-source-badge { display: none; }
@media (max-width: 600px) {
  .yt-player-container.media-audio-player > .media-playback-notice,
  .yt-player-container.media-native-video > .media-playback-notice { left: 8px; right: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 6px 10px; font-size: var(--font-xs); }
}
.media-player-static .yt-player-container { position: relative; height: auto; aspect-ratio: 16 / 9; }
.media-player-static iframe { width: 100%; height: 100%; border: 0; }

.yt-player-container.media-native-video video { width: 100%; height: 100%; object-fit: contain; }


.yt-player-sticky-wrapper .yt-player-collapsed-bar,
.yt-player-sticky-wrapper.is-unfolding:not(.is-stuck) .yt-player-collapsed-bar {
  min-height: 54px;
  max-height: 56px;
  visibility: visible;
  opacity: 1;
  border-width: 1px;
}
.yt-player-sticky-wrapper.is-collapsed .yt-player-container,
.yt-player-sticky-wrapper.is-stuck:not(.is-expanded) .yt-player-container.media-audio-player {
  min-height: 0;
  max-height: 0;
  padding: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.yt-player-media-controls {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  transition: opacity var(--duration-slow) ease;
}
.yt-player-clock { font-size: var(--font-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }

.yt-player-clock.is-total { color: var(--text-muted); }
.yt-player-media-controls input { min-width: 0; accent-color: var(--accent); cursor: pointer; }
.yt-player-seek { flex: 1; width: 100%; }
.yt-player-sticky-wrapper.is-reading-on.is-playing .yt-player-media-controls { opacity: 0; visibility: hidden; pointer-events: none; }

.yt-player-container.media-audio-player {
  position: relative;
  display: block;
  overflow: hidden;
  padding: 0;
  min-height: 0;
  aspect-ratio: 16 / 9;
  background: var(--bg-video);
}
.media-audio-player > .media-audio-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; object-fit: cover; filter: blur(40px) brightness(.5); transform: scale(1.25); }
.media-audio-player > .media-audio-art { position: relative; display: block; width: auto; max-width: 100%; height: 100%; margin: 0 auto; object-fit: contain; }
.media-audio-player > audio { display: none; }


.markdown-body .media-source-badge,
.media-source-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-on-media);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--text-on-color);
  font: var(--font-weight-semibold) var(--font-sm) / 1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity var(--duration-slow) ease, background var(--duration-slow) ease;
}
.media-source-badge-verb { font-weight: var(--font-weight-normal, 400); opacity: .85; }
.media-source-badge .media-provider-icon { width: 16px; height: 16px; }
.media-source-badge:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.yt-player-sticky-wrapper.is-playing .media-source-badge { opacity: 0; pointer-events: none; }
@media (hover: hover) {
  .markdown-body .media-source-badge:hover { background: var(--bg-on-media-hover); text-decoration: none; }
  .yt-player-sticky-wrapper.is-playing .yt-player-container:hover .media-source-badge { opacity: 1; pointer-events: auto; }
}
@media (max-width: 600px) {
  .media-source-badge { right: 8px; bottom: 8px; gap: 5px; padding: 5px 8px; font-size: var(--font-xs); }
  .media-source-badge .media-provider-icon { width: 14px; height: 14px; }
}
@media (max-width: 600px) {
  .yt-player-clock { font-size: var(--font-3xs); }
  .yt-player-media-controls { gap: 6px; }
}

@media (max-width: 400px) {
  .yt-player-collapsed-bar { gap: 8px; padding-inline: 8px; }
  .yt-player-media-controls { gap: 4px; }
}


.yt-player-media-controls input[type="range"] {
  appearance: none;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(to right, var(--text-soft) var(--media-progress, 0%), var(--border-medium) var(--media-progress, 0%));
}
.yt-player-media-controls input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text-main);
  cursor: pointer;
}
.yt-player-media-controls input[type="range"]::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 50%;
  background: var(--text-main);
}
.yt-player-media-controls input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }

.yt-player-collapsed-bar { font-family: var(--font-sans); }

.yt-player-sticky-wrapper .yt-player-waves { opacity: 0; transition: opacity var(--duration-slow) ease; }
.yt-player-sticky-wrapper.is-reading-on.is-playing .yt-player-waves { opacity: 1; }

.yt-player-expand-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }


.yt-player-expand-toggle .yt-player-fold-loading { display: none; }
.yt-player-expand-toggle.is-loading { cursor: wait; }
.yt-player-expand-toggle.is-loading .yt-player-fold-arrow { display: none; }
.yt-player-expand-toggle.is-loading .yt-player-fold-loading {
  display: block;
  animation: icon-spin 0.85s linear infinite;
}
.yt-player-media-controls input:disabled { opacity: 0.45; cursor: default; }


.yt-player-media-controls .icon-btn {
  --icon-btn-size: var(--control-sm);
  --icon-btn-icon: var(--icon-md);
  border-radius: var(--radius-sm);
}

.yt-player-captions-toggle[aria-pressed="true"] {
  color: var(--text-strong);
  background: var(--fill-soft);
  border-color: var(--border);
}


.yt-player-inner:fullscreen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--bg-video);
}

:is(.yt-player-sticky-wrapper.is-stuck.is-collapsed, .yt-player-sticky-wrapper) .yt-player-inner:fullscreen .yt-player-container {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
  margin: 0;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  border-radius: 0;
  box-shadow: none;
}

:is(.yt-player-sticky-wrapper.is-stuck.is-collapsed, .yt-player-sticky-wrapper) .yt-player-inner:fullscreen .yt-player-collapsed-bar {
  flex: none;
  width: min(100%, 960px);
  margin-inline: auto;
  border-width: 1px;
  border-radius: var(--radius-lg);
}

.yt-player-inner:fullscreen .yt-player-expand-toggle {
  display: none;
}

.markdown-document-view {
  min-height: calc(100vh - var(--app-bar-height));
  min-height: calc(100dvh - var(--app-bar-height));
  background:
    radial-gradient(circle at 50% -20%, var(--bg-hover), transparent 42rem),
    var(--bg-base);
}

.markdown-document-route {
  min-height: calc(100vh - var(--app-bar-height));
  min-height: calc(100dvh - var(--app-bar-height));
  overflow-y: auto;
}

.markdown-document-route > .layout,
.markdown-document-route > .sidebar-backdrop {
  display: none;
}

.markdown-document-toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  
  padding:
    calc(12px + env(safe-area-inset-top, 0px))
    max(clamp(18px, 3vw, 44px), env(safe-area-inset-right, 0px))
    12px
    max(clamp(18px, 3vw, 44px), env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--border);
  background: var(--bg-glass);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.markdown-document-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}

.markdown-document-toolbar-actions,
.markdown-document-mode-switch {
  display: flex;
  align-items: center;
}

.markdown-document-toolbar-actions {
  justify-content: flex-end;
  gap: 10px;
}

.markdown-document-mode-switch {
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--fill-subtle);
}

.markdown-document-mode-switch button {
  min-height: 32px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--font-sm);
  font-weight: var(--font-weight-medium);
  transition: color var(--duration-base) ease, background var(--duration-base) ease;
}

.markdown-document-mode-switch button.is-active {
  color: var(--text-main);
  background: var(--fill-medium);
}

@media (hover: hover) {
  .markdown-document-mode-switch button:hover {
    color: var(--text-main);
    background: var(--fill-medium);
  }
}

.markdown-document-action {
  min-height: 38px;
  padding: 8px 12px;
}

.markdown-document-stage {
  width: min(100%, 1100px);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 48px) 80px;
}

.markdown-document-paper {
  min-height: calc(100vh - 180px);
  padding: clamp(28px, 6vw, 72px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-card-strong);
  box-shadow: var(--shadow-paper);
}

.markdown-document-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding-bottom: 32px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border);
}

.markdown-document-file-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--accent-hover);
  background: var(--bg-accent-faint);
}

.markdown-document-file-icon svg {
  width: 22px;
  height: 22px;
}

.markdown-document-filename {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--font-xs);
  overflow-wrap: anywhere;
}

.markdown-document-header h1 {
  max-width: 28ch;
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.18;
  letter-spacing: var(--tracking-tight);
}

.markdown-document-channel {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: var(--font-md);
}

.markdown-document-rendered {
  max-width: 760px;
  margin: 0 auto;
}

.markdown-document-rendered h1 {
  margin: 40px 0 30px;
  font-size: clamp(1.75rem, 3.2vw, 2.05rem);
  line-height: 1.25;
}

.markdown-document-rendered details {
  margin: 1.65rem 0;
  overflow: visible;
  border: 0;
  border-radius:0;
  background: transparent;
}

.markdown-document-rendered details > summary {
  display: flex;
  align-items: center;
  margin-left: 0;
  padding: 0;
  cursor: pointer;
  font-size: 1.18rem;
  font-weight: 650;
  line-height: 1.45;
  list-style: none;
  user-select: none;
}

.markdown-document-rendered details > summary::-webkit-details-marker {
  display: none;
}

.markdown-document-rendered details > summary::before {
  content: '▶';
  flex: 0 0 auto;
  margin-right: 0.55rem;
  font-size: 0.78em;
  line-height: 1;
  transform-origin: center;
  transition: transform var(--duration-base) ease;
}

.markdown-document-rendered details[open] > summary::before {
  transform: rotate(90deg);
}

.markdown-document-rendered details[open] > summary {
  border-bottom: 0;
}

.markdown-document-rendered .markdown-details-content {
  padding: 0.85rem 0 0 1.15rem;
}

.markdown-document-rendered .markdown-details-content > :last-child {
  margin-bottom: 0;
}

.markdown-document-rendered ul,
.markdown-document-rendered ol {
  margin: 0 0 20px 24px;
}

.markdown-document-rendered blockquote {
  margin: 24px 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--accent-hover);
  color: var(--text-muted);
}

.markdown-document-rendered code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.markdown-document-rendered :not(pre) > code {
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-code);
}

.markdown-document-rendered pre,
.markdown-document-raw {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-base);
  font-family: var(--font-mono);
  font-size: var(--font-sm);
  line-height: 1.7;
  tab-size: 2;
}

.markdown-document-rendered pre {
  margin: 24px 0;
  padding: 18px;
}

.markdown-document-raw {
  min-height: 55vh;
  margin: 0;
  padding: clamp(18px, 3vw, 30px);
  color: var(--text-body);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.markdown-document-state {
  display: flex;
  min-height: calc(100vh - 68px);
  min-height: calc(100dvh - 68px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  padding: 32px;
  color: var(--text-muted);
  text-align: center;
}

.markdown-document-state h1 {
  color: var(--text-main);
  font-size: var(--font-xl);
}

.markdown-document-state > svg {
  width: 34px;
  height: 34px;
  color: var(--status-red);
}

.markdown-document-state .btn {
  margin-top: 8px;
  padding-inline: 16px;
}

.markdown-document-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-hover);
  border-radius: var(--radius-round);
  animation: markdown-document-spin 0.8s linear infinite;
}

@keyframes markdown-document-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
  .markdown-document-toolbar {
    position: relative;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding:
      calc(14px + env(safe-area-inset-top, 0px))
      max(16px, env(safe-area-inset-right, 0px))
      14px
      max(16px, env(safe-area-inset-left, 0px));
  }

  .markdown-document-toolbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .markdown-document-mode-switch {
    justify-content: stretch;
  }

  .markdown-document-mode-switch button {
    flex: 1;
  }

  .markdown-document-stage {
    padding: 14px 10px 48px;
  }

  .markdown-document-paper {
    min-height: calc(100vh - 140px);
    padding: 24px 18px;
    border-radius: var(--radius-lg);
  }

  .markdown-document-header {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-bottom: 24px;
    margin-bottom: 28px;
  }

  .markdown-document-header h1 {
    font-size: 1.65rem;
  }
}

@media (max-width: 480px) {
  .markdown-document-toolbar-actions {
    grid-template-columns: 1fr 1fr;
  }

  .markdown-document-mode-switch {
    grid-column: 1 / -1;
  }

  .markdown-document-action span {
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .markdown-document-spinner {
    animation-duration: 1.6s;
  }
}


.markdown-document-rendered .markdown-wiki-link {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}



.playlist-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.playlist-pills-sidebar {
  margin-bottom: 0;
}

.playlist-pill {
  max-width: 100%;
  padding: 5px 9px;
  color: var(--text-main);
  background: var(--fill-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--font-xs);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--duration-base) ease, background var(--duration-base) ease;
}

.playlist-pill.is-collection {
  color: var(--pill-collection-text);
  border-color: var(--pill-collection-border);
  background: var(--pill-collection-bg);
}

.playlist-pill.is-youtube {
  border-color: var(--pill-youtube-border);
  background: var(--pill-youtube-bg);
}

.playlist-pill.is-warning {
  color: var(--text-on-color);
  border-color: var(--status-red);
  background: var(--status-red);
}

.playlist-pill.is-more {
  color: var(--text-muted);
}

.playlist-pill.is-open {
  border-color: var(--border-strong);
}

@media (hover: hover) {
  .playlist-pill:hover {
    border-color: var(--border-strong);
  }
}

.playlist-pill.is-collection.is-open { border-color: var(--pill-collection); }

@media (hover: hover) {
  .playlist-pill.is-collection:hover {
    border-color: var(--pill-collection);
  }
}

.playlist-pill.is-youtube.is-open { border-color: var(--pill-youtube); }

@media (hover: hover) {
  .playlist-pill.is-youtube:hover {
    border-color: var(--pill-youtube);
  }
}

.playlist-pill-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: color var(--duration-base) ease, border-color var(--duration-base) ease;
}

.playlist-pill-add.is-open {
  color: var(--text-main);
  border-color: var(--pill-collection);
  border-style: solid;
}

@media (hover: hover) {
  .playlist-pill-add:hover {
    color: var(--text-main);
    border-color: var(--pill-collection);
    border-style: solid;
  }
}

.playlist-pill-add i { width: 14px; height: 14px; }


.pill-popover {
  position: fixed;
  z-index: var(--layer-popup);
  min-width: 220px;
  max-width: min(280px, calc(100vw - 16px));
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
}

.pill-popover-menu,
.pill-popover-add {
  display: flex;
  flex-direction: column;
  gap: 2px;
}



.pill-popover-option svg { opacity: 0; }
.pill-popover-option.is-checked svg { opacity: 1; color: var(--pill-collection); }

.pill-popover-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
}

.pill-popover-create {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--pill-collection-text);
}

.pill-popover-note {
  margin: 0;
  padding: 8px 10px;
  color: var(--text-muted);
  font-size: var(--font-xs);
  line-height: var(--leading-normal);
}


.status-badge.status-archived {
  color: var(--warning-text);
  background: var(--warning-solid);
  border-color: var(--warning-solid);
  text-transform: lowercase;
}


.pill-popover.is-playlist-add {
  min-width: min(300px, calc(100vw - 16px));
  max-width: min(320px, calc(100vw - 16px));
}

.pill-popover-playlist-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 4px 2px;
}


.pill-popover-playlist-wrap.is-private :is(.playlist-source-warning, .playlist-private-help) {
  margin: 0;
  padding: 0 6px;
}

.pill-popover-playlist {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.pill-popover-playlist-thumb {
  flex: 0 0 auto;
  width: 84px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.pill-popover-playlist-words {
  min-width: 0;
}

.pill-popover-playlist-name {
  color: var(--text-main);
  font-size: var(--font-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--leading-tight);
  overflow-wrap: anywhere;
}

.pill-popover-playlist-meta {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: var(--font-xs);
  overflow-wrap: anywhere;
}

.pill-popover-playlist-add {
  justify-content: center;
  width: 100%;
}

.pill-popover-heading {
  margin: 0 0 6px;
  padding: 2px 10px 0;
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}



body.is-dragging-video,
body.is-dragging-video * {
  cursor: default !important;
}


body.is-dragging-video {
  user-select: none;
}


.video-drag-picture {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--layer-video-being-dragged);
  pointer-events: none;
  will-change: transform;
}


.video-drag-plus {
  position: fixed;
  top: 0;
  left: 0;
  z-index: calc(var(--layer-video-being-dragged) + 1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--text-strong);
  background: var(--pill-collection);
  border: 2px solid var(--text-strong);
  border-radius: var(--radius-round);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  pointer-events: none;
  will-change: transform;
}

.video-drag-plus.is-shown {
  opacity: 1;
}

.video-drag-plus svg {
  width: 11px;
  height: 11px;
}

.video-drag-picture img {
  display: block;
  width: 88px;
  height: 50px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-drag);
}


body.is-dragging-video [data-collection-drop] {
  border: 1px dashed var(--pill-collection-border);
  border-radius: var(--radius-sm);
  background: var(--pill-collection-bg);
}


body.is-dragging-video [data-collection-drop].is-drop-target {
  border-style: solid;
  border-color: var(--pill-collection);
  background: var(--drop-target-bg);
}

body.is-dragging-video [data-collection-drop].is-drop-target .dashboard-playlist-name {
  color: var(--pill-collection-text);
}


body.is-dragging-video .dashboard-sidebar-tree-group:has([data-collection-drop]) .dashboard-sidebar-tree-group-heading {
  color: var(--pill-collection-text);
}


body.is-dragging-video .dashboard-playlist-row[data-collection-drop].is-active {
  color: var(--text-main);
}

body.is-dragging-video .dashboard-playlist-row[data-collection-drop].is-active .dashboard-playlist-count {
  color: var(--text-muted);
  background: var(--fill-soft);
}






.right-sidebar-tabs {
  box-sizing: border-box;
  padding: 0 12px;
}

@media (min-width: 1201px) {
  .right-sidebar-tabs {
    width: var(--right-sidebar-expanded-width);
    min-width: var(--right-sidebar-expanded-width);
  }
}

.right-sidebar-panel[hidden] {
  display: none;
}



.tags-module-loading,
.tags-module-error {
  padding: 12px 0;
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.tags-module-error {
  color: var(--danger-text);
}

.tags-module-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0 8px;
}

.tags-module-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.tag-summary-undo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: var(--fill-soft);
  color: var(--text-main);
  font-family: inherit;
  font-size: var(--font-xs);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  cursor: pointer;
  transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease, color var(--duration-fast) ease;
}

.tag-summary-undo svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

@media (hover: hover) {
  .tag-summary-undo:hover:not(:disabled) {
    background: var(--fill-medium);
    border-color: var(--border-strong);
    color: var(--text-strong);
  }
}

.tag-summary-undo:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 1px;
}

.tag-summary-undo:disabled {
  opacity: 0.6;
  cursor: progress;
}

@media (hover: none), (pointer: coarse) {
  .tag-summary-undo {
    min-height: 32px;
    padding: 0 10px;
  }
}

.tags-module-summary {
  margin: 0;
  flex: 1;
  color: var(--text-muted);
  font-size: var(--font-xs);
  line-height: var(--leading-normal);
}

.tags-tree {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags-tree-unfiled-label {
  margin: 16px 8px 6px;
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-weight: var(--font-weight-semibold);
}

.tags-tree-row {
  display: flex;
  box-sizing: border-box;
  height: 36px;
  line-height: 20px;
  align-items: center;
  gap: 8px;
  margin-left: calc(var(--tags-tree-depth, 0) * 18px);
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease;
}


.right-sidebar .tags-tree-row {
  font-size: var(--sidebar-row-size);
}

.tags-tree-row[hidden] { display: none; }
.tags-tree-fold[data-tag-fold-open="true"] svg { transform: rotate(90deg); }

@media (hover: hover) {
  .tags-tree-row:hover {
    background: var(--fill-subtle);
  }
}

.tags-tree-kind {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-round);
  background: var(--tag-entity);
}

.tags-tree-row.is-category .tags-tree-kind { background: var(--tag-category); }
.tags-tree-row.is-subject .tags-tree-kind { background: var(--tag-subject); }
.tags-tree-row.is-entity .tags-tree-kind { background: var(--tag-entity); }

.tags-tree-row.is-category .tags-tree-name {
  font-weight: var(--font-weight-semibold);
}


.tags-tree-fold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

@media (hover: hover) {
  .tags-tree-fold:hover {
    color: var(--text-main);
  }
}


.tags-tree-row > .tags-tree-fold {
  align-self: stretch;
  width: 30px;
  height: auto;
  margin: -6px -6px -6px -8px;
}

.tags-tree-fold svg {
  width: 13px;
  height: 13px;
}


.tags-tree-fold.is-empty {
  cursor: default;
}


.tags-tree-row.is-selected {
  border-color: var(--border-strong);
  background: var(--fill-medium);
}

.tags-tree-row.is-clicked {
  border-color: var(--pill-collection-border);
  background: var(--pill-collection-bg);
}

.tags-tree-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.tags-tree-info {
  flex: 0 0 auto;
  display: none;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-xs);
  background: none;
  color: var(--text-muted);
  opacity: 0.7;
  cursor: help;
  transition: opacity var(--duration-fast) ease, color var(--duration-fast) ease;
}

.tags-tree-info i,
.tags-tree-info svg {
  width: 13px;
  height: 13px;
}

.tags-tree-row:hover .tags-tree-info,
.tags-tree-row:focus-within .tags-tree-info {
  display: inline-flex;
}

.tags-tree-info:focus-visible {
  opacity: 1;
  color: var(--text-main);
}

@media (hover: hover) {
  .tags-tree-info:hover {
    opacity: 1;
    color: var(--text-main);
  }
}

.tags-tree-info:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 1px;
}

.tags-tree-count {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-variant-numeric: tabular-nums;
}


.tags-tree-row .topics-flag { flex: 0 0 auto; }


.tags-tree-row:focus { outline: none; }


.tags-tree-row:focus-within .row-actions {
  display: flex;
}
@media (hover: hover) {
  .tags-tree-row:hover .row-actions {
    display: flex;
  }
}



.tag-pills {
  
  --tag-pill-height: 22px;
  --tag-pill-gap: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  gap: var(--tag-pill-gap);
  margin-bottom: 12px;
}


.tag-pills:not(.is-showing-all) {
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
}

.tag-pills:not(.is-showing-all) .tag-pill[data-tag-id] {
  min-width: 0;
  flex: 0 1 auto;
}

.tag-pills.is-measuring .tag-pill[data-tag-id] {
  flex: 0 0 auto;
}

.tag-pills:not(.is-showing-all) .tag-pill.is-more,
.tag-pills:not(.is-showing-all) .tag-pill-add {
  flex: 0 0 auto;
}

.tag-pills-card {
  min-height: var(--tag-pill-height);
}

.tag-pills-sidebar {
  margin-bottom: 0;
}


.tag-pill {
  display: inline-flex;
  align-items: center;
  height: var(--tag-pill-height);
  max-width: 100%;
  color: var(--text-main);
  background: var(--fill-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: var(--font-2xs);
  line-height: 1.2;
}


.tag-pill.is-category { border-color: var(--tag-category-outline); }
.tag-pill.is-subject { border-color: var(--tag-subject-outline); }
.tag-pill.is-entity { border-color: var(--tag-entity-outline); }


.tag-pills:not(.is-showing-all) .tag-pill.is-overflow-hidden,
.tag-pills:not(.is-showing-all) .tag-pill.is-past-the-first-few {
  display: none;
}

.tag-pill.is-more[hidden] {
  display: none;
}


.tag-pill.is-more {
  display: inline-block;
  position: relative;
  padding: 0 8px;
  text-align: center;
  font-size: var(--font-2xs);
  line-height: calc(var(--tag-pill-height) - 2px);
  color: var(--text-muted);
  font-family: inherit;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  transition: color var(--duration-fast) ease, border-color var(--duration-fast) ease, background var(--duration-fast) ease;
}

.tag-pill-more-label {
  pointer-events: none;
}

@media (hover: hover) {
  .tag-pill.is-more:hover {
    color: var(--text-main);
    border-color: var(--border-strong);
    background: var(--fill-medium);
  }
}

.tag-pill-name {
  max-width: 190px;
  padding: 3px 3px 3px 8px;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-pill-remove {
  padding: 3px 7px 3px 3px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: var(--font-sm);
  line-height: 1;
  cursor: pointer;
}

@media (hover: hover) {
  .tag-pill-remove:hover {
    color: var(--status-red);
  }
}

.tag-pill-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tag-pill-height);
  height: var(--tag-pill-height);
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.tag-pill-regenerate {
  border-style: solid;
  border-color: var(--border);
}

.tag-pill-regenerate svg {
  width: 11px;
  height: 11px;
}

.tag-pill.is-tagging {
  padding: 0 8px;
  color: var(--text-muted);
  border-style: dashed;
}

@media (hover: hover) {
  .tag-pill-add:hover {
    color: var(--text-main);
    border-color: var(--accent-hover);
  }
}



.tag-picker {
  position: absolute;
  z-index: var(--layer-popup);
  width: 280px;
  max-height: 360px;
  overflow-y: auto;
}

.tag-picker-options {
  margin-top: 4px;
}

.tag-picker-option {
  justify-content: space-between;
  gap: 8px;
}

.tag-picker-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.tag-picker-label > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-picker-option.is-category .tags-tree-kind { background: var(--tag-category); }
.tag-picker-option.is-subject .tags-tree-kind { background: var(--tag-subject); }
.tag-picker-option.is-entity .tags-tree-kind { background: var(--tag-entity); }

.tag-picker-option.is-make {
  color: var(--text-muted);
}

.tag-picker-option.is-make strong {
  color: var(--text-main);
}

.chat-module-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding-bottom: 6px;
}


.chat-module-bar .custom-select-wrap {
  
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  max-width: 62%;
}

.chat-module-bar .custom-select-trigger {
  width: auto;
  padding: 3px 4px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  font-size: var(--font-xs);
}

@media (hover: hover) {
  .chat-module-bar .custom-select-trigger:hover {
    color: var(--text-main);
  }
}

.chat-module-bar .custom-select-trigger i,
.chat-module-bar .custom-select-trigger svg { display: none; }


.chat-module-bar .custom-select-wrap.is-chosen .custom-select-trigger {
  color: var(--text-main);
  background: transparent;
}



.asked-before {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.asked-before[hidden] { display: none; }

.asked-before-heading {
  margin: 0 0 2px;
  padding: 2px 7px;
  color: var(--text-muted);
  font-size: var(--font-3xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}


.asked-before-row {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: var(--radius-sm);
}

@media (hover: hover) {
  .asked-before-row:hover {
    background: var(--bg-control);
  }
}

.asked-before-row.is-open {
  background: var(--bg-control);
  box-shadow: inset 2px 0 0 var(--accent-hover);
}

.asked-before-line {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
  padding: 5px 7px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-main);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.asked-before-delete {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 4px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
}

@media (hover: hover) {
  .asked-before-row:hover .asked-before-delete {
    opacity: 1;
  }
}
@media (hover: hover) {
  .asked-before-delete:hover {
    color: var(--danger-text);
  }
}
.asked-before-delete i { width: 12px; height: 12px; }

.asked-before-question {
  overflow: hidden;
  font-size: var(--font-xs);
  font-weight: var(--font-weight-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asked-before-where {
  color: var(--text-muted);
  font-size: var(--font-3xs);
}

.asked-before-clear {
  align-self: flex-start;
  margin-top: 2px;
  padding: 3px 7px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--font-3xs);
  cursor: pointer;
}

@media (hover: hover) {
  .asked-before-clear:hover {
    color: var(--text-main);
  }
}

.asked-before-empty {
  margin: 0;
  padding: 4px 6px;
  color: var(--text-muted);
  font-size: var(--font-xs);
}

.asked-before-error {
  margin: 0;
  color: var(--danger-text);
  font-size: var(--font-xs);
}



.chat-module {
  display: flex;
  flex-direction: column;
  min-height: 320px;
}


.right-sidebar-scroll-area {
  display: flex;
  flex-direction: column;
}

.right-sidebar-panel[data-library-panel="chat"],
.right-sidebar-panel[data-video-panel="chat"] {
  flex: 1;
  min-height: 0;
}



.answer-outline {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: var(--font-xs);
}

.answer-outline-video + .answer-outline-video {
  margin-top: 12px;
}


.answer-outline-video-title {
  flex: 1;
  min-width: 0;
  color: var(--text-main);
  font-size: var(--font-base);
  font-weight: var(--font-weight-semibold);
  line-height: var(--leading-normal);
}


.answer-outline .ai-outline-title {
  color: var(--text-main);
}


.answer-outline .ai-collapsible-trigger {
  margin-bottom: 6px;
}

.answer-outline .ai-outline-list {
  padding-left: 22px;
}

.answer-outline .ai-outline-list > li {
  margin-bottom: 8px;
}

.answer-outline .ai-outline-summary {
  padding-left: 22px;
  color: var(--text-muted);
  line-height: var(--leading-normal);
}

.answer-outline .ai-outline-bullets {
  padding-left: 40px;
  color: var(--text-muted);
}



.right-sidebar-chosen-tags:empty {
  display: none;
}

.right-sidebar-chosen-tags,
.dashboard-sidebar-chosen-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}


.right-sidebar-chosen-tags {
  margin-top: 12px;
}

.dashboard-sidebar-chosen-tags {
  padding: 0 4px 4px;
}

.dashboard-sidebar-chosen-tags:empty {
  display: none;
}

.chosen-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 7px 12px;
  color: var(--text-main);
  background: var(--fill-subtle);
  border: 1px solid var(--tag-entity-outline);
  border-radius: var(--radius-lg);
  font-family: inherit;
  font-size: var(--font-2xs);
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}

.chosen-tag-name { min-width: 0; overflow-wrap: anywhere; }
.chosen-tag-close { flex: 0 0 16px; text-align: center; font-size: var(--font-base); }


.chosen-tag.is-category { border-color: var(--tag-category-outline); }
.chosen-tag.is-subject { border-color: var(--tag-subject-outline); }
.chosen-tag.is-entity { border-color: var(--tag-entity-outline); }

@media (hover: hover) {
  .chosen-tag:hover {
    border-color: var(--accent-hover);
  }
}


.sidebar .dashboard-sidebar-chosen-tags .chosen-tag:not(.is-clear) {
  color: var(--inverse-text);
  background: var(--inverse-bg);
  border-color: var(--inverse-bg);
}
@media (hover: hover) {
  .sidebar .dashboard-sidebar-chosen-tags .chosen-tag:not(.is-clear):hover {
    color: var(--inverse-text);
    background: var(--inverse-bg);
    border-color: var(--inverse-bg);
  }
}

.chosen-tag.is-clear {
  color: var(--text-muted);
  background: transparent;
  border-style: dashed;
  border-color: var(--border-strong);
}

.chosen-tag-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
}

@media (hover: hover) {
  .chosen-tag-add:hover {
    color: var(--text-main);
    border-color: var(--accent-hover);
  }
}


.chosen-tag-add.is-named {
  gap: 6px;
  width: auto;
  height: auto;
  padding: 3px 10px;
  font-family: inherit;
  font-size: var(--font-xs);
}



.tags-tree-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.tags-leftovers-title {
  margin: 14px 0 6px;
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}


.tags-detail-delete {
  color: var(--status-red);
  border-color: var(--danger-border);
}

@media (hover: hover) {
  .tags-detail-delete:hover {
    color: var(--text-on-color);
    background: var(--status-red);
    border-color: var(--status-red);
  }
}


.tags-panel-filter {
  margin-bottom: 10px;
}


.chat-module-bar .custom-select-popover {
  min-width: 12rem;
  width: max-content;
  max-width: 15rem;
  left: auto;
  right: 0;
}

.chat-module-bar .custom-select-option { white-space: nowrap; }


.tag-standards-setting { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; padding:22px; margin:22px 0; border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--bg-card); }
.tag-standards-setting strong { font-size:15px; }
.tag-standards-setting p { max-width:660px; line-height:1.55; margin:8px 0 14px; }
.tag-standards-setting .setting-switch { flex-shrink:0; margin-top:2px; }
#standardCategoriesStatus { margin-left:12px; }
.tag-tree-hint { display:flex; align-items:center; gap:8px; font-size:var(--font-xs); margin:16px 0; }
.tag-tree-hint svg { width:14px; height:14px; }
.tag-definition-dialog { width:min(560px, calc(100vw - 32px)); padding:26px; }
.tag-definition-form { display:flex; flex-direction:column; gap:12px; }
.tag-definition-form label { display:flex; flex-direction:column; gap:8px; font-size:var(--font-sm); font-weight:var(--font-weight-medium); }
.tag-definition-form input, .tag-definition-form textarea, .tag-definition-form select { width:100%; box-sizing:border-box; }
.tag-definition-form textarea { resize:vertical; line-height:1.55; min-height:84px; }
.tag-definition-form p { margin:0; line-height:1.5; }
.tag-definition-form .dialog-header, .standard-categories-dialog .dialog-header { align-items:flex-start; margin-bottom:6px; }
.tag-definition-form h3, .standard-categories-dialog h3 { margin:6px 0 10px; }
.tag-editor-eyebrow { font-size:var(--font-3xs); letter-spacing:.12em; color:var(--text-muted); }
.tag-dialog-close { border:0; background:transparent; color:var(--text-muted); font-size:25px; cursor:pointer; padding:0 6px; }
.tag-description-heading { display:flex; justify-content:space-between; align-items:center; margin-top:4px; gap:12px; }
.tag-description-heading button { display:flex; align-items:center; gap:6px; }
.tag-description-heading svg { width:14px; height:14px; }
.tag-alias-details { border-top:1px solid var(--border); padding-top:12px; }
.tag-alias-details summary { cursor:pointer; font-size:var(--font-sm); }
.tag-alias-details p { margin:12px 0; }
.tag-definition-form .dialog-actions { margin-top:10px; }
.standard-categories-dialog { width:min(780px, calc(100vw - 32px)); max-height:85dvh; padding:26px; }
.standard-categories-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:18px 0 12px; }
.standard-category-cards { display:grid; gap:8px; max-height:52dvh; overflow:auto; padding-right:6px; }
.standard-category-card { display:flex; align-items:center; gap:16px; border:1px solid var(--border); border-radius:var(--radius-md); padding:15px; }
.standard-category-edit { flex:1; min-width:0; display:flex; flex-direction:column; gap:6px; text-align:left; background:transparent; border:0; color:inherit; cursor:pointer; padding:0; }
.standard-category-edit strong { font-size:var(--font-base); }
.standard-category-edit span { font-size:var(--font-xs); line-height:1.5; color:var(--text-muted); }
@media (hover: hover) {
  .standard-category-card:has(.standard-category-edit:hover) {
    border-color:var(--status-green);
  }
}
.standard-category-card .setting-switch { flex-shrink:0; }
.standard-categories-footer { display:flex; gap:24px; align-items:center; justify-content:space-between; border-top:1px solid var(--border); margin-top:18px; padding-top:16px; }
.standard-categories-footer p { max-width:560px; margin:0; line-height:1.5; }
.tags-tree-row[data-tag-path] { cursor:default; }
body.is-dragging-tag, body.is-dragging-tag * { cursor:grabbing !important; user-select:none !important; -webkit-user-select:none !important; }

#tags-settings .topics-workbench { align-items:stretch; }
#tags-settings .tags-tree-panel { contain:size; min-height:34rem; max-height:none; }
#tags-settings .topics-catalog-detail { position:static; }
@media(max-width:900px) { #tags-settings .tags-tree-panel { contain:none; min-height:0; height:28rem; } }

.tag-drop-options { display:flex; flex-direction:column; gap:12px; }
.tag-drop-options .btn { justify-content:flex-start; }
.tag-merge-names { display:flex; flex-direction:column; gap:10px; padding:14px; border:1px solid var(--border); border-radius:var(--radius-md); }
.tag-merge-names label { display:flex; flex-direction:row; align-items:center; gap:10px; }
.tag-merge-names input[type=radio] { width:auto; }
@media(max-width:640px) { .tag-standards-setting { padding:16px; gap:12px; } #standardCategoriesStatus { display:block; margin:10px 0 0; } .standard-categories-dialog { padding:18px; } .tag-definition-dialog { padding:0; } .tag-tree-hint { line-height:1.5; }
  
  .standard-categories-dialog[open] { display:block; padding:18px 18px 0; overflow-y:auto; }
  .standard-category-cards { max-height:none; overflow:visible; padding-right:0; }
  .standard-categories-toolbar { margin:12px 0; }
  .standard-categories-footer { display:contents; }
  .standard-categories-footer p { margin:16px 0 0; }
  .standard-categories-footer .btn { position:sticky; bottom:12px; width:100%; margin:16px 0 12px; box-shadow:0 0 0 12px var(--bg-sidebar); } }

.tag-move-preview { max-height:240px; overflow:auto; padding-left:20px; font-size:var(--font-sm); line-height:1.6; }


.tag-picker { position:fixed; display:flex; flex-direction:column; overflow:hidden; box-sizing:border-box; }
.tag-picker-options { overflow:auto; min-height:0; }
.tag-picker-options:empty { display:none; }
.tag-picker-search { flex-shrink:0; }
.tag-picker:has(.tag-picker-options:empty) .tag-picker-search { margin-bottom:0; }
.tag-picker-option:disabled, .tag-pill-remove:disabled { cursor:progress; opacity:.65; }
.tag-definition-form select { text-overflow:ellipsis; }




.topics-panel-toolbar {
  display: flex;
  align-items: flex-start;
  gap: 0.375rem;
  margin-bottom: 10px;
}

.topics-panel-toolbar > .tags-panel-filter {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}


.topics-new-button {
  --icon-btn-size: 34px;
  --icon-btn-icon: var(--icon-md);
}


.topics-row-state {
  flex: 0 0 auto;
  padding: 1px 6px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: var(--font-3xs);
}

.topics-row-state.is-archived { color: var(--warning-text); border-color: var(--warning-border); }
.topics-row-state.is-trashed { color: var(--danger-text); border-color: var(--danger-border); }

.topics-row.is-open {
  background: var(--fill-subtle);
}


.topics-row.is-open .tags-tree-name {
  color: var(--text-main);
  font-size: var(--sidebar-open-row-size);
  font-weight: var(--font-weight-semibold);
}


.topics-fold-slot {
  list-style: none;
  margin: 2px 0 10px calc(1px + 8px + 16px + 8px);
}


.topic-fold {
  display: grid;
  gap: 14px;
  min-width: 0;
  color: var(--text-main);
  font-size: var(--font-base);
  line-height: var(--leading-relaxed);
}


.topic-fold-notes {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.topic-fold .topic-fold-notes > .ai-collapsible-trigger h4 { color: var(--text-main); }

.topic-fold-notes .topic-notes-editor-body { border-color: var(--border-strong); }


.topic-notes-hint {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: var(--font-sm);
  line-height: var(--leading-relaxed);
}



.topic-videos-list { margin: 0 0 0 -6px; }
.topic-videos-list .dashboard-sidebar-video-row { text-decoration: none; }

.topic-videos-count {
  margin-left: 6px;
  color: var(--text-muted);
  font-weight: var(--font-weight-normal);
}


.chosen-tag.is-topic {
  border-color: var(--border-strong);
}

.chosen-tag.is-topic svg {
  flex: 0 0 auto;
  opacity: 0.8;
}



.topic-notepad {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.topic-notepad-loading {
  margin: 0;
  color: var(--text-muted);
}


.topic-notes-editor-body {
  min-height: 140px;
  max-height: min(40vh, 360px);
  overflow-y: auto;
  padding: 8px 12px;
  color: var(--text-reading);
  background: var(--bg-control);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  
  font-size: inherit;
  line-height: var(--leading-relaxed);
  outline: none;
  overflow-wrap: anywhere;
}

.topic-notepad.is-page .topic-notes-editor-body {
  min-height: 320px;
  max-height: none;
  padding: 14px 18px;
}

.topic-notes-editor-body:focus { border-color: var(--border-strong); }


.topic-notes-editor-body > :first-child { margin-top: 0; }
.topic-notes-editor-body > :last-child { margin-bottom: 0; }
.topic-notes-editor-body p { margin: 0 0 0.6em; }
.topic-notes-editor-body h1,
.topic-notes-editor-body h2,
.topic-notes-editor-body h3,
.topic-notes-editor-body h4 {
  margin: 1em 0 0.4em;
  color: var(--text-strong);
  line-height: 1.25;
}
.topic-notes-editor-body h1 { font-size: 1.4em; }
.topic-notes-editor-body h2 { font-size: 1.22em; }
.topic-notes-editor-body h3 { font-size: 1.08em; }
.topic-notes-editor-body h4 { font-size: 1em; }
.topic-notes-editor-body ul,
.topic-notes-editor-body ol { margin: 0 0 0.6em; padding-left: 1.4em; }
.topic-notes-editor-body li > p { margin: 0; }

.topic-notes-editor-body blockquote {
  margin: 0 0 0.6em;
  padding-left: 0.9em;
  color: var(--text-main);
  border-left: 3px solid var(--accent-hover);
}
.topic-notes-editor-body blockquote > p:last-child:not(:first-child) { color: var(--text-muted); }
.topic-notes-editor-body blockquote a { color: inherit; }
.topic-notes-editor-body code {
  padding: 1px 4px;
  background: var(--fill-soft);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.topic-notes-editor-body pre {
  margin: 0 0 0.6em;
  padding: 8px 10px;
  overflow-x: auto;
  background: var(--bg-code);
  border-radius: var(--radius-sm);
}
.topic-notes-editor-body pre code { padding: 0; background: none; }
.topic-notes-editor-body a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }

.topic-notes-editor-body a[href*="youtube.com/watch"] { cursor: pointer; }
@media (hover: hover) {
  .topic-notes-editor-body a[href*="youtube.com/watch"]:hover {
    color: var(--text-main);
  }
}
.topic-notes-editor-body hr { border: none; border-top: 1px solid var(--border); margin: 1em 0; }


.topic-notes-editor-body ul[data-type="taskList"] { padding-left: 0.2em; list-style: none; }
.topic-notes-editor-body ul[data-type="taskList"] li { display: flex; gap: 0.5em; align-items: flex-start; }
.topic-notes-editor-body ul[data-type="taskList"] li > label { flex: 0 0 auto; margin-top: 0.15em; }
.topic-notes-editor-body ul[data-type="taskList"] li > div { flex: 1 1 auto; min-width: 0; }
.topic-notes-editor-body ul[data-type="taskList"] li[data-checked="true"] > div { color: var(--text-muted); text-decoration: line-through; }


.notes-wiki-link {
  color: var(--accent);
  border-bottom: 1px dotted currentColor;
}


.topic-notes-editor-body p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  height: 0;
  color: var(--text-muted);
  pointer-events: none;
}


.topic-fold-notes.is-expanded {
  position: absolute;
  inset: var(--notes-expanded-top, 0px) 0 0 0;
  
  z-index: 20;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 12px 16px 16px;
  background: var(--bg-sidebar);
}

.topic-fold-notes.is-expanded > .ai-collapsible-trigger { cursor: default; }
.topic-fold-notes.is-expanded > .ai-collapsible-trigger .ai-chevron { visibility: hidden; }
.topic-fold-notes.is-expanded > .ai-collapsible-trigger .row-actions { opacity: 1; pointer-events: auto; }

.topic-fold-notes.is-expanded > .ai-collapsible-content,
.topic-fold-notes.is-expanded [data-topic-fold-notes],
.topic-fold-notes.is-expanded .topic-notepad,
.topic-fold-notes.is-expanded .topic-notepad-editor,
.topic-fold-notes.is-expanded .topic-notes-editor {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.topic-fold-notes.is-expanded .topic-notes-editor-body {
  flex: 1 1 auto;
  max-height: none;
  padding: 14px 18px;
}


.notes-toolbar {
  position: fixed;
  z-index: var(--layer-popup);
  display: flex;
  gap: 2px;
  padding: 4px;
}

.notes-toolbar-gap {
  width: 1px;
  margin: 4px 3px;
  background: var(--border);
}

.notes-toolbar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.notes-toolbar-button svg { width: 16px; height: 16px; }
@media (hover: hover) {
  .notes-toolbar-button:hover {
    color: var(--text-strong);
    background: var(--bg-hover);
  }
}
.notes-toolbar-button.is-on { color: var(--text-strong); background: var(--bg-hover-strong); }

.topic-notepad-status {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-xs);
}


.topic-notepad-status:empty { display: none; }
.topic-notepad-status.is-error { color: var(--danger-text); }



.topics-settings-notes {
  margin: 0;
  padding: 0.6rem 0.75rem;
  max-height: 14rem;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--text-main);
  background: var(--bg-control);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--font-sm);
  line-height: var(--leading-normal);
}



.video-topics-rows {
  margin: 0;
  padding: 0;
}

.video-topics-rows .tags-tree-row { cursor: pointer; }



.topic-document-name {
  cursor: text;
  border-radius: var(--radius-sm);
}

@media (hover: hover) {
  .topic-document-name:hover {
    background: var(--fill-soft);
  }
}

.topic-document-rename {
  width: 100%;
  padding: 2px 6px;
  color: var(--text-strong);
  background: var(--bg-control);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  letter-spacing: inherit;
}

.topic-document-state {
  max-width: 760px;
  margin: -12px auto 28px;
  padding: 0.6rem 0.8rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
}

.topic-document .topic-notepad { margin-bottom: 8px; }

.topic-document-videos li { margin: 4px 0; }

.topic-document-videos .topics-row-state { margin-left: 6px; }


.chat-module[data-chat-scope="topic"] {
  position: relative;
  min-height: 0;
}

.chat-module[data-chat-scope="topic"] .ai-chat-history {
  max-height: 360px;
}



.topic-sections.is-sidebar {
  display: grid;
  gap: 14px;
}

.topic-sections.is-sidebar:empty { display: none; }

.topic-section-body {
  color: var(--text-reading);
  overflow-wrap: anywhere;
}

.topic-section-body > :first-child { margin-top: 0; }
.topic-section-body > :last-child { margin-bottom: 0; }

.topic-sections.is-sidebar .topic-section-body p { margin: 0 0 10px; }
.topic-sections.is-sidebar .topic-section-body h3 {
  margin: 12px 0 4px;
  font-size: 1em;
  font-weight: var(--font-weight-semibold);
}
.topic-sections.is-sidebar .topic-section-body ul { margin: 0 0 10px; padding-left: 18px; list-style: disc; }
.topic-sections.is-sidebar .topic-section-body li { margin-bottom: 8px; }


.topic-outline-themes .ai-outline-bullets { list-style-type: disc; }


.topic-moment-link {
  color: var(--text-timestamp);
  font-size: var(--timestamp-size);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity var(--duration-slow), color var(--duration-slow);
}

@media (hover: hover) {
  .topic-moment-link:hover {
    color: var(--text-main);
    opacity: 1;
    text-decoration: underline;
  }
}


.markdown-document-rendered details > summary .row-actions {
  display: inline-flex;
  margin-left: 10px;
  opacity: 1;
  pointer-events: auto;
}


.topic-section-state {
  margin: 0 0 6px;
  color: var(--text-muted);
}

.topic-section-state.is-error { color: var(--danger-text); }
.topic-section-state.is-stale em { color: var(--warning-text); font-style: normal; }

.topic-section-state.is-busy {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topic-section-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--text-main);
  border-radius: var(--radius-round);
  animation: icon-spin 0.9s linear infinite;
}


.topic-section-write {
  padding: 0;
  color: var(--text-main);
  background: none;
  border: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}


.highlight-anchor {
  position: fixed;
  pointer-events: none;
  visibility: hidden;
}


#markdownContent.is-over-selection { cursor: grab; }


body.is-dragging-highlight,
body.is-dragging-highlight * { cursor: grabbing !important; }
.highlight-drag-picture {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 220px;
  will-change: transform;
}
.highlight-drag-picture svg { flex: none; width: 14px; height: 14px; margin-top: 2px; color: var(--status-green); }
.highlight-drag-picture span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}



.topic-files .topic-files-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic-file-row { cursor: default; }

.topic-file-icon {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

.topic-file-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-file-meta {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: var(--font-xs);
  line-height: 1;
}

.topic-file-meta.is-error { color: var(--danger-text); }


.topic-file-row:focus-within .topic-file-meta { display: none; }
@media (hover: hover) {
  .topic-file-row:hover .topic-file-meta {
    display: none;
  }
}

.topic-files-count {
  margin-left: 6px;
  color: var(--text-muted);
  font-weight: var(--font-weight-normal);
}


.topic-files.is-drop-target {
  outline: 1px dashed var(--border-strong);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}



.prompt-workspace {
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-sidebar);
  margin: 20px 0 32px;
  scroll-margin-top: 24px;
}

.prompt-workspace[hidden] {
  display: none;
}

.pw-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.pw-heading h3 {
  margin: 6px 0 10px;
  font-size: 1.35rem;
}

.pw-heading p,
.pw-step-title p {
  color: var(--text-muted);
  margin: 0;
  font-size: var(--font-base);
  line-height: 1.5;
}

.pw-eyebrow {
  font-size: var(--font-3xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: .14em;
  color: var(--success-text);
}

.pw-workflows,
.pw-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.pw-workflows button,
.pw-tabs button {
  background: transparent;
  border: 0;
  border-radius: var(--radius-md);
  padding: 8px 14px;
  color: var(--text-muted);
  cursor: pointer;
}

.pw-workflows button[aria-selected=true],
.pw-tabs button[aria-selected=true] {
  background: var(--success-bg-strong);
  color: var(--success-text);
}

.pw-layout {
  display: grid;
  grid-template-columns: 240px minmax(0,1fr);
}

.pw-flow {
  padding: 20px 14px;
  border-right: 1px solid var(--border);
  background: var(--bg-inset);
}

.pw-start {
  text-align: center;
  padding: 8px;
  font-size: var(--font-xs);
  color: var(--text-muted);
}

.pw-node {
  position: relative;
  display: flex;
  gap: 10px;
  text-align: left;
  width: 100%;
  padding: 12px 10px;
  margin: 16px 0;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--bg-popover);
  color: inherit;
  cursor: pointer;
}

.pw-node:before {
  content: '';
  height: 17px;
  position: absolute;
  left: 23px;
  top: -18px;
  border-left: 1px solid var(--border-hover);
}

.pw-node.selected {
  border-color: var(--status-green);
  background: var(--success-bg-strong);
  box-shadow: 0 0 0 1px var(--success-ring);
}

.pw-node-index {
  font-size: var(--font-2xs);
  line-height: 20px;
  color: var(--success-text);
}

.pw-node strong {
  display: block;
  font-size: var(--font-sm);
  font-weight: var(--font-weight-medium);
  line-height: 1.35;
}

.pw-node small {
  display: block;
  font-size: .65rem;
  margin-top: 5px;
  color: var(--text-muted);
}

.pw-flow-note {
  font-size: .71rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 22px 8px;
}

.pw-editor {
  min-width: 0;
  padding: 20px;
}

.pw-step-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.pw-step-title h4 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.pw-engine {
  padding: 5px 7px;
  background: var(--success-bg-strong);
  color: var(--success-text);
  border-radius: var(--radius-sm);
  font-size: var(--font-2xs);
  letter-spacing: .04em;
}

.pw-revision {
  margin-left: auto;
  white-space: nowrap;
  font-size: var(--font-2xs);
  color: var(--text-soft);
}

.pw-tabs {
  padding: 16px 0 10px;
}

.pw-video {
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 18px 0 8px;
}

.pw-video label {
  flex: 1;
  min-width: 0;
}

.pw-video select,
.pw-field select,
.pw-field input,
.pw-field textarea,
.pw-add-input input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-control);
  color: inherit;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-top: 7px;
  font: inherit;
}

.pw-video select {
  font-size: var(--font-sm);
}

.pw-field,
.pw-video label {
  display: block;
  font-size: var(--font-sm);
  margin-bottom: 16px;
}

.pw-field textarea {
  font-size: var(--font-sm);
  line-height: 1.65;
  resize: vertical;
  min-height: 140px;
}

.pw-field textarea:focus {
  outline: 1px solid var(--status-green);
  border-color: var(--status-green);
}

.pw-context-note {
  font-size: var(--font-xs);
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 22px;
}

.pw-prompt-block,
.pw-input {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px;
  margin: 12px 0;
}

.pw-prompt-block summary,
.pw-input summary {
  cursor: pointer;
  font-size: var(--font-sm);
}

.pw-input summary {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.pw-input small {
  color: var(--text-muted);
}

.pw-prompt-block .pw-field {
  margin-top: 12px;
}

.pw-variable-hint {
  font-size: var(--font-xs);
  color: var(--text-soft);
  line-height: 1.6;
}

.pw-variable-hint code {
  display: inline-block;
  padding: 2px 5px;
  margin: 3px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
}

.pw-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 20px 0 0;
  margin-top: 24px;
  border-top: 1px solid var(--border);
}

.pw-footer>span {
  flex: 1;
  min-width: 180px;
  font-size: var(--font-xs);
  color: var(--text-soft);
  line-height: 1.5;
}

.pw-empty {
  color: var(--text-muted);
  line-height: 1.7;
  padding: 20px 0;
}

.pw-editor pre {
  max-height: 440px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: var(--font-xs);
  line-height: 1.6;
  background: var(--bg-inset);
  border-radius: var(--radius-md);
  padding: 12px;
}

.pw-history,
.pw-result-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-medium);
}

.pw-history small {
  display: block;
  color: var(--text-soft);
  margin-top: 6px;
}

.pw-add-input,
.pw-launch-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pw-test-intro h5 {
  font-size: var(--font-md);
  margin: 20px 0 10px;
}

.pw-test-intro p,
#pwResult p {
  color: var(--text-soft);
  font-size: var(--font-sm);
  line-height: 1.6;
}

#pwResult {
  margin-top: 20px;
}

.pw-result-summary strong {
  color: var(--success-text);
}

.pw-result-summary span {
  font-size: var(--font-xs);
  color: var(--text-soft);
}

.pw-editor details>summary {
  cursor: pointer;
}

@media (min-width:1400px) {
  .pw-layout {
    grid-template-columns: 270px minmax(0,1fr);
  }
}

@media (max-width:800px) {
  .pw-layout {
    grid-template-columns: 1fr;
  }
  .pw-flow {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 10px;
  }
  .pw-node {
    min-width: 190px;
    max-width: 210px;
    margin: 0;
  }
  .pw-node:before,
  .pw-flow-note,
  .pw-flow>.pw-start {
    display: none;
  }
  .pw-heading {
    padding: 16px;
  }
  .pw-editor {
    padding: 16px;
  }
  .pw-revision {
    display: none;
  }
  .pw-workflows {
    padding: 10px;
  }
  .pw-video {
    flex-direction: column;
    align-items: stretch;
  }
  .pw-launch-actions {
    flex-wrap: wrap;
  }
}

.pw-answer-list article {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.pw-answer-list article p {
  margin: 0 0 10px!important;
}

.pw-answer-list strong {
  font-size: var(--font-sm);
  color: var(--success-text);
}

.pw-answer-list span {
  font-size: var(--font-xs);
  margin-left: 12px;
  color: var(--text-soft);
}

.ai-sidebar-module {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.ai-controls {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.ai-controls label {
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.ai-result-container {
  font-size: var(--font-base);
  line-height: var(--leading-relaxed);
  color: var(--text-main);
  display: grid;
  gap: 14px;
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.ai-loading {
  color: var(--text-muted);
  font-style: italic;
  padding: 10px 0;
  text-align: center;
}

.ai-error {
  color: var(--status-red);
  padding: 12px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
}

.ai-analysis-result {
  display: grid;
  gap: 8px;
}


.ai-subtitle {
  margin: 0;
  font-size: var(--sidebar-heading-size);
  font-weight: var(--font-weight-semibold);
  color: var(--text-main);
  line-height: var(--leading-tight);
}

.ai-collapsible-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 6px;
}

.ai-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform var(--duration-slow) ease;
}

.ai-collapsible-section.is-collapsed>.ai-collapsible-trigger .ai-chevron {
  transform: rotate(-90deg);
}

.ai-collapsible-section.is-collapsed>.ai-collapsible-content {
  display: none;
}


.ai-summary h4,
.ai-outline h4,
.topic-fold .ai-collapsible-trigger h4 {
  margin: 0;
  font-size: var(--sidebar-heading-size);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
}

.ai-summary p {
  margin: 0;
}


.ai-summary p,
.ai-outline-summary,
.ai-outline-bullets,
.ai-chat-message.ai-message .ai-message-content,
.topic-section-body,
.topic-notes-editor-body {
  color: var(--text-reading);
  font-family: var(--font-reading);
  letter-spacing: var(--reading-tracking);
  -webkit-text-stroke: var(--reading-thicken) currentColor;
}

.ai-summary p,
.ai-outline-summary,
.ai-outline-bullets,
.ai-chat-message.ai-message .ai-message-content,
.topic-sections.is-sidebar .topic-section-body,
.topic-notepad:not(.is-page) .topic-notes-editor-body {
  font-size: var(--reading-size-sidebar);
  
  color: var(--text-reading-sidebar);
}

:is(.ai-chat-message.ai-message .ai-message-content, .topic-section-body, .topic-notes-editor-body) :is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--font-sans);
  letter-spacing: normal;
  -webkit-text-stroke: 0;
}

.ai-outline-list {
  margin: 0;
  padding-left: 6px;
  color: var(--text-main);
  list-style: none;
}

.ai-outline-list>li {
  margin-bottom: 10px;
}

.ai-outline-title {
  font-size: var(--sidebar-heading-size);
  font-weight: var(--font-weight-semibold);
}


.ai-outline-summary {
  padding-left: 22px;
}

.ai-outline-bullets {
  margin: 8px 0 0 0;
  padding-left: 40px;
  
  list-style-type: disc;
}

.ai-outline-bullets li {
  margin-bottom: 8px;
}

.ai-timestamp-link {
  color: var(--text-timestamp);
  font-size: var(--timestamp-size);
  font-weight: var(--font-weight-normal);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
  transition: opacity var(--duration-slow), color var(--duration-slow);
}

@media (hover: hover) {
  .ai-timestamp-link:hover {
    color: var(--text-main);
    opacity: 1;
    text-decoration: underline;
  }
}


.ai-timestamp-link.active-timestamp,
.topic-moment-link.active-timestamp {
  color: var(--text-strong);
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}


::highlight(sidebar-moment) {
  color: var(--text-strong);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
}

.ai-collapsible-section .ai-collapsible-content {
  position: relative;
}

.ai-chat-history {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 0;
  padding-bottom: 60px;
  padding-right: 4px;
  -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 60px), transparent 100%);
  mask-image: linear-gradient(to bottom, black calc(100% - 60px), transparent 100%);
}


.right-sidebar-panel > .chat-module {
  position: relative;
  height: 100%;
  min-height: 340px;
  padding-bottom: 12px;
}

.right-sidebar-panel > .chat-module .ai-chat-history {
  flex: 1;
  max-height: none;
}

.ai-chat-history:empty {
  padding-bottom: 0;
  -webkit-mask-image: none;
  mask-image: none;
}


.ai-chat-scroll-bottom {
  --icon-btn-icon: var(--icon-lg);
  position: absolute;
  right: 12px;
  bottom: 56px;
  z-index: 11;
  box-shadow: var(--shadow-md);
}
.ai-message-content > :first-child { margin-top: 0; }
.ai-message-content > :last-child { margin-bottom: 0; }

.ai-chat-message {
  display: flex;
  flex-direction: column;
  max-width: 90%;
}

.ai-chat-message.user-message {
  align-self: flex-end;
  background: var(--fill-soft);
  padding: 6px 12px 10px 12px;
  border-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-xs);
  color: var(--text-main);
  border: 1px solid var(--border);
}


.ai-chat-message.user-message .ai-message-content {
  font-size: var(--sidebar-message-size);
  line-height: 1.4;
}

.ai-chat-message.ai-message {
  align-self: flex-start;
  color: var(--text-main);
  position: relative;
  width: 100%;
}

.ai-chat-message.ai-message .ai-message-content {
  padding-right: 30px;
  line-height: var(--leading-relaxed);
}

.ai-copy-btn {
  position: absolute;
  top: 0;
  right: 0;
}

.ai-chat-input-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  background: var(--bg-card-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px 40px 8px 16px;
  box-shadow: var(--shadow-md);
}

.ai-chat-history:empty + .ai-chat-input-wrapper,
.ai-chat-history:empty ~ .ai-chat-input-wrapper {
  position: relative;
  margin-top: 12px;
}


.right-sidebar-panel > .chat-module .ai-chat-history:empty {
  flex: 0 0 auto;
}

.right-sidebar-panel > .chat-module .ai-chat-history:empty ~ .ai-chat-input-wrapper {
  bottom: auto;
}

.ai-chat-input-wrapper:focus-within {
  border-color: var(--border-strong);
}


.chat-module [data-chat-input] {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: var(--sidebar-message-size);
  resize: none;
  height: 20px;
  max-height: 200px;
  outline: none;
  padding: 0;
  margin: 0;
  line-height: 20px;
  overflow-y: hidden;
}

.ai-chat-send-btn {
  position: absolute;
  right: 6px;
  bottom: 6px;
}




.ai-collapsible-trigger .row-actions {
  --row-action-size: 24px;
  --row-action-icon: 15px;
  display: inline-flex;
  margin-left: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) ease;
}

.ai-collapsible-trigger:focus-within .row-actions {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: hover) {
  .ai-collapsible-trigger:hover .row-actions {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (hover: hover) {
  .row-action:hover {
    background: var(--bg-control);
  }
}


.right-sidebar-panel > .chat-module .ai-chat-input-wrapper {
  bottom: calc(12px + var(--chat-below, 0px));
}

.right-sidebar-panel > .chat-module .ai-chat-scroll-bottom {
  bottom: calc(56px + var(--chat-below, 0px));
}

.chat-videos-mount {
  flex: 0 0 auto;
}


@media (max-width: 600px) {
  .right-sheet .right-sidebar-panel > .chat-module {
    height: auto;
    min-height: 0;
  }

  .right-sheet .right-sidebar-panel > .chat-module .ai-chat-history {
    flex: none;
    padding-bottom: 0;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .right-sheet .right-sidebar-panel > .chat-module .ai-chat-input-wrapper {
    position: sticky;
    bottom: calc(8px + var(--right-sidebar-foot-shown, 0px));
    margin-top: 12px;
  }

  .right-sheet .right-sidebar-panel > .chat-module .ai-chat-scroll-bottom {
    display: none;
  }
}

.chat-videos {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.chat-videos-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.chat-videos-head h4 {
  flex: 0 0 auto;
  margin: 0;
}


.chat-videos-add {
  min-width: 0;
}

.chat-videos-add span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.chat-videos .topic-videos-list {
  max-height: 220px;
  margin-bottom: 0;
  overflow-y: auto;
}


.topics-row-state.is-new {
  color: var(--pill-collection-text);
  border-color: var(--pill-collection-border);
}


.chat-topic-added-option {
  align-items: flex-start;
  color: var(--pill-collection-text);
}

.chat-topic-added-words {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.chat-topic-added-words small {
  color: var(--text-muted);
  font-size: var(--font-xs);
}

.chat-topic-added + .pill-popover-heading {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}


.chat-topic-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding: 10px 10px 4px;
  border-top: 1px solid var(--border);
  color: var(--text-main);
  font-size: var(--font-xs);
}


.being-made {
  
  margin-right: -16px;
  padding-top: 14px;
}

.being-made-words {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-sm);
  line-height: var(--leading-normal);
}


.being-made-spool {
  position: relative;
  overflow: hidden;
  margin-top: 17px;
  padding-bottom: calc(min(88%, 400px) + 31px);
}

.being-made-spool::after {
  content: '';
  position: absolute;
  top: 0;
  right: calc(min(88%, 400px) * -0.42);
  width: min(88%, 400px);
  aspect-ratio: 1;
  background: var(--page-reel) no-repeat center / 100%;
  opacity: 0.6;
  pointer-events: none;
  animation: reel-spin 1.6s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .being-made-spool::after {
    animation: none;
  }
}



.legal-page {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% -20%, var(--bg-hover), transparent 42rem),
    var(--bg-base);
}


.legal-page .markdown-document-rendered > h1:first-child,
.legal-page .markdown-document-rendered > div:first-child > h1:first-child {
  margin-top: 0;
}

.legal-page-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin-top: 28px;
  font-size: var(--font-sm);
}

.legal-page-links a {
  color: var(--text-muted);
  text-decoration: none;
}

@media (hover: hover) {
  .legal-page-links a:hover {
    color: var(--text-main);
  }
}



.landing {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 82% 6%, var(--bg-hover-strong), transparent 40rem),
    var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-brand);
  font-size: var(--font-md);
  
  overflow: clip;
  position: relative;
}

.landing-track {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}




.landing-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-bottom: 0;
  justify-content: space-between;
  gap: 16px;
  padding: 28px clamp(16px, 4vw, 48px);
}

.landing-brand {
  display: inline-flex;
  text-decoration: none;
}

.landing-brand .wordmark {
  font-size: 1.375rem;
}

.landing-nav {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 24px;
  font-size: 0.9375rem;
  
  white-space: nowrap;
}

.landing-sign-in {
  color: var(--text-body);
  text-decoration: none;
}


.landing-sign-in.is-checking {
  visibility: hidden;
}

@media (hover: hover) {
  .landing-sign-in:hover {
    color: var(--text-strong);
  }
}

.landing-cta {
  align-self: flex-start;
  padding: 15px 24px;
  border-radius: 10px;
  background: var(--landing-cta);
  color: var(--landing-cta-text);
  font-size: var(--font-md);
  font-weight: var(--font-weight-bold);
  text-decoration: none;
  transition: background var(--duration-fast) ease;
}

@media (hover: hover) {
  .landing-cta:hover {
    background: var(--landing-cta-hover);
  }
}

.landing-cta:focus-visible,
.landing-sign-in:focus-visible,
.landing-footer a:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

.landing-cta-small {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: inherit;
}


@media (max-width: 480px) {
  .landing-header {
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 16px;
  }

  .landing-brand .wordmark {
    font-size: 1.125rem;
  }

  .landing-nav {
    gap: 14px;
    font-size: 0.875rem;
  }

  .landing-cta-small {
    padding: 8px 12px;
  }
}

@media (max-width: 360px) {
  .landing-brand .wordmark {
    font-size: 1rem;
  }

  .landing-nav {
    gap: 10px;
  }

  .landing-cta-small {
    padding: 8px 10px;
  }
}



.landing-thread {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  color: var(--accent-light);
  pointer-events: none;
}

.landing-wheel-face {
  fill: var(--bg-base);
}


.landing-edge-reel {
  position: fixed;
  top: 170px;
  right: -250px;
  color: var(--accent-light);
  opacity: 0.55;
  pointer-events: none;
}



.landing-section {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 48px 72px;
  padding: 72px clamp(16px, 4vw, 48px);
}

.landing-text {
  position: relative;
  display: flex;
  flex: 1 1 360px;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  max-width: 540px;
  border-radius: 28px;
  background: var(--bg-glass);
  box-shadow: 0 0 44px 30px var(--bg-glass);
}

.landing-title {
  color: var(--text-strong);
  font-size: clamp(44px, 5.6vw, 80px);
  font-weight: 300;
  line-height: 1.03;
  letter-spacing: -0.035em;
}

.landing-title strong,
.landing-closer strong {
  font-weight: var(--font-weight-bold);
}

.landing-lede {
  max-width: 26ch;
  color: var(--accent-light);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: var(--font-weight-medium);
  line-height: 1.35;
}

.landing-heading {
  color: var(--text-strong);
  font-size: clamp(32px, 3.6vw, 48px);
  font-weight: var(--font-weight-bold);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.landing-body {
  max-width: 46ch;
  color: var(--text-body);
  font-size: 1.125rem;
  line-height: var(--leading-relaxed);
}

.landing-hero-text {
  flex: 0 1 auto;
  gap: 30px;
  max-width: 620px;
}

.landing-hero-text .landing-body,
.landing-section-topics .landing-body {
  max-width: 52ch;
}

.landing-hero-text .landing-cta {
  margin-top: 6px;
}

.landing-section-closer {
  display: block;
  padding-top: 160px;
}

.landing-closer-text {
  gap: 36px;
  max-width: 600px;
}

.landing-closer {
  color: var(--text-strong);
  font-size: clamp(34px, 4.4vw, 60px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.03em;
}




.landing-chat {
  flex: 1 1 400px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-sidebar);
  font-family: var(--font-sans);
  font-size: var(--font-base);
}

.landing-chat-tabs {
  display: flex;
  gap: 28px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}

.landing-chat-tabs span {
  padding: 14px 0;
  color: var(--text-muted);
}

.landing-chat-tabs .is-current {
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-light);
  color: var(--text-strong);
}

.landing-chat-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}

.landing-chat-question {
  align-self: flex-end;
  max-width: 86%;
  padding: 11px 15px;
  border-radius: 14px 14px var(--radius-xs) 14px;
  background: var(--bg-hover-strong);
  line-height: var(--leading-normal);
}

.landing-chat-answer {
  max-width: 94%;
  color: var(--text-body);
  line-height: 1.65;
}

.landing-chat-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
}

.landing-chat-sources li {
  padding: 4px 9px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--fill-subtle);
  color: var(--text-body);
  font-size: var(--font-xs);
}

.landing-chat-input {
  margin-top: 6px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-control);
  color: var(--text-muted);
}


.landing-playlists {
  display: flex;
  flex: 1 1 360px;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-width: 420px;
  padding: 20px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-sidebar);
  font-family: var(--font-sans);
}

.landing-playlists-title {
  padding: 0 8px 8px;
  color: var(--text-strong);
  font-size: 0.9375rem;
  font-weight: var(--font-weight-semibold);
}

.landing-playlists-label {
  padding: 4px 8px 6px;
  color: var(--text-muted);
  font-size: var(--font-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.landing-playlists-list + .landing-playlists-label {
  padding-top: 16px;
}

.landing-playlists-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
}

.landing-playlists-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 8px;
  font-size: 0.9375rem;
}

.landing-chevron {
  flex: none;
  width: var(--icon-sm);
  height: var(--icon-sm);
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.6;
}

.landing-count {
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  background: var(--fill-soft);
  color: var(--text-muted);
  font-size: var(--font-xs);
}

.landing-synced {
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-radius: var(--radius-round);
  background: var(--status-green);
  box-shadow: 0 0 0 4px var(--success-ring);
}

.landing-playlists-video {
  padding: 6px 8px 6px 34px;
  color: var(--text-soft);
  font-size: 0.84375rem;
}

.landing-playlists-video.is-new {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-strong);
}

.landing-playlists-video.is-new > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.landing-new {
  flex: none;
  padding: 2px 8px;
  border: 1px solid var(--pill-collection-border);
  border-radius: var(--radius-md);
  background: var(--success-bg);
  color: var(--success-text);
  font-size: var(--font-xs);
}


.landing-finder {
  flex: 1 1 440px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  background: var(--finder-window);
  box-shadow: var(--shadow-dialog);
  color: var(--finder-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  font-size: var(--font-sm);
}

.landing-finder-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--finder-bar-line);
  background: var(--finder-bar);
}

.landing-finder-lights {
  display: flex;
  gap: 8px;
}

.landing-finder-lights span {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-round);
  background: var(--finder-close);
}

.landing-finder-lights span:nth-child(2) {
  background: var(--finder-minimise);
}

.landing-finder-lights span:nth-child(3) {
  background: var(--finder-zoom);
}

.landing-finder-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: var(--font-weight-semibold);
}

.landing-finder-scroll {
  overflow-x: auto;
}

.landing-finder-table {
  width: 100%;
  min-width: 440px;
  border-collapse: collapse;
  table-layout: fixed;
}

.landing-finder-table th:nth-child(2),
.landing-finder-table td:nth-child(2) {
  width: 120px;
}

.landing-finder-table th:nth-child(3),
.landing-finder-table td:nth-child(3) {
  width: 100px;
}

.landing-finder-table th {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  color: var(--finder-text-muted);
  font-size: var(--font-2xs);
  font-weight: var(--font-weight-normal);
  text-align: left;
}

.landing-finder-table td {
  padding: 5px 0;
  color: var(--finder-text-muted);
  white-space: nowrap;
}

.landing-finder-table td:first-child {
  overflow: hidden;
  color: var(--finder-text);
  text-overflow: ellipsis;
}

.landing-finder-table th:first-child,
.landing-finder-table td:first-child {
  padding-left: 16px;
}

.landing-finder-table th:last-child,
.landing-finder-table td:last-child {
  padding-right: 16px;
}

.landing-finder-table tr.is-inside td:first-child {
  padding-left: 52px;
}

.landing-finder-table tbody tr:nth-child(even) {
  background: var(--fill-faint);
}

.landing-finder-table tbody tr:last-child td {
  padding-bottom: 10px;
}

.landing-finder svg {
  margin-right: 6px;
  vertical-align: -2px;
}

.landing-finder-name svg {
  margin-right: 0;
}

.landing-disclosure {
  width: 8px;
  height: 8px;
  fill: var(--finder-text-muted);
  vertical-align: 0;
}

.landing-folder {
  width: 16px;
  height: 13px;
  fill: var(--finder-folder-back);
}

.landing-folder-front {
  fill: var(--finder-folder);
}

.landing-file {
  width: 12px;
  height: 15px;
  fill: var(--finder-file);
}

.landing-file-fold {
  fill: var(--finder-file-fold);
}


.landing-topics {
  flex: 1 1 400px;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 14px;
  max-width: 560px;
  list-style: none;
}

.landing-topic {
  padding: 13px 24px;
  border: 1.5px solid;
  border-radius: var(--radius-pill);
  color: var(--text-strong);
  font-size: 1.125rem;
  font-weight: var(--font-weight-medium);
}

.landing-topic-category {
  border-color: var(--tag-category);
  background: var(--landing-topic-category-bg);
}

.landing-topic-subject {
  border-color: var(--tag-subject);
  background: var(--landing-topic-subject-bg);
}

.landing-topic-entity {
  border-color: var(--tag-entity);
  background: var(--landing-topic-entity-bg);
}

.landing-topic-work {
  border: 1.5px dashed var(--landing-topic-work-border);
  background: var(--landing-topic-work-bg);
  color: var(--success-text);
}



.landing-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 28px clamp(16px, 4vw, 48px) 44px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--font-base);
}

.landing-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.landing-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

@media (hover: hover) {
  .landing-footer a:hover {
    color: var(--text-main);
  }
}



@media (min-width: 1240px) {
  .landing-thread {
    display: block;
  }

  .landing-edge-reel {
    display: none;
  }

  .landing-section {
    flex-wrap: nowrap;
    padding: 0 72px;
  }

  .landing-section-hero {
    align-items: flex-start;
    height: 800px;
    padding-top: 100px;
  }

  .landing-section-ask { height: 640px; }
  .landing-section-sync { height: 760px; }
  .landing-section-folders { height: 720px; }
  .landing-section-topics { height: 560px; }

  .landing-section-closer {
    height: 560px;
    padding-top: 160px;
  }
}


@keyframes landing-unroll {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}

@keyframes landing-turn {
  from { transform: rotate(0deg); }
  to { transform: rotate(1080deg); }
}

@keyframes landing-turn-back {
  from { transform: rotate(0deg); }
  to { transform: rotate(-1080deg); }
}

@keyframes landing-wind-on {
  from { opacity: 0; }
  to { opacity: 1; }
}

@supports (animation-timeline: view()) {
  @media (min-width: 1240px) and (max-height: 1600px) and (prefers-reduced-motion: no-preference) {
    .landing-thread-line {
      animation: landing-unroll 1ms linear both;
      animation-timeline: view(block 80% 19%);
    }

    .landing-spin {
      transform-box: fill-box;
      transform-origin: center;
      animation: landing-turn 1ms linear both;
      animation-timeline: scroll(nearest block);
    }

    .landing-spin-ccw {
      animation-name: landing-turn-back;
    }

    .landing-wind {
      animation: landing-wind-on 1ms linear both;
      animation-timeline: scroll(nearest block);
      animation-range: 78% 100%;
    }
  }
}



@media (max-width: 600px) {
  :root {
    
    --sheet-pill-top: calc(env(safe-area-inset-top, 0px) + var(--phone-bar-middle) - (var(--mobile-top-mask-height) - 4px) / 2);
    
    --sheet-pill-button: var(--sidebar-toggle-mobile-size);
    --sheet-pill-middle: calc((var(--mobile-top-mask-height) - 4px) / 2);
    --sheet-pill-pad: calc(var(--sheet-pill-middle) - var(--sheet-pill-button) / 2);
    
    --sheet-pill-step: 36px;
    --sheet-pill-row: 36px;
    --sheet-pill-line-top: calc(var(--sheet-pill-middle) + var(--sheet-pill-step) - var(--sheet-pill-row) / 2);
    --sheet-pill-height: calc(2 * var(--sheet-pill-middle) + var(--sheet-pill-step));
    --sheet-pill-inset: 8px;
    
    --sheet-pill-ink: calc((var(--sheet-pill-button) - 20px) / 2 + 2.5px);
    --sheet-pill-bottom: calc(var(--sheet-pill-top) + var(--sheet-pill-height));
    
    --sheet-pill-room: calc(var(--sheet-pill-bottom) + 8px);
  }

  .left-sheet .sidebar-topbar,
  .right-sheet .right-sidebar-brandbar {
    position: fixed;
    top: var(--sheet-pill-top);
    right: var(--sheet-pill-inset);
    left: var(--sheet-pill-inset);
    z-index: var(--layer-sheet-pill);
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    height: var(--sheet-pill-height);
    min-height: 0;
    margin: 0;
    
    padding: calc(var(--sheet-pill-pad) - 1px)
      calc(var(--phone-bar-button-right) - var(--sheet-pill-inset) - 1px)
      0
      calc(var(--phone-bar-button-left) - var(--sheet-pill-inset) - 1px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    backdrop-filter: blur(6px) saturate(1.4);
    -webkit-backdrop-filter: blur(6px) saturate(1.4);
  }

  
  .left-sheet .sidebar-topbar .icon-btn,
  .right-sheet .right-sidebar-brandbar .icon-btn {
    --icon-btn-size: var(--sidebar-toggle-mobile-size);
    flex: 0 0 auto;
  }

  
  .left-sheet .sidebar-topbar .sidebar-brand,
  .right-sheet .right-sidebar-brandbar .sidebar-brand {
    height: var(--sheet-pill-button);
    min-height: 0;
    padding: 0;
  }

  .left-sheet .sidebar-topbar .sidebar-brand {
    margin-right: var(--sheet-pill-ink);
  }

  .right-sheet .right-sidebar-brandbar .sidebar-brand {
    margin-left: var(--sheet-pill-ink);
  }

  
  .right-sheet .right-sidebar-brandbar .sidebar-brand.is-away {
    margin-left: calc(var(--sheet-pill-ink) - 4px);
  }

  
  .left-sheet .sidebar .sidebar-tool-tabs,
  .left-sheet .sidebar[data-view="settings"] [data-account-surface="sidebar"],
  .right-sheet .right-sidebar-title {
    position: fixed;
    top: calc(var(--sheet-pill-top) + var(--sheet-pill-line-top));
    right: calc(var(--phone-bar-button-right) + var(--sheet-pill-ink));
    left: calc(var(--phone-bar-button-left) + var(--sheet-pill-ink));
    z-index: var(--layer-sheet-pill-line);
    box-sizing: border-box;
    height: var(--sheet-pill-row);
    min-height: 0;
    margin: 0;
    padding: 0;
    font-size: var(--font-md);
  }

  
  .right-sheet .right-sidebar-title {
    padding-right: 16px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    color: var(--text-strong);
    font-weight: var(--font-weight-semibold);
    line-height: var(--sheet-pill-row);
    white-space: nowrap;
    mask-image: linear-gradient(to right, black calc(100% - 16px), transparent);
  }

  .right-sheet .right-sidebar-title::-webkit-scrollbar {
    display: none;
  }

  .right-sheet .right-sidebar-title.is-swiped {
    mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
  }

  .right-sheet .right-sidebar-title {
    cursor: pointer;
  }

  
  .left-sheet .sidebar .sidebar-tool-tabs {
    display: flex;
    align-items: stretch;
    gap: 24px;
    border-bottom: 0;
  }

  .left-sheet .sidebar .sidebar-tool-tabs .tab {
    display: flex;
    align-items: center;
    min-height: 0;
    padding: 0;
    border-top: 2px solid transparent;
    font-size: var(--font-md);
    line-height: 1;
  }

  
  .left-sheet .sidebar[data-view="settings"] [data-account-surface="sidebar"] {
    display: flex;
    align-items: center;
  }

  .left-sheet .sidebar[data-view="settings"] [data-account-surface="sidebar"] > * {
    flex: 1;
    min-width: 0;
    gap: 10px;
  }

  .left-sheet .sidebar[data-view="settings"] [data-account-surface="sidebar"] .sidebar-account-link {
    gap: 10px;
    min-height: 0;
    height: var(--sheet-pill-row);
    padding: 0;
    border-radius: 0;
    background: none;
  }

  .left-sheet .sidebar[data-view="settings"] [data-account-surface="sidebar"] .account-avatar {
    width: 24px;
    height: 24px;
    font-size: var(--font-xs);
  }

  .left-sheet .sidebar[data-view="settings"] [data-account-surface="sidebar"] .sidebar-account-title {
    color: var(--text-strong);
    font-size: var(--font-md);
  }

  .left-sheet .sidebar[data-view="settings"] [data-account-surface="sidebar"] .sidebar-account-subtitle {
    display: none;
  }

  
  .left-sheet .sidebar[data-view="settings"] [data-account-surface="sidebar"] .sidebar-account-signout {
    --icon-btn-size: var(--sidebar-toggle-mobile-size);
    flex: 0 0 auto;
    margin-right: calc(-1 * var(--sheet-pill-ink));
  }

  
  body.left-sheet-sliding .sidebar-topbar,
  body.right-sheet-sliding .right-sidebar-brandbar {
    top: calc(var(--sheet-top, 0px) + var(--sheet-pill-top));
  }

  body.left-sheet-sliding .sidebar .sidebar-tool-tabs,
  body.left-sheet-sliding .sidebar[data-view="settings"] [data-account-surface="sidebar"],
  body.right-sheet-sliding .right-sidebar-title {
    top: calc(var(--sheet-top, 0px) + var(--sheet-pill-top) + var(--sheet-pill-line-top));
  }

  
  .right-sheet .right-sidebar-channel-row.has-provider {
    margin-right: 0;
  }
}





.row-actions-more {
  display: none;
}

@media (hover: none), (pointer: coarse) {
  
  :root {
    --control-xs: 44px;
    --control-sm: 44px;
    --control-md: 44px;
    --control-lg: 44px;
    --sidebar-toggle-mobile-size: 44px;
  }

  
  .row-actions,
  .ai-collapsible-trigger .row-actions {
    --row-action-size: 44px;
    --row-action-icon: 18px;
    display: inline-flex;
    opacity: 1;
    pointer-events: auto;
  }

  
  .row-actions > .row-action {
    --row-action-size: 44px;
    --row-action-icon: 18px;
    margin-block: -6px;
  }

  .row-actions-more {
    display: inline-flex;
  }

  
  .dashboard-playlist-row .row-actions:has([data-playlist-row-kind="youtube"]),
  .dashboard-playlist-row .row-actions:has([data-playlist-row-action="remove"]) {
    display: none;
  }

  .row-actions:has(> .row-actions-more) > .row-action:not(.row-actions-more) {
    display: none;
  }

  
  .dashboard-playlist-row .row-actions > .row-action[data-playlist-row-kind="collection"],
  .dashboard-playlist-row .row-actions:has(> [data-playlist-row-action="add-video"]) > .row-actions-more {
    display: none;
  }

  
  .dashboard-playlist-row .row-actions:has(> [data-playlist-row-action="add-video"]) {
    margin-right: calc((8px - 44px) / 2);
  }

  
  .sidebar:has(.sidebar-tool-tabs) .dashboard-playlist-row .row-actions > .row-action[data-playlist-row-action="add-video"] {
    display: inline-flex;
  }

  
  .row-actions-menu {
    display: flex;
    flex-direction: column;
    min-width: 200px;
  }

  .row-actions-menu .menu-item {
    min-height: 44px;
    font-size: var(--font-md);
  }

  .row-actions-menu .menu-item i,
  .row-actions-menu .menu-item svg {
    width: 18px;
    height: 18px;
  }

  
  .dashboard-playlist-row,
  .dashboard-sidebar-video-row,
  .sidebar-settings-link,
  .tab {
    min-height: 44px;
  }

  .sidebar-brand {
    min-height: 44px;
  }

  
  .dashboard-playlist-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    column-gap: 0;
    padding-left: 0;
  }

  .dashboard-playlist-row > .dashboard-playlist-chevron {
    width: 44px;
    height: 44px;
    margin: -6px 0;
  }

  .dashboard-playlist-row .dashboard-playlist-name-wrap {
    padding-right: 6px;
  }

  
  .tags-tree-row {
    height: 44px;
    padding-left: 0;
    font-size: var(--font-base);
  }

  .ai-collapsible-trigger,
  .custom-select-trigger {
    min-height: 44px;
  }

  .tags-tree-row > .tags-tree-fold {
    width: 44px;
    height: 44px;
    margin: -6px -8px -6px 0;
  }

  .tags-tree-fold svg {
    width: 17px;
    height: 17px;
  }

  
  .markdown-body em a[data-seek],
  .ai-timestamp-link {
    position: relative;
  }

  .markdown-body em a[data-seek]::after,
  .ai-timestamp-link::after {
    content: "";
    position: absolute;
    inset: -12px -6px;
  }

  
  input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="hidden"], [type="color"], [type="button"], [type="submit"]),
  select,
  textarea {
    font-size: 16px !important;
  }

  input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="hidden"], [type="color"], [type="button"], [type="submit"]),
  select {
    min-height: 44px;
  }

  .topics-new-button {
    --icon-btn-size: 44px;
  }

  
  .btn {
    min-height: 44px;
  }

  
  .switch input {
    inset: -12px -5px;
    width: auto;
    height: auto;
  }

  
  .asked-before-line {
    min-height: 44px;
  }

  
  .dashboard-sidebar-group-add {
    opacity: 1;
  }

  .dashboard-sidebar-group-add svg,
  .dashboard-sidebar-collapse-all svg {
    width: 18px;
    height: 18px;
  }

  
  .ai-chat-input-wrapper {
    align-items: center;
    min-height: 56px;
    padding: 6px 56px 6px 16px;
  }

  
  .asked-before-delete {
    width: 44px;
    height: 44px;
    margin-right: 0;
    opacity: 1;
  }

  .asked-before-delete i {
    width: 16px;
    height: 16px;
  }

  

  
  .video-card .tag-pill-remove,
  .video-card .tag-pill-add {
    display: none;
  }

  
  .video-card .card-provider-link {
    min-width: 44px;
    min-height: 44px;
    margin-top: -8px;
    margin-bottom: -8px;
  }

  
  .video-card .tag-pills:not(:has(> :not(.tag-pill-add))) {
    display: none;
  }

  .video-card .tag-pill-name {
    padding-right: 10px;
  }

  
  .tag-pills {
    --tag-pill-height: 36px;
    --tag-pill-gap: 8px;
  }

  .tag-pill,
  .tag-pill.is-more {
    font-size: var(--font-xs);
  }

  .tag-pill.is-more {
    min-width: 44px;
  }

  .tag-pill-add,
  .playlist-pill-add {
    width: 44px;
    height: 36px;
  }

  .playlist-pill {
    min-height: 36px;
    padding: 9px 12px;
  }

  .card-links a,
  .card-links span {
    min-height: 44px;
  }

  
  .status-badge.icon-only::after {
    content: "";
    position: absolute;
    inset: -8px;
  }
}

