:root {
  color-scheme: dark;
  --bg: oklch(0.12 0.01 250);
  --bg-elevated: oklch(0.15 0.012 250);
  --bg-pane: oklch(0.18 0.013 250);
  --bg-pane-2: oklch(0.16 0.012 250);
  --bg-soft: oklch(0.97 0.008 250 / 0.035);
  --border: oklch(0.72 0.012 250 / 0.16);
  --border-strong: oklch(0.78 0.09 74 / 0.28);
  --text: oklch(0.93 0.014 250);
  --text-dim: oklch(0.74 0.018 250);
  --text-faint: oklch(0.59 0.016 250);
  --accent: oklch(0.78 0.12 74);
  --accent-soft: oklch(0.78 0.12 74 / 0.1);
  --green: oklch(0.74 0.13 151);
  --green-soft: oklch(0.74 0.13 151 / 0.1);
  --red: oklch(0.68 0.16 28);
  --red-soft: oklch(0.68 0.16 28 / 0.12);
  --blue: oklch(0.72 0.13 247);
  --blue-soft: oklch(0.72 0.13 247 / 0.11);
  --rail-width: 236px;
  --topbar-height: 64px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans), sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, oklch(0.78 0.12 74 / 0.08), transparent 30%),
    linear-gradient(180deg, oklch(0.15 0.012 250) 0%, oklch(0.11 0.01 250) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 40;
  padding: 8px 10px;
  border: 1px solid rgba(255, 216, 154, 0.44);
  border-radius: 8px;
  background: rgba(7, 10, 14, 0.98);
  color: #ffe2aa;
  font-family: var(--font-mono), monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

button,
input {
  font: inherit;
}

.terminal-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  background: linear-gradient(180deg, oklch(0.14 0.011 250) 0%, oklch(0.11 0.01 250) 100%);
}

.terminal-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: linear-gradient(180deg, oklch(0.16 0.012 250 / 0.98), oklch(0.13 0.011 250 / 0.98));
  border-right: 1px solid var(--border);
}

.terminal-brand {
  display: grid;
  gap: 4px;
}

.terminal-brand-kicker {
  font-family: var(--font-display), sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: oklch(0.78 0.11 74 / 0.8);
}

.terminal-brand-name {
  min-width: 0;
  font-family: var(--font-display), sans-serif;
  font-size: 1.56rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.terminal-nav {
  display: grid;
  gap: 8px;
}

.terminal-nav-link {
  min-width: 0;
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.terminal-nav-link:hover {
  border-color: var(--border);
  color: var(--text);
  background: var(--bg-soft);
}

.terminal-nav-link:focus-visible,
.terminal-button:focus-visible,
.instrument-focus-chip button:focus-visible {
  outline: 2px solid oklch(0.83 0.08 74 / 0.82);
  outline-offset: 2px;
}

.terminal-nav-link-active {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--accent-soft);
}

.shell-metrics {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.shell-metric {
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.shell-metric-label,
.overview-label,
.focus-label,
.terminal-filter-label,
.summary-title,
.filter-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.68rem;
}

.shell-metric-value,
.overview-cell strong,
.focus-value {
  font-family: var(--font-mono), monospace;
  font-size: 0.92rem;
}

.terminal-frame {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(var(--topbar-height), auto) minmax(0, 1fr);
}

.terminal-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 10px 20px;
  background: oklch(0.15 0.012 250 / 0.96);
  border-bottom: 1px solid var(--border);
}

.status-dot,
.chart-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--text-faint);
}

.status-connected .status-dot,
.chart-status-connected .chart-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(37, 193, 122, 0.14);
}

.chart-status-connecting .chart-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(245, 166, 35, 0.12);
  animation: pulse 1.3s ease-in-out infinite;
}

.status-stale .status-dot,
.chart-status-stale .chart-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(245, 166, 35, 0.18);
}

.status-disconnected .status-dot,
.chart-status-disconnected .chart-dot {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 107, 95, 0.12);
}

.terminal-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
  width: auto;
  margin-left: auto;
}

.terminal-topbar-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
  flex: 0 1 auto;
}

.terminal-topbar-mode {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  margin-left: auto;
}

.terminal-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: clamp(220px, 24vw, 360px);
  flex: 0 1 clamp(220px, 24vw, 360px);
}

