:root {
  --bg: #0c1118;
  --bg-elev: #121a24;
  --panel: #141c27;
  --border: #243041;
  --border-soft: #1c2734;
  --text: #e8eef4;
  --muted: #8b9aab;
  --accent: #2bb673;
  --accent-dim: rgba(43, 182, 115, 0.14);
  --long: #38bdf8;
  --short: #fb923c;
  --tp: #4ade80;
  --sl: #f87171;
  --timeout: #fbbf24;
  --focus: #5ec8ff;
  --radius: 8px;
  --font: "IBM Plex Sans", "Noto Sans SC", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --text2: #94a3b8;
  --title-gradient: linear-gradient(100deg, #f8fafc 0%, #a5f3fc 48%, #93c5fd 100%);
  --scroll-size: 8px;
  --scroll-thumb: rgba(139, 154, 171, 0.28);
  --scroll-thumb-hover: rgba(139, 154, 171, 0.5);
  --scroll-thumb-active: rgba(43, 182, 115, 0.42);
  --rail-w: 2.75rem;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}

*::-webkit-scrollbar {
  width: var(--scroll-size);
  height: var(--scroll-size);
}
*::-webkit-scrollbar-track,
*::-webkit-scrollbar-corner {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background-color: var(--scroll-thumb);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
  background-color: var(--scroll-thumb-hover);
}
*::-webkit-scrollbar-thumb:active {
  background-color: var(--scroll-thumb-active);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

html, body {
  height: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(43, 182, 115, 0.07), transparent 55%),
    radial-gradient(900px 420px at 90% 0%, rgba(56, 189, 248, 0.05), transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.top {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(18, 26, 36, 0.98), rgba(12, 17, 24, 0.94));
  backdrop-filter: blur(10px);
}
.masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1.1rem 0.5rem;
  border-bottom: 1px solid var(--border-soft);
}
.load-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
}
.load-bar-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.2s ease;
}
.load-bar-fill.is-loading {
  background: var(--focus);
}
.load-bar-fill.is-running {
  background: var(--accent);
}
.load-bar-fill.is-pulse {
  width: 28%;
  transition: none;
  animation: lab-bar-pulse 1.1s ease-in-out infinite;
}
@keyframes lab-bar-pulse {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(380%); }
}

.brand { min-width: 0; flex: 1 1 auto; }
.brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin-bottom: 0.15rem;
}
.eyebrow {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.muted { color: var(--muted); font-size: 0.78rem; }
#window-meta {
  margin: 0;
  line-height: 1.3;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.92;
}

