/* Signal Architect Royal Institutional Visual System v1.1 — Uniformity Closure
   Loaded after royal-institutional-theme.css. TDBU remains the visual authority.
   This layer only harmonizes legacy presentation; it does not alter research logic. */

body.sa-royal-theme{
  --sa-royal-surface-0:#080b0d;
  --sa-royal-surface-1:#0d1215;
  --sa-royal-surface-2:#11171b;
  --sa-royal-surface-3:#151c20;
  --sa-royal-ink:#f3efe4;
  --sa-royal-copy:#c7c5bc;
  --sa-royal-muted-2:#8e8d87;
}

/* Force legacy workspace shells into the same institutional room language. */
body.sa-royal-theme :is(
  .workspace,.workspace-shell,.workspace-stage,.workspace-content,.workspace-panel,.workspace-card,
  .dashboard,.dashboard-shell,.dashboard-grid,.dashboard-panel,
  .content-shell,.content-panel,.content-card,.section,.section-panel,
  .research-shell,.research-panel,.research-card,.research-section,
  .il-shell,.il-entry,.il-workspace-stage,.ipe-shell,.lh-shell,.ar-shell,.ll-shell
){
  color:var(--sa-royal-copy)!important;
}

body.sa-royal-theme :is(
  .il-entry-header,.il-control-deck,.il-sidebar,.il-health-panel,.il-market-dna,.il-report-panel,.il-mtf-panel,.il-workspace,.il-combo-hero,
  .il-engine-cards article,.il-report-grid>div,.il-mtf-grid div,.il-detail-grid article,.il-combo-grid article,.il-explain-box,.il-linear-gauge,.il-flow-axis,.il-productivity-scale,.il-dimension-grid article,.il-saeo-triad article,.il-premium-card,
  .ipe-panel,.ipe-card,.ipe-grid article,.ipe-section,.ipe-status,.ipe-metric,
  .lh-panel,.lh-card,.lh-metric,.lh-tf,.lh-candidate,.lh-section,.lh-summary,.lh-result,
  .ar-panel,.ar-model-card,.ar-road-card,.ar-sequence-row,.ar-section,.ar-card,
  .ll-card,.ll-panel,.ll-section
){
  background:linear-gradient(145deg,rgba(17,23,27,.95),rgba(9,13,15,.98))!important;
  border-color:var(--sa-royal-line-soft)!important;
  box-shadow:none!important;
}

/* Sidebar, tab, and secondary navigation treatments. */
body.sa-royal-theme :is(.il-nav-btn,.ipe-nav-btn,.lh-tabs button,.ar-tab,.workspace-tab,.subtab,.sub-tab,.filter-btn){
  background:#0a0f11!important;
  border-color:var(--sa-royal-line-soft)!important;
  color:var(--sa-royal-copy)!important;
  box-shadow:none!important;
}
body.sa-royal-theme :is(.il-nav-btn,.ipe-nav-btn,.lh-tabs button,.ar-tab,.workspace-tab,.subtab,.sub-tab,.filter-btn):is(:hover,.active,[aria-selected="true"],[aria-current="page"]){
  background:linear-gradient(180deg,rgba(183,154,91,.15),rgba(183,154,91,.045))!important;
  border-color:var(--sa-royal-brass-2)!important;
  color:var(--sa-royal-ivory)!important;
  box-shadow:inset 3px 0 var(--sa-royal-brass)!important;
}

/* Remove remaining cyan/teal visual authority from specialist headings and labels. */
body.sa-royal-theme :is(
  .il-section-head span,.il-workspace-title strong,.il-explain-box strong,.il-timeline-event time,
  .ipe-kicker,.ipe-label,.ipe-title-accent,.lh-kicker,.lh-label,.ar-kicker,.ar-label,
  .section-label,.metric-label,.card-label,.panel-label
){color:var(--sa-royal-brass-2)!important}

body.sa-royal-theme :is(
  .il-entry-header p,.il-section-head em,.il-dna-row>span,.il-report-panel>p,.il-report-grid p,.il-detail-grid p,.il-explain-box p,.il-timeline-event p,
  .ipe-muted,.ipe-description,.lh-muted,.lh-footnote,.ar-muted,.ll-muted
){color:var(--sa-royal-muted)!important}

/* Data surfaces use charcoal and brass while semantic direction remains green/red. */
body.sa-royal-theme :is(.progress,.track,.meter,.bar-track,.il-dna-row>div,.il-linear-gauge>div,.il-dimension-grid div,.il-saeo-triad article>div){
  background:#171b1c!important;
}
body.sa-royal-theme :is(.il-dna-row i,.il-linear-gauge i,.il-dimension-grid i,.il-saeo-triad i){
  background:linear-gradient(90deg,var(--sa-royal-brass),var(--sa-royal-brass-2))!important;
}

/* Decorative glows become restrained institutional highlights. */
body.sa-royal-theme :is(.combo-card,.il-combo-hero,.recommended,.featured,.selected-card){
  border-color:var(--sa-royal-brass-2)!important;
  box-shadow:inset 0 0 0 1px rgba(210,189,134,.08)!important;
}
body.sa-royal-theme :is(.live-dot,.il-live-dot,.status-dot){
  background:var(--sa-royal-brass-2)!important;
  box-shadow:0 0 10px rgba(210,189,134,.32)!important;
}

/* General text hierarchy across older pages. */
body.sa-royal-theme :is(.subtitle,.description,.copy,.body-copy,.supporting-copy){color:var(--sa-royal-copy)!important}
body.sa-royal-theme :is(.label,.meta,.caption,.helper,.note){color:var(--sa-royal-muted)!important}

/* Keep financial state colors semantic, never decorative. */
body.sa-royal-theme :is(.bull,.bullish,.up,.positive,.gain,.confirmed,.success){color:var(--sa-royal-bull)!important}
body.sa-royal-theme :is(.bear,.bearish,.down,.negative,.loss,.failed,.error){color:var(--sa-royal-bear)!important}
body.sa-royal-theme :is(.neutral,.forming,.warning,.developmental){color:var(--sa-royal-warn)!important}

/* Scrollbars: subtle and consistent. */
body.sa-royal-theme{scrollbar-color:rgba(183,154,91,.55) #090d0f}
body.sa-royal-theme ::-webkit-scrollbar{width:10px;height:10px}
body.sa-royal-theme ::-webkit-scrollbar-track{background:#090d0f}
body.sa-royal-theme ::-webkit-scrollbar-thumb{background:rgba(183,154,91,.46);border:2px solid #090d0f;border-radius:8px}