.terminal-filter-label {
  margin-bottom: 0;
  line-height: 1;
}

.terminal-filter-field {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 32px;
}

.terminal-filter-field::before,
.terminal-filter-field::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.terminal-filter-field::before {
  height: 1px;
  background: var(--border);
  opacity: 1;
}

.terminal-filter-field::after {
  height: 2px;
  background: var(--accent);
  transform: scaleX(0.12);
  transform-origin: left center;
  opacity: 0;
}

.terminal-input {
  min-width: 0;
  width: 100%;
  padding: 0 0 6px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono), monospace;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.terminal-input::placeholder {
  color: oklch(0.7 0.014 250 / 0.72);
  font-size: 0.84rem;
}

.terminal-filter:focus-within .terminal-filter-label {
  color: var(--text-dim);
}

.terminal-filter:focus-within .terminal-filter-field::before {
  background: oklch(0.74 0.02 250 / 0.32);
}

.terminal-filter:focus-within .terminal-filter-field::after {
  transform: scaleX(1);
  opacity: 1;
}

.terminal-filter:focus-within .terminal-input {
  color: var(--text);
}

.terminal-input:focus-visible,
.filter-input:focus-visible {
  outline: none;
}

.terminal-button,
.mode-button,
.filter-clear,
.jump-button,
.pause-button,
.interval-button,
.overlay-toggle,
.drawer-close {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--bg-soft);
  color: var(--text);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

.terminal-button:disabled,
.filter-clear:disabled,
.jump-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.terminal-button-primary,
.interval-button.active,
.overlay-toggle.overlay-toggle-on,
.mode-button {
  border-color: var(--border-strong);
  background: var(--accent-soft);
  color: var(--text);
}

.instrument-focus-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 32px;
  max-width: min(360px, 32vw);
  padding: 5px 8px 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: oklch(0.78 0.12 74 / 0.07);
  color: var(--text);
  font-family: var(--font-mono), monospace;
  font-size: 0.72rem;
  font-weight: 600;
}

.instrument-focus-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.instrument-focus-chip button,
.instrument-cell-button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.instrument-focus-chip button {
  padding: 4px 6px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.62rem;
}

.instrument-cell-button {
  padding: 0;
  text-align: inherit;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

.instrument-cell-button:hover,
.instrument-cell-button:focus-visible {
  color: var(--text);
  outline: none;
}

.pause-button {
  padding: 7px 10px;
  font-size: 0.66rem;
}

.terminal-content {
  min-width: 0;
  padding: 24px 24px 24px;
}

.page-shell {
  display: grid;
  gap: 18px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-title,
h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display), sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.page-title {
  font-size: clamp(1.75rem, 2.4vw, 2.3rem);
  letter-spacing: 0.06em;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.contract-filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  min-width: 0;
  max-width: min(440px, 42vw);
}

.contract-filter-button-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-filter-button.is-active {
  border-color: var(--border-strong);
  background: var(--accent-soft);
  color: var(--text);
}

.flow-filter-popover {
  position: relative;
}

.flow-filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.flow-filter-trigger.is-active {
  border-color: var(--border-strong);
  background: var(--accent-soft);
}

.flow-filter-badge {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: oklch(0.78 0.12 74 / 0.16);
  color: var(--text);
  font-family: var(--font-mono), monospace;
  font-size: 0.7rem;
  text-align: center;
}

.flow-filter-popover-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 30;
  width: min(420px, calc(100vw - 72px));
  max-height: min(70vh, 560px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: oklch(0.16 0.012 250 / 0.98);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.32);
}

.flow-filter-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
}

.flow-filter-popover-title {
  font-family: var(--font-sans), sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.flow-filter-popover-copy {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 0.78rem;
}

.flow-filter-popover-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.flow-filter-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-soft);
}

.flow-filter-section-title {
  color: var(--text-dim);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.flow-filter-checkbox-grid,
.flow-filter-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.flow-filter-checkbox-grid-wide {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.flow-filter-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  cursor: pointer;
}

.flow-filter-check input {
  margin: 0;
  accent-color: var(--accent);
}

.filter-chip {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--text);
  min-height: 42px;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
  text-transform: uppercase;
}

