/* Trading pages (2026-11-02). */
.trading-page {
  display: grid;
  gap: 18px;
}
.trading-state {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 20px 22px;
  border-left: 4px solid var(--muted);
}
.trading-state[data-state='active'] {
  border-left-color: var(--green);
}
.trading-state[data-state='paused'] {
  border-left-color: #e0a63a;
}
.trading-state[data-state='emergency_stop'] {
  border-left-color: var(--red);
  background: color-mix(in srgb, var(--red) 8%, var(--panel));
}
.trading-state[data-mode='live'][data-state='active'] {
  border-left-color: var(--red);
}
.trading-state-main {
  min-width: 0;
  flex: 1 1 320px;
}
.trading-state-main p {
  margin: 4px 0 0;
}
.trading-state-label {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.trading-state[data-state='active'] .trading-state-label {
  color: var(--green);
}
.trading-state[data-state='paused'] .trading-state-label {
  color: #e0a63a;
}
.trading-state[data-state='emergency_stop'] .trading-state-label {
  color: var(--red);
}
.trading-state-actions,
.trading-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.trading-blocks {
  border: 1px solid color-mix(in srgb, #e0a63a 45%, transparent);
  background: color-mix(in srgb, #e0a63a 8%, transparent);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
}
.trading-chart-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
}
.trading-chart-scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  text-align: right;
}
.trading-chart {
  width: 100%;
  height: 220px;
  display: block;
}
.trading-chart-line {
  fill: none;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.trading-chart.up .trading-chart-line {
  stroke: var(--green);
}
.trading-chart.down .trading-chart-line {
  stroke: var(--red);
}
.trading-chart-area {
  opacity: 0.12;
}
.trading-chart.up .trading-chart-area {
  fill: var(--green);
}
.trading-chart.down .trading-chart-area {
  fill: var(--red);
}
.trading-chart-axis {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}
.trading-events {
  list-style: none;
  margin: 0;
  padding: 0 20px 18px;
  display: grid;
  gap: 8px;
  font-size: 12px;
}
.trading-events li {
  border-left: 2px solid var(--border);
  padding-left: 10px;
}
.trading-events li[data-severity='critical'] {
  border-left-color: var(--red);
}
.trading-events li[data-severity='warning'] {
  border-left-color: #e0a63a;
}
.trading-span {
  grid-column: 1 / -1;
  min-width: 0;
}
.trading-backtest-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 760px) {
  .trading-backtest-grid {
    grid-template-columns: 1fr 1fr;
  }
  .trading-state-label {
    font-size: 18px;
  }
}
/* Live trading (2026-11-02). */
.trading-state[data-state='active'] {
  border-left-color: var(--red);
}
.trading-state[data-state='active'] .trading-state-label {
  color: var(--red);
}
.trading-state[data-state='halted'] {
  border-left-color: #e0a63a;
}
.trading-state[data-state='halted'] .trading-state-label {
  color: #e0a63a;
}
.trading-steps {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.trading-steps li[data-done='true'] > span {
  color: var(--green);
}
.trading-steps li[data-done='false'] {
  color: var(--muted);
}
.trading-connection textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}
.trading-howto {
  margin: 0 0 12px;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}
/* Coinbase-style portfolio, tabs and simplified risk (2026-11-03). */
.trading-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.trading-tabs button {
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.trading-tabs button[aria-selected='true'] {
  color: var(--text);
  border-bottom-color: var(--text);
}
.trading-tab {
  display: grid;
  gap: 18px;
}
.cb-hero {
  padding: 22px;
  display: grid;
  gap: 14px;
}
.cb-hero-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.cb-label {
  font-size: 13px;
  color: var(--muted);
}
.cb-total {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 4px 0 6px;
}
.cb-delta {
  font-size: 14px;
  font-weight: 600;
}
.cb-hero-side {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.cb-hero-side > div {
  display: grid;
  gap: 2px;
}
.cb-ranges {
  display: flex;
  gap: 6px;
}
.cb-ranges button {
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.cb-ranges button[aria-pressed='true'] {
  background: var(--panel2);
  color: var(--text);
}
.cb-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.cb-assets {
  display: grid;
}
.cb-asset {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}
.cb-asset-head {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 8px;
  padding-bottom: 8px;
}
.cb-asset > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.cb-asset small {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cb-asset-name {
  grid-template-columns: 32px 1fr;
  align-items: center;
  column-gap: 10px;
}
.cb-asset-name .asset-icon {
  width: 32px;
  height: 32px;
}
.cb-asset-name > span {
  display: grid;
  min-width: 0;
}
.cb-asset-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cb-bot {
  font-style: normal;
  color: var(--green);
}
.cb-change {
  font-size: 12px;
  font-weight: 600;
}
.cb-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--panel2);
  overflow: hidden;
  display: block;
}
.cb-bar i {
  display: block;
  height: 100%;
  background: #3d7bfd;
  border-radius: 999px;
}
.cb-allocation {
  display: grid;
  justify-items: center;
  gap: 16px;
}
.cb-donut {
  width: 170px;
  height: 170px;
  transform: rotate(0deg);
}
.cb-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: grid;
  gap: 8px;
  font-size: 13px;
}
.cb-legend li {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 8px;
}
.cb-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.cb-legend span {
  color: var(--muted);
}
.trading-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.trading-preset {
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
span.trading-preset {
  cursor: default;
}
.trading-preset[aria-pressed='true'] {
  border-color: var(--text);
  color: var(--text);
  background: var(--panel2);
}
.trading-risk-simple {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}
.trading-risk-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.trading-risk-input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.trading-risk-input i {
  font-style: normal;
  color: var(--muted);
}
.trading-risk-input input {
  width: 90px;
  text-align: right;
}
.trading-risk-advanced {
  margin: 6px 0 10px;
}
.trading-risk-advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}
@media (max-width: 900px) {
  .cb-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .cb-total {
    font-size: 32px;
  }
  .cb-asset {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px 16px;
  }
  .cb-asset-head,
  .cb-asset-price,
  .cb-asset-alloc {
    display: none !important;
  }
  .cb-asset-balance {
    text-align: right;
  }
}
.cb-cash-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1f8f5f;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}
.trading-risk-input i {
  width: 12px;
  text-align: center;
}
.cb-small-toggle {
  display: block;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--border);
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  padding: 12px 20px;
  text-align: left;
  cursor: pointer;
}
.cb-small-toggle:hover {
  color: var(--text);
}
/* ---- Trading UI refresh (2026-11-03): control bar, performance chart, polish ---- */
.trading-page {
  --pf-up: #22c39a;
  --pf-down: #f0506e;
  --pf-amber: #e8a93a;
}

