:root {
  color-scheme: dark;
  --bg: #0b0e13;
  --panel: #11161e;
  --line: #252c37;
  --muted: #929dab;
  --text: #e8edf3;
  --accent: #b9ca9c;
  --green: #66c8a3;
  --red: #ef8585;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: Inter, "Segoe UI", sans-serif
}

* {
  box-sizing: border-box
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased
}

button,
input,
select {
  font: inherit
}

button,
a,
select {
  touch-action: manipulation
}

button,
select,
input {
  border: 1px solid var(--line);
  background: #171d26;
  color: var(--text);
  border-radius: 5px;
  padding: 7px 10px
}

button {
  cursor: pointer
}

button:hover,
select:hover {
  border-color: var(--accent)
}

button:disabled {
  opacity: .5;
  cursor: wait
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px
}

h1,
h2,
h3,
p {
  margin: 0
}

h1 {
  font-size: 28px;
  letter-spacing: -1px;
  font-weight: 550
}

h1>span {
  color: var(--accent)
}

h2 {
  font-size: 18px;
  letter-spacing: -.4px;
  font-weight: 550
}

h3 {
  font-size: 16px;
  font-weight: 600
}

strong,
b {
  font-weight: 550
}

small,
.subtle {
  color: var(--muted);
  font-size: 11px
}

dl,
dt,
dd {
  margin: 0
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 11px/1.7 var(--mono);
  color: var(--muted)
}

details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 12px
}

summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px
}

.skip {
  position: absolute;
  top: -100px;
  z-index: 100
}

.skip:focus {
  top: 0;
  padding: 16px;
  background: var(--panel)
}

.boot {
  padding: 60px;
  line-height: 3
}

.command-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 30px;
  background: #0d1118f5;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px)
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 16px;
  letter-spacing: 2px
}

.brand b {
  color: var(--accent)
}

.brand small {
  display: block;
  font-size: 9px;
  letter-spacing: 3.7px;
  margin-top: 2px
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #728065;
  width: 38px;
  height: 38px;
  color: var(--accent);
  font-size: 18px;
  letter-spacing: -5px;
  padding-right: 5px;
  transform: skew(-5deg)
}

.brand-icon span {
  padding-top: 8px
}

.paper-status {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #b9ca9c4d;
  border-radius: 5px;
  padding: 8px 18px;
  font: 600 13px var(--mono);
  letter-spacing: .6px;
  color: var(--accent);
  background: #b9ca9c0a
}

.status-dot {
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%
}

.paper-status:not(.bad) .status-dot {
  animation: breathe 3s infinite
}

.clocks {
  display: flex;
  gap: 22px;
  font: 11px var(--mono);
  color: var(--muted)
}

.clocks span:first-child {
  color: var(--text)
}

.nav {
  display: flex;
  gap: 28px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 30px;
  height: 48px;
  color: var(--muted);
  font-size: 12px;
  overflow: auto
}

.nav a {
  white-space: nowrap;
  padding: 14px 0
}

.nav a:hover,
.nav .selected {
  color: var(--accent);
  border-bottom: 2px solid var(--accent)
}

.nav>span {
  margin-left: auto;
  white-space: nowrap;
  font: 10px var(--mono);
  letter-spacing: .6px
}

.nav i {
  color: #4b5564;
  margin: 0 8px;
  font-style: normal
}

main {
  max-width: 1920px;
  margin: auto;
  padding: 26px 30px
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px
}

.eyebrow {
  display: block;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px
}

.snapshot-age {
  text-align: right;
  font: 10px/1.8 var(--mono);
  color: var(--muted)
}

.snapshot-age button {
  margin-left: 8px;
  font-size: 10px
}

.telemetry {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 11px 0;
  border-block: 1px solid var(--line);
  font: 9px var(--mono);
  color: var(--muted)
}

.telemetry>span {
  display: flex;
  align-items: center;
  gap: 7px
}

.telemetry b {
  color: var(--text);
  font-weight: 400
}

.badge {
  display: inline-block;
  padding: 3px 6px;
  border: 1px solid #46503c;
  border-radius: 3px;
  background: #b9ca9c08;
  color: var(--accent);
  font: 9px/1.4 var(--mono);
  letter-spacing: .3px;
  white-space: nowrap
}