.filter-chip.is-active {
  border-color: var(--border-strong);
  background: var(--accent-soft);
  color: var(--text);
}

.replay-matrix {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.overview-cell {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
}

.page-grid {
  display: grid;
  gap: 16px;
  align-items: stretch;
}

.page-grid-home {
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
}

.page-grid-tape {
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
}

.page-grid-signals {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 2fr) minmax(0, 1fr);
  height: calc(100vh - var(--topbar-height) - 172px);
  min-height: 620px;
}

.page-grid-charts {
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr);
}

.page-grid-replay {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.page-grid-home > :nth-child(3),
.page-grid-tape > :nth-child(1),
.page-grid-replay > :nth-child(1) {
  grid-column: 1 / -1;
}

.terminal-pane {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-pane);
  overflow: hidden;
}

.terminal-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  background: oklch(0.2 0.012 250 / 0.38);
}

.terminal-pane-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.terminal-pane-title {
  font-family: var(--font-sans), sans-serif;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.terminal-pane-status {
  min-width: 0;
}

.terminal-pane-actions,
.card-controls,
.chart-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.terminal-pane-body,
.card-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px 18px;
}

.chart-panel {
  display: grid;
  gap: 12px;
}

.chart-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.chart-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chart-meta-time,
.chart-hint,
.overlay-legend,
.timestamp,
.drawer-subtitle,
.drawer-note,
.drawer-empty,
.note,
.time {
  color: var(--text-dim);
}

.chart-surface {
  width: 100%;
  height: 460px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-pane-2);
  overflow: hidden;
}

.chart-empty {
  margin-top: -2px;
}

.chart-intervals {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status span,
.timestamp,
.missed-count,
.chart-hint,
.meta,
.note,
.drawer-note,
.drawer-row-meta {
  font-family: var(--font-mono), monospace;
}

.status-replay .status-dot {
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(77, 163, 255, 0.14);
}

.status-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  min-width: 0;
  font-family: var(--font-mono), monospace;
}

.status-inline-label {
  color: var(--text);
  font-size: 0.82rem;
}

.status-inline-meta {
  color: var(--text-dim);
  font-size: 0.72rem;
}

.status-inline-counter {
  min-width: 82px;
  color: var(--accent);
  font-size: 0.72rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.status-inline-counter-visible {
  opacity: 1;
}

.tape-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

.tape-controls button {
  white-space: nowrap;
}

.missed-count {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.72rem;
  color: var(--accent);
  opacity: 0;
  transform: translateX(6px);
  transition:
    max-width 180ms ease,
    opacity 140ms ease,
    transform 180ms ease;
}

.missed-count-visible {
  max-width: 92px;
  opacity: 1;
  transform: translateX(0);
}

.list {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding: 12px;
  padding-right: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-pane-2);
  align-self: stretch;
}

.terminal-list-compact {
  flex: 0 0 auto;
  max-height: 260px;
}

.page-grid-home > :nth-child(1),
.page-grid-home > :nth-child(2) {
  height: clamp(430px, 56vh, 760px);
}

.page-grid-home > :nth-child(3),
.page-grid-replay > :not(:first-child) {
  height: clamp(430px, 58vh, 760px);
}

.page-grid-signals > .terminal-pane {
  height: 100%;
  min-height: 0;
}

.page-grid-signals > .signals-pane-alerts {
  grid-column: 1;
  grid-row: 1;
}

.page-grid-signals > .signals-pane-rules {
  grid-column: 2;
  grid-row: 1;
}

.page-grid-signals > .signals-pane-dark {
  grid-column: 1 / -1;
  grid-row: 2;
}

.page-grid-tape > :first-child {
  height: clamp(460px, 64vh, 880px);
}

.page-grid-tape > :not(:first-child) {
  height: clamp(400px, 50vh, 680px);
}

.page-grid-charts > :first-child {
  height: auto;
}