/* Bot control bar */
.bot-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--bot-color) 12%, transparent), transparent 60%),
    var(--panel);
  --bot-color: var(--pf-amber);
}
.bot-control[data-state='active'] {
  --bot-color: var(--pf-up);
}
.bot-control[data-state='emergency_stop'] {
  --bot-color: var(--pf-down);
}
.bot-control[data-state='halted'] {
  --bot-color: var(--pf-amber);
}
.bot-status {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-width: 0;
  flex: 1 1 340px;
}
.bot-status p {
  margin: 3px 0 0;
  font-size: 13px;
}
.bot-light {
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--bot-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--bot-color) 22%, transparent);
}
.bot-control[data-state='active'] .bot-light {
  animation: bot-pulse 1.8s ease-out infinite;
}
@keyframes bot-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--bot-color) 55%, transparent);
  }
  100% {
    box-shadow: 0 0 0 12px transparent;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bot-control[data-state='active'] .bot-light {
    animation: none;
  }
}
.bot-label {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--bot-color);
}
.bot-meta {
  color: var(--muted);
  font-size: 12px !important;
}
.bot-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.bot-switch {
  display: flex;
  padding: 4px;
  gap: 4px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.bot-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.05s;
}
.bot-btn:active:not(:disabled) {
  transform: translateY(1px);
}
.bot-btn span:last-child {
  display: grid;
  line-height: 1.25;
}
.bot-btn strong {
  font-size: 14px;
}
.bot-btn small {
  font-size: 11px;
  color: var(--muted);
}
.bot-btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  flex-shrink: 0;
}
.bot-start .bot-btn-icon {
  background: color-mix(in srgb, var(--pf-up) 20%, transparent);
  color: var(--pf-up);
}
.bot-stop .bot-btn-icon {
  background: color-mix(in srgb, var(--pf-amber) 20%, transparent);
  color: var(--pf-amber);
}
.bot-start:not(:disabled) {
  background: var(--pf-up);
  color: #04130d;
}
.bot-start:not(:disabled) small {
  color: #0b3b2a;
}
.bot-start:not(:disabled) .bot-btn-icon {
  background: #04130d22;
  color: #04130d;
}
.bot-start:not(:disabled):hover {
  background: color-mix(in srgb, var(--pf-up) 88%, white);
}
.bot-stop:not(:disabled) {
  border-color: color-mix(in srgb, var(--pf-amber) 50%, transparent);
}
.bot-stop:not(:disabled):hover {
  background: color-mix(in srgb, var(--pf-amber) 12%, transparent);
}
.bot-btn:disabled {
  cursor: default;
}
.bot-control[data-state='active'] .bot-start:disabled {
  background: color-mix(in srgb, var(--pf-up) 12%, transparent);
  border-color: color-mix(in srgb, var(--pf-up) 40%, transparent);
}
.bot-control:not([data-state='active']) .bot-stop:disabled {
  background: color-mix(in srgb, var(--pf-amber) 10%, transparent);
}
.bot-btn:disabled .bot-btn-icon {
  opacity: 0.9;
}

