:root {
  --bg: #05060a;
  --surface: #0b1018;
  --surface-2: #101826;
  --border: rgba(125, 211, 252, 0.12);
  --text: #eef4ff;
  --muted: #7d8aa3;
  --accent: #eef4ff;
  --accent-action: #22d3ee;
  --green: #2ee6b6;
  --red: #ff4d6d;
  --amber: #f5c14a;
  --cyan: #22d3ee;
  --violet: #818cf8;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "Outfit", system-ui, sans-serif;
  --settings-w: 360px;
  --chart-h: 180px;
  --panel-h: 320px;
  --chart-area-h: 48vh;
  --topbar-h: 56px;
  --intel-h: auto;
  --panel-h: min(340px, 38vh);
  --intel-w: 50%;
  --radius: 8px;
  --radius-sm: 6px;
  --text-base: 15px;
  --text-sm: 13px;
  --text-xs: 12px;
  --input-h: 34px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-thumb { background: #27272a; border-radius: 4px; }
*::-webkit-scrollbar-track { background: transparent; }

html, body {
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(900px 480px at 12% -10%, rgba(34, 211, 238, 0.12), transparent 55%),
    radial-gradient(800px 420px at 100% 0%, rgba(129, 140, 248, 0.1), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.09) 1px, transparent 1px);
  background-size: 48px 48px;
}

.app {
  position: relative;
  z-index: 1;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.price {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
}

.price-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.price-row {
  align-items: flex-start;
}

.price-row > span:first-child {
  padding-top: 6px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.9);
  border: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--muted);
  flex-shrink: 0;
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #52525b;
}

.status-pill.running {
  color: var(--text);
}

.status-pill.running .dot {
  background: var(--green);
  animation: status-pulse 1.4s ease-in-out infinite;
}

