:root {
  color-scheme: dark;
  --bg: #050910;
  --bg-2: #0b1220;
  --panel: #0f1828;
  --panel-2: #152238;
  --line: #233656;
  --line-strong: #2f4b79;
  --text: #f2f6fd;
  --muted: #91a5c4;
  --blue: #5b9bff;
  --green: #22e68a;
  --yellow: #f0bc2b;
  --red: #ff5d7b;
  --violet: #c77dff;
  --cyan: #41d8ff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(64, 116, 196, 0.22), transparent 30%),
    radial-gradient(circle at 85% 5%, rgba(84, 225, 165, 0.12), transparent 25%),
    linear-gradient(180deg, #07101a, var(--bg));
  color: var(--text);
  font-family: "Segoe UI", "Inter", ui-sans-serif, system-ui, sans-serif;
}

.shell {
  display: grid;
  grid-template-columns: 78px 1fr;
  min-height: 100vh;
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 10px;
  border-right: 1px solid rgba(47, 75, 121, 0.45);
  background:
    linear-gradient(180deg, rgba(7, 12, 21, 0.95), rgba(3, 7, 12, 0.96)),
    linear-gradient(180deg, transparent, rgba(91, 155, 255, 0.04));
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(199, 125, 255, 0.7);
  color: var(--violet);
  font-weight: 900;
  font-size: 24px;
  background: radial-gradient(circle at 30% 30%, rgba(199, 125, 255, 0.18), rgba(6, 10, 16, 0.8));
}

.rail-button,
.tab,
button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: 160ms ease;
  font-weight: 800;
}

.rail-button {
  width: 48px;
  height: 38px;
  border-radius: 12px;
  font-size: 11px;
}

.rail-button.active,
.rail-button:hover,
.tab.active,
.tab:hover {
  color: var(--text);
  border-color: rgba(91, 155, 255, 0.7);
  background: rgba(91, 155, 255, 0.14);
}

