:root {
  color-scheme: dark;
  --bg: #101316;
  --panel: #181d22;
  --panel-2: #1f252a;
  --line: #303941;
  --line-soft: #263039;
  --text: #ecf1f4;
  --muted: #92a0aa;
  --muted-2: #687781;
  --green: #2ed39e;
  --red: #ff6b73;
  --amber: #f2bd54;
  --blue: #4da3ff;
  --cyan: #57d6e8;
  --shadow: rgba(0, 0, 0, 0.25);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-width: 320px;
  padding-bottom: 270px;
  position: relative;
}

.market-field-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  opacity: 0.58;
  mix-blend-mode: screen;
  transform: translateZ(0);
}

body[data-market-pace="idle"] .market-field-canvas {
  opacity: 0.48;
}

body[data-market-pace="below"] .market-field-canvas,
body[data-market-pace="hot"] .market-field-canvas {
  opacity: 0.68;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: #242b31;
  color: var(--text);
  min-height: 38px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

button:hover {
  border-color: #4a5963;
  background: #2a333a;
}

button:active {
  transform: translateY(1px);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1560px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 14px 0 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #091114;
  background: linear-gradient(135deg, var(--cyan), var(--amber));
}

.mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 20px;
}

h2 {
  font-size: 16px;
}

.brand span,
.panel-head span,
.stats-row span,
.paper-summary span,
label span,
.levels dt,
#feedStatus,
#chartMeta,
#signalTime {
  color: var(--muted);
  font-size: 12px;
}

.control-strip {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

label {
  display: grid;
  gap: 5px;
}

.label-with-info {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.info-tip {
  position: relative;
  z-index: 5;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(87, 214, 232, 0.42);
  border-radius: 50%;
  color: #d9fbff;
  background: rgba(87, 214, 232, 0.10);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  cursor: help;
  text-transform: none;
}

.info-tip::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 40;
  left: 50%;
  bottom: calc(100% + 9px);
  width: max-content;
  max-width: min(280px, calc(100vw - 32px));
  padding: 9px 10px;
  border: 1px solid rgba(87, 214, 232, 0.28);
  border-radius: 8px;
  color: var(--text);
  background: #080d10;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  text-transform: none;
  transform: translate(-50%, 5px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: normal;
}

.info-tip::before {
  content: "";
  position: absolute;
  z-index: 39;
  left: 50%;
  bottom: calc(100% + 4px);
  width: 9px;
  height: 9px;
  border-right: 1px solid rgba(87, 214, 232, 0.28);
  border-bottom: 1px solid rgba(87, 214, 232, 0.28);
  background: #080d10;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 5px) rotate(45deg);
  transition: opacity 120ms ease, transform 120ms ease;
}

.info-tip:hover::after,
.info-tip:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.info-tip:hover::before,
.info-tip:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0) rotate(45deg);
}

.label-with-info .info-tip {
  color: #d9fbff;
  font-size: 10px;
}

.info-tip:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

input,
select {
  color: var(--text);
  background: #11161a;
  border: 1px solid var(--line);
  min-height: 38px;
  border-radius: 6px;
  padding: 0 10px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--blue);
}

#symbolInput {
  width: 130px;
  text-transform: uppercase;
}

.primary {
  background: #d7f8ff;
  border-color: #d7f8ff;
  color: #071114;
  font-weight: 700;
  padding-inline: 18px;
}

.icon-button {
  width: 38px;
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}

.lower-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr 0.95fr;
  gap: 14px;
  margin-top: 14px;
}

.side-stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.tool-panel {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  box-shadow: 0 16px 40px var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.chart-panel {
  min-height: 620px;
}

.price-stack {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.chart-head-actions {
  display: grid;
  justify-items: end;
  gap: 9px;
}

.chart-zoom {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.chart-zoom button {
  min-width: 30px;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 6px;
  font-weight: 800;
}

.chart-zoom button:disabled {
  cursor: default;
  opacity: 0.38;
}

.chart-zoom span {
  min-width: 34px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.active-trades-bar {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  justify-content: stretch;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: visible;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(53, 214, 151, 0.08), rgba(96, 225, 223, 0.05), rgba(255, 104, 111, 0.06)),
    rgba(255, 255, 255, 0.018);
  box-shadow: 0 16px 40px var(--shadow);
}

.active-trades-empty {
  min-height: 44px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.active-trade {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(170px, 0.42fr) minmax(0, 1.58fr);
  align-items: center;
  gap: 14px;
  min-height: 74px;
  padding: 12px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(9, 13, 12, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.active-trade.long {
  border-color: rgba(53, 214, 151, 0.32);
}

.active-trade.short {
  border-color: rgba(255, 104, 111, 0.32);
}

.active-trade.selected {
  border-color: rgba(96, 225, 223, 0.74);
  background:
    linear-gradient(135deg, rgba(96, 225, 223, 0.12), rgba(53, 214, 151, 0.06)),
    rgba(9, 13, 12, 0.92);
  box-shadow:
    0 0 0 1px rgba(96, 225, 223, 0.16),
    0 18px 34px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.active-trade:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.active-trade-main {
  display: grid;
  grid-template-columns: auto auto minmax(72px, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.active-trade-main strong {
  overflow: hidden;
  font-size: 18px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-trade-side {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(96, 225, 223, 0.13);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.active-trade.short .active-trade-side {
  background: rgba(255, 104, 111, 0.14);
  color: var(--red);
}

.active-trade-metrics {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(68px, 0.72fr))
    minmax(158px, 1.18fr)
    minmax(210px, 1.35fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: visible;
}

.active-trade-metrics > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.active-trade-metrics small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.active-trade-metrics small.label-with-info {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  overflow: visible;
  white-space: nowrap;
}

.active-trade-metrics strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-trade-pnl.positive strong {
  color: var(--green);
}

.active-trade-pnl.negative strong {
  color: var(--red);
}

.active-trade-pnl strong {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0;
  white-space: nowrap;
}

.active-trade-pnl strong em {
  flex: 0 1 auto;
  max-width: 100%;
  min-width: 0;
  padding: 3px 7px;
  overflow: hidden;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  opacity: 0.82;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1024px) {
  .active-trade {
    grid-template-columns: 1fr;
  }
}

#lastPrice {
  font-size: 22px;
}

#priceChange.positive,
.positive {
  color: var(--green);
}

#priceChange.negative,
.negative {
  color: var(--red);
}

.chart-wrap {
  position: relative;
  height: 470px;
  padding: 8px 12px 0;
}

#priceCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.crosshair-label {
  position: absolute;
  display: none;
  pointer-events: none;
  max-width: min(270px, calc(100% - 16px));
  padding: 5px 7px;
  background: rgba(10, 14, 16, 0.9);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  border-top: 1px solid var(--line-soft);
  background: var(--line-soft);
}

.stats-row div,
.paper-summary div {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: var(--panel);
}

.stats-row strong,
.paper-summary strong {
  font-size: 16px;
}

.signal-panel {
  min-height: 0;
}

.signal-badge {
  min-width: 78px;
  min-height: 38px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-weight: 800;
  border: 1px solid var(--line);
}

.signal-badge.buy {
  background: rgba(46, 211, 158, 0.16);
  color: var(--green);
  border-color: rgba(46, 211, 158, 0.35);
}

.signal-badge.sell {
  background: rgba(255, 107, 115, 0.16);
  color: var(--red);
  border-color: rgba(255, 107, 115, 0.35);
}

.signal-badge.hold {
  background: rgba(242, 189, 84, 0.13);
  color: var(--amber);
  border-color: rgba(242, 189, 84, 0.32);
}

.confidence-shell {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 10px;
  align-items: center;
  padding: 14px 14px 6px;
}

.confidence-bar {
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  background: #0d1114;
  border: 1px solid var(--line-soft);
}

.confidence-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--amber), var(--green));
}

.levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 8px 14px 4px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
}

.levels div {
  background: #151a1f;
  padding: 10px;
}

.levels dd {
  margin: 5px 0 0;
  font-size: 13px;
  font-weight: 700;
}

.level-source {
  margin: 8px 14px 0;
  padding: 9px 10px;
  border: 1px solid rgba(96, 225, 223, 0.22);
  border-radius: 8px;
  background: rgba(96, 225, 223, 0.06);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.tune-source {
  border-color: rgba(246, 197, 96, 0.28);
  background: rgba(246, 197, 96, 0.08);
  color: #f6c560;
}

.signal-list,
.risk-list {
  margin: 0;
  padding: 10px 22px 0 32px;
}

.signal-list li,
.risk-list li {
  margin-bottom: 7px;
  font-size: 13px;
  color: #dce6eb;
}

.risk-list li {
  color: #f4c9c9;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 14px;
}

.ai-box {
  margin: 0 14px 14px;
  padding: 0;
  color: #d9e5ea;
  font-size: 13px;
  line-height: 1.45;
}

.ai-box.visible {
  padding: 12px;
  background: #11161a;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.autopilot-badge {
  min-width: 88px;
  min-height: 34px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--line);
}

.autopilot-badge.active {
  color: var(--green);
  background: rgba(46, 211, 158, 0.14);
  border-color: rgba(46, 211, 158, 0.35);
}

.autopilot-badge.paused {
  color: var(--muted);
  background: #20262c;
}

.autopilot-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 14px;
}

.autopilot-readiness {
  display: grid;
  gap: 8px;
  margin: 0 14px 12px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #14191e;
}

.autopilot-readiness.ok {
  border-color: rgba(46, 211, 158, 0.34);
}

.autopilot-readiness.warning {
  border-color: rgba(242, 189, 84, 0.42);
  background: rgba(242, 189, 84, 0.08);
}

.autopilot-readiness.error {
  border-color: rgba(255, 107, 115, 0.42);
  background: rgba(255, 107, 115, 0.08);
}

.autopilot-readiness.paused {
  color: var(--muted);
}

.autopilot-readiness div {
  display: grid;
  gap: 4px;
}

.autopilot-readiness strong {
  font-size: 14px;
}

.autopilot-readiness span,
.autopilot-readiness li {
  color: var(--muted);
  font-size: 12px;
}

.autopilot-readiness ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.blocker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.blocker-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  border: 1px solid rgba(242, 189, 84, 0.34);
  border-radius: 999px;
  padding: 4px 7px;
  color: #ffe7ae;
  background: rgba(242, 189, 84, 0.08);
  font-size: 11px;
  font-weight: 800;
}

.blocker-chip b {
  color: var(--text);
  font-size: 10px;
}

.ai-gate {
  margin: 0 14px 12px;
  border: 1px solid var(--line-soft);
  background: #11161a;
  border-radius: 8px;
  overflow: hidden;
}

.ai-gate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.ai-gate-head div:first-child {
  display: grid;
  gap: 4px;
}

.ai-gate-head span,
.ai-gate-score span {
  color: var(--muted);
  font-size: 12px;
}

.ai-threshold {
  min-width: 74px;
  min-height: 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--cyan);
  border: 1px solid rgba(87, 214, 232, 0.34);
  background: rgba(87, 214, 232, 0.08);
  font-size: 12px;
  font-weight: 800;
  padding: 0 9px;
  text-align: center;
  white-space: nowrap;
}

.ai-threshold.is-adaptive {
  color: #d8fbff;
  border-color: rgba(52, 199, 89, 0.45);
  background:
    linear-gradient(135deg, rgba(52, 199, 89, 0.18), rgba(87, 214, 232, 0.1)),
    rgba(87, 214, 232, 0.06);
  box-shadow: 0 0 24px rgba(52, 199, 89, 0.14);
}

.ai-threshold.is-strict {
  color: #fff4f5;
  border-color: rgba(255, 107, 115, 0.44);
  background:
    linear-gradient(135deg, rgba(255, 107, 115, 0.16), rgba(242, 189, 84, 0.08)),
    rgba(255, 107, 115, 0.06);
  box-shadow: 0 0 22px rgba(255, 107, 115, 0.12);
}

.ai-gate-meter {
  height: 10px;
  margin: 0 12px;
  border-radius: 99px;
  overflow: hidden;
  background: #0b0f12;
  border: 1px solid var(--line-soft);
}

.ai-gate-meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--amber), var(--green));
}

.ai-gate-score {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px 12px;
}

.ai-gate-score strong {
  font-size: 22px;
}

.learning-card {
  display: grid;
  gap: 10px;
  margin: 0 14px 12px;
  padding: 12px;
  border: 1px solid rgba(87, 214, 232, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(87, 214, 232, 0.12), rgba(46, 211, 158, 0.06) 46%, rgba(255, 255, 255, 0.025)),
    rgba(9, 14, 16, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.market-stack-card {
  display: grid;
  gap: 10px;
  margin: 0 14px 12px;
  padding: 12px;
  border: 1px solid rgba(172, 192, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(172, 192, 255, 0.11), rgba(46, 211, 158, 0.06) 48%, rgba(255, 255, 255, 0.025)),
    rgba(8, 12, 17, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px rgba(0, 0, 0, 0.18);
}

.market-stack-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.market-stack-head > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.market-stack-head span,
.market-stack-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.stream-pill {
  min-width: 58px;
  min-height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(242, 189, 84, 0.34);
  border-radius: 999px;
  color: #f7d48c;
  background: rgba(242, 189, 84, 0.1);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
}

.stream-pill.live {
  color: #07110e;
  border-color: rgba(46, 211, 158, 0.48);
  background: var(--green);
  box-shadow: 0 0 24px rgba(46, 211, 158, 0.18);
}

.market-stack-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.market-stack-grid div {
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  min-width: 0;
}

.market-stack-grid strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.learning-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.learning-head > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.learning-head span,
.learning-stats span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.learning-score-pill {
  min-width: 58px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(46, 211, 158, 0.32);
  border-radius: 999px;
  color: #06110d;
  background: var(--green);
  font-size: 13px;
  font-weight: 950;
  box-shadow: 0 0 24px rgba(46, 211, 158, 0.14);
}

.learning-score-pill.defensive {
  color: #211006;
  border-color: rgba(242, 189, 84, 0.42);
  background: var(--amber);
}

.learning-score-pill.cold {
  color: #21080a;
  border-color: rgba(255, 107, 115, 0.44);
  background: var(--red);
}

.learning-meter {
  height: 9px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.learning-meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--amber), var(--green));
  box-shadow: 0 0 18px rgba(46, 211, 158, 0.2);
  transition: width 280ms ease;
}

.learning-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.learning-stats div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px;
  background: rgba(8, 13, 15, 0.92);
}

.learning-stats strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.autopilot-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.autopilot-stats div {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  background: var(--panel);
}

.autopilot-stats span {
  color: var(--muted);
  font-size: 12px;
}

.autopilot-log {
  display: grid;
  gap: 8px;
  padding: 12px;
  max-height: 132px;
  overflow: auto;
}

.autopilot-event {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px;
  background: #14191e;
  font-size: 13px;
}

.autopilot-event.trade {
  border-color: rgba(46, 211, 158, 0.45);
  background: rgba(46, 211, 158, 0.08);
}

.autopilot-event.error {
  border-color: rgba(255, 107, 115, 0.45);
  background: rgba(255, 107, 115, 0.08);
}

.autopilot-event.ai-block {
  border-color: rgba(242, 189, 84, 0.45);
  background: rgba(242, 189, 84, 0.08);
}

.autopilot-event .event-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
}

.autopilot-event .event-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.event-ai {
  margin-top: 7px;
  color: #d7f8ff;
  font-size: 12px;
}

.watchlist {
  display: grid;
  gap: 8px;
  padding: 12px;
  max-height: 170px;
  overflow: auto;
}

.watch-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: #14191e;
  cursor: pointer;
}

.watch-item.active {
  border-color: var(--cyan);
}

.watch-symbol {
  font-weight: 800;
}

.watch-meta {
  color: var(--muted);
  font-size: 12px;
}

.small-button {
  min-height: 32px;
  padding: 0 12px;
}

.paper-summary {
  display: grid;
  grid-template-columns: 1.35fr repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
}

.paper-summary small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.positions {
  display: grid;
  gap: 8px;
  padding: 12px;
  min-height: 118px;
}

.performance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
}

.performance-grid div {
  display: grid;
  gap: 5px;
  min-height: 72px;
  padding: 12px;
  background: var(--panel);
}

.performance-grid span {
  color: var(--muted);
  font-size: 12px;
}

.performance-grid strong {
  font-size: 18px;
}

.paper-editor,
.position-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line-soft);
}

.paper-editor {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.position-editor {
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 14px;
  background: rgba(31, 37, 42, 0.45);
}

.position-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.position-editor-head strong {
  font-size: 14px;
}

.position-editor-head span {
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
  background: #11161a;
  font-size: 12px;
  white-space: nowrap;
}

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

.position-ticket-grid .span-2 {
  grid-column: 1 / -1;
}

.position-editor input,
.position-editor select {
  width: 100%;
  min-height: 44px;
}

.position-editor input[readonly] {
  color: var(--text);
  border-color: var(--line-soft);
  background: #12171b;
}

.ticket-leverage-control {
  display: grid;
  gap: 8px;
  min-height: 94px;
  padding: 12px;
  border: 1px solid rgba(246, 197, 96, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(246, 197, 96, 0.09), rgba(46, 211, 158, 0.06)),
    #12171b;
}

.ticket-leverage-control > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.ticket-leverage-control strong {
  min-width: 48px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #07110f;
  text-align: center;
  background: #f6c560;
}

.ticket-leverage-control input[type="range"] {
  width: 100%;
  height: 36px;
  min-height: 36px;
}

.ticket-leverage-control input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f6c560 0 var(--slider-fill), #070a09 var(--slider-fill) 100%);
}

.ticket-leverage-control input[type="range"]::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  margin-top: -7px;
}

.position-ticket-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
  gap: 10px;
}

.position-ticket-actions button {
  min-height: 42px;
  padding: 0 14px;
}

.position-toggle {
  min-height: 44px;
  align-self: end;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #12171b;
}

.position-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #14191e;
  font-size: 13px;
}

.position-row {
  grid-template-columns: minmax(0, 1.3fr) auto auto auto;
}

.position-row button {
  min-height: 30px;
  padding: 0 10px;
}

.position-actions {
  display: flex;
  gap: 6px;
}

.journal-panel {
  margin-top: 14px;
}

.journal-panel .panel-head {
  align-items: flex-start;
  flex-wrap: wrap;
}

.journal-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  background: #121612;
  white-space: nowrap;
  transition: none;
}

.filter-chip strong {
  min-width: 24px;
  min-height: 24px;
  display: grid;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
}

.filter-chip.active {
  color: #07110f;
  border-color: var(--cyan);
  background: var(--cyan);
  font-weight: 800;
}

.filter-chip.active strong {
  color: #07110f;
  background: rgba(7, 17, 15, 0.12);
}

.auto-save-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(96, 225, 223, 0.24);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(96, 225, 223, 0.08);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.auto-save-status.pending,
.auto-save-status.saving {
  color: var(--amber);
  border-color: rgba(245, 193, 93, 0.34);
  background: rgba(245, 193, 93, 0.1);
}

.auto-save-status.saved {
  color: #07110f;
  border-color: var(--green);
  background: var(--green);
}

.auto-save-status.error {
  color: var(--red);
  border-color: rgba(255, 104, 111, 0.4);
  background: rgba(255, 104, 111, 0.1);
}

.journal {
  display: grid;
  gap: 8px;
  padding: 12px;
  max-height: 360px;
  overflow: auto;
}

.journal-header,
.journal-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.45fr) minmax(88px, 0.58fr) minmax(92px, 0.62fr) minmax(104px, 0.7fr) minmax(104px, 0.7fr);
  gap: 12px;
  align-items: center;
}

.journal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 4px 10px 8px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  background: var(--panel);
}

.journal-row {
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #14191e;
  font-size: 13px;
}

.journal-main {
  min-width: 0;
}

.journal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.journal-title strong,
.journal-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journal-chip,
.journal-ai {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.journal-chip.buy {
  color: #081310;
  background: var(--green);
}

.journal-chip.sell {
  color: #18090b;
  background: var(--red);
}

.journal-chip.watch {
  color: var(--cyan);
  border: 1px solid rgba(96, 225, 223, 0.34);
  background: rgba(96, 225, 223, 0.1);
}

.journal-chip.signal {
  color: var(--amber);
  border: 1px solid rgba(245, 193, 93, 0.34);
  background: rgba(245, 193, 93, 0.1);
}

.journal-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.journal-ai {
  margin-left: 6px;
  color: var(--cyan);
  background: rgba(87, 214, 232, 0.1);
  border: 1px solid rgba(87, 214, 232, 0.22);
}

.journal-stat {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.journal-stat span {
  display: none;
  color: var(--muted-2);
  font-size: 11px;
  text-transform: uppercase;
}

.journal-stat strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.journal-result {
  justify-items: end;
  text-align: right;
}

.journal-result.profit {
  color: var(--green);
}

.journal-result.loss {
  color: var(--red);
}

.journal-result.even {
  color: var(--amber);
}

.journal-result.open {
  color: var(--muted);
}

.journal-result span {
  display: block;
}

.audit-panel {
  margin-top: 14px;
}

.audit-head {
  align-items: flex-start;
  flex-wrap: wrap;
}

.audit-toolbar {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(96px, 0.45fr) minmax(170px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.audit-toolbar input,
.audit-toolbar select {
  min-height: 38px;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
}

.audit-integrity {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: var(--line-soft);
}

.audit-integrity div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  background: rgba(12, 17, 19, 0.92);
}

.audit-integrity span,
.audit-meta,
.audit-hash span {
  color: var(--muted);
  font-size: 12px;
}

.audit-integrity strong,
.audit-hash strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-log {
  display: grid;
  gap: 8px;
  max-height: 440px;
  overflow: auto;
  padding: 12px;
}

.audit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 0.22fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  padding: 10px;
  background: rgba(14, 19, 21, 0.92);
}

.audit-row.warning {
  border-color: rgba(245, 193, 93, 0.28);
  background: rgba(245, 193, 93, 0.06);
}

.audit-row.error {
  border-color: rgba(255, 104, 111, 0.32);
  background: rgba(255, 104, 111, 0.06);
}

.audit-main {
  min-width: 0;
}

.audit-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.audit-title strong,
.audit-title b,
.audit-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-title b {
  color: var(--cyan);
  font-size: 12px;
}

.audit-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(87, 214, 232, 0.25);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(87, 214, 232, 0.09);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.audit-chip.paper,
.audit-chip.learning {
  color: #06110d;
  border-color: transparent;
  background: var(--green);
}

.audit-chip.risk,
.audit-chip.gate,
.audit-chip.ai {
  color: #241606;
  border-color: transparent;
  background: var(--amber);
}

.audit-hash {
  display: grid;
  justify-items: end;
  gap: 3px;
  min-width: 0;
}

.audit-hash.verified strong {
  color: var(--green);
}

.audit-hash.failed strong {
  color: var(--red);
}

.audit-details {
  grid-column: 1 / -1;
  min-width: 0;
}

.audit-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.audit-details pre {
  max-height: 280px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  color: #dbe8ea;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .audit-toolbar,
  .audit-integrity,
  .audit-row {
    grid-template-columns: 1fr;
  }

  .audit-hash {
    justify-items: start;
  }

  .audit-title {
    flex-wrap: wrap;
  }
}

.mini-trade-log,
.mini-watchlist {
  position: fixed;
  top: var(--floating-panel-top);
  left: var(--app-shell-gutter);
  z-index: 30;
  width: min(330px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 52%),
    rgba(12, 15, 14, 0.88);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.mini-watchlist {
  left: auto;
  right: var(--app-shell-gutter);
  width: min(360px, calc(100vw - 28px));
  border-color: rgba(87, 214, 232, 0.16);
  background:
    linear-gradient(135deg, rgba(87, 214, 232, 0.12), rgba(46, 211, 158, 0.06) 45%, rgba(242, 189, 84, 0.05)),
    rgba(12, 15, 17, 0.9);
}

.mini-trade-log.is-floating,
.mini-watchlist.is-floating,
.trade-director-tray.is-floating {
  right: auto;
  bottom: auto;
  transform: none;
}

.mini-trade-log.is-dragging,
.mini-watchlist.is-dragging,
.trade-director-tray.is-dragging {
  z-index: 80;
  opacity: 0.94;
  user-select: none;
}

.mini-trade-log-head,
.mini-watchlist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  cursor: move;
}

.mini-trade-log-head > div,
.mini-watchlist-head > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mini-trade-log-head strong,
.mini-watchlist-head strong {
  font-size: 13px;
  line-height: 1;
}

.mini-trade-log-head span,
.mini-watchlist-head span {
  min-width: 24px;
  min-height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #07110f;
  background: var(--cyan);
  font-size: 11px;
  font-weight: 900;
}

.mini-watchlist-head span {
  color: #06100d;
  background: var(--green);
}

.mini-trade-log-head button,
.mini-watchlist-head button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
  cursor: pointer;
}

.mini-watchlist-head {
  flex-wrap: wrap;
}

.mini-watchlist-manager {
  flex: 1 1 100%;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 6px !important;
  cursor: default;
}

.mini-watchlist-manager select {
  min-width: 0;
  min-height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--ink);
  background: rgba(9, 13, 19, 0.92);
  font-size: 11px;
  font-weight: 800;
}

.mini-watchlist-manager small {
  min-height: 28px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: rgba(235, 250, 244, 0.78);
  background: rgba(255, 255, 255, 0.06);
  white-space: nowrap;
  font-size: 10px;
  font-weight: 900;
}

.mini-watchlist-manager button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.floating-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex: 0 0 auto;
}

.mini-trade-log-body,
.mini-watchlist-body {
  display: grid;
  gap: 7px;
  max-height: 326px;
  overflow: auto;
  padding: 8px;
}

.mini-watchlist-body {
  max-height: 372px;
}

.mini-trade-log-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 5px 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--amber);
  border-radius: 8px;
  background: rgba(20, 25, 30, 0.86);
}

.mini-trade-log-row.buy,
.mini-trade-log-row.profit {
  border-left-color: var(--green);
}