.status-pill.starting {
  color: var(--amber, #f59e0b);
}

.status-pill.starting .dot {
  background: var(--amber, #f59e0b);
  animation: status-pulse 0.7s ease-in-out infinite;
}

.status-pill.stopping {
  color: var(--muted);
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.settings.is-locked .field-cell:not(.field-live-edit) input,
.settings.is-locked .field-cell:not(.field-live-edit) select,
.settings.is-locked .settings-toggles input,
.settings.is-locked details.settings-more {
  opacity: 0.55;
  pointer-events: none;
}

.settings.is-locked .field-live-edit input {
  border-color: rgba(34, 197, 94, 0.35);
}

.bot-lock-hint {
  margin: 6px 0 0;
  color: var(--amber, #f59e0b);
}

.tog-rails {
  grid-column: 1 / -1;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 6px;
  padding: 8px 10px !important;
  background: rgba(245, 158, 11, 0.05);
  transition: border-color 0.15s, background 0.15s;
}

.tog-rails span {
  font-weight: 600;
  color: #fbbf24;
}

.tog-rails input {
  accent-color: #f59e0b;
}

.tog-rails.is-armed {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

.tog-rails.is-armed span {
  color: #fde68a;
}

.tog-invert {
  grid-column: 1 / -1;
  border: 1px solid rgba(168, 85, 247, 0.28);
  border-radius: 6px;
  padding: 8px 10px !important;
  background: rgba(168, 85, 247, 0.05);
  transition: border-color 0.15s, background 0.15s;
}

.tog-invert span {
  font-weight: 600;
  color: #c084fc;
}

.tog-invert input {
  accent-color: #a855f7;
}

.tog-invert.is-armed {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.12);
}

.tog-invert.is-armed span {
  color: #e9d5ff;
}

.btn.is-busy .btn-label::after {
  content: "…";
  animation: status-pulse 0.8s ease-in-out infinite;
}

/* ── Intel line ── */
.intel-line {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 14px;
  height: 26px;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}

.intel-line .god-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.intel-line .god-item + .god-item::before {
  content: "·";
  margin: 0 10px;
  color: #3f3f46;
}

.intel-line strong {
  color: var(--text);
  font-family: var(--mono);
  font-weight: 500;
}

.intel-line .god-bull strong { color: var(--green); }
.intel-line .god-bear strong { color: var(--red); }
.intel-line .god-go strong { color: var(--green); }
.intel-line .god-watch strong { color: var(--amber); }
.intel-line .god-no strong { color: var(--red); }

/* legacy god chips (fallback) */
.god-chip { border: none; background: none; padding: 0; font-size: inherit; }
.god-bar { display: flex; align-items: center; padding: 0 20px; font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--border); overflow: hidden; white-space: nowrap; }

/* ── Resize handles ── */
.resize-handle {
  flex-shrink: 0;
  position: relative;
  z-index: 6;
  background: transparent;
  touch-action: none;
}

.resize-handle--col {
  width: 5px;
  cursor: col-resize;
}

.resize-handle--row {
  height: 5px;
  cursor: row-resize;
  flex-shrink: 0;
}

.resize-handle:hover,
.resize-handle.is-dragging {
  background: rgba(59, 130, 246, 0.28);
}

body.is-resizing {
  user-select: none;
}

body.is-resizing-x,
body.is-resizing-x * {
  cursor: col-resize !important;
}

body.is-resizing-y,
body.is-resizing-y * {
  cursor: row-resize !important;
}

/* ── Modern top bar ── */
.topbar {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  min-height: var(--topbar-h);
  padding: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.topbar-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-h);
  padding: 0 14px;
}

.topbar-zone + .topbar-zone {
  border-left: 1px solid var(--border);
}

.topbar-zone--market {
  flex-shrink: 0;
}

.topbar-zone--price {
  flex-shrink: 0;
  gap: 8px;
}

.topbar-zone--stats {
  justify-content: flex-end;
  gap: 18px;
  min-width: 0;
}

.topbar-zone--actions {
  flex-shrink: 0;
  gap: 8px;
}

.topbar-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topbar-inline--pair select {
  min-width: 118px;
}

.topbar-inline select {
  height: 32px;
  min-width: 68px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
}

.topbar-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: right;
}

.topbar-stat-val {
  font-size: 14px;
  font-weight: 600;
}

.topbar-price {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.topbar-actions .btn,
.topbar-zone--actions .btn {
  min-width: 76px;
  height: 36px;
  font-size: 13px;
  font-weight: 600;
}

.topbar-label,
.intel-kicker,
.ticket-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

/* legacy topbar classes */
.topbar-group { display: contents; }
.topbar-field { display: contents; }
.topbar-market { display: contents; }
.topbar-price-group { display: contents; }
.topbar-stats { display: contents; }
.topbar-actions { display: contents; }

/* ── ML intel strip ── */
.intel-strip {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  min-height: 48px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
}

.intel-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 0 12px;
  border-right: 1px solid var(--border);
}

.intel-cell--safety {
  padding: 0 10px;
}

.intel-cell--params {
  margin-left: auto;
  border-right: none;
  border-left: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
  padding: 6px 12px;
  gap: 10px;
}

.intel-meta {
  font-size: var(--text-sm);
  color: var(--text);
  white-space: nowrap;
}

.intel-safety {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.intel-safety.ml-safety--ok {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.intel-safety.ml-safety--warn {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.intel-headline {
  flex: 1;
  min-width: 80px;
  padding: 0 12px;
  font-size: var(--text-sm);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border);
}

.intel-param {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.intel-param input {
  width: 64px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
}

.tog-compact {
  font-size: 12px;
  white-space: nowrap;
}

.ml-gauge--compact {
  width: 64px;
  flex-shrink: 0;
}

.ml-gauge--compact .ml-gauge-track {
  height: 6px;
}

/* legacy intel */
.intel-signal,
.intel-sentiment,
.intel-params {
  display: contents;
}

/* ── Order ticket bar ── */
.ticket-bar {
  flex-shrink: 0;
  padding: 8px 14px 6px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ticket-grid {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) 80px 90px 120px auto;
  gap: 10px;
  align-items: end;
}

.ticket-lev {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ticket-lev-labels {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.ticket-lev-labels strong {
  font-size: 16px;
}

.ticket-lev-hint {
  margin-left: auto;
  font-style: normal;
  font-size: var(--text-xs);
}

.ticket-lev input[type="range"] {
  width: 100%;
  height: 5px;
  accent-color: var(--accent-action);
  cursor: pointer;
}

.ticket-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ticket-field input {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
}

.ticket-field--highlight {
  justify-content: flex-end;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.ticket-field--highlight strong {
  font-size: 16px;
  color: #93c5fd;
}

.ticket-manual {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

.btn-ticket {
  flex: 1;
  min-width: 52px;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.manual-toast {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(24, 24, 27, 0.95);
  color: var(--text);
  font-size: 12px;
  font-family: var(--mono);
  line-height: 1.35;
}

.manual-toast.hidden {
  display: none;
}

.manual-toast.is-ok {
  border-color: rgba(22, 199, 132, 0.45);
  color: #86efac;
}

.manual-toast.is-warn {
  border-color: rgba(245, 158, 11, 0.45);
  color: #fcd34d;
}

.manual-toast.is-err {
  border-color: rgba(234, 57, 67, 0.45);
  color: #fca5a5;
}

.ticket-hints {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

.ticket-hints .hint {
  margin: 0;
  flex-shrink: 0;
}

.ticket-hints .hint:empty {
  display: none;
}

.ticket-hints .hint:not(:empty) ~ .hint:not(:empty)::before {
  content: "·";
  margin: 0 8px;
  color: #3f3f46;
}

.ticket-status {
  margin-left: auto;
  color: var(--green);
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-header--slim {
  min-height: 40px;
  padding: 0 12px 0 14px;
  justify-content: space-between;
}

.panel-header-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }

  .topbar-zone {
    border-left: none !important;
    border-top: 1px solid var(--border);
    padding: 8px 12px;
  }

  .topbar-zone--market {
    grid-column: 1 / -1;
    border-top: none;
  }

  .topbar-zone--stats {
    justify-content: flex-start;
  }

  .intel-cell--params {
    flex-wrap: wrap;
    max-width: 100%;
  }

  .intel-strip {
    flex-wrap: wrap;
  }

  .intel-headline {
    flex: 1 1 100%;
    border-right: none;
    border-top: 1px solid var(--border);
    min-height: 32px;
  }

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

  .ticket-lev {
    grid-column: 1 / -1;
  }

  .ticket-manual {
    grid-column: 1 / -1;
  }
}

/* ── Workspace (stacked: chart → ticket → trades) ── */
.workspace {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.main-col,
.center-col {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.chart-stack {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 160px;
  overflow: hidden;
}

.chart-zone {
  flex: 1;
  min-height: 0;
}

/* legacy control deck — unused in modern layout */
.control-deck { display: none; }
.control-grid { display: none; }

/* ── Settings blocks (shared) ── */
.settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.settings-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}

.field-grid {
  display: grid;
  gap: 8px 10px;
  align-items: center;
}

.field-grid.cols-2 {
  grid-template-columns: 1fr 1fr;
}

.field-cell--wide {
  grid-column: 1 / -1;
}

.field-cell--lev {
  grid-template-columns: 1fr;
  gap: 6px;
}

.field-cell--lev .lev-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--muted);
}

.field-cell--lev .lev-head strong {
  color: var(--text);
  font-size: 15px;
}

.field-cell--lev .lev-head em {
  font-style: normal;
  font-size: var(--text-xs);
  margin-left: auto;
}

.field-cell--lev input[type="range"] {
  width: 100%;
  height: 6px;
  margin: 0;
  accent-color: var(--accent-action);
  cursor: pointer;
}

.field-cell {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.field-cell > span:first-child {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.2;
}

.field-cell--value strong {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
}

.price-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
  padding: 2px 0 0;
  overflow: hidden;
}

.price-strip .price {
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.price-strip .signal-action {
  margin-left: auto;
  flex-shrink: 0;
  padding: 2px 6px;
  font-size: 10px;
}

.settings-more {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding-top: 4px;
}

.settings-more summary {
  font-size: 10px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
  padding: 2px 0;
}

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

.settings-more[open] summary {
  color: var(--text);
  margin-bottom: 4px;
}

.settings-more[open] {
  max-height: 76px;
  overflow-y: auto;
}

.settings-toggles {
  flex-shrink: 0;
  padding-top: 2px;
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.action-row .btn {
  width: 100%;
}

.action-row--primary .btn {
  height: 28px;
  font-size: 12px;
}

.field-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 8px;
}

.field-row > span:first-child {
  font-size: 11px;
  color: var(--muted);
}

.field,
.field-cell input,
.field-cell select,
.field-row input,
.field-row select {
  width: 100%;
  height: var(--input-h);
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
}

.field:focus,
.field-cell input:focus,
.field-cell select:focus,
.field-row input:focus,
.field-row select:focus {
  outline: none;
  border-color: #52525b;
}

.hint-compact {
  font-size: var(--text-xs);
  line-height: 1.35;
  white-space: normal;
}

.tog {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--muted);
  cursor: pointer;
  line-height: 1.35;
}

.tog-inline {
  min-height: 28px;
}

.settings-toggles .tog-inline {
  padding-left: 2px;
}

.settings-more .tog-inline {
  padding-left: 46px;
}

.tog input { accent-color: var(--accent-action); }

.hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.hint.pnl-pos { color: var(--green); }
.hint.pnl-neg { color: var(--red); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.hidden {
  display: none !important;
}

.chart-wrap {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

.chart-container {
  position: absolute;
  inset: 0;
}

.chart-ohlc {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  pointer-events: none;
}

.chart-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 14px;
  flex-shrink: 0;
  min-width: 0;
  overflow: hidden;
}

.metrics {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}

.metric {
  font-family: var(--mono);
  font-size: 12px;
}

.metric strong { font-weight: 500; }

.signal-copy {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.position-chip {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
}

.position-chip.hidden { display: none; }

.alerts-line {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 14px 8px;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}

.alert-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(234, 179, 8, 0.1);
  color: var(--amber);
  font-size: 11px;
}

.live-badge {
  font-size: 10px;
  font-weight: 500;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.live-badge.hidden { display: none; }

.signal-action {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
}

.signal-action.long { color: var(--green); }
.signal-action.short { color: var(--red); }
.signal-action.close_long,
.signal-action.close_short { color: var(--amber); }

.muted, .dim { color: var(--muted); }
.mono { font-family: var(--mono); }

.delta-pos { color: var(--green); }
.delta-neg { color: var(--red); }
.side-buy { color: var(--green); }
.side-sell { color: var(--red); }
.pnl-pos { color: var(--green); }
.pnl-neg { color: var(--red); }
.pnl-neutral { color: var(--muted); }

/* ── Bottom panel (trades focus) ── */
/* ── Bottom panel controls ── */
.panel-controls {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.ctrl-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}

.ctrl-pair-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-width: 0;
  flex: 1 1 200px;
  max-width: 100%;
}

.pair-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.pair-chips.is-empty {
  display: none;
}

.pair-chip {
  appearance: none;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
  border-radius: 999px;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.pair-chip:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.55);
  color: #bfdbfe;
}

.pair-chip.is-active {
  background: rgba(59, 130, 246, 0.28);
  border-color: #3b82f6;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.pair-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-pick-coin {
  align-self: center;
  white-space: nowrap;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
}

.coin-pick-hint {
  align-self: center;
  font-size: 0.72rem;
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coin-pick-hint.is-busy {
  opacity: 0.85;
}

.coin-pick-hint.is-ok {
  color: var(--ok, #2f9e6b);
}

.coin-pick-hint.is-err {
  color: var(--danger, #c44);
}

.ctrl-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ctrl-inline--pair select {
  min-width: 118px;
}

.ctrl-inline select {
  height: 32px;
  min-width: 68px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
}

.ctrl-label,
.topbar-label,
.intel-kicker,
.ticket-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

.ctrl-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ctrl-val {
  font-size: 14px;
  font-weight: 600;
}

.ctrl-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.ctrl-actions .btn {
  min-width: 76px;
  height: 34px;
  font-size: 13px;
  font-weight: 600;
}

.train-status {
  font-size: 12px;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.train-status.is-ok {
  color: var(--green);
}

.train-status.is-err {
  color: var(--red);
}

.intel-cell--model {
  gap: 8px;
  flex-wrap: wrap;
  max-width: 280px;
}

.btn-train {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #d8b4fe;
  font-weight: 600;
  min-width: 64px;
}

.btn-train:hover:not(:disabled) {
  background: rgba(168, 85, 247, 0.28);
  border-color: #a855f7;
  color: #f3e8ff;
}

.model-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border);
}

.model-badge--trained {
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.35);
}

.model-badge--global {
  background: rgba(168, 85, 247, 0.12);
  color: #c4b5fd;
  border-color: rgba(168, 85, 247, 0.35);
}

.model-badge--baseline {
  background: rgba(113, 113, 122, 0.18);
  color: #a1a1aa;
  border-color: rgba(113, 113, 122, 0.35);
}

.model-badge--unknown {
  background: transparent;
  color: var(--muted);
}

.panel-controls .intel-strip {
  border-bottom: 1px solid var(--border);
}

.panel-controls .ticket-bar {
  border-top: none;
  padding: 8px 14px 6px;
}

.panel {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: 280px;
  height: var(--panel-h);
  max-height: 72vh;
  background: var(--bg);
  overflow: hidden;
}

.panel-body {
  flex: 1 1 0;
  min-height: 80px;
  position: relative;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--border);
  min-height: 40px;
  flex-shrink: 0;
}

.session-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
  overflow: hidden;
}

.session-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex-shrink: 0;
}

.session-label {
  font-size: var(--text-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.session-value {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
}

.panel-tabs {
  display: flex;
  gap: 0;
  flex-shrink: 0;
}

.panel-tab {
  appearance: none;
  border: none;
  background: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: var(--text-base);
  font-weight: 500;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.panel-tab:hover { color: var(--text); }

.panel-tab.is-active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.panel-pane {
  display: none;
  height: 100%;
  flex-direction: column;
  min-height: 0;
}

.panel-pane.is-active {
  display: flex;
}

.panel-content,
.dock-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px;
  font-size: var(--text-base);
}

.panel-content.empty,
.dock-body.empty {
  color: var(--muted);
  display: flex;
  align-items: center;
}

.panel-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding: 6px 12px 0;
}

.intel-grid {
  display: flex;
  height: 100%;
  min-height: 0;
}

.intel-block {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.intel-block--footprint {
  width: var(--intel-w, 50%);
  flex-shrink: 0;
}

.intel-block--analytics {
  flex: 1;
  min-width: 0;
}

.resize-intel {
  align-self: stretch;
}

.intel-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 8px 16px 4px;
}

.position-status {
  flex-shrink: 0;
  margin: 0;
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: var(--text-base);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.position-status--open {
  color: var(--text);
}

.position-status--wait {
  color: var(--amber);
}

.position-status--idle {
  color: var(--muted);
}

.trade-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(10, 16, 28, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.trade-card.pnl-pos {
  border-color: rgba(46, 230, 182, 0.22);
  background: rgba(8, 28, 24, 0.45);
}

.trade-card.pnl-neg {
  border-color: rgba(255, 77, 109, 0.22);
  background: rgba(28, 10, 16, 0.4);
}

.trade-closed {
  display: inline-flex;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: #041016;
  background: var(--cyan);
  padding: 3px 8px;
  border-radius: 999px;
}

.trade-card-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.trade-id {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.trade-sym {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.trade-side {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.trade-pnl {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.trade-card-meta {
  font-size: 11px;
  color: var(--muted);
}

.fp-row {
  display: grid;
  grid-template-columns: 1fr repeat(3, auto);
  gap: 8px;
  padding: 3px 0;
  font-size: 11px;
  font-family: var(--mono);
}

.an-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 11px;
}

.an-note { margin-top: 6px; color: var(--muted); font-size: 11px; }

.log-output {
  font-family: var(--mono);
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--muted);
}

.log-line { margin: 0; }
.log-line.error { color: var(--red); }
.log-line.warning { color: var(--amber); }

.conf-part {
  display: inline-block;
  margin-right: 8px;
  color: var(--muted);
  font-size: 11px;
}

/* ── Buttons ── */
.btn {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover:not(:disabled) { background: var(--surface-2); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface);
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 11px;
}

.btn-primary {
  background: var(--accent-action);
  border-color: var(--accent-action);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-stop {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.06);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.micro,
.hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.micro.pnl-pos,
.hint.pnl-pos { color: var(--green); }

.micro.pnl-neg,
.hint.pnl-neg { color: var(--red); }

@media (max-width: 1100px) {
  .metric-hide { display: none; }
  .session-stat:nth-child(n+4) { display: none; }
}

.manual-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.manual-actions .btn {
  width: 100%;
  min-height: 42px;
  font-weight: 600;
  font-size: 13px;
}

.btn-buy {
  background: rgba(22, 199, 132, 0.15);
  border-color: rgba(22, 199, 132, 0.45);
  color: #16c784;
}

.btn-buy:hover:not(:disabled) {
  background: rgba(22, 199, 132, 0.25);
}

.btn-sell {
  background: rgba(234, 57, 67, 0.12);
  border-color: rgba(234, 57, 67, 0.4);
  color: #ea3943;
}

.btn-sell:hover:not(:disabled) {
  background: rgba(234, 57, 67, 0.22);
}

.btn-close {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.btn-close:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.2);
}

/* ML Signals & Risk panel */
.ml-panel {
  border: 1px solid rgba(59, 130, 246, 0.15);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.04) 0%, transparent 100%);
}

.ml-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}

.ml-signal-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.ml-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 600;
  border: 1px solid var(--border);
}

.ml-badge--bullish {
  color: var(--green);
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
}

.ml-badge--bearish {
  color: var(--red);
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
}

.ml-badge--neutral {
  color: var(--muted);
  background: var(--surface-2);
}

.ml-confidence {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-left: auto;
}

.ml-sentiment {
  margin-bottom: 10px;
}

.ml-sentiment-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
}

.ml-sentiment-label {
  font-size: var(--text-sm);
  font-weight: 500;
}

.ml-gauge-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red) 0%, var(--surface-2) 50%, var(--green) 100%);
  overflow: hidden;
}

.ml-gauge-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 50%;
  opacity: 0.25;
  pointer-events: none;
}

.ml-gauge-fill.pos { background: var(--green); opacity: 0.35; }
.ml-gauge-fill.neg { background: var(--red); opacity: 0.35; }
.ml-gauge-fill.neu { background: var(--muted); opacity: 0.2; }

.ml-gauge-marker {
  position: absolute;
  top: -2px;
  width: 3px;
  height: 10px;
  margin-left: -1px;
  border-radius: 2px;
  background: var(--text);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.35);
  left: 50%;
  transition: left 0.35s ease;
}

.ml-headline {
  margin-top: 8px;
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--muted);
}