.workspace {
  position: relative;
  padding: 30px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.workspace::before {
  content: "";
  position: fixed;
  inset: 0 0 0 78px;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 96px, 96px 100%;
  mask-image: linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 78%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 24px 26px;
  border: 1px solid rgba(47, 75, 121, 0.55);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(11, 18, 31, 0.9), rgba(8, 14, 24, 0.88)),
    radial-gradient(circle at top right, rgba(65, 216, 255, 0.08), transparent 24%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.topbar > div:first-child {
  max-width: 900px;
}

.eyebrow {
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
}

h1 {
  margin: 10px 0 10px;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

h2,
h3 {
  margin: 0;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.status-stack {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 430px;
}

#clock {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 32px;
  letter-spacing: -0.04em;
  color: var(--text);
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
}

.good {
  color: var(--green);
  border-color: rgba(34, 230, 138, 0.38);
}

.neutral {
  color: var(--yellow);
  border-color: rgba(240, 188, 43, 0.28);
}

.watch {
  color: var(--yellow);
  border-color: rgba(255, 208, 88, 0.5);
}

.bad {
  color: var(--red);
  border-color: rgba(255, 93, 123, 0.36);
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(35, 54, 86, 0.85);
  margin: 34px 0 30px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 0 12px;
  background: linear-gradient(180deg, rgba(5, 9, 16, 0.98), rgba(5, 9, 16, 0.84));
  backdrop-filter: blur(10px);
}

.tab {
  flex: 0 0 auto;
  padding: 14px 16px;
  border-radius: 16px 16px 0 0;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.layer {
  display: none;
}

.layer.active {
  display: block;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
}

.card,
.panel {
  border: 1px solid rgba(35, 54, 86, 0.92);
  background:
    linear-gradient(180deg, rgba(21, 34, 56, 0.96), rgba(15, 24, 40, 0.97)),
    radial-gradient(circle at top right, rgba(91, 155, 255, 0.08), transparent 30%);
  border-radius: 18px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.card {
  min-height: 118px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.card::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(91, 155, 255, 0.1), rgba(65, 216, 255, 0.9), rgba(34, 230, 138, 0.14));
}

.card span,
.card small,
.panel-head span,
th,
td,
.risk-grid span,
.focus-stats span {
  color: var(--muted);
}

.card strong {
  font-size: 34px;
  color: var(--blue);
  letter-spacing: -0.04em;
}

.main-grid,
.terminal-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.panel {
  padding: 20px;
  min-width: 0;
}

.manual-intervention-panel {
  margin-top: 16px;
  opacity: 0.82;
}

.manual-intervention-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.manual-intervention-panel[open] summary {
  margin-bottom: 16px;
  color: var(--warning);
}

.manual-action-stack[hidden],
.production-inputs[hidden] {
  display: none !important;
}

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head h2 {
  font-size: clamp(24px, 2.2vw, 30px);
  letter-spacing: -0.04em;
}

.panel-head span {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.pro-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(220px, 0.8fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  border: 1px solid rgba(47, 75, 121, 0.72);
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.filter-chip.active,
.filter-chip:hover {
  color: var(--text);
  border-color: rgba(65, 216, 255, 0.72);
  background: rgba(65, 216, 255, 0.1);
}

.toolbar-note {
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pro-expansion-console {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
}

.pro-timeframe-flat[hidden] {
  display: none !important;
}

.pro-control-subnav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
  gap: 8px;
  border: 1px solid rgba(47, 75, 121, 0.62);
  border-radius: 8px;
  padding: 8px;
  background: rgba(8, 13, 22, 0.76);
}

.pro-subtab {
  min-height: 54px;
  display: grid;
  align-content: center;
  gap: 3px;
  border: 1px solid rgba(47, 75, 121, 0.68);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: left;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
}

.pro-subtab strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.1;
}

.pro-subtab span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pro-subtab.active,
.pro-subtab:hover {
  border-color: rgba(65, 216, 255, 0.82);
  background: rgba(65, 216, 255, 0.09);
}

.pro-subtab.active {
  box-shadow: 0 0 0 1px rgba(65, 216, 255, 0.18) inset;
}

.pro-node-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(47, 75, 121, 0.56);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.025);
}

.pro-node-head strong {
  color: var(--text);
}

.pro-node-head p {
  margin: 3px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.pro-expansion-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(65, 216, 255, 0.28);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(65, 216, 255, 0.055);
}

.pro-expansion-summary strong,
.pro-lane-chip strong,
.pro-method-row strong {
  color: var(--text);
}

.pro-expansion-summary p,
.pro-method-row p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.pro-expansion-summary code {
  color: var(--cyan);
  font-size: 11px;
  white-space: nowrap;
}

.pro-expansion-lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}

.pro-timeframe-nodes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.pro-timeframe-node {
  border: 1px solid rgba(47, 75, 121, 0.72);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.025);
}

.pro-timeframe-node.selected {
  border-color: rgba(65, 216, 255, 0.82);
  box-shadow: 0 0 0 1px rgba(65, 216, 255, 0.2) inset;
}

.pro-timeframe-node.good {
  border-color: rgba(34, 230, 138, 0.42);
}

.pro-timeframe-node.watch {
  border-color: rgba(255, 208, 88, 0.48);
}

.pro-node-folder {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  align-items: center;
  text-align: left;
  border: 0;
  border-bottom: 1px solid rgba(47, 75, 121, 0.55);
  padding: 9px 10px;
  background: rgba(12, 20, 34, 0.62);
  color: var(--muted);
}

.pro-node-folder strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.pro-node-folder span,
.pro-node-folder small {
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.pro-node-folder:hover {
  color: var(--text);
  background: rgba(65, 216, 255, 0.075);
}

.pro-node-slots {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 6px;
}

.pro-slot {
  min-height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(47, 75, 121, 0.52);
  border-radius: 5px;
  padding: 3px 4px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  text-align: center;
}

.pro-slot strong {
  color: var(--text);
  font-size: 10px;
  line-height: 1;
}

.pro-slot span {
  display: none;
  font-size: 11px;
}

.bot-slot {
  border-color: rgba(34, 230, 138, 0.35);
}

.bot-slot:hover {
  border-color: rgba(65, 216, 255, 0.76);
  color: var(--text);
}

.missing-slot {
  border-style: dashed;
  border-color: rgba(255, 208, 88, 0.42);
  background: rgba(255, 208, 88, 0.045);
}

.pro-lane-chip {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 4px;
  text-align: left;
  border: 1px solid rgba(47, 75, 121, 0.72);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.pro-lane-chip span,
.pro-lane-chip small {
  font-size: 11px;
  font-weight: 800;
}

.pro-lane-chip.good {
  border-color: rgba(34, 230, 138, 0.45);
  background: rgba(34, 230, 138, 0.07);
}

.pro-lane-chip.watch {
  border-color: rgba(255, 208, 88, 0.5);
  background: rgba(255, 208, 88, 0.075);
}

.pro-lane-chip.neutral:hover,
.pro-lane-chip.good:hover,
.pro-lane-chip.watch:hover {
  border-color: rgba(65, 216, 255, 0.75);
  color: var(--text);
}

.pro-vertical-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.pro-method-row {
  border: 1px solid rgba(35, 54, 86, 0.82);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.025);
}

.pro-method-row .pill {
  float: right;
  margin-left: 8px;
}

.target-slot-row td {
  color: var(--muted);
  background: rgba(255, 208, 88, 0.035);
}

.target-slot-row small,
.slot-action {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

td.neutral {
  color: var(--muted);
}

.pool-health-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.pool-metric {
  border: 1px solid rgba(35, 54, 86, 0.82);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.025);
}

.pool-metric span,
.pool-metric small {
  display: block;
  color: var(--muted);
}

.pool-metric strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 24px;
  letter-spacing: -0.04em;
  color: var(--text);
}

.pro-search input {
  width: 100%;
  border: 1px solid rgba(47, 75, 121, 0.72);
  border-radius: 12px;
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font: inherit;
}

.pro-search input::placeholder {
  color: rgba(145, 165, 196, 0.82);
}

.pro-search input:focus-visible {
  outline: 2px solid rgba(65, 216, 255, 0.95);
  outline-offset: 2px;
}

.bot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.bot-card {
  width: 100%;
  border: 1px solid rgba(65, 216, 255, 0.12);
  border-radius: 16px;
  padding: 14px;
  background: rgba(11, 20, 34, 0.86);
  text-align: left;
  appearance: none;
  min-height: 178px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bot-card:hover {
  border-color: rgba(91, 155, 255, 0.38);
  transform: translateY(-1px);
}

.bot-card.selected {
  border-color: rgba(91, 155, 255, 0.68);
  box-shadow: inset 0 0 0 1px rgba(91, 155, 255, 0.22);
  background: linear-gradient(180deg, rgba(20, 34, 58, 0.95), rgba(11, 20, 34, 0.95));
}

.bot-card-head,
.trade-row-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.bot-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.bot-card p {
  margin: 8px 0 0;
  font-size: 14px;
}

.bot-card code,
.strategy-row code,
.coverage-row code,
.runtime-card code {
  color: var(--cyan);
}

.bot-card-meta,
.trade-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.bot-card-meta span,
.trade-row-meta span,
.focus-stats div,
.feed-row,
.runtime-meta span,
.strategy-meta span {
  border: 1px solid rgba(35, 54, 86, 0.9);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 12px;
}

.risk-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.risk-grid div,
.focus-stats div {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.risk-grid div {
  border: 1px solid rgba(35, 54, 86, 0.92);
  padding: 14px;
}

.risk-grid strong,
.focus-stats strong {
  display: block;
  margin-top: 6px;
  color: var(--green);
  font-size: 22px;
}

.kill-switch,
.primary {
  width: 100%;
  margin-top: 18px;
  border-radius: 14px;
  padding: 14px;
  font-weight: 900;
}

.kill-switch {
  border: 1px solid rgba(255, 93, 123, 0.75);
  background: rgba(255, 93, 123, 0.1);
  color: #ff9aad;
}

.primary {
  border: 1px solid rgba(91, 155, 255, 0.65);
  color: var(--text);
  background: linear-gradient(135deg, #1e62f3, #7648ff);
}

.primary:disabled,
.primary[aria-busy="true"] {
  cursor: wait;
  opacity: 0.7;
}

.secondary {
  background: rgba(91, 155, 255, 0.12);
  color: var(--text);
}

.primary.danger {
  border-color: rgba(255, 96, 126, 0.72);
  background: rgba(255, 96, 126, 0.12);
  color: #ffc5d0;
}

.inline-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
  gap: 18px;
}

.focus-primary h3 {
  font-size: 27px;
  margin-bottom: 8px;
}

.focus-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.feed-runtime,
.agent-runtime-list,
.strategy-board,
.coverage-list,
.gate-list,
.trade-list {
  display: grid;
  gap: 12px;
}

.feed-row,
.runtime-card,
.strategy-row,
.reserve-row,
.coverage-row,
.gate-row,
.trade-row {
  border: 1px solid rgba(35, 54, 86, 0.9);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.trade-row,
.coverage-row,
.strategy-row,
.reserve-row,
.runtime-card,
.gate-row {
  position: relative;
}

.trade-row::before,
.coverage-row::before,
.strategy-row::before,
.reserve-row::before,
.runtime-card::before,
.gate-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 999px;
  background: rgba(91, 155, 255, 0.18);
}

.trade-row.positive::before {
  background: rgba(34, 230, 138, 0.92);
}

.trade-row.negative::before {
  background: rgba(255, 93, 123, 0.92);
}

.coverage-row.real-account {
  background: linear-gradient(135deg, rgba(34, 230, 138, 0.08), rgba(91, 155, 255, 0.06));
  border-color: rgba(34, 230, 138, 0.32);
}

.coverage-row.real-account::before {
  background: rgba(34, 230, 138, 0.92);
}

.coverage-row.real-account:not(.observed) {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(35, 54, 86, 0.9);
}

.coverage-row.real-account:not(.observed)::before {
  background: rgba(91, 155, 255, 0.18);
}

.runtime-card strong,
.strategy-row strong,
.reserve-row strong,
.coverage-row strong,
.gate-row strong,
.trade-row strong {
  display: block;
  margin-bottom: 8px;
}

.compact-board {
  gap: 10px;
}

.strategy-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}

.strategy-toolbar .pill {
  cursor: pointer;
}

.strategy-toolbar .pill.active {
  background: rgba(34, 230, 138, 0.14);
  border-color: rgba(34, 230, 138, 0.55);
  color: var(--good);
}

.reserve-row-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.reserve-row p {
  margin: 8px 0 0;
}

.vertical-bot-actions {
  margin-top: 10px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.vertical-bot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.vertical-bot-grid.compact {
  grid-template-columns: 1fr;
}

.vertical-bot-card,
.vertical-reserve-card {
  border: 1px solid rgba(47, 75, 121, 0.72);
  border-radius: 8px;
  background: rgba(13, 24, 40, 0.76);
  padding: 12px;
  display: grid;
  gap: 10px;
  cursor: pointer;
}

.vertical-reserve-card {
  cursor: default;
}

.vertical-bot-card:hover {
  border-color: rgba(65, 216, 255, 0.58);
  background: rgba(17, 33, 55, 0.86);
}

.vertical-bot-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.vertical-bot-head strong {
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.vertical-bot-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.vertical-bot-metrics.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vertical-bot-metrics div {
  border: 1px solid rgba(35, 54, 86, 0.82);
  border-radius: 8px;
  padding: 8px;
  background: rgba(6, 11, 19, 0.28);
  min-width: 0;
}

.vertical-bot-metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.vertical-bot-metrics strong {
  margin: 3px 0 0;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.vertical-bot-metrics .pill {
  padding: 4px 7px;
  font-size: 10px;
  line-height: 1;
}

.vertical-bot-card p,
.vertical-reserve-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.vertical-bot-card code,
.vertical-reserve-card code {
  color: var(--cyan);
  white-space: normal;
  overflow-wrap: anywhere;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 13px;
  background: rgba(6, 11, 19, 0.24);
  border-radius: 16px;
  overflow: hidden;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(38, 54, 79, 0.7);
  text-align: left;
}

th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(10, 18, 31, 0.96);
  backdrop-filter: blur(12px);
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
}

.sort-button::after {
  content: "↕";
  color: rgba(145, 165, 196, 0.7);
  font-size: 11px;
}

.sort-button.active::after {
  content: "↑";
  color: var(--cyan);
}

.sort-button.active.desc::after {
  content: "↓";
}

tr[data-bot-row] {
  cursor: pointer;
  transition: background 160ms ease;
}

tr[data-bot-row]:hover {
  background: rgba(91, 155, 255, 0.08);
}

tr[data-bot-row].selected {
  background: rgba(91, 155, 255, 0.12);
}

tr[data-bot-row].selected td:first-child {
  color: var(--cyan);
}

.table-action {
  width: 100%;
  border: 1px solid rgba(91, 155, 255, 0.45);
  border-radius: 10px;
  padding: 7px 10px;
  color: var(--text);
  background: rgba(91, 155, 255, 0.1);
  font-size: 11px;
  font-weight: 800;
}

.table-action:hover {
  background: rgba(91, 155, 255, 0.18);
  border-color: rgba(65, 216, 255, 0.72);
}

.table-actions {
  display: grid;
  gap: 8px;
}

.table-action.danger {
  border-color: rgba(255, 96, 126, 0.45);
  background: rgba(255, 96, 126, 0.08);
  color: #ffc5d0;
}

.table-action.danger:hover {
  background: rgba(255, 96, 126, 0.16);
  border-color: rgba(255, 96, 126, 0.72);
}

.table-action.production {
  border-color: rgba(34, 230, 138, 0.5);
  background: rgba(34, 230, 138, 0.08);
  color: #bfffe0;
}

.table-action.production:hover {
  border-color: rgba(34, 230, 138, 0.82);
  background: rgba(34, 230, 138, 0.16);
}

#bot-table small {
  display: inline-block;
  margin-top: 4px;
  color: var(--cyan);
  font-size: 11px;
}

#bot-table .risk-reason {
  color: var(--muted);
  max-width: 170px;
  white-space: normal;
  overflow-wrap: anywhere;
}

td.positive {
  color: var(--green);
}

td.negative {
  color: var(--red);
}

.empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 16px;
  white-space: pre-wrap;
}

.chart-panel {
  padding: 20px;
  overflow: hidden;
}

.chart-head {
  margin-bottom: 14px;
}

.chart-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chart-badges .pill {
  background: rgba(91, 155, 255, 0.08);
  color: var(--text);
}

.chart-meta-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.9fr);
  gap: 12px;
  margin-bottom: 14px;
}

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