.page-grid-charts > :last-child {
  height: clamp(430px, 58vh, 760px);
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.row-button {
  width: 100%;
  text-align: left;
  color: inherit;
}

.row-button:hover {
  border-color: var(--border-strong);
  background: oklch(0.78 0.12 74 / 0.05);
}

.data-table-shell,
.options-table-wrap {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.data-table-wrap {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: oklch(0.14 0.01 250 / 0.72);
}

.data-table {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  min-width: 980px;
}

.data-table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.data-table-body {
  position: relative;
  min-width: 100%;
}

.data-table-options {
  min-width: 1280px;
}

.data-table-equities {
  min-width: 660px;
}

.data-table-flow {
  min-width: 1260px;
}

.data-table-alerts {
  min-width: 900px;
}

.data-table-classifier {
  min-width: 760px;
}

.data-table-dark {
  min-width: 820px;
}

.data-table-head,
.data-table-row {
  display: grid;
  align-items: center;
  column-gap: 8px;
}

.data-table-head {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 10px;
  border-bottom: 1px solid oklch(0.72 0.012 250 / 0.12);
  background: oklch(0.15 0.012 250 / 0.96);
  color: var(--text-faint);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.data-table-row {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid oklch(0.72 0.012 250 / 0.08);
  background: oklch(0.98 0.008 250 / 0.008);
  color: inherit;
  font: inherit;
  text-align: left;
}

.data-table-row.is-even {
  background: oklch(0.98 0.008 250 / 0.018);
}

.data-table-virtual-row {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

.data-table-row:hover,
.data-table-row:focus-visible {
  outline: none;
  background: oklch(0.78 0.12 74 / 0.05);
}

.data-table-row-button {
  cursor: pointer;
}

.data-table-row-options {
  height: 36px;
}

.data-table-row-equities {
  height: 36px;
}

.data-table-row-flow,
.data-table-row-alerts,
.data-table-row-classifier,
.data-table-row-dark {
  height: 44px;
}

.data-table-row-classified {
  background:
    linear-gradient(90deg, rgba(var(--classifier-rgb, 192, 200, 210), calc(0.012 + var(--classifier-intensity, 0) * 0.06)), transparent 62%),
    oklch(0.98 0.008 250 / 0.008);
}

.data-table-row-classified:hover,
.data-table-row-classified:focus-visible {
  background:
    linear-gradient(90deg, rgba(var(--classifier-rgb, 192, 200, 210), calc(0.02 + var(--classifier-intensity, 0) * 0.1)), transparent 68%),
    oklch(0.78 0.12 74 / 0.035);
}

.data-table-row-classified.is-classified {
  box-shadow: inset 0 0 0 1px rgba(var(--classifier-rgb), calc(0.16 + var(--classifier-intensity) * 0.12));
}

.data-table-row-warn,
.data-table-row-severity-high,
.data-table-row-direction-bearish {
  box-shadow: inset 0 0 0 1px oklch(0.68 0.16 28 / 0.32);
}

.data-table-row-severity-medium,
.data-table-row-direction-neutral {
  box-shadow: inset 0 0 0 1px oklch(0.72 0.13 247 / 0.24);
}

.data-table-row-severity-low,
.data-table-row-direction-bullish {
  box-shadow: inset 0 0 0 1px oklch(0.74 0.13 151 / 0.26);
}

.data-table-options .data-table-head,
.data-table-options .data-table-row {
  grid-template-columns: minmax(72px, 0.8fr) minmax(50px, 0.55fr) minmax(64px, 0.7fr) minmax(58px, 0.6fr) minmax(34px, 0.35fr) minmax(62px, 0.65fr) minmax(104px, 1fr) minmax(54px, 0.55fr) minmax(66px, 0.7fr) minmax(48px, 0.5fr) minmax(42px, 0.45fr) minmax(92px, 0.9fr);
}

.data-table-equities .data-table-head,
.data-table-equities .data-table-row {
  grid-template-columns: minmax(76px, 0.9fr) minmax(70px, 0.8fr) minmax(76px, 0.8fr) minmax(70px, 0.75fr) minmax(80px, 0.8fr) minmax(76px, 0.75fr);
}

.data-table-flow .data-table-head,
.data-table-flow .data-table-row {
  grid-template-columns: minmax(148px, 1.1fr) minmax(180px, 1.4fr) minmax(62px, 0.45fr) minmax(70px, 0.5fr) minmax(88px, 0.7fr) minmax(74px, 0.55fr) minmax(132px, 1fr) minmax(110px, 0.8fr) minmax(210px, 1.6fr);
}

.data-table-alerts .data-table-head,
.data-table-alerts .data-table-row {
  grid-template-columns: minmax(76px, 0.75fr) minmax(170px, 1.4fr) minmax(52px, 0.45fr) minmax(58px, 0.45fr) minmax(52px, 0.4fr) minmax(66px, 0.55fr) minmax(260px, 2fr);
}

.data-table-classifier .data-table-head,
.data-table-classifier .data-table-row {
  grid-template-columns: minmax(76px, 0.75fr) minmax(180px, 1.45fr) minmax(70px, 0.6fr) minmax(74px, 0.65fr) minmax(300px, 2.2fr);
}

.data-table-dark .data-table-head,
.data-table-dark .data-table-row {
  grid-template-columns: minmax(76px, 0.75fr) minmax(170px, 1.35fr) minmax(76px, 0.65fr) minmax(74px, 0.65fr) minmax(74px, 0.65fr) minmax(260px, 2fr);
}

.data-table-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
}

.data-table-cell-number {
  font-family: var(--font-mono), monospace;
  font-variant-numeric: tabular-nums;
}

.data-table-spacer {
  min-width: 100%;
  pointer-events: none;
}

.options-table {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: hidden;
}

.options-table-head,
.options-table-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.8fr) minmax(50px, 0.55fr) minmax(64px, 0.7fr) minmax(58px, 0.6fr) minmax(34px, 0.35fr) minmax(62px, 0.65fr) minmax(104px, 1fr) minmax(54px, 0.55fr) minmax(66px, 0.7fr) minmax(48px, 0.5fr) minmax(42px, 0.45fr) minmax(92px, 0.9fr);
  align-items: center;
  column-gap: 8px;
}

.options-table-head {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 8px;
  border-bottom: 1px solid var(--border);
  background: oklch(0.15 0.012 250 / 0.96);
  color: var(--text-faint);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.options-table-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.options-table-row {
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  border-bottom: 1px solid oklch(0.72 0.012 250 / 0.08);
  background:
    linear-gradient(90deg, rgba(var(--classifier-rgb, 192, 200, 210), calc(0.012 + var(--classifier-intensity, 0) * 0.06)), transparent 62%),
    oklch(0.98 0.008 250 / 0.012);
  color: inherit;
  font: inherit;
  text-align: left;
}

.options-table-row:hover,
.options-table-row:focus-visible {
  outline: none;
  background:
    linear-gradient(90deg, rgba(var(--classifier-rgb, 192, 200, 210), calc(0.02 + var(--classifier-intensity, 0) * 0.1)), transparent 68%),
    oklch(0.78 0.12 74 / 0.03);
}

.options-table-row.is-classified {
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(var(--classifier-rgb), calc(0.16 + var(--classifier-intensity) * 0.12));
}

.options-table-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
}

.mono {
  font-variant-numeric: tabular-nums;
}

.classifier-green { --classifier-rgb: 37, 193, 122; }
.classifier-red { --classifier-rgb: 255, 107, 95; }
.classifier-amber { --classifier-rgb: 245, 166, 35; }
.classifier-copper { --classifier-rgb: 198, 122, 75; }
.classifier-blue { --classifier-rgb: 77, 163, 255; }
.classifier-teal { --classifier-rgb: 64, 210, 190; }
.classifier-yellowgreen { --classifier-rgb: 174, 210, 78; }
.classifier-violet { --classifier-rgb: 170, 130, 255; }
.classifier-cyan { --classifier-rgb: 94, 214, 255; }
.classifier-magenta { --classifier-rgb: 255, 92, 205; }
.classifier-neutral { --classifier-rgb: 192, 200, 210; }

.contract,
.drawer-row-title {
  margin-bottom: 6px;
  font-size: 0.92rem;
  font-weight: 600;
}

.option-contract {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta,
.drawer-row-meta,
.flow-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.76rem;
}

.notional-emphasis {
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--accent);
}