/* Tabs */
.trading-tabs {
  border-bottom: 0;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  width: fit-content;
  max-width: 100%;
}
.trading-tabs button {
  border-bottom: 0;
  border-radius: 9px;
  padding: 8px 16px;
}
.trading-tabs button[aria-selected='true'] {
  background: var(--panel2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}

/* Balance hero */
.cb-hero {
  padding: 24px 24px 18px;
  gap: 18px;
  overflow: hidden;
}
.pf-headline .cb-label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pf-refresh {
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.pf-refresh:hover:not(:disabled) {
  color: var(--text);
  background: var(--panel2);
}
.cb-total {
  font-size: 46px;
  font-variant-numeric: tabular-nums;
}
.pf-delta {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 600;
  min-height: 24px;
}
.pf-pill {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}
.pf-pill.positive {
  background: color-mix(in srgb, var(--pf-up) 16%, transparent);
  color: var(--pf-up);
}
.pf-pill.negative {
  background: color-mix(in srgb, var(--pf-down) 16%, transparent);
  color: var(--pf-down);
}
.pf-delta .positive {
  color: var(--pf-up);
}
.pf-delta .negative {
  color: var(--pf-down);
}
.pf-tiles {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pf-tile {
  display: grid;
  gap: 2px;
  min-width: 130px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel2) 60%, transparent);
}
.pf-tile small {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pf-tile strong {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.pf-tile span {
  font-size: 12px;
}
.pf-chart {
  position: relative;
  height: 260px;
  margin: 0 -4px;
  touch-action: pan-y;
  cursor: crosshair;
}
.pf-chart-empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.pf-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.pf-line {
  fill: none;
  stroke-width: 2.25;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.pf-svg.up .pf-line {
  stroke: var(--pf-up);
}
.pf-svg.down .pf-line {
  stroke: var(--pf-down);
}
.pf-svg.up .pf-stop-top {
  stop-color: var(--pf-up);
  stop-opacity: 0.28;
}
.pf-svg.down .pf-stop-top {
  stop-color: var(--pf-down);
  stop-opacity: 0.28;
}
.pf-stop-bottom {
  stop-color: var(--panel);
  stop-opacity: 0;
}
.pf-base {
  stroke: var(--muted);
  stroke-opacity: 0.35;
  stroke-dasharray: 3 5;
  vector-effect: non-scaling-stroke;
}
.pf-cursor {
  stroke: var(--muted);
  stroke-opacity: 0.6;
  vector-effect: non-scaling-stroke;
}
.pf-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 3px var(--panel);
  pointer-events: none;
}
.pf-chart:has(.pf-svg.up) .pf-dot {
  background: var(--pf-up);
}
.pf-chart:has(.pf-svg.down) .pf-dot {
  background: var(--pf-down);
}
.pf-dot-end {
  animation: bot-pulse 2s ease-out infinite;
  --bot-color: var(--pf-up);
}
@media (prefers-reduced-motion: reduce) {
  .pf-dot-end {
    animation: none;
  }
}
.pf-tip {
  position: absolute;
  top: -6px;
  transform: translate(-50%, -100%);
  display: grid;
  gap: 1px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--panel2);
  border: 1px solid var(--border);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 20px #0006;
}
.pf-tip span {
  color: var(--muted);
  font-size: 11px;
}
.pf-axis {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: -18px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  pointer-events: none;
}
.pf-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.cb-ranges button {
  padding: 5px 13px;
  font-weight: 600;
}
.cb-ranges button:hover {
  color: var(--text);
}

/* Assets, panels */
.cb-asset:not(.cb-asset-head) {
  transition: background 0.12s;
}
.cb-asset:not(.cb-asset-head):hover {
  background: color-mix(in srgb, var(--panel2) 70%, transparent);
}
.cb-asset strong {
  font-variant-numeric: tabular-nums;
}
.trading-page .panel {
  border-radius: 14px;
}
.trading-page .stat-card {
  border-radius: 14px;
}
@media (max-width: 760px) {
  .bot-actions,
  .bot-switch {
    width: 100%;
  }
  .bot-btn {
    flex: 1;
    min-width: 0;
  }
  .cb-total {
    font-size: 36px;
  }
  .pf-chart {
    height: 200px;
  }
  .pf-tiles {
    width: 100%;
  }
  .pf-tile {
    flex: 1 1 120px;
  }
}
.pf-chart:has(.pf-svg.down) .pf-dot-end {
  --bot-color: var(--pf-down);
}
.bot-btn:disabled {
  opacity: 1;
}
.bot-control[data-state='active'] .bot-start:disabled {
  color: var(--pf-up);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pf-up) 45%, transparent);
}
.bot-control[data-state='active'] .bot-start:disabled small {
  color: color-mix(in srgb, var(--pf-up) 70%, var(--muted));
}
.bot-control:not([data-state='active']) .bot-stop:disabled {
  color: var(--pf-amber);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pf-amber) 45%, transparent);
}
.bot-control[data-state='emergency_stop'] .bot-start:disabled,
.bot-control[data-state='halted'] .bot-start:disabled {
  opacity: 0.45;
}
.bot-blocks ul {
  margin: 6px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 2px;
}
/* ---- Robinhood pass (2026-11-03) ---- */
.trading-page {
  --pf-up: #00c805;
  --pf-down: #ff5000;
}
.trading-page .positive {
  color: var(--pf-up);
}
.trading-page .negative {
  color: var(--pf-down);
}
.trading-page .cb-bar i {
  background: var(--pf-up);
}