/* Metric rail: hero μR + quiet book strip */
.metric-rail {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  font-variant-numeric: tabular-nums;
}
.metric-band {
  display: flex;
  align-items: center;
  gap: 0.85rem 1.1rem;
  min-height: 0;
}
.metric-band.is-edge {
  padding: 0.45rem 1.1rem 0.4rem;
  background: linear-gradient(90deg, rgba(43, 182, 115, 0.08), transparent 42%);
  border-bottom: 1px solid var(--border-soft);
}
.metric-band.is-book {
  padding: 0.28rem 1.1rem 0.35rem;
  background: rgba(8, 12, 18, 0.35);
}
.metric-band-tag {
  flex: 0 0 auto;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--focus);
  opacity: 0.85;
  cursor: help;
}
.metric-hero {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.02rem;
  min-width: 5.5rem;
  padding-right: 0.85rem;
  border-right: 1px solid rgba(43, 182, 115, 0.28);
  cursor: help;
}
.metric-hero-k {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.metric-hero-v {
  font-family: var(--mono);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
}
.metric-hero-v.pos { color: var(--tp); }
.metric-hero-v.neg { color: var(--sl); }
.metric-bits {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.95rem;
  min-width: 0;
  flex: 1 1 auto;
}
.metric-bit {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28rem;
  min-width: 0;
}
.metric-bit.is-wide { min-width: 7.5rem; }
.metric-bit.is-link {
  cursor: pointer;
  border-radius: 4px;
  padding: 0.05rem 0.2rem;
  margin: -0.05rem -0.2rem;
}
.metric-bit.is-link:hover,
.metric-bit.is-link:focus-visible {
  background: rgba(43, 182, 115, 0.12);
  outline: none;
}
.metric-bit-k {
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.metric-bit-v {
  font-family: var(--mono);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}
.metric-band.is-book .metric-bit-v {
  font-size: 0.78rem;
  color: #c5d0db;
}
.metric-bit-v.pos { color: var(--tp); }
.metric-bit-v.neg { color: var(--sl); }
.metric-bit-v.warn { color: var(--timeout); }
.metric-bit-v.muted { color: var(--muted); }
.stat-budget-warn {
  margin: 0;
  padding: 0.28rem 1.1rem;
  border-top: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.07);
  color: var(--timeout);
  font-size: 0.7rem;
  line-height: 1.35;
  cursor: help;
}
.stat-empty {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0.45rem 1.1rem 0.55rem;
  padding: 0.4rem 0.65rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: inline-block;
}
/* Legacy chip classes kept for any residual nodes */
.stats { display: contents; }
.stat { display: none; }
.stat-k, .stat-v, .stat-group, .stat-group-label, .stat-side, .stat-link { display: none; }

.layout {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(248px, 292px) minmax(0, 1fr) minmax(268px, 332px);
  gap: 0;
  min-height: 0;
  height: 0; /* fill remaining viewport under .top */
}
.layout.is-collapsed {
  grid-template-columns: var(--rail-w) minmax(0, 1fr) minmax(268px, 332px);
}
.layout.is-history-collapsed {
  grid-template-columns: minmax(248px, 292px) minmax(0, 1fr) var(--rail-w);
}
.layout.is-collapsed.is-history-collapsed {
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--rail-w);
}

.drawer {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: var(--panel);
}
.layout.is-collapsed .drawer {
  display: none;
}
.drawer-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border-soft);
}
.drawer-title {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.drawer-toggle {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.72rem;
  cursor: pointer;
}
.drawer-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}
.drawer-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.45rem 0.7rem 0.55rem;
}
.drawer-foot {
  flex: 0 0 auto;
  padding: 0.55rem 0.7rem 0.7rem;
  border-top: 1px solid var(--border-soft);
  background: var(--panel);
}
/* Collapsed side tabs: params / history / K-line share one rail look. */
.panel-rail {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0.85rem 0;
  border: 0;
  background:
    linear-gradient(180deg, rgba(43, 182, 115, 0.08), transparent 42%),
    var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}
.panel-rail-glyph {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(43, 182, 115, 0.35);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
}
.panel-rail-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1;
}
.drawer-rail {
  border-right: 1px solid var(--border);
}
.history-rail,
.chart-rail {
  border-left: 1px solid var(--border);
}
.layout.is-collapsed .drawer-rail,
.layout.is-history-collapsed .history-rail,
.workspace.is-chart-collapsed .chart-rail {
  display: flex;
}
.panel-rail:hover {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(43, 182, 115, 0.16), transparent 48%),
    var(--bg-elev);
}
.drawer-rail:hover {
  box-shadow: inset -2px 0 0 var(--accent);
}
.history-rail:hover {
  box-shadow: inset 2px 0 0 var(--accent);
}
.panel-rail:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.history {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  border-left: 1px solid var(--border);
  background: var(--panel);
}
.layout.is-history-collapsed .history {
  display: none;
}
.history-head-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}
.runs-count {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}
.history-hint {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.4rem 0.7rem 0.45rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.68rem;
  line-height: 1.4;
  color: var(--muted);
}
.history-hint strong {
  color: var(--text);
  font-weight: 600;
}