.condition-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.condition-sweep {
  border-color: rgba(37, 193, 122, 0.34);
  color: #98f0c0;
  background: var(--green-soft);
}

.condition-iso {
  border-color: rgba(77, 163, 255, 0.34);
  color: #bddcff;
  background: var(--blue-soft);
}

.condition-neutral {
  border-color: rgba(192, 200, 210, 0.28);
  color: #d4dbe3;
  background: rgba(192, 200, 210, 0.08);
}

.pill,
.drawer-chip,
.flag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.structure-tag {
  border-color: rgba(77, 163, 255, 0.36);
  color: #9bcbff;
  background: var(--blue-soft);
}

.aggressor-tag,
.direction-bullish,
.severity-low,
.flag {
  border-color: rgba(37, 193, 122, 0.34);
  color: #98f0c0;
  background: var(--green-soft);
}

.direction-bearish,
.severity-high,
.nbbo-missing {
  border-color: rgba(255, 107, 95, 0.34);
  color: #ffc3bd;
  background: var(--red-soft);
}

.direction-neutral,
.severity-medium,
.flag-muted,
.nbbo-stale {
  border-color: rgba(77, 163, 255, 0.26);
  color: #bddcff;
  background: var(--blue-soft);
}

.nbbo-meta {
  margin-top: 8px;
}