.chart-meta-card,
.chart-legend,
.chart-equity-card {
  border: 1px solid rgba(35, 54, 86, 0.82);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
}

.chart-meta-card strong,
.chart-legend strong,
.chart-equity-card strong {
  color: var(--text);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid rgba(35, 54, 86, 0.82);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.025);
}

.chart-toggle {
  border: 1px solid rgba(47, 75, 121, 0.72);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.chart-toggle.active,
.chart-toggle:hover {
  color: var(--text);
  border-color: rgba(65, 216, 255, 0.72);
  background: rgba(65, 216, 255, 0.1);
}

.chart-equity-summary {
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1.5;
}

#equity-mini-chart {
  min-height: 90px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.legend-mark {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.legend-mark.candle-up {
  background: var(--green);
}

.legend-mark.candle-down {
  background: var(--red);
}

.legend-mark.trade-entry {
  background: var(--cyan);
}

.legend-mark.trade-exit {
  background: var(--yellow);
}

.legend-mark.signal {
  background: var(--violet);
}

canvas {
  width: 100%;
  max-width: 100%;
  display: block;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(18, 30, 49, 0.96), rgba(10, 17, 29, 0.96)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent 20%);
}

#market-chart {
  min-height: 380px;
}

#physics-market-chart {
  min-height: 320px;
}

