/* Analysis/catalogue adoption, never Ideas/library in the shared template. */
:is(.main:has(#competitorsIntroSection:not(.page-hidden)), body.catalog-workspace-page) {
  --analysis-edge: color-mix(in srgb, var(--sia-sidebar-active-line) 20%, var(--sia-line));
  --analysis-control-edge: color-mix(in srgb, var(--sia-sidebar-active-line) 35%, var(--sia-line));
  --analysis-control-fill: linear-gradient(color-mix(in srgb, var(--sia-surface) 65%, transparent), color-mix(in srgb, var(--sia-surface) 65%, transparent)), var(--sia-sidebar-active);
  --analysis-glow: inset 0 1px 0 rgba(121,215,210,.035), 0 0 12px rgba(67,189,184,.035);
}
.main:has(#competitorsIntroSection:not(.page-hidden)) :is(.comp-hub-hero, .comp-hub-filters-shell, .comp-hub-list, .comp-hub-presets, .comp-hub-tabs, .comp-hub-note, .channel-gate-card, .transcript-panel),
body.catalog-workspace-page :is(.opportunity-search, .filters, .niche-card, .cat-card, .channel-card, .drawer, .library-empty, .opportunity-result-card) {
  background: var(--sia-sidebar-bg) !important; border-color: var(--analysis-edge) !important; border-radius: 20px; box-shadow: var(--analysis-glow) !important;
}
.main:has(#competitorsIntroSection:not(.page-hidden)) .comp-hub-heading h1,
body.catalog-workspace-page .page-head h1 { font-size: clamp(32px, 3vw, 48px); line-height: 1.15; color: var(--sia-heading); }
.main:has(#competitorsIntroSection:not(.page-hidden)) .comp-hub-hero { padding: 24px; min-height: 0; }
.main:has(#competitorsIntroSection:not(.page-hidden)) .comp-hub-hero h3 { font-size: 24px; line-height: 1.3; }
.main:has(#competitorsIntroSection:not(.page-hidden)) .comp-hub-hero-icon { height: 64px; width: 64px; flex: 0 0 64px; }
.main:has(#competitorsIntroSection:not(.page-hidden)) :is(.comp-hub-hero-icon, .comp-hub-hero-art-chip, .comp-rank-pill),
body.catalog-workspace-page :is(.niche-save, .drawer-close) { background: var(--analysis-control-fill) !important; border: 1px solid var(--analysis-control-edge) !important; color: var(--sia-sidebar-accent); box-shadow: var(--analysis-glow) !important; }
.main:has(#competitorsIntroSection:not(.page-hidden)) .comp-hub-hero-art { opacity: .4; }
.main:has(#competitorsIntroSection:not(.page-hidden)) :is(.comp-hub-heading p, .comp-hub-hero p, .comp-hub-note, .channel-gate-copy p),
body.catalog-workspace-page :is(.page-head p, .niche-desc, .drawer-lead, .block p, .channel-summary, .opportunity-search-subtitle) { color: var(--sia-muted); font-size: 15px; line-height: 1.6; }
.main:has(#competitorsIntroSection:not(.page-hidden)) :is(.comp-hub-tab, .comp-table-row, .comp-hub-table-head) { background: transparent !important; border-color: var(--analysis-edge) !important; }
.main:has(#competitorsIntroSection:not(.page-hidden)) .comp-hub-table-head { background: var(--sia-surface-soft) !important; }
.main:has(#competitorsIntroSection:not(.page-hidden)) .comp-table-row:hover { background: var(--analysis-control-fill) !important; }
.main:has(#competitorsIntroSection:not(.page-hidden)) :is(.comp-video-title, .comp-channel-name) { font-size: 15px; color: var(--sia-heading); line-height: 1.45; }
.main:has(#competitorsIntroSection:not(.page-hidden)) :is(.comp-channel-subs, .comp-hub-refresh-meta, .refresh-meta-inline, .comp-hub-table-head, .comp-duration) { font-size: 12px; }
.main:has(#competitorsIntroSection:not(.page-hidden)) :is(.comp-col-views, .comp-growth-value) { font-size: 22px; }
.main:has(#competitorsIntroSection:not(.page-hidden)) .comp-growth-value.down { color: var(--sia-danger); }
.main:has(#competitorsIntroSection:not(.page-hidden)) :is(.comp-hub-tab, .preset-btn, .comp-hub-clear-filters) { font-size: 14px; min-height: 44px; }
.main:has(#competitorsIntroSection:not(.page-hidden)) :is(.comp-hub-tab.active, .preset-btn.active),
body.catalog-workspace-page :is(.view-tab.active, .cat-card.active, .filter-select-option.is-selected) { background: var(--sia-sidebar-active) !important; border-color: var(--sia-sidebar-active-line) !important; color: var(--sia-sidebar-accent) !important; }
.main:has(#competitorsIntroSection:not(.page-hidden)) :is(.comp-hub-refresh, .channel-gate-button),
body.catalog-workspace-page :is(.btn-primary, .opportunity-search-submit, .btn-add-channel) { background: var(--sia-teal-dark) !important; border-color: var(--analysis-control-edge) !important; color: #fff !important; border-radius: 14px; font-size: 15px; min-height: 48px; box-shadow: var(--analysis-glow) !important; }
html[data-theme="dark"] .main:has(#competitorsIntroSection:not(.page-hidden)) :is(.comp-hub-refresh, .channel-gate-button),
html[data-theme="dark"] body.catalog-workspace-page :is(.btn-primary, .opportunity-search-submit, .btn-add-channel) { color: var(--sia-bg) !important; }
.main:has(#competitorsIntroSection:not(.page-hidden)) :is(input, select),
body.catalog-workspace-page :is(.search-input, .opportunity-search-input, .filter-select-trigger, .filter-select-menu) { background: var(--sia-surface) !important; border-color: var(--analysis-control-edge) !important; color: var(--sia-text); font-size: 15px; border-radius: 14px; min-height: 48px; }
body.catalog-workspace-page .opportunity-search { padding: 32px 24px; }
body.catalog-workspace-page .opportunity-search-title { font-size: clamp(24px, 2.5vw, 32px); line-height: 1.3; }
body.catalog-workspace-page :is(.opportunity-pro-lock, .plan-hint, .view-tabs, .summary-card) { background: var(--analysis-control-fill) !important; border-color: var(--analysis-edge) !important; box-shadow: none !important; }
body.catalog-workspace-page :is(.opportunity-example, .view-tab, .filter-select-option, .btn, .load-more-btn, .channel-add-btn) { min-height: 44px; font-size: 14px; border-color: var(--analysis-control-edge); }
body.catalog-workspace-page :is(.niche-save, .drawer-close) { height: 44px; width: 44px; flex: 0 0 44px; }
body.catalog-workspace-page .niche-save.is-saved { color: var(--sia-sidebar-accent); border-color: var(--sia-sidebar-active-line) !important; }
body.catalog-workspace-page .niche-card h3 { font-size: 18px; line-height: 1.4; }
body.catalog-workspace-page .niches-col-list .niche-card { display: block; padding: 18px; }
body.catalog-workspace-page .niches-col-list .channel-list-thumb { width: 64px; height: 64px; min-height: 64px; padding: 0; margin-bottom: 14px; }
body.catalog-workspace-page .niches-col-list .channel-list-thumb img { height: 100%; width: 100%; }
body.catalog-workspace-page .cat-card h3 { font-size: 18px; }
body.catalog-workspace-page .cat-card p { color: var(--sia-muted); font-size: 15px; line-height: 1.55; }
body.catalog-workspace-page .cat-enter { font-size: 14px; min-height: 44px; }
body.catalog-workspace-page .niches-col-list .niche-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
body.catalog-workspace-page :is(.niche-stat-label, .channel-stat-label, .meta, .channel-video-meta, .updated, .summary-label, .pill) { font-size: 12px; line-height: 1.45; }
body.catalog-workspace-page :is(.niche-stat-value, .channel-stat-value) { color: var(--sia-heading); font-size: 15px; }
body.catalog-workspace-page .section-head h2 { font-size: 24px; }
body.catalog-workspace-page .niches-col-head h3 { font-size: 18px; }
body.catalog-workspace-page .niche-thumb { background: var(--sia-surface-soft); }
body.catalog-workspace-page :is(.niche-body, .channel-title, .channel-stat, .block, .channel-video > div) { min-width: 0; overflow-wrap: anywhere; }
body.catalog-workspace-page .drawer { border-radius: 24px 0 0 24px; }
body.catalog-workspace-page .drawer-head { background: transparent !important; border-color: var(--analysis-edge); gap: 16px; }
body.catalog-workspace-page .drawer-head h2 { font-size: 24px; line-height: 1.3; }
body.catalog-workspace-page :is(.drawer-body, .channel-catalog-head) h3 { font-size: 18px; }
body.catalog-workspace-page .summary-card { border-radius: 14px; }
body.catalog-workspace-page .channel-card { box-shadow: none !important; }
body.catalog-workspace-page .channel-stat { background: var(--sia-surface) !important; border-color: var(--analysis-edge); }
body.catalog-workspace-page .drawer :is(.block, .channel-stats, .channel-note, .channel-videos) { border-color: var(--analysis-edge); }
:is(.main:has(#competitorsIntroSection:not(.page-hidden)), body.catalog-workspace-page) :is(button, a, input, select):focus-visible { outline: 2px solid var(--sia-sidebar-accent); outline-offset: 3px; }
@media(max-width: 1200px) {
  body.catalog-workspace-page .niches-columns { grid-template-columns: minmax(0, 1fr); }
}
@media(max-width: 900px) {
  body:has(#competitorsIntroSection:not(.page-hidden)) .brand, body.catalog-workspace-page .brand { width: 100%; box-sizing: border-box; padding-right: 60px !important; }
  body:has(#competitorsIntroSection:not(.page-hidden)) .brand-name, body.catalog-workspace-page .brand-name { font-size: clamp(1.3rem, 6.65vw, 1.62rem) !important; }
  body:has(#competitorsIntroSection:not(.page-hidden)) .floating-theme-toggle, body.catalog-workspace-page .floating-theme-toggle { top: 17px; right: 16px; bottom: auto; z-index: 41; }
  body.catalog-workspace-page:has(.drawer.is-open) .floating-theme-toggle { display: none !important; }
}
@media(max-width: 600px) {
  .main:has(#competitorsIntroSection:not(.page-hidden)) .comp-hub-hero { padding: 20px; }
  .main:has(#competitorsIntroSection:not(.page-hidden)) .comp-hub-hero h3 { font-size: 22px; }
  body.catalog-workspace-page .opportunity-search { padding: 24px 18px; }
  body.catalog-workspace-page .drawer { border-radius: 0; }
  body.catalog-workspace-page .niche-card { padding: 18px; gap: 16px; }
  body.catalog-workspace-page .niche-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
