/* Empirical Markets unified terminal shell
   Chart Studio is the design authority. Scoped em-* selectors deliberately avoid
   colliding with Bootstrap, historical dashboard styles, and chart-studio.js. */
:root {
  --em-bg:#010516; --em-nav:#050919; --em-panel:#090c1a;
  --em-panel-2:#10152b; --em-border:#2c2f56; --em-faint:#7c88b7;
  --em-muted:#a0a0d0; --em-text:#d0d0ff; --em-accent:#77bbff;
  --em-positive:#00cc99; --em-negative:#ff7878;
  --em-font:'DM Sans',sans-serif; --em-mono:'IBM Plex Mono',monospace;
}
.em-terminal-page { background:var(--em-bg);color:var(--em-text);font-family:var(--em-font);margin:0;min-height:100vh; }
.em-terminal-page a {text-decoration:none;}
.em-terminal-page *, .em-terminal-page *::before, .em-terminal-page *::after {box-sizing:border-box;}
.em-shell {display:flex;align-items:stretch;min-height:100vh;}
.em-sidebar {width:239px;min-width:239px;flex:none;min-height:100vh;background:var(--em-nav);border-right:1px solid #262846;padding:27px 16px 17px;display:flex;flex-direction:column;align-self:stretch;z-index:30;}
.em-sidebar-brand-row {display:flex;justify-content:space-between;align-items:center;gap:8px;}
.em-brand {display:inline-flex;align-items:center;gap:9px;color:#f1f4ff!important;text-decoration:none!important;white-space:nowrap;}
.em-brand-symbol {font-size:33px;line-height:1;color:var(--em-accent);font-family:var(--em-font);}
.em-brand-type {font-size:12px;letter-spacing:1.04px;font-weight:700;color:#e0e7ff;}
.em-brand-type span {font-weight:400;color:#b6c0e5;}
.em-sidebar-version {font:9px var(--em-mono);margin:7px 0 0 40px;letter-spacing:.65px;color:var(--em-accent);white-space:nowrap;}
.em-sidebar-version span {color:#7d88b7;letter-spacing:0;}
.em-sidebar-rule {margin:24px 4px 20px;height:1px;background:#282d4b;flex:none;}
.em-sidebar-group-label {font:10px var(--em-mono);color:#7784b3;letter-spacing:1.3px;margin:0 12px 10px;}
.em-sidebar-nav {display:flex;flex-direction:column;gap:3px;}
.em-sidebar-link {width:100%;min-height:40px;border:1px solid transparent;background:transparent;color:#afb9e5!important;display:flex;align-items:center;gap:11px;text-align:left;font:600 12px var(--em-font);border-radius:6px;padding:10px 11px;text-decoration:none!important;cursor:pointer;transition:background .15s,border-color .15s,color .15s;}
.em-sidebar-link:hover {background:#111830;color:#f3f6ff!important;}
.em-sidebar-link.active,.em-sidebar-link[aria-current="page"] {background:#181c3c;border-color:#454b84;color:#eaf0ff!important;}
.em-nav-icon {font:21px/1 var(--em-font);width:22px;color:var(--em-accent);text-align:center;flex:none;}
.em-nav-arrow {margin-left:auto;font:12px var(--em-mono);color:#64729f;}
.em-nav-count {margin-left:auto;background:#303559;padding:2px 7px;border-radius:4px;font:10px var(--em-mono);color:#e2e7ff;}
.em-sidebar-utility {margin-top:auto;padding-top:10px;}
.em-sidebar-utility > .em-sidebar-rule {margin-top:15px;}
.em-plan-card {background:linear-gradient(135deg,#151932,#0b1025);border:1px solid #343960;border-radius:9px;padding:15px;margin-top:17px;}
.em-plan-eyebrow {font:10px var(--em-mono);color:var(--em-accent);letter-spacing:.6px;margin-bottom:7px;}
.em-plan-copy {color:#9da8d6;font-size:11px;line-height:1.5;}
.em-plan-card a {display:flex;justify-content:space-between;margin-top:14px;font-size:11px;color:var(--em-accent)!important;text-decoration:none;}
.em-saved-rail {max-height:25vh;overflow:auto;}
.em-saved-rail .small {padding:0 10px;line-height:1.5;}
.em-sidebar-close,.em-mobile-scrim,.em-hamburger {display:none;}
/* Top bar and research overview */
.em-main {flex:1;min-width:0;width:0;max-width:1800px;margin:0 auto;padding:0 36px 50px;}
.em-topbar {min-height:71px;border-bottom:1px solid #292b4b;display:flex;align-items:center;justify-content:space-between;gap:12px;}
.em-crumb {font:11px var(--em-font);color:#8e99c4;display:flex;align-items:center;gap:11px;flex-wrap:wrap;}
.em-crumb span.sep {color:#50547b;}
.em-crumb strong {font-weight:600;color:#d0dbff;}
.em-top-actions {display:flex;align-items:center;gap:11px;flex-shrink:0;}
.em-top-actions #feedStatus {text-transform:uppercase;}

.em-date-chip {font:10px var(--em-mono);color:#97a6d2;white-space:nowrap;}
.status-dot {display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--em-positive);box-shadow:0 0 13px #00cc996e;}

.em-outline,.em-primary {display:inline-flex;align-items:center;justify-content:center;gap:9px;border-radius:5px;font:700 11px var(--em-font);padding:11px 13px;white-space:nowrap;text-decoration:none!important;cursor:pointer;}
.em-outline {background:#141830;border:1px solid #3d436f;color:#d1d8ff!important;}
.em-primary {background:linear-gradient(100deg,#5b68e1,#7a80c8);border:1px solid #7a80c8;color:#fff!important;}
.em-outline:hover,.em-primary:hover {filter:brightness(1.16);}
.em-outline.em-logout {border-color:#7a3a4a;color:#ffb3b3!important;}
.em-outline.em-logout:hover {border-color:var(--em-negative);background:#2a1420;color:#fff!important;filter:none;}

.em-masthead {display:flex;align-items:end;justify-content:space-between;gap:22px;padding:38px 0 28px;}
.em-kicker {font:10px var(--em-mono);color:var(--em-accent);letter-spacing:1.3px;text-transform:uppercase;}
.em-masthead h1 {font-size:42px;line-height:1.08;letter-spacing:-2px;font-weight:600;color:#e8ecff;margin:12px 0 8px;}
.em-masthead h1 span {color:var(--em-accent);}
.em-masthead p {margin:0;color:var(--em-muted);font-size:14px;}
.em-masthead-aside {text-align:right;flex:none;}
.em-masthead-aside span {display:block;color:#8290b9;font:9px var(--em-mono);letter-spacing:.5px;}
.em-masthead-aside strong {display:block;color:#d4dcfd;margin-top:8px;font:19px var(--em-mono);}
.em-section {display:none;animation:em-appear .18s ease-out;}
.em-section.is-active {display:block;}
@keyframes em-appear {from {opacity:.8;transform:translateY(5px)} to {opacity:1;transform:translateY(0)}}
.em-section-intro {display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin:0 0 19px;}
.em-section-intro h2 {font-size:19px;letter-spacing:-.4px;margin:7px 0 4px;font-weight:600;color:#e8edff;}
.em-section-intro p {font-size:12px;margin:0;color:#9aa7d4;max-width:650px;line-height:1.7;}
.em-surface {border:1px solid var(--em-border);background:var(--em-panel);border-radius:9px;min-width:0;}
.em-welcome {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:24px;align-items:center;padding:24px 27px;margin-bottom:22px;background:linear-gradient(110deg,#101836 0%,#0b1128 57%,#090c1a 100%);position:relative;overflow:hidden;}
.em-welcome::before {content:"";position:absolute;right:10%;top:-80px;width:230px;height:230px;border-radius:50%;background:#3a60bb15;filter:blur(12px);pointer-events:none;}
.em-welcome > * {position:relative;}
.em-welcome h2 {font-size:20px;font-weight:600;color:#e6ecff;letter-spacing:-.55px;margin:9px 0 8px;}
.em-welcome p {font-size:12px;color:#9ba8d2;max-width:560px;line-height:1.7;margin:0;}
.em-welcome-links {display:flex;align-items:center;gap:9px;flex-wrap:wrap;}
/* .em-overview-grid {display:grid;grid-template-columns:minmax(0,1.48fr) minmax(310px,1fr);gap:19px;align-items:start;}
.em-overview-column {min-width:0;}
.em-overview-column > * + * {margin-top:18px;} */
.em-overview-grid {display:grid;grid-template-columns:minmax(0,1.48fr) minmax(310px,1fr);gap:19px;align-items:stretch;}
.em-overview-column {min-width:0;display:flex;flex-direction:column;gap:18px;}
/* Last panel in each column absorbs the height difference so bottoms align. */
.em-overview-column > :last-child {flex:1 1 auto;display:flex;flex-direction:column;}
.em-overview-column > :last-child > .card-section {flex:1 1 auto;}
/* */
.em-panel-shell {border:1px solid #2c2f56;background:#090c1a;border-radius:9px;padding:21px;min-width:0;}
.em-panel-shell > .em-section-intro {margin-bottom:16px;}
.em-panel-shell .card-section {margin:0!important;}
.em-tool-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;}
.em-tool-card {min-height:110px;display:flex;flex-direction:column;align-items:flex-start;gap:9px;padding:16px 14px;border-radius:7px;border:1px solid #363c66;background:#11162d;color:#dce6ff!important;text-decoration:none!important;transition:border-color .15s,transform .15s,background .15s;}
.em-tool-card:hover {border-color:#727eb7;transform:translateY(-2px);background:#161e3d;}
.em-tool-card .em-tool-icon {font-size:23px;line-height:1;color:#8bbcff;}
.em-tool-card strong {font-size:12px;color:#e5eaff;}
.em-tool-card small {font-size:10px;color:#8999c4;line-height:1.4;}
/* new */
.em-overview-wide {margin-top:19px;}
.em-cross-asset-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}
.em-notable-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:8px;}
.em-movers-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
.em-movers-grid .brief-mover-tile {cursor:pointer;}
.brief-asof {font-size:.7rem;color:#4a5a7a;letter-spacing:.04em;font-variant-numeric:tabular-nums;}
@media (max-width:560px){.em-movers-grid{grid-template-columns:1fr;}}
/* end of new */
.em-panel-footer {display:flex;justify-content:flex-end;margin-top:16px;border-top:1px solid #242944;padding-top:13px;}
.em-text-link {font-size:11px;color:var(--em-accent)!important;text-decoration:none!important;}
.em-research-body {padding:24px;min-height:330px;}
.em-research-body .card-section {max-width:none;}
.em-loading {padding:50px 20px;text-align:center;color:#879ac9;font:12px var(--em-mono);}
.em-loading-spinner {display:block;width:25px;height:25px;border-radius:50%;border:2px solid #313962;border-top-color:#77bbff;animation:em-spin .8s linear infinite;margin:0 auto 15px;}
@keyframes em-spin {to{transform:rotate(360deg)}}
.em-error {background:#3a18213a;border:1px solid #6b3540;color:#ffb6c2;padding:16px;border-radius:6px;font-size:12px;line-height:1.6;}
.em-retry {background:#222b50;color:#e5eaff;border:1px solid #51629b;padding:7px 12px;border-radius:4px;margin-left:8px;cursor:pointer;}
.em-searchbox {display:flex;align-items:center;gap:8px;background:#12182e;border:1px solid #474d7e;border-radius:6px;padding:7px 8px 7px 13px;min-width:230px;max-width:390px;}
.em-searchbox span {font-size:20px;color:var(--em-accent);}
.em-searchbox input {border:0;outline:0;background:transparent;color:#fff;flex:1;min-width:0;font:12px var(--em-mono);}
.em-searchbox button {padding:7px 10px;background:#2a325b;border:1px solid #455381;color:#e3eaff;border-radius:4px;cursor:pointer;}
.em-footer {border-top:1px solid #292d4d;margin-top:34px;padding:19px 0 0;color:#7886b2;font:10px var(--em-mono);display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;}
/* Keep legacy panel styling working in the new shell. */
.em-terminal-page .card-section {background:#0b1021;color:#d0d0ff;border:1px solid #303458;border-radius:7px;}
.em-terminal-page .tab-pane {display:block;} /* Inner AI/Quant wrappers manage their own .tab-pane separately. */
.em-terminal-page #ai-panel-container .tab-pane,.em-terminal-page #quant-panel-container .tab-pane,.em-terminal-page #macro-panel-container .tab-pane {display:none;}
.em-terminal-page #ai-panel-container .tab-pane.active,.em-terminal-page #quant-panel-container .tab-pane.active,.em-terminal-page #macro-panel-container .tab-pane.active {display:block;}
.em-terminal-page .nav-link {cursor:pointer;}
.em-terminal-page .ai-tabs {justify-content:flex-start!important;}
.em-terminal-page #overview-risk-profile {scroll-margin-top:22px;}
.em-terminal-page .smc-stat-value {font-variant-numeric:tabular-nums;}
.em-terminal-page .em-panel-shell .card-section + .card-section {margin-top:14px!important;}
/* Chart Studio overrides: retain its chart geometry and DOM hooks. */
.studio .em-sidebar {padding:27px 16px 17px;}
.studio .em-sidebar .em-saved-rail {margin-top:4px;}
.studio .em-sidebar .saved-item {font-size:11px;}
.studio .em-sidebar .em-sidebar-link {font-size:12px;}
.studio .em-sidebar-utility {margin-top:auto;}
.studio .em-brand {font-family:var(--em-font);}
.studio .em-plan-card a {display:flex;}
.studio .workspace {min-width:0;}
@media(max-width:1250px) {
  .em-sidebar {width:218px;min-width:218px;}
  .em-main {padding:0 25px 42px;}
  .em-overview-grid {grid-template-columns:minmax(0,1.3fr) minmax(280px,1fr);}
}
@media(max-width:980px) {
  .em-sidebar {display:flex;position:fixed;left:0;top:0;bottom:0;min-height:0;height:100dvh;overflow-y:auto;width:259px;min-width:259px;max-width:85vw;transform:translateX(-110%);transition:transform .2s ease;box-shadow:18px 0 45px #0008;z-index:1000;}
  body.em-sidebar-open .em-sidebar {transform:translateX(0);}
  .em-mobile-scrim {position:fixed;inset:0;background:#010516c9;z-index:999;}
  body.em-sidebar-open .em-mobile-scrim {display:block;}
  .em-sidebar-close {display:block;border:0;background:transparent;color:#b4c2ed;font-size:25px;cursor:pointer;}
  .em-hamburger {display:inline-grid;place-items:center;border:1px solid #3b446f;background:#121831;color:#bdcbef;border-radius:5px;width:37px;height:37px;cursor:pointer;}
  .em-main {padding:0 22px 35px;}
  .em-overview-grid {grid-template-columns:1fr;}
  .em-overview-column.secondary {display:grid;grid-template-columns:1fr 1fr;gap:15px;}
  .em-overview-column.secondary > * + * {margin:0;}
}
@media(max-width:720px) {
  .em-topbar {min-height:64px;}
  .em-crumb .em-crumb-hide,.em-date-chip {display:none;}
  .em-masthead {padding:26px 0 23px;}
  .em-masthead h1 {font-size:34px;}
  .em-masthead-aside {display:none;}
  .em-welcome {grid-template-columns:1fr;padding:21px;}
  .em-overview-column.secondary {display:flex;flex-direction:column;}
  .em-panel-shell,.em-research-body {padding:16px;}
  .em-tool-grid {grid-template-columns:1fr 1fr;}
  .em-searchbox {min-width:0;max-width:100%;}
  .em-main {padding:0 13px 35px;}
  .em-crumb {gap:7px;font-size:10px;}
  /* .em-top-actions .em-outline {display:none;} */
  .em-top-actions {gap:6px;}
  .em-top-actions .em-outline {padding:8px 10px;font-size:10px;}
  .em-section-intro {align-items:start;flex-direction:column;}
}
@media(max-width:425px) {
  .em-tool-grid {grid-template-columns:1fr;}
  .em-top-actions .em-primary {padding:9px 10px;}
  .em-masthead h1 {font-size:30px;}
}
/* Chart-specific compact toolbar accommodations. */
@media(max-width:720px){
  .studio .topbar{gap:7px;}
  .studio .crumb{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;gap:6px;}
  .studio .top-actions{gap:5px;flex-shrink:0;}
}