#physics-chart {
  min-height: 180px;
}

.physics-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.compact-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip.compact {
  padding: 6px 10px;
  font-size: 11px;
}

.physics-indicator-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 16px 0 10px;
}

.sentiment-row.active {
  border-color: rgba(65, 216, 255, 0.72);
  background: rgba(65, 216, 255, 0.08);
}

.physical-fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.physical-bot-card {
  border: 1px solid rgba(47, 75, 121, 0.72);
  border-radius: 8px;
  background: rgba(13, 24, 40, 0.76);
  padding: 12px;
  display: grid;
  gap: 10px;
  min-height: 220px;
}

.physical-bot-card.good {
  border-color: rgba(34, 230, 138, 0.45);
}

.physical-bot-card.bad {
  border-color: rgba(255, 92, 122, 0.55);
}

.physical-bot-head,
.physical-bot-signal,
.physical-bot-metrics,
.physical-bot-costs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.physical-bot-head {
  justify-content: space-between;
}

.physical-bot-head span,
.physical-bot-head small,
.physical-bot-metrics span,
.physical-bot-costs span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.physical-bot-head strong {
  color: var(--text);
  font-size: 14px;
  max-width: 170px;
  overflow-wrap: anywhere;
}

.physical-bot-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.physical-bot-card code {
  color: var(--cyan);
  white-space: normal;
  overflow-wrap: anywhere;
}