.nbbo-side {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nbbo-tag {
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.nbbo-tag-a,
.nbbo-tag-aa {
  border-color: rgba(37, 193, 122, 0.34);
  color: #98f0c0;
  background: var(--green-soft);
}

.nbbo-tag-b,
.nbbo-tag-bb {
  border-color: rgba(255, 107, 95, 0.34);
  color: #ffc3bd;
  background: var(--red-soft);
}

.nbbo-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(7, 10, 14, 0.96);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 5;
}

.nbbo-tooltip-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
}

.nbbo-side:hover .nbbo-tooltip,
.nbbo-side:focus-within .nbbo-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.alert-strips {
  display: grid;
  gap: 12px;
}

.alert-strip-section {
  display: grid;
  gap: 6px;
}

.alert-strip-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
}

.alert-strip-bar {
  display: flex;
  height: 24px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.strip-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #03130a;
}

.alert-strip-bar .severity-high,
.alert-strip-bar .direction-bearish {
  background: rgba(255, 107, 95, 0.9);
  color: #230705;
}

.alert-strip-bar .severity-medium,
.alert-strip-bar .direction-neutral {
  background: rgba(77, 163, 255, 0.9);
  color: #04111f;
}

.alert-strip-bar .severity-low,
.alert-strip-bar .direction-bullish {
  background: rgba(37, 193, 122, 0.92);
  color: #03130a;
}

.focus-stack {
  display: grid;
  gap: 14px;
}

.focus-block {
  display: grid;
  gap: 8px;
}

.focus-value {
  font-size: 1.4rem;
}

.empty {
  padding: 18px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
}

.drawer {
  position: fixed;
  top: 24px;
  right: 24px;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: oklch(0.16 0.012 250 / 0.98);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.38);
  z-index: 40;
}

.synthetic-control-gear {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: oklch(0.16 0.012 250 / 0.96);
  color: var(--text-dim);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  z-index: 45;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.synthetic-control-gear:hover,
.synthetic-control-gear.is-open {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
}

.synthetic-control-gear-mark {
  display: inline-flex;
  font-size: 1.05rem;
  line-height: 1;
  transform: rotate(45deg);
}

.synthetic-control-drawer {
  position: fixed;
  top: 84px;
  right: 0;
  bottom: 0;
  width: min(388px, calc(100vw - 20px));
  padding: 18px 18px 24px;
  display: grid;
  align-content: start;
  gap: 16px;
  overflow: auto;
  border-left: 1px solid var(--border);
  background: oklch(0.15 0.012 250 / 0.98);
  box-shadow: -16px 0 42px rgba(0, 0, 0, 0.26);
  z-index: 42;
}

.synthetic-control-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.synthetic-control-header h3 {
  margin: 0;
  font-family: var(--font-sans), sans-serif;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.synthetic-control-kicker {
  margin: 0 0 6px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.64rem;
}
.synthetic-control-section {
  display: grid;
  gap: 10px;
  padding: 14px 14px 0;
  border-top: 1px solid var(--border);
}

.synthetic-control-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
}

.synthetic-control-select select,
.synthetic-segment,
.synthetic-control-toggle {
  font: inherit;
}

.synthetic-control-select select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text);
}

.synthetic-control-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
}

.synthetic-control-toggle input {
  accent-color: var(--accent);
}

.synthetic-segment-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.synthetic-segment {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-dim);
}