.mini-trade-log-row.sell,
.mini-trade-log-row.loss,
.mini-trade-log-row.blocked {
  border-left-color: var(--red);
}

.mini-trade-log-row.watch,
.mini-trade-log-row.signal {
  border-left-color: var(--cyan);
}

.mini-trade-log-row span,
.mini-trade-log-row small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.mini-trade-log-row span {
  text-transform: uppercase;
}

.mini-trade-log-row strong,
.mini-trade-log-row b,
.mini-trade-log-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-trade-log-row strong {
  font-size: 12px;
}

.mini-trade-log-row b {
  font-size: 12px;
  text-align: right;
}

.mini-trade-log-row small {
  grid-column: 1 / -1;
}

.mini-trade-log-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.mini-watch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-left: 3px solid var(--cyan);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 62%),
    rgba(20, 25, 30, 0.86);
}

.mini-watch-row.selected {
  border-color: rgba(87, 214, 232, 0.4);
  box-shadow: inset 0 0 0 1px rgba(87, 214, 232, 0.08);
}

.mini-watch-row.trading,
.mini-watch-row.buy {
  border-left-color: var(--green);
}

.mini-watch-row.sell {
  border-left-color: var(--red);
}

.mini-watch-main {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.mini-watch-main:hover {
  color: var(--cyan);
}

.mini-watch-main span,
.mini-watch-main strong,
.mini-watch-main small,
.mini-watch-side b,
.mini-watch-row em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-watch-main span {
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
}

.mini-watch-main strong {
  color: #d9fbff;
  font-size: 12px;
}

.mini-watch-main small,
.mini-watch-row em {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.mini-watch-side {
  display: grid;
  gap: 5px;
  justify-items: end;
  align-content: start;
}

.mini-watch-side b {
  max-width: 104px;
  font-size: 12px;
}

.mini-watch-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

.mini-watch-actions button {
  min-height: 26px;
  padding: 0 8px;
  color: #07110f;
  border-color: transparent;
  background: var(--cyan);
  font-size: 10px;
  font-weight: 900;
}

.mini-watch-row.trading .mini-watch-side button {
  background: var(--green);
}

.mini-watch-actions button[data-action="remove"] {
  width: 26px;
  padding: 0;
  color: #24090a;
  background: rgba(255, 98, 95, 0.92);
}

.mini-watch-row em {
  grid-column: 1 / -1;
  font-style: normal;
}

.mini-trade-log.collapsed,
.mini-watchlist.collapsed {
  width: 286px;
}

.mini-watchlist.collapsed {
  width: 302px;
}

.mini-trade-log.collapsed .mini-trade-log-head,
.mini-watchlist.collapsed .mini-watchlist-head {
  border-bottom: 0;
}

.mini-trade-log.collapsed .mini-trade-log-body,
.mini-watchlist.collapsed .mini-watchlist-body {
  display: none;
}

.trade-director-tray {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 36;
  width: min(1180px, calc(100vw - 24px));
  max-height: min(48vh, 380px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(87, 214, 232, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(87, 214, 232, 0.14), rgba(46, 211, 158, 0.08) 42%, rgba(242, 189, 84, 0.08)),
    rgba(10, 15, 17, 0.96);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.trade-director-tray.is-floating {
  z-index: 62;
}

.director-handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: move;
}

.director-controls,
.director-controls button,
.director-auto {
  cursor: default;
}

.director-controls button {
  cursor: pointer;
}

.director-handle > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.director-handle span,
.director-eyebrow,
.director-order-grid span,
.director-queue-row small {
  color: var(--muted);
  font-size: 12px;
}

.director-handle strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
}

.director-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.director-auto {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.director-auto input {
  accent-color: var(--green);
}

.director-body {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.8fr);
  gap: 10px;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
}

.director-primary,
.director-queue {
  min-height: 0;
  overflow: auto;
}

.director-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--cyan);
  border-radius: 8px;
  background: rgba(5, 9, 10, 0.72);
}

.director-card.made {
  border-left-color: var(--green);
}

.director-card.declined {
  border-left-color: var(--red);
}

.director-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.director-card-top > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.director-card-top strong {
  font-size: 24px;
  line-height: 1.05;
}

.director-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #06100d;
  background: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.director-status.made {
  background: var(--green);
}

.director-status.declined {
  color: #1b080a;
  background: var(--red);
}

.director-order-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.director-order-grid div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px;
  background: rgba(11, 16, 18, 0.96);
}

.director-order-grid strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.director-card p {
  margin: 0;
  color: #dce7ea;
  font-size: 13px;
  line-height: 1.45;
}

.director-card ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.director-card li,
.director-risk span,
.director-tags span {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.035);
  color: #cbd8dc;
  font-size: 12px;
  line-height: 1.35;
}

.director-tags,
.director-risk {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.director-tags span {
  color: #d9fbff;
  border-color: rgba(87, 214, 232, 0.22);
  background: rgba(87, 214, 232, 0.08);
  font-weight: 800;
}

.director-risk span {
  color: #ffe0c2;
  border-color: rgba(242, 189, 84, 0.20);
  background: rgba(242, 189, 84, 0.08);
}

.director-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.director-queue {
  display: grid;
  align-content: start;
  gap: 7px;
}

.director-queue-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 5px 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 3px solid var(--cyan);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.director-queue-row.made {
  border-left-color: var(--green);
}

.director-queue-row.declined {
  border-left-color: var(--red);
}

.director-queue-row span {
  border-radius: 999px;
  padding: 4px 7px;
  color: #06100d;
  background: var(--cyan);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.director-queue-row.made span {
  background: var(--green);
}

.director-queue-row.declined span {
  color: #1b080a;
  background: var(--red);
}

.director-queue-row strong,
.director-queue-row b,
.director-queue-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.director-queue-row small {
  grid-column: 2 / -1;
}

.trade-director-tray.collapsed {
  max-height: 58px;
}

.trade-director-tray.collapsed .director-handle {
  border-bottom: 0;
}

.trade-director-tray.collapsed .director-body {
  display: none;
}

.profiles-panel {
  margin-top: 14px;
}

.profile-head {
  align-items: end;
}

.profile-save-form {
  display: grid;
  grid-template-columns: minmax(180px, 280px) auto;
  gap: 8px;
  align-items: end;
}

.profile-save-form input {
  min-height: 42px;
}

.profiles-table-wrap {
  overflow-x: auto;
  padding: 0 12px 12px;
}

.profiles-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.profiles-table th {
  padding: 0 10px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.profiles-table td {
  padding: 12px 10px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: #14191e;
  font-size: 13px;
  vertical-align: middle;
}

.profiles-table td:first-child {
  border-left: 1px solid var(--line-soft);
  border-radius: 8px 0 0 8px;
}

.profiles-table td:last-child {
  border-right: 1px solid var(--line-soft);
  border-radius: 0 8px 8px 0;
}

.profiles-table strong,
.profile-summary {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-top: 6px;
  padding: 2px 7px;
  border: 1px solid rgba(70, 210, 180, 0.38);
  border-radius: 6px;
  color: #7bf0d4;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.profile-badge.manual {
  border-color: rgba(154, 171, 191, 0.34);
  color: var(--muted-2);
}

.profile-summary {
  max-width: 520px;
  color: var(--muted);
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.empty {
  color: var(--muted);
  padding: 12px;
}

.settings-grid,
.key-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.key-grid {
  border-top: 1px solid var(--line-soft);
}

.settings-grid input,
.key-grid input {
  width: 100%;
}

.slider-control {
  gap: 10px;
}

.slider-control > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.slider-control strong {
  min-width: 54px;
  padding: 3px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--cyan);
  background: #11161a;
  font-size: 12px;
  text-align: center;
}

.settings-grid input[type="range"] {
  --slider-fill: 0%;
  appearance: none;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
}

.settings-grid input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan) 0 var(--slider-fill), #0b0f12 var(--slider-fill) 100%);
}

.settings-grid input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border: 2px solid #071114;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 2px rgba(242, 189, 84, 0.24);
}

.settings-grid input[type="range"]::-moz-range-track {
  height: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #0b0f12;
}

.settings-grid input[type="range"]::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--cyan);
}

.settings-grid input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #071114;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 2px rgba(242, 189, 84, 0.24);
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.toggle-line input {
  width: 18px;
  height: 18px;
  min-height: unset;
}

@media (max-width: 1120px) {
  .workspace,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .chart-panel {
    min-height: 560px;
  }

  .chart-wrap {
    height: 420px;
  }

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

  .control-strip {
    justify-content: start;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 16px, 1560px);
    padding-top: 8px;
  }

  .control-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #symbolInput {
    width: 100%;
  }

  .stats-row,
  .paper-summary,
  .performance-grid,
  .autopilot-stats,
  .levels,
  .paper-editor,
  .position-editor,
  .settings-grid,
  .key-grid {
    grid-template-columns: 1fr;
  }

  .button-row,
  .autopilot-actions {
    grid-template-columns: 1fr;
  }

  .position-editor-head {
    align-items: stretch;
    flex-direction: column;
  }

  .position-editor-head span {
    width: 100%;
  }

  .position-ticket-grid,
  .position-ticket-actions {
    grid-template-columns: 1fr;
  }

  .journal-header {
    display: none;
  }

  .journal-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .journal-main,
  .journal-result {
    grid-column: 1 / -1;
  }

  .journal-stat span {
    display: block;
  }

  .journal-result {
    justify-items: start;
    text-align: left;
    padding-top: 8px;
    border-top: 1px solid var(--line-soft);
  }

  .mini-trade-log {
    top: 72px;
    left: 8px;
    width: min(310px, calc(100vw - 16px));
  }

  .mini-trade-log-body {
    max-height: 238px;
  }

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

  .profile-save-form {
    grid-template-columns: 1fr;
  }

  .chart-wrap {
    height: 360px;
  }
}

/* JBOT cockpit refresh */
:root {
  --bg: #0c0f0e;
  --panel: #171a18;
  --panel-2: #20231f;
  --line: #343a36;
  --line-soft: #252b28;
  --text: #f3f4ef;
  --muted: #a8b2aa;
  --muted-2: #737f77;
  --green: #35d697;
  --red: #ff686f;
  --amber: #f5c15d;
  --blue: #6aa8ff;
  --cyan: #60e1df;
  --shadow: rgba(0, 0, 0, 0.34);
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 240px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 120px),
    var(--bg);
}

button,
input,
select {
  min-height: 42px;
}

button {
  background: #242923;
  border-color: #38413a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

button:hover {
  background: #2b322c;
  border-color: #536056;
}

.primary {
  background: linear-gradient(180deg, #eefdfa, #bfeee7);
  border-color: #d8fffa;
  color: #07110f;
}

.app-shell {
  width: min(1640px, calc(100vw - 32px));
  padding: 18px 0 28px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 8px;
  background: rgba(12, 15, 14, 0.88);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.brand {
  min-width: 180px;
}

.brand h1 {
  font-size: 22px;
  line-height: 1;
}

.mark {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, #60e1df 0%, #f5c15d 55%, #35d697 100%);
  box-shadow: 0 12px 28px rgba(96, 225, 223, 0.12);
}

.market-strip {
  gap: 8px;
}

.market-strip label {
  min-width: 106px;
}

.market-strip .symbol-label {
  min-width: 170px;
}

#symbolInput {
  width: 100%;
  min-width: 0;
  font-weight: 800;
  letter-spacing: 0;
}

input,
select {
  background: #101412;
  border-color: #313a34;
}

input:focus,
select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(96, 225, 223, 0.12);
}

.cockpit {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) repeat(3, minmax(150px, 0.7fr)) minmax(230px, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.cockpit-card,
.tool-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 42%),
    var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  box-shadow: 0 18px 46px var(--shadow);
}

.cockpit-card {
  min-height: 154px;
  padding: 16px;
}

.cockpit-card span,
.cockpit-card small {
  color: var(--muted);
  font-size: 12px;
}

.equity-card,
.command-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.equity-card {
  align-items: stretch;
}

.equity-card > div:first-child,
.command-card > div:first-child {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
}

.equity-card strong {
  font-size: 34px;
  line-height: 1;
}

.equity-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-pill {
  align-self: start;
  min-width: 84px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--line);
}

.state-pill.active {
  color: #06130f;
  background: var(--green);
  border-color: var(--green);
}

.state-pill.paused {
  color: var(--muted);
  background: #242923;
}

.dial-card {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
}

.dial-ring {
  --dial-value: 0%;
  --dial-color: var(--amber);
  position: relative;
  width: 108px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border-radius: 50%;
  background:
    conic-gradient(var(--dial-color) 0 var(--dial-value), rgba(255, 255, 255, 0.08) var(--dial-value) 100%);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.dial-ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: linear-gradient(180deg, #20251f, #111512);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.dial-ring strong,
.dial-ring span {
  position: relative;
  z-index: 1;
}

.dial-ring strong {
  font-size: 22px;
  line-height: 1;
}

.dial-ring span {
  display: block;
  margin-top: 4px;
  position: relative;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
}

.dial-ring[data-tone="buy"],
.dial-ring[data-tone="profit"],
.dial-ring[data-tone="approve"] {
  --dial-color: var(--green);
}

.dial-ring[data-tone="sell"],
.dial-ring[data-tone="loss"],
.dial-ring[data-tone="block"] {
  --dial-color: var(--red);
}

.dial-ring[data-tone="hold"],
.dial-ring[data-tone="even"] {
  --dial-color: var(--amber);
}

.dial-ring.ai {
  --dial-color: var(--cyan);
}

.pnl-card {
  --pnl-accent: var(--amber);
  align-content: stretch;
  justify-items: stretch;
  gap: 12px;
  text-align: left;
  border-color: rgba(255, 204, 77, 0.30);
  background:
    linear-gradient(135deg, rgba(255, 204, 77, 0.18), rgba(255, 255, 255, 0.055) 42%, rgba(96, 225, 223, 0.10)),
    rgba(18, 25, 32, 0.72);
  box-shadow:
    0 0 0 1px rgba(255, 204, 77, 0.13),
    0 26px 74px rgba(0, 0, 0, 0.36),
    0 0 48px rgba(255, 204, 77, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.20);
}

.pnl-card[data-tone="profit"] {
  --pnl-accent: var(--green);
  border-color: rgba(49, 209, 143, 0.42);
  background:
    linear-gradient(135deg, rgba(49, 209, 143, 0.23), rgba(255, 255, 255, 0.06) 45%, rgba(96, 225, 223, 0.12)),
    rgba(13, 28, 24, 0.78);
  box-shadow:
    0 0 0 1px rgba(49, 209, 143, 0.18),
    0 28px 84px rgba(0, 0, 0, 0.38),
    0 0 52px rgba(49, 209, 143, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.pnl-card[data-tone="loss"] {
  --pnl-accent: var(--red);
  border-color: rgba(255, 98, 95, 0.44);
  background:
    linear-gradient(135deg, rgba(255, 98, 95, 0.24), rgba(255, 255, 255, 0.055) 45%, rgba(255, 204, 77, 0.08)),
    rgba(31, 16, 19, 0.80);
  box-shadow:
    0 0 0 1px rgba(255, 98, 95, 0.18),
    0 28px 84px rgba(0, 0, 0, 0.38),
    0 0 52px rgba(255, 98, 95, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.pnl-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--pnl-accent), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 38%);
  opacity: 0.22;
}

.pnl-card-hero,
.pnl-card-stats {
  position: relative;
  z-index: 1;
}

.pnl-card-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.pnl-card .dial-ring {
  width: 120px;
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.30),
    0 0 30px color-mix(in srgb, var(--pnl-accent) 22%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.20);
}

.pnl-card .dial-ring::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.035)),
    rgba(10, 14, 18, 0.92);
}

.pnl-card-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.pnl-card-copy span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pnl-card-copy strong {
  overflow: hidden;
  color: #ffffff;
  font-size: clamp(28px, 3.2vw, 48px);
  font-weight: 860;
  line-height: 0.94;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pnl-card-copy small {
  color: rgba(255, 255, 255, 0.70);
  font-size: 13px;
  font-weight: 700;
}

.pnl-card-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.10);
}

.pnl-card-stats div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.030)),
    rgba(8, 13, 18, 0.42);
}

.pnl-card-stats span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.pnl-card-stats strong {
  overflow: hidden;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warning-text {
  color: var(--amber);
}

.brain-strip {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) auto minmax(320px, 1.4fr) minmax(260px, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(87, 214, 232, 0.10), rgba(46, 211, 158, 0.055) 45%, rgba(242, 189, 84, 0.075)),
    #12171a;
  box-shadow: 0 18px 46px var(--shadow);
}

.brain-lead {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.brain-lead span,
.brain-lead small,
.brain-metrics span,
.brain-score span {
  color: var(--muted);
  font-size: 12px;
}

.brain-lead strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 24px;
  line-height: 1.1;
}

.brain-lead small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brain-score {
  --brain-score: 0%;
  --brain-color: var(--amber);
  width: 90px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  border-radius: 50%;
  background: conic-gradient(var(--brain-color) 0 var(--brain-score), rgba(255, 255, 255, 0.08) var(--brain-score) 100%);
  position: relative;
}

.brain-score::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: #11171a;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.brain-score strong,
.brain-score span {
  position: relative;
  z-index: 1;
}

.brain-score strong {
  font-size: 24px;
  line-height: 1;
}

.brain-score[data-tone="prime"],
.brain-score[data-tone="tradable"] {
  --brain-color: var(--green);
}

.brain-score[data-tone="caution"] {
  --brain-color: var(--amber);
}

.brain-score[data-tone="blocked"] {
  --brain-color: var(--red);
}

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

.brain-metrics div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.brain-metrics strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  text-transform: capitalize;
}

.brain-checks {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.brain-checks span {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid rgba(87, 214, 232, 0.24);
  border-radius: 999px;
  padding: 5px 8px;
  color: #d9fbff;
  background: rgba(87, 214, 232, 0.08);
  font-size: 11px;
  font-weight: 800;
}

.algo-machine {
  --machine-power: 0%;
  --stage-x: 7%;
  --stage-fill: 0%;
  --machine-color: var(--cyan);
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background:
    radial-gradient(circle at var(--stage-x) 38%, rgba(96, 225, 223, 0.18), transparent 170px),
    linear-gradient(135deg, rgba(96, 225, 223, 0.08), rgba(245, 193, 93, 0.05) 45%, rgba(53, 214, 151, 0.06)),
    #0e1314;
  box-shadow: 0 18px 46px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
  position: relative;
}

.algo-machine[data-tone="buy"],
.algo-machine[data-tone="trade"],
.algo-machine[data-tone="active"] {
  --machine-color: var(--green);
}

.algo-machine[data-tone="sell"] {
  --machine-color: var(--red);
}

.algo-machine[data-tone="blocked"] {
  --machine-color: var(--amber);
}

.algo-machine::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.055), transparent),
    repeating-linear-gradient(90deg, transparent 0 72px, rgba(255, 255, 255, 0.025) 72px 73px);
  opacity: 0.34;
  pointer-events: none;
  transform: translateX(-30%);
  animation: machineSweep 5s linear infinite;
}

.machine-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.machine-head > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.machine-head span,
.machine-head small,
.algo-node span,
.algo-node small {
  color: var(--muted);
  font-size: 12px;
}

.machine-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 19px;
}

.machine-pulse {
  min-width: 64px;
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--machine-color) 48%, transparent);
  border-radius: 999px;
  color: #07110f;
  background: var(--machine-color);
  font-weight: 900;
  box-shadow: 0 0 24px color-mix(in srgb, var(--machine-color) 26%, transparent);
}

.machine-board {
  display: grid;
  grid-template-columns: repeat(9, minmax(104px, 1fr));
  gap: 10px;
  position: relative;
  z-index: 1;
}

.machine-rail {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 50%;
  height: 4px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--machine-color) 0 var(--stage-fill), rgba(255, 255, 255, 0.10) var(--stage-fill) 100%);
  box-shadow: 0 0 18px color-mix(in srgb, var(--machine-color) 28%, transparent);
  transform: translateY(-50%);
}

.machine-ball {
  position: absolute;
  left: var(--stage-x);
  top: 50%;
  z-index: 3;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #ffffff, var(--machine-color) 42%, #07110f 100%);
  box-shadow:
    0 0 16px var(--machine-color),
    0 0 34px color-mix(in srgb, var(--machine-color) 42%, transparent);
  transform: translate(-50%, -50%);
  transition: left 420ms cubic-bezier(.2, .8, .2, 1), background 160ms ease;
  animation: machineBall 1.4s ease-in-out infinite;
}

.algo-node {
  min-height: 104px;
  display: grid;
  align-content: space-between;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 55%),
    rgba(6, 10, 11, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  opacity: 0.66;
  position: relative;
  overflow: hidden;
}

.algo-node::after {
  content: "";
  position: absolute;
  inset: auto 12px 10px 12px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.algo-node.is-active {
  border-color: color-mix(in srgb, var(--machine-color) 35%, rgba(255, 255, 255, 0.08));
  opacity: 1;
}

.algo-node.is-active::after {
  background: var(--machine-color);
  box-shadow: 0 0 18px color-mix(in srgb, var(--machine-color) 40%, transparent);
}

.algo-node.is-current {
  transform: translateY(-2px);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.24),
    0 0 0 1px color-mix(in srgb, var(--machine-color) 34%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.algo-node strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  line-height: 1.15;
}

.algo-node small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dial-ring.is-live {
  animation: dialBreathe 3.4s ease-in-out infinite;
}

.slider-control.is-adjusting,
.stop-target-card.is-adjusting,
.switch-control.is-adjusting {
  border-color: rgba(96, 225, 223, 0.55);
  box-shadow:
    0 0 0 1px rgba(96, 225, 223, 0.16),
    0 0 26px rgba(96, 225, 223, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.settings-grid input[type="range"],
.stop-target-card input[type="range"] {
  filter: drop-shadow(0 0 7px rgba(96, 225, 223, 0.10));
}

.settings-grid input[type="range"]::-webkit-slider-thumb,
.stop-target-card input[type="range"]::-webkit-slider-thumb {
  box-shadow:
    0 0 0 3px rgba(96, 225, 223, 0.12),
    0 0 18px rgba(96, 225, 223, 0.26);
}

.algo-machine.is-reacting .machine-ball,
.slider-control.is-adjusting input[type="range"]::-webkit-slider-thumb,
.stop-target-card.is-adjusting input[type="range"]::-webkit-slider-thumb {
  animation: controlPop 720ms ease;
}

.autopilot-badge.active,
.state-pill.active {
  animation: statusPulse 2.6s ease-in-out infinite;
}

@keyframes machineSweep {
  to {
    transform: translateX(30%);
  }
}

@keyframes machineBall {
  0%, 100% {
    scale: 1;
  }
  50% {
    scale: 1.14;
  }
}

@keyframes dialBreathe {
  0%, 100% {
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28), 0 0 0 rgba(96, 225, 223, 0);
  }
  50% {
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.3), 0 0 22px color-mix(in srgb, var(--dial-color) 22%, transparent);
  }
}

@keyframes controlPop {
  0%, 100% {
    scale: 1;
  }
  42% {
    scale: 1.18;
  }
}

@keyframes statusPulse {
  0%, 100% {
    filter: saturate(1);
  }
  50% {
    filter: saturate(1.35) brightness(1.08);
  }
}

/* Iteration 1: premium live algorithm machine */
.algo-machine {
  --machine-intensity: 0.2;
  padding: 16px;
  border-color: color-mix(in srgb, var(--machine-color) 28%, rgba(255, 255, 255, 0.08));
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 100%),
    linear-gradient(135deg, rgba(87, 214, 232, 0.08), rgba(246, 197, 96, 0.045) 52%, rgba(46, 211, 158, 0.065)),
    #080d0f;
  background-size: 34px 34px, 34px 34px, auto, auto;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.025),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.algo-machine::before {
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--machine-color) 16%, transparent), transparent),
    repeating-linear-gradient(90deg, transparent 0 88px, rgba(255, 255, 255, 0.03) 88px 89px);
  opacity: calc(0.18 + (var(--machine-intensity) * 0.34));
}

.machine-kicker {
  color: #d9fbff;
  font-weight: 900;
  text-transform: uppercase;
}

#algoMachineStage {
  color: color-mix(in srgb, var(--machine-color) 72%, var(--muted));
  font-weight: 800;
  text-transform: capitalize;
}

.machine-stage-meter {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 4px;
  width: min(520px, 100%);
  margin-top: 3px;
}

.machine-stage-meter span {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.machine-stage-meter span.passed {
  background: color-mix(in srgb, var(--machine-color) 48%, rgba(255, 255, 255, 0.12));
}

.machine-stage-meter span.current {
  background: var(--machine-color);
  box-shadow:
    0 0 18px color-mix(in srgb, var(--machine-color) 42%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.machine-readout {
  display: grid;
  grid-template-columns: minmax(90px, auto) auto;
  align-items: center;
  gap: 10px;
}

.machine-readout > div:first-child {
  display: grid;
  gap: 3px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  background: rgba(4, 8, 9, 0.68);
}

.machine-readout span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.machine-readout strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1;
}

.machine-pulse {
  min-width: 72px;
  min-height: 44px;
  border-radius: 8px;
  color: #04100d;
  font-size: 16px;
}

.machine-board {
  counter-reset: algoStage;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 8px;
  padding: 18px 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 28%),
    rgba(1, 5, 6, 0.45);
}

.machine-scanline {
  position: absolute;
  left: var(--stage-x);
  top: 8px;
  bottom: 8px;
  z-index: 2;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--machine-color), transparent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--machine-color) 48%, transparent);
  opacity: calc(0.24 + (var(--machine-intensity) * 0.48));
  transform: translateX(-50%);
  transition: left 420ms cubic-bezier(.2, .8, .2, 1), opacity 160ms ease;
}

.machine-rail {
  left: 5%;
  right: 5%;
  top: 25px;
  height: 5px;
  background:
    linear-gradient(90deg, var(--machine-color) 0 var(--stage-fill), rgba(255, 255, 255, 0.12) var(--stage-fill) 100%);
}