.ml-safety {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: 8px;
}

.ml-safety--ok {
  background: rgba(34, 197, 94, 0.1);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.ml-safety--warn {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.ml-warn-toggle {
  margin-top: 4px;
}

.bot-opt-toggle {
  margin-top: 8px;
}


.ml-conf-field input {
  width: 100%;
  margin-top: 6px;
  height: var(--input-h);
  font-size: 14px;
}

.bot-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bot-actions .btn {
  width: 100%;
  min-height: 48px;
  font-weight: 600;
  font-size: 15px;
}

.btn-start {
  background: rgba(34, 211, 238, 0.14);
  border-color: rgba(34, 211, 238, 0.45);
  color: #67e8f9;
}

.btn-start:hover:not(:disabled) {
  background: rgba(34, 211, 238, 0.24);
}

.btn-stop-bot {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.btn-stop-bot:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.22);
}

.status-pill.running .dot {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.status-pill.bot-running .dot {
  background: #60a5fa;
  box-shadow: 0 0 8px #60a5fa;
}

/* ── Tabbed shell ── */
.trader-chrome {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.shell {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 12, 20, 0.78);
  backdrop-filter: blur(16px);
  min-height: 56px;
  flex-wrap: wrap;
}

.shell-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.shell-mark {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  color: #041016;
  font-size: 13px;
  font-weight: 700;
}

.shell-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.shell-sub {
  display: block;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.shell-market {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-width: 0;
  flex: 0 0 auto;
}

.shell-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shell-field select {
  height: 32px;
  min-width: 108px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
}

.shell-quote {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.shell-price {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.shell-book {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 12px;
  flex: 1 1 420px;
  min-width: 0;
  align-items: end;
}

.book-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.book-stat .ctrl-label {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.book-stat .ctrl-val {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-wallet-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.book-wallet-row .ctrl-val {
  min-width: 0;
}

.wallet-chart-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 6px;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
  cursor: pointer;
}

.wallet-chart-btn:hover {
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.2);
}

.book-stat #bookCurrent {
  font-size: 16px;
  color: var(--green);
}

.book-stat #bookPnl.pnl-pos {
  color: var(--green);
}

.book-stat #bookPnl.pnl-neg {
  color: var(--red);
}

.shell-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.shell-signal-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.shell-signal {
  font-size: 11px;
}

.shell-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}

.shell-trail-only {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.shell-trail-only input {
  accent-color: var(--accent, #2ee6b6);
}

.shell-actions .btn {
  min-width: 72px;
  height: 34px;
  font-weight: 600;
}

.shell-chips {
  flex-shrink: 0;
  padding: 6px 14px 4px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.shell-chips:empty,
.shell-chips.is-empty {
  display: none;
}

.app-nav {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 12, 20, 0.55);
}

.app-nav-btn {
  appearance: none;
  height: 30px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.app-nav-btn:hover {
  color: var(--text);
  border-color: var(--border);
}

.app-nav-btn.is-active {
  color: #041016;
  background: var(--accent-action);
  border-color: var(--accent-action);
}

.app-stages {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.app-tab {
  display: none;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.app-tab.is-active {
  display: flex;
  flex-direction: column;
}

.app-tab--chart .chart-stack,
.app-tab--chart .chart-zone,
.app-tab--chart .chart-wrap {
  flex: 1;
  height: 100%;
}

.app-tab--chart .position-chip {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 3;
  pointer-events: none;
}

.stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 16px;
  padding: 20px;
  overflow: auto;
  align-content: start;
}

.stage-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}

.stage-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 14px;
}

.ticket-bar--stage {
  padding: 0;
  border: none;
  background: transparent;
}

.ticket-bar--stage .ticket-grid {
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.ticket-bar--stage .ticket-lev {
  grid-column: 1 / -1;
}

.ticket-bar--stage .ticket-hints {
  flex-wrap: wrap;
  white-space: normal;
  margin-top: 12px;
}

.ticket-manual--stack {
  flex-direction: column;
  gap: 10px;
}

.ticket-manual--stack .btn-ticket {
  min-height: 48px;
  font-size: 14px;
}

.stage-hotkeys {
  margin-top: 12px;
  font-size: 11px;
}

.app-tab--model {
  overflow: auto;
}

.app-tab--model .intel-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 20px;
  min-height: 0;
  overflow: visible;
  border: none;
  background: transparent;
  align-items: stretch;
}

.app-tab--model .intel-cell {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.app-tab--model .intel-cell--safety {
  justify-content: center;
}

.app-tab--model .intel-headline {
  grid-column: 1 / -1;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  min-height: auto;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}

.app-tab--model .intel-cell--params {
  grid-column: 1 / -1;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-left: 0;
  border-left: 1px solid var(--border);
  background: var(--surface);
}

.app-tab--model .ml-gauge--compact {
  width: 100%;
}

@media (max-width: 1100px) {
  .shell {
    flex-wrap: wrap;
    height: auto;
    min-height: 0;
  }

  .shell-market {
    flex: 1 1 100%;
    order: 5;
  }

  .shell-quote {
    margin-left: auto;
  }

  .stage-grid,
  .app-tab--model .intel-strip {
    grid-template-columns: 1fr;
  }

  .desk-settings {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Multi-slot desk ── */
.app-tab--desk.is-active {
  display: flex;
}

.desk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "opens history";
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.desk-opens {
  grid-area: opens;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: rgba(5, 6, 10, 0.45);
}

.slot-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
  padding: 8px 10px 6px;
  border-bottom: 1px solid var(--border);
}

.slot-toolbar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}

.slot-sorts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.slot-sort {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
}

.slot-sort:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.slot-sort.is-active {
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.12);
}

.desk-tpsl {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}

.sl-cap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sl-cap-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.sl-cap input {
  width: 76px;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
}

.sl-cap input:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.45);
}

.sl-cap input::placeholder {
  color: var(--muted);
  font-weight: 500;
}

.sl-cap-set {
  appearance: none;
  border: 1px solid rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.12);
  color: #67e8f9;
  border-radius: 999px;
  padding: 4px 12px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
}