.badge.good {
  color: var(--green);
  border-color: #66c8a330;
  background: #66c8a308
}

.bad,
.badge.bad {
  color: var(--red);
  border-color: #ef858540;
  background: #ef858508
}

.alert {
  display: flex;
  gap: 14px;
  padding: 10px 14px;
  margin-top: 8px;
  background: #c6ae7110;
  border-left: 2px solid #c6ae71;
  color: #dec994;
  font-size: 11px
}

.alert b {
  font: 10px/1.6 var(--mono);
  min-width: 65px
}

.alert.critical {
  background: #ef858515;
  border-color: var(--red);
  color: #ffaaaa
}

.money-grid {
  display: grid;
  grid-template-columns: 1.45fr repeat(2, 1fr) 1.4fr;
  gap: 12px;
  margin-top: 20px
}

.money-card {
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  min-width: 0
}

.money-card strong {
  display: block;
  font: 25px/1.5 var(--mono);
  letter-spacing: -1px;
  margin-top: 7px
}

.money-card small {
  display: block;
  font: 10px/1.5 var(--mono)
}

.money-card.equity {
  grid-row: span 2;
  background: radial-gradient(ellipse at top left, #b9ca9c12, transparent 80%), var(--panel);
  border-color: #b9ca9c40;
  display: flex;
  flex-direction: column;
  justify-content: center
}

.money-card.equity strong {
  font-size: 38px;
  color: var(--text);
  margin: 7px 0
}

.money-card.drawdown {
  grid-column: 4;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: center
}

.drawdown strong {
  font-size: 30px
}

.drawdown .meter {
  margin: 18px 0 10px;
  height: 7px
}

.drawdown .meter span {
  background: #d8b87c
}

.positive strong,
.positive dd,
.positive b,
.positive {
  color: var(--green)
}

.negative strong,
.negative dd,
.negative b,
.negative {
  color: var(--red)
}

.capital-strip {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 13px 0 20px;
  font: 9px var(--mono);
  color: var(--muted)
}

.capital-strip b {
  margin-left: 10px;
  color: var(--text);
  font-size: 11px
}

.capital-strip em {
  font-style: normal;
  color: var(--muted);
  margin-left: 6px
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr);
  gap: 20px
}

.positions-section,
.strategy-section {
  grid-column: 1/-1
}

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

.section-head .eyebrow {
  font-size: 8px;
  margin-bottom: 3px
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 20px;
  min-width: 0
}

.asset-head {
  display: flex;
  align-items: center;
  gap: 12px
}

.asset-head>.badge {
  margin-left: auto
}

.coin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #b9ca9c40;
  background: #b9ca9c0c;
  border-radius: 50%;
  font-size: 23px;
  color: var(--accent)
}

.asset-head small {
  font: 9px var(--mono);
  letter-spacing: 1px
}

.position-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 16px
}

.position-value strong {
  font: 28px var(--mono)
}

.position-value>div:last-child {
  text-align: right
}

.position-value b {
  font: 18px var(--mono);
  display: block
}

.position-value small {
  display: block;
  color: inherit
}

.position-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 24px;
  border-top: 1px solid var(--line);
  padding-top: 10px
}

.kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 11px;
  padding: 6px 0;
  min-width: 0
}

.kv dt {
  color: var(--muted);
  flex-shrink: 1
}

.kv dd {
  font: 10px/1.4 var(--mono);
  text-align: right;
  overflow-wrap: anywhere
}

.strategy {
  background: linear-gradient(115deg, #111920, #11161e)
}

.strategy-levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 22px 0 16px
}

.strategy-levels strong {
  font: 19px var(--mono)
}

.distance {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  padding: 8px 0
}

.distance b {
  font: 10px var(--mono);
  color: var(--text)
}

.meter {
  height: 4px;
  background: #252d35;
  border-radius: 2px;
  overflow: hidden
}

.meter span {
  height: 100%;
  display: block;
  background: var(--accent);
  transition: width .4s
}