.signal-state {
  font-size: 58px;
  font-weight: 950;
  color: #7f8da4;
  margin: 44px 0 18px;
  letter-spacing: -0.06em;
}

.signal-compact {
  font-size: 42px;
  margin: 10px 0 12px;
}

#selected-bot-clock {
  min-width: 64px;
  text-align: center;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 15px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(47, 75, 121, 0.72);
  background: rgba(8, 14, 24, 0.86);
  color: var(--cyan);
}

#selected-trade-copy {
  max-width: 34ch;
  font-size: 16px;
  line-height: 1.62;
}

.meter {
  height: 10px;
  border-radius: 999px;
  background: #24324a;
  overflow: hidden;
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: #233049;
  overflow: hidden;
}

.bar span,
.meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--yellow), var(--green));
}

.sentiment-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.sentiment-row {
  display: grid;
  grid-template-columns: 44px 1fr 76px;
  gap: 10px;
  align-items: center;
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.agent-card {
  border: 1px solid rgba(35, 54, 86, 0.9);
  border-radius: 16px;
  padding: 18px;
  background: rgba(16, 24, 39, 0.88);
  cursor: pointer;
  transition: 160ms ease;
  text-align: left;
  min-height: 100%;
}

.agent-card:hover {
  border-color: rgba(91, 155, 255, 0.42);
  transform: translateY(-1px);
}

.agent-card.selected {
  border-color: rgba(91, 155, 255, 0.7);
  box-shadow: inset 0 0 0 1px rgba(91, 155, 255, 0.22);
  background: linear-gradient(180deg, rgba(20, 34, 58, 0.95), rgba(16, 24, 39, 0.95));
}

.agent-card strong {
  display: block;
  font-size: 19px;
  margin-bottom: 8px;
}

.agent-card ul,
.pipeline {
  color: var(--muted);
  line-height: 1.8;
}

.agent-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 6px;
}