.machine-return-rail {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 34px;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 45%, rgba(255, 255, 255, 0.08));
}

.machine-ball {
  top: 25px;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.72);
}

.algo-node {
  min-height: 126px;
  padding: 15px 12px 13px;
  border-color: rgba(255, 255, 255, 0.075);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 52%),
    linear-gradient(135deg, color-mix(in srgb, var(--machine-color) 8%, transparent), transparent 65%),
    rgba(6, 10, 11, 0.82);
  transition: transform 220ms ease, border-color 220ms ease, opacity 220ms ease, box-shadow 220ms ease;
}

.algo-node::before {
  counter-increment: algoStage;
  content: "0" counter(algoStage);
  position: absolute;
  top: 9px;
  right: 10px;
  color: color-mix(in srgb, var(--machine-color) 68%, var(--muted));
  font-size: 10px;
  font-weight: 900;
}

.algo-node[data-state="current"]::before {
  content: "LIVE";
  color: #04100d;
  min-width: 38px;
  min-height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--machine-color);
  box-shadow: 0 0 18px color-mix(in srgb, var(--machine-color) 32%, transparent);
}

.algo-node::after {
  height: 4px;
  background: linear-gradient(90deg, var(--machine-color) 0 var(--node-level, 0%), rgba(255, 255, 255, 0.09) var(--node-level, 0%) 100%);
}

.algo-node[data-state="waiting"] {
  opacity: 0.48;
}

.algo-node.is-active {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 50%),
    linear-gradient(135deg, color-mix(in srgb, var(--machine-color) 16%, transparent), transparent 65%),
    rgba(7, 13, 13, 0.92);
}

.algo-node.is-current {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--machine-color) 52%, rgba(255, 255, 255, 0.08));
}

.algo-node span {
  padding-right: 24px;
  font-weight: 900;
  text-transform: uppercase;
}

.algo-node strong {
  font-size: 17px;
}

.algo-node small {
  color: #aab8bd;
}

/* Iteration 2: unified JBOT command-brand layer */
:root {
  --bg: #080b0d;
  --panel: #101519;
  --panel-2: #151b20;
  --line: #2a3538;
  --line-soft: #1d282b;
  --text: #f2f7f7;
  --muted: #94a5a8;
  --muted-2: #66777b;
  --green: #35d697;
  --red: #ff6976;
  --amber: #f6c560;
  --blue: #5aa7ff;
  --cyan: #60e1df;
  --shadow: rgba(0, 0, 0, 0.34);
}

body {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, #0b0f11 0%, #07090b 46%, #090d0d 100%);
  background-size: 42px 42px, 42px 42px, auto;
  overflow-x: clip;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(96, 225, 223, 0.08), transparent 34%),
    linear-gradient(245deg, rgba(246, 197, 96, 0.065), transparent 38%),
    linear-gradient(0deg, rgba(46, 211, 158, 0.045), transparent 28%);
}

.app-shell {
  width: min(1680px, calc(100vw - 34px));
}

.topbar {
  border-color: rgba(255, 255, 255, 0.07);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 80%),
    rgba(7, 11, 12, 0.9);
}

.brand {
  gap: 13px;
}

.brand .mark {
  position: relative;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.34),
    0 0 28px rgba(96, 225, 223, 0.16);
  isolation: isolate;
}

.brand .mark::after {
  content: "";
  position: absolute;
  inset: -7px;
  z-index: -1;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.34), transparent 28%),
    radial-gradient(circle at 76% 72%, rgba(255, 204, 77, 0.18), transparent 35%),
    rgba(100, 210, 255, 0.08);
  filter: blur(10px);
  opacity: 0.78;
}

.brand h1 {
  font-size: 24px;
  font-weight: 950;
}

.brand-subline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
}

.brand-subline b {
  color: #d7fff7;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.brand-subline b::after {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--green);
  vertical-align: middle;
  box-shadow: 0 0 10px rgba(53, 214, 151, 0.72);
}

.brand-subline #statusText {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

button,
input,
select {
  border-color: rgba(255, 255, 255, 0.09);
}

button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), transparent 72%),
    #151b1f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

button:hover {
  border-color: rgba(96, 225, 223, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), transparent 72%),
    #1a2226;
}

.primary {
  background:
    linear-gradient(180deg, #f4fffb, #bceee6 58%, #88ded5);
  border-color: rgba(232, 255, 251, 0.92);
  box-shadow:
    0 10px 24px rgba(96, 225, 223, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

input,
select {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 70%),
    #0b1012;
}

.cockpit-card,
.tool-panel,
.brain-strip,
.algo-machine,
.analysis-context-bar,
.active-trades-bar {
  border-color: rgba(255, 255, 255, 0.075);
  box-shadow:
    0 22px 58px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.cockpit-card,
.tool-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.012) 56%, transparent),
    #101519;
}

.panel-head {
  min-height: 58px;
}

.panel-head h2 {
  font-size: 17px;
  font-weight: 900;
}

.cockpit-card {
  border-radius: 8px;
}

.equity-card strong {
  color: #f5fffc;
}

.state-pill,
.autopilot-badge,
.journal-chip,
.analysis-context-pill,
.director-status {
  letter-spacing: 0;
}

@media (prefers-reduced-motion: reduce) {
  .market-field-canvas {
    opacity: 0.28;
  }

  .algo-machine::before,
  .machine-scanline,
  .machine-ball,
  .dial-ring.is-live,
  .autopilot-badge.active,
  .state-pill.active {
    animation: none;
  }

  .machine-ball,
  .algo-node {
    transition: none;
  }

  .tool-panel::after,
  .cockpit-card::after,
  .algo-machine::after,
  .analysis-context-bar::after {
    display: none;
  }
}

.command-card {
  align-items: center;
}

.command-card strong {
  font-size: 17px;
  line-height: 1.25;
}

.quick-actions {
  display: grid;
  gap: 8px;
  min-width: 98px;
}

.workspace {
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: 14px;
}

.main-stack {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.analysis-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 78px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 0%, rgba(96, 225, 223, 0.14), transparent 220px),
    linear-gradient(135deg, rgba(96, 225, 223, 0.08), rgba(245, 193, 93, 0.045) 48%, rgba(53, 214, 151, 0.055)),
    #101516;
  box-shadow: 0 18px 46px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.analysis-context-bar[data-context="long"] {
  border-color: rgba(53, 214, 151, 0.36);
}

.analysis-context-bar[data-context="short"] {
  border-color: rgba(255, 104, 111, 0.38);
}

.analysis-context-bar[data-context="detached"] {
  border-color: rgba(245, 193, 93, 0.38);
}

.analysis-context-bar > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.analysis-context-bar span,
.analysis-context-bar small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-context-bar strong {
  overflow: hidden;
  color: var(--text);
  font-size: 23px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-context-pill {
  flex: 0 0 auto;
  min-width: 112px;
  min-height: 40px;
  display: grid;
  place-items: center;
  padding: 0 14px;
  border: 1px solid rgba(96, 225, 223, 0.28);
  border-radius: 999px;
  color: #d9fbff;
  background: rgba(96, 225, 223, 0.10);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.analysis-context-bar[data-context="long"] .analysis-context-pill {
  border-color: var(--green);
  color: #06130f;
  background: var(--green);
}

.analysis-context-bar[data-context="short"] .analysis-context-pill {
  border-color: var(--red);
  color: #18080a;
  background: var(--red);
}

.analysis-context-bar[data-context="detached"] .analysis-context-pill {
  border-color: var(--amber);
  color: #151006;
  background: var(--amber);
}

.analysis-context-pill[data-tone="buy"] {
  border-color: var(--green);
  color: #06130f;
  background: var(--green);
}

.analysis-context-pill[data-tone="sell"] {
  border-color: var(--red);
  color: #18080a;
  background: var(--red);
}

.analysis-context-pill[data-tone="hold"],
.analysis-context-pill[data-tone="detached"] {
  border-color: var(--amber);
  color: #151006;
  background: var(--amber);
}

.analysis-context-pill[data-tone="market"] {
  border-color: rgba(96, 225, 223, 0.28);
  color: #d9fbff;
  background: rgba(96, 225, 223, 0.10);
}

.active-trade-context {
  width: fit-content;
  min-height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: #07110f;
  background: var(--cyan);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 0 18px rgba(96, 225, 223, 0.18);
}

.active-trade-fill-count {
  width: fit-content;
  min-height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  border: 1px solid rgba(245, 193, 93, 0.34);
  border-radius: 999px;
  color: #ffe6ae;
  background: rgba(245, 193, 93, 0.10);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.lower-grid {
  grid-template-columns: minmax(440px, 1.18fr) minmax(360px, 0.95fr) minmax(310px, 0.75fr);
  gap: 14px;
}

.main-stack .lower-grid {
  grid-template-columns: minmax(360px, 1.1fr) minmax(320px, 0.9fr);
  margin-top: 0;
}

.main-stack .performance-panel {
  grid-column: 1 / -1;
}

.portfolio-tabs {
  overflow: hidden;
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  padding: 6px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.02);
}

.tab-button {
  min-height: 44px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  transition: none;
}

.tab-button.active {
  color: #07110f;
  background: var(--cyan);
  border-color: var(--cyan);
}

.tab-panels {
  min-height: 520px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tab-panel > .panel-head {
  border-top: 0;
}

.panel-head {
  padding: 15px 16px;
}

.chart-panel {
  min-height: 640px;
}

.chart-wrap {
  height: 490px;
}

.stats-row div,
.paper-summary div,
.autopilot-stats div {
  background: rgba(255, 255, 255, 0.018);
}

.signal-badge,
.autopilot-badge,
.ai-threshold {
  border-radius: 999px;
}

.confidence-shell {
  grid-template-columns: 1fr auto;
  padding: 16px 16px 8px;
}

.confidence-bar,
.ai-gate-meter {
  height: 12px;
}

.levels {
  margin: 10px 16px 6px;
}

.button-row,
.autopilot-actions {
  padding: 14px 16px;
}

.ai-box {
  margin: 0 16px 16px;
}

.autopilot-readiness,
.ai-gate {
  margin: 0 16px 14px;
}

.autopilot-log,
.watchlist,
.positions,
.journal {
  padding: 14px;
}

.watch-panel {
  min-height: 520px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.watchlist {
  max-height: none;
  min-height: 440px;
  grid-auto-rows: max-content;
  align-content: start;
}

.watch-item {
  align-self: start;
}

.watch-actions {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.watch-trade-button {
  min-width: 72px;
}

.watch-trade-button.active {
  color: #07110f;
  border-color: var(--green);
  background: var(--green);
  font-weight: 800;
}

.watch-remove-button {
  min-width: 44px;
  padding-inline: 0;
}

.watch-symbol-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.watch-scope,
.event-scope,
.journal-scope {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.watch-scope.holding,
.event-scope.holding,
.journal-scope.active {
  color: #07110f;
  background: var(--green);
}

.watch-scope.watch-only,
.event-scope.watch-only {
  color: var(--cyan);
  border: 1px solid rgba(96, 225, 223, 0.28);
  background: rgba(96, 225, 223, 0.08);
}

.event-scope.system {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.watch-signal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.watch-signal span {
  color: var(--muted);
  font-weight: 700;
}

.watch-item.holding {
  border-color: rgba(53, 214, 151, 0.34);
}

.event-scope-row {
  margin: 6px 0;
}

.paper-summary {
  grid-template-columns: 1.35fr repeat(4, minmax(0, 1fr));
}

.paper-summary strong {
  font-size: 20px;
}

.paper-editor {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px 16px;
}

.position-editor {
  margin: 0 16px 14px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #121612;
}

.position-ticket-grid {
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
}

.position-ticket-grid .span-2 {
  grid-column: 1 / -1;
}

.position-editor input,
.position-editor select {
  min-height: 48px;
  font-size: 15px;
}

.position-editor input[readonly] {
  color: #dfe9e3;
  background: #0f130f;
}

.position-editor .ticket-leverage-control input[type="range"] {
  min-height: 36px;
}

.position-ticket-actions {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.position-row {
  grid-template-columns: minmax(150px, 1.2fr) minmax(92px, 0.65fr) minmax(0, 0.95fr) auto;
  min-height: 72px;
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.06);
  background: #121612;
}

.position-pnl {
  display: grid;
  justify-items: stretch;
  min-width: 0;
  gap: 6px;
  overflow: hidden;
}

.position-pnl-main {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.position-pnl-main strong {
  font-size: clamp(20px, 2.15vw, 30px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

.position-pnl-main span,
.position-pnl-subrow em {
  flex: 1 1 84px;
  max-width: 100%;
  min-width: 0;
  padding: 4px 8px;
  overflow: hidden;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  opacity: 0.82;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.position-pnl-subrow {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
}

.position-pnl-subrow span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.position-pnl-subrow strong {
  color: inherit;
  font-size: 13px;
  font-weight: 900;
}

.position-actions button {
  min-height: 34px;
}

.settings-grid,
.key-grid {
  gap: 12px;
  padding: 14px 16px;
}

.dial-settings {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}

.master-tune-control {
  grid-column: 1 / -1;
  min-height: 118px;
  border-color: rgba(246, 197, 96, 0.28);
  background:
    linear-gradient(135deg, rgba(246, 197, 96, 0.13), rgba(96, 225, 223, 0.08)),
    #121612;
}

.master-tune-control strong {
  min-width: 124px;
  background: #f6c560;
  border-color: #f6c560;
}

.master-tune-control input[type="range"]::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, #f6c560 0 var(--slider-fill), #070a09 var(--slider-fill) 100%);
}

.style-control,
.frequency-control,
.chart-gate-control {
  grid-column: span 2;
  min-height: 108px;
}

.leverage-control {
  grid-column: span 2;
  min-height: 108px;
  border-color: rgba(246, 197, 96, 0.28);
  background:
    linear-gradient(135deg, rgba(246, 197, 96, 0.1), rgba(46, 211, 158, 0.06)),
    #121612;
}

.leverage-control strong {
  min-width: 56px;
  background: #f6c560;
  border-color: #f6c560;
}

.leverage-control input[type="range"]::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, #f6c560 0 var(--slider-fill), #070a09 var(--slider-fill) 100%);
}

.style-control strong {
  min-width: 92px;
}

.style-scale {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.direction-control {
  grid-column: span 2;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #121612;
}

.direction-control select {
  min-height: 46px;
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.slider-control {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #121612;
}

.slider-control > span {
  margin-bottom: 4px;
}

.slider-control strong {
  min-width: 62px;
  color: #07110f;
  background: var(--cyan);
  border-color: var(--cyan);
}

.settings-grid input[type="range"] {
  height: 38px;
  min-height: 38px;
}

.settings-grid input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  background: linear-gradient(90deg, var(--cyan) 0 var(--slider-fill), #070a09 var(--slider-fill) 100%);
}

.settings-grid input[type="range"]::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  margin-top: -8px;
}

.toggle-line {
  min-height: 52px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #121612;
}

.toggle-line input {
  accent-color: var(--green);
}

.switch-control {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 108px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #121612;
}

.switch-control > span:first-of-type {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.switch-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #080c0a;
  transition: background 160ms ease, border-color 160ms ease;
}

.switch-track::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
}

.switch-control input:checked ~ .switch-track {
  border-color: rgba(46, 211, 158, 0.75);
  background: rgba(46, 211, 158, 0.22);
}

.switch-control input:checked ~ .switch-track::before {
  background: var(--green);
  transform: translateX(22px);
}

.switch-control input:focus-visible ~ .switch-track {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.contrarian-switch {
  grid-column: span 2;
  min-height: 118px;
  overflow: hidden;
  border-color: rgba(255, 107, 107, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(255, 205, 86, 0.11)),
    rgba(18, 9, 12, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 18px 44px rgba(255, 82, 82, 0.12);
}

.contrarian-switch > span:first-of-type {
  font-size: 17px;
  letter-spacing: 0;
}

.contrarian-switch em {
  position: absolute;
  left: 14px;
  bottom: 13px;
  color: rgba(255, 224, 224, 0.76);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.contrarian-switch .switch-track {
  width: 70px;
  height: 38px;
  border-color: rgba(255, 138, 101, 0.55);
  background: rgba(20, 8, 10, 0.94);
}

.contrarian-switch .switch-track::before {
  width: 28px;
  height: 28px;
  background: rgba(255, 205, 210, 0.8);
}

.contrarian-switch input:checked ~ .switch-track {
  border-color: rgba(255, 210, 64, 0.9);
  background: rgba(255, 83, 83, 0.34);
}

.contrarian-switch input:checked ~ .switch-track::before {
  background: #ffd35a;
  transform: translateX(32px);
  box-shadow: 0 0 22px rgba(255, 211, 90, 0.55);
}

.switch-control.feature-locked {
  cursor: pointer;
  opacity: 0.62;
  filter: grayscale(0.28);
}

.switch-control.feature-locked .switch-track {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(17, 20, 24, 0.94);
}

.switch-control.feature-locked em::after {
  content: " / Pulse";
  color: #ffd76b;
}

.stop-target-dials {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line-soft);
}

.stop-target-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 148px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #121612;
}

.stop-target-card input[type="range"] {
  --slider-fill: 0%;
  appearance: none;
  grid-column: 1 / -1;
  width: 100%;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
}

.stop-target-card input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan) 0 var(--slider-fill), #070a09 var(--slider-fill) 100%);
}

.stop-target-card input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -8px;
  border: 2px solid #07110f;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 2px rgba(242, 189, 84, 0.24);
}

.stop-target-card input[type="range"]::-moz-range-track {
  height: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #070a09;
}

.stop-target-card input[type="range"]::-moz-range-progress {
  height: 10px;
  border-radius: 999px;
  background: var(--cyan);
}

.stop-target-card input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 2px solid #07110f;
  border-radius: 50%;
  background: var(--amber);
}

.compact-switch {
  min-height: 72px;
  padding: 12px;
}

.ai-level-switch {
  margin: 12px 14px 10px;
  min-height: 58px;
  border-color: rgba(96, 225, 223, 0.2);
  background: rgba(96, 225, 223, 0.05);
}

.mini-dial {
  --dial-value: 0%;
  --dial-color: var(--cyan);
  position: relative;
  width: 86px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border-radius: 50%;
  background: conic-gradient(var(--dial-color) 0 var(--dial-value), rgba(255, 255, 255, 0.08) var(--dial-value) 100%);
}

.mini-dial::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: linear-gradient(180deg, #20251f, #111512);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mini-dial strong,
.mini-dial span {
  position: relative;
  z-index: 1;
}

.mini-dial strong {
  font-size: 19px;
  line-height: 1;
}

.mini-dial span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.mini-dial[data-tone="stop"] {
  --dial-color: var(--red);
}

.mini-dial[data-tone="target"] {
  --dial-color: var(--green);
}

.mini-dial[data-tone="off"] {
  --dial-color: var(--muted-2);
}

.stop-target-card.disabled {
  border-color: rgba(255, 255, 255, 0.055);
}

.stop-target-card.disabled input[type="range"] {
  opacity: 0.55;
}

.drawer {
  border-top: 1px solid var(--line-soft);
}

.drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0 16px;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.drawer summary::-webkit-details-marker {
  display: none;
}

.drawer summary::after {
  content: "+";
  color: var(--cyan);
  font-size: 18px;
}

.drawer[open] summary::after {
  content: "-";
}

.advanced-open {
  overflow: hidden;
}

.advanced-overlay[hidden] {
  display: none;
}

.advanced-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 18px;
}

.advanced-backdrop {
  position: absolute;
  inset: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(96, 225, 223, 0.16), transparent 36%),
    rgba(4, 8, 12, 0.72);
  backdrop-filter: blur(20px) saturate(1.2);
}

.advanced-backdrop:hover {
  border: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(96, 225, 223, 0.16), transparent 36%),
    rgba(4, 8, 12, 0.72);
}

.advanced-panel {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100vw - 28px));
  max-height: min(88vh, 920px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.045)),
    rgba(13, 18, 24, 0.94);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.54),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(34px) saturate(1.35);
}

.advanced-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}

.advanced-head span,
.advanced-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.advanced-head h2 {
  margin-top: 3px;
  font-size: 22px;
}

.advanced-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 12px;
  padding: 14px;
  overflow: auto;
}

.advanced-section {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 46%),
    rgba(12, 17, 22, 0.78);
}

.advanced-section:nth-child(3),
.advanced-section:nth-child(5) {
  grid-column: 1 / -1;
}

.advanced-section-head {
  display: grid;
  gap: 4px;
  padding: 14px 16px 0;
}

.advanced-section-head strong {
  font-size: 15px;
}

.advanced-section .settings-grid,
.advanced-section .key-grid {
  padding: 14px;
}

.advanced-section .stop-target-dials {
  border-top: 0;
  padding: 12px 14px 14px;
}

.advanced-section .ai-level-switch {
  margin: 12px 14px 0;
}

.admin-login,
.admin-strip {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line-soft);
}

.admin-login {
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: end;
}