.panel {
  padding: 0;
  overflow: hidden;
}
.panel label {
  display: inline;
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.panel label.has-help {
  cursor: default;
  text-decoration: none;
}
.param-tip-btn {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1;
  cursor: help;
}
.param-tip-btn:hover,
.param-tip-btn:focus-visible {
  border-color: var(--focus);
  color: var(--text);
  outline: none;
  box-shadow: 0 0 0 2px rgba(94, 200, 255, 0.22);
}

/* Unified tooltip skin (same as whale_ai_web / Z-Score tip) */
.wf-tip-aura {
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  background: linear-gradient(115deg, #8b5cf6, #3b82f6, #22d3ee, #8b5cf6);
  background-size: 280% 280%;
  animation: wf-tip-shimmer 3.2s ease infinite;
  opacity: 0.85;
}
.wf-tip-card {
  position: relative;
  z-index: 1;
  background: linear-gradient(155deg, rgba(26, 29, 43, 0.98) 0%, rgba(15, 17, 23, 0.99) 100%);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 10px;
  padding: 10px 11px 9px;
  overflow: hidden;
}
.wf-tip-card::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 70%;
  height: 80%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.18) 0%, transparent 70%);
  pointer-events: none;
}
.wf-tip-body {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text2);
  margin: 0;
  position: relative;
  white-space: pre-line;
  max-width: min(360px, 92vw);
}
.wf-tip-float:has(.wf-tip-body--block) {
  max-width: min(440px, 92vw);
}
.wf-tip-body--block {
  max-width: none;
  max-height: min(52vh, 380px);
  overflow-y: auto;
}
.wf-tip-kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 14px;
  row-gap: 3px;
  margin: 0;
  position: relative;
  min-width: 148px;
}
.wf-tip-kv dt {
  margin: 0;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.wf-tip-kv dd {
  margin: 0;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  text-align: right;
}
.wf-tip-kv dd.wf-tip-kv--up { color: #34d399; }
.wf-tip-kv dd.wf-tip-kv--down { color: #f87171; }
.wf-tip-float:has(.wf-tip-kv) { max-width: 240px; }
.wf-tip-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--title-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.wf-tip-title--solo { margin: 0 0 2px; }
.wf-tip-sub {
  font-size: 10px;
  color: var(--text2);
  line-height: 1.35;
  margin: 0;
}
.wf-tip-sub--top { margin-bottom: 4px; }
.wf-tip-float {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.55));
  max-width: 280px;
}
.wf-tip-float.show {
  opacity: 1;
  visibility: visible;
}
@keyframes wf-tip-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .wf-tip-aura { animation: none; }
  .wf-tip-float { transition: opacity 0.15s ease, visibility 0.15s; }
}
.panel .group-title,
.param-group > summary {
  margin-top: 0;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.param-group {
  margin: 0 0 0.15rem;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 0.35rem;
}
.param-group:last-of-type { border-bottom: 0; }
.param-group > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0 0.25rem;
  user-select: none;
}
.param-group > summary::-webkit-details-marker { display: none; }
.param-group > summary::before {
  content: "";
  width: 0.35rem;
  height: 0.35rem;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.12s ease;
}
.param-group[open] > summary::before {
  transform: rotate(45deg);
  margin-top: -0.12rem;
}
.linkish {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.15rem 0.25rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.linkish:hover { color: var(--text); }
.linkish:disabled { opacity: 0.5; cursor: not-allowed; }
.linkish.is-on { color: var(--accent); text-decoration: none; }
.param-group:first-child .group-title,
.param-group:first-child > summary { margin-top: 0.1rem; }
.param-group[hidden], .param-row[hidden] { display: none !important; }
.param-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6.6rem;
  align-items: center;
  gap: 0.35rem;
  margin: 0.18rem 0;
}
.param-row.is-bool {
  grid-template-columns: 1.1rem minmax(0, 1fr);
}
.param-label-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  min-width: 0;
}
.param-label-row label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.param-row input[type="checkbox"] {
  width: auto;
  margin: 0;
  justify-self: center;
}
.panel input, .panel select, #strategy-select, #universe-select {
  width: 100%;
  padding: 0.28rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.panel input:hover, .panel select:hover, #strategy-select:hover, #universe-select:hover {
  border-color: #35506a;
}
.panel input:focus, .panel select:focus, #strategy-select:focus, #universe-select:focus, .primary:focus-visible, .run-item:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 2px rgba(94, 200, 255, 0.25);
}
.panel input[type="checkbox"] { width: auto; accent-color: var(--accent); }