.synthetic-segment.is-active {
  border-color: var(--border-strong);
  background: var(--accent-soft);
  color: var(--text);
}

.synthetic-profile-grid,
.synthetic-hit-list {
  display: grid;
  gap: 12px;
}

.synthetic-profile-row,
.synthetic-hit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.synthetic-profile-row > span,
.synthetic-hit-row > span,
.synthetic-status-grid span {
  color: var(--text-dim);
  font-size: 0.84rem;
}

.synthetic-status-grid {
  display: grid;
  gap: 10px;
}

.synthetic-status-grid strong,
.synthetic-hit-row strong {
  font-family: var(--font-mono), monospace;
  font-size: 0.86rem;
}

.synthetic-control-disabled {
  display: grid;
  gap: 8px;
  padding: 14px 14px 0;
  border-top: 1px solid var(--border);
}

.synthetic-control-disabled p,
.synthetic-control-disabled span {
  margin: 0;
}

.synthetic-control-disabled-label {
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
}

.synthetic-control-error {
  color: var(--red);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.drawer-eyebrow {
  margin: 0 0 6px;
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.drawer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.drawer-section {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.drawer-section h4 {
  margin: 0;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

.drawer-list {
  display: grid;
  gap: 10px;
}

.drawer-row {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.18);
  }
  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .skip-link,
  .terminal-nav-link,
  .terminal-filter-field::before,
  .terminal-filter-field::after,
  .terminal-button,
  .mode-button,
  .filter-clear,
  .jump-button,
  .pause-button,
  .interval-button,
  .overlay-toggle,
  .drawer-close,
  .status-inline-counter,
  .missed-count,
  .synthetic-control-gear {
    transition: none;
  }

  .chart-status-connecting .chart-dot {
    animation: none;
  }
}

@media (max-width: 1180px) {
  .terminal-shell {
    grid-template-columns: 1fr;
  }

  .terminal-rail {
    position: sticky;
    top: 0;
    z-index: 35;
    height: auto;
    display: grid;
    grid-template-columns: minmax(170px, auto) minmax(0, 1fr);
    align-items: center;
    gap: 14px 18px;
    padding: 14px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .terminal-brand {
    gap: 2px;
  }

  .terminal-brand-name {
    font-size: 1.25rem;
  }

  .terminal-nav {
    display: flex;
    min-width: 0;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .terminal-nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .shell-metrics {
    grid-column: 1 / -1;
    margin-top: 0;
    grid-template-columns: repeat(4, minmax(136px, 1fr));
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .shell-metric {
    min-width: 136px;
    padding: 10px 12px;
  }

  .terminal-topbar {
    position: static;
  }
}

@media (max-width: 980px) {
  .page-grid-home,
  .page-grid-tape,
  .page-grid-signals,
  .page-grid-charts,
  .page-grid-replay,
  .replay-matrix,
  .shell-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-grid-home > :nth-child(3),
  .page-grid-tape > :nth-child(1),
  .page-grid-replay > :nth-child(1) {
    grid-column: auto;
    grid-row: auto;
  }

  .page-grid-home > :nth-child(1),
  .page-grid-home > :nth-child(2),
  .page-grid-home > :nth-child(3),
  .page-grid-signals > .terminal-pane,
  .page-grid-replay > :not(:first-child),
  .page-grid-tape > :first-child,
  .page-grid-tape > :not(:first-child),
  .page-grid-charts > :last-child {
    height: auto;
  }

  .page-grid-signals {
    grid-template-rows: auto;
    min-height: 0;
  }

  .terminal-topbar {
    align-items: center;
    justify-content: flex-end;
    padding: 10px 16px;
  }

  .terminal-topbar-actions {
    justify-content: flex-end;
    margin-left: auto;
    width: auto;
  }

  .terminal-topbar-controls {
    flex: 0 1 auto;
  }

  .flow-filter-popover-panel {
    width: min(420px, calc(100vw - 56px));
  }
}

@media (max-width: 720px) {
  .terminal-shell {
    background-size: 24px 24px, 24px 24px, 100% 100%, auto;
  }

  .terminal-rail {
    position: static;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .terminal-brand {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    gap: 10px;
  }

  .terminal-brand-kicker {
    font-size: 0.7rem;
  }

  .terminal-brand-name {
    font-size: 1rem;
  }

  .terminal-nav {
    padding-bottom: 2px;
  }

  .terminal-nav-link {
    padding: 12px;
    font-size: 0.72rem;
  }

  .shell-metrics {
    display: flex;
    gap: 8px;
  }

  .shell-metric {
    flex: 0 0 156px;
  }

  .terminal-content {
    padding: 16px 10px 22px;
  }

  .page-shell {
    gap: 14px;
  }

  .page-title {
    font-size: 1.55rem;
    line-height: 1.06;
  }

  .page-header,
  .terminal-pane-head,
  .chart-controls,
  .card-controls,
  .terminal-pane-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .terminal-pane-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .terminal-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 12px 10px;
  }

  .terminal-button,
  .mode-button,
  .filter-clear,
  .jump-button,
  .pause-button,
  .interval-button,
  .overlay-toggle,
  .drawer-close,
  .contract-filter-button,
  .filter-chip {
    min-height: 44px;
  }

  .terminal-topbar-actions,
  .terminal-topbar-controls,
  .terminal-topbar-mode {
    width: 100%;
    justify-content: flex-start;
  }

  .terminal-topbar-actions,
  .terminal-topbar-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .terminal-topbar-mode .terminal-button,
  .terminal-topbar-controls > .terminal-button,
  .page-actions > .terminal-button,
  .page-actions > .flow-filter-popover {
    width: 100%;
  }

  .instrument-focus-chip {
    max-width: none;
    min-height: 44px;
    justify-content: space-between;
  }

  .terminal-filter {
    width: 100%;
    min-width: 0;
    flex-basis: auto;
    flex: 1 1 auto;
  }

  .terminal-input {
    width: 100%;
    min-height: 38px;
    padding-bottom: 8px;
    font-size: 1rem;
  }

  .terminal-pane {
    border-radius: 12px;
  }

  .terminal-pane-head,
  .terminal-pane-body {
    padding: 14px 12px;
  }

  .terminal-pane-actions,
  .card-controls,
  .chart-controls,
  .tape-controls {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .tape-controls button {
    flex: 1 1 112px;
  }

  .status-inline {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .status-inline-counter {
    min-width: 0;
  }

  .page-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .flow-filter-popover {
    width: 100%;
  }

  .flow-filter-trigger {
    width: 100%;
    justify-content: space-between;
  }

  .flow-filter-popover-panel {
    position: fixed;
    top: auto;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    right: 10px;
    width: auto;
    max-height: min(72vh, 560px);
    border-radius: 16px;
  }

  .flow-filter-checkbox-grid,
  .flow-filter-checkbox-grid-wide,
  .flow-filter-chip-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .row {
    flex-direction: column;
    align-items: flex-start;
  }

  .data-table-wrap {
    margin-inline: -12px;
    border-radius: 0;
    scroll-snap-type: x proximity;
  }

  .data-table {
    min-width: 860px;
    scroll-snap-align: start;
  }

  .data-table-options,
  .data-table-flow {
    min-width: 1080px;
  }

  .data-table-head,
  .data-table-row {
    padding-inline: 8px;
  }

  .data-table-row-options,
  .data-table-row-equities {
    height: 40px;
  }

  .data-table-row-flow,
  .data-table-row-alerts,
  .data-table-row-classifier,
  .data-table-row-dark {
    height: 48px;
  }

  .time {
    text-align: left;
  }

  .chart-surface {
    height: 320px;
  }

  .drawer {
    position: fixed;
    inset: auto 10px calc(10px + env(safe-area-inset-bottom));
    width: auto;
    max-height: min(78vh, 640px);
    margin-top: 0;
    border-radius: 16px;
  }
}

@media (max-width: 420px) {
  .terminal-content {
    padding-inline: 8px;
  }

  .terminal-pane-head,
  .terminal-pane-body {
    padding-inline: 10px;
  }

  .shell-metric {
    flex-basis: 142px;
  }

  .data-table-wrap {
    margin-inline: -10px;
  }

  .synthetic-control-gear {
    right: 14px;
    bottom: 14px;
  }

  .synthetic-control-drawer {
    top: auto;
    left: 14px;
    right: 14px;
    bottom: 68px;
    width: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
  }
}