.admin-login > span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.admin-strip {
  grid-template-columns: 1fr auto;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.performance-grid {
  gap: 10px;
  padding: 14px;
  background: transparent;
}

.performance-grid div {
  min-height: 78px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #121612;
}

.journal {
  max-height: 420px;
}

.journal-header,
.journal-row {
  grid-template-columns: minmax(220px, 1.4fr) minmax(88px, 0.5fr) minmax(100px, 0.55fr) minmax(108px, 0.65fr) minmax(140px, 0.85fr);
}

.journal-row {
  min-height: 70px;
  background: #121612;
}

.journal-row.signal-only.watch-only {
  border-color: rgba(96, 225, 223, 0.2);
}

.journal-row.signal-only.holding {
  border-color: rgba(245, 193, 93, 0.24);
}

.journal-chip {
  border-radius: 999px;
}

.journal-title {
  flex-wrap: wrap;
}

@media (max-width: 1320px) {
  .cockpit {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

  .brain-strip {
    grid-template-columns: minmax(220px, 1fr) auto minmax(320px, 1.4fr);
  }

  .brain-checks {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

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

  .machine-rail,
  .machine-return-rail,
  .machine-scanline,
  .machine-ball {
    display: none;
  }

  .workspace,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .chart-panel {
    min-height: 570px;
  }

  .chart-wrap {
    height: 420px;
  }
}

@media (max-width: 1024px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    position: static;
  }

  .market-strip {
    display: grid;
    grid-template-columns: minmax(180px, 1.3fr) repeat(3, minmax(98px, 0.8fr)) minmax(110px, 0.7fr) 48px;
    align-items: end;
  }

  .market-strip .icon-button {
    width: 100%;
  }

  button,
  input,
  select {
    min-height: 44px;
  }

  .small-button {
    min-width: 44px;
    min-height: 44px;
  }

  .settings-grid input[type="range"] {
    height: 44px;
    min-height: 44px;
  }

  .cockpit-card {
    min-height: 120px;
  }

  .brain-strip {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .brain-metrics,
  .brain-checks {
    grid-column: 1 / -1;
  }

  .machine-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dial-ring {
    width: 88px;
  }

  .dial-ring strong {
    font-size: 19px;
  }

  .portfolio-tabs {
    order: -1;
  }

  .chart-panel {
    min-height: 0;
  }
}

@media (max-width: 820px) {
  body {
    padding-bottom: 350px;
  }

  .app-shell {
    width: min(100vw - 18px, 1640px);
    padding-top: 8px;
  }

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

  .control-strip,
  .market-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-strip button,
  .market-strip .icon-button {
    width: 100%;
  }

  .market-strip label,
  .market-strip .symbol-label {
    min-width: 0;
  }

  .chart-head-actions {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .analysis-context-bar {
    align-items: stretch;
    flex-direction: column;
    min-height: 0;
  }

  .analysis-context-bar strong {
    font-size: 20px;
  }

  .analysis-context-pill {
    width: fit-content;
    min-width: 0;
  }

  .cockpit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .brain-score {
    width: 86px;
  }

  .brain-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brain-checks {
    justify-content: flex-start;
  }

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

  .machine-readout {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .machine-pulse {
    width: fit-content;
  }

  .equity-card,
  .command-card {
    grid-column: 1 / -1;
  }

  .equity-card strong {
    font-size: 28px;
  }

  .dial-ring {
    width: 96px;
  }

  .cockpit .dial-card:nth-of-type(4) {
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    min-height: 98px;
    text-align: left;
  }

  .stats-row,
  .paper-summary,
  .performance-grid,
  .autopilot-stats,
  .levels,
  .paper-editor,
  .position-ticket-grid,
  .position-ticket-actions,
  .settings-grid,
  .key-grid,
  .admin-login,
  .admin-strip,
  .stop-target-dials,
  .dial-settings {
    grid-template-columns: 1fr;
  }

  .dial-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .advanced-overlay {
    padding: 8px;
    align-items: stretch;
  }

  .advanced-panel {
    width: min(100vw - 16px, 1120px);
    max-height: calc(100vh - 16px);
  }

  .advanced-head {
    align-items: start;
    padding: 14px;
  }

  .advanced-body {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .advanced-section:nth-child(3),
  .advanced-section:nth-child(5) {
    grid-column: auto;
  }

  .style-control,
  .frequency-control,
  .chart-gate-control,
  .leverage-control,
  .scan-control,
  .direction-control {
    grid-column: 1 / -1;
  }

  .switch-control {
    min-height: 74px;
    padding: 12px;
  }

  .switch-control > span:first-of-type {
    font-size: 13px;
  }

  .main-stack .lower-grid {
    grid-template-columns: 1fr;
  }

  .main-stack .performance-panel {
    grid-column: auto;
  }

  .button-row,
  .autopilot-actions {
    grid-template-columns: 1fr;
  }

  .chart-wrap {
    height: 350px;
  }

  .position-editor {
    margin: 0 12px 12px;
  }

  .position-editor-head {
    align-items: stretch;
    flex-direction: column;
  }

  .position-editor-head span {
    width: 100%;
  }

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

  .position-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .tab-panels {
    min-height: 0;
  }

  .journal-header {
    display: none;
  }

  .journal-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .journal-main,
  .journal-result {
    grid-column: 1 / -1;
  }

  .journal-stat span {
    display: block;
  }

  .journal-result {
    justify-items: start;
    text-align: left;
    padding-top: 8px;
    border-top: 1px solid var(--line-soft);
  }

  .trade-director-tray {
    bottom: 8px;
    width: calc(100vw - 16px);
    max-height: 56vh;
  }

  .director-handle {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .director-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) repeat(4, auto);
    width: 100%;
  }

  .director-body {
    grid-template-columns: 1fr;
  }

  .director-order-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .director-card ul {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body {
    padding-bottom: 390px;
  }

  .control-strip,
  .market-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .market-strip .symbol-label {
    grid-column: 1 / -1;
  }

  .market-strip button.primary {
    grid-column: span 2;
  }

  .cockpit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cockpit-card {
    min-height: 108px;
    padding: 12px;
  }

  .dial-card {
    gap: 7px;
  }

  .dial-ring {
    width: 78px;
  }

  .dial-ring::before {
    inset: 8px;
  }

  .dial-ring strong {
    font-size: 18px;
  }

  .dial-ring span {
    font-size: 9px;
  }

  .equity-card,
  .command-card {
    grid-column: 1 / -1;
  }

  .equity-card strong {
    font-size: 25px;
  }

  .quick-actions {
    grid-template-columns: 1fr 1fr;
  }

  .brain-metrics {
    grid-template-columns: 1fr;
  }

  .brain-lead strong {
    font-size: 21px;
  }

  .machine-board {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .algo-node {
    min-height: 82px;
    padding: 13px 12px 12px;
  }

  .director-controls {
    grid-template-columns: 1fr 1fr;
  }

  .director-auto {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .director-card-top {
    align-items: stretch;
    flex-direction: column;
  }

  .director-card-top strong {
    font-size: 21px;
  }

  .director-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

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

  .tab-button {
    min-height: 48px;
    padding: 0 6px;
    font-size: 13px;
  }

  .panel-head {
    padding: 12px;
  }

  .chart-panel .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .chart-head-actions {
    justify-items: stretch;
  }

  .chart-zoom {
    justify-content: space-between;
  }

  .chart-zoom button {
    min-width: 34px;
  }

  .active-trades-bar {
    justify-content: stretch;
    padding-inline: 10px;
  }

  .active-trade {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .active-trade-main {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
  }

  .active-trade-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .active-trade-pnl {
    grid-column: 1 / -1;
  }

  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .autopilot-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .paper-summary {
    grid-template-columns: 1fr;
  }

  .performance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .performance-grid strong {
    font-size: 16px;
  }

  .watch-panel {
    min-height: 430px;
  }

  .watchlist {
    min-height: 340px;
  }

  .chart-wrap {
    height: 260px;
    padding-inline: 6px;
  }

  .switch-control {
    gap: 8px;
    min-height: 68px;
    padding: 10px;
  }

  .switch-control > span:first-of-type {
    font-size: 12px;
    white-space: nowrap;
  }

  .switch-track {
    width: 46px;
    height: 28px;
  }

  .switch-track::before {
    width: 18px;
    height: 18px;
  }

  .switch-control input:checked ~ .switch-track::before {
    transform: translateX(20px);
  }
}

/* P&L priority tile */
.cockpit .pnl-card {
  grid-template-columns: minmax(0, 1fr);
  align-content: space-between;
  justify-items: stretch;
  min-height: 168px;
  border-color: color-mix(in srgb, var(--pnl-accent) 58%, rgba(255, 255, 255, 0.18));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--pnl-accent) 25%, transparent), rgba(255, 255, 255, 0.070) 46%, rgba(100, 210, 255, 0.08)),
    rgba(14, 20, 27, 0.84);
}

.cockpit .pnl-card[data-tone="profit"] {
  --pnl-accent: var(--green);
}

.cockpit .pnl-card[data-tone="loss"] {
  --pnl-accent: var(--red);
}

.cockpit .pnl-card[data-tone="even"] {
  --pnl-accent: var(--amber);
}

.cockpit .pnl-card:hover::after,
.cockpit .pnl-card:focus-within::after {
  opacity: 0.76;
}

@media (max-width: 1320px) {
  .cockpit .pnl-card {
    grid-column: span 2;
  }
}

@media (max-width: 820px) {
  .cockpit .pnl-card {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
    min-height: 156px;
    text-align: left;
  }
}

@media (max-width: 520px) {
  .pnl-card-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .pnl-card .dial-ring {
    width: 104px;
  }
}

/* Progression HUD */
.topbar {
  align-items: flex-start;
}

.brand {
  align-items: flex-start;
  flex: 0 1 430px;
  min-width: 360px;
}

.brand-copy {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.xp-console {
  display: grid;
  gap: 7px;
  width: min(390px, 42vw);
}

.xp-lane {
  position: relative;
  display: grid;
  gap: 6px;
  overflow: hidden;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.055)),
    rgba(15, 20, 25, 0.58);
  box-shadow:
    0 12px 34px rgba(5, 10, 16, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(24px) saturate(1.35);
}

.xp-line {
  display: grid;
  grid-template-columns: auto minmax(92px, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.xp-line span,
.xp-line b {
  color: rgba(235, 244, 249, 0.72);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.xp-line strong {
  min-width: 0;
  color: rgba(248, 252, 255, 0.94);
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xp-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.xp-bar i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  transition: width 420ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.xp-lane.jbot .xp-bar i {
  background: linear-gradient(90deg, #64d2ff, #31d18f, #f5c84b);
  box-shadow: 0 0 18px rgba(100, 210, 255, 0.34);
}

.xp-lane.user .xp-bar i {
  background: linear-gradient(90deg, #f5c84b, #ff7a90, #64d2ff);
  box-shadow: 0 0 18px rgba(245, 200, 75, 0.3);
}

.xp-lane::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.24) 48%, transparent 70%);
  opacity: 0;
  transform: translateX(-120%);
  pointer-events: none;
}

.xp-lane.xp-earned::after,
.xp-lane.xp-level-up::after {
  animation: xp-sheen 900ms ease;
}

.xp-lane.xp-level-up {
  animation: xp-pop 920ms ease;
}

.xp-recent {
  display: block;
  min-width: 0;
  color: rgba(206, 219, 229, 0.72);
  font-size: 10px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes xp-sheen {
  0% {
    opacity: 0;
    transform: translateX(-120%);
  }
  30% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translateX(120%);
  }
}

@keyframes xp-pop {
  0%,
  100% {
    transform: translateY(0);
  }
  42% {
    transform: translateY(-2px);
  }
}

@media (max-width: 1024px) {
  .brand {
    min-width: min(100%, 390px);
  }

  .xp-console {
    width: min(390px, 100%);
  }
}

@media (max-width: 820px) {
  .topbar {
    align-items: stretch;
  }

  .brand {
    width: 100%;
  }

  .brand-copy,
  .xp-console {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .brand {
    min-width: 0;
  }

  .xp-line {
    grid-template-columns: 1fr auto;
    gap: 5px 8px;
  }

  .xp-line strong {
    grid-column: 1 / -1;
    grid-row: 1;
    padding-right: 76px;
  }

  .xp-line span {
    grid-column: 1;
    grid-row: 2;
  }

  .xp-line b {
    grid-column: 2;
    grid-row: 2;
  }
}

/* Engine chart tabs */
.chart-tabs-panel {
  display: grid;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.045)),
    rgba(15, 20, 25, 0.58);
  box-shadow:
    0 16px 42px rgba(5, 10, 16, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(26px) saturate(1.35);
}

.chart-tabs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.chart-tabs-head span {
  color: rgba(248, 250, 252, 0.82);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.chart-tabs-head strong {
  min-width: 0;
  color: rgba(206, 219, 229, 0.74);
  font-size: 11px;
  font-weight: 760;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.chart-tab,
.chart-tab-empty {
  flex: 0 0 min(210px, 74vw);
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(8, 12, 16, 0.48);
  color: var(--text);
  text-align: left;
}

.chart-tab {
  cursor: pointer;
}

.chart-tab span {
  color: rgba(206, 219, 229, 0.7);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.chart-tab strong {
  font-size: 18px;
  line-height: 1.05;
}

.chart-tab small {
  min-width: 0;
  color: rgba(206, 219, 229, 0.68);
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-tab.long {
  border-color: rgba(49, 209, 143, 0.34);
}

.chart-tab.short {
  border-color: rgba(255, 104, 111, 0.36);
}

.chart-tab.armed {
  border-color: rgba(100, 210, 255, 0.35);
}

.chart-tab.watch,
.chart-tab.paused {
  border-color: rgba(245, 200, 75, 0.28);
}

.chart-tab.selected {
  border-color: rgba(100, 210, 255, 0.82);
  background:
    linear-gradient(135deg, rgba(100, 210, 255, 0.16), rgba(49, 209, 143, 0.075)),
    rgba(10, 16, 20, 0.72);
  box-shadow:
    0 0 0 1px rgba(100, 210, 255, 0.17),
    0 16px 34px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.chart-tab:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.chart-tab-empty {
  flex-basis: 100%;
  place-items: center;
  color: rgba(206, 219, 229, 0.68);
  font-size: 12px;
  font-weight: 760;
}

@media (max-width: 820px) {
  .chart-tabs-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-tabs-head strong {
    text-align: left;
    white-space: normal;
  }

  .chart-tab {
    flex-basis: min(230px, 82vw);
  }
}

.pump-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px 16px 0;
}

.pump-guide-toggle {
  min-height: 42px;
  padding: 0 12px;
}

.pump-hunt-list {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
  padding: 0 14px 14px;
}

.pump-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.028)),
    rgba(18, 25, 32, 0.54);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.pump-card.hot {
  border-color: rgba(255, 98, 95, 0.44);
  background:
    linear-gradient(180deg, rgba(255, 98, 95, 0.14), rgba(255, 255, 255, 0.032)),
    rgba(18, 25, 32, 0.58);
}

.pump-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pump-card-head > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.pump-card-head span,
.pump-metrics span,
.pump-score span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.pump-card-head strong {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pump-score {
  min-width: 56px;
  min-height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 204, 77, 0.28);
  border-radius: 8px;
  background: rgba(255, 204, 77, 0.10);
}

.pump-score.hot {
  border-color: rgba(255, 98, 95, 0.42);
  background: rgba(255, 98, 95, 0.12);
}

.pump-score strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.pump-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.pump-metrics div {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.pump-metrics strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pump-plan,
.pump-risks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pump-plan span,
.pump-risks span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(100, 210, 255, 0.20);
  border-radius: 7px;
  color: rgba(240, 248, 255, 0.86);
  background: rgba(100, 210, 255, 0.075);
  font-size: 11px;
  font-weight: 700;
}

.pump-risks span {
  border-color: rgba(255, 98, 95, 0.22);
  background: rgba(255, 98, 95, 0.08);
}

.pump-reasons {
  margin: 0;
  padding-left: 18px;
  color: rgba(240, 248, 255, 0.78);
  font-size: 12px;
  line-height: 1.35;
}

.pump-guide {
  display: grid;
  gap: 6px;
}

.pump-step {
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-left: 3px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.pump-step.done,
.pump-step.ready {
  border-left-color: var(--green);
}

.pump-step.risk {
  border-left-color: var(--red);
}

.pump-step.plan {
  border-left-color: var(--blue);
}

.pump-step b {
  font-size: 12px;
}

.pump-step span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.pump-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

@media (max-width: 520px) {
  .pump-actions,
  .pump-card-actions {
    grid-template-columns: 1fr;
  }

  .pump-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Iteration 3: responsive density polish */
@media (max-width: 1320px) {
  .algo-machine {
    padding: 14px;
  }

  .machine-board {
    padding-top: 10px;
  }

  .algo-node::before {
    top: 8px;
  }
}

@media (max-width: 1024px) {
  .brand {
    min-width: 0;
  }

  .topbar {
    gap: 12px;
  }

  .cockpit {
    gap: 10px;
  }

  .algo-machine {
    margin-top: 10px;
  }

  .machine-head strong {
    white-space: normal;
  }
}

@media (max-width: 820px) {
  .info-tip::after,
  .info-tip::before {
    display: none;
  }

  .app-shell {
    width: min(100vw - 14px, 1680px);
  }

  .brand .mark {
    width: 44px;
    height: 44px;
  }

  .brand h1 {
    font-size: 21px;
  }

  .brand-subline {
    flex-wrap: wrap;
    gap: 5px 8px;
  }

  .cockpit-card,
  .tool-panel,
  .brain-strip,
  .algo-machine {
    box-shadow:
      0 14px 34px rgba(0, 0, 0, 0.26),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }

  .machine-readout {
    grid-template-columns: 1fr auto;
  }

  .machine-readout > div:first-child {
    min-height: 42px;
  }

  .algo-node strong,
  .algo-node small {
    white-space: normal;
  }
}

@media (max-width: 520px) {
  .machine-readout {
    grid-template-columns: 1fr;
  }

  .machine-pulse {
    width: 100%;
  }

  .machine-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .algo-node {
    gap: 5px;
    min-height: 112px;
  }

  .algo-node strong {
    font-size: 14px;
  }
}

/* Tahoe 26.4.1 visual pass: Liquid Glass desktop app treatment */
:root {
  color-scheme: dark;
  --bg: #20282d;
  --panel: rgba(28, 34, 40, 0.66);
  --panel-2: rgba(45, 52, 60, 0.58);
  --line: rgba(255, 255, 255, 0.18);
  --line-soft: rgba(255, 255, 255, 0.10);
  --text: #f8fafc;
  --muted: rgba(236, 241, 246, 0.68);
  --muted-2: rgba(236, 241, 246, 0.48);
  --green: #31d18f;
  --red: #ff625f;
  --amber: #ffcc4d;
  --blue: #0a84ff;
  --cyan: #64d2ff;
  --purple: #bf5af2;
  --glass: rgba(31, 38, 46, 0.54);
  --glass-strong: rgba(37, 45, 54, 0.72);
  --glass-soft: rgba(255, 255, 255, 0.075);
  --hairline: rgba(255, 255, 255, 0.16);
  --inner-glow: rgba(255, 255, 255, 0.14);
  --shadow: rgba(4, 10, 16, 0.30);
  --app-shell-gutter: max(16px, calc((100vw - 1700px) / 2));
  --floating-panel-top: 115px;
  --apple-accent: #0a84ff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", sans-serif;
}

html {
  min-height: 100%;
  background: #cfdbe7;
}

body {
  background:
    linear-gradient(128deg, rgba(222, 234, 246, 0.62) 0%, rgba(134, 175, 198, 0.26) 30%, transparent 48%),
    linear-gradient(225deg, rgba(255, 213, 166, 0.42) 0%, rgba(237, 161, 172, 0.18) 34%, transparent 56%),
    linear-gradient(315deg, rgba(113, 201, 183, 0.26) 0%, transparent 42%),
    linear-gradient(180deg, #304150 0%, #141b22 46%, #0d1117 100%);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.025) 24%, transparent 66%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 100%);
  background-size: auto, 74px 74px, 74px 74px;
  opacity: 0.82;
}

.app-shell {
  width: min(1700px, calc(100vw - 32px));
  padding-top: 12px;
}

.topbar {
  position: relative;
  min-height: 76px;
  margin: 0 0 14px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.055)),
    rgba(31, 39, 48, 0.58);
  box-shadow:
    0 24px 70px rgba(5, 10, 16, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(38px) saturate(1.55);
}

.topbar::before {
  display: none;
}

.brand .mark {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 14px;
  color: inherit;
  background: transparent;
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.22),
    0 0 30px rgba(100, 210, 255, 0.18);
}

.brand .mark::after {
  border: 0;
}

.brand h1,
.panel-head h2,
.machine-head strong,
.brain-lead strong {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, sans-serif;
  font-weight: 800;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 23px;
}

.brand-subline b {
  color: rgba(248, 250, 252, 0.78);
  font-weight: 700;
  text-transform: none;
}

.brand-subline b::after {
  background: var(--green);
  box-shadow: 0 0 14px rgba(49, 209, 143, 0.76);
}

button,
input,
select {
  border-radius: 8px;
  letter-spacing: 0;
}

button {
  border-color: rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)),
    rgba(38, 47, 56, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 8px 20px rgba(0, 0, 0, 0.13);
  backdrop-filter: blur(18px) saturate(1.25);
}

button:hover {
  border-color: rgba(255, 255, 255, 0.30);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.075)),
    rgba(49, 60, 70, 0.72);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(10, 132, 255, 0.34);
  outline-offset: 2px;
}

.primary,
.tab-button.active,
.watch-trade-button.active {
  border-color: rgba(10, 132, 255, 0.88);
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.30), transparent 44%),
    linear-gradient(180deg, #2f9bff, #007aff);
  box-shadow:
    0 12px 26px rgba(10, 132, 255, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

input,
select {
  border-color: rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035)),
    rgba(18, 24, 31, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(22px) saturate(1.3);
}

input:focus,
select:focus {
  border-color: rgba(10, 132, 255, 0.84);
  box-shadow:
    0 0 0 3px rgba(10, 132, 255, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.cockpit-card,
.tool-panel,
.brain-strip,
.algo-machine,
.analysis-context-bar,
.active-trades-bar,
.mini-trade-log,
.trade-director-tray {
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.055) 48%, rgba(255, 255, 255, 0.035)),
    var(--glass);
  box-shadow:
    0 24px 72px rgba(5, 10, 16, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(34px) saturate(1.45);
}

.cockpit-card,
.tool-panel {
  overflow: hidden;
}

.cockpit {
  gap: 12px;
  margin-top: 0;
}

.cockpit-card {
  min-height: 142px;
  padding: 15px;
}

.cockpit-card span,
.cockpit-card small,
.panel-head span,
.machine-head span,
.machine-head small,
.algo-node span,
.algo-node small,
.brain-lead span,
.brain-lead small,
.brain-metrics span,
.brain-score span {
  color: rgba(238, 243, 248, 0.64);
  font-weight: 600;
}

.equity-card strong {
  color: #ffffff;
  font-weight: 760;
}

.state-pill,
.autopilot-badge,
.signal-badge,
.journal-chip,
.analysis-context-pill,
.director-status,
.watch-scope,
.event-scope,
.journal-scope,
.profile-badge {
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.state-pill.paused,
.autopilot-badge.paused {
  color: rgba(248, 250, 252, 0.66);
  background: rgba(255, 255, 255, 0.08);
}

.state-pill.active,
.autopilot-badge.active,
.watch-scope.holding,
.event-scope.holding,
.journal-scope.active {
  color: #062016;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent 55%),
    var(--green);
  border-color: rgba(49, 209, 143, 0.72);
}

.panel-head,
.mini-trade-log-head,
.director-handle {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.125), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.035);
  border-bottom-color: rgba(255, 255, 255, 0.10);
}

.panel-head h2 {
  font-size: 16px;
  font-weight: 760;
}

.market-strip {
  align-items: end;
}

.market-strip label {
  min-width: 104px;
}

.chart-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)),
    rgba(24, 31, 39, 0.66);
}

.chart-wrap {
  margin: 0 10px 12px;
  padding: 10px 10px 0;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015)),
    rgba(9, 13, 18, 0.42);
  overflow: hidden;
}

#priceCanvas {
  border-radius: 6px;
}

.chart-zoom,
.tabbar,
.journal-toolbar,
.floating-actions {
  border-color: rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)),
    rgba(15, 22, 29, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(18px) saturate(1.25);
}

.tabbar {
  gap: 4px;
  padding: 6px;
}

.tab-button {
  min-height: 38px;
  border-radius: 7px;
  color: rgba(238, 243, 248, 0.68);
  font-weight: 680;
}

.tab-button:not(.active):hover {
  background: rgba(255, 255, 255, 0.08);
}

.dial-ring,
.brain-score,
.mini-dial {
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.dial-ring::before,
.brain-score::before,
.mini-dial::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.035)),
    rgba(17, 24, 31, 0.88);
  border-color: rgba(255, 255, 255, 0.12);
}

.brain-strip {
  margin-top: 12px;
  padding: 14px;
}

.brain-metrics div,
.stats-row div,
.paper-summary div,
.autopilot-stats div,
.performance-grid div,
.levels div,
.position-editor,
.position-row,
.watch-item,
.journal-row,
.director-card,
.director-queue-row,
.profiles-table td,
.slider-control,
.switch-control,
.toggle-line,
.direction-control,
.stop-target-card {
  border-color: rgba(255, 255, 255, 0.11);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.026)),
    rgba(18, 25, 32, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.075);
  backdrop-filter: blur(24px) saturate(1.25);
}

.analysis-context-bar {
  background:
    linear-gradient(90deg, rgba(10, 132, 255, 0.18), rgba(100, 210, 255, 0.08) 42%, rgba(49, 209, 143, 0.08)),
    var(--glass);
}

.analysis-context-bar[data-context="long"] {
  border-color: rgba(49, 209, 143, 0.42);
}

.analysis-context-bar[data-context="short"] {
  border-color: rgba(255, 98, 95, 0.42);
}

.analysis-context-pill[data-tone="buy"],
.analysis-context-bar[data-context="long"] .analysis-context-pill {
  color: #062016;
  background: var(--green);
}

.analysis-context-pill[data-tone="sell"],
.analysis-context-bar[data-context="short"] .analysis-context-pill {
  color: #24090a;
  background: var(--red);
}

.active-trades-bar {
  background:
    linear-gradient(90deg, rgba(10, 132, 255, 0.12), rgba(49, 209, 143, 0.08), rgba(255, 204, 77, 0.06)),
    var(--glass);
}

.active-trade {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(14, 20, 27, 0.66);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 12px 28px rgba(0, 0, 0, 0.18);
}

.active-trade.selected {
  border-color: rgba(10, 132, 255, 0.78);
  background:
    linear-gradient(180deg, rgba(10, 132, 255, 0.22), rgba(255, 255, 255, 0.05)),
    rgba(18, 25, 32, 0.74);
}

.active-trade-side,
.active-trade-context,
.active-trade-fill-count {
  border-radius: 7px;
  text-transform: none;
}

.confidence-bar,
.ai-gate-meter,
.settings-grid input[type="range"]::-webkit-slider-runnable-track,
.stop-target-card input[type="range"]::-webkit-slider-runnable-track,
.ticket-leverage-control input[type="range"]::-webkit-slider-runnable-track {
  border-color: rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(90deg, var(--blue) 0 var(--slider-fill), rgba(255, 255, 255, 0.11) var(--slider-fill) 100%);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.26);
}

.settings-grid input[type="range"]::-webkit-slider-thumb,
.stop-target-card input[type="range"]::-webkit-slider-thumb,
.ticket-leverage-control input[type="range"]::-webkit-slider-thumb {
  border: 1px solid rgba(255, 255, 255, 0.64);
  background:
    linear-gradient(180deg, #ffffff, #dfe8f2);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.slider-control strong,
.master-tune-control strong,
.leverage-control strong {
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06)),
    rgba(10, 132, 255, 0.62);
}

.master-tune-control,
.leverage-control {
  border-color: rgba(255, 204, 77, 0.26);
  background:
    linear-gradient(135deg, rgba(255, 204, 77, 0.16), rgba(10, 132, 255, 0.08)),
    rgba(18, 25, 32, 0.52);
}

.switch-track {
  width: 54px;
  height: 31px;
  border-color: rgba(255, 255, 255, 0.20);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(7, 12, 18, 0.60);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.24);
}

.switch-track::before {
  top: 3px;
  left: 3px;
  width: 23px;
  height: 23px;
  background:
    linear-gradient(180deg, #ffffff, #dfe7ef);
  box-shadow:
    0 2px 7px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.switch-control input:checked ~ .switch-track {
  border-color: rgba(48, 209, 88, 0.82);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 58%),
    #30d158;
}

.switch-control input:checked ~ .switch-track::before {
  transform: translateX(23px);
}

.info-tip {
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.10);
}

.info-tip::after,
.info-tip::before {
  border-color: rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.055)),
    rgba(24, 31, 39, 0.92);
  backdrop-filter: blur(30px) saturate(1.35);
}

.algo-machine {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.045)),
    rgba(18, 25, 32, 0.58);
}

.algo-machine::before,
.machine-scanline {
  opacity: 0.38;
}

.machine-board {
  border-color: rgba(255, 255, 255, 0.09);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(6, 11, 16, 0.24);
}

.algo-node {
  border-color: rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03)),
    rgba(15, 22, 29, 0.56);
}

.algo-node.is-current,
.algo-node[data-state="current"] {
  border-color: rgba(10, 132, 255, 0.78);
  background:
    linear-gradient(180deg, rgba(10, 132, 255, 0.26), rgba(255, 255, 255, 0.05)),
    rgba(18, 25, 32, 0.72);
}

.autopilot-readiness,
.ai-gate,
.ai-box,
.level-source,
.tune-source {
  border-color: rgba(255, 255, 255, 0.11);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(16, 23, 31, 0.45);
  backdrop-filter: blur(22px) saturate(1.25);
}

.tool-panel,
.cockpit-card,
.algo-machine,
.analysis-context-bar,
.active-trades-bar {
  position: relative;
}

.tool-panel::after,
.cockpit-card::after,
.algo-machine::after,
.analysis-context-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 36%, rgba(255, 255, 255, 0.11) 46%, transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 28%);
  opacity: 0;
  transition: opacity 180ms ease;
}

.tool-panel:hover::after,
.cockpit-card:hover::after,
.algo-machine:hover::after,
.analysis-context-bar:hover::after,
.tool-panel:focus-within::after,
.cockpit-card:focus-within::after {
  opacity: 0.58;
}