.sl-cap-set:hover:not(:disabled) {
  background: rgba(34, 211, 238, 0.22);
}

.sl-cap-set:disabled {
  opacity: 0.5;
  cursor: default;
}

.slot-board {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px 10px;
  overflow: auto;
  align-content: stretch;
  min-width: 0;
  min-height: 0;
  flex: 1;
}

.desk-history {
  grid-area: history;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--border);
  background: rgba(8, 12, 20, 0.4);
}

.desk-history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.desk-history-head .stage-title {
  margin: 0;
}

.desk-history-meta {
  font-family: var(--mono);
  font-size: 11px;
  text-align: right;
  color: var(--muted);
}

.desk-history .panel-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
}

.desk-history .panel-content.empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot-empty {
  grid-column: 1 / -1;
  padding: 28px 8px;
  text-align: center;
  font-size: 13px;
}

.slot-card {
  appearance: none;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 78px;
  align-items: center;
  gap: 4px 12px;
  min-width: 0;
  min-height: 72px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(10, 16, 28, 0.82);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.slot-card:focus-visible {
  outline: 1px solid var(--cyan);
  outline-offset: 1px;
}

.slot-card.is-active {
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: inset 0 1px 0 rgba(34, 211, 238, 0.12), 0 0 20px rgba(34, 211, 238, 0.08);
}

.slot-card.is-profit {
  background: rgba(8, 28, 24, 0.78);
  border-color: rgba(46, 230, 182, 0.38);
  box-shadow: inset 0 1px 0 rgba(46, 230, 182, 0.12), 0 0 24px rgba(46, 230, 182, 0.06);
}

.slot-card.is-loss {
  background: rgba(28, 10, 16, 0.78);
  border-color: rgba(255, 77, 109, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 77, 109, 0.1), 0 0 24px rgba(255, 77, 109, 0.06);
}

.slot-card.is-flat {
  opacity: 0.88;
}

.slot-id {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.slot-sym-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.slot-sym {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-used {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.slot-side {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.slot-side.is-long { color: var(--green); }
.slot-side.is-short { color: var(--red); }

.slot-mid {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slot-rail-wrap {
  position: relative;
  min-width: 0;
}

.slot-rail-labs {
  position: relative;
  height: 30px;
  overflow: visible;
}

.slot-lab {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.slot-lab.lane-1 { top: 10px; }
.slot-lab.lane-2 { top: 20px; }
.slot-lab.sl { color: var(--red); }
.slot-lab.lo { color: #f97316; }
.slot-lab.hi { color: var(--amber); }
.slot-lab.tp { color: var(--green); }
.slot-lab.now { color: #eef4ff; z-index: 2; }
.slot-lab.now.pnl-pos { color: var(--green); }
.slot-lab.now.pnl-neg { color: var(--red); }

.slot-rail {
  position: relative;
  height: 14px;
  border-radius: 99px;
  background: linear-gradient(
    90deg,
    rgba(255, 77, 109, 0.28) 0%,
    rgba(249, 115, 22, 0.16) 28%,
    rgba(238, 244, 255, 0.14) 50%,
    rgba(245, 193, 74, 0.16) 72%,
    rgba(46, 230, 182, 0.28) 100%
  );
}

.slot-dot {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px rgba(5, 6, 10, 0.72);
}

.slot-dot.sl { background: var(--red); }
.slot-dot.lo { background: #f97316; }
.slot-dot.ent {
  width: 9px;
  height: 9px;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(5, 6, 10, 0.8), 0 0 8px rgba(255, 255, 255, 0.35);
}
.slot-dot.hi { background: var(--amber); }
.slot-dot.tp { background: var(--green); }

.slot-now-bar {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.55);
  z-index: 3;
  pointer-events: none;
}

.slot-meta {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-meta.is-up { color: var(--green); }
.slot-meta.is-down { color: var(--red); }

.slot-pnl {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--mono);
  flex-shrink: 0;
}

.slot-pnl strong {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
}

.slot-pnl span {
  font-size: 10px;
  color: var(--muted);
}

.slot-pnl .pnl-pos { color: var(--green); }
.slot-pnl .pnl-neg { color: var(--red); }

.slot-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.slot-row strong {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.slot-row strong.pnl-pos {
  color: var(--green);
}

.slot-row strong.pnl-neg {
  color: var(--red);
}

.slot-chg {
  font-family: var(--mono);
  font-size: 11px;
}

.slot-vol,
.slot-sig,
.slot-pos {
  font-size: 11px;
  color: var(--muted);
}

.slot-pos.pnl-pos,
.slot-pos.pnl-neg {
  font-family: var(--mono);
  font-weight: 600;
}

.desk-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--border);
  background: transparent;
}

.desk-settings .ticket-lev {
  flex: 1 1 220px;
  min-width: 180px;
}

.desk-settings .intel-param {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.desk-settings .intel-param input {
  width: 88px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
}

.desk-settings .hint {
  flex: 1 1 100%;
  margin: 0;
}

.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  flex-shrink: 0;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.chart-pair-label {
  font-size: 14px;
  letter-spacing: -0.02em;
}

.chart-headline {
  flex-shrink: 0;
  margin: 0;
  padding: 6px 16px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}

.app-tab--chart.is-active {
  display: flex;
  flex-direction: column;
}

@media (max-width: 900px) {
  html, body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app,
  .trader-chrome,
  .app-stages,
  .app-tab,
  .app-tab.is-active,
  .app-tab--desk.is-active {
    height: auto;
    min-height: 0;
    overflow: visible;
    flex: none;
  }

  .app {
    min-height: 100%;
  }

  .shell {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px 10px;
    padding: 8px 10px;
  }

  .shell-brand { grid-column: 1; }
  .shell-sub { display: none; }
  .shell-market { display: none; }
  .shell-stats {
    grid-column: 1 / -1;
    justify-content: space-between;
    gap: 8px;
  }
  .shell-actions { grid-column: 2; grid-row: 1; }
  .shell-book {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    flex: unset;
  }

  .desk {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
      "opens"
      "history";
    height: auto;
    overflow: visible;
  }

  .slot-board,
  .desk-opens,
  .desk-history,
  .desk-history .panel-content {
    overflow: visible;
    height: auto;
    max-height: none;
    flex: none;
  }

  .desk-history {
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .slot-board {
    padding: 8px 10px;
  }

  .slot-card {
    grid-template-columns: 108px minmax(0, 1fr) 68px;
    min-height: 68px;
    padding: 7px 10px;
    gap: 3px 8px;
  }
}

.wallet-pop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(5, 6, 10, 0.62);
}

.wallet-pop[hidden] {
  display: none;
}

.wallet-pop-card {
  width: min(920px, 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0b1018;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.wallet-pop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 8px;
}

.wallet-pop-head strong {
  display: block;
  font-size: 13px;
}

.wallet-pop-now {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 2px;
  font-size: 18px;
}

.wallet-now-wallet { color: var(--cyan); }
.wallet-now-current { color: var(--green); }

.wallet-pop-close {
  appearance: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.wallet-pop-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 0 14px 8px;
}

.wallet-pop-ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wallet-range-btn {
  appearance: none;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.wallet-range-btn:hover {
  color: var(--text);
}

.wallet-range-btn.is-active {
  color: #041016;
  background: var(--accent-action);
  border-color: var(--accent-action);
}

.wallet-pop-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
}

.wallet-leg::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 99px;
  vertical-align: 1px;
}

.wallet-leg.is-wallet::before { background: var(--cyan); }
.wallet-leg.is-current::before { background: var(--green); }
.wallet-leg.is-start::before { background: var(--green); }
.wallet-leg.is-stop::before { background: var(--red); }
.wallet-leg.is-flatten::before { background: var(--amber); }

.wallet-pop-chart-wrap {
  position: relative;
  margin: 0 8px;
}

.wallet-pop-chart {
  width: 100%;
  height: 340px;
}

.wallet-pop-tip {
  position: absolute;
  z-index: 2;
  min-width: 168px;
  max-width: 240px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0b1018;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
}

.wallet-pop-tip strong {
  display: block;
  font-size: 13px;
}

.wallet-pop-tip .tip-wallet { color: var(--cyan); }
.wallet-pop-tip .tip-current { color: var(--green); }

.wallet-pop-tip .tip-time {
  color: var(--muted);
  font-size: 11px;
}

.wallet-pop-tip .tip-event {
  margin-top: 4px;
  font-size: 11px;
}

.wallet-pop-tip .tip-event.is-start { color: var(--green); }
.wallet-pop-tip .tip-event.is-stop { color: var(--red); }
.wallet-pop-tip .tip-event.is-flatten { color: var(--amber); }

.wallet-pop-canvas {
  display: block;
  width: 100%;
  height: 220px;
}

.wallet-pop-hint {
  margin: 0;
  padding: 8px 14px 12px;
  font-size: 11px;
}

@media (max-width: 720px) {
  .wallet-pop-chart { height: 260px; }
}

.slot-card.is-expanded {
  grid-template-rows: auto auto;
}

.slot-expand {
  display: none;
  grid-column: 1 / -1;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}

.slot-card.is-expanded .slot-expand {
  display: flex;
}

.slot-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slot-menu-btn {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(10, 16, 28, 0.9);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.slot-menu-btn span {
  font-size: 13px;
  font-weight: 600;
}

.slot-menu-btn em {
  font-family: var(--mono);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.slot-menu-btn[data-action="tp_breakeven"] em,
.slot-menu-btn[data-action="tp_highest"] em {
  color: var(--green);
}

.slot-menu-btn[data-action="sl_worst"] em {
  color: var(--red);
}

.slot-menu-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.slot-expand-hint {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 420px) {
  .slot-card {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }

  .slot-card.is-expanded {
    grid-template-rows: auto auto auto;
  }

  .slot-id { grid-column: 1; }
  .slot-pnl { grid-column: 2; grid-row: 1; }
  .slot-mid { grid-column: 1 / -1; }

  .shell-actions .btn {
    min-width: 64px;
    padding: 0 10px;
  }
}

.btn-logout {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  min-width: 88px;
  font-weight: 650;
}

.btn-logout:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.shell-who {
  font-size: var(--text-sm);
  font-weight: 600;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
}

.view-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(234, 179, 8, 0.14);
  border-bottom: 1px solid rgba(234, 179, 8, 0.35);
  color: var(--text);
  font-size: var(--text-sm);
  z-index: 3;
}

.view-banner.hidden,
.view-banner[hidden] {
  display: none;
}

.admin-user-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  width: 100%;
  margin-bottom: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.admin-user-head:hover strong {
  text-decoration: underline;
}

body.auth-body {
  overflow: auto;
  display: grid;
  place-items: center;
  min-height: 100%;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(400px, calc(100% - 32px));
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.auth-brand { margin-bottom: 20px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form .btn-start { width: 100%; justify-content: center; }
.auth-error { color: var(--red); font-size: var(--text-sm); }

body.admin-page {
  overflow: auto;
}
body.admin-page .app {
  height: auto;
  min-height: 100vh;
  overflow: visible;
}
.admin-main { padding: 20px 24px 48px; max-width: 1180px; }
.admin-lead { margin: 0 0 16px; max-width: 62ch; }
.admin-once {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: var(--text-sm);
}
.admin-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 18px;
}
.admin-tab[hidden] { display: none; }
.admin-form, .admin-list-wrap { display: flex; flex-direction: column; gap: 10px; }
.admin-form { max-width: 420px; }
.admin-check { display: flex; gap: 8px; align-items: center; font-size: var(--text-sm); color: var(--muted); }
.admin-user {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--surface);
}
.admin-user-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.admin-user-top .admin-user-head {
  width: auto;
  margin: 0;
  flex: 1 1 auto;
}
.admin-user-top .btn-primary { margin-left: auto; }
.admin-user-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.admin-pill {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.admin-pill.is-on {
  color: #041016;
  background: var(--green);
  border-color: var(--green);
}
.admin-pill.is-off {
  color: var(--muted);
  background: var(--surface-2);
}
.admin-key { font-size: var(--text-xs); }
.admin-desk-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 12px 0;
  margin: 10px 0 12px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.admin-desk-stats .admin-stat-current { font-size: 16px; }
.admin-user-actions, .admin-keys { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-keys input { height: var(--input-h); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: 0 8px; border-radius: 4px; }
.admin-transfer-form { max-width: 720px; }
.admin-transfer-form select,
.admin-transfer-form input { height: var(--input-h); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: 0 8px; border-radius: 4px; width: 100%; }
.admin-transfer-out {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: pre-wrap;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.45;
  max-width: 720px;
}

@media (max-width: 1100px) {
  .admin-desk-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .admin-desk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-user-top .btn-primary { margin-left: 0; }
}



