:root {
  --bg: #02070a;
  --panel: #071116;
  --panel-2: #0b1c24;
  --panel-3: #09171e;
  --line: #1a343f;
  --line-soft: #102630;
  --text: #e9f4f6;
  --muted: #7f99a1;
  --teal: #13d6ac;
  --red: #ff4e63;
  --amber: #f2b84b;
  --blue: #e2e8eb;
}

/* Live market signals */
.market-signal-band {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(7,17,22,.96);
  overflow: hidden;
}
.market-signal-band-head {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
}
.market-signal-band-head > div { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.market-signal-band-head strong { font-size: 13px; }
.market-signal-band-head span { min-width: 0; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-signal-band-head span.warning { color: var(--amber); }
.market-signal-band-head a { color: var(--teal); font-size: 11px; font-weight: 900; text-decoration: none; white-space: nowrap; }
.market-signal-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 10px;
  padding: 4px 10px 6px;
}
.market-signal-compact {
  min-width: 0;
  min-height: 42px;
  display: grid;
  grid-template-columns: 48px minmax(130px, 1fr) minmax(120px, .8fr) 68px;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.market-signal-compact:hover { background: rgba(24,199,167,.07); }
.market-signal-compact time { color: var(--muted); font-size: 10px; }
.market-signal-compact strong { min-width: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-signal-compact small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.market-signal-compact b { min-width: 0; font-size: 11px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-signal-compact em { font-size: 10px; font-style: normal; text-align: right; white-space: nowrap; }

.signals-shell { align-content: start; }
.signal-health-strip {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(7,17,22,.96);
  overflow: hidden;
}
.signal-health-strip > div {
  min-width: 0;
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px 14px;
  border-right: 1px solid var(--line);
}
.signal-health-strip > div:last-child { border-right: 0; }
.signal-health-strip span { color: var(--muted); font-size: 10px; font-weight: 850; }
.signal-health-strip strong { font-size: 18px; line-height: 1; font-variant-numeric: tabular-nums; }
.signal-health-strip small { min-width: 0; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signal-toolbar {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(440px, 1fr) minmax(140px, 220px) 132px 62px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(7,17,22,.96);
}
.signal-segments {
  min-width: 0;
  height: 32px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}
.signal-segments button {
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #061218;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.signal-segments button:last-child { border-right: 0; }
.signal-segments button.active { color: #041016; background: var(--teal); }
.signal-search-input,
.signal-toolbar select,
.signal-toolbar > button { width: 100%; height: 32px; }
.signal-search-input { text-transform: uppercase; font-weight: 850; }
.signal-toolbar > button { border-color: rgba(19,214,172,.42); color: var(--teal); font-weight: 900; }
.signal-workspace {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(7,17,22,.96);
  overflow: hidden;
}
.signal-feed-region { min-width: 0; }
.signal-column-head,
.market-signal-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 78px 112px minmax(140px, .85fr) minmax(150px, 1fr) minmax(190px, 1.25fr) 78px;
  gap: 10px;
  align-items: center;
}
.signal-column-head {
  min-height: 36px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}
.signal-feed { min-height: 280px; max-height: calc(100vh - 220px); overflow-y: auto; }
.market-signal-row {
  min-height: 58px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.market-signal-row:hover { background: rgba(24,199,167,.07); }
.market-signal-row time { color: var(--text); font-size: 11px; font-style: normal; }
.market-signal-row time small,
.market-signal-row strong small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-signal-kind { min-width: 0; color: var(--teal); font-size: 10px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-signal-kind.kind-kucoin_microcap_orderbook { color: var(--amber); }
.market-signal-kind.kind-single_exchange_sell_wall { color: var(--red); }
.market-signal-row strong,
.market-signal-row b,
.market-signal-row em,
.market-signal-row i { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-signal-row strong { font-size: 13px; }
.market-signal-row b { font-size: 11px; text-align: right; }
.market-signal-row em { color: var(--muted); font-size: 10px; font-style: normal; text-align: right; }
.market-signal-row i { font-size: 10px; font-style: normal; font-weight: 850; text-align: right; }
.delivery-sent { color: var(--teal); }
.delivery-warning { color: var(--amber); }
.delivery-error { color: var(--red); }
.delivery-pending { color: var(--muted); }
.signal-feed-empty { min-height: 280px; display: grid; place-items: center; }
.signal-insights {
  min-width: 0;
  border-left: 1px solid var(--line);
  background: #061016;
}
.signal-insights > section + section { border-top: 1px solid var(--line); }
.signal-insight-head {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 11px;
  border-bottom: 1px solid var(--line-soft);
}
.signal-insight-head strong { font-size: 12px; }
.signal-insight-head span { color: var(--muted); font-size: 9px; }
.signal-distribution { padding: 10px; }
.signal-distribution-row {
  min-height: 34px;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 28px;
  gap: 8px;
  align-items: center;
  font-size: 10px;
}
.signal-distribution-row > div { height: 5px; background: #132128; overflow: hidden; }
.signal-distribution-row i { display: block; height: 100%; background: var(--teal); }
.signal-distribution-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.signal-top-symbols { padding: 4px 10px 10px; }
.signal-top-symbols a {
  min-height: 34px;
  display: grid;
  grid-template-columns: 20px minmax(60px, 1fr) 42px 92px;
  gap: 7px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  text-decoration: none;
  font-size: 10px;
}
.signal-top-symbols a:hover { background: rgba(24,199,167,.07); }
.signal-top-symbols span { color: var(--muted); }
.signal-top-symbols em,
.signal-top-symbols i { color: var(--muted); font-style: normal; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1100px) {
  .market-signal-strip { grid-template-columns: 1fr; }
  .signal-health-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .signal-health-strip > div:nth-child(2) { border-right: 0; }
  .signal-health-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .signal-toolbar { grid-template-columns: 1fr minmax(160px, .7fr) 132px 62px; }
  .signal-segments { grid-column: 1 / -1; }
  .signal-workspace { grid-template-columns: 1fr; }
  .signal-insights { border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .signal-insights > section + section { border-top: 0; border-left: 1px solid var(--line); }
  .signal-feed { max-height: none; overflow-y: visible; }
}

@media (max-width: 680px) {
  .market-signal-band-head > div { display: grid; gap: 2px; }
  .market-signal-compact { grid-template-columns: 42px minmax(110px, 1fr) 62px; gap: 6px; }
  .market-signal-compact b { grid-column: 2 / 4; grid-row: 2; text-align: left; padding-bottom: 5px; }
  .signal-health-strip { grid-template-columns: 1fr; }
  .signal-health-strip > div { min-height: 64px; border-right: 0; border-bottom: 1px solid var(--line); }
  .signal-health-strip > div:nth-child(2) { border-right: 0; }
  .signal-health-strip > div:last-child { border-bottom: 0; }
  .signal-toolbar { grid-template-columns: 1fr 82px; }
  .signal-segments { height: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .signal-segments button { min-height: 32px; border-bottom: 1px solid var(--line); }
  .signal-segments button:nth-child(2) { border-right: 0; }
  .signal-segments button:nth-child(n+3) { border-bottom: 0; }
  .signal-search-input { grid-column: 1 / -1; }
  .signal-toolbar select { min-width: 0; }
  .signal-column-head { display: none; }
  .market-signal-row {
    grid-template-columns: 64px minmax(0, 1fr) 72px;
    gap: 6px 8px;
    padding: 10px;
  }
  .market-signal-row time { grid-column: 1; grid-row: 1; }
  .market-signal-row > strong { grid-column: 2; grid-row: 1; }
  .market-signal-row > i { grid-column: 3; grid-row: 1; }
  .market-signal-row .market-signal-kind { grid-column: 1; grid-row: 2; }
  .market-signal-row > b { grid-column: 2 / 4; grid-row: 2; text-align: left; }
  .market-signal-row > em { grid-column: 2 / 4; grid-row: 3; text-align: left; padding-bottom: 2px; }
  .signal-insights { grid-template-columns: 1fr; }
  .signal-insights > section + section { border-left: 0; border-top: 1px solid var(--line); }
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; }
html { overflow-x: hidden; overflow-y: auto; }
body { overflow: visible; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(2, 7, 10, .88);
  backdrop-filter: blur(8px);
}
.access-box {
  width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #071116;
  padding: 18px;
  display: grid;
  gap: 11px;
  box-shadow: 0 22px 70px rgba(0,0,0,.45);
}
.access-box strong { font-size: 18px; }
.access-box span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.access-box input {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #020a0e;
  color: var(--text);
  padding: 0 11px;
  outline: 0;
}
.access-box input:focus { border-color: rgba(19,214,172,.65); }
.access-box button {
  height: 38px;
  border: 1px solid rgba(19,214,172,.55);
  border-radius: 5px;
  background: rgba(19,214,172,.15);
  color: var(--teal);
  font-weight: 900;
}
.access-box small { min-height: 16px; color: var(--red); }

.terminal-top {
  height: 46px;
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 190px auto 76px minmax(150px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 12, 17, 0.96);
}
.mini-nav {
  height: 30px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.mini-nav a {
  height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}
.mini-nav a.active,
.mini-nav a:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--panel);
}
.brand { display: flex; align-items: center; gap: 9px; }
.top-brand strong { font-size: 15px; letter-spacing: 0; }
.top-brand span { color: var(--muted); font-size: 11px; margin-left: 7px; }
.pulse-mark {
  width: 22px; height: 22px; border-radius: 5px;
  background: linear-gradient(135deg, var(--teal), #5fd5ff);
}
.live-pill {
  height: 28px; border: 1px solid var(--line); border-radius: 7px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  color: var(--teal); font-weight: 800; font-size: 12px; background: var(--panel);
}
.live-pill span { width: 7px; height: 7px; background: var(--teal); border-radius: 50%; }
.polling { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.top-controls { display: flex; align-items: center; gap: 8px; }
.global-search {
  width: min(360px, 30vw);
  height: 32px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  border: 1px solid rgba(19,214,172,.38);
  background: #041016;
  border-radius: 6px;
  overflow: hidden;
}
.global-search span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  border-right: 1px solid var(--line-soft);
}
.global-search input {
  height: 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-weight: 850;
  text-transform: uppercase;
}
.segmented {
  height: 32px; border: 1px solid var(--line); border-radius: 7px; display: flex; align-items: center; gap: 4px; padding: 3px 5px; background: var(--panel);
}
.segmented b { color: var(--muted); font-size: 12px; padding: 0 7px; }
.segmented button { height: 24px; padding: 0 9px; }

.app {
  min-height: calc(100vh - 46px);
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr) 320px;
  overflow: visible;
  align-items: start;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #030b0f;
  padding: 10px 8px;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(160px, 1fr) auto auto;
  min-height: 0;
  overflow: hidden;
}
.news-sidebar {
  position: sticky;
  top: 46px;
  height: calc(100vh - 46px);
  overflow: auto;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
}
.news-search-row { margin-bottom: 0; }
.news-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--line);
}
.news-head strong { font-size: 14px; }
.news-head span { color: var(--muted); font-size: 11px; line-height: 1.25; }
.side-row { margin: 0 0 10px; }
input, select, button {
  border: 1px solid var(--line);
  background: #040d12;
  color: var(--text);
  border-radius: 4px;
  height: 30px;
  padding: 0 9px;
  font-size: 12px;
}
input { width: 100%; }
button { cursor: pointer; }
.side-head {
  display: grid; grid-template-columns: 1fr 78px 70px;
  color: var(--muted); text-transform: uppercase; font-weight: 800; font-size: 10px;
  padding: 7px 8px; border-bottom: 1px solid var(--line);
}
.section-title {
  color: var(--muted); font-size: 11px; text-transform: uppercase; font-weight: 800;
  margin: 12px 4px 8px;
}
.watch-custom-head {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0 4px;
}
.watch-custom-head button { height: 22px; padding: 0 7px; color: var(--muted); }
.observe-list {
  max-height: 118px;
  min-height: 42px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 9px;
}
.observe-empty { color: var(--muted); font-size: 12px; padding: 12px 10px; }
.observe-item {
  width: 100%;
  height: 34px;
  display: grid;
  grid-template-columns: 1fr 58px 20px;
  align-items: center;
  gap: 6px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  text-align: left;
}
.observe-item:hover, .observe-item.active { background: rgba(24, 199, 167, 0.08); }
.observe-item span { font-size: 12px; font-weight: 900; }
.observe-item small { display: inline; color: var(--muted); font-size: 10px; margin-left: 6px; font-weight: 700; }
.observe-item strong { text-align: right; font-size: 11px; font-variant-numeric: tabular-nums; }
.observe-item em { color: var(--muted); font-style: normal; text-align: center; font-size: 14px; }
.watchlist { min-height: 0; overflow: auto; }
.watch-item {
  width: 100%; border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0;
  background: transparent; color: var(--text); padding: 6px 8px; text-align: left;
}
.watch-item:hover, .watch-item.active { background: rgba(24, 199, 167, 0.08); }
.watch-top { display: grid; grid-template-columns: 1fr 76px; gap: 8px; font-size: 12px; font-weight: 800; }
.watch-top span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.watch-meta { display: grid; grid-template-columns: 1fr 70px; gap: 8px; color: var(--muted); font-size: 11px; margin-top: 2px; }
.watch-meta em { font-style: normal; }
.watch-meta span:last-child { text-align: right; font-weight: 800; }
.exchange-status { border: 1px solid var(--line); border-radius: 4px; overflow: auto; min-height: 0; }
.status-row { display: grid; grid-template-columns: 1fr 52px 82px; padding: 7px 8px; border-bottom: 1px solid var(--line-soft); font-size: 11px; }
.status-row:last-child { border-bottom: 0; }
.status-row strong { font-size: 10px; }
.status-row small { text-align: right; color: var(--muted); }
.rightbar {
  position: sticky;
  top: 46px;
  height: calc(100vh - 46px);
  min-height: 0;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: #030b0f;
  padding: 8px;
  display: grid;
  grid-template-rows: auto minmax(44px, 76px) auto minmax(118px, 190px) auto minmax(120px, 180px) minmax(220px, 300px) auto minmax(120px, 180px);
  gap: 7px;
}
.rightbar .observe-list { margin-bottom: 0; max-height: none; }
.rightbar .watchlist { border: 1px solid var(--line); border-radius: 4px; }
.rightbar .side-head { border: 1px solid var(--line); border-bottom: 0; border-radius: 4px 4px 0 0; padding: 6px 8px; }
.candidate-head { grid-template-columns: 1fr 42px 78px; }
.candidate-list {
  min-height: 0;
  max-height: 210px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.candidate-item {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(82px, 1fr) 30px 78px;
  grid-template-rows: 20px 16px;
  gap: 3px 6px;
  align-items: center;
  padding: 4px 7px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  text-align: left;
}
.candidate-item:hover, .candidate-item.active { background: rgba(24,199,167,.08); }
.candidate-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.candidate-item b { font-size: 12px; }
.candidate-item small { color: var(--muted); font-size: 10px; margin-left: 5px; }
.candidate-item strong {
  justify-self: center;
  min-width: 26px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  font-size: 11px;
  border: 1px solid var(--line);
}
.grade-s { color: var(--amber); border-color: rgba(242,184,75,.7) !important; background: rgba(242,184,75,.1); }
.grade-a { color: var(--teal); border-color: rgba(19,214,172,.55) !important; background: rgba(19,214,172,.08); }
.grade-b { color: var(--muted); }
.candidate-item em {
  color: var(--muted);
  font-style: normal;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.candidate-item i {
  font-style: normal;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.candidate-item i:nth-of-type(1) { grid-column: 1 / 2; }
.candidate-item i:nth-of-type(2) { grid-column: 2 / 4; text-align: right; }
.rightbar .live-tape-panel {
  grid-template-columns: 1fr;
  grid-template-rows: 32px minmax(0, 1fr);
  min-height: 0;
  max-height: none;
}
.rightbar .tape-head {
  border-right: 0;
  border-bottom: 1px solid var(--line);
  padding: 5px 8px;
}
.rightbar .tape-head span { display: none; }
.rightbar .live-tape {
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  padding: 5px;
}
.rightbar .tape-item {
  width: 100%;
  height: 34px;
  flex: none;
}
.hidden { display: none !important; }

.main {
  padding: 8px;
  min-width: 0;
  max-width: 100%;
  min-height: calc(100vh - 46px);
  height: auto;
  overflow: visible;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 46px 64px auto auto minmax(520px, 66vh) minmax(360px, auto);
  gap: 7px;
}
.exchange-tabs {
  height: 46px; display: flex; gap: 4px; align-items: center;
  border: 1px solid var(--line); background: var(--panel); border-radius: 4px; padding: 5px; margin-bottom: 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.exchange-tabs button {
  min-width: 112px;
  height: 34px;
  display: grid;
  grid-template-rows: 17px 12px;
  align-content: center;
  gap: 1px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}
.exchange-tabs button.active, .exchange-tabs button:hover { color: var(--text); background: var(--panel-2); border-color: var(--line-soft); }
.exchange-tabs button.hot { border-color: rgba(242,184,75,.35); }
.exchange-tabs button span,
.exchange-tabs button small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.exchange-tabs button small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: none;
}
.exchange-tabs button.active small { color: var(--teal); }
.exchange-tabs button.disabled {
  opacity: .38;
  cursor: not-allowed;
  color: var(--muted);
}
.exchange-tabs button.disabled:hover {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.contract-strip {
  width: 100%;
  min-width: 0;
  height: 64px; display: grid; grid-template-columns: minmax(156px, 1.25fr) minmax(96px, .88fr) minmax(104px, .9fr) minmax(92px, .82fr) repeat(3, minmax(68px, .7fr)); align-items: center;
  border: 1px solid var(--line); background: var(--panel); border-radius: 4px; margin-bottom: 0;
  overflow: hidden;
}
.contract-main { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-right: 1px solid var(--line); height: 100%; }
.star { width: 24px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 18px; }
.star.active, .row-star.active, .alert-star.active { color: var(--amber); }
h1 { margin: 0; font-size: 17px; line-height: 1.05; }
.contract-main span { color: var(--muted); font-size: 11px; }
.contract-stat { padding: 0 14px; border-right: 1px solid var(--line); height: 100%; display: flex; flex-direction: column; justify-content: center; }
.contract-stat:last-child { border-right: 0; }
.contract-stat span { color: var(--muted); font-size: 11px; }
.contract-stat strong { font-size: 15px; margin-top: 5px; font-variant-numeric: tabular-nums; }
.contract-stat #lastPrice, .contract-stat #fundingRate { cursor: pointer; text-decoration: underline; text-decoration-color: rgba(127,153,161,.35); text-underline-offset: 3px; }
.contract-stat.big strong { font-size: 22px; }
.contract-stat small { color: var(--muted); font-size: 10px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.contract-main, .contract-stat { min-width: 0; overflow: hidden; }
.contract-main h1, .contract-main span, .contract-stat span, .contract-stat strong, .contract-stat small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.symbol-overview {
  min-width: 0;
  min-height: 116px;
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr);
  grid-template-rows: 72px 43px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(7, 17, 22, 0.96);
  overflow: hidden;
}
.overview-head {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.overview-head strong {
  font-size: 14px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.overview-head span {
  color: var(--amber);
  font-size: 11px;
  line-height: 1.35;
}
.overview-kpis {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(96px, 1fr));
  border-bottom: 1px solid var(--line);
}
.overview-kpis div {
  min-width: 0;
  padding: 9px 10px;
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.overview-kpis span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}
.overview-kpis strong {
  margin-top: 4px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.overview-kpis small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.overview-exchanges {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  gap: 4px;
  padding: 4px 6px;
  overflow-x: auto;
  overflow-y: hidden;
}
.overview-exchange {
  height: 34px;
  flex: 0 0 236px;
  min-width: 236px;
  display: grid;
  grid-template-columns: minmax(70px, 1fr) 70px 74px 46px;
  gap: 5px;
  align-items: center;
  border-color: var(--line-soft);
  background: #061218;
  padding: 0 7px;
  text-align: left;
}
.overview-exchange:hover,
.overview-exchange.active {
  background: rgba(24, 199, 167, 0.08);
  border-color: rgba(19,214,172,.42);
}
.overview-exchange.hot { border-color: rgba(242,184,75,.42); }
.overview-exchange span,
.overview-exchange strong,
.overview-exchange em,
.overview-exchange i {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.overview-exchange strong,
.overview-exchange em,
.overview-exchange i { text-align: right; }
.overview-exchange i { color: var(--muted); }
.overview-exchange span small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.overview-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  padding: 18px 14px;
}

.chart-panel, .alerts-panel, .table-panel, .card, .resonance-panel {
  background: rgba(10, 25, 33, 0.96);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.resonance-panel { margin-bottom: 0; overflow: hidden; min-height: 0; }
.panel-head.compact { height: 32px; padding: 5px 10px; }
.resonance-board {
  min-height: 42px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(430px, 1fr);
  grid-template-columns: none;
  gap: 5px;
  padding: 5px;
  overflow-x: auto;
}
.resonance-card {
  height: 34px;
  min-width: 430px;
  display: grid;
  grid-template-columns: 72px 88px 42px 78px 72px 92px minmax(120px, 1fr) 24px;
  align-items: center;
  gap: 7px;
  text-align: left;
  padding: 0 8px;
  border-color: var(--line);
  background: #061218;
  overflow: hidden;
}
.resonance-card:hover, .resonance-card.active { background: rgba(24, 199, 167, 0.08); border-color: rgba(19,214,172,.42); }
.resonance-card.short:hover, .resonance-card.exit:hover, .resonance-card.short.active, .resonance-card.exit.active { border-color: rgba(255,78,99,.42); }
.resonance-card strong { font-size: 13px; letter-spacing: 0; }
.resonance-card span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.resonance-card .signal { min-width: 76px; height: 20px; }
.res-legs { color: var(--muted); }
.res-observe { color: var(--amber) !important; font-size: 14px !important; text-align: center; cursor: pointer; }
.resonance-empty { grid-column: 1 / -1; color: var(--muted); font-size: 12px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 4px; }
.live-tape-panel {
  min-height: 0;
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  border: 1px solid var(--line);
  background: rgba(7, 17, 22, 0.96);
  border-radius: 4px;
  overflow: hidden;
}
.tape-head {
  border-right: 1px solid var(--line);
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.tape-head strong { font-size: 13px; }
.tape-head span { color: var(--muted); font-size: 10px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-tape {
  min-width: 0;
  overflow-x: auto;
  display: flex;
  gap: 5px;
  padding: 5px;
}
.tape-item {
  flex: 0 0 206px;
  height: 30px;
  display: grid;
  grid-template-columns: 34px 1fr 58px 54px;
  gap: 5px;
  align-items: center;
  padding: 0 7px;
  border-color: var(--line-soft);
  background: #061218;
  text-align: left;
}
.tape-item:hover { background: rgba(24, 199, 167, 0.08); border-color: rgba(19,214,172,.42); }
.tape-item span { color: var(--amber); font-size: 10px; font-weight: 900; }
.tape-item strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.tape-item small { color: var(--muted); font-size: 10px; margin-left: 5px; }
.tape-item em, .tape-item i {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  font-style: normal;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.tape-item i { color: var(--muted); }
.module-dock {
  min-height: 0;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  border: 1px solid var(--line);
  background: rgba(7, 17, 22, 0.96);
  border-radius: 4px;
  overflow: hidden;
}
.module-nav {
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: repeat(10, 1fr);
  padding: 4px;
  gap: 3px;
}
.module-nav button {
  height: auto;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  text-align: left;
}
.module-nav button.active, .module-nav button:hover {
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--line-soft);
}
.module-board {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  grid-auto-rows: 32px;
  gap: 4px;
  padding: 5px;
}
.module-board.event-board {
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  grid-auto-rows: auto;
  align-content: start;
}
.module-board.event-board .event-summary-bar { grid-column: 1 / -1; }
.module-row {
  height: 32px;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(66px, 1fr) 82px 58px 92px;
  gap: 6px;
  align-items: center;
  padding: 0 7px;
  border-color: var(--line-soft);
  background: #061218;
  text-align: left;
  overflow: hidden;
}
.module-row:hover { background: rgba(24, 199, 167, 0.08); border-color: rgba(19,214,172,.42); }
.module-row span, .coverage-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-row b { font-size: 12px; }
.module-row small, .coverage-row small { color: var(--muted); font-size: 10px; margin-left: 5px; }
.module-row strong, .module-row em, .module-row i {
  font-size: 11px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.module-row i { color: var(--muted); }
.action-row {
  grid-template-columns: minmax(82px, 1fr) 74px 64px 132px;
}
.module-empty { color: var(--muted); font-size: 12px; padding: 10px; }
.event-tape span { color: #5fd5ff; }
.event-radar-panel {
  min-height: 0;
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  border: 1px solid var(--line);
  background: rgba(7, 17, 22, 0.96);
  border-radius: 4px;
  overflow: hidden;
}
.event-radar-head {
  border-right: 1px solid var(--line);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.event-radar-head strong { font-size: 13px; }
.event-radar-head span { color: var(--muted); font-size: 10px; margin-top: 3px; line-height: 1.25; }
.event-radar-strip {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 8px;
  padding: 4px;
}
.event-strip-card {
  width: 100%;
  min-height: 148px;
  height: auto;
  display: grid;
  grid-template-rows: 22px auto auto 26px;
  gap: 5px;
  padding: 10px;
  border-color: var(--line-soft);
  border-radius: 4px;
  background: #061218;
  text-align: left;
  overflow: hidden;
}
.event-strip-card:hover { background: rgba(24, 199, 167, 0.08); border-color: rgba(19,214,172,.42); }
.event-strip-card.long { border-left: 3px solid rgba(19,214,172,.75); }
.event-strip-card.short { border-left: 3px solid rgba(255,78,99,.8); }
.event-strip-top {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 48px;
  gap: 6px;
  align-items: center;
}
.event-strip-top strong { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-strip-top span, .event-strip-top em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event-strip-top em { text-align: right; color: var(--amber); }
.event-strip-title {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text);
  overflow: visible;
  font-weight: 760;
}
.event-strip-original {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.28;
  max-height: 42px;
  overflow: hidden;
}
.event-strip-metrics {
  display: grid;
  grid-template-columns: 76px repeat(3, 1fr);
  gap: 5px;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.event-strip-metrics span, .event-strip-metrics b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event-strip-metrics b { text-align: right; }
.event-strip-empty { color: var(--muted); font-size: 12px; padding: 12px; }
.event-summary-bar {
  height: 32px;
  display: grid;
  grid-template-columns: 42px 48px 42px 72px minmax(180px, 1fr);
  gap: 5px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line-soft);
  background: #061218;
  font-size: 11px;
  color: var(--muted);
}
.event-summary-bar strong { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.event-summary-bar small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-card {
  min-height: 104px;
  border: 1px solid var(--line-soft);
  background: #061218;
  border-radius: 4px;
  padding: 8px;
  overflow: hidden;
}
.event-meta {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) 104px 46px;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
}
.event-meta strong { color: var(--amber); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-meta span, .event-meta em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: normal; text-align: right; }
.event-title {
  margin-top: 5px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
  max-height: none;
  overflow: visible;
}
.event-original {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  max-height: 38px;
  overflow: hidden;
}
.event-title a { color: inherit; text-decoration: none; }
.event-title a:hover { color: var(--teal); }
.event-summary {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  max-height: 28px;
  overflow: hidden;
}
.event-foot {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}
.event-coins { display: flex; gap: 4px; min-width: 0; overflow: hidden; }
.event-coins span {
  height: 18px;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--teal);
  background: rgba(19, 214, 172, .06);
}
.event-heat { white-space: nowrap; font-variant-numeric: tabular-nums; }
.event-reactions {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}
.event-reaction {
  height: 28px;
  min-width: 0;
  display: grid;
  grid-template-columns: 42px 30px repeat(3, 1fr);
  gap: 3px;
  align-items: center;
  padding: 0 5px;
  border-color: var(--line-soft);
  background: #040d12;
  text-align: left;
}
.event-reaction:hover { background: rgba(24, 199, 167, 0.08); border-color: rgba(19,214,172,.42); }
.event-reaction b, .event-reaction small, .event-reaction em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.event-reaction small { color: var(--muted); }
.event-reaction em { text-align: right; }
.event-no-reaction {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  padding: 6px;
  border: 1px dashed var(--line);
  border-radius: 3px;
}
.coverage-summary {
  height: 32px;
  display: grid;
  grid-template-columns: 48px 58px 48px 58px 48px 72px minmax(160px, 1fr);
  gap: 5px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line-soft);
  background: #061218;
  font-size: 11px;
  color: var(--muted);
}
.coverage-summary strong { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.coverage-summary small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coverage-row {
  height: 32px;
  display: grid;
  grid-template-columns: 1fr 48px 58px 50px;
  gap: 6px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line-soft);
  background: #061218;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.coverage-row strong, .coverage-row em, .coverage-row i { text-align: right; font-style: normal; }
.coverage-row em, .coverage-row i { color: var(--muted); }
.chart-panel {
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 40px auto minmax(360px, 1fr) 34px;
}
.alerts-panel {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: 36px minmax(104px, 1fr) 26px auto;
}
.rightbar .alerts-panel {
  grid-template-rows: 34px minmax(112px, 1fr) 24px auto;
  min-height: 0;
  max-height: none;
}
.chart-toolbar {
  height: 40px; display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-bottom: 1px solid var(--line);
}
.chart-select-group {
  height: 30px;
  display: grid;
  grid-template-columns: auto minmax(82px, 1fr);
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}
.chart-select-group select { min-width: 86px; }
.chart-select-group span { white-space: nowrap; }
.tool-tabs { display: flex; gap: 4px; }
.tool-tabs button, .range-buttons button { height: 26px; border-color: transparent; background: transparent; color: var(--muted); }
.tool-tabs button { min-width: 58px; padding: 0 10px; white-space: nowrap; }
.tool-tabs button.active, .range-buttons button.active { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.oi-metric-tabs {
  height: 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(62px, 1fr));
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.oi-metric-tabs button {
  min-width: 72px;
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}
.oi-metric-tabs button:last-child { border-right: 0; }
.oi-metric-tabs button.active { color: var(--teal); background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--teal); }
.oi-metric-tabs.hidden { display: none; }
.legend { margin-left: auto; display: flex; gap: 14px; color: var(--muted); font-size: 11px; }
.legend span { white-space: nowrap; }
.legend i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 5px; }
.legend .up { background: var(--teal); }
.legend .down { background: var(--red); }
.legend .line { background: var(--blue); }
.legend .funding { background: var(--amber); }
.oi-range-summary {
  min-width: 0;
  border-bottom: 1px solid var(--line);
  background: #051016;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  overflow: hidden;
}
.summary-title {
  min-width: 0;
  padding: 9px 12px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.summary-title strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summary-title span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summary-kpis {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(104px, 1fr));
}
.summary-kpis div {
  min-width: 0;
  padding: 8px 10px;
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.summary-kpis span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}
.summary-kpis strong {
  margin-top: 4px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summary-kpis small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summary-empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
}
.oi-quality-panel {
  min-width: 0;
  min-height: 62px;
  display: grid;
  grid-template-columns: 1.05fr 1.15fr 1.45fr 1fr;
  border: 1px solid var(--line);
  background: var(--panel-3);
  overflow: hidden;
}
.quality-cell {
  min-width: 0;
  padding: 8px 12px;
  border-right: 1px solid var(--line-soft);
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: center;
  gap: 3px;
}
.quality-cell:last-child { border-right: 0; }
.quality-cell > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
}
.quality-cell > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.quality-cell > small {
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quality-meter {
  width: 100%;
  height: 3px;
  margin-top: 2px;
  background: var(--line-soft);
  overflow: hidden;
}
.quality-meter i { display: block; height: 100%; background: var(--teal); }
.quality-cell.partial .quality-meter i { background: var(--amber); }
.quality-cell.pending strong { color: var(--amber); }
#chart { width: 100%; height: 100%; min-height: 0; display: block; cursor: crosshair; }
.chart-canvas-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.chart-inspect {
  position: absolute;
  z-index: 5;
  width: 226px;
  border: 1px solid rgba(19,214,172,.48);
  border-radius: 5px;
  background: rgba(4,13,18,.96);
  box-shadow: 0 16px 42px rgba(0,0,0,.35);
  padding: 9px;
  pointer-events: none;
}
.chart-inspect strong {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}
.chart-inspect span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 7px;
  white-space: nowrap;
}
.chart-inspect div {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  line-height: 1.55;
}
.chart-inspect em {
  color: var(--muted);
  font-style: normal;
}
.chart-inspect b {
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.range-buttons { height: 34px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 4px; padding: 4px 10px; color: var(--muted); font-size: 11px; overflow: hidden; }
.range-buttons b { color: var(--muted); font-size: 11px; margin-right: 5px; }
.range-buttons span { margin-left: auto; }
.range-buttons .hint { margin-left: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.panel-head { height: 40px; padding: 8px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.alerts-panel .panel-head { height: 36px; padding: 5px 12px; }
h2 { margin: 0; font-size: 13px; text-transform: uppercase; }
h2 small { color: var(--muted); font-size: 11px; text-transform: none; }
.panel-head span { color: var(--muted); font-size: 11px; }
.anomaly-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 5px;
  min-height: 0;
  overflow: hidden;
}
.anomaly-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-3);
  padding: 5px 6px;
  min-height: 58px;
  max-height: 64px;
  overflow: hidden;
}
.anomaly-card.warn { border-color: rgba(242, 184, 75, .55); background: linear-gradient(180deg, rgba(242, 184, 75, .08), var(--panel-3)); }
.anomaly-card.critical { border-color: rgba(255, 82, 99, .68); background: linear-gradient(180deg, rgba(255, 82, 99, .1), var(--panel-3)); }
.anomaly-card h3 { margin: 0 0 3px; font-size: 10px; }
.anomaly-card .big { font-size: 16px; font-weight: 900; line-height: 1; margin-bottom: 5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.anomaly-card .row { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; line-height: 1.12; gap: 3px; }
.anomaly-card .row strong { font-variant-numeric: tabular-nums; }
.alert-title { height: 24px; display: flex; align-items: center; padding: 0 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-transform: uppercase; font-weight: 800; font-size: 11px; }
.alerts { min-height: 0; overflow: auto; padding: 0; }
.alert { display: grid; grid-template-columns: 68px 20px 1fr; gap: 6px; align-items: start; border-bottom: 1px solid var(--line-soft); padding: 5px 9px; background: transparent; }
.alert.warn { border-left: 3px solid var(--amber); }
.alert.critical { border-left: 3px solid var(--red); }
.alert-time { color: var(--muted); font-size: 11px; }
.alert-star, .row-star {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}
.row-star { display: inline-block; vertical-align: top; margin-right: 4px; }
.alert-msg { font-size: 11px; line-height: 1.18; cursor: pointer; }
.alert-msg b { color: var(--text); }

.cards { display: none; }
.up { color: var(--teal); }
.down { color: var(--red); }
.warn-text { color: var(--amber); }
.muted { color: var(--muted); }

.table-panel {
  margin-top: 0;
  min-height: 360px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 40px minmax(320px, 1fr);
}
.table-panel .panel-head input { width: 160px; height: 28px; }
table {
  display: block;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-collapse: collapse;
  font-size: 11px;
}
thead { position: sticky; top: 0; background: #0b1820; z-index: 1; }
tbody { display: block; height: 100%; min-height: 0; overflow: auto; }
thead tr, tbody tr {
  display: grid;
  grid-template-columns: 42px minmax(84px, .72fr) minmax(128px, 1fr) minmax(96px, .82fr) minmax(96px, .82fr) minmax(132px, 1fr) repeat(3, minmax(116px, .95fr));
  min-width: 1010px;
  align-items: center;
}
th, td { min-width: 0; padding: 7px 8px; border-bottom: 1px solid var(--line-soft); text-align: right; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
th { color: var(--muted); text-transform: uppercase; font-size: 10px; }
th:first-child, td:first-child, th:nth-child(2), td:nth-child(2), th:nth-child(3), td:nth-child(3) { text-align: left; }
tbody tr:hover, .selected-row { background: rgba(24, 199, 167, 0.08); }
tbody tr.empty-row { min-height: 48px; color: var(--muted); }
tbody tr.empty-row:hover { background: transparent; }
tbody tr.empty-row td:first-child { grid-column: 1 / -1; text-align: left; }
td small { display: block; color: var(--muted); font-size: 10px; margin-top: 1px; }
td:nth-child(7) small,
td:nth-child(8) small,
td:nth-child(9) small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.signal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 19px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  background: #061016;
  font-size: 10px;
  font-weight: 800;
}
.signal.long, .signal.cover { color: var(--teal); border-color: rgba(19,214,172,.38); background: rgba(19,214,172,.08); }
.signal.short, .signal.exit { color: var(--red); border-color: rgba(255,78,99,.38); background: rgba(255,78,99,.08); }
.spark { display: block; width: 72px; height: 18px; margin-top: 3px; }
.spark polyline { fill: none; stroke: var(--muted); stroke-width: 1.4; vector-effect: non-scaling-stroke; }

.detail-drawer {
  position: fixed;
  top: 46px;
  right: 0;
  width: min(430px, 38vw);
  height: calc(100vh - 46px);
  z-index: 20;
  transform: translateX(104%);
  transition: transform .18s ease;
  background: rgba(5, 14, 19, .98);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 40px rgba(0,0,0,.35);
  padding: 10px;
  overflow: auto;
}
.detail-drawer.open { transform: translateX(0); }
.detail-head {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.detail-head strong { display: block; font-size: 20px; line-height: 1; }
.detail-head span { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.detail-head button { width: 28px; padding: 0; font-size: 16px; }
.detail-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.detail-actions button.active { color: var(--amber); border-color: rgba(242,184,75,.5); background: rgba(242,184,75,.08); }
.detail-kpis {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 8px;
}
.detail-kpis div {
  min-height: 54px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 4px;
  padding: 8px;
}
.detail-kpis span, .detail-section h3 {
  color: var(--muted);
  font-size: 11px;
  margin: 0;
  text-transform: uppercase;
}
.detail-kpis strong { display: block; font-size: 18px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.detail-kpis small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.detail-section {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  margin-bottom: 8px;
  overflow: hidden;
}
.detail-section h3 { padding: 8px 9px; border-bottom: 1px solid var(--line-soft); }
.detail-row {
  min-height: 31px;
  display: grid;
  grid-template-columns: 62px 74px minmax(86px, 1fr) 70px;
  gap: 6px;
  align-items: center;
  padding: 6px 9px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  font-size: 11px;
}
.detail-row:last-child { border-bottom: 0; }
.detail-row:hover { background: rgba(24,199,167,.08); }
.detail-row span { color: var(--muted); }
.detail-row strong, .detail-row em, .detail-row i {
  font-style: normal;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail-row em, .detail-row i { color: var(--muted); }
.detail-alert {
  padding: 7px 9px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11px;
}
.detail-alert span { color: var(--muted); display: block; }
.detail-alert strong { display: block; margin: 2px 0; }
.detail-alert em { font-style: normal; }
.detail-empty { color: var(--muted); font-size: 12px; padding: 10px; }
#detailNote {
  width: 100%;
  min-height: 82px;
  resize: vertical;
  border: 0;
  border-radius: 0;
  background: #040d12;
  color: var(--text);
  padding: 9px;
  font-size: 12px;
  outline: none;
}

.portal-body, .home-body, .strategy-body {
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}
.portal-top {
  min-height: 50px;
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 230px minmax(380px, 1fr) minmax(280px, 420px);
  gap: 12px;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 12, 17, .97);
}
.portal-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
}
.portal-brand span {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--teal), #5fd5ff);
}
.portal-brand strong { font-size: 15px; white-space: nowrap; }
.portal-brand em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.portal-nav {
  min-width: 0;
  display: flex;
  gap: 5px;
  align-items: center;
}
.portal-nav a {
  height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}
.portal-nav a.active,
.portal-nav a:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--panel);
}
.portal-search {
  min-width: 0;
  height: 32px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  border: 1px solid rgba(19,214,172,.38);
  border-radius: 6px;
  background: #041016;
  overflow: hidden;
}
.portal-search span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  border-right: 1px solid var(--line-soft);
}
.portal-search input { border: 0; border-radius: 0; background: transparent; height: 30px; font-weight: 850; text-transform: uppercase; }
.portal-shell {
  min-height: calc(100vh - 50px);
  padding: 12px;
  display: grid;
  gap: 10px;
}
.portal-hero {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(7,17,22,.96);
  padding: 18px;
}
.portal-hero.compact-hero { min-height: 78px; }
.portal-hero h1 { margin: 0 0 7px; font-size: 28px; line-height: 1; }
.portal-hero p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.portal-action {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(19,214,172,.45);
  border-radius: 5px;
  padding: 0 13px;
  color: var(--teal);
  text-decoration: none;
  font-weight: 900;
  white-space: nowrap;
}
.portal-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(420px, 1.15fr) minmax(320px, .85fr);
  grid-template-rows: minmax(300px, .9fr) minmax(240px, .7fr);
  gap: 10px;
}
.portal-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(7,17,22,.96);
  overflow: hidden;
}
.signal-panel { grid-row: span 2; }
.portal-panel-head {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}
.portal-panel-head strong { font-size: 13px; }
.portal-panel-head span { color: var(--muted); font-size: 11px; }
.portal-list, .portal-events, .quality-board, .settings-board, .watch-table {
  min-height: 0;
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding: 6px;
}
.portal-list.compact { max-height: 480px; }
.portal-signal {
  min-height: 50px;
  display: grid;
  grid-template-columns: 38px minmax(130px, 1fr) 74px 118px;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: #061218;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 5px;
}
.portal-signal:hover { border-color: rgba(19,214,172,.42); background: rgba(24,199,167,.08); }
.portal-signal > strong {
  height: 28px;
  min-width: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
}
.portal-signal.grade-s > strong { color: var(--amber); border-color: rgba(242,184,75,.65); background: rgba(242,184,75,.08); }
.portal-signal.grade-a > strong { color: var(--teal); border-color: rgba(19,214,172,.55); background: rgba(19,214,172,.08); }
.portal-signal span, .portal-event span, .watch-row strong, .watch-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-signal b { display: block; font-size: 13px; }
.portal-signal small, .portal-event small, .watch-row small { color: var(--muted); font-size: 10px; margin-left: 6px; }
.portal-signal em, .portal-signal i {
  font-style: normal;
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.portal-signal i { color: var(--muted); }
.portal-event {
  display: grid;
  gap: 5px;
  min-height: 78px;
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: #061218;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 6px;
}
.portal-event > span { display: flex; align-items: center; gap: 6px; }
.portal-event > span b { color: var(--text); font-size: 12px; }
.portal-event > span small { margin-left: 0; }
.portal-event:hover { border-color: rgba(19,214,172,.42); background: rgba(24,199,167,.08); }
.portal-event strong { font-size: 12px; line-height: 1.35; }
.portal-event em { color: var(--muted); font-style: normal; font-size: 10px; line-height: 1.3; max-height: 28px; overflow: hidden; }
.quality-row, .setting-row {
  min-height: 36px;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 62px 64px 52px;
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.setting-row { grid-template-columns: 128px 92px minmax(180px, 1fr); }
.quality-row span, .setting-row span { min-width: 0; font-weight: 850; }
.quality-row small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.quality-row strong, .quality-row em, .quality-row i, .setting-row strong, .setting-row small {
  text-align: right;
  font-style: normal;
  color: var(--muted);
}
.setting-row small { text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-layout, .settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 10px;
}
.watch-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.watch-kpis div {
  min-width: 0;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(7,17,22,.96);
  padding: 11px 12px;
}
.watch-kpis span,
.watch-card-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}
.watch-kpis strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.watch-kpis small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}
.watch-main-panel,
.watch-signal-panel {
  min-height: calc(100vh - 238px);
}
.watch-row {
  min-height: 46px;
  display: grid;
  grid-template-columns: minmax(92px, 1fr) minmax(180px, 1.4fr) 96px 108px 58px;
  gap: 8px;
  align-items: center;
  padding: 8px 9px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
}
.watch-row:hover { background: rgba(24,199,167,.08); }
.watch-row em, .watch-row i, .watch-row b { text-align: right; font-style: normal; font-variant-numeric: tabular-nums; }
.watch-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--line);
  border-radius: 5px;
  background: #061218;
  padding: 10px;
  margin-bottom: 7px;
}
.watch-group {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}
.watch-group h3 {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0 4px;
  color: var(--text);
  font-size: 12px;
}
.watch-group h3 small {
  min-width: 22px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 10px;
}
.watch-card.up,
.watch-card.watch-hot { border-left-color: var(--teal); }
.watch-card.down { border-left-color: var(--red); }
.watch-card.warn-text { border-left-color: var(--amber); }
.watch-card-main {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 96px 86px;
  align-items: center;
  gap: 8px;
}
.watch-card-main strong {
  min-width: 0;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.watch-card-main small {
  color: var(--muted);
  font-size: 11px;
  margin-left: 7px;
}
.watch-card-main span {
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.watch-card-main span.up,
.watch-card-main span.watch-hot { color: var(--teal); border-color: rgba(19,214,172,.45); background: rgba(19,214,172,.08); }
.watch-card-main span.down { color: var(--red); border-color: rgba(255,78,99,.45); background: rgba(255,78,99,.08); }
.watch-card-main span.warn-text { color: var(--amber); border-color: rgba(242,184,75,.45); background: rgba(242,184,75,.08); }
.watch-card-main em {
  color: var(--muted);
  text-align: right;
  font-style: normal;
  font-size: 11px;
}
.watch-card-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}
.watch-card-grid div {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: #040d12;
  padding: 8px;
}
.watch-card-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.watch-card-grid small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.watch-card-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, .9fr);
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.watch-card-note span,
.watch-card-note em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}
.watch-card-note em { text-align: right; color: var(--text); }
.watch-mini-chart {
  min-width: 0;
  height: 74px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: #040d12;
  padding: 5px 7px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 14px;
}
.watch-mini-chart > span {
  align-self: center;
  justify-self: center;
  color: var(--muted);
  font-size: 11px;
}
.watch-mini-chart svg {
  width: 100%;
  height: 52px;
  display: block;
}
.watch-mini-chart polyline {
  fill: none;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.watch-mini-chart .oi { stroke: var(--teal); }
.watch-mini-chart .price { stroke: var(--amber); opacity: .86; }
.watch-mini-chart .entry {
  stroke: rgba(233,244,246,.52);
  stroke-dasharray: 3 3;
}
.watch-mini-legend {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
}
.watch-mini-legend span:first-child { color: var(--teal); }
.watch-mini-legend span:nth-child(2) { color: var(--amber); }
.watch-mini-legend em { font-style: normal; }
.watch-card-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.watch-card-actions a,
.watch-card-actions button,
.watch-signal-row button {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #040d12;
  color: var(--muted);
  padding: 0 9px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 850;
}
.watch-card-actions a:hover,
.watch-card-actions button:hover,
.watch-signal-row button:hover {
  color: var(--text);
  border-color: rgba(19,214,172,.45);
  background: rgba(19,214,172,.08);
}
.watch-signal-row {
  grid-template-columns: 38px minmax(130px, 1fr) 72px 96px 52px;
}
.watch-signal-row button {
  color: var(--teal);
}
.portal-empty, .portal-error { color: var(--muted); font-size: 12px; padding: 12px; }
.portal-error { color: var(--red); padding: 0; }

.home-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  padding: 42px;
  background:
    linear-gradient(120deg, rgba(19,214,172,.08), transparent 34%),
    #02070a;
}
.home-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 26px;
}
.home-hero h1 { font-size: 42px; margin: 0 0 10px; }
.home-hero p { max-width: 720px; color: var(--muted); font-size: 16px; line-height: 1.7; margin: 0; }
.home-status {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--teal);
  font-weight: 900;
}
.home-status span { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.home-modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 16px;
  align-content: start;
}
.home-card {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(7,17,22,.96);
  padding: 24px;
  color: var(--text);
  text-decoration: none;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
}
.home-card.primary { border-color: rgba(19,214,172,.5); }
.home-card strong { font-size: 28px; }
.home-card span { color: var(--muted); line-height: 1.7; font-size: 15px; }
.home-card em { color: var(--teal); font-style: normal; font-weight: 900; }

.strategy-top {
  grid-template-columns: 72px 112px 220px minmax(0, 1fr);
}
.module-link {
  color: var(--muted);
  text-decoration: none;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 900;
}
.module-link:hover { color: var(--text); border-color: rgba(19,214,172,.45); }
.strategy-shell {
  min-height: calc(100vh - 46px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 8px;
  padding: 8px;
  align-items: start;
}
.strategy-workbench {
  grid-template-columns: minmax(0, 1fr) 340px;
}
.strategy-chart-panel, .strategy-side section {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(7,17,22,.96);
  overflow: hidden;
}
.strategy-chart-panel {
  min-width: 0;
  min-height: calc(100vh - 62px);
  display: grid;
  grid-template-rows: 58px minmax(520px, 58vh) auto auto;
}
.strategy-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}
.strategy-head h1 { font-size: 20px; margin: 0; }
.strategy-head span { color: var(--muted); font-size: 12px; }
.strategy-legend { display: flex; gap: 12px; color: var(--muted); font-size: 12px; }
.strategy-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.strategy-legend .buy { background: #f2d14b; }
.strategy-legend .sell { background: #fff; }
.strategy-legend .trend { background: #13d66f; }
#strategyChart { width: 100%; height: 100%; display: block; }
.strategy-side {
  position: sticky;
  top: 54px;
  min-height: 0;
  max-height: calc(100vh - 62px);
  display: grid;
  grid-template-rows: minmax(230px, .9fr) minmax(150px, .58fr) minmax(170px, .62fr);
  gap: 8px;
  overflow: auto;
}
.strategy-side section {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  padding: 12px;
}
.strategy-side h2 { margin-bottom: 10px; }
.strategy-list { display: grid; gap: 8px; }
.strategy-list div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
  padding: 8px 0;
  color: var(--muted);
  font-size: 12px;
}
.strategy-list strong { color: var(--text); }
.strategy-note {
  color: var(--muted);
  line-height: 1.55;
  font-size: 12px;
  overflow: auto;
}
.strategy-note div {
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
}
.strategy-score {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: #061218;
}
.strategy-grade {
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 4px;
  display: grid;
  place-items: center;
  grid-template-rows: 28px 18px;
}
.strategy-grade strong { font-size: 20px; line-height: 1; }
.strategy-grade span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.strategy-grade.grade-s { color: var(--amber); border-color: rgba(242,184,75,.65); background: rgba(242,184,75,.08); }
.strategy-grade.grade-a { color: var(--teal); border-color: rgba(19,214,172,.55); background: rgba(19,214,172,.08); }
.strategy-score b { display: block; font-size: 15px; margin-bottom: 4px; }
.strategy-score small { color: var(--muted); font-size: 11px; }
.strategy-oi-box {
  min-height: 0;
  overflow: auto;
}
.strategy-oi-link {
  min-height: 112px;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(19,214,172,.32);
  border-radius: 4px;
  background: rgba(19,214,172,.06);
  color: var(--text);
  text-decoration: none;
}
.strategy-oi-link:hover { border-color: rgba(19,214,172,.58); background: rgba(19,214,172,.1); }
.strategy-oi-link strong { font-size: 15px; }
.strategy-oi-link span, .strategy-oi-link i {
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  line-height: 1.35;
}
.strategy-oi-link em {
  font-style: normal;
  font-size: 20px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.strategy-subhead {
  height: 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.strategy-subhead strong { font-size: 13px; }
.strategy-subhead span { color: var(--muted); font-size: 11px; }
.strategy-replay-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: 34px auto minmax(108px, auto);
}
.strategy-signal-detail {
  min-height: 42px;
  display: grid;
  grid-template-columns: 124px minmax(150px, .8fr) minmax(170px, 1fr) minmax(180px, 1.2fr);
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  background: #041016;
  color: var(--muted);
  font-size: 11px;
}
.strategy-signal-detail.buy {
  border-left: 3px solid rgba(242,209,75,.9);
  background: rgba(242,184,75,.07);
}
.strategy-signal-detail.sell {
  border-left: 3px solid rgba(233,244,246,.85);
  background: rgba(233,244,246,.05);
}
.strategy-signal-detail strong {
  color: var(--text);
  font-size: 13px;
}
.strategy-signal-detail span,
.strategy-signal-detail em,
.strategy-signal-detail i {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.strategy-signal-detail i { color: var(--muted); }
.strategy-replay {
  min-height: 0;
  max-height: 178px;
  overflow: auto;
  padding: 5px;
}
.replay-row {
  min-height: 32px;
  display: grid;
  grid-template-columns: 70px 74px 82px 82px 82px minmax(160px, 1fr);
  gap: 8px;
  align-items: center;
  padding: 5px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: #061218;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 4px;
  font-size: 11px;
}
.replay-row:hover { border-color: rgba(19,214,172,.42); background: rgba(24,199,167,.08); }
.strategy-backtest-panel {
  min-height: 312px;
  display: grid;
  grid-template-rows: 34px auto auto 166px minmax(96px, auto);
  border-top: 1px solid var(--line);
  background: #050c10;
}
.strategy-backtest-assumptions {
  min-height: 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 0;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 10px;
}
.strategy-backtest-assumptions span {
  min-width: 0;
  padding: 0 10px;
  border-right: 1px solid var(--line-soft);
  white-space: nowrap;
}
.strategy-backtest-assumptions span:first-child { padding-left: 0; }
.strategy-backtest-assumptions span:last-child { border-right: 0; }
.strategy-backtest-assumptions b { color: #b8cbd0; font-weight: 800; }
.strategy-backtest-assumptions .warning, .strategy-backtest-assumptions .warning b { color: var(--amber); }
.strategy-backtest-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 7px;
  border-bottom: 1px solid var(--line-soft);
}
.strategy-backtest-kpis div {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: #061218;
}
.strategy-backtest-kpis span {
  color: var(--muted);
  font-size: 11px;
}
.strategy-backtest-kpis strong {
  font-size: 20px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.strategy-backtest-kpis small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strategy-backtest-kpis small + small { color: #9eb4ba; }
#strategyPathChart {
  width: 100%;
  height: 166px;
  display: block;
  border-bottom: 1px solid var(--line-soft);
}
.strategy-backtest-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 6px;
  max-height: 202px;
  overflow: auto;
}
.backtest-row {
  min-height: 38px;
  display: grid;
  grid-template-columns: 38px 116px 72px minmax(130px, 1fr);
  gap: 8px;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: #061218;
  text-align: left;
  color: var(--text);
}
.backtest-row:hover {
  border-color: rgba(19,214,172,.45);
  background: rgba(24,199,167,.08);
}
.backtest-row.buy { border-left: 3px solid rgba(242,209,75,.86); }
.backtest-row.sell { border-left: 3px solid rgba(233,244,246,.76); }
.backtest-row strong {
  font-size: 16px;
  line-height: 1;
  color: var(--text);
}
.backtest-row strong small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}
.backtest-row span,
.backtest-row em,
.backtest-row i {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.backtest-row span small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 1px;
}
.backtest-row em {
  text-align: right;
  font-size: 13px;
  font-weight: 900;
}
.backtest-row i { color: var(--muted); }
.replay-row.buy { border-left: 3px solid rgba(242,209,75,.88); }
.replay-row.sell { border-left: 3px solid rgba(233,244,246,.78); }
.replay-row strong {
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.replay-row span, .replay-row em, .replay-row i, .replay-row b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.replay-row span { color: var(--muted); }
.replay-row b { color: var(--muted); font-weight: 700; }

/* Strategy composite view */
.strategy-top {
  min-height: 58px;
  height: auto;
  grid-template-columns: minmax(270px, auto) 228px minmax(0, 1fr);
  gap: 12px;
  padding: 7px 10px;
}
.strategy-nav {
  min-width: 0;
  display: grid;
  grid-template-columns: 76px 116px 108px;
  gap: 6px;
}
.strategy-nav .module-link { width: 100%; }
.strategy-controls {
  min-width: 0;
  justify-content: flex-end;
  gap: 6px;
}
.strategy-controls .global-search { width: min(230px, 20vw); }
.strategy-field {
  min-width: 86px;
  height: 42px;
  display: grid;
  grid-template-rows: 11px 28px;
  gap: 2px;
  align-items: center;
}
.strategy-field > span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}
.strategy-field select {
  width: 100%;
  height: 28px;
  padding: 0 24px 0 8px;
  font-size: 11px;
}
.strategy-field.compact {
  min-width: 98px;
  height: 30px;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr;
  gap: 6px;
}
.strategy-field.compact > span { font-size: 10px; }
.strategy-field.compact select { height: 28px; }
.strategy-controls > button {
  width: 52px;
  height: 30px;
  margin-top: 12px;
}
.strategy-live {
  min-width: 88px;
  height: 28px;
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(19,214,172,.34);
  border-radius: 4px;
  color: var(--teal);
  background: rgba(19,214,172,.06);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.strategy-live.loading, .strategy-live.stale { color: var(--amber); border-color: rgba(242,184,75,.35); background: rgba(242,184,75,.06); }
.strategy-live.error { color: var(--red); border-color: rgba(255,78,99,.4); background: rgba(255,78,99,.06); }
.strategy-workbench { grid-template-columns: minmax(0, 1fr) 306px; }
.strategy-chart-panel {
  min-height: calc(100vh - 74px);
  grid-template-rows: 62px 42px minmax(540px, 62vh) auto auto;
}
.strategy-head { padding: 9px 14px; }
.strategy-head > div:first-child { min-width: 0; }
.strategy-head h1 { font-size: 18px; }
.strategy-head span { display: block; margin-top: 2px; }
.strategy-legend { flex-wrap: wrap; justify-content: flex-end; }
.strategy-chart-toolbar {
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--line);
  background: #041016;
}
.strategy-toggle {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.strategy-toggle input { width: 14px; height: 14px; accent-color: var(--teal); }
.strategy-history-control {
  min-width: 180px;
  flex: 1 1 280px;
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) auto;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
}
.strategy-history-control input { width: 100%; accent-color: var(--teal); }
.strategy-chart-toolbar > button {
  height: 28px;
  padding: 0 9px;
  white-space: nowrap;
}
.strategy-window-meta {
  max-width: 245px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strategy-chart-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #050c10;
  border-bottom: 1px solid var(--line);
}
#strategyChart {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
  outline: 0;
}
#strategyChart:focus-visible { box-shadow: inset 0 0 0 1px rgba(242,184,75,.72); }
.strategy-candle-readout {
  position: absolute;
  top: 7px;
  left: 84px;
  right: 80px;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 9px;
  border-left: 2px solid rgba(242,184,75,.8);
  background: rgba(2,9,13,.88);
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
}
.strategy-candle-readout strong { color: var(--text); font-size: 11px; }
.strategy-candle-readout em { font-style: normal; font-weight: 900; }
.strategy-candle-readout b {
  min-width: 0;
  margin-left: auto;
  color: #a9bdc3;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strategy-side {
  position: fixed;
  top: 66px;
  right: 8px;
  width: 306px;
  max-height: calc(100vh - 74px);
  grid-template-rows: auto auto auto;
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 4;
}
.strategy-side section {
  display: block;
  padding: 12px;
}
.strategy-side h2 { font-size: 13px; }
.strategy-score {
  grid-template-columns: 64px minmax(0, 1fr);
  padding: 7px 0 10px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
}
.strategy-grade { height: 48px; }
.strategy-list { gap: 0; }
.strategy-list div { padding: 7px 0; }
.strategy-list strong {
  max-width: 150px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.strategy-note { overflow: visible; }
.strategy-oi-box { overflow: visible; }
.strategy-oi-link { min-height: 104px; }
.strategy-replay-panel { grid-template-rows: 34px auto minmax(116px, auto); }
.strategy-signal-detail {
  min-height: 72px;
  grid-template-columns: 150px minmax(120px, .75fr) minmax(210px, 1.2fr) minmax(150px, .8fr);
  gap: 7px 12px;
  padding: 8px 12px;
}
.strategy-signal-detail > div { min-width: 0; display: grid; gap: 3px; }
.strategy-signal-detail > div > span { color: var(--muted); font-size: 9px; }
.strategy-signal-detail > div > strong {
  min-width: 0;
  color: var(--text);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.strategy-signal-detail .signal-detail-main strong { font-size: 13px; }
.strategy-signal-detail p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}
.strategy-replay { max-height: 210px; }
.replay-row {
  width: 100%;
  grid-template-columns: 112px 88px 92px 88px 88px minmax(180px, 1fr);
  text-align: left;
  cursor: pointer;
}
.strategy-backtest-kpis { gap: 0; padding: 0 8px; }
.strategy-backtest-kpis div {
  min-height: 66px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}
.strategy-backtest-kpis div:last-child { border-right: 0; }
.backtest-row { grid-template-columns: 38px 132px 72px minmax(120px, 1fr); }

@media (max-width: 1100px) {
  .terminal-top { grid-template-columns: 1fr; height: auto; }
  .mini-nav { overflow-x: auto; }
  .portal-top { grid-template-columns: 1fr; }
  .portal-nav { overflow-x: auto; }
  .portal-grid, .watch-layout, .settings-layout { grid-template-columns: 1fr; grid-template-rows: none; }
  .signal-panel { grid-row: auto; }
  .portal-hero { align-items: start; flex-direction: column; }
  .portal-signal { grid-template-columns: 34px minmax(120px, 1fr) 68px; }
  .portal-signal i { grid-column: 2 / 4; text-align: left; }
  .watch-row { grid-template-columns: 1fr 1fr; }
  .watch-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .watch-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .watch-card-note { grid-template-columns: 1fr; }
  .watch-card-note em { text-align: left; }
  .app { grid-template-columns: 1fr; height: auto; }
  .main { grid-template-rows: 46px auto auto auto minmax(460px, auto) auto; }
  .sidebar { display: none; }
  .rightbar {
    position: static;
    top: auto;
    height: auto;
    grid-template-rows: auto auto auto auto auto auto auto auto auto;
    overflow: visible;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .grid { grid-template-columns: 1fr; }
  .resonance-board { grid-auto-columns: minmax(360px, 1fr); }
  .contract-strip { grid-template-columns: 1fr 1fr; height: auto; }
  .symbol-overview { grid-template-columns: 1fr; grid-template-rows: auto auto auto; }
  .overview-head { border-right: 0; border-bottom: 1px solid var(--line); }
  .overview-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-exchanges { display: grid; grid-template-columns: 1fr; overflow-x: hidden; overflow-y: auto; }
  .overview-exchange { min-width: 0; width: 100%; }
  .contract-main, .contract-stat { min-height: 58px; }
  .table-panel, tbody { height: auto; max-height: none; }
  .detail-drawer { top: 0; width: 100vw; height: 100vh; }
  .home-shell { padding: 22px; }
  .home-hero { align-items: start; flex-direction: column; }
  .home-modules, .strategy-shell, .strategy-workbench { grid-template-columns: 1fr; height: auto; }
  .strategy-top { grid-template-columns: 1fr; }
  .strategy-chart-panel { min-height: auto; grid-template-rows: auto 460px auto auto; }
  .strategy-side {
    position: static;
    right: auto;
    width: auto;
    max-height: none;
    overflow: visible;
    z-index: auto;
  }
  .strategy-backtest-kpis, .strategy-backtest-table { grid-template-columns: 1fr; }
  .strategy-signal-detail { grid-template-columns: 1fr; align-items: start; }
  .replay-row { grid-template-columns: 64px 52px 78px 1fr; }
  .replay-row i:nth-of-type(2), .replay-row b { display: none; }
}

@media (max-width: 1320px) {
  .portal-grid, .watch-layout, .settings-layout { grid-template-columns: 1fr; grid-template-rows: none; }
  .signal-panel { grid-row: auto; }
  .chart-toolbar { gap: 6px; }
  .legend { display: none; }
}

@media (max-width: 1500px) and (min-width: 1101px) {
  .terminal-top {
    grid-template-columns: 158px auto 64px minmax(140px, 1fr) auto;
    gap: 6px;
  }
  .top-brand span, .polling { display: none; }
  .global-search { width: min(280px, 24vw); }
  .app { grid-template-columns: 250px minmax(0, 1fr) 280px; }
  .main { grid-template-rows: 46px auto auto auto minmax(520px, 66vh) minmax(360px, auto); }
  .exchange-tabs button { min-width: 80px; padding-inline: 5px; font-size: 10px; }
  .contract-strip {
    height: 116px;
    grid-template-columns: minmax(168px, 1.2fr) repeat(3, minmax(92px, 1fr));
    grid-template-rows: repeat(2, 57px);
  }
  .contract-main { grid-row: 1 / 3; }
  .contract-stat:nth-child(n + 5) { border-top: 1px solid var(--line-soft); }
  .contract-stat:nth-child(4),
  .contract-stat:nth-child(7) { border-right: 0; }
  .rightbar { padding: 6px; }
  .overview-kpis { grid-template-columns: repeat(5, minmax(88px, 1fr)); }
  .overview-exchange { min-width: 246px; }
  .contract-stat { padding-inline: 8px; }
  .contract-stat.big strong { font-size: 18px; }
}

@media (max-width: 900px) {
  .oi-quality-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-cell:nth-child(2) { border-right: 0; }
  .quality-cell:nth-child(-n + 2) { border-bottom: 1px solid var(--line-soft); }
  .chart-toolbar { height: auto; min-height: 40px; flex-wrap: wrap; }
  .chart-panel { grid-template-rows: auto auto minmax(380px, 1fr) 34px; }
  .legend { width: 100%; margin-left: 0; justify-content: flex-end; }
  .oi-range-summary { grid-template-columns: 1fr; }
  .summary-title { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .summary-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .main { grid-template-rows: auto 64px auto auto minmax(520px, 66vh) minmax(360px, auto); }
  .exchange-tabs {
    height: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    overflow: hidden;
  }
  .exchange-tabs button {
    width: 100%;
    min-width: 0;
    padding-inline: 3px;
    font-size: 10px;
  }
  .terminal-top {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 5px 8px;
    padding: 6px 8px;
  }
  .top-brand { min-width: 0; }
  .top-brand span { display: none; }
  .pulse-mark { width: 18px; height: 18px; }
  .mini-nav { grid-column: 2; grid-row: 1; width: 100%; }
  .mini-nav a { flex: 1 1 0; justify-content: center; padding-inline: 3px; font-size: 10px; }
  .live-pill { display: none; }
  .polling { display: none; }
  .top-controls {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(100px, .9fr) minmax(118px, 1.2fr) 72px;
    gap: 5px;
  }
  .global-search { grid-column: 1 / -1; width: 100%; }
  .segmented { min-width: 0; padding-inline: 3px; }
  .segmented b { padding-inline: 4px; font-size: 10px; white-space: nowrap; }
  .segmented button { padding-inline: 5px; }
  .top-controls select, .top-controls button { min-width: 0; padding-inline: 5px; }
  .top-controls select:nth-of-type(2) { display: none; }
  .oi-quality-panel { grid-template-columns: 1fr; }
  .quality-cell { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .quality-cell:last-child { border-bottom: 0; }
  .summary-kpis { grid-template-columns: 1fr; }
  .rightbar .watchlist { max-height: 360px; }
  .rightbar .candidate-list { max-height: 300px; }
  .rightbar .live-tape-panel { max-height: 320px; }
  .rightbar .alerts-panel { max-height: 680px; grid-template-rows: 34px minmax(160px, 420px) 24px auto; }
  .rightbar .exchange-status { max-height: 320px; }
}

@media (max-width: 1320px) {
  .strategy-top { grid-template-columns: minmax(270px, auto) minmax(0, 1fr); }
  .strategy-top .top-brand { justify-self: end; }
  .strategy-controls {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .strategy-controls .global-search { width: min(300px, 30vw); }
}

@media (max-width: 1100px) {
  .strategy-top { grid-template-columns: minmax(0, 1fr); position: static; }
  .strategy-top .top-brand { justify-self: start; }
  .strategy-nav { width: 100%; grid-template-columns: repeat(3, minmax(92px, 1fr)); }
  .strategy-controls { grid-column: auto; flex-wrap: wrap; }
  .strategy-controls .global-search { width: min(360px, 44vw); }
  .strategy-chart-panel { grid-template-rows: auto auto minmax(520px, 66vh) auto auto; }
  .strategy-side { top: 0; }
  .strategy-backtest-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .strategy-backtest-table { grid-template-columns: 1fr; }
  .strategy-signal-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strategy-signal-detail p { grid-column: 1 / -1; }
  .replay-row { grid-template-columns: 108px 84px 88px 84px 84px minmax(150px, 1fr); }
  .replay-row i:nth-of-type(2), .replay-row b { display: block; }
}

@media (max-width: 720px) {
  .strategy-top { gap: 8px; padding: 8px; }
  .strategy-top .top-brand { display: none; }
  .strategy-nav {
    display: flex;
    overflow-x: auto;
  }
  .strategy-nav .module-link { min-width: 92px; }
  .strategy-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }
  .strategy-controls .global-search { grid-column: 1 / -1; width: 100%; }
  .strategy-controls .strategy-field { width: 100%; }
  .strategy-controls > button, .strategy-live { width: 100%; margin-top: 0; }
  .strategy-shell { padding: 4px; }
  .strategy-chart-panel { grid-template-rows: auto auto 500px auto auto; }
  .strategy-head { align-items: flex-start; flex-direction: column; gap: 7px; }
  .strategy-legend { justify-content: flex-start; gap: 9px; }
  .strategy-chart-toolbar { flex-wrap: wrap; gap: 6px 9px; padding: 6px 8px; }
  .strategy-history-control { order: 5; flex-basis: calc(100% - 90px); }
  .strategy-window-meta { order: 7; width: 100%; max-width: none; }
  .strategy-candle-readout {
    left: 58px;
    right: 58px;
    min-height: 44px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px 2px;
    padding: 4px 6px;
    font-size: 8px;
    white-space: normal;
  }
  .strategy-candle-readout strong { grid-column: 1 / 4; grid-row: 1; font-size: 10px; white-space: nowrap; }
  .strategy-candle-readout em { grid-column: 4; grid-row: 1; font-size: 9px; text-align: right; }
  .strategy-candle-readout span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .strategy-candle-readout span:nth-of-type(1) { grid-column: 1; grid-row: 2; }
  .strategy-candle-readout span:nth-of-type(2) { grid-column: 2; grid-row: 2; }
  .strategy-candle-readout span:nth-of-type(3) { grid-column: 3; grid-row: 2; }
  .strategy-candle-readout span:nth-of-type(4) { grid-column: 4; grid-row: 2; }
  .strategy-candle-readout span:nth-of-type(5), .strategy-candle-readout b { display: none; }
  .strategy-signal-detail { grid-template-columns: 1fr; }
  .strategy-signal-detail p { grid-column: auto; }
  .strategy-subhead { height: auto; min-height: 38px; align-items: flex-start; gap: 5px; flex-direction: column; padding: 6px 9px; }
  .strategy-replay-panel { grid-template-rows: auto auto minmax(116px, auto); }
  .replay-row {
    grid-template-columns: 96px 76px minmax(78px, 1fr);
    gap: 5px;
  }
  .replay-row i, .replay-row b { display: none !important; }
  .strategy-backtest-kpis { grid-template-columns: 1fr; padding: 0 8px; }
  .strategy-backtest-assumptions { display: grid; grid-template-columns: 1fr; }
  .strategy-backtest-assumptions span { padding: 3px 0; border-right: 0; border-bottom: 1px solid var(--line-soft); white-space: normal; }
  .strategy-backtest-assumptions span:last-child { border-bottom: 0; }
  .strategy-backtest-kpis div { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .strategy-backtest-kpis div:last-child { border-bottom: 0; }
  .backtest-row { grid-template-columns: 32px minmax(118px, 1fr) 64px; }
  .backtest-row i { display: none; }
}

/* Strategy terminal v12 */
.strategy-body {
  --bg: #080a0d;
  --panel: #0d1115;
  --panel-2: #12181d;
  --panel-3: #10151a;
  --line: #283038;
  --line-soft: #1b2228;
  --text: #eef2f3;
  --muted: #8b989f;
  --teal: #2bc99a;
  --red: #ef5f70;
  --amber: #e5b454;
  --blue: #dce3e6;
  background: var(--bg);
}

.strategy-body button,
.strategy-body input,
.strategy-body select { font: inherit; letter-spacing: 0; }

.strategy-top {
  min-height: 54px;
  height: 54px;
  grid-template-columns: 310px 176px minmax(0, 1fr);
  gap: 12px;
  padding: 6px 10px;
  border-color: var(--line-soft);
  background: rgba(8, 10, 13, .97);
}

.strategy-nav { grid-template-columns: 72px 112px 108px; gap: 5px; }
.strategy-nav .module-link {
  height: 32px;
  border-color: transparent;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}
.strategy-nav .module-link:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--panel-2);
}
.strategy-top .top-brand { min-width: 0; gap: 8px; }
.strategy-top .pulse-mark {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: linear-gradient(135deg, #39d5a6, #8ea0a8);
}
.strategy-top .top-brand strong { font-size: 14px; }
.strategy-top .top-brand span { display: block; margin: 1px 0 0; font-size: 10px; }

.strategy-controls {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}
.strategy-controls .global-search {
  width: min(200px, 18vw);
  height: 34px;
  border-color: var(--line);
  border-radius: 5px;
  background: var(--panel);
}
.strategy-controls .global-search span { color: var(--muted); font-size: 10px; }
.strategy-controls .global-search input { font-size: 13px; }
.strategy-field {
  min-width: 88px;
  height: 42px;
  grid-template-rows: 10px 30px;
  gap: 2px;
}
.strategy-field > span { color: var(--muted); font-size: 10px; }
.strategy-field select {
  height: 30px;
  border-color: var(--line);
  border-radius: 5px;
  background-color: var(--panel);
  color: var(--text);
  font-size: 12px;
}
.strategy-secondary-controls { display: flex; align-items: center; gap: 6px; }
.strategy-secondary-controls > button,
.strategy-options-toggle {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
}
.strategy-secondary-controls > button { width: 52px; margin-top: 12px; }
.strategy-secondary-controls > button:hover,
.strategy-options-toggle:hover { border-color: #4a5962; background: var(--panel-2); }
.strategy-options-toggle { display: none; white-space: nowrap; }

.strategy-workbench {
  display: block;
  min-height: calc(100vh - 54px);
  padding: 10px;
}
.strategy-upper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 10px;
  align-items: stretch;
}
.strategy-chart-panel,
.strategy-side section,
.strategy-replay-panel,
.strategy-backtest-panel {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--panel);
  overflow: hidden;
}
.strategy-chart-panel {
  min-height: 650px;
  display: grid;
  grid-template-rows: 58px 44px minmax(548px, calc(100vh - 176px));
}
.strategy-head {
  min-width: 0;
  padding: 9px 14px;
  border-bottom-color: var(--line-soft);
}
.strategy-head h1 { font-size: 18px; line-height: 1.15; }
.strategy-head span { margin-top: 4px; font-size: 11px; }
.strategy-head-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}
.strategy-live {
  min-width: 88px;
  height: 28px;
  margin: 0;
  border-color: rgba(43, 201, 154, .3);
  border-radius: 5px;
  background: rgba(43, 201, 154, .06);
  font-size: 11px;
}
.strategy-legend { gap: 12px; font-size: 11px; }
.strategy-legend span { display: inline-flex; align-items: center; white-space: nowrap; }
.strategy-legend i { width: 7px; height: 7px; border-radius: 2px; margin-right: 5px; }

.strategy-chart-toolbar {
  min-height: 44px;
  gap: 10px;
  padding: 6px 12px;
  border-bottom-color: var(--line-soft);
  background: #0a0e12;
}
.strategy-field.compact { min-width: 106px; }
.strategy-toggle { color: var(--muted); font-size: 11px; }
.strategy-toggle input { width: 15px; height: 15px; accent-color: var(--teal); }
.strategy-history-control { color: var(--muted); font-size: 10px; }
.strategy-history-control input { accent-color: var(--teal); }
.strategy-chart-toolbar > button {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
  font-size: 11px;
}
.strategy-window-meta { color: var(--muted); font-size: 10px; }
.strategy-chart-wrap { border-bottom: 0; background: #090c0f; }
.strategy-candle-readout {
  top: 8px;
  min-height: 36px;
  border-left-color: var(--amber);
  background: rgba(8, 10, 13, .9);
  color: var(--muted);
  font-size: 11px;
}
.strategy-candle-readout strong { font-size: 12px; }

.strategy-side {
  position: static;
  top: auto;
  right: auto;
  width: auto;
  max-height: none;
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 10px;
  overflow: visible;
  z-index: auto;
}
.strategy-side section { padding: 16px; }
.strategy-side h2 {
  margin: 0 0 12px;
  color: #cbd3d6;
  font-size: 12px;
  font-weight: 800;
}
.strategy-score {
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 8px;
  padding: 10px 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
}
.strategy-grade {
  height: 52px;
  border-radius: 5px;
  background: transparent;
}
.strategy-score b { font-size: 15px; }
.strategy-score small { font-size: 11px; line-height: 1.45; }
.strategy-list { gap: 0; }
.strategy-list div { min-height: 39px; padding: 10px 0; color: var(--muted); font-size: 11px; }
.strategy-list strong { max-width: 150px; font-size: 12px; }
.strategy-oi-box { overflow: visible; }
.strategy-oi-link {
  min-height: 116px;
  padding: 12px 0 2px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}
.strategy-oi-link:hover { border-color: var(--line); background: transparent; }
.strategy-oi-link em { font-size: 22px; }

.strategy-analysis {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.strategy-subhead {
  min-height: 44px;
  height: 44px;
  padding: 0 14px;
  border-top: 0;
  border-bottom-color: var(--line-soft);
}
.strategy-subhead strong { font-size: 14px; }
.strategy-subhead span { font-size: 11px; }
.strategy-replay-panel { display: grid; grid-template-rows: 44px auto minmax(120px, auto); }
.strategy-replay-context {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, .8fr);
  border-bottom: 1px solid var(--line-soft);
}
.strategy-signal-detail {
  min-height: 100px;
  grid-template-columns: 150px minmax(120px, .75fr) minmax(200px, 1.1fr) minmax(180px, 1fr);
  gap: 8px 16px;
  padding: 14px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  background: transparent;
  font-size: 11px;
}
.strategy-signal-detail.buy,
.strategy-signal-detail.sell { background: transparent; }
.strategy-signal-detail.buy { border-left: 3px solid var(--amber); }
.strategy-signal-detail.sell { border-left: 3px solid #dce3e6; }
.strategy-signal-detail > div > span { font-size: 10px; }
.strategy-signal-detail > div > strong { font-size: 12px; }
.strategy-signal-detail .signal-detail-main strong { font-size: 14px; }
.strategy-signal-detail p { font-size: 11px; }
.strategy-explain-panel { min-width: 0; padding: 13px 14px; }
.strategy-explain-panel h3 { margin: 0 0 7px; color: #cbd3d6; font-size: 11px; }
.strategy-explain-panel .strategy-note {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
  overflow: visible;
  font-size: 11px;
  line-height: 1.35;
}
.strategy-explain-panel .strategy-note div { padding: 6px 0; border-bottom-color: var(--line-soft); }
.strategy-replay {
  max-height: 254px;
  padding: 0 8px 6px;
  overflow: auto;
}
.replay-row {
  min-height: 39px;
  grid-template-columns: 118px 92px 104px 92px 92px minmax(220px, 1fr);
  gap: 12px;
  margin: 0;
  padding: 7px 8px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  font-size: 11px;
}
.replay-row:hover { border-color: var(--line); background: rgba(255, 255, 255, .025); }
.replay-row.selected {
  background: rgba(229, 180, 84, .055);
  box-shadow: inset 3px 0 0 var(--amber);
}
.replay-row.buy,
.replay-row.sell { border-left: 0; }

.strategy-backtest-panel {
  min-height: 620px;
  grid-template-rows: 44px auto auto 186px minmax(220px, auto);
  border-top: 1px solid var(--line-soft);
  background: var(--panel);
}
.strategy-backtest-assumptions {
  min-height: 42px;
  padding: 8px 14px;
  border-bottom-color: var(--line-soft);
  color: var(--muted);
  font-size: 11px;
}
.strategy-backtest-assumptions span { padding: 0 12px; border-right-color: var(--line); }
.strategy-backtest-assumptions b { color: #cbd3d6; }
.strategy-backtest-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--line-soft);
}
.strategy-backtest-kpis div {
  min-height: 104px;
  padding: 16px 18px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}
.strategy-backtest-kpis div:last-child { border-right: 0; }
.strategy-backtest-kpis span { font-size: 12px; }
.strategy-backtest-kpis strong { margin: 2px 0; font-size: 26px; }
.strategy-backtest-kpis small { font-size: 11px; }
#strategyPathChart { height: 186px; border-bottom-color: var(--line-soft); }
.strategy-backtest-table {
  display: block;
  max-height: 460px;
  padding: 0;
  overflow: auto;
}
.backtest-table-head,
.backtest-row {
  min-width: 1020px;
  display: grid;
  grid-template-columns: 62px 156px 156px 92px 82px 100px 100px minmax(180px, 1fr);
  gap: 12px;
  align-items: center;
}
.backtest-table-head {
  min-height: 36px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #0a0e12;
  color: var(--muted);
  font-size: 10px;
}
.backtest-row {
  width: 100%;
  min-height: 52px;
  padding: 7px 14px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}
.backtest-row:hover { border-color: var(--line); background: rgba(255, 255, 255, .025); }
.backtest-row.selected {
  background: rgba(229, 180, 84, .055);
  box-shadow: inset 3px 0 0 var(--amber);
}
.backtest-row.buy,
.backtest-row.sell { border-left: 0; }
.backtest-row strong { font-size: 16px; }
.backtest-row span,
.backtest-row em,
.backtest-row i { font-size: 12px; }
.backtest-row span small,
.backtest-row i small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.backtest-row em { text-align: left; font-size: 14px; }
.backtest-row i { color: var(--text); }

@media (max-width: 1180px) {
  .strategy-top { grid-template-columns: 310px minmax(0, 1fr); }
  .strategy-top .top-brand { display: none; }
  .strategy-controls .global-search { width: min(210px, 22vw); }
  .strategy-upper { grid-template-columns: minmax(0, 1fr) 280px; }
  .strategy-replay-context { grid-template-columns: 1fr; }
  .strategy-signal-detail { border-right: 0; border-bottom: 1px solid var(--line-soft); }
}

@media (max-width: 900px) {
  .strategy-top {
    height: auto;
    min-height: 84px;
    position: sticky;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 6px 8px;
  }
  .strategy-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .strategy-controls {
    display: grid;
    grid-template-columns: minmax(106px, 1.35fr) minmax(86px, .85fr) 70px 72px;
    gap: 6px;
  }
  .strategy-controls .global-search { width: 100%; height: 34px; }
  .strategy-field.primary { width: 100%; height: 34px; display: block; }
  .strategy-field.primary > span { display: none; }
  .strategy-field.primary select { width: 100%; height: 34px; }
  .strategy-options-toggle { display: block; width: 100%; height: 34px; padding: 0 4px; }
  .strategy-secondary-controls {
    width: 230px;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 80;
    display: none;
    grid-template-columns: 1fr 62px;
    align-items: end;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #11161b;
    box-shadow: 0 14px 32px rgba(0, 0, 0, .42);
  }
  .strategy-secondary-controls.open { display: grid; }
  .strategy-secondary-controls .strategy-field { width: 100%; }
  .strategy-secondary-controls > button { width: 62px; margin-top: 0; }
  .strategy-workbench { padding: 6px; }
  .strategy-upper { grid-template-columns: 1fr; }
  .strategy-chart-panel { min-height: 620px; grid-template-rows: auto auto 520px; }
  .strategy-side { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; }
  .strategy-side section { min-width: 0; }
  .strategy-head-actions { gap: 8px; }
  .strategy-legend span:nth-child(-n+2) { display: none; }
  .strategy-replay-context { grid-template-columns: 1fr; }
  .strategy-explain-panel .strategy-note { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .strategy-top { min-height: 82px; }
  .strategy-nav .module-link { min-width: 0; height: 30px; font-size: 11px; }
  .strategy-controls { grid-template-columns: minmax(106px, 1.35fr) 88px 66px 70px; }
  .strategy-controls .global-search span { width: 34px; }
  .strategy-controls .global-search input { min-width: 0; font-size: 12px; }
  .strategy-field.primary select { padding-left: 6px; font-size: 11px; }
  .strategy-options-toggle { font-size: 10px; }
  .strategy-workbench { padding: 4px; }
  .strategy-chart-panel { min-height: 610px; grid-template-rows: auto auto 500px; }
  .strategy-head { align-items: center; flex-direction: row; gap: 8px; padding: 9px 10px; }
  .strategy-head h1 { font-size: 16px; }
  .strategy-head span { font-size: 10px; }
  .strategy-head-actions { display: grid; justify-items: end; gap: 5px; }
  .strategy-live { min-width: 78px; height: 24px; font-size: 9px; }
  .strategy-legend { gap: 8px; }
  .strategy-legend span { font-size: 9px; }
  .strategy-chart-toolbar { flex-wrap: wrap; gap: 6px 9px; padding: 6px 8px; }
  .strategy-field.compact { min-width: 100px; }
  .strategy-toggle { font-size: 10px; }
  .strategy-history-control { order: 5; min-width: 0; flex: 1 1 calc(100% - 92px); }
  .strategy-chart-toolbar > button { order: 6; }
  .strategy-window-meta { order: 7; width: 100%; max-width: none; }
  .strategy-candle-readout { left: 58px; right: 58px; font-size: 9px; }
  .strategy-side { grid-template-columns: 1fr; }
  .strategy-side section { padding: 14px; }
  .strategy-subhead { height: auto; min-height: 44px; align-items: flex-start; flex-direction: column; gap: 3px; padding: 8px 10px; }
  .strategy-signal-detail { min-height: 88px; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
  .strategy-signal-detail p { grid-column: 1 / -1; }
  .strategy-explain-panel { padding: 12px; }
  .strategy-explain-panel .strategy-note { grid-template-columns: 1fr; }
  .strategy-replay { max-height: none; overflow-x: auto; overflow-y: visible; }
  .replay-row { min-width: 720px; }
  .strategy-backtest-assumptions { display: grid; padding: 8px 12px; }
  .strategy-backtest-assumptions span { padding: 5px 0; border-right: 0; border-bottom: 1px solid var(--line-soft); white-space: normal; }
  .strategy-backtest-assumptions span:last-child { border-bottom: 0; }
  .strategy-backtest-kpis { grid-template-columns: 1fr; }
  .strategy-backtest-kpis div { min-height: 96px; padding: 14px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .strategy-backtest-kpis div:last-child { border-bottom: 0; }
  .strategy-backtest-panel { grid-template-rows: auto auto auto 170px minmax(220px, auto); }
  #strategyPathChart { height: 170px; }
  .strategy-backtest-table { max-height: none; overflow-x: auto; overflow-y: visible; }
  .backtest-table-head > span:first-child,
  .backtest-row > strong:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--panel);
  }
  .backtest-table-head > span:first-child { z-index: 3; background: #0a0e12; }
  .backtest-row.selected > strong:first-child { background: #171612; }
}