.slider-control.is-adjusting,
.switch-control.is-adjusting,
.stop-target-card.is-adjusting {
  box-shadow:
    0 0 0 1px rgba(100, 210, 255, 0.28),
    0 0 32px rgba(100, 210, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.watchlist,
.positions,
.journal,
.autopilot-log,
.profiles-table-wrap {
  background: rgba(255, 255, 255, 0.018);
}

.journal-row.signal-only.watch-only,
.watch-scope.watch-only,
.event-scope.watch-only {
  border-color: rgba(100, 210, 255, 0.24);
  background: rgba(100, 210, 255, 0.09);
}

.journal-row.signal-only.holding {
  border-color: rgba(255, 204, 77, 0.24);
}

.positive {
  color: #44e0a1;
}

.negative {
  color: #ff7a78;
}

.signal-badge.buy,
.journal-chip.buy,
.mini-trade-log-row.buy,
.mini-trade-log-row.profit {
  border-color: rgba(49, 209, 143, 0.42);
  color: #6ff0b6;
  background: rgba(49, 209, 143, 0.12);
}

.signal-badge.sell,
.journal-chip.sell,
.mini-trade-log-row.sell,
.mini-trade-log-row.loss,
.mini-trade-log-row.blocked {
  border-color: rgba(255, 98, 95, 0.42);
  color: #ff928f;
  background: rgba(255, 98, 95, 0.12);
}

.signal-badge.hold {
  border-color: rgba(255, 204, 77, 0.38);
  color: #ffd978;
  background: rgba(255, 204, 77, 0.12);
}

.levels {
  gap: 1px;
  border-color: rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.08);
}

.mini-trade-log,
.trade-director-tray {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.19), rgba(255, 255, 255, 0.07)),
    rgba(28, 36, 45, 0.72);
}

.mini-trade-log-row,
.director-card,
.director-queue-row {
  border-radius: 8px;
}

.profiles-table td:first-child,
.profiles-table td:last-child {
  border-radius: 8px;
}

.profile-badge {
  border-color: rgba(49, 209, 143, 0.30);
  color: #7ff3ba;
  background: rgba(49, 209, 143, 0.10);
}

.profile-badge.manual {
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(238, 243, 248, 0.62);
  background: rgba(255, 255, 255, 0.07);
}

@media (max-width: 1024px) {
  :root {
    --floating-panel-top: 221px;
  }

  .topbar {
    padding: 12px;
  }

  .topbar::before {
    display: none;
  }

  .market-strip {
    padding-top: 2px;
  }
}

@media (max-width: 820px) {
  body {
    padding-bottom: 24px;
  }

  .app-shell {
    width: min(100vw - 14px, 1700px);
  }

  .mini-trade-log,
  .mini-watchlist {
    position: static;
    width: min(100vw - 14px, 420px);
    margin: 8px auto 0;
    max-height: 230px;
    z-index: auto;
  }

  .mini-trade-log.is-floating,
  .mini-watchlist.is-floating {
    position: static;
    transform: none;
  }

  .mini-trade-log-body,
  .mini-watchlist-body {
    max-height: 168px;
  }

  .trade-director-tray {
    position: static;
    width: min(100vw - 14px, 780px);
    max-height: none;
    margin: 12px auto 16px;
    transform: none;
  }

  .trade-director-tray.is-floating {
    position: static;
    transform: none;
  }

  .cockpit-card,
  .tool-panel,
  .brain-strip,
  .algo-machine,
  .analysis-context-bar,
  .active-trades-bar {
    backdrop-filter: blur(24px) saturate(1.3);
  }

  .chart-wrap {
    margin-inline: 8px;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding: 50px 10px 10px;
  }

  .brand .mark {
    width: 42px;
    height: 42px;
  }

  .market-strip {
    gap: 8px;
  }

  .switch-control input:checked ~ .switch-track::before {
    transform: translateX(20px);
  }
}

.director-hero-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 48%, rgba(10, 132, 255, 0.18), transparent 34%),
    radial-gradient(circle at 18% 24%, rgba(49, 209, 143, 0.12), transparent 24%),
    radial-gradient(circle at 82% 78%, rgba(255, 159, 10, 0.10), transparent 24%),
    rgba(2, 7, 11, 0.30);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.director-hero-overlay.show {
  opacity: 1;
  visibility: visible;
}

.director-hero-stack {
  position: relative;
  width: min(780px, calc(100vw - 28px));
  min-height: min(610px, calc(100vh - 44px));
  display: grid;
  place-items: center;
  pointer-events: none;
}

.director-hero-card {
  --hero-accent: #31d18f;
  --hero-soft: rgba(49, 209, 143, 0.16);
  --hero-glow: rgba(49, 209, 143, 0.34);
  position: absolute;
  width: min(780px, 100%);
  color: #eef5f8;
  opacity: 0.78;
  pointer-events: none;
}

.director-hero-card.short {
  --hero-accent: #ff6b73;
  --hero-soft: rgba(255, 107, 115, 0.15);
  --hero-glow: rgba(255, 107, 115, 0.30);
}

.director-hero-card:nth-child(1) {
  z-index: 3;
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

.director-hero-card:nth-child(2) {
  z-index: 2;
  transform: translate(28px, 28px) scale(0.955);
}

.director-hero-card:nth-child(3) {
  z-index: 1;
  transform: translate(56px, 56px) scale(0.91);
}

.director-hero-card.active {
  pointer-events: auto;
}

.director-hero-card.queued .director-hero-frame {
  filter: saturate(0.82) brightness(0.76);
}

.director-hero-glow {
  position: absolute;
  inset: 10px;
  border-radius: 16px;
  background: var(--hero-glow);
  filter: blur(42px);
  opacity: 0.72;
}

.director-hero-frame {
  position: relative;
  display: grid;
  gap: 14px;
  padding: clamp(18px, 3vw, 28px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.05) 42%, rgba(255, 255, 255, 0.025)),
    radial-gradient(circle at 18% 0%, var(--hero-soft), transparent 34%),
    rgba(8, 14, 20, 0.88);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.46),
    0 0 0 1px rgba(255, 255, 255, 0.045),
    0 0 42px var(--hero-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(34px) saturate(1.55);
}

.director-hero-frame::before,
.director-hero-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.director-hero-frame::before {
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 6px);
  opacity: 0.42;
  mix-blend-mode: screen;
}

.director-hero-frame::after {
  width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), transparent);
  transform: translateX(-135%);
  animation: directorHeroSweep 2.8s ease-in-out infinite;
}

.director-hero-card.is-new.active .director-hero-frame {
  animation: directorHeroFlash 980ms ease-out 1;
}

.director-hero-top,
.director-hero-command,
.director-hero-exec,
.director-hero-levels,
.director-hero-reasons,
.director-hero-risk,
.director-hero-actions,
.director-hero-next,
.director-hero-frame p {
  position: relative;
  z-index: 1;
}

.director-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(238, 245, 248, 0.68);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.director-hero-top b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 8px;
  color: #06110f;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent 50%),
    var(--hero-accent);
  font-size: 12px;
}

.director-hero-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.director-hero-badges small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(238, 245, 248, 0.62);
  font-size: 11px;
  font-weight: 740;
}

.director-hero-command {
  display: grid;
  gap: 5px;
}

.director-hero-command small {
  color: var(--hero-accent);
  font-size: 13px;
  font-weight: 860;
}

.director-hero-command strong {
  overflow-wrap: anywhere;
  font-size: clamp(42px, 8vw, 82px);
  line-height: 0.88;
  font-weight: 820;
  color: #ffffff;
  text-shadow: 0 0 22px var(--hero-glow);
}

.director-hero-command span {
  overflow-wrap: anywhere;
  color: rgba(238, 245, 248, 0.82);
  font-size: clamp(17px, 3vw, 28px);
  font-weight: 760;
}

.director-hero-exec {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.11);
}

.director-hero-exec div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px 10px;
  background: rgba(6, 12, 18, 0.72);
}

.director-hero-exec span,
.director-hero-levels span,
.director-hero-reasons span,
.director-hero-risk span,
.director-hero-next {
  color: rgba(238, 245, 248, 0.62);
  font-size: 11px;
  font-weight: 720;
}

.director-hero-exec strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ffffff;
  font-size: 15px;
  font-weight: 820;
}

.director-hero-levels,
.director-hero-reasons,
.director-hero-risk {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.director-hero-levels span,
.director-hero-reasons span,
.director-hero-risk span {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(238, 245, 248, 0.80);
}

.director-hero-levels span:first-child {
  border-color: color-mix(in srgb, var(--hero-accent) 42%, transparent);
  background: var(--hero-soft);
}

.director-hero-risk span {
  border-color: rgba(255, 159, 10, 0.32);
  background: rgba(255, 159, 10, 0.10);
  color: #ffe2ad;
}

.director-hero-frame p {
  margin: 0;
  color: rgba(238, 245, 248, 0.78);
  font-size: 14px;
  line-height: 1.48;
}

.director-hero-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.director-hero-actions button {
  min-height: 54px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 880;
}

.director-hero-made {
  color: #06110f;
  border-color: rgba(49, 209, 143, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 55%),
    #31d18f;
}

.director-hero-decline {
  color: #ffe8eb;
  border-color: rgba(255, 107, 115, 0.44);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 55%),
    rgba(255, 107, 115, 0.22);
}

.director-hero-next {
  justify-self: start;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.06);
}

@keyframes directorHeroFlash {
  0% {
    box-shadow:
      0 0 0 5px rgba(255, 255, 255, 0.38),
      0 0 0 14px var(--hero-glow),
      0 42px 110px rgba(0, 0, 0, 0.58),
      0 0 80px var(--hero-glow),
      inset 0 1px 0 rgba(255, 255, 255, 0.40);
    filter: brightness(1.42) saturate(1.45);
  }
  100% {
    filter: brightness(1) saturate(1);
  }
}

@keyframes directorHeroSweep {
  0%, 48% {
    transform: translateX(-135%);
    opacity: 0;
  }
  55% {
    opacity: 0.72;
  }
  100% {
    transform: translateX(420%);
    opacity: 0;
  }
}

@media (max-width: 760px) {
  .director-hero-overlay {
    align-items: start;
    padding: 76px 12px 18px;
    overflow: hidden;
  }

  .director-hero-stack {
    align-items: start;
    min-height: calc(100vh - 94px);
  }

  .director-hero-card:nth-child(2) {
    transform: translate(12px, 18px) scale(0.965);
  }

  .director-hero-card:nth-child(3) {
    transform: translate(24px, 36px) scale(0.93);
  }

  .director-hero-frame {
    max-height: calc(100vh - 106px);
    gap: 10px;
    overflow-y: auto;
    padding: 16px;
  }

  .director-hero-command strong {
    font-size: clamp(34px, 14vw, 54px);
  }

  .director-hero-command span {
    font-size: 16px;
  }

  .director-hero-exec {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .director-hero-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .director-hero-card.is-new.active .director-hero-frame,
  .director-hero-frame::after {
    animation: none;
  }
}

/* Tahoe 26.4.1 coherence layer: one visual system across JBOT */
:root {
  --tahoe-radius: 8px;
  --tahoe-control-radius: 7px;
  --tahoe-control-height: 38px;
  --tahoe-material:
    linear-gradient(180deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.055) 48%, rgba(255, 255, 255, 0.032)),
    rgba(28, 36, 44, 0.58);
  --tahoe-material-strong:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.075) 46%, rgba(255, 255, 255, 0.04)),
    rgba(31, 40, 49, 0.76);
  --tahoe-material-soft:
    linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.028)),
    rgba(17, 24, 31, 0.46);
  --tahoe-control:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.045)),
    rgba(24, 32, 40, 0.56);
  --tahoe-control-hover:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.065)),
    rgba(36, 46, 56, 0.72);
  --tahoe-field:
    linear-gradient(180deg, rgba(255, 255, 255, 0.115), rgba(255, 255, 255, 0.035)),
    rgba(12, 18, 24, 0.58);
  --tahoe-border: rgba(255, 255, 255, 0.16);
  --tahoe-border-soft: rgba(255, 255, 255, 0.095);
  --tahoe-shadow: 0 22px 68px rgba(5, 10, 16, 0.28);
  --tahoe-shadow-small: 0 12px 28px rgba(5, 10, 16, 0.18);
  --tahoe-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 520;
  line-height: 1.42;
}

h1,
h2,
h3,
strong,
button,
input,
select {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

:where(.brand span, .panel-head span, .stats-row span, .paper-summary span, label span, .levels dt, small, dt) {
  color: var(--muted);
  font-weight: 650;
}

:where(h1, h2, .panel-head h2, .machine-head strong, .director-handle strong, .chart-tabs-head span) {
  color: rgba(255, 255, 255, 0.94);
  font-weight: 760;
}

:where(
  .topbar,
  .cockpit-card,
  .tool-panel,
  .brain-strip,
  .algo-machine,
  .analysis-context-bar,
  .active-trades-bar,
  .chart-tabs-panel,
  .pump-card,
  .profiles-panel,
  .advanced-panel,
  .audit-panel,
  .mini-trade-log,
  .mini-watchlist,
  .trade-director-tray,
  .director-hero-frame
) {
  border: 1px solid var(--tahoe-border);
  border-radius: var(--tahoe-radius);
  background: var(--tahoe-material);
  box-shadow: var(--tahoe-shadow), var(--tahoe-highlight), inset 0 -1px 0 rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(34px) saturate(1.45);
}

:where(
  .panel-head,
  .mini-trade-log-head,
  .mini-watchlist-head,
  .director-handle,
  .chart-tabs-head
) {
  border-bottom: 1px solid var(--tahoe-border-soft);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.032)),
    rgba(255, 255, 255, 0.034);
}

:where(
  button,
  .small-button,
  .icon-button,
  .tab-button,
  .filter-chip,
  .watch-trade-button,
  .watch-remove-button,
  .mini-watch-actions button,
  .director-actions button,
  .director-controls button,
  .director-hero-actions button
) {
  min-height: var(--tahoe-control-height);
  border: 1px solid var(--tahoe-border);
  border-radius: var(--tahoe-control-radius);
  color: rgba(250, 253, 255, 0.92);
  background: var(--tahoe-control);
  box-shadow: var(--tahoe-shadow-small), var(--tahoe-highlight);
  font-weight: 720;
  text-transform: none;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}

:where(
  button,
  .small-button,
  .icon-button,
  .tab-button,
  .filter-chip,
  .watch-trade-button,
  .watch-remove-button,
  .director-actions button,
  .director-controls button
):hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: var(--tahoe-control-hover);
}

:where(.primary, .tab-button.active, .watch-trade-button.active, .director-hero-made) {
  border-color: rgba(10, 132, 255, 0.82);
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent 48%),
    linear-gradient(180deg, #3aa2ff, #007aff);
  box-shadow:
    0 14px 30px rgba(10, 132, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

:where(input, select, textarea) {
  min-height: var(--tahoe-control-height);
  border: 1px solid var(--tahoe-border);
  border-radius: var(--tahoe-control-radius);
  color: rgba(250, 253, 255, 0.94);
  background: var(--tahoe-field);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(22px) saturate(1.25);
}

:where(input, select, textarea):focus {
  border-color: rgba(10, 132, 255, 0.82);
  box-shadow:
    0 0 0 3px rgba(10, 132, 255, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

:where(input[readonly], .position-editor input[readonly]) {
  color: rgba(250, 253, 255, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018)),
    rgba(8, 13, 18, 0.50);
}

:where(
  .brain-metrics div,
  .stats-row div,
  .paper-summary div,
  .autopilot-stats div,
  .performance-grid div,
  .levels div,
  .position-editor,
  .position-row,
  .watch-item,
  .journal-row,
  .autopilot-event,
  .audit-row,
  .profile-save-form,
  .profiles-table td,
  .slider-control,
  .switch-control,
  .toggle-line,
  .direction-control,
  .stop-target-card,
  .chart-tab,
  .mini-trade-log-row,
  .mini-watch-row,
  .director-card,
  .director-queue-row,
  .director-order-grid div,
  .director-card li,
  .director-tags span,
  .director-risk span,
  .pump-card,
  .pump-stat,
  .pump-level,
  .pump-risk,
  .ai-gate,
  .ai-box,
  .autopilot-readiness,
  .level-source,
  .tune-source
) {
  border-color: var(--tahoe-border-soft);
  border-radius: var(--tahoe-radius);
  background: var(--tahoe-material-soft);
  box-shadow: var(--tahoe-highlight);
  backdrop-filter: blur(24px) saturate(1.25);
}

:where(.paper-summary, .performance-grid, .levels, .director-order-grid) {
  gap: 1px;
  border: 1px solid var(--tahoe-border-soft);
  border-radius: var(--tahoe-radius);
  background: rgba(255, 255, 255, 0.075);
  overflow: hidden;
}

:where(.tabbar, .chart-zoom, .journal-toolbar, .floating-actions, .button-row, .panel-actions) {
  border: 1px solid var(--tahoe-border-soft);
  border-radius: var(--tahoe-radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(10, 16, 22, 0.40);
  box-shadow: var(--tahoe-highlight);
  backdrop-filter: blur(18px) saturate(1.2);
}

:where(
  .state-pill,
  .autopilot-badge,
  .signal-badge,
  .journal-chip,
  .analysis-context-pill,
  .director-status,
  .watch-scope,
  .event-scope,
  .journal-scope,
  .profile-badge,
  .chart-tab span,
  .active-trade-side,
  .active-trade-context,
  .active-trade-fill-count
) {
  border-radius: var(--tahoe-control-radius);
  font-weight: 760;
  letter-spacing: 0;
  text-transform: none;
}

:where(.settings-grid input[type="range"], .stop-target-card input[type="range"], .ticket-leverage-control input[type="range"]) {
  height: 34px;
  min-height: 34px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

:where(.settings-grid input[type="range"], .stop-target-card input[type="range"], .ticket-leverage-control input[type="range"])::-webkit-slider-runnable-track {
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--apple-accent) 0 var(--slider-fill), rgba(255, 255, 255, 0.13) var(--slider-fill) 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.22);
}

:where(.settings-grid input[type="range"], .stop-target-card input[type="range"], .ticket-leverage-control input[type="range"])::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  margin-top: -8px;
  border: 1px solid rgba(255, 255, 255, 0.70);
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #dfe8f2);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

:where(.settings-grid input[type="range"], .stop-target-card input[type="range"], .ticket-leverage-control input[type="range"])::-moz-range-track {
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

:where(.settings-grid input[type="range"], .stop-target-card input[type="range"], .ticket-leverage-control input[type="range"])::-moz-range-progress {
  height: 10px;
  border-radius: 999px;
  background: var(--apple-accent);
}

:where(.settings-grid input[type="range"], .stop-target-card input[type="range"], .ticket-leverage-control input[type="range"])::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.70);
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #dfe8f2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.34);
}

.switch-track {
  width: 54px;
  height: 31px;
  border-radius: 999px;
}

.active-trade,
.chart-tab,
.watch-item,
.position-row,
.journal-row,
.mini-trade-log-row,
.mini-watch-row,
.director-card,
.director-queue-row {
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 140ms ease;
}

.active-trade:hover,
.chart-tab:hover,
.watch-item:hover,
.position-row:hover,
.journal-row:hover,
.mini-trade-log-row:hover,
.mini-watch-row:hover,
.director-card:hover,
.director-queue-row:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: var(--tahoe-material);
}

.active-trade.selected,
.chart-tab.selected,
.watch-item.active,
.mini-watch-row.selected {
  border-color: rgba(10, 132, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(10, 132, 255, 0.22), rgba(255, 255, 255, 0.055)),
    rgba(22, 31, 40, 0.70);
  box-shadow:
    0 0 0 1px rgba(10, 132, 255, 0.16),
    var(--tahoe-shadow-small),
    var(--tahoe-highlight);
}

.mini-watch-actions button {
  color: #ffffff;
  border-color: rgba(10, 132, 255, 0.68);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.30), transparent 48%),
    var(--apple-accent);
}

.mini-watch-actions button[data-action="remove"],
.director-hero-decline {
  color: #fff4f4;
  border-color: rgba(255, 98, 95, 0.48);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 54%),
    rgba(255, 98, 95, 0.26);
}

.positive,
.active-trade-pnl.positive strong {
  color: #59e6aa;
}

.negative,
.active-trade-pnl.negative strong {
  color: #ff8582;
}

.chart-wrap,
#priceCanvas {
  border-radius: var(--tahoe-radius);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.035);
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.36);
  background-clip: padding-box;
}

@media (max-width: 820px) {
  :where(
    .topbar,
    .cockpit-card,
    .tool-panel,
    .brain-strip,
    .algo-machine,
    .analysis-context-bar,
    .active-trades-bar,
    .chart-tabs-panel,
    .mini-trade-log,
    .mini-watchlist,
    .trade-director-tray
  ) {
    backdrop-filter: blur(24px) saturate(1.30);
  }
}

/* Tahoe chrome cleanup: native-feeling type, no logo, unframed top bar */
:root {
  --apple-font-text: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, sans-serif;
  --apple-font-display: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, sans-serif;
}

html,
body,
button,
input,
select,
textarea {
  font-family: var(--apple-font-text);
  font-optical-sizing: auto;
}

body {
  font-size: 14px;
  font-weight: 450;
  line-height: 1.36;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
.brand h1,
.panel-head h2,
.machine-head strong,
.brain-lead strong,
.director-handle strong,
.chart-tabs-head span,
.cockpit-card strong,
.pnl-card-copy strong {
  font-family: var(--apple-font-display);
  font-weight: 650;
  letter-spacing: 0;
}

:where(strong, button, input, select, .tab-button, .filter-chip, .state-pill, .autopilot-badge) {
  font-weight: 620;
}

.topbar,
:where(.topbar) {
  min-height: 0;
  margin: 0 0 12px;
  padding: 4px 0 10px;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.topbar::before,
.topbar::after,
.brand .mark,
.mark {
  display: none !important;
}

.brand {
  gap: 0;
  min-width: 290px;
}

.brand-copy {
  gap: 8px;
}

.brand h1 {
  font-size: 22px;
  line-height: 1.04;
}

.brand-subline {
  gap: 8px;
}

.brand-subline b,
.brand-subline #statusText {
  font-weight: 560;
}

.xp-lane {
  border-color: rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.115), rgba(255, 255, 255, 0.032)),
    rgba(18, 24, 31, 0.48);
  box-shadow:
    0 10px 24px rgba(5, 10, 16, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.xp-line span,
.xp-line b,
.xp-recent {
  font-weight: 620;
}

.xp-line strong {
  font-weight: 650;
}

@media (max-width: 1024px) {
  .topbar,
  :where(.topbar) {
    padding-top: 2px;
  }
}

@media (max-width: 820px) {
  .topbar,
  :where(.topbar) {
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .brand {
    min-width: 0;
  }
}

/* Default dock for activity components */
.market-dock {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(360px, 1.08fr);
  align-items: start;
  gap: 12px;
  margin: 0 0 12px;
}

.market-dock .mini-trade-log,
.market-dock .mini-watchlist {
  position: relative;
  inset: auto;
  width: 100%;
  max-width: none;
  margin: 0;
  transform: none;
  z-index: 2;
}

.market-dock .mini-trade-log.collapsed,
.market-dock .mini-watchlist.collapsed {
  width: 100%;
}

.market-dock .mini-trade-log-body,
.market-dock .mini-watchlist-body {
  max-height: 236px;
}

.mini-trade-log.is-floating,
.mini-watchlist.is-floating {
  position: fixed;
  z-index: 64;
  width: min(330px, calc(100vw - 28px));
  margin: 0;
}

.mini-watchlist.is-floating {
  width: min(360px, calc(100vw - 28px));
}

.mini-trade-log.is-floating.collapsed {
  width: 286px;
}

.mini-watchlist.is-floating.collapsed {
  width: 302px;
}

@media (max-width: 1024px) {
  .market-dock {
    grid-template-columns: 1fr;
  }

  .market-dock .mini-trade-log-body,
  .market-dock .mini-watchlist-body {
    max-height: 190px;
  }
}

@media (max-width: 820px) {
  .market-dock {
    gap: 8px;
    margin-bottom: 10px;
  }

  .mini-trade-log.is-floating,
  .mini-watchlist.is-floating {
    position: static;
    width: 100%;
    transform: none;
  }
}

/* Header title/status row */
.brand-copy > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  white-space: nowrap;
}

.brand h1 {
  flex: 0 0 auto;
}

.brand-subline {
  display: inline-flex;
  align-items: baseline;
  flex: 0 0 auto;
  gap: 8px;
  min-width: max-content;
  white-space: nowrap;
}

.brand-subline b::after {
  content: none !important;
  display: none !important;
}

.brand-subline b,
.brand-subline #statusText {
  white-space: nowrap;
}

@media (max-width: 520px) {
  .brand-copy > div:first-child {
    gap: 9px;
  }

  .brand h1 {
    font-size: 20px;
  }

  .brand-subline b,
  .brand-subline #statusText {
    font-size: 11px;
  }
}

/* JBOT consumer shell and local landing page */
body[data-shell-view="landing"] {
  padding-bottom: 0;
  overflow-x: hidden;
  color: #111827;
  background: #eef6ff;
}

body[data-shell-view="landing"] .app-shell,
body[data-shell-view="landing"] .market-field-canvas,
body[data-shell-view="landing"] #tradeDirectorTray,
body[data-shell-view="landing"] #directorHeroOverlay,
body[data-shell-view="landing"] #advancedSettingsOverlay {
  display: none !important;
}

body[data-shell-view="app"] .landing-shell {
  display: none !important;
}

.landing-shell {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  font-family: var(--apple-font-text);
}

.landing-scene-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100vw;
  height: 100vh;
}

.landing-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.28) 46%, rgba(238, 246, 255, 0.88)),
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.58), transparent 34%);
}

.landing-menu {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 16px 0 10px;
}

.landing-wordmark,
.landing-menu a {
  color: inherit;
  text-decoration: none;
}

.landing-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}

.landing-wordmark strong {
  font-family: var(--apple-font-display);
  font-size: 22px;
  font-weight: 720;
}

.landing-wordmark span,
.landing-menu-links a,
.landing-signin small,
.landing-feature-strip p,
.landing-footer {
  color: rgba(17, 24, 39, 0.66);
}