.meter.unavailable {
  background: repeating-linear-gradient(135deg, #252d35, #252d35 4px, #1c232c 4px, #1c232c 8px)
}

.strategy .position-grid {
  margin-top: 16px
}

.strategy-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font: 9px var(--mono);
  color: var(--muted)
}

.strategy-foot b {
  color: var(--accent);
  font-size: 12px
}

.performance {
  grid-column: 1
}

.tape {
  grid-column: 2
}

.chart-tools,
.history-tools {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px
}

.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap
}

.tabs button {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  font-size: 10px;
  padding: 6px 9px;
  white-space: nowrap
}

.tabs .active {
  background: #b9ca9c15;
  color: var(--accent);
  border-color: #b9ca9c35
}

.chart-tools label,
.filters label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--muted)
}

select {
  font-size: 10px;
  max-width: 170px
}

.plot {
  display: block;
  width: 100%;
  height: auto;
  min-height: 180px
}

.plot.compact {
  min-height: 90px
}

.plot text {
  fill: var(--muted);
  font: 10px var(--mono)
}

.gridline {
  stroke: #27313d;
  stroke-dasharray: 3 6;
  stroke-width: .7
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  vector-effect: non-scaling-stroke
}

.chart-line.dd-line {
  stroke: #ce8787
}

.chart-line.benchmark {
  stroke: #8b9bca;
  stroke-dasharray: 5 3
}

.chart-point {
  fill: var(--accent);
  opacity: .5
}

.chart-caption {
  display: flex;
  justify-content: space-between;
  margin: 10px 0 22px;
  font-size: 9px;
  color: var(--muted)
}

.legend-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 5px
}

.performance-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line)
}

.note {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 12px;
  overflow-wrap: anywhere
}

.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 140px;
  color: var(--muted);
  font: 10px/1.8 var(--mono);
  text-align: center;
  padding: 25px
}

.empty-mark {
  font-size: 28px;
  color: #586273;
  margin-bottom: 12px
}

.poll-label {
  font: 9px var(--mono);
  color: var(--accent)
}

.tape-list {
  max-height: 720px;
  overflow: auto;
  scrollbar-width: thin
}

.tape-event {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  overflow-wrap: anywhere
}

.tape-event time {
  display: block;
  color: var(--muted);
  font: 9px var(--mono);
  margin-bottom: 6px
}

.tape-event>b {
  font: 10px var(--mono);
  color: var(--accent)
}

.tape-event p {
  margin: 6px 0
}

.tape-event small {
  font-size: 9px
}

.risk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px
}

.market .two-grid>article+article {
  border-left: 1px solid var(--line);
  padding-left: 14px
}

.market-price {
  display: block;
  font: 24px var(--mono);
  margin: 12px 0
}

.market .eyebrow {
  font-size: 8px;
  letter-spacing: .5px
}

.market dl {
  margin-top: 14px
}

.history,
.intelligence,
.system {
  grid-column: 1/-1
}

.filters {
  display: flex;
  gap: 12px
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left
}

th {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 400;
  border-bottom: 1px solid var(--line);
  padding: 10px 8px
}

td {
  font: 11px/1.5 var(--mono);
  padding: 12px 8px;
  border-bottom: 1px solid #252c3780;
  overflow-wrap: anywhere
}

td:last-child {
  max-width: 220px
}

.news-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 35px 20px;
  text-align: center;
  min-height: 260px;
  background: radial-gradient(ellipse at center, #b9ca9c06, transparent 65%)
}

.news-symbol {
  font-size: 28px;
  color: #76836a;
  margin-bottom: 15px
}

.news-empty h3 {
  font: 13px var(--mono);
  letter-spacing: 2px;
  color: var(--accent)
}

.news-empty p {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0 22px
}

.news-empty>span {
  font: 8px var(--mono);
  letter-spacing: 1px;
  color: var(--muted)
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px
}

.health-grid article {
  background: #0d1219;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 13px;
  min-width: 0
}

.health-grid article>div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center
}

.health-grid b {
  font-size: 11px
}

.health-grid dl {
  margin-top: 12px
}

.health-grid .kv {
  font-size: 9px;
  flex-wrap: wrap
}

.health-grid .kv dd {
  font-size: 9px
}

.system-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 30px;
  margin-top: 20px
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 25px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  font: 9px var(--mono);
  color: var(--muted)
}