#strategy-select, #universe-select {
  width: auto;
  min-width: 10rem;
  max-width: min(18rem, 42vw);
  background: var(--bg-elev);
}
#universe-select {
  min-width: 14rem;
  max-width: min(26rem, 48vw);
}
.window-range {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.window-range-sep {
  color: var(--muted);
  font-size: 0.78rem;
}
.window-date {
  width: auto;
  min-width: 8.6rem;
  padding: 0.24rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-variant-numeric: tabular-nums;
  color-scheme: dark;
}
.window-date:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 2px rgba(94, 200, 255, 0.25);
}
.end-mode-btn {
  width: auto;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.end-mode-btn:hover:not(:disabled) {
  border-color: #35506a;
}
.end-mode-btn:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 2px rgba(94, 200, 255, 0.25);
}
.end-mode-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text);
}
.end-mode-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.primary {
  margin-top: 0;
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #34c481, var(--accent));
  color: #04140c;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.param-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.4rem;
  margin-top: 0;
}
.param-actions .primary {
  grid-column: 1 / -1;
}
.param-actions button:not(.primary) {
  width: 100%;
  padding: 0.45rem 0.35rem;
  border: 1px solid var(--border, #2a3340);
  border-radius: 6px;
  background: var(--bg-elev, #151a22);
  color: inherit;
  cursor: pointer;
}
.param-actions button:not(.primary):hover:not(:disabled) {
  border-color: var(--accent, #2db872);
}
.param-actions button:not(.primary):disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.primary:hover:not(:disabled) { filter: brightness(1.06); }
.primary:active:not(:disabled) { transform: translateY(1px); }
.primary:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.primary.is-stop {
  background: linear-gradient(180deg, #f87171, #dc2626);
  color: #fff7f7;
}

.status-line {
  min-height: 1.25em;
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
}

.runs-list {
  list-style: none;
  padding: 0.45rem 0.55rem 0.7rem;
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.runs-empty {
  margin: 0.85rem 0.35rem;
  padding: 0.75rem 0.65rem;
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}
.runs-list > li {
  position: relative;
  margin: 0 0 0.4rem;
}
.runs-list > li:last-child { margin-bottom: 0; }
.history-head {
  flex-wrap: wrap;
  row-gap: 0.25rem;
}
.run-item {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  width: 100%;
  min-height: 5.2rem;
  text-align: left;
  margin: 0;
  padding: 0.45rem 1.7rem 0.48rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.74rem;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.run-item:hover {
  border-color: var(--border);
  background: rgba(18, 26, 36, 0.72);
}
.run-item.is-active {
  border-color: rgba(43, 182, 115, 0.45);
  background: var(--accent-dim);
  box-shadow: inset 3px 0 0 var(--accent);
}
.run-item.is-other {
  opacity: 0.72;
}
.run-actions {
  position: absolute;
  top: 0.18rem;
  right: 0.12rem;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.run-ctx-menu {
  position: fixed;
  z-index: 80;
  min-width: 11rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #121a24;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.run-ctx-menu[hidden] {
  display: none !important;
}
.run-ctx-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.4rem 0.55rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
}
.run-ctx-item:hover:not(:disabled),
.run-ctx-item:focus-visible:not(:disabled) {
  background: rgba(43, 182, 115, 0.16);
  color: var(--accent);
}
.run-ctx-item:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.65;
}
.run-act {
  width: 1.35rem;
  height: 1.2rem;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
}
.run-act:hover,
.run-act:focus-visible,
.run-act.is-on {
  color: var(--accent);
  background: rgba(43, 182, 115, 0.14);
  opacity: 1;
}
.run-item-del {
  position: static;
  top: auto;
  right: auto;
  width: 1.35rem;
  height: 1.2rem;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.5;
}
.run-item-del:hover,
.run-item-del:focus-visible {
  color: var(--sl);
  background: rgba(248, 113, 113, 0.14);
  opacity: 1;
}
.run-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.run-item-when {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.run-item-mu {
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.run-item-mu.pos { color: var(--tp); }
.run-item-mu.neg { color: var(--sl); }
.run-item-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.55rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.run-item-sid {
  color: var(--short);
}
.run-item-uni.is-other {
  color: var(--accent);
}
.run-item-rb.is-budget-warn,
.run-item-stats .is-budget-warn {
  color: var(--timeout);
}
.run-item-halves {
  color: var(--text);
  opacity: 0.85;
}
.run-item-note {
  margin-top: 0.28rem;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.run-item-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
}
.run-chip {
  max-width: 100%;
  padding: 0.08rem 0.32rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-elev);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.64rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.run-chip.is-on {
  border-color: rgba(43, 182, 115, 0.45);
  color: var(--tp);
}
.run-chip.is-off {
  color: var(--muted);
}
.run-chip.is-more,
.run-chip.is-default {
  color: var(--muted);
  border-style: dashed;
}

.content {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  min-width: 0;
}

.tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 0.15rem;
  padding: 0.15rem 0.75rem 0;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 20, 0.72);
}
.tab {
  padding: 0.42rem 0.7rem 0.48rem;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.tab:hover { color: var(--text); }
.tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.tab-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: none;
  flex-direction: column;
  padding: 0.65rem 0.75rem 0.75rem;
  overflow: hidden;
}
.tab-panel.is-active {
  display: flex;
}

.stat-link {
  cursor: pointer;
}
.stat-link:hover {
  border-color: var(--accent);
}
.stat-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.monthly {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
.monthly .overview-head {
  flex: 0 0 auto;
}
.monthly-table-wrap {
  flex: 1 1 auto;
}
#monthly-table tr {
  cursor: default;
}
#stress-table tr.stress-row {
  cursor: pointer;
}
#stress-table tr.stress-row--na {
  opacity: 0.55;
  cursor: default;
}
#stress-table tr.stress-row:hover td {
  background: rgba(43, 182, 115, 0.08);
}
#stress-table td.stress-delta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  max-width: 18rem;
  white-space: normal;
}
#monthly-table tfoot td {
  font-weight: 600;
  border-top: 1px solid var(--border);
  background: #101821;
}
.mu-spark {
  width: 7.2rem;
  height: 0.45rem;
  position: relative;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 2px;
}
.mu-spark-zero {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  background: rgba(148, 163, 184, 0.45);
}
.mu-spark-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 2px;
}
.mu-spark-fill.pos { background: var(--tp); }
.mu-spark-fill.neg { background: var(--sl); }

