:root {
  color-scheme: dark;
  --bg: #071016;
  --surface: #0d1922;
  --surface-raised: #12232e;
  --surface-soft: #0a151d;
  --line: #213945;
  --line-bright: #315363;
  --text: #eef5f7;
  --muted: #8298a2;
  --green: #52dfa5;
  --cyan: #5bc8f5;
  --red: #ff758d;
  --amber: #f7c65c;
}
* {
  box-sizing: border-box;
}
html {
  min-width: 320px;
  background: var(--bg);
}
body {
  min-height: 100vh;
  margin: 0;
  position: relative;
  isolation: isolate;
  background-image:
    linear-gradient(
      180deg,
      rgba(3, 10, 17, 0.7) 0%,
      rgba(4, 12, 18, 0.82) 52%,
      rgba(3, 9, 14, 0.94) 100%
    ),
    radial-gradient(circle at 76% 4%, rgba(25, 114, 102, 0.16), transparent 42%),
    url("/static/research-bg.webp");
  background-position: center, center, center top;
  background-size: cover, cover, cover;
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}
body:before {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(#ffffff05 1px, transparent 1px),
    linear-gradient(90deg, #ffffff05 1px, transparent 1px);
  background-size: 48px 48px;
  content: "";
  mask-image: linear-gradient(to bottom, #000 0, transparent 58%);
  pointer-events: none;
}
.wrap {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 40px), 1680px);
  margin: auto;
  padding: 22px 0 64px;
}
.top {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #3782a1;
  border-radius: 11px;
  background: linear-gradient(145deg, #14384a, #0d2632);
  color: var(--cyan);
  box-shadow: inset 0 1px #ffffff12, 0 8px 24px #0003;
  font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: -0.04em;
}
.brand-copy {
  display: grid;
  gap: 1px;
}
.brand-copy strong {
  font-size: 15px;
  letter-spacing: 0.01em;
}
.brand-copy > span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #9aadb5;
  font-size: 12px;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px #52dfa514, 0 0 12px #52dfa566;
}
.grid {
  display: grid;
  grid-template-columns: minmax(340px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  transition: grid-template-columns 0.2s ease;
}
.grid.sidebar-collapsed {
  grid-template-columns: 58px minmax(0, 1fr);
}
.card {
  border: 1px solid rgba(49, 83, 99, 0.82);
  border-radius: 20px;
  background: linear-gradient(
    155deg,
    rgba(13, 30, 39, 0.89) 0%,
    rgba(6, 16, 23, 0.93) 78%
  );
  box-shadow: 0 20px 54px #00000052, inset 0 1px #ffffff0a;
  backdrop-filter: blur(10px) saturate(0.82);
  padding: 24px;
}
.form {
  min-width: 0;
  align-self: start;
  overflow: hidden;
  transition: padding 0.2s ease;
}
.runs {
  min-width: 0;
}
.full {
  grid-column: 1/-1;
}
.form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.form-head h2 {
  margin: 0;
}
.sidebar-toggle {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border-color: var(--line-bright);
  background: #102631;
  color: var(--cyan);
  font-size: 21px;
  line-height: 1;
}
.sidebar-toggle-icon {
  display: block;
  transition: transform 0.2s ease;
}
.grid.sidebar-collapsed .form {
  min-height: 0;
  padding: 11px;
}
.grid.sidebar-collapsed .form-head {
  justify-content: center;
}
.grid.sidebar-collapsed .form-head h2 {
  display: none;
}
.grid.sidebar-collapsed .sidebar-toggle-icon {
  transform: rotate(180deg);
}
.grid.sidebar-collapsed #experimentForm {
  display: none;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h2 {
  margin: 0 0 16px;
  color: #b9cbd2;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
label {
  display: block;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid #294653;
  border-radius: 10px;
  outline: none;
  background: #07131a;
  color: var(--text);
  padding: 10px 11px;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus,
textarea:focus,
select:focus {
  border-color: #4ca1c4;
  box-shadow: 0 0 0 3px #5bc8f516;
}
textarea {
  min-height: 88px;
  resize: vertical;
}
button {
  border: 1px solid #34795f;
  border-radius: 10px;
  background: #123627;
  color: var(--green);
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease,
    background 0.15s ease;
}
button:hover:not(:disabled) {
  transform: translateY(-1px);
}
button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button.primary {
  width: 100%;
  margin-top: 17px;
  background: linear-gradient(135deg, #16563d, #123b2d);
}
button.small {
  border-color: #315464;
  background: #102631;
  color: var(--cyan);
  padding: 6px 9px;
  font-size: 11px;
}
button.quiet {
  margin-left: 7px;
  border-color: transparent;
  background: #ffffff08;
  color: #a8bbc2;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  white-space: nowrap;
}
th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.scroll {
  max-height: 520px;
  overflow: auto;
}
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #ffffff0d;
  border-radius: 999px;
  background: #182631;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.pill.complete {
  background: #123627;
  color: var(--green);
}
.pill.running {
  background: #3a2e11;
  color: var(--amber);
}
.pill.queued {
  background: #102637;
  color: var(--cyan);
}
.pill.failed,
.pill.cancelled {
  background: #351821;
  color: var(--red);
}
.pill.urd-robust {
  background: #123627;
  color: var(--green);
}
.pill.urd-watch {
  background: #3a2e11;
  color: var(--amber);
}
.pill.urd-fragile {
  background: #351821;
  color: var(--red);
}
.muted {
  color: var(--muted);
}
.positive {
  color: var(--green);
}
.negative {
  color: var(--red);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.metric {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #07131c;
  padding: 12px;
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}
.metric b {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}
.audit-details {
  display: grid;
  gap: 14px;
  margin: 4px 0 20px;
}
.audit-details[hidden] {
  display: none;
}
.audit-overview {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid #63323c;
  border-radius: 13px;
  background: linear-gradient(100deg, #29141b, #10151a);
  padding: 16px;
}
.audit-verdict {
  display: grid;
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid #844050;
  border-radius: 50%;
  color: var(--red);
  font: 800 14px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  box-shadow: inset 0 0 0 6px #ff758d0b;
}
.audit-verdict.pass {
  border-color: #34795f;
  color: var(--green);
  box-shadow: inset 0 0 0 6px #52dfa50b;
}
.audit-copy {
  min-width: 0;
}
.audit-copy strong,
.audit-copy span {
  display: block;
}
.audit-copy strong {
  margin-bottom: 3px;
  font-size: 15px;
}
.audit-copy span {
  color: #9db0ba;
  font-size: 12px;
}
.audit-copy ul {
  margin: 9px 0 0;
  padding-left: 18px;
  color: var(--red);
  font-size: 11px;
}
.audit-periods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.audit-period-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #07131c;
  padding: 13px;
}
.audit-period-card > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.audit-period-card > b {
  font: 700 18px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.audit-period-card > small {
  color: #8fa4ad;
  font-size: 10px;
}
.audit-table-wrap {
  max-height: none;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.audit-table-wrap table {
  min-width: 900px;
}
.audit-table-wrap th,
.audit-table-wrap td {
  white-space: nowrap;
}
canvas {
  display: block;
  width: 100%;
  height: 220px;
  margin-bottom: 12px;
}
.login {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  background: #03090ef2;
  backdrop-filter: blur(12px);
}
.login.visible {
  display: flex;
}
.login-card {
  width: min(420px, 90%);
}
.login-card label {
  display: block;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.login-card input {
  width: 100%;
}
.error {
  min-height: 20px;
  margin-top: 10px;
  color: var(--red);
}
.notice {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}
.eyebrow {
  color: var(--cyan);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.runs-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.runs-heading h1 {
  margin: 5px 0 4px;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.runs-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}
.tabs {
  display: flex;
  gap: 7px;
  margin: 0 0 18px;
  overflow-x: auto;
  padding: 3px;
  border-radius: 12px;
  scrollbar-width: thin;
}
.tab {
  flex: 0 0 auto;
  border-color: transparent;
  background: #07131a;
  color: #8298a2;
  padding: 8px 12px;
  font-size: 11px;
}
.tab:hover:not(:disabled) {
  border-color: var(--line-bright);
  background: #10232e;
}
.tab.active {
  border-color: #34795f;
  background: #123627;
  color: var(--green);
  box-shadow: inset 0 1px #ffffff0d;
}
.tab.best.active {
  border-color: #806622;
  background: #342a10;
  color: #f8d778;
}
.tab.promising.active {
  border-color: #31566c;
  background: #102637;
  color: var(--cyan);
}
.tab.rest.active {
  border-color: #4a5763;
  background: #17222b;
  color: #9db0bc;
}
.tab.rejected.active {
  border-color: #71343a;
  background: #30191d;
  color: var(--red);
}
.tab.archive.active {
  border-color: #6b5723;
  background: #2b240f;
  color: var(--amber);
}
.run-list {
  display: grid;
  gap: 10px;
}
.run-card {
  display: grid;
  grid-template-columns:
    minmax(210px, 1.05fr) minmax(240px, 1.25fr)
    minmax(300px, 1.35fr) 104px;
  gap: 20px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(110deg, #0d1c25, #09141b);
  padding: 18px;
  transition: border-color 0.15s ease, background 0.15s ease,
    transform 0.15s ease;
}
.run-card:hover {
  border-color: #315462;
  background: linear-gradient(110deg, #10232d, #0a171f);
  transform: translateY(-1px);
}
.run-main,
.run-spark,
.run-stats {
  min-width: 0;
}
.run-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}
.run-id {
  color: #8fa4ad;
  font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.hypothesis-cell strong,
.hypothesis-cell span {
  display: block;
}
.hypothesis-cell strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hypothesis-cell span {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 4px;
  color: #91a6ae;
  font-size: 11px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}
.run-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  margin-top: 10px;
  color: var(--muted);
  font: 10px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.run-meta span {
  overflow: hidden;
  border-radius: 6px;
  background: #ffffff08;
  padding: 4px 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.spark-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.spark-head span:last-child {
  color: #607984;
  font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0;
  text-transform: none;
}
.spark-cell {
  width: 100%;
  min-width: 0;
}
.month-bars {
  position: relative;
  display: flex;
  width: 100%;
  height: 52px;
  align-items: stretch;
  gap: 2px;
  padding: 1px 0;
}
.month-bars:after {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 1px;
  background: #315061;
  content: "";
  opacity: 0.65;
  pointer-events: none;
}
.month-slot {
  position: relative;
  flex: 1 1 0;
  min-width: 2px;
  height: 100%;
  border: 0;
  border-radius: 3px;
  background: transparent;
  padding: 0;
}
.month-slot:hover,
.month-slot:focus-visible {
  outline: 1px solid #55c7ff55;
  background: #55c7ff12;
  filter: none;
  transform: none;
}
.month-bar {
  position: absolute;
  right: 1px;
  left: 1px;
  min-height: 1px;
  border-radius: 2px;
}
.month-bar.gain {
  bottom: 50%;
  background: var(--green);
  box-shadow: 0 0 8px #52dfa522;
}
.month-bar.loss {
  top: 50%;
  background: var(--red);
}
.month-bar.flat {
  top: calc(50% - 1px);
  background: var(--muted);
}
.month-bars.muted {
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.audit-bars {
  height: 66px;
  padding-bottom: 14px;
}
.audit-slot i {
  position: absolute;
  right: 0;
  bottom: -14px;
  left: 0;
  color: #607984;
  font: 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
}
.run-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #1e343f;
  border-radius: 11px;
  background: #07121999;
}
.run-stat {
  min-width: 0;
  padding: 11px 10px;
}
.run-stat + .run-stat {
  border-left: 1px solid #1e343f;
}
.run-stat span,
.run-stat b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.run-stat span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.run-stat b {
  font: 700 13px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.run-actions {
  display: grid;
  gap: 7px;
}
.run-actions button {
  width: 100%;
  white-space: nowrap;
}
.run-actions .open-run {
  border-color: #2f718b;
  background: #103044;
  color: #7dd6fa;
}
.archive-action {
  margin-left: 0;
  border-color: #554821 !important;
  background: transparent !important;
  color: var(--amber) !important;
}
.empty-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  border: 1px dashed var(--line-bright);
  border-radius: 15px;
  color: var(--muted);
  text-align: center;
}
.empty-state strong {
  display: block;
  margin-bottom: 4px;
  color: #b9c9cf;
}
.trade-panel {
  margin: 22px 0 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.trade-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}
.trade-chart-head h2 {
  margin: 3px 0 0;
  font-size: 15px;
  color: var(--text);
}
.eyebrow {
  color: var(--cyan);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.trade-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #08151f;
}
.trade-controls {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}
.trade-controls label {
  margin: 0;
}
.trade-controls select {
  min-width: 118px;
  padding: 7px 9px;
}
.trade-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.trade-actions button {
  white-space: nowrap;
}
.strategy-decision {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 10px 13px;
  margin-bottom: 10px;
  border: 1px solid #27475a;
  border-radius: 9px;
  background: linear-gradient(90deg, #0d2230, #091722);
}
.strategy-decision.unavailable {
  border-color: #5c4a25;
  background: linear-gradient(90deg, #241e0e, #11160f);
}
.strategy-decision-copy {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 11px;
}
.strategy-decision-copy .eyebrow {
  flex-basis: 100%;
}
.strategy-decision-copy > b {
  font-size: 11px;
}
.strategy-decision-copy > .muted {
  font-size: 10px;
}
.indicator-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 9px;
}
.indicator-legend i {
  display: inline-block;
  width: 13px;
  height: 2px;
  margin: 0 4px 2px 0;
  background: var(--indicator-color);
}
.indicator-toggles {
  display: flex;
  gap: 7px;
  flex: 0 0 auto;
}
.indicator-toggles label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  margin: 0;
  border: 1px solid #31566c;
  border-radius: 6px;
  background: #07131c;
  color: #9db0ba;
  cursor: pointer;
  text-transform: none;
  white-space: nowrap;
}
.indicator-toggles label[hidden] {
  display: none !important;
}
.indicator-toggles input {
  width: auto;
  margin: 0;
  accent-color: var(--cyan);
}
.strategy-decision.unavailable .indicator-toggles {
  display: none;
}
.trade-workspace {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(300px, 0.85fr);
  min-height: 720px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #07131c;
  overflow: hidden;
}
.trade-visual {
  position: relative;
  min-width: 0;
  border-right: 1px solid var(--line);
}
.trade-chart-wrap {
  position: relative;
  background: #07131c;
  min-height: 680px;
}
.trade-price-chart {
  height: 680px;
  margin: 0;
}
.pane-labels {
  position: absolute;
  inset: 0 auto auto 10px;
  z-index: 4;
  color: #8aa1ad;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}
.pane-labels span {
  position: absolute;
  width: max-content;
  padding: 3px 5px;
  border-radius: 3px;
  background: #07131ccc;
}
.pane-labels span:nth-child(1) {
  top: 8px;
}
.pane-labels span:nth-child(2) {
  top: 414px;
}
.pane-labels span:nth-child(3) {
  top: 494px;
}
.pane-labels span:nth-child(4) {
  top: 582px;
}
.trade-tooltip {
  display: none;
  position: absolute;
  z-index: 8;
  min-width: 235px;
  max-width: 390px;
  padding: 10px 12px;
  border: 1px solid #31566c;
  border-radius: 7px;
  background: #081722f2;
  color: var(--text);
  font-size: 11px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 10px 30px #0008;
}
.trade-tooltip strong {
  display: block;
  margin-bottom: 5px;
  color: var(--cyan);
}
.trade-tooltip-grid {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 2px 14px;
}
.trade-tooltip-grid span:nth-child(odd) {
  color: var(--muted);
}
.trade-empty {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  color: var(--muted);
  background: #07131c;
}
.trade-empty.visible {
  display: grid;
}
.trade-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 39px;
  padding: 9px 12px;
  margin: 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.trade-legend b {
  font-size: 14px;
}
.trade-legend .cyan {
  color: var(--cyan);
}
.trade-legend .amber {
  color: var(--amber);
}
.trade-legend .muted-dot {
  color: var(--muted);
}
.trade-legend .signal-dot {
  color: #c994ff;
}
.trade-hint {
  margin-left: auto;
}
.trade-status {
  color: var(--muted);
  font-size: 11px;
  margin-left: auto;
}
.episode-inspector {
  display: flex;
  min-width: 0;
  max-height: 720px;
  flex-direction: column;
  background: linear-gradient(165deg, #0b1a25, #08131c);
}
.inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px;
  border-bottom: 1px solid var(--line);
}
.inspector-head h3 {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 600;
}
.episode-side {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}
.episode-side.long {
  border-color: #34795f;
  color: var(--green);
  background: #123627;
}
.episode-side.short {
  border-color: #7a3545;
  color: var(--red);
  background: #351821;
}
.decision-inspector {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #0d1f2b;
}
.decision-inspector > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.decision-inspector div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}
.decision-inspector b {
  font-size: 13px;
}
.decision-inspector b.long {
  color: var(--green);
}
.decision-inspector b.short {
  color: var(--red);
}
.decision-inspector b.flat {
  color: var(--muted);
}
.decision-inspector small {
  overflow: hidden;
  color: #9db0ba;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.episode-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}
.episode-metric {
  min-width: 0;
  padding: 10px 12px;
  background: #091722;
}
.episode-metric span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.episode-metric b {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
}
.episode-list-head {
  display: flex;
  justify-content: space-between;
  padding: 11px 14px 7px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.episode-list {
  flex: 1;
  padding: 0 8px 10px;
  overflow: auto;
}
.episode-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 9px 8px;
  border: 1px solid transparent;
  border-bottom-color: var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.episode-card:hover,
.episode-card.active {
  border-color: #31566c;
  background: #102637;
  filter: none;
}
.episode-card-index {
  color: var(--muted);
  font-size: 10px;
}
.episode-card-main b,
.episode-card-main span {
  display: block;
}
.episode-card-main b {
  font-size: 11px;
}
.episode-card-main span {
  color: var(--muted);
  font-size: 9px;
}
.episode-card-pnl {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.trade-attribution {
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}
.trade-attribution a {
  color: #8db8ce;
}
.trade-panel:fullscreen {
  padding: 16px;
  margin: 0;
  overflow: auto;
  background: var(--bg);
}
.trade-panel:fullscreen .trade-workspace {
  min-height: calc(100vh - 150px);
}
.trade-panel:fullscreen .trade-price-chart,
.trade-panel:fullscreen .trade-chart-wrap {
  height: calc(100vh - 190px);
}
.active-queue {
  display: none;
  margin-bottom: 14px;
  border: 1px solid #6b5723;
  border-radius: 10px;
  background: #2b240f;
  color: var(--amber);
  padding: 10px 12px;
  font-size: 12px;
}
@media (max-width: 1400px) {
  .run-card {
    grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.25fr);
  }
  .run-stats {
    grid-column: 1;
  }
  .run-actions {
    grid-column: 2;
    grid-template-columns: repeat(2, minmax(0, 140px));
    justify-content: end;
  }
}
@media (max-width: 760px) {
  .run-card {
    grid-template-columns: 1fr;
  }
  .run-stats,
  .run-actions {
    grid-column: auto;
  }
  .run-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .trade-chart-head {
    align-items: stretch;
    flex-direction: column;
  }
  .trade-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .strategy-decision {
    align-items: stretch;
    flex-direction: column;
  }
  .indicator-toggles {
    display: grid;
    grid-template-columns: 1fr;
  }
  .trade-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  .trade-controls select {
    min-width: 0;
  }
  .trade-workspace {
    grid-template-columns: 1fr;
  }
  .trade-visual {
    border-right: 0;
  }
  .trade-hint,
  .pane-labels {
    display: none;
  }
  .episode-inspector {
    max-height: 520px;
  }
  .audit-periods {
    grid-template-columns: 1fr;
  }
  .audit-overview {
    align-items: flex-start;
  }
}
@media (max-width: 950px) {
  .grid,
  .grid.sidebar-collapsed {
    grid-template-columns: 1fr;
  }
  .sidebar-toggle-icon {
    transform: rotate(90deg);
  }
  .grid.sidebar-collapsed .form {
    min-height: 0;
  }
  .grid.sidebar-collapsed .form-head {
    flex-direction: row;
  }
  .grid.sidebar-collapsed .sidebar-toggle-icon {
    transform: rotate(-90deg);
  }
  .metrics {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 600px) {
  body {
    background-attachment: scroll;
  }
  .wrap {
    width: calc(100% - 20px);
    padding: 14px 0;
  }
  .top {
    margin-bottom: 14px;
  }
  .status #dbState,
  .status-dot {
    display: none;
  }
  .card {
    border-radius: 15px;
    padding: 17px;
  }
  .runs-heading {
    margin-bottom: 16px;
  }
  .runs-heading p {
    display: none;
  }
  .run-card {
    padding: 15px;
  }
  .run-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .run-stat:nth-child(3) {
    border-left: 0;
    border-top: 1px solid #1e343f;
  }
  .run-stat:nth-child(4) {
    border-top: 1px solid #1e343f;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}