footer b {
  color: var(--accent)
}

.login {
  padding: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  margin-top: 10px
}

.login label {
  display: flex;
  flex-direction: column;
  font-size: 10px;
  color: var(--muted)
}

@keyframes breathe {
  50% {
    opacity: .45
  }
}

@media(min-width:1600px) {
  .money-card.equity strong {
    font-size: 46px
  }

  .workspace {
    grid-template-columns: minmax(0, 1.8fr) minmax(420px, 1fr)
  }
}

@media(max-width:1200px) {
  .health-grid {
    grid-template-columns: repeat(3, 1fr)
  }

  .nav>span {
    display: none
  }

  .clocks {
    flex-direction: column;
    gap: 4px
  }

  .position-grid {
    column-gap: 15px
  }

  .performance-stats {
    grid-template-columns: 1fr 1fr
  }

  .market .two-grid {
    grid-template-columns: 1fr
  }

  .market .two-grid>article+article {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 15px 0 0
  }
}

@media(max-width:900px) {
  main {
    padding: 20px 16px
  }

  .command-bar {
    padding: 13px 16px
  }

  .nav {
    padding: 0 16px;
    gap: 24px
  }

  .workspace {
    grid-template-columns: 1fr
  }

  .workspace>section {
    grid-column: 1
  }

  .money-grid {
    grid-template-columns: repeat(3, 1fr)
  }

  .money-card.equity {
    grid-row: auto;
    grid-column: span 2
  }

  .money-card.drawdown {
    grid-column: auto;
    grid-row: auto
  }

  .money-card.equity strong {
    font-size: 34px
  }

  .money-card.drawdown strong {
    font-size: 23px
  }

  .tape-list {
    max-height: 350px
  }

  .performance {
    order: 4
  }

  .tape {
    order: 3
  }

  .positions-section {
    order: 1
  }

  .strategy-section {
    order: 2
  }

  .risk {
    order: 5
  }

  .market {
    order: 6
  }

  .history {
    order: 7
  }

  .intelligence {
    order: 8
  }

  .system {
    order: 9
  }

  .market .two-grid {
    grid-template-columns: 1fr 1fr
  }

  .market .two-grid>article+article {
    border-top: 0;
    border-left: 1px solid var(--line);
    padding: 0 0 0 14px
  }

  .health-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .title-row .eyebrow {
    font-size: 8px
  }

  h1 {
    font-size: 24px
  }

  .snapshot-age {
    max-width: 190px
  }

  .position-grid {
    grid-template-columns: 1fr
  }

  .strategy-levels strong {
    font-size: 16px
  }

  .strategy-levels .eyebrow {
    font-size: 8px;
    letter-spacing: .4px
  }

  td {
    font-size: 10px
  }
}