/* Start / Stop as two bold pills */
.bot-switch {
  padding: 0;
  gap: 10px;
  border: 0;
  background: none;
}
.bot-btn {
  border-radius: 999px;
  padding: 8px 22px 8px 8px;
  min-width: 0;
  border: 0;
  background: #ffffff12;
}
.bot-btn-icon {
  width: 34px;
  height: 34px;
  font-size: 13px;
}
.bot-start:not(:disabled) {
  background: var(--pf-up);
  color: #000;
}
.bot-start:not(:disabled):hover {
  background: #00b304;
}
.bot-start:not(:disabled) small {
  color: #003d02;
}
.bot-start:not(:disabled) .bot-btn-icon {
  background: #0000001f;
  color: #000;
}
.bot-stop:not(:disabled) {
  background: #ffffff14;
  color: #fff;
  border: 0;
}
.bot-stop:not(:disabled):hover {
  background: #ffffff24;
}
.bot-stop .bot-btn-icon {
  background: #ffffff1a;
  color: #fff;
}
.bot-control[data-state='active'] .bot-start:disabled {
  background: #00c8051a;
  color: var(--pf-up);
  box-shadow: none;
}
.bot-control[data-state='active'] .bot-start:disabled .bot-btn-icon {
  background: #00c80526;
  color: var(--pf-up);
}
.bot-control:not([data-state='active']) .bot-stop:disabled {
  background: #ffffff0d;
  color: var(--text);
  box-shadow: none;
}
.bot-control:not([data-state='active']) .bot-stop:disabled small {
  color: var(--muted);
}
.bot-control .button.danger {
  padding: 10px 18px;
}
.bot-control[data-state='active'] {
  --bot-color: var(--pf-up);
}
.bot-control[data-state='emergency_stop'] {
  --bot-color: var(--pf-down);
}