.agent-card-copy {
  margin: 12px 0;
}

.agent-source-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.agent-source-list span {
  border: 1px solid rgba(35, 54, 86, 0.9);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 12px;
}

.memory-graph-lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.memory-graph-lane {
  border: 1px solid rgba(35, 54, 86, 0.9);
  border-radius: 8px;
  background: rgba(10, 16, 28, 0.64);
  padding: 12px;
  min-height: 180px;
  overflow: hidden;
}

.memory-graph-lane strong {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
}

.memory-graph-lane p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.memory-graph-lane code {
  display: inline-block;
  margin-left: 4px;
  color: #9ec7ff;
}

.mini-action {
  margin-top: 10px;
  border: 1px solid rgba(91, 155, 255, 0.7);
  background: rgba(28, 42, 68, 0.95);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  min-height: 36px;
  min-width: 86px;
  white-space: nowrap;
  touch-action: manipulation;
}

.mini-action:hover {
  border-color: rgba(65, 216, 255, 0.9);
}

.mini-action:disabled,
.mini-action[aria-busy="true"] {
  cursor: wait;
  opacity: 0.68;
}

.mini-action.danger {
  border-color: rgba(255, 92, 128, 0.7);
  color: #ffd6df;
}

.mini-action.danger:hover {
  border-color: rgba(255, 92, 128, 0.95);
}

.decision-actions {
  display: none !important;
  grid-template-columns: repeat(auto-fit, minmax(112px, max-content));
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  width: 100%;
}

.ceo-pipeline-note {
  border-color: rgba(0, 245, 160, 0.28);
  background: rgba(0, 245, 160, 0.04);
}

.ceo-pipeline-note code {
  color: #00f5a0;
}

.ceo-action-routing {
  margin-top: 10px;
  color: var(--muted);
}

.ceo-action-routing code {
  color: #00f5a0;
}

.decision-inbox-panel {
  min-height: 0;
}

.decision-inbox-panel .coverage-row,
.decision-inbox-panel .mini-decision-row {
  overflow: visible;
}

