/* Research-terminal layout, loaded only by /agent/. */

html[data-studio='trade'] .header {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 25;
  width: var(--studio-rail-width);
  height: 100dvh;
  border: 0;
  border-right: 1px solid var(--studio-border);
  background: var(--studio-rail);
  padding: 26px 16px 18px;
  overflow-y: auto;
}
html[data-studio='trade'] #navigation a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--studio-muted);
  font: 500 13px/1.4 var(--studio-font);
  text-decoration: none;
  white-space: nowrap;
}
html[data-studio='trade'] body {
  margin-left: var(--studio-rail-width);
}
html[data-studio='trade'] .header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
html[data-studio='trade'] .brand {
  font-size: 18px;
  padding: 3px 7px 24px;
  gap: 11px;
}
html[data-studio='trade'] .brand-sub {
  display: block;
  font-size: 10px;
  letter-spacing: 0.1em;
  margin-top: 1px;
  color: var(--studio-faint);
}
html[data-studio='trade'] .brand-mark {
  width: 32px;
  height: 32px;
  background: var(--studio-accent);
  color: var(--studio-inverse);
  border: 0;
  border-radius: 10px;
}
html[data-studio='trade'] .brand-mark > span {
  display: none;
}
html[data-studio='trade'] #navigation {
  display: flex;
  flex-direction: column;
  height: auto;
  gap: 5px;
}
html[data-studio='trade'] .header-actions {
  margin: auto 0 0;
  padding-top: 28px;
  gap: 12px;
  flex-wrap: wrap;
}
html[data-studio='trade'] .home-link {
  flex: 1 0 100%;
  border-radius: 11px;
  background: var(--studio-surface);
}
html[data-studio='trade'] .connection {
  display: block;
  flex: 1;
  font-size: 11px;
}
html[data-studio='trade'] .demo-bar {
  padding: 13px 32px;
  background: var(--studio-bg);
  font-size: 11px;
  border-color: var(--studio-border);
}
html[data-studio='trade'] #workspace {
  max-width: 1420px;
  padding: 30px 32px 40px;
}
html[data-studio='trade'] .page-intro {
  margin-bottom: 26px;
}
html[data-studio='trade'] h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.045em;
}
html[data-studio='trade'] .page-intro p {
  font-size: 12px;
  line-height: 1.8;
}
html[data-studio='trade'] :is(.panel, .metric, .factor-card) {
  border-radius: 14px;
  overflow: clip;
}
html[data-studio='trade'] .metric-grid {
  gap: 12px;
}
html[data-studio='trade'] .metric {
  padding: 18px 16px;
  background: var(--studio-surface);
}
html[data-studio='trade'] .metric .amount {
  font-size: clamp(21px, 1.9vw, 29px);
  letter-spacing: -0.04em;
}
html[data-studio='trade'] .metric .caption {
  color: var(--studio-faint);
  font-size: 11px;
}
html[data-studio='trade'] .info-strip {
  border: 0;
  padding: 17px 2px;
  color: var(--studio-faint);
}
html[data-studio='trade'] .chart-toolbar {
  padding: 12px 16px;
  gap: 7px;
  background: var(--studio-surface);
}
html[data-studio='trade'] button {
  border-radius: 8px;
  min-height: 34px;
}
html[data-studio='trade'] .seg {
  border-radius: 9px;
  overflow: hidden;
}
html[data-studio='trade'] button[aria-pressed='true'] {
  color: var(--studio-accent);
  background: var(--studio-selected);
  border-color: var(--studio-strong);
}
html[data-studio='trade'] .panel-head {
  padding: 17px 18px;
}
html[data-studio='trade'] th {
  background: var(--studio-input);
  color: var(--studio-faint);
}
html[data-studio='trade'] td {
  padding-block: 17px;
}
html[data-studio='trade'] tbody tr:hover {
  background: var(--studio-raised);
}
html[data-studio='trade'] dialog {
  border-radius: 18px;
  border-color: var(--studio-strong);
}
html[data-studio='trade'] .site-footer {
  padding-inline: 32px;
  font-size: 10px;
}
@media (max-width: 1200px) {
  html[data-studio='trade'] #workspace {
    padding-inline: 22px;
  }
  html[data-studio='trade'] .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  html[data-studio='trade'] .terminal-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 720px) {
  html[data-studio='trade'] body {
    margin-left: 0;
  }
  html[data-studio='trade'] .header {
    position: relative;
    width: 100%;
    height: auto;
    padding: 18px 16px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--studio-border);
    overflow: visible;
  }
  html[data-studio='trade'] .header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }
  html[data-studio='trade'] .brand {
    padding: 0;
    gap: 8px;
    font-size: 16px;
  }
  html[data-studio='trade'] .brand-sub {
    display: none;
  }
  html[data-studio='trade'] #navigation {
    flex-direction: row;
    grid-row: 2;
    grid-column: 1/-1;
    overflow-x: auto;
    gap: 3px;
  }
  html[data-studio='trade'] #navigation a {
    padding: 10px 12px;
    min-height: 44px;
    flex: none;
    gap: 7px;
    font-size: 12px;
  }
  html[data-studio='trade'] #navigation .studio-icon {
    width: 16px;
    height: 16px;
  }
  html[data-studio='trade'] .header-actions {
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
    gap: 8px;
  }
  html[data-studio='trade'] .header-actions .connection {
    display: none;
  }
  html[data-studio='trade'] .home-link {
    flex: none;
    padding-inline: 10px;
    min-height: 44px;
  }
  html[data-studio='trade'] .demo-bar {
    padding: 9px 16px;
    gap: 8px;
  }
  html[data-studio='trade'] #workspace {
    padding: 24px 14px 32px;
  }
  html[data-studio='trade'] h1 {
    font-size: 25px;
  }
  html[data-studio='trade'] .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  html[data-studio='trade'] .metric {
    padding: 14px;
  }
  html[data-studio='trade'] .metric .amount {
    font-size: 24px;
  }
  html[data-studio='trade'] .right-stack {
    grid-template-columns: minmax(0, 1fr);
  }
  html[data-studio='trade'] .site-footer {
    padding-inline: 16px;
  }
}