@media(max-width:600px) {
  html {
    scroll-padding-top: 126px
  }

  .command-bar {
    flex-wrap: wrap;
    gap: 10px
  }

  .brand {
    font-size: 13px;
    letter-spacing: 1.5px
  }

  .brand small {
    font-size: 7px;
    letter-spacing: 2.4px
  }

  .brand-icon {
    height: 30px;
    width: 30px;
    font-size: 15px
  }

  .paper-status {
    padding: 7px 9px;
    font-size: 10px;
    gap: 6px
  }

  .clocks {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    font-size: 9px
  }

  .nav {
    height: 42px;
    font-size: 11px;
    gap: 22px
  }

  .title-row {
    align-items: flex-start;
    gap: 15px
  }

  .title-row .eyebrow {
    display: none
  }

  h1 {
    font-size: 21px
  }

  .snapshot-age {
    font-size: 8px;
    max-width: 130px
  }

  .snapshot-age button {
    margin: 3px 0 0
  }

  .telemetry {
    gap: 10px 14px;
    font-size: 8px
  }

  .telemetry .badge {
    font-size: 8px
  }

  .alert {
    padding: 9px;
    gap: 8px;
    font-size: 10px
  }

  .alert b {
    min-width: 52px;
    font-size: 9px
  }

  .money-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px
  }

  .money-card {
    padding: 14px
  }

  .money-card.equity {
    grid-column: 1/-1;
    order: 0
  }

  .money-card.equity strong {
    font-size: 38px
  }

  .money-card:nth-child(2) {
    order: 1
  }

  .money-card.drawdown {
    order: 2;
    grid-column: auto
  }

  .money-card:nth-child(n+4) {
    order: 3
  }

  .money-card strong {
    font-size: 22px
  }

  .money-card small {
    font-size: 9px
  }

  .drawdown .meter {
    margin: 12px 0 8px
  }

  .money-card .eyebrow {
    font-size: 8px;
    letter-spacing: .8px
  }

  .capital-strip {
    gap: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr
  }

  .capital-strip>span {
    display: flex;
    flex-direction: column;
    gap: 5px
  }

  .capital-strip b {
    margin: 0;
    font-size: 10px
  }

  .two-grid {
    grid-template-columns: 1fr
  }

  .panel {
    padding: 16px
  }

  .section-head h2 {
    font-size: 17px
  }

  .section-head>.subtle {
    max-width: 110px;
    text-align: right;
    font-size: 9px
  }

  .position-grid {
    grid-template-columns: 1fr 1fr;
    column-gap: 14px
  }

  .kv {
    font-size: 10px
  }

  .kv dd {
    font-size: 9px
  }

  .position-value strong {
    font-size: 26px
  }

  .strategy-levels strong {
    font-size: 18px
  }

  .strategy-levels .eyebrow {
    font-size: 8px
  }

  .performance-stats {
    grid-template-columns: 1fr 1fr;
    column-gap: 15px
  }

  .chart-caption {
    gap: 10px;
    font-size: 8px
  }

  .plot {
    min-height: 150px
  }

  .plot.compact {
    min-height: 80px
  }

  .chart-tools {
    gap: 8px
  }

  .tabs button {
    padding: 7px 8px
  }

  .risk-grid {
    column-gap: 15px
  }

  .market .two-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px
  }

  .market-price {
    font-size: 20px
  }

  .market .kv {
    flex-direction: column;
    gap: 2px
  }

  .market .kv dd {
    text-align: left
  }

  .market .two-grid>article+article {
    padding-left: 10px
  }

  .filters {
    width: 100%;
    gap: 8px;
    justify-content: space-between
  }

  .filters label {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px
  }

  .history-tools>.tabs {
    gap: 1px
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%
  }

  thead {
    display: none
  }

  tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--line)
  }

  td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    border: 0;
    font-size: 11px
  }

  td:before {
    content: attr(data-label);
    font: 10px var(--sans);
    color: var(--muted)
  }

  td:last-child {
    max-width: none
  }

  .health-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px
  }

  .health-grid article {
    padding: 10px
  }

  .health-grid article>div {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px
  }

  .system-meta {
    grid-template-columns: 1fr;
    gap: 0
  }

  .news-empty {
    padding: 30px 8px
  }

  .news-empty h3 {
    font-size: 11px;
    letter-spacing: 1px
  }

  .news-empty p {
    font-size: 11px
  }

  .news-empty>span {
    font-size: 7px
  }

  footer {
    flex-direction: column;
    gap: 8px;
    font-size: 8px
  }

  .tape {
    order: 3
  }

  .intelligence {
    order: 4
  }

  .performance {
    order: 5
  }

  .risk {
    order: 6
  }

  .market {
    order: 7
  }

  .history {
    order: 8
  }

  .system {
    order: 9
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important
  }
}

.news-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--line)
}

.news-item>div {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 10px
}

.news-item time {
  font: 10px var(--mono);
  color: var(--muted)
}

.news-item h3 {
  margin-bottom: 8px
}

/* Explicit money-card placement keeps the two-row desktop overview dense. */
.money-grid {
  grid-template-areas: "equity today week drawdown" "equity month all drawdown";
}

.money-grid .money-card:nth-child(1) {
  grid-area: equity;
}

.money-grid .money-card:nth-child(2) {
  grid-area: today;
}

.money-grid .money-card:nth-child(3) {
  grid-area: drawdown;
}

.money-grid .money-card:nth-child(4) {
  grid-area: week;
}

.money-grid .money-card:nth-child(5) {
  grid-area: month;
}