.landing-menu-links {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: 0 18px 50px rgba(37, 99, 235, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(22px) saturate(1.25);
}

.landing-menu-links a,
.landing-menu-links button,
.landing-actions a,
.landing-actions button,
.landing-signin button {
  min-height: 38px;
  border-radius: 8px;
}

.landing-menu-links a,
.landing-menu-links button {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 0;
  color: rgba(17, 24, 39, 0.78);
  background: transparent;
  font-weight: 650;
}

.landing-menu-links button {
  color: #fff;
  background: #111827;
}

.landing-hero {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: calc(100svh - 84px);
  width: min(1040px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 66px 0 34px;
  text-align: center;
}

.landing-kicker {
  margin: 0 0 12px;
  color: rgba(0, 113, 227, 0.90);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.landing-hero h1 {
  margin: 0;
  color: #0a0f1a;
  font-family: var(--apple-font-display);
  font-size: clamp(74px, 14vw, 178px);
  font-weight: 760;
  line-height: 0.86;
  letter-spacing: 0;
}

.landing-copy {
  width: min(700px, 100%);
  margin: 24px auto 0;
  color: rgba(17, 24, 39, 0.74);
  font-size: clamp(19px, 2.8vw, 30px);
  font-weight: 520;
  line-height: 1.18;
}

.landing-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.landing-actions a,
.landing-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid rgba(17, 24, 39, 0.10);
  text-decoration: none;
  font-weight: 720;
}

.landing-primary,
.landing-signin button {
  color: #fff;
  background: linear-gradient(180deg, #1b74ff, #0a63d8);
  box-shadow: 0 18px 34px rgba(0, 113, 227, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.landing-secondary {
  color: rgba(17, 24, 39, 0.80);
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(16px) saturate(1.2);
}

.landing-signin {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 10px;
  width: min(740px, 100%);
  margin-top: 28px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 18px 54px rgba(16, 24, 40, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(26px) saturate(1.30);
  text-align: left;
}

.landing-signin-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.landing-signin-head strong {
  color: #111827;
  font-size: 15px;
}

.landing-signin label {
  gap: 6px;
}

.landing-signin label span {
  color: rgba(17, 24, 39, 0.64);
  font-size: 12px;
  font-weight: 680;
}

.landing-signin input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 8px;
  padding: 0 12px;
  color: #111827;
  background: rgba(255, 255, 255, 0.72);
}

.landing-signin button {
  min-width: 110px;
  border-color: rgba(0, 113, 227, 0.28);
}

.landing-signin small {
  grid-column: 1 / -1;
  font-size: 12px;
}

.landing-feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: min(1040px, calc(100vw - 32px));
  margin: 0 auto 22px;
}

.landing-feature-strip > div {
  min-height: 118px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: 0 16px 40px rgba(16, 24, 40, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px) saturate(1.25);
}

.landing-feature-strip span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-bottom: 12px;
  border-radius: 50%;
  color: #fff;
  background: #111827;
  font-weight: 760;
}

.landing-feature-strip strong {
  display: block;
  color: #111827;
  font-size: 18px;
}

.landing-feature-strip p {
  margin: 6px 0 0;
  line-height: 1.35;
}

.landing-pricing {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(1040px, calc(100vw - 32px));
  margin: 0 auto 22px;
}

.landing-plan-card {
  display: grid;
  gap: 10px;
  min-height: 210px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  color: #111827;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 16px 40px rgba(16, 24, 40, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px) saturate(1.25);
}

.landing-plan-card.featured {
  border-color: rgba(0, 113, 227, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.52)),
    rgba(0, 113, 227, 0.10);
}

.landing-plan-card span {
  width: fit-content;
  border-radius: 999px;
  color: #fff;
  background: #111827;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.landing-plan-card strong {
  font-size: 22px;
  line-height: 1;
}

.landing-plan-card b {
  font-size: 34px;
  line-height: 1;
}

.landing-plan-card p {
  margin: 0;
  line-height: 1.38;
}

.landing-plan-card button {
  align-self: end;
  min-height: 40px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 8px;
  color: #fff;
  background: #111827;
  font-weight: 850;
}

.landing-footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  width: min(1040px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 24px;
  font-size: 12px;
}

.landing-footer a {
  color: inherit;
  text-decoration: none;
}

.app-sign-out {
  flex: 0 0 auto;
}

.simple-command-center {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(360px, 1.35fr) minmax(290px, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.035)),
    rgba(13, 18, 24, 0.62);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(28px) saturate(1.3);
}

.simple-command-copy,
.simple-command-actions,
.simple-command-stats,
.simple-starter-controls {
  display: flex;
  align-items: center;
}

.simple-command-copy {
  gap: 10px;
  min-width: 0;
}

.simple-command-copy strong {
  display: block;
  font-size: 18px;
}

.simple-command-copy small {
  display: block;
  color: var(--muted);
}

.simple-starter-controls {
  display: grid;
  grid-template-columns: minmax(110px, 0.75fr) auto minmax(130px, 1fr) auto;
  gap: 8px;
  min-width: 0;
}

.simple-starter-controls label {
  min-width: 0;
  gap: 4px;
}

.simple-starter-controls span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.simple-starter-controls input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border-radius: 8px;
}

.simple-starter-controls #simpleWatchSymbolInput {
  text-transform: uppercase;
}

.simple-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.simple-status-pill.paused {
  color: #c9d4df;
  background: rgba(255, 255, 255, 0.10);
}

.simple-status-pill.active {
  color: #042017;
  background: #59e6aa;
}

.simple-command-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 8px;
}

.simple-command-stats div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.simple-command-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
}

.simple-command-stats strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-size: clamp(15px, 1.7vw, 22px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.simple-command-actions {
  justify-content: flex-end;
  gap: 8px;
}

.simple-command-actions button {
  min-width: 78px;
}

.jbot-operating-strip {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
  gap: 12px;
  align-items: stretch;
  margin: 0 0 12px;
}

.simple-engine-strip,
.jbot-thinking-panel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(13, 18, 24, 0.62);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(28px) saturate(1.3);
}

.simple-engine-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.engine-step {
  position: relative;
  min-width: 0;
  min-height: 74px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.engine-step::after {
  content: "";
  position: absolute;
  inset: auto 10px 8px 10px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.engine-step.active::after,
.engine-step.buy::after {
  background: #59e6aa;
}

.engine-step.sell::after,
.engine-step.blocked::after {
  background: #ff8582;
}

.engine-step.watching::after {
  background: #8ab4ff;
}

.engine-step span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-bottom: 8px;
  border-radius: 50%;
  color: #071114;
  background: #d7f8ff;
  font-size: 11px;
  font-weight: 820;
}

.engine-step strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.engine-step small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jbot-thinking-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.thinking-head {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.thinking-head span {
  color: #8ab4ff;
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.thinking-head strong {
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thinking-head small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.thinking-dials {
  display: grid;
  gap: 10px;
}

.thinking-dials label {
  gap: 6px;
}

.thinking-dials label > span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.thinking-dials b {
  color: var(--text);
}

.thinking-dials input[type="range"] {
  width: 100%;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.thinking-dials input[type="range"]::-webkit-slider-runnable-track {
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0a84ff 0 var(--slider-fill), rgba(255, 255, 255, 0.13) var(--slider-fill) 100%);
}

.thinking-dials input[type="range"]::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -7px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #dfe8f2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.34);
}

.thinking-dials input[type="range"]::-moz-range-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

.thinking-dials input[type="range"]::-moz-range-progress {
  height: 9px;
  border-radius: 999px;
  background: #0a84ff;
}

.thinking-dials input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #dfe8f2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.34);
}

body.consumer-mode .market-strip,
body.consumer-mode .brain-strip,
body.consumer-mode .algo-machine,
body.consumer-mode .side-stack,
body.consumer-mode .journal-panel,
body.consumer-mode .audit-panel,
body.consumer-mode .profiles-panel,
body.consumer-mode .portfolio-tabs,
body.consumer-mode .stats-row,
body.consumer-mode .command-card,
body.consumer-mode .cockpit .dial-card:not(.pnl-card),
body.consumer-mode .tab-button[data-tab-target="dials"],
body.consumer-mode .settings-panel.tab-panel {
  display: none !important;
}

body.consumer-mode:not(.advanced-unlocked) #simpleAdvancedButton {
  display: none !important;
}

body.consumer-mode .workspace {
  grid-template-columns: 1fr;
}

body.consumer-mode .main-stack {
  min-width: 0;
}

body.consumer-mode .cockpit {
  grid-template-columns: minmax(220px, 0.7fr) minmax(320px, 1.3fr);
  align-items: stretch;
}

body.consumer-mode .cockpit-card {
  min-height: 126px;
}

body.consumer-mode .cockpit .pnl-card {
  order: -1;
}

body.consumer-mode .portfolio-tabs {
  margin-top: 12px;
}

body.consumer-mode .tabbar {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
}

body.consumer-mode .market-dock {
  grid-template-columns: minmax(300px, 0.86fr) minmax(340px, 1.14fr);
}

body.consumer-mode .chart-panel .panel-head h2 {
  font-size: clamp(18px, 2vw, 26px);
}

body.consumer-mode .chart-wrap {
  min-height: clamp(360px, 48vh, 640px);
}

@media (max-width: 980px) {
  .landing-menu,
  .landing-menu-links,
  .landing-signin,
  .simple-command-center,
  .jbot-operating-strip,
  body.consumer-mode .cockpit,
  body.consumer-mode .market-dock {
    grid-template-columns: 1fr;
  }

  .landing-menu {
    display: grid;
    align-items: stretch;
  }

  .landing-menu-links {
    display: grid;
  }

  .landing-signin {
    align-items: stretch;
  }

  .simple-command-actions {
    justify-content: stretch;
  }

  .simple-command-actions button {
    flex: 1 1 0;
  }

  .simple-starter-controls,
  .simple-engine-strip {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .landing-menu-links a {
    display: none;
  }

  .landing-hero {
    min-height: auto;
    padding-top: 54px;
  }

  .landing-copy {
    font-size: 19px;
  }

  .landing-feature-strip {
    grid-template-columns: 1fr;
  }

  .simple-command-stats {
    grid-template-columns: 1fr;
  }

  .simple-starter-controls,
  .simple-engine-strip {
    grid-template-columns: 1fr;
  }

  body.consumer-mode .chart-wrap {
    min-height: 330px;
  }
}

.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
}

.tutorial-overlay[hidden] {
  display: none !important;
}

.tutorial-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 0;
  background: rgba(4, 8, 14, 0.60);
  backdrop-filter: blur(18px) saturate(1.18);
}

.tutorial-card {
  position: relative;
  width: min(520px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05)),
    rgba(16, 22, 30, 0.94);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.tutorial-progress {
  height: 5px;
  background: rgba(255, 255, 255, 0.10);
}

.tutorial-progress span {
  display: block;
  width: 20%;
  height: 100%;
  background: linear-gradient(90deg, #59e6aa, #0a84ff);
}

.tutorial-copy {
  display: grid;
  gap: 10px;
  padding: 24px 24px 18px;
}

.tutorial-copy span {
  color: #8ab4ff;
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.tutorial-copy h2 {
  font-size: clamp(24px, 5vw, 38px);
}

.tutorial-copy p {
  margin: 0;
  color: #c8d2dd;
  font-size: 16px;
  line-height: 1.42;
}

.tutorial-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 24px 24px;
  flex-wrap: wrap;
}

/* JBOT arcade cockpit layer */
:root {
  --game-ink: #05070b;
  --game-glass: rgba(8, 13, 19, 0.72);
  --game-line: rgba(146, 236, 255, 0.20);
  --game-line-strong: rgba(146, 236, 255, 0.42);
  --game-blue: #4cb3ff;
  --game-cyan: #66f2ff;
  --game-green: #54f0a2;
  --game-red: #ff5f7e;
  --game-gold: #ffd76b;
  --game-violet: #b186ff;
  --jbot-accent: var(--game-cyan);
  --jbot-secondary: var(--game-blue);
}

body.consumer-mode[data-shell-view="app"] {
  background:
    linear-gradient(90deg, rgba(102, 242, 255, 0.055) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.038) 0 1px, transparent 1px 100%),
    linear-gradient(150deg, rgba(76, 179, 255, 0.22), transparent 34%),
    linear-gradient(226deg, rgba(255, 215, 107, 0.14), transparent 42%),
    linear-gradient(180deg, #111a24 0%, #071018 44%, #05070b 100%);
  background-attachment: fixed;
  background-size: 54px 54px, 54px 54px, auto, auto, auto;
}

body.consumer-mode[data-shell-view="app"]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(2, 6, 11, 0.72), rgba(5, 9, 14, 0.42) 46%, rgba(2, 5, 9, 0.74) 100%),
    linear-gradient(115deg, transparent 0 34%, rgba(102, 242, 255, 0.10) 34.2% 34.7%, transparent 35% 100%),
    linear-gradient(245deg, transparent 0 58%, rgba(255, 215, 107, 0.08) 58.2% 58.6%, transparent 59% 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 18%, rgba(0, 0, 0, 0.22) 100%);
  opacity: 0.92;
}

body.consumer-mode[data-shell-view="app"]::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 5px);
  mix-blend-mode: screen;
  opacity: 0.18;
}

body.consumer-mode[data-jbot-mood="buy"],
.jbot-avatar-panel[data-mood="buy"],
.jbot-avatar-panel[data-mood="profit"] {
  --jbot-accent: var(--game-green);
  --jbot-secondary: var(--game-cyan);
}

body.consumer-mode[data-jbot-mood="sell"],
.jbot-avatar-panel[data-mood="sell"],
.jbot-avatar-panel[data-mood="loss"] {
  --jbot-accent: var(--game-red);
  --jbot-secondary: var(--game-gold);
}

body.consumer-mode[data-jbot-mood="blocked"],
.jbot-avatar-panel[data-mood="blocked"] {
  --jbot-accent: var(--game-gold);
  --jbot-secondary: var(--game-red);
}

body.consumer-mode[data-jbot-mood="thinking"],
.jbot-avatar-panel[data-mood="thinking"] {
  --jbot-accent: var(--game-cyan);
  --jbot-secondary: var(--game-violet);
}

body.consumer-mode .app-shell {
  position: relative;
}

body.consumer-mode .app-shell {
  z-index: 3;
}

body.consumer-mode .market-field-canvas {
  position: fixed;
  opacity: 0.26;
  filter: brightness(0.46) saturate(1.55) contrast(1.18);
}

body.consumer-mode .cockpit {
  display: none !important;
}

body.consumer-mode .topbar {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.consumer-mode .brand h1 {
  color: #ffffff;
  font-size: clamp(24px, 3vw, 42px);
  font-weight: 900;
  text-shadow:
    0 0 24px rgba(102, 242, 255, 0.34),
    0 2px 0 rgba(0, 0, 0, 0.28);
}

body.consumer-mode .brand {
  flex: 0 1 auto;
  min-width: 0;
}

body.consumer-mode .brand-copy {
  width: min(430px, 100%);
}

body.consumer-mode .brand-subline {
  color: rgba(233, 246, 255, 0.76);
  min-width: 0;
}

body.consumer-mode .simple-command-center,
body.consumer-mode .jbot-avatar-panel,
body.consumer-mode .simple-engine-strip,
body.consumer-mode .jbot-thinking-panel,
body.consumer-mode .market-dock > aside,
body.consumer-mode .cockpit-card,
body.consumer-mode .chart-panel,
body.consumer-mode .analysis-context-bar,
body.consumer-mode .active-trades-bar,
body.consumer-mode .chart-tabs-panel,
body.consumer-mode .trade-director-tray {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--game-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.035) 40%, rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, rgba(102, 242, 255, 0.08), rgba(255, 215, 107, 0.032) 44%, rgba(255, 95, 126, 0.045)),
    var(--game-glass);
  box-shadow:
    0 22px 70px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.045) inset,
    0 0 38px rgba(102, 242, 255, 0.08);
  backdrop-filter: blur(30px) saturate(1.55);
}

body.consumer-mode .simple-command-center::after,
body.consumer-mode .simple-engine-strip::after,
body.consumer-mode .jbot-thinking-panel::after,
body.consumer-mode .chart-panel::after,
body.consumer-mode .active-trades-bar::after,
body.consumer-mode .market-dock > aside::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, var(--jbot-accent), transparent 22%, transparent 78%, var(--jbot-secondary)) top left / 100% 1px no-repeat,
    linear-gradient(90deg, var(--jbot-secondary), transparent 18%, transparent 82%, var(--jbot-accent)) bottom left / 100% 1px no-repeat;
  opacity: 0.74;
}

.jbot-operating-strip {
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr) minmax(320px, 390px);
  align-items: stretch;
}

.jbot-avatar-panel {
  display: grid;
  grid-template-columns: minmax(148px, 0.92fr) minmax(0, 1fr);
  gap: 10px;
  min-height: 206px;
  padding: 12px;
  isolation: isolate;
}

.jbot-avatar-panel::before {
  content: "";
  position: absolute;
  inset: -40% -10%;
  z-index: -1;
  background: linear-gradient(115deg, transparent 36%, color-mix(in srgb, var(--jbot-accent) 34%, transparent) 48%, transparent 60%);
  opacity: 0.42;
  transform: translateX(-22%);
  animation: jbotPanelSweep 5.8s linear infinite;
}

.jbot-avatar-stage {
  position: relative;
  min-width: 0;
  min-height: 188px;
  display: grid;
  place-items: end center;
}

.jbot-aura {
  position: absolute;
  inset: 15px 2px 4px;
  border: 1px solid color-mix(in srgb, var(--jbot-accent) 44%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--jbot-accent) 12%, transparent) 0 2px, transparent 2px 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--jbot-secondary) 10%, transparent) 0 2px, transparent 2px 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.012));
  background-size: 18px 18px, 18px 18px, auto;
  box-shadow:
    0 0 28px color-mix(in srgb, var(--jbot-accent) 24%, transparent),
    inset 0 0 26px rgba(255, 255, 255, 0.045);
  transform: perspective(420px) rotateX(58deg) translateY(30px);
}

.jbot-robot-shadow {
  position: absolute;
  left: 18%;
  right: 10%;
  bottom: 2px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.44);
  filter: blur(7px);
}

#jbotRobotImage {
  position: relative;
  z-index: 2;
  width: min(220px, 138%);
  max-height: 238px;
  object-fit: contain;
  object-position: bottom center;
  transform-origin: 50% 92%;
  animation: jbotFloat 4.2s ease-in-out infinite;
  filter:
    saturate(1.12)
    drop-shadow(0 16px 24px rgba(0, 0, 0, 0.46))
    drop-shadow(0 0 20px color-mix(in srgb, var(--jbot-accent) 34%, transparent));
}

.jbot-scan-ring {
  position: absolute;
  z-index: 1;
  border: 1px solid color-mix(in srgb, var(--jbot-accent) 48%, transparent);
  border-radius: 8px;
  opacity: 0.64;
  animation: jbotScanBracket 2.7s ease-in-out infinite;
}

.jbot-scan-ring.ring-one {
  inset: 20px 8px 14px;
}

.jbot-scan-ring.ring-two {
  inset: 34px 22px 28px;
  border-color: color-mix(in srgb, var(--jbot-secondary) 44%, transparent);
  animation-delay: -1.2s;
}

.jbot-avatar-copy {
  position: relative;
  z-index: 3;
  align-self: center;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.jbot-avatar-copy span {
  width: fit-content;
  max-width: 100%;
  padding: 5px 9px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--jbot-accent) 48%, transparent);
  border-radius: 999px;
  color: #041016;
  background: linear-gradient(180deg, #ffffff, var(--jbot-accent));
  box-shadow: 0 0 20px color-mix(in srgb, var(--jbot-accent) 24%, transparent);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jbot-avatar-copy strong {
  overflow: hidden;
  color: #ffffff;
  font-size: clamp(18px, 1.6vw, 25px);
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 0 18px color-mix(in srgb, var(--jbot-accent) 32%, transparent);
  text-overflow: ellipsis;
  white-space: normal;
}

.jbot-avatar-copy small {
  display: -webkit-box;
  overflow: hidden;
  color: rgba(230, 243, 250, 0.78);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.jbot-speech-bubble {
  position: relative;
  z-index: 4;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 11px;
  border: 1px solid color-mix(in srgb, var(--jbot-accent) 42%, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(3, 8, 13, 0.74);
  box-shadow:
    0 0 28px color-mix(in srgb, var(--jbot-accent) 15%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.jbot-speech-bubble::before {
  content: "";
  position: absolute;
  left: 56px;
  top: -9px;
  width: 16px;
  height: 16px;
  border-top: 1px solid color-mix(in srgb, var(--jbot-accent) 42%, rgba(255, 255, 255, 0.08));
  border-left: 1px solid color-mix(in srgb, var(--jbot-accent) 42%, rgba(255, 255, 255, 0.08));
  background: rgba(7, 14, 20, 0.94);
  transform: rotate(45deg);
}

.jbot-speech-bubble div {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.jbot-speech-bubble span {
  display: block;
  margin-bottom: 4px;
  color: var(--jbot-accent);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.jbot-speech-bubble p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: rgba(248, 253, 255, 0.92);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

#jbotVoiceStatus {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: rgba(225, 238, 246, 0.58);
  font-size: 10px;
  font-weight: 760;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#jbotVoiceStatus[data-tone="working"],
#jbotVoiceStatus[data-tone="speaking"] {
  color: var(--jbot-accent);
}

#jbotVoiceStatus[data-tone="error"] {
  color: var(--game-red);
}

#jbotVoiceStatus[data-tone="ready"] {
  color: var(--game-green);
}

#jbotVoiceButton {
  position: relative;
  z-index: 1;
  min-width: 86px;
  min-height: 38px;
  border-color: color-mix(in srgb, var(--jbot-accent) 36%, rgba(255, 255, 255, 0.13));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.06);
  color: rgba(245, 252, 255, 0.88);
  box-shadow: 0 0 18px color-mix(in srgb, var(--jbot-accent) 10%, transparent);
}

#jbotVoiceButton.active {
  color: #061016;
  background: linear-gradient(180deg, #ffffff, var(--jbot-accent));
  box-shadow:
    0 0 22px color-mix(in srgb, var(--jbot-accent) 34%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

#jbotVoiceButton:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.jbot-avatar-panel[data-mood="buy"] #jbotRobotImage,
.jbot-avatar-panel[data-mood="profit"] #jbotRobotImage {
  animation: jbotCelebrate 1.65s ease-in-out infinite;
}

.jbot-avatar-panel[data-mood="sell"] #jbotRobotImage,
.jbot-avatar-panel[data-mood="loss"] #jbotRobotImage {
  animation: jbotAlert 1.8s ease-in-out infinite;
}

.jbot-avatar-panel[data-mood="blocked"] #jbotRobotImage {
  animation: jbotLock 1.25s ease-in-out infinite;
}

.jbot-avatar-panel[data-mood="thinking"] .jbot-scan-ring {
  animation-duration: 1.65s;
}

.simple-engine-strip {
  gap: 10px;
}

.engine-step {
  border-color: rgba(255, 255, 255, 0.10);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.018)),
    rgba(5, 9, 14, 0.58);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.engine-step::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0 42%, rgba(255, 255, 255, 0.12) 49%, transparent 57% 100%);
  opacity: 0;
  transform: translateX(-80%);
}

.engine-step.active,
.engine-step.buy,
.engine-step.sell,
.engine-step.blocked,
.engine-step.watching {
  border-color: color-mix(in srgb, var(--jbot-accent) 48%, transparent);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 24px color-mix(in srgb, var(--jbot-accent) 12%, transparent);
}

.engine-step.active::before,
.engine-step.buy::before,
.engine-step.sell::before,
.engine-step.blocked::before,
.engine-step.watching::before {
  opacity: 1;
  animation: engineSweep 2.6s ease-in-out infinite;
}

.engine-step span {
  background: linear-gradient(180deg, #ffffff, var(--jbot-accent));
  box-shadow: 0 0 16px color-mix(in srgb, var(--jbot-accent) 36%, transparent);
}

.thinking-head span {
  color: var(--jbot-accent);
}

.thinking-dials input[type="range"]::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, var(--jbot-accent) 0 var(--slider-fill), rgba(255, 255, 255, 0.13) var(--slider-fill) 100%);
}

.thinking-dials input[type="range"]::-moz-range-progress {
  background: var(--jbot-accent);
}

body.consumer-mode .active-trades-bar {
  gap: 12px;
  padding: 12px;
}

body.consumer-mode .active-trade {
  grid-template-columns: minmax(170px, 0.36fr) minmax(0, 1.64fr);
  border-color: color-mix(in srgb, var(--jbot-accent) 26%, rgba(255, 255, 255, 0.10));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--jbot-accent) 12%, transparent), transparent 34%),
    rgba(5, 9, 14, 0.74);
}

body.consumer-mode .active-trade-metrics {
  grid-template-columns: repeat(4, minmax(68px, 0.72fr)) minmax(180px, 1.48fr);
  overflow: hidden;
}

body.consumer-mode .active-trade-pnl strong {
  color: #ffffff;
  font-size: clamp(20px, 2vw, 30px);
  text-shadow: 0 0 18px currentColor;
}

body.consumer-mode .active-trade-pnl.positive strong {
  color: var(--game-green);
}

body.consumer-mode .active-trade-pnl.negative strong {
  color: var(--game-red);
}

body.consumer-mode .active-trade-pnl strong em {
  color: inherit;
  background: rgba(255, 255, 255, 0.065);
}

body.consumer-mode .mini-trade-log-head strong,
body.consumer-mode .mini-watchlist-head strong,
body.consumer-mode .panel-head h2,
body.consumer-mode .director-handle strong {
  color: #ffffff;
  text-shadow: 0 0 18px rgba(102, 242, 255, 0.22);
}