.decision-inbox-panel .mini-action {
  margin-top: 0;
  width: 100%;
  min-width: 112px;
  position: relative;
  z-index: 2;
}

.decision-stack {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.mini-decision-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(35, 54, 86, 0.86);
  border-radius: 8px;
  background: rgba(4, 14, 28, 0.35);
}

.mini-decision-row > div {
  min-width: 0;
}

.mini-decision-row strong,
.mini-decision-row p,
.mini-decision-row code,
.coverage-row p,
.coverage-row code {
  overflow-wrap: anywhere;
}

.mini-decision-row p {
  margin: 4px 0;
}

.mini-decision-row .mini-action {
  margin-top: 0;
}

.pipeline li {
  margin: 8px 0;
  padding: 12px;
  border: 1px solid rgba(35, 54, 86, 0.86);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.danger-dot {
  width: 10px;
  height: 10px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--red);
}

.runtime-meta,
.strategy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.action-stack {
  display: grid;
  gap: 12px;
}

.production-actions {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.production-reset-actions {
  grid-template-columns: minmax(180px, 320px);
  margin: -2px 0 14px;
}

.production-actions .primary {
  margin-top: 0;
}

.production-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.production-inputs label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.production-inputs .production-baseline-confirm {
  grid-column: span 2;
}

.production-inputs input {
  width: 100%;
  margin-top: 6px;
  border: 1px solid rgba(47, 75, 121, 0.78);
  border-radius: 10px;
  background: rgba(10, 18, 31, 0.82);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

@media (max-width: 760px) {
  .production-inputs .production-baseline-confirm {
    grid-column: span 1;
  }
}

.production-table-wrap {
  max-height: 420px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.production-table-wrap table {
  min-width: 880px;
}

.trade-list,
.coverage-list,
.strategy-board,
.agent-runtime-list,
.gate-list {
  align-content: start;
}

.trade-list {
  max-height: 720px;
  overflow: auto;
  padding-right: 2px;
}

#chart-stream-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(35, 54, 86, 0.8);
  background: rgba(255, 255, 255, 0.025);
}

#layer-pro .terminal-layout > .panel:first-child {
  max-height: 720px;
  overflow: auto;
  scrollbar-gutter: stable;
}

#layer-pro .terminal-layout > .panel:nth-child(2) {
  position: sticky;
  top: 104px;
}

.coverage-row p,
.runtime-card p,
.gate-row p,
.strategy-row p,
.trade-row p {
  margin: 0;
}

.strategy-score {
  font-size: 28px;
  color: var(--green);
  font-weight: 900;
}

button:focus-visible,
.tab:focus-visible,
.rail-button:focus-visible,
.bot-card:focus-visible,
.agent-card:focus-visible {
  outline: 2px solid rgba(65, 216, 255, 0.95);
  outline-offset: 2px;
}

@media (max-width: 1200px) {
  .workspace::before {
    inset: 0;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .status-stack {
    justify-content: flex-start;
    max-width: none;
  }

  .focus-grid {
    grid-template-columns: 1fr;
  }

  .chart-meta-strip {
    grid-template-columns: 1fr;
  }
}

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

  .rail {
    position: sticky;
    top: 0;
    z-index: 3;
    flex-direction: row;
    justify-content: center;
    backdrop-filter: blur(8px);
  }

  .kpi-grid,
  .main-grid,
  .terminal-layout {
    grid-template-columns: 1fr;
  }

  .span-2,
  .span-3 {
    grid-column: auto;
  }

  .workspace {
    padding: 22px 16px 28px;
  }

  .tabs {
    overflow-x: auto;
  }

  .pro-toolbar {
    grid-template-columns: 1fr;
  }

  .toolbar-note {
    justify-self: start;
  }

  #layer-pro .terminal-layout > .panel:first-child,
  #layer-pro .terminal-layout > .panel:nth-child(2) {
    max-height: none;
    position: static;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 20px 18px;
    border-radius: 20px;
  }

  #clock {
    font-size: 24px;
  }

  .bot-grid,
  .agent-grid {
    grid-template-columns: 1fr;
  }

  .focus-stats,
  .risk-grid {
    grid-template-columns: 1fr;
  }

  .tab {
    white-space: nowrap;
  }

  h1 {
    line-height: 1;
  }

  #market-chart {
    min-height: 300px;
  }
}