.money-grid .money-card:nth-child(6) {
  grid-area: all;
}

@media (min-width: 601px) and (max-width: 900px) {
  .money-grid {
    grid-template-areas: "equity equity today" "drawdown week month" "all all all";
  }
}

@media (max-width: 600px) {
  .money-grid {
    grid-template-areas: "equity equity" "today drawdown" "week month" "all all";
  }
}

.review-banner { display:flex; flex-direction:column; gap:4px; margin-bottom:18px; padding:12px 14px; border:1px solid var(--line); border-left:2px solid var(--accent); color:var(--muted); font-size:11px; }
.review-banner b { color:var(--accent); font:10px var(--mono); letter-spacing:.6px; }
/* Empty streams stay compact instead of stretching to match adjacent charts. */
.tape { align-self:start; }
#drawdown-chart > .empty { min-height:80px; }
.alert-time { display:block; margin-top:3px; font:9px var(--mono); opacity:.8; }

/* Persistent paper permission is independent of service readiness. */
.command-bar { flex-wrap: wrap; }
.trading-control { display:flex; align-items:center; justify-content:center; gap:14px; flex-wrap:wrap; padding:12px 16px; border:1px solid #2f8068; border-radius:6px; background:#102a23; color:#79e4b9; }
.trading-control strong { font-size:13px; letter-spacing:.04em; }
.trading-control button { padding:12px 18px; font-weight:800; border:1px solid currentColor; border-radius:4px; background:#d7eee4; color:#14261e; cursor:pointer; }
.trading-control.paused { background:#302817; border-color:#b89542; color:#f1cb74; }
.trading-control.halted { background:#321d23; border-color:#b34b60; color:#ff9baa; }
.trading-control button:disabled { opacity:.65; cursor:not-allowed; }
.trading-control small { flex-basis:100%; max-width:440px; }
#trading-dialog { width:min(520px,calc(100% - 32px)); box-sizing:border-box; background:#111b23; color:#e5ecef; border:1px solid #506270; border-radius:10px; padding:28px; }
#trading-dialog::backdrop { background:rgba(0,0,0,.75); }
#trading-dialog h2 { margin:18px 0; font-size:24px; }
#trading-dialog p { line-height:1.65; }
#trading-dialog label { display:block; margin-top:24px; }
#trading-dialog input { display:block; width:100%; box-sizing:border-box; margin-top:10px; padding:12px; background:#091219; color:#fff; border:1px solid #506270; }
.dialog-actions { display:flex; justify-content:flex-end; gap:12px; margin-top:20px; }
.dialog-actions button { padding:12px 18px; cursor:pointer; }
#control-error { color:#ff9baa; }
@media(max-width:800px) { .trading-control { order:4; width:100%; box-sizing:border-box; } }

/* Live previews never replace the persisted accounting/risk presentation. */
#live-desk { margin: 22px 0 28px; padding: 24px; border: 1px solid #344c49; border-radius: 10px; background: linear-gradient(125deg,#101c21,#0d141c 70%); }
.live-head { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.live-head h2 { margin:8px 0 0; font-size:26px; }.live-head h2 span { color:#85d9ba; }
.live-head > div:last-child { text-align:right; }.live-head small { display:block; margin-top:8px; color:#91a5b6; }
.live-safety { color:#acbabc; font-size:12px; line-height:1.65; margin:16px 0; }
.live-totals { display:grid; grid-template-columns:repeat(3,1fr) 1.1fr; gap:20px; padding:17px 0; border-top:1px solid #29363d; border-bottom:1px solid #29363d; margin-bottom:20px; }
.live-totals dd { font-size:22px; color:#dce9df; }.live-totals small { color:#8e9ba7; font-size:11px; line-height:1.6; }
.live-card { min-width:0; padding:22px; background:#101821; border:1px solid #2a3940; border-radius:7px; }
.live-asset { display:flex; align-items:center; justify-content:space-between; gap:10px; }.live-asset h3 { font-size:16px; letter-spacing:.03em; }
.live-price { font:500 clamp(30px,3vw,43px)/1.35 var(--mono,monospace); letter-spacing:-.04em; margin:12px 0 3px; color:#e4f1ec; font-variant-numeric:tabular-nums; }
.live-age { display:flex; gap:12px; flex-wrap:wrap; justify-content:space-between; font-size:11px; color:#93a9aa; }
.live-book { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:18px 0; }.live-book dt { font-size:10px; }
.live-cross { background:#192831; padding:12px; margin-bottom:16px; border-left:2px solid #56746e; }
.live-cross strong { font-size:12px; }.live-cross small { display:block; font-size:11px; margin-top:7px; color:#a9babb; }
.live-cross.crossed { border-color:#e9b76a; background:#30271c; color:#f3cb92; }
.live-level { display:grid; grid-template-columns:1fr 1fr 1.2fr; gap:8px; padding:10px 0; border-bottom:1px solid #26363d; align-items:center; }
.live-level span { font-size:10px; color:#b3bfab; }.live-level b,.live-level small { text-align:right; font-family:var(--mono,monospace); font-size:12px; }
.live-confirmed { display:flex; flex-direction:column; gap:7px; color:#99aaa8; font-size:10px; padding:10px 0 18px; }
.live-card details { border-top:1px solid #293841; padding:14px 0 0; margin-top:10px; }.live-card summary { display:flex; justify-content:space-between; font-size:10px; gap:8px; cursor:pointer; }
.live-countdown { color:#c8dac3; font-variant-numeric:tabular-nums; }.live-phase { display:block; margin-top:10px; color:#e6bd74; font-size:10px; }
.live-ohlc { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:16px 0; }.live-ohlc dd { font-size:12px; }.live-ohlc dt { font-size:9px; }.live-card details > small { color:#8fa1ab; font-size:10px; }
@media(max-width:800px) { #live-desk { padding:16px; }.live-head { align-items:flex-start; flex-direction:column; }.live-head > div:last-child { text-align:left; }.live-totals { grid-template-columns:repeat(2,minmax(0,1fr)); }.live-card { padding:16px; }.live-level { grid-template-columns:1fr 1fr; }.live-level small { grid-column:1 / -1; }.live-ohlc { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:800px) { .live-totals .kv { display:block; min-width:0; }.live-totals dd { margin:8px 0 0; font-size:18px; white-space:nowrap; }.live-totals dt { font-size:10px; } }

/* Frozen 4-pair research comparison. Each method has its own historical account. */
.trial-section { padding: 24px; }
.trial-pair { margin-top: 24px; }
.trial-pair h3 { margin: 0 0 12px; font-size: 1.12rem; }
.trial-method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.trial-method { min-width: 0; border: 1px solid rgba(132, 220, 220, .3); border-radius: 18px; background: rgba(255, 255, 255, .08); padding: 18px; }
.trial-method h4 { margin: 0 0 8px; font-size: .98rem; }
.trial-return { font-size: 1.75rem; font-weight: 750; }
.trial-method small { display: block; opacity: .78; margin: 4px 0 14px; }
.trial-method dl { margin: 0; }
.trial-method .kv { border-top: 1px solid rgba(255, 255, 255, .12); }
@media (max-width: 880px) { .trial-method-grid { grid-template-columns: 1fr; } }

/* Research readiness stays visibly separate from executable PAPER books. */
.feature-lab { grid-column: 1 / -1; padding: 24px; }
.feature-lab .risk-grid { margin-top: 18px; }

/* Autonomous research remains a distinct, full-width evidence panel. */
.autonomous-section { grid-column: 1 / -1; padding: 24px; }
.autonomous-section .kv { align-items: flex-start; }
.autonomous-section .kv dt { flex-basis: 40%; }
.autonomous-section .kv dd { flex-basis: 60%; }
@media (max-width: 800px) { .autonomous-section .risk-grid { grid-template-columns: 1fr; } }
.feature-observations { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin: 18px 0; }
.feature-observation { min-width: 0; border: 1px solid rgba(132,220,220,.25); border-radius: 18px; padding: 16px; background: rgba(255,255,255,.05); }
.feature-observation > div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.feature-observation h3 { font-size: 1rem; margin: 12px 0 8px; }
.feature-observation p, .feature-observation small { color: var(--muted); font-size: 11px; }
@media (max-width: 800px) { .feature-observations { grid-template-columns: 1fr; } }