body.consumer-mode .mini-trade-log-row,
body.consumer-mode .mini-watch-row,
body.consumer-mode .chart-tab,
body.consumer-mode .director-card,
body.consumer-mode .director-queue-row {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.015)),
    rgba(4, 8, 13, 0.64);
}

body.consumer-mode .chart-wrap {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(90deg, rgba(102, 242, 255, 0.035) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.024) 0 1px, transparent 1px 100%);
  background-size: 34px 34px;
}

@keyframes jbotFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(1.2deg); }
}

@keyframes jbotCelebrate {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  45% { transform: translateY(-10px) rotate(-2deg) scale(1.035); }
}

@keyframes jbotAlert {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  35% { transform: translateX(-2px) rotate(-1.4deg); }
  70% { transform: translateX(2px) rotate(1.2deg); }
}

@keyframes jbotLock {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(2px) scale(0.985); }
}

@keyframes jbotScanBracket {
  0%, 100% { opacity: 0.24; transform: scale(0.94); }
  50% { opacity: 0.86; transform: scale(1.02); }
}

@keyframes jbotPanelSweep {
  from { transform: translateX(-26%); }
  to { transform: translateX(26%); }
}

@keyframes engineSweep {
  0% { transform: translateX(-86%); }
  55%, 100% { transform: translateX(86%); }
}

@keyframes enginePinballPop {
  0%, 100% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.045),
      0 0 18px color-mix(in srgb, var(--stage-accent) 18%, transparent);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.10),
      0 0 32px color-mix(in srgb, var(--stage-accent) 34%, transparent),
      0 0 64px color-mix(in srgb, var(--stage-accent) 16%, transparent);
  }
}

@media (max-width: 1180px) {
  .jbot-operating-strip {
    grid-template-columns: 1fr 1fr;
  }

  .simple-engine-strip {
    grid-column: 1 / -1;
    order: 3;
  }
}

@media (max-width: 760px) {
  .jbot-operating-strip,
  .jbot-avatar-panel,
  body.consumer-mode .active-trade,
  body.consumer-mode .active-trade-metrics {
    grid-template-columns: 1fr;
  }

  .jbot-avatar-panel {
    min-height: auto;
  }

  .jbot-avatar-stage {
    min-height: 188px;
    overflow: hidden;
  }

  .jbot-aura {
    display: none;
  }

  #jbotRobotImage {
    width: min(190px, 88vw);
    max-height: 210px;
  }

  .jbot-avatar-copy strong,
  .jbot-avatar-copy small {
    white-space: normal;
  }

  .jbot-speech-bubble {
    grid-template-columns: 1fr;
  }

  #jbotVoiceButton {
    width: 100%;
  }

  body.consumer-mode .topbar {
    gap: 8px;
  }

  body.consumer-mode .brand-copy > div:first-child,
  body.consumer-mode .brand-subline {
    min-width: 0;
    overflow: hidden;
  }

  body.consumer-mode .brand-copy > div:first-child {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
  }

  body.consumer-mode .brand-subline {
    flex: 1 1 auto;
    max-width: 100%;
  }

  body.consumer-mode .brand-subline #statusText {
    display: inline-block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.consumer-mode .trade-director-tray {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    max-width: 100%;
    margin: 12px 0 16px;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jbot-avatar-panel::before,
  #jbotRobotImage,
  .jbot-scan-ring,
  .engine-step::before {
    animation: none !important;
  }
}

/* XP unlock deck and robot odometer */
.feature-unlock-strip {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(160px, 0.18fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--game-line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.035)),
    linear-gradient(90deg, rgba(102, 242, 255, 0.09), rgba(177, 134, 255, 0.05), rgba(255, 215, 107, 0.045)),
    rgba(6, 10, 16, 0.76);
  box-shadow:
    0 22px 70px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(30px) saturate(1.5);
}

.feature-unlock-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--jbot-accent), transparent 18%, transparent 82%, var(--jbot-secondary)) top left / 100% 1px no-repeat,
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.11), transparent);
  opacity: 0.62;
}

.feature-strip-head {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 10px;
}

.feature-strip-head span {
  color: var(--jbot-accent);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.feature-strip-head strong {
  color: rgba(248, 253, 255, 0.92);
  font-size: 14px;
  font-weight: 880;
  line-height: 1.16;
}

.feature-dial-track {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 9px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 2px 4px;
  scrollbar-width: thin;
}

.feature-dial-card {
  --dial-fill: 0%;
  position: relative;
  flex: 0 0 108px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  min-height: 118px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--jbot-accent) 34%, rgba(255, 255, 255, 0.10));
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.022)),
    rgba(2, 7, 12, 0.64);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 0 22px color-mix(in srgb, var(--jbot-accent) 10%, transparent);
  user-select: none;
}

.feature-dial-card.active {
  cursor: grab;
}

.feature-dial-card.dial-turning {
  cursor: grabbing;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 34px color-mix(in srgb, var(--jbot-accent) 22%, transparent);
}

.feature-dial-input {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  min-height: 0;
  opacity: 0;
  cursor: inherit;
}

.feature-dial-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(6, 12, 18, 0.96) 0 53%, transparent 55%),
    conic-gradient(var(--jbot-accent) 0 var(--dial-fill), rgba(255, 255, 255, 0.12) var(--dial-fill) 100%);
  box-shadow:
    0 0 20px color-mix(in srgb, var(--jbot-accent) 20%, transparent),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.feature-dial-ring::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: inherit;
}

.feature-dial-ring b {
  position: relative;
  z-index: 1;
  color: #ffffff;
  font-size: 18px;
  font-weight: 950;
  text-shadow: 0 0 14px color-mix(in srgb, var(--jbot-accent) 34%, transparent);
}

.feature-dial-card strong {
  max-width: 100%;
  overflow: hidden;
  color: rgba(248, 253, 255, 0.94);
  font-size: 12px;
  font-weight: 880;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feature-dial-card small {
  color: color-mix(in srgb, var(--jbot-accent) 68%, rgba(255, 255, 255, 0.68));
  font-size: 10px;
  font-weight: 840;
  text-align: center;
  text-transform: uppercase;
}

.feature-dial-card.locked {
  cursor: pointer;
  opacity: 0.42;
  filter: grayscale(0.42);
}

.feature-dial-card.capped {
  border-color: color-mix(in srgb, #ffd76b 44%, rgba(255, 255, 255, 0.12));
}

.feature-dial-card.capped small::after {
  content: " CAP 50";
  color: #ffd76b;
}

.feature-dial-card.locked::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 8px);
}

.feature-dial-ring.locked {
  background:
    radial-gradient(circle at center, rgba(6, 12, 18, 0.94) 0 53%, transparent 55%),
    conic-gradient(rgba(255, 255, 255, 0.19) 0 24%, rgba(255, 255, 255, 0.065) 24% 100%);
}

.feature-dial-card.xp-unlocked {
  opacity: 0.78;
}

.feature-dial-card.xp-unlocked .feature-dial-ring {
  --dial-fill: 100%;
}

.feature-dial-card.power-switch-card {
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.feature-dial-card.power-switch-card.unlocked {
  opacity: 0.78;
  filter: none;
}

.feature-dial-card.power-switch-card.on {
  opacity: 1;
  border-color: rgba(255, 212, 93, 0.72);
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 212, 93, 0.22), transparent 56%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.026)),
    rgba(18, 7, 9, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 34px rgba(255, 112, 87, 0.24),
    0 0 24px rgba(255, 212, 93, 0.18);
}

.feature-dial-card.power-switch-card.on .feature-dial-ring {
  background:
    radial-gradient(circle at center, rgba(28, 12, 10, 0.96) 0 53%, transparent 55%),
    conic-gradient(#ffd45d 0 var(--dial-fill), rgba(255, 255, 255, 0.13) var(--dial-fill) 100%);
}

body.consumer-mode .jbot-operating-strip {
  grid-template-columns: minmax(0, 1.42fr) minmax(280px, 0.58fr);
}

body.consumer-mode .jbot-avatar-panel {
  grid-template-columns: minmax(180px, 0.48fr) minmax(0, 1fr);
  min-height: 286px;
  align-items: stretch;
}

.jbot-engine-odometer {
  grid-column: 2;
  align-self: end;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  min-height: 0;
  padding: 7px;
  border-color: color-mix(in srgb, var(--jbot-accent) 28%, rgba(255, 255, 255, 0.10));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.018)),
    rgba(2, 7, 12, 0.56);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 0 24px color-mix(in srgb, var(--jbot-accent) 10%, transparent);
}

.jbot-engine-odometer .engine-step {
  min-height: 54px;
  padding: 7px;
  border-radius: 7px;
}

.jbot-engine-odometer .engine-step span {
  width: 18px;
  height: 18px;
  margin-bottom: 5px;
  font-size: 10px;
}

.jbot-engine-odometer .engine-step strong {
  font-size: 11px;
}

.jbot-engine-odometer .engine-step small {
  margin-top: 2px;
  font-size: 10px;
}

.jbot-engine-odometer .engine-step {
  --stage-accent: var(--jbot-accent);
  --stage-muted: rgba(255, 255, 255, 0.12);
}

.jbot-engine-odometer .engine-step.stage-waiting {
  opacity: 0.54;
  filter: saturate(0.58);
}

.jbot-engine-odometer .engine-step.stage-passed,
.jbot-engine-odometer .engine-step.stage-current {
  opacity: 1;
  filter: none;
  border-color: color-mix(in srgb, var(--stage-accent) 48%, rgba(255, 255, 255, 0.10));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.045),
    0 0 18px color-mix(in srgb, var(--stage-accent) 18%, transparent);
}

.jbot-engine-odometer .engine-step.stage-passed::after {
  background: linear-gradient(90deg, var(--stage-accent), color-mix(in srgb, var(--stage-accent) 42%, #ffffff));
}

.jbot-engine-odometer .engine-step.stage-current {
  transform: translateY(-1px);
  animation: enginePinballPop 1.05s ease-in-out infinite;
}

.jbot-engine-odometer .engine-step.stage-current::before {
  opacity: 1;
  animation: engineSweep 1.35s ease-in-out infinite;
}

.jbot-engine-odometer .engine-step.stage-current::after {
  background: var(--stage-accent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--stage-accent) 72%, transparent);
}

.jbot-engine-odometer .engine-step.stage-current span,
.jbot-engine-odometer .engine-step.stage-passed span {
  color: #041016;
  background: linear-gradient(180deg, #ffffff, var(--stage-accent));
  box-shadow:
    0 0 14px color-mix(in srgb, var(--stage-accent) 58%, transparent),
    0 0 34px color-mix(in srgb, var(--stage-accent) 24%, transparent);
}

.jbot-engine-odometer .engine-step[data-tone="buy"] {
  --stage-accent: var(--game-green);
}

.jbot-engine-odometer .engine-step[data-tone="sell"],
.jbot-engine-odometer .engine-step[data-tone="blocked"] {
  --stage-accent: var(--game-red);
}

.jbot-engine-odometer .engine-step[data-tone="trade"] {
  --stage-accent: var(--game-gold);
}

body.consumer-mode .jbot-thinking-panel {
  min-height: 0;
  align-content: center;
}

@media (max-width: 1180px) {
  .feature-unlock-strip,
  body.consumer-mode .jbot-operating-strip {
    grid-template-columns: 1fr;
  }

  .feature-strip-head {
    padding-bottom: 0;
  }

  body.consumer-mode .jbot-avatar-panel {
    grid-template-columns: minmax(170px, 0.42fr) minmax(0, 1fr);
  }
}

/* Account and monetization overlay */
.account-overlay[hidden] {
  display: none;
}

.account-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
}

.account-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(102, 242, 255, 0.20), transparent 32%),
    radial-gradient(circle at 88% 18%, rgba(177, 134, 255, 0.18), transparent 30%),
    rgba(2, 5, 10, 0.72);
  backdrop-filter: blur(24px) saturate(1.35);
}

.account-panel {
  position: relative;
  width: min(1240px, 100%);
  max-height: min(860px, calc(100svh - 28px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: #f7fbff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.045)),
    linear-gradient(135deg, rgba(5, 10, 18, 0.96), rgba(9, 18, 31, 0.94));
  box-shadow:
    0 34px 110px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.account-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.account-panel-head span,
.account-section-head span,
.account-status-card > span {
  color: var(--jbot-accent, #66f2ff);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.account-panel-head h2 {
  margin: 2px 0 6px;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1;
  letter-spacing: 0;
}

.account-panel-head p,
.account-status-card p,
.account-plan-card p,
.account-feature-card p,
.account-payment-card p {
  margin: 0;
  color: rgba(247, 251, 255, 0.66);
}

.account-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr) minmax(260px, 0.9fr);
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.account-status-card,
.account-plan-card,
.account-feature-card,
.account-growth-card,
.account-payment-card,
.account-history-card,
.account-support-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.028)),
    rgba(4, 9, 16, 0.70);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.account-status-card {
  grid-row: span 2;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
}

.account-status-card strong {
  font-size: 30px;
  line-height: 1;
}

.account-cap-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
}

.account-cap-meter i {
  display: block;
  width: 50%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #66f2ff, #ffd76b);
  box-shadow: 0 0 18px rgba(102, 242, 255, 0.40);
}

.account-plan-grid,
.account-feature-grid {
  display: grid;
  gap: 10px;
}

.account-plan-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-column: span 2;
}