/* Robinhood-style text tabs and range selector */
.trading-tabs {
  border: 0;
  background: none;
  padding: 0;
  gap: 22px;
  border-bottom: 1px solid var(--border);
  width: 100%;
  border-radius: 0;
}
.trading-tabs button {
  border-radius: 0;
  padding: 10px 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-size: 14px;
  font-weight: 700;
}
.trading-tabs button:hover {
  color: var(--text);
}
.trading-tabs button[aria-selected='true'] {
  background: none;
  box-shadow: none;
  color: var(--text);
  border-bottom-color: var(--pf-up);
}
.cb-ranges {
  gap: 4px;
}
.cb-ranges button {
  border: 0;
  border-radius: 0;
  background: none;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.cb-ranges button[aria-pressed='true'] {
  background: none;
  color: var(--pf-up);
  border-bottom-color: var(--pf-up);
}
.cb-hero[data-tone='down'] .cb-ranges button[aria-pressed='true'] {
  color: var(--pf-down);
  border-bottom-color: var(--pf-down);
}

/* Presets as pills */
.trading-preset {
  border: 0;
  background: #ffffff12;
  color: var(--text);
  font-weight: 700;
  padding: 7px 14px;
}
.trading-preset[aria-pressed='true'] {
  background: #00c8051f;
  color: var(--pf-up);
  border: 0;
}

/* Live indicator and price ticks */
.pf-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pf-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.pf-live.on {
  color: #00c805;
}
.pf-live.on i {
  background: #00c805;
  animation: live-dot 1.6s ease-out infinite;
}
@keyframes live-dot {
  0% {
    box-shadow: 0 0 0 0 #00c80580;
  }
  100% {
    box-shadow: 0 0 0 7px transparent;
  }
}
.tick-up {
  animation: tick-up 0.9s ease-out;
}
.tick-down {
  animation: tick-down 0.9s ease-out;
}
@keyframes tick-up {
  0% {
    color: #00c805;
  }
}
@keyframes tick-down {
  0% {
    color: #ff5000;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pf-live.on i,
  .tick-up,
  .tick-down {
    animation: none;
  }
}
.trading-tabs {
  border-bottom: 0;
  box-shadow: inset 0 -1px 0 var(--border);
  overflow-y: hidden;
  scrollbar-width: none;
}
.trading-tabs::-webkit-scrollbar {
  display: none;
}
.trading-tabs button {
  margin-bottom: 0;
}
.cb-change.positive {
  color: #00c805;
}
.cb-change.negative {
  color: #ff5000;
}