.overview {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
.overview-chart,
.dist-card {
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: rgba(18, 26, 36, 0.55);
  padding: 0.4rem 0.5rem 0.35rem;
  min-height: 0;
}
.overview-chart {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 12rem;
  overflow: hidden;
  border-color: rgba(94, 200, 255, 0.18);
  background: rgba(10, 14, 20, 0.55);
}
.overview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
  flex: 0 0 auto;
}
.overview-label {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.overview-side {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  flex: 0 0 auto;
  min-height: 0;
}
.equity-plot {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}
/* Plotly default absolute height fights flex fill — force match container */
.equity-plot .js-plotly-plot,
.equity-plot .plot-container,
.equity-plot .svg-container {
  width: 100% !important;
  height: 100% !important;
}
.equity-plot .modebar {
  left: 2px;
  right: auto;
}
.equity-plot.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
  min-height: 0;
}

.dist { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.4rem; }
.dist-row { display: grid; grid-template-columns: 4.2rem 1fr 2.4rem; gap: 0.35rem; align-items: center; }
.dist-row.has-detail { grid-template-columns: 4.2rem 1fr 9.2rem; }
.dist-row.has-tip { cursor: help; }
.dist-row.has-tip:hover .dist-name,
.dist-row.has-tip:focus-visible .dist-name { color: var(--text); }
.dist-row.has-tip:focus-visible { outline: 1px solid var(--focus); outline-offset: 2px; }
.dist-name { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.dist-track {
  height: 8px;
  border-radius: 999px;
  background: #1a2430;
  overflow: hidden;
}
.dist-fill { height: 100%; border-radius: inherit; transition: width 0.35s ease; }
.dist-fill.tp { background: var(--tp); }
.dist-fill.sl { background: var(--sl); }
.dist-fill.timeout { background: var(--timeout); }
.dist-fill.long { background: var(--long); }
.dist-fill.short { background: var(--short); }
.dist-fill.init { background: #fb7185; }
.dist-fill.structure { background: #fbbf24; }
.dist-fill.trail { background: #a78bfa; }
.dist-n {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-align: right;
  color: var(--text);
}
.dist-n.wide {
  font-size: 0.66rem;
  white-space: nowrap;
}
.dist-empty { color: var(--muted); font-size: 0.8rem; padding: 0.35rem 0; }

.hist {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 88px;
  margin-top: 0.45rem;
  padding: 0 0.1rem;
}
.hist-bar {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 2px 2px 0 0;
  background: rgba(56, 189, 248, 0.55);
}
.hist-bar.neg { background: rgba(248, 113, 113, 0.55); }
.hist-bar.pos { background: rgba(74, 222, 128, 0.55); }
.hist-bar.zero { background: rgba(148, 163, 184, 0.45); }
.hist-empty {
  width: 100%;
  color: var(--muted);
  font-size: 0.8rem;
  align-self: center;
  text-align: center;
}

.workspace {
  --trades-table-fr: 0.95fr;
  --trades-chart-fr: 1.35fr;
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, var(--trades-table-fr)) 5px minmax(180px, var(--trades-chart-fr));
  gap: 0.35rem 0.45rem;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
.workspace.is-chart-collapsed {
  /* Always reclaim full width — K-line expand is a chip, never a side rail. */
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}
.workspace.is-chart-collapsed .workspace-split,
.workspace.is-chart-collapsed .panel-chart {
  display: none;
}
.workspace.is-chart-collapsed .chart-rail {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 6;
  width: auto;
  height: auto;
  flex-direction: row;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.32rem 0.7rem 0.32rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(43, 182, 115, 0.14), transparent 70%),
    var(--panel);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.workspace.is-chart-collapsed .chart-rail .panel-rail-label {
  writing-mode: horizontal-tb;
  letter-spacing: 0.1em;
}
.workspace.is-chart-collapsed .chart-rail:hover {
  box-shadow:
    inset 0 0 0 1px rgba(43, 182, 115, 0.35),
    0 8px 20px rgba(0, 0, 0, 0.4);
}
.workspace.is-chart-collapsed .table-wrap {
  border-top-right-radius: var(--radius);
}
.workspace-split {
  position: relative;
  cursor: col-resize;
  touch-action: none;
  border-radius: 3px;
  background: transparent;
  align-self: stretch;
}
.workspace-split::after {
  content: "";
  position: absolute;
  inset: 0.35rem 1px;
  border-radius: 2px;
  background: var(--border);
  opacity: 0.7;
  transition: background 0.12s ease, opacity 0.12s ease;
}
.workspace-split:hover::after,
.workspace-split:focus-visible::after,
.workspace.is-resizing .workspace-split::after {
  background: var(--accent);
  opacity: 1;
}
.workspace.is-resizing {
  cursor: col-resize;
  user-select: none;
}

.table-wrap {
  overflow: auto;
  max-height: none;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.panel-chart {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
}
.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex: 0 0 auto;
}
.chart-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}
.chart-caption {
  font-size: 0.8rem;
  color: var(--muted);
  min-height: 1.2em;
  min-width: 0;
  flex: 1 1 auto;
}
.copy-toast { font-size: 0.75rem; color: var(--accent); }
.copy-toast.err { color: var(--sl); }
.chart-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0b1220;
  overflow: hidden;
}
#chart {
  width: 100%;
  height: 100%;
  min-height: 0;
}
.chart-price-tag {
  position: absolute;
  right: 1px;
  z-index: 6;
  transform: translateY(-50%);
  pointer-events: none;
  padding: 2px 7px;
  border-radius: 3px 0 0 3px;
  background: var(--long);
  color: #0b1220;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}
.chart-crosshair-h,
.chart-crosshair-v {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: rgba(148, 163, 184, 0.45);
}
.chart-crosshair-h { left: 0; width: 100%; height: 1px; }
.chart-crosshair-v { top: 0; width: 1px; height: 100%; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
}
th, td {
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  white-space: nowrap;
}
th {
  color: var(--muted);
  font-weight: 500;
  font-family: var(--font);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  background: #101821;
  z-index: 1;
}
#trades-table th.th-sort {
  cursor: pointer;
  user-select: none;
  padding-right: 1.1rem;
}
#trades-table th.th-sort:hover {
  color: var(--text, #e6edf3);
}
#trades-table th.th-sort::after {
  content: "";
  position: absolute;
  right: 0.3rem;
  opacity: 0.35;
  font-size: 0.65rem;
}
#trades-table th.th-sort[aria-sort="ascending"]::after {
  content: "▲";
  opacity: 0.9;
  color: var(--accent, #2bb673);
}
#trades-table th.th-sort[aria-sort="descending"]::after {
  content: "▼";
  opacity: 0.9;
  color: var(--accent, #2bb673);
}
tr:hover td { background: rgba(30, 42, 56, 0.85); }
tr.active td {
  background: rgba(43, 182, 115, 0.12);
  box-shadow: inset 3px 0 0 var(--accent);
}
tr { cursor: pointer; }
td.side-long { color: var(--long); }
td.side-short { color: var(--short); }
td.result-tp { color: var(--tp); }
td.result-sl { color: var(--sl); }
td.result-timeout { color: var(--timeout); }
td.pnl-pos { color: var(--tp); }
td.pnl-neg { color: var(--sl); }