.account-feature-grid {
  grid-column: span 2;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.account-plan-card,
.account-feature-card,
.account-growth-card,
.account-payment-card,
.account-history-card,
.account-support-card {
  padding: 14px;
}

.account-plan-card {
  display: grid;
  gap: 6px;
}

.account-plan-card span,
.account-feature-card span {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  color: #061018;
  background: #66f2ff;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.account-plan-card.current span,
.account-plan-card.selected span,
.account-feature-card.included span {
  background: #7cff9d;
}

.account-plan-card strong {
  font-size: 18px;
}

.account-plan-card b {
  font-size: 26px;
}

.account-plan-card em {
  color: rgba(247, 251, 255, 0.56);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.account-plan-card.selected {
  border-color: rgba(124, 255, 157, 0.46);
  box-shadow:
    0 0 0 1px rgba(124, 255, 157, 0.12),
    0 0 24px rgba(124, 255, 157, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.account-plan-cta {
  min-height: 36px;
  border: 1px solid rgba(180, 230, 255, 0.16);
  border-radius: 8px;
  color: #061018;
  background: linear-gradient(180deg, #66f2ff, #28bed1);
  font-weight: 900;
}

.account-plan-cta.current {
  color: rgba(247, 251, 255, 0.62);
  background: rgba(255, 255, 255, 0.07);
}

.account-plan-cta:disabled {
  cursor: default;
  opacity: 0.72;
}

.account-plan-card small,
.account-list-row small {
  color: rgba(247, 251, 255, 0.50);
  font-size: 11px;
}

.account-feature-card.locked {
  opacity: 0.66;
  cursor: pointer;
}

.account-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.payment-provider-row,
.payment-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.payment-provider-row button,
.payment-action-row button,
.account-support-form button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #f7fbff;
  background: rgba(255, 255, 255, 0.08);
  padding: 0 12px;
  font-weight: 850;
}

.payment-provider-row button.active,
.payment-action-row .primary,
.account-support-form button {
  color: #061018;
  background: linear-gradient(180deg, #7cff9d, #40d66d);
}

.account-payment-card,
.account-history-card,
.account-support-card {
  display: grid;
  align-content: start;
  gap: 10px;
}

.account-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.account-list.compact {
  max-height: 180px;
}

.account-list-row {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.account-list-row strong,
.account-list-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-list-row span {
  color: rgba(247, 251, 255, 0.70);
}

.account-support-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.account-support-form input {
  min-width: 0;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #f7fbff;
  background: rgba(255, 255, 255, 0.07);
  padding: 0 11px;
}

@media (max-width: 980px) {
  .account-layout,
  .account-plan-grid,
  .account-feature-grid {
    grid-template-columns: 1fr;
  }

  .account-plan-grid,
  .account-feature-grid {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .feature-dial-track {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .feature-dial-card {
    flex-basis: auto;
    min-height: 112px;
  }

  body.consumer-mode .jbot-avatar-panel,
  .jbot-engine-odometer {
    grid-template-columns: 1fr;
  }

  .jbot-engine-odometer {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .feature-dial-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-dial-card {
    min-height: 104px;
  }

  .feature-dial-ring {
    width: 56px;
    height: 56px;
  }
}

/* AAA account overlay pass */
.account-backdrop,
.account-backdrop:hover,
.account-backdrop:focus,
.account-backdrop:active {
  appearance: none;
  outline: none;
  background:
    radial-gradient(circle at 16% 14%, rgba(102, 242, 255, 0.18), transparent 34%),
    radial-gradient(circle at 86% 16%, rgba(255, 215, 107, 0.14), transparent 32%),
    linear-gradient(135deg, rgba(2, 6, 12, 0.84), rgba(5, 9, 16, 0.76));
}

.account-panel {
  width: min(1360px, calc(100vw - 24px));
  max-height: min(900px, calc(100svh - 20px));
  border-color: rgba(180, 230, 255, 0.22);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.045)),
    radial-gradient(circle at 18% 0%, rgba(102, 242, 255, 0.10), transparent 28%),
    radial-gradient(circle at 90% 0%, rgba(255, 215, 107, 0.075), transparent 30%),
    rgba(5, 9, 16, 0.96);
}

.account-panel-head {
  padding: 18px 20px;
}

.account-panel-head h2 {
  font-size: clamp(30px, 4.3vw, 58px);
}

.account-layout {
  grid-template-columns: minmax(260px, 0.75fr) minmax(420px, 1.35fr) minmax(320px, 0.9fr);
  gap: 14px;
  padding: 14px;
}

.account-status-card,
.account-profile-card,
.account-plan-card,
.account-feature-card,
.account-growth-card,
.account-payment-card,
.account-history-card,
.account-support-card {
  border-color: rgba(180, 230, 255, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.032)),
    rgba(4, 10, 18, 0.78);
}

.account-profile-card {
  grid-column: span 2;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
}

.account-growth-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 16px;
}

.account-profile-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.account-profile-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.account-profile-form label.wide,
.account-profile-actions.wide {
  grid-column: span 2;
}

.account-profile-form span {
  color: rgba(247, 251, 255, 0.62);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.account-profile-form input {
  min-width: 0;
  min-height: 40px;
  border: 1px solid rgba(180, 230, 255, 0.14);
  border-radius: 9px;
  color: #f7fbff;
  background: rgba(255, 255, 255, 0.075);
  padding: 0 11px;
}

.account-profile-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.account-profile-actions button {
  min-height: 38px;
  border: 1px solid rgba(180, 230, 255, 0.16);
  border-radius: 9px;
  color: #061018;
  background: linear-gradient(180deg, #66f2ff, #28bed1);
  padding: 0 12px;
  font-weight: 900;
}

.account-profile-actions button + button {
  color: #f7fbff;
  background: rgba(255, 255, 255, 0.09);
}

.account-profile-actions span.verified {
  color: #7cff9d;
}

.account-profile-actions span.pending {
  color: #ffd76b;
}

#accountProfileStatus {
  margin: 0;
  color: rgba(247, 251, 255, 0.62);
}

.account-plan-grid {
  grid-column: span 2;
  gap: 12px;
}

.account-plan-card {
  align-content: start;
  gap: 9px;
  min-width: 0;
  padding: 16px;
}

.account-plan-card strong {
  font-size: clamp(18px, 2vw, 24px);
}

.account-plan-card b {
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1;
}

.account-plan-card ul {
  display: grid;
  gap: 6px;
  margin: 4px 0;
  padding: 0;
  list-style: none;
}

.account-plan-card li {
  color: rgba(247, 251, 255, 0.74);
  font-size: 12px;
  line-height: 1.35;
}

.account-plan-card li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: #66f2ff;
  vertical-align: 1px;
}

.account-feature-grid {
  grid-column: span 2;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.account-feature-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  min-height: 128px;
}

.account-feature-card p,
.account-plan-card p,
.account-payment-card p {
  overflow: visible;
  line-height: 1.4;
}

.payment-provider-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.payment-provider-row button {
  display: grid;
  justify-items: start;
  gap: 2px;
  min-height: 58px;
  padding: 9px 11px;
  text-align: left;
}

.payment-provider-row button b {
  font-size: 18px;
  line-height: 1;
}

.payment-provider-row button small {
  color: rgba(247, 251, 255, 0.60);
  font-size: 11px;
}

.payment-provider-row .brand-stripe b {
  color: #bda7ff;
  font-weight: 950;
  text-transform: lowercase;
}

.payment-provider-row .brand-paypal b {
  color: #7fb7ff;
  font-weight: 950;
}

.payment-provider-row .brand-crypto b {
  color: #ffd76b;
  font-weight: 950;
}

.payment-brand-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(180, 230, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
}

.payment-brand-mark {
  display: grid;
  place-items: center;
  min-width: 86px;
  min-height: 50px;
  border-radius: 10px;
  color: #fff;
  font-size: 18px;
  font-weight: 950;
}

.payment-brand-mark.stripe {
  background: linear-gradient(135deg, #635bff, #8e7dff);
  text-transform: lowercase;
}

.payment-brand-mark.paypal {
  background: linear-gradient(135deg, #003087, #009cde);
}

.payment-brand-mark.nowpayments {
  color: #061018;
  background: linear-gradient(135deg, #f7931a, #7cff9d);
}

.payment-method-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.payment-method-chips span {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: rgba(247, 251, 255, 0.78);
  background: rgba(255, 255, 255, 0.06);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 800;
}

.account-growth-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.growth-metric-grid,
.growth-provider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.growth-metric-grid > div,
.growth-provider {
  min-width: 0;
  border: 1px solid rgba(180, 230, 255, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.055);
  padding: 10px;
}

.growth-metric-grid span,
.growth-provider span {
  display: block;
  color: rgba(247, 251, 255, 0.54);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.growth-metric-grid strong,
.growth-provider strong {
  display: block;
  margin-top: 3px;
  color: #f7fbff;
  font-size: 18px;
  line-height: 1;
}

.growth-provider.ready {
  border-color: rgba(124, 255, 157, 0.28);
}

.growth-provider.pending {
  border-color: rgba(255, 215, 107, 0.22);
}

.growth-lever-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.growth-lever-list button {
  min-height: 34px;
  border: 1px solid rgba(180, 230, 255, 0.16);
  border-radius: 999px;
  color: #061018;
  background: linear-gradient(180deg, #ffd76b, #ffb445);
  padding: 0 12px;
  font-size: 11px;
  font-weight: 900;
}

.account-list-row strong,
.account-list-row span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.account-list {
  max-height: 300px;
}

@media (max-width: 1100px) {
  .account-layout,
  .account-plan-grid,
  .account-feature-grid,
  .account-profile-form,
  .payment-provider-row {
    grid-template-columns: 1fr;
  }

  .account-profile-card,
  .account-plan-grid,
  .account-feature-grid,
  .account-profile-form label.wide,
  .account-profile-actions.wide {
    grid-column: auto;
  }
}

@media (max-width: 860px) {
  .landing-pricing,
  .growth-metric-grid,
  .growth-provider-grid {
    grid-template-columns: 1fr;
  }
}

/* Compact app density pass */
body.consumer-mode[data-shell-view="app"] {
  padding-bottom: 178px;
}

body.consumer-mode[data-shell-view="app"] button {
  min-height: 32px;
  padding-inline: 10px;
}

body.consumer-mode[data-shell-view="app"] input,
body.consumer-mode[data-shell-view="app"] select {
  min-height: 32px;
  padding-block: 0;
}

body.consumer-mode[data-shell-view="app"] .app-shell {
  width: min(1760px, calc(100vw - 18px));
  padding: 6px 0 14px;
}

body.consumer-mode[data-shell-view="app"] .topbar {
  align-items: center;
  gap: 10px;
  min-height: 0;
  margin: 0 0 8px;
  padding: 3px 0 5px;
}

body.consumer-mode[data-shell-view="app"] .brand {
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
}

body.consumer-mode[data-shell-view="app"] .brand-copy {
  display: flex;
  align-items: center;
  gap: 12px;
  width: auto;
}

body.consumer-mode[data-shell-view="app"] .brand-copy > div:first-child {
  flex: 0 0 auto;
}

body.consumer-mode[data-shell-view="app"] .brand h1 {
  font-size: clamp(22px, 2.1vw, 32px);
  line-height: 0.95;
}

body.consumer-mode[data-shell-view="app"] .brand-subline {
  gap: 6px;
  font-size: 11px;
  white-space: nowrap;
}

body.consumer-mode[data-shell-view="app"] .xp-console {
  grid-template-columns: repeat(2, minmax(176px, 1fr));
  gap: 5px;
  width: min(540px, 44vw);
}

body.consumer-mode[data-shell-view="app"] .xp-lane {
  gap: 4px;
  padding: 5px 7px;
}

body.consumer-mode[data-shell-view="app"] .xp-line {
  grid-template-columns: auto minmax(72px, 1fr) auto;
  gap: 6px;
}

body.consumer-mode[data-shell-view="app"] .xp-line span,
body.consumer-mode[data-shell-view="app"] .xp-line b,
body.consumer-mode[data-shell-view="app"] .xp-recent {
  font-size: 9px;
}

body.consumer-mode[data-shell-view="app"] .xp-line strong {
  font-size: 11px;
}

body.consumer-mode[data-shell-view="app"] .xp-bar {
  height: 5px;
}

body.consumer-mode[data-shell-view="app"] .xp-recent {
  grid-column: 1 / -1;
  margin-top: -1px;
}

body.consumer-mode[data-shell-view="app"] .simple-command-center {
  grid-template-columns: minmax(185px, 0.8fr) minmax(320px, 1.2fr) minmax(238px, 0.82fr) auto;
  gap: 8px;
  margin: 0 0 8px;
  padding: 8px;
}

body.consumer-mode[data-shell-view="app"] .simple-command-copy {
  gap: 8px;
}

body.consumer-mode[data-shell-view="app"] .simple-command-copy strong {
  font-size: 15px;
  line-height: 1.1;
}

body.consumer-mode[data-shell-view="app"] .simple-command-copy small {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.consumer-mode[data-shell-view="app"] .simple-status-pill {
  min-width: 54px;
  min-height: 26px;
  padding: 0 8px;
  font-size: 10px;
}

body.consumer-mode[data-shell-view="app"] .simple-starter-controls {
  grid-template-columns: minmax(96px, 0.75fr) auto minmax(116px, 1fr) auto;
  gap: 6px;
}

body.consumer-mode[data-shell-view="app"] .simple-starter-controls input {
  min-height: 32px;
}

body.consumer-mode[data-shell-view="app"] .simple-starter-controls span,
body.consumer-mode[data-shell-view="app"] .simple-command-stats span {
  font-size: 10px;
}

body.consumer-mode[data-shell-view="app"] .simple-command-stats {
  gap: 6px;
}

body.consumer-mode[data-shell-view="app"] .simple-command-stats div {
  padding: 6px 8px;
}

body.consumer-mode[data-shell-view="app"] .simple-command-stats strong {
  font-size: clamp(14px, 1.25vw, 18px);
}

body.consumer-mode[data-shell-view="app"] .simple-command-actions {
  gap: 6px;
}

body.consumer-mode[data-shell-view="app"] .simple-command-actions button {
  min-width: 64px;
}

body.consumer-mode[data-shell-view="app"] .feature-unlock-strip {
  grid-template-columns: minmax(132px, 0.14fr) minmax(0, 1fr);
  gap: 8px;
  margin: 0 0 8px;
  padding: 6px;
}

body.consumer-mode[data-shell-view="app"] .feature-strip-head {
  gap: 2px;
  padding: 3px 5px;
}

body.consumer-mode[data-shell-view="app"] .feature-strip-head span {
  font-size: 9px;
}

body.consumer-mode[data-shell-view="app"] .feature-strip-head strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.15;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.consumer-mode[data-shell-view="app"] .feature-dial-track {
  gap: 7px;
  padding: 0 1px 1px;
}

body.consumer-mode[data-shell-view="app"] .feature-dial-card {
  flex-basis: 82px;
  gap: 3px;
  min-height: 78px;
  padding: 5px;
}

body.consumer-mode[data-shell-view="app"] .feature-dial-ring {
  width: 40px;
  height: 40px;
}

body.consumer-mode[data-shell-view="app"] .feature-dial-ring::after {
  inset: 5px;
}

body.consumer-mode[data-shell-view="app"] .feature-dial-ring b {
  font-size: 12px;
}

body.consumer-mode[data-shell-view="app"] .feature-dial-card strong {
  font-size: 10px;
}

body.consumer-mode[data-shell-view="app"] .feature-dial-card small {
  font-size: 8px;
}

body.consumer-mode[data-shell-view="app"] .jbot-operating-strip {
  grid-template-columns: minmax(0, 1.52fr) minmax(260px, 0.48fr);
  gap: 8px;
  margin: 0 0 8px;
}

body.consumer-mode[data-shell-view="app"] .jbot-avatar-panel {
  grid-template-columns: minmax(104px, 124px) minmax(180px, 0.46fr) minmax(280px, 1fr);
  grid-template-rows: auto auto;
  gap: 8px;
  min-height: 148px;
  padding: 8px;
  align-items: center;
}

body.consumer-mode[data-shell-view="app"] .jbot-avatar-stage {
  grid-column: 1;
  grid-row: 1 / 3;
  min-height: 126px;
}

body.consumer-mode[data-shell-view="app"] .jbot-aura {
  inset: 12px 0 4px;
  transform: perspective(360px) rotateX(58deg) translateY(22px);
}

body.consumer-mode[data-shell-view="app"] .jbot-robot-shadow {
  bottom: 1px;
  height: 12px;
}

body.consumer-mode[data-shell-view="app"] #jbotRobotImage {
  width: min(136px, 124%);
  max-height: 144px;
}

body.consumer-mode[data-shell-view="app"] .jbot-scan-ring.ring-one {
  inset: 15px 6px 10px;
}

body.consumer-mode[data-shell-view="app"] .jbot-scan-ring.ring-two {
  inset: 27px 18px 22px;
}

body.consumer-mode[data-shell-view="app"] .jbot-avatar-copy {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  gap: 4px;
}

body.consumer-mode[data-shell-view="app"] .jbot-avatar-copy span {
  padding: 4px 8px;
  font-size: 9px;
}

body.consumer-mode[data-shell-view="app"] .jbot-avatar-copy strong {
  font-size: clamp(16px, 1.35vw, 21px);
}

body.consumer-mode[data-shell-view="app"] .jbot-avatar-copy small {
  font-size: 11px;
  line-height: 1.25;
  -webkit-line-clamp: 2;
}

body.consumer-mode[data-shell-view="app"] .jbot-speech-bubble {
  grid-column: 2;
  grid-row: 2;
  gap: 8px;
  min-height: 48px;
  padding: 7px 8px;
}

body.consumer-mode[data-shell-view="app"] .jbot-speech-bubble::before {
  left: 38px;
  top: -7px;
  width: 12px;
  height: 12px;
}

body.consumer-mode[data-shell-view="app"] .jbot-speech-bubble span {
  margin-bottom: 2px;
  font-size: 9px;
}

body.consumer-mode[data-shell-view="app"] .jbot-speech-bubble p {
  font-size: 11px;
  line-height: 1.25;
  -webkit-line-clamp: 2;
}

body.consumer-mode[data-shell-view="app"] #jbotVoiceStatus {
  margin-top: 3px;
  font-size: 9px;
}

body.consumer-mode[data-shell-view="app"] #jbotVoiceButton {
  min-width: 72px;
  min-height: 30px;
  font-size: 11px;
}

body.consumer-mode[data-shell-view="app"] .jbot-engine-odometer {
  grid-column: 3;
  grid-row: 1 / 3;
  align-self: stretch;
  grid-template-columns: repeat(5, minmax(72px, 1fr));
  align-content: stretch;
  gap: 5px;
  padding: 5px;
}

body.consumer-mode[data-shell-view="app"] .jbot-engine-odometer .engine-step {
  min-height: 0;
  padding: 4px 5px;
}

body.consumer-mode[data-shell-view="app"] .jbot-engine-odometer .engine-step span {
  width: 15px;
  height: 15px;
  margin-bottom: 2px;
  font-size: 8px;
}

body.consumer-mode[data-shell-view="app"] .jbot-engine-odometer .engine-step strong {
  font-size: 9px;
}

body.consumer-mode[data-shell-view="app"] .jbot-engine-odometer .engine-step small {
  margin-top: 1px;
  font-size: 8px;
}

body.consumer-mode[data-shell-view="app"] .jbot-thinking-panel {
  gap: 7px;
  padding: 8px;
}

body.consumer-mode[data-shell-view="app"] .thinking-head {
  gap: 2px;
}

body.consumer-mode[data-shell-view="app"] .thinking-head span {
  font-size: 9px;
}

body.consumer-mode[data-shell-view="app"] .thinking-head strong {
  font-size: 14px;
}

body.consumer-mode[data-shell-view="app"] .thinking-head small {
  font-size: 11px;
  line-height: 1.25;
  -webkit-line-clamp: 4;
}

body.consumer-mode[data-shell-view="app"] .market-dock {
  grid-template-columns: minmax(260px, 0.9fr) minmax(300px, 1.1fr);
  gap: 8px;
  margin: 0 0 8px;
}

body.consumer-mode[data-shell-view="app"] .mini-trade-log-head,
body.consumer-mode[data-shell-view="app"] .mini-watchlist-head {
  gap: 7px;
  min-height: 34px;
  padding: 5px 7px;
}

body.consumer-mode[data-shell-view="app"] .mini-trade-log-head strong,
body.consumer-mode[data-shell-view="app"] .mini-watchlist-head strong {
  font-size: 12px;
}

body.consumer-mode[data-shell-view="app"] .mini-trade-log-head span,
body.consumer-mode[data-shell-view="app"] .mini-watchlist-head span {
  min-width: 20px;
  min-height: 18px;
  font-size: 10px;
}

body.consumer-mode[data-shell-view="app"] .floating-actions {
  gap: 4px;
}

body.consumer-mode[data-shell-view="app"] .floating-actions button,
body.consumer-mode[data-shell-view="app"] .mini-trade-log-head button,
body.consumer-mode[data-shell-view="app"] .mini-watchlist-head button {
  min-height: 24px;
  padding: 0 7px;
  font-size: 10px;
}

body.consumer-mode[data-shell-view="app"] .mini-watchlist-manager {
  gap: 4px !important;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
}

body.consumer-mode[data-shell-view="app"] .mini-watchlist-manager select,
body.consumer-mode[data-shell-view="app"] .mini-watchlist-manager small {
  min-height: 23px;
  font-size: 9px;
  border-radius: 7px;
}

body.consumer-mode[data-shell-view="app"] .mini-watchlist-manager small {
  padding: 0 6px;
}

body.consumer-mode[data-shell-view="app"] .market-dock .mini-trade-log-body,
body.consumer-mode[data-shell-view="app"] .market-dock .mini-watchlist-body {
  gap: 5px;
  max-height: 178px;
  padding: 6px;
}

body.consumer-mode[data-shell-view="app"] .mini-trade-log-row,
body.consumer-mode[data-shell-view="app"] .mini-watch-row {
  gap: 3px 6px;
  padding: 5px 6px;
}

body.consumer-mode[data-shell-view="app"] .mini-trade-log-row strong,
body.consumer-mode[data-shell-view="app"] .mini-trade-log-row b {
  font-size: 11px;
}

body.consumer-mode[data-shell-view="app"] .mini-trade-log-row span,
body.consumer-mode[data-shell-view="app"] .mini-trade-log-row small {
  font-size: 9px;
}

body.consumer-mode[data-shell-view="app"] .mini-watch-main {
  gap: 2px;
}

body.consumer-mode[data-shell-view="app"] .mini-watch-main span {
  font-size: 12px;
}

body.consumer-mode[data-shell-view="app"] .mini-watch-main strong,
body.consumer-mode[data-shell-view="app"] .mini-watch-side b {
  font-size: 11px;
}

body.consumer-mode[data-shell-view="app"] .mini-watch-main small,
body.consumer-mode[data-shell-view="app"] .mini-watch-row em {
  font-size: 9px;
}

body.consumer-mode[data-shell-view="app"] .mini-watch-side {
  gap: 3px;
}

body.consumer-mode[data-shell-view="app"] .mini-watch-actions {
  gap: 4px;
}

body.consumer-mode[data-shell-view="app"] .mini-watch-actions button {
  min-height: 22px;
  padding: 0 7px;
  font-size: 9px;
}

body.consumer-mode[data-shell-view="app"] .mini-watch-actions button[data-action="remove"] {
  width: 22px;
}

body.consumer-mode[data-shell-view="app"] .workspace {
  gap: 8px;
  margin-top: 8px;
}

body.consumer-mode[data-shell-view="app"] .main-stack {
  gap: 8px;
}

body.consumer-mode[data-shell-view="app"] .analysis-context-bar {
  gap: 8px;
  min-height: 50px;
  padding: 7px 9px;
}

body.consumer-mode[data-shell-view="app"] .analysis-context-bar > div:first-child {
  gap: 2px;
}

body.consumer-mode[data-shell-view="app"] .analysis-context-bar span,
body.consumer-mode[data-shell-view="app"] .analysis-context-bar small {
  font-size: 10px;
}

body.consumer-mode[data-shell-view="app"] .analysis-context-bar strong {
  font-size: 17px;
}

body.consumer-mode[data-shell-view="app"] .analysis-context-pill {
  min-width: 82px;
  min-height: 30px;
  padding: 0 9px;
  font-size: 10px;
}

body.consumer-mode[data-shell-view="app"] .active-trades-bar {
  gap: 6px;
  padding: 7px 8px;
}

body.consumer-mode[data-shell-view="app"] .active-trades-empty {
  min-height: 30px;
  font-size: 11px;
}

body.consumer-mode[data-shell-view="app"] .active-trade {
  grid-template-columns: minmax(150px, 0.34fr) minmax(0, 1.66fr);
  gap: 8px;
  min-height: 56px;
  padding: 8px;
}

body.consumer-mode[data-shell-view="app"] .active-trade-main {
  gap: 6px;
}

body.consumer-mode[data-shell-view="app"] .active-trade-main strong {
  font-size: 15px;
}

body.consumer-mode[data-shell-view="app"] .active-trade-side,
body.consumer-mode[data-shell-view="app"] .active-trade-context,
body.consumer-mode[data-shell-view="app"] .active-trade-fill-count {
  min-height: 18px;
  padding: 0 6px;
  font-size: 9px;
}

body.consumer-mode[data-shell-view="app"] .active-trade-metrics {
  grid-template-columns: repeat(4, minmax(56px, 0.7fr)) minmax(148px, 1.45fr);
  gap: 5px;
}

body.consumer-mode[data-shell-view="app"] .active-trade-metrics small {
  font-size: 9px;
}

body.consumer-mode[data-shell-view="app"] .active-trade-metrics strong {
  font-size: 12px;
}

body.consumer-mode[data-shell-view="app"] .active-trade-pnl strong {
  gap: 6px;
  font-size: clamp(17px, 1.55vw, 23px);
}

body.consumer-mode[data-shell-view="app"] .active-trade-pnl strong em {
  padding: 2px 5px;
  font-size: 9px;
}

body.consumer-mode[data-shell-view="app"] .chart-tabs-panel {
  gap: 5px;
  padding: 7px 8px;
}

body.consumer-mode[data-shell-view="app"] .chart-tabs-head {
  gap: 8px;
}

body.consumer-mode[data-shell-view="app"] .chart-tabs-head span,
body.consumer-mode[data-shell-view="app"] .chart-tabs-head strong {
  font-size: 10px;
}

body.consumer-mode[data-shell-view="app"] .chart-tabs {
  gap: 6px;
  padding-bottom: 0;
}

body.consumer-mode[data-shell-view="app"] .chart-tab,
body.consumer-mode[data-shell-view="app"] .chart-tab-empty {
  flex-basis: min(184px, 70vw);
  gap: 2px;
  min-height: 54px;
  padding: 6px 8px;
}

body.consumer-mode[data-shell-view="app"] .chart-tab span {
  font-size: 9px;
}

body.consumer-mode[data-shell-view="app"] .chart-tab strong {
  font-size: 15px;
}

body.consumer-mode[data-shell-view="app"] .chart-tab small,
body.consumer-mode[data-shell-view="app"] .chart-tab-empty {
  font-size: 9px;
}

body.consumer-mode[data-shell-view="app"] .chart-panel {
  min-height: 0;
}

body.consumer-mode[data-shell-view="app"] .panel-head {
  gap: 8px;
  padding: 8px 10px;
}

body.consumer-mode[data-shell-view="app"] .panel-head h2 {
  font-size: 15px;
}

body.consumer-mode[data-shell-view="app"] .panel-head span,
body.consumer-mode[data-shell-view="app"] #chartMeta {
  font-size: 10px;
}

body.consumer-mode[data-shell-view="app"] .chart-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

body.consumer-mode[data-shell-view="app"] #lastPrice {
  font-size: 16px;
}

body.consumer-mode[data-shell-view="app"] .price-stack {
  min-width: 76px;
  gap: 2px;
}

body.consumer-mode[data-shell-view="app"] .chart-zoom {
  min-height: 28px;
  padding: 2px;
}

body.consumer-mode[data-shell-view="app"] .chart-zoom button {
  min-width: 26px;
  min-height: 22px;
  padding: 0 7px;
}

body.consumer-mode[data-shell-view="app"] .chart-zoom span {
  min-width: 28px;
  font-size: 10px;
}

body.consumer-mode[data-shell-view="app"] .chart-wrap {
  height: clamp(300px, 40vh, 450px);
  min-height: clamp(300px, 40vh, 450px);
  margin: 0 8px 8px;
  padding: 6px 8px 0;
}

body.consumer-mode[data-shell-view="app"] .trade-director-tray {
  position: fixed;
  left: 50%;
  bottom: 8px;
  width: min(1040px, calc(100vw - 18px));
  max-height: min(38vh, 300px);
  margin: 0;
  transform: translateX(-50%);
}

body.consumer-mode[data-shell-view="app"] .director-handle {
  gap: 9px;
  padding: 7px 9px;
}

body.consumer-mode[data-shell-view="app"] .director-handle > div:first-child {
  gap: 2px;
}

body.consumer-mode[data-shell-view="app"] .director-handle span,
body.consumer-mode[data-shell-view="app"] .director-eyebrow,
body.consumer-mode[data-shell-view="app"] .director-order-grid span,
body.consumer-mode[data-shell-view="app"] .director-queue-row small {
  font-size: 10px;
}

body.consumer-mode[data-shell-view="app"] .director-handle strong {
  font-size: 14px;
}

body.consumer-mode[data-shell-view="app"] .director-controls {
  gap: 5px;
}

body.consumer-mode[data-shell-view="app"] .director-auto {
  gap: 5px;
  min-height: 28px;
  padding: 0 8px;
  font-size: 10px;
}

body.consumer-mode[data-shell-view="app"] .director-body {
  gap: 7px;
  padding: 7px;
}

body.consumer-mode[data-shell-view="app"] .director-card {
  gap: 7px;
  padding: 9px;
}

body.consumer-mode[data-shell-view="app"] .director-card-top {
  gap: 8px;
}

body.consumer-mode[data-shell-view="app"] .director-card-top strong {
  font-size: 18px;
}

body.consumer-mode[data-shell-view="app"] .director-status {
  min-height: 24px;
  padding: 0 8px;
  font-size: 10px;
}

body.consumer-mode[data-shell-view="app"] .director-order-grid div {
  gap: 2px;
  padding: 6px;
}

body.consumer-mode[data-shell-view="app"] .director-order-grid strong {
  font-size: 12px;
}

body.consumer-mode[data-shell-view="app"] .director-card p {
  font-size: 12px;
  line-height: 1.3;
}

body.consumer-mode[data-shell-view="app"] .director-card li,
body.consumer-mode[data-shell-view="app"] .director-risk span,
body.consumer-mode[data-shell-view="app"] .director-tags span {
  padding: 5px 6px;
  font-size: 10px;
  line-height: 1.25;
}

body.consumer-mode[data-shell-view="app"] .director-actions {
  gap: 6px;
}

body.consumer-mode[data-shell-view="app"] .director-queue {
  gap: 5px;
}

body.consumer-mode[data-shell-view="app"] .director-queue-row {
  gap: 4px 6px;
  padding: 7px;
}

@media (max-width: 1180px) {
  body.consumer-mode[data-shell-view="app"] .topbar,
  body.consumer-mode[data-shell-view="app"] .brand-copy {
    align-items: flex-start;
  }

  body.consumer-mode[data-shell-view="app"] .xp-console {
    width: min(520px, 100%);
  }

  body.consumer-mode[data-shell-view="app"] .simple-command-center,
  body.consumer-mode[data-shell-view="app"] .feature-unlock-strip,
  body.consumer-mode[data-shell-view="app"] .jbot-operating-strip {
    grid-template-columns: 1fr;
  }

  body.consumer-mode[data-shell-view="app"] .feature-strip-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  body.consumer-mode[data-shell-view="app"] .jbot-avatar-panel {
    grid-template-columns: minmax(124px, 0.28fr) minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  body.consumer-mode[data-shell-view="app"] {
    padding-bottom: 138px;
  }

  body.consumer-mode[data-shell-view="app"] .app-shell {
    width: min(100vw - 10px, 1760px);
    padding-top: 4px;
  }

  body.consumer-mode[data-shell-view="app"] .topbar,
  body.consumer-mode[data-shell-view="app"] .brand-copy,
  body.consumer-mode[data-shell-view="app"] .simple-starter-controls,
  body.consumer-mode[data-shell-view="app"] .director-body {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.consumer-mode[data-shell-view="app"] .xp-console {
    grid-template-columns: 1fr;
  }

  body.consumer-mode[data-shell-view="app"] .simple-command-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.consumer-mode[data-shell-view="app"] .feature-dial-track {
    display: flex;
    overflow-x: auto;
  }

  body.consumer-mode[data-shell-view="app"] .feature-dial-card {
    flex: 0 0 82px;
  }

  body.consumer-mode[data-shell-view="app"] .jbot-avatar-panel,
  body.consumer-mode[data-shell-view="app"] .jbot-engine-odometer,
  body.consumer-mode[data-shell-view="app"] .active-trade,
  body.consumer-mode[data-shell-view="app"] .active-trade-metrics {
    grid-template-columns: 1fr;
  }

  body.consumer-mode[data-shell-view="app"] .jbot-avatar-stage {
    min-height: 118px;
  }

  body.consumer-mode[data-shell-view="app"] .jbot-engine-odometer {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.consumer-mode[data-shell-view="app"] .chart-wrap {
    height: clamp(260px, 38vh, 360px);
    min-height: clamp(260px, 38vh, 360px);
  }
}

/* Imagegen HUD art integration */
.hud-art-layer {
  display: none;
}

body.consumer-mode[data-shell-view="app"] .hud-art-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 48%, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.68) 62%, rgba(0, 0, 0, 0.86) 100%),
    url("/assets/jbot-hud-original.png") center / cover no-repeat;
  filter: saturate(1.18) contrast(1.08);
  mix-blend-mode: screen;
  opacity: 0.34;
}

body.consumer-mode[data-shell-view="app"] .app-shell {
  position: relative;
  z-index: 4;
}

body.consumer-mode[data-shell-view="app"] :where(
  .simple-command-center,
  .feature-unlock-strip,
  .simple-engine-strip,
  .jbot-thinking-panel,
  .market-dock > aside,
  .analysis-context-bar,
  .active-trades-bar,
  .chart-tabs-panel,
  .chart-panel,
  .trade-director-tray
) {
  border-color: color-mix(in srgb, var(--jbot-accent) 34%, rgba(255, 255, 255, 0.13));
  box-shadow:
    0 18px 54px rgba(0, 0, 0, 0.42),
    0 0 36px color-mix(in srgb, var(--jbot-accent) 8%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

body.consumer-mode[data-shell-view="app"] :where(
  .simple-command-center,
  .feature-unlock-strip,
  .simple-engine-strip,
  .jbot-thinking-panel,
  .market-dock > aside,
  .analysis-context-bar,
  .active-trades-bar,
  .chart-tabs-panel,
  .chart-panel,
  .trade-director-tray
)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(102, 242, 255, 0.11), transparent 26%, transparent 74%, rgba(255, 186, 74, 0.10)),
    url("/assets/jbot-hud-original.png") center / cover no-repeat;
  mix-blend-mode: screen;
  opacity: 0.075;
}

body.consumer-mode[data-shell-view="app"] :where(
  .simple-command-center,
  .feature-unlock-strip,
  .simple-engine-strip,
  .jbot-thinking-panel,
  .market-dock > aside,
  .analysis-context-bar,
  .active-trades-bar,
  .chart-tabs-panel,
  .chart-panel,
  .trade-director-tray
) > * {
  position: relative;
  z-index: 1;
}

body.consumer-mode[data-shell-view="app"] .chart-wrap {
  box-shadow:
    inset 0 0 0 1px rgba(102, 242, 255, 0.10),
    inset 0 0 42px rgba(102, 242, 255, 0.045),
    0 0 26px rgba(255, 186, 74, 0.055);
}

body.consumer-mode[data-shell-view="app"] .feature-dial-card,
body.consumer-mode[data-shell-view="app"] .chart-tab,
body.consumer-mode[data-shell-view="app"] .mini-trade-log-row,
body.consumer-mode[data-shell-view="app"] .mini-watch-row,
body.consumer-mode[data-shell-view="app"] .active-trade,
body.consumer-mode[data-shell-view="app"] .director-card {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(102, 242, 255, 0.07),
    0 0 18px rgba(102, 242, 255, 0.055);
}

body.consumer-mode[data-shell-view="app"] .jbot-avatar-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.125), rgba(255, 255, 255, 0.026) 44%, rgba(0, 0, 0, 0.10)),
    linear-gradient(90deg, color-mix(in srgb, var(--jbot-accent) 14%, transparent), transparent 42%, rgba(255, 186, 74, 0.055)),
    url("/assets/jbot-hud-original.png") center / cover no-repeat,
    var(--game-glass);
  background-blend-mode: normal, screen, screen, normal;
}

@media (prefers-reduced-motion: reduce) {
  .jbot-engine-odometer .engine-step.stage-current {
    animation: none;
    transform: none;
  }
}

/* Stable header XP lanes */
body.consumer-mode[data-shell-view="app"] .brand {
  flex: 0 0 min(860px, calc(100vw - 126px));
  max-width: min(860px, calc(100vw - 126px));
}

body.consumer-mode[data-shell-view="app"] .brand-copy {
  display: grid;
  grid-template-columns: clamp(210px, 18vw, 300px) minmax(360px, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
}

body.consumer-mode[data-shell-view="app"] .brand-copy > div:first-child {
  min-width: 0;
  overflow: hidden;
}

body.consumer-mode[data-shell-view="app"] .brand-subline {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

body.consumer-mode[data-shell-view="app"] .brand-subline #statusText {
  display: inline-block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

body.consumer-mode[data-shell-view="app"] .xp-console {
  justify-self: stretch;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
}

body.consumer-mode[data-shell-view="app"] .xp-line {
  grid-template-columns: 76px minmax(0, 1fr) 96px;
}

body.consumer-mode[data-shell-view="app"] .xp-line > *,
body.consumer-mode[data-shell-view="app"] .xp-recent {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  body.consumer-mode[data-shell-view="app"] .brand {
    flex-basis: auto;
    max-width: 100%;
  }

  body.consumer-mode[data-shell-view="app"] .brand-copy {
    grid-template-columns: 1fr;
    width: 100%;
  }

  body.consumer-mode[data-shell-view="app"] .xp-console {
    grid-template-columns: 1fr;
  }

  body.consumer-mode[data-shell-view="app"] .xp-line {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}
