/* V4 dashboard surfaces, workspace hierarchy and responsive behavior. */
.ref {
  --ink: #e7f2ff; --subtle: #a5b8ce; --line: #28415a;
  --surface: #0c192a; --aqua: #6cf4e5; --danger: #ff8296;
  background: #070e19;
  color: var(--ink);
  font-size: clamp(13px, .87vw, 15px);
}
.ref .ref-shell { max-width: 1780px; padding-inline: clamp(12px, 2vw, 34px); }
.ref .ref-head { min-height: 100px; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); background-size: auto 100%; background-position: 69% center; }
.ref .ref-head h1 { font-size: clamp(27px, 2.45vw, 42px); line-height: 1.16; text-shadow: none; }
.ref .ref-brand img { width: clamp(120px, 15vw, 220px); margin-inline: 0 auto; }
.ref .ref-head strong { color: #90e7f0; font-size: clamp(12px, .95vw, 16px); }
.ref .ref-sidebrand { justify-self: end; }
.ref .ref-sidebrand b { background: #0d2332; border-color: #356374; }
.ref .ref-sidebrand p { color: var(--subtle); }
.ref .ref-nav { border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; padding: 5px 0; margin: 0; border-radius: 0; }
.ref .ref-nav a { position: relative; border-radius: 6px; padding: 9px 13px; white-space: nowrap; }
.ref .ref-nav .active { background: #142a39; color: var(--aqua); box-shadow: none; }
.ref .ref-nav .active::after { content: ''; position: absolute; inset: auto 13px 0; height: 2px; background: var(--aqua); }
.ref .ref-nav input { min-width: 9rem; background: #0d1d2c; border-color: #314a61; }
.ref .ref-workspace { margin-block: 16px; }
.ref .ref-overview {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(110deg, #10243a, #101c2c 60%);
  overflow: hidden;
}
.ref .ref-kpi { min-width: 0; padding: 12px clamp(9px, 1.1vw, 18px); border-inline-end: 1px solid var(--line); }
.ref .ref-kpi:last-child { border-inline-end: 0; }
.ref .ref-kpi small { display: block; color: #acc3d8; margin-bottom: 3px; }
.ref .ref-kpi strong { display: block; color: var(--ink); font-size: clamp(17px, 1.45vw, 26px); line-height: 1.36; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ref .ref-kpi strong.up { color: var(--aqua); }
.ref .ref-kpi strong.down { color: var(--danger); }
.ref .ref-status { margin: 6px 0 0; padding: 0 2px; background: transparent; min-height: 0; color: #dbb984; }
.ref .ref-grid, .ref .ref-stack { gap: clamp(11px, 1vw, 17px); }
.ref .ref-box { border-color: var(--line); background: var(--surface); border-radius: 13px; box-shadow: 0 9px 22px #0002; }
.ref .ref-box h2 { display: flex; align-items: center; gap: .55em; padding: 11px 13px; background: #101f32; border-color: #263d53; }
.ref .ref-box h2 span { color: #7ce9ef; margin: 0; }
.ref .ref-body { padding: clamp(9px, .95vw, 15px); }
.ref .ref-box tbody tr:hover { background: #162d43; }
.ref .ref-box th,.ref .ref-box td { border-color: #21364a; }
.ref .ref-box td[dir=ltr] { text-align: left; }
.ref .ref-instrument {
  border-color: #3c6176; background: radial-gradient(ellipse at 75% 0, #152e41, transparent 70%), #0b1828;
}
.ref .ref-instrument h2 { background: #102539; border-color: #34556a; }
.ref .ref-plot canvas { height: clamp(230px, 18vw, 354px); background: #071524; }
.ref .ref-plot canvas.mini-chart { height: clamp(155px, 11vw, 212px); }
.ref .ref-chart-head { display:flex; align-items: baseline; justify-content: flex-start; }
.ref .ref-chart-head [data-symbol-label] { color: #bbd4e5; font-size: 1.02em; letter-spacing: .045em; }
.ref .ref-chart-head [data-price] { color: #f0fbff; font-size: clamp(25px, 2.5vw, 42px); line-height: 1.22; }
.ref .ref-chart-head .ref-controls { margin-inline-start: auto; }
.ref .ref-chart-reading { color: #cfdfec; background: #14283a; padding: 6px 9px; }
.ref .ref-price-change { font-size: 1.04em; }
.ref .ref-chip { background: #13273a; border-color: #30475f; padding: 7px 6px; }
.ref .ref-chip small { color: var(--subtle); }
.ref .ref-scenario { background: #162d45; }
.ref .ref-scenario.up { background: #0a3337; }
.ref .ref-scenario.down { background: #352132; }
.ref .ref-scenario .scenario-line { height: 44px; margin-top: 7px; }
.ref .ref-alert { background: #191c2e; border-color: #73465b; }
.ref .ref-alert h2 { background: #281e30; }
.ref .ref-foot { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; margin-block: 18px 0; }
.ref .ref-focus {
  color: #c9e6f4; background: #142b40; border-color: #38617c;
  text-decoration: none; margin-inline-start: auto; font-size: .86em; white-space: nowrap;
}
.ref .ref-instrument:fullscreen { padding: 18px; width: 100%; height: 100%; overflow: auto; background: #071321; }
.ref .ref-instrument:fullscreen .ref-plot canvas,
.ref .ref-instrument:fullscreen #network canvas { height: min(68vh, 860px); }
.ref .ref-instrument:fullscreen .ref-scene { max-height: 72vh; width: auto; margin: auto; }
.ref .ref-instrument:fullscreen .ref-chart-head { margin-block: 14px; }
.ref .ref-collapse-btn { display: none; }
.ref .ref-strip { gap: 8px; }
@media (max-width: 1050px) {
  .ref .ref-chart-head .ref-controls { flex-basis: 100%; margin-inline-start: 0; }
  .ref .ref-head { background-position: 76% center; }
}
@media (max-width: 720px) {
  .ref .ref-shell { padding-inline: 9px; }
  .ref .ref-head { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 7px; background-position: right center; }
  .ref .ref-brand img { width: 108px; margin: auto; }
  .ref .ref-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ref .ref-kpi { padding: 7px 9px; }
  .ref .ref-kpi:nth-child(even) { border-inline-end: 0; }
  .ref .ref-kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .ref .ref-workspace { margin-block: 10px; }
  .ref .ref-instrument .ref-focus { font-size: .8em; min-height: 32px; }
  .ref .ref-plot .ref-chart { height: 234px; }
  .ref .ref-plot .mini-chart { height: 178px; }
  .ref .ref-chart-reading { font-size: .85em; }
}

.ref .ref-instrument.ref-focused { position: fixed; inset: 12px; z-index: 20; padding: 8px; overflow: auto; background: #071321; box-shadow: 0 0 0 20px #000b; }
.ref .ref-instrument.ref-focused .ref-plot canvas,
.ref .ref-instrument.ref-focused #network canvas,
.ref .ref-instrument:fullscreen canvas[data-draw="emotion"],
.ref .ref-instrument.ref-focused canvas[data-draw="emotion"] { height: min(65vh, 810px); }
.ref .ref-instrument.ref-focused .ref-scene { max-height: 67vh; margin-inline: auto; }
.workspace-entrance { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,215px),1fr)); gap: 12px; margin-block: 0 24px; }
.workspace-entrance a { overflow: hidden; border: 1px solid #335776; border-radius: 12px; color: #e7f8ff; background: #102338; text-decoration: none; }
.workspace-entrance a:hover, .workspace-entrance a:focus-visible { border-color: #75f3e8; }
.workspace-entrance img { display: block; width: 100%; height: 110px; object-fit: cover; background: #041528; }
.workspace-entrance span { display: block; padding: 10px 12px; }
.workspace-entrance small { display: block; }