@media (max-width: 1280px) {
  .layout {
    grid-template-columns: minmax(260px, 290px) minmax(0, 1fr) minmax(280px, 340px);
  }
  .layout.is-collapsed {
    grid-template-columns: var(--rail-w) minmax(0, 1fr) minmax(280px, 340px);
  }
  .layout.is-history-collapsed {
    grid-template-columns: minmax(260px, 290px) minmax(0, 1fr) var(--rail-w);
  }
  .layout.is-collapsed.is-history-collapsed {
    grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--rail-w);
  }
}
@media (max-width: 1100px) {
  .overview-side { grid-template-columns: 1fr 1fr; }
  .overview-side .hist-card { grid-column: auto; }
  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(10rem, 1fr) 0 minmax(12rem, 1fr);
  }
  .workspace.is-chart-collapsed {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
  }
  .workspace-split {
    display: none;
  }
  .metric-rail { max-width: 100%; }
  .metric-hero-v { font-size: 1.4rem; }
  .layout,
  .layout.is-collapsed,
  .layout.is-history-collapsed,
  .layout.is-collapsed.is-history-collapsed {
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(11rem, 28vh);
  }
  .drawer { grid-row: 1 / -1; }
  .drawer-rail { grid-row: 1 / -1; }
  .content { grid-column: 2; grid-row: 1; }
  .history {
    grid-column: 2;
    grid-row: 2;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .history-rail {
    grid-column: 2;
    grid-row: 2;
    flex-direction: row;
    justify-content: center;
    gap: 0.45rem;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .history-rail .panel-rail-label {
    writing-mode: horizontal-tb;
    letter-spacing: 0.12em;
  }
  .history-rail .panel-rail-glyph {
    transform: rotate(90deg);
  }
  .layout.is-collapsed {
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
  }
  .layout.is-history-collapsed,
  .layout.is-collapsed.is-history-collapsed {
    grid-template-rows: minmax(0, 1fr) var(--rail-w);
  }
}
@media (max-width: 800px) {
  body { overflow: auto; }
  .layout,
  .layout.is-collapsed,
  .layout.is-history-collapsed,
  .layout.is-collapsed.is-history-collapsed {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    height: auto;
  }
  .drawer,
  .drawer-rail,
  .content,
  .history,
  .history-rail {
    grid-column: auto;
    grid-row: auto;
  }
  .drawer { max-height: 42vh; border-right: 0; border-bottom: 1px solid var(--border); }
  .layout.is-collapsed .drawer { display: flex; max-height: 0; overflow: hidden; border: 0; padding: 0; }
  .layout.is-collapsed .drawer-rail {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 0.75rem;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .layout.is-collapsed .drawer-rail .panel-rail-label {
    writing-mode: horizontal-tb;
    letter-spacing: 0.12em;
  }
  .layout.is-collapsed .drawer-rail .panel-rail-glyph {
    transform: rotate(90deg);
  }
  .history { max-height: 36vh; border-top: 1px solid var(--border); }
  .layout.is-history-collapsed .history-rail {
    flex-direction: row;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 0.75rem;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .layout.is-history-collapsed .history-rail .panel-rail-label {
    writing-mode: horizontal-tb;
    letter-spacing: 0.12em;
  }
  .layout.is-history-collapsed .history-rail .panel-rail-glyph {
    transform: rotate(90deg);
  }
  .tab-panel { overflow: auto; }
  .overview-side { grid-template-columns: 1fr; }
  .overview-side .hist-card { grid-column: auto; }
}
.tool-panel {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 0;
  flex: 1 1 auto;
}
.tool-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.7rem;
  margin: 0;
}
.tool-field {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
}
.tool-field input,
.tool-field select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.28rem 0.4rem;
}
.tool-field input { width: 4.2rem; }
.tool-field select { max-width: 16rem; }
.tool-field-grow { flex: 1 1 12rem; min-width: 0; }
.tool-field-grow select { width: 100%; max-width: none; }
.tool-go {
  padding: 0.32rem 0.75rem;
  border: 0;
  border-radius: 5px;
  background: var(--accent);
  color: #062116;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
}
.tool-go:disabled { opacity: 0.45; cursor: not-allowed; }
.tool-summary {
  color: var(--text);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.tool-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}
.delta-cell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 7rem;
}
.delta-track {
  flex: 1 1 auto;
  height: 6px;
  border-radius: 99px;
  background: rgba(139, 154, 171, 0.18);
  overflow: hidden;
}
.delta-fill {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--muted);
}
.delta-fill.pos { background: var(--tp); }
.delta-fill.neg { background: var(--sl); }
.cmp-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}
.cmp-metrics:empty { display: none; }
.cmp-card {
  min-width: 0;
  padding: 0.4rem 0.55rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(8, 12, 18, 0.35);
}
.cmp-card-k {
  display: block;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.cmp-card-v {
  display: block;
  margin-top: 0.12rem;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
}
.cmp-card-v.pnl-pos { color: var(--tp); }
.cmp-card-v.pnl-neg { color: var(--sl); }
.cmp-card-v.warn { color: var(--timeout); }
.cmp-card-s {
  display: block;
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 900px) {
  .cmp-metrics { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .primary, .run-item, .panel input, .dist-fill, .tab { transition: none; }
}
