/* =============================================================================
   ROB E BANK AI — Quantum Pressure X Workspace Theme
   Premium dark glass aesthetic. Cyan/gold accent palette.
   ============================================================================= */

/* ── Color tokens ────────────────────────────────────────────────────────────── */
:root {
  --qx-bg:           #0a0c12;
  --qx-card-bg:      rgba(8, 10, 20, 0.88);
  --qx-card-border:  rgba(0, 200, 255, 0.12);
  --qx-cyan:         #00c8ff;
  --qx-gold:         #f5a623;
  --qx-success:      #00e676;
  --qx-error:        #ff4444;
  --qx-warn:         #ffaa00;
  --qx-text:         #e8eaf0;
  --qx-text-dim:     #7a8099;
  --qx-text-mid:     #a8b0c8;
}

/* ── Workspace wrapper ───────────────────────────────────────────────────────── */
.qx-workspace {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 100%;
}

/* ── Header card ─────────────────────────────────────────────────────────────── */
.qx-header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #04090f 0%, #070d18 40%, #04090e 100%);
  border: 1px solid rgba(0, 200, 255, 0.22);
  border-radius: 10px;
  padding: 14px 16px 12px;
  box-shadow:
    0 0 32px rgba(0, 200, 255, 0.12),
    0 2px 12px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(0, 200, 255, 0.10);
}

.qx-header::before {
  content: '';
  position: absolute;
  top: -60%;
  left: -30%;
  width: 80%;
  height: 200%;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(0, 200, 255, 0.06) 50%,
    transparent 60%
  );
  animation: qxHeaderReflect 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes qxHeaderReflect {
  0%, 100% { transform: translateX(-100%) skewX(-15deg); opacity: 0; }
  40%       { opacity: 1; }
  50%       { transform: translateX(200%) skewX(-15deg); opacity: 0; }
}

.qx-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.qx-header-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--qx-cyan);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 7px;
}

.qx-header-subtitle {
  font-size: 10px;
  color: var(--qx-text-dim);
  margin-top: 2px;
  letter-spacing: 0.03em;
}

/* ── LIVE badge ──────────────────────────────────────────────────────────────── */
.qx-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 230, 118, 0.12);
  border: 1px solid rgba(0, 230, 118, 0.35);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--qx-success);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qx-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--qx-success);
  animation: qxLivePulse 1.4s ease-in-out infinite;
}

@keyframes qxLivePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.60); }
  50%       { opacity: 0.65; box-shadow: 0 0 0 5px rgba(0, 230, 118, 0); }
}

.qx-live-badge.off {
  background: rgba(122, 128, 153, 0.10);
  border-color: rgba(122, 128, 153, 0.25);
  color: var(--qx-text-dim);
}

.qx-live-badge.off .qx-live-dot {
  background: var(--qx-text-dim);
  animation: none;
}

/* ── Glass card base ─────────────────────────────────────────────────────────── */
.qx-card {
  background: var(--qx-card-bg);
  border: 1px solid var(--qx-card-border);
  border-radius: 8px;
  padding: 13px 14px;
  box-shadow:
    0 0 20px rgba(0, 200, 255, 0.05),
    0 2px 8px rgba(0, 0, 0, 0.40),
    inset 0 1px 0 rgba(0, 200, 255, 0.06);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.qx-card:hover {
  border-color: rgba(0, 200, 255, 0.20);
  box-shadow:
    0 0 24px rgba(0, 200, 255, 0.07),
    0 3px 10px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(0, 200, 255, 0.08);
}

.qx-config-card {
  background:
    radial-gradient(circle at 22% 0%, rgba(0, 200, 255, 0.08), transparent 44%),
    linear-gradient(150deg, rgba(7, 16, 25, 0.96) 0%, rgba(7, 8, 14, 0.98) 100%);
  border-color: rgba(0, 200, 255, 0.28);
  box-shadow:
    0 0 28px rgba(0, 200, 255, 0.14),
    0 2px 10px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(0, 200, 255, 0.12),
    inset 0 0 22px rgba(0, 200, 255, 0.04);
}

.qx-config-title {
  font-size: 12.5px;
  text-transform: none;
  letter-spacing: 0.02em;
}

.qx-card-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--qx-cyan);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.qx-card-title-icon {
  font-size: 12px;
}

/* ── Config panel ────────────────────────────────────────────────────────────── */
.qx-config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}

.qx-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qx-field label {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--qx-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.qx-select,
.qx-input {
  background: rgba(0, 12, 28, 0.70);
  border: 1px solid rgba(0, 200, 255, 0.18);
  border-radius: 6px;
  color: var(--qx-text);
  font-family: inherit;
  font-size: 11px;
  padding: 6px 8px;
  outline: none;
  transition: border-color 0.18s;
  width: 100%;
  box-sizing: border-box;
}

.qx-select:focus,
.qx-input:focus {
  border-color: rgba(0, 200, 255, 0.45);
  box-shadow: 0 0 0 2px rgba(0, 200, 255, 0.08);
}

.qx-select option {
  background: #0a0c12;
}

.qx-config-save-row {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

/* ── Pressure engine panel ───────────────────────────────────────────────────── */
.qx-pressure-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qx-pressure-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.qx-pressure-pair {
  font-size: 13px;
  font-weight: 700;
  color: var(--qx-text);
}

.qx-pressure-pair-sub {
  font-size: 10px;
  color: var(--qx-text-dim);
  margin-top: 1px;
}

/* ── Confidence bar ──────────────────────────────────────────────────────────── */
.qx-confidence-wrap {
  margin-top: 6px;
  padding: 6px;
  border: 1px solid rgba(0, 200, 255, 0.18);
  border-radius: 7px;
  background: rgba(0, 200, 255, 0.035);
  box-shadow:
    0 0 16px rgba(0, 200, 255, 0.08),
    inset 0 1px 0 rgba(0, 200, 255, 0.08);
}

.qx-confidence-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.qx-confidence-label {
  font-size: 9.5px;
  color: var(--qx-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.qx-confidence-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--qx-cyan);
  line-height: 1;
}

.qx-confidence-tier {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qx-tier-sniper  { background: rgba(255, 50, 50, 0.20); color: #ff6060; border: 1px solid rgba(255, 50, 50, 0.35); }
.qx-tier-strong  { background: rgba(0, 200, 255, 0.18); color: var(--qx-cyan); border: 1px solid rgba(0, 200, 255, 0.35); }
.qx-tier-good    { background: rgba(0, 230, 118, 0.15); color: var(--qx-success); border: 1px solid rgba(0, 230, 118, 0.30); }
.qx-tier-caution { background: rgba(255, 170, 0, 0.15); color: var(--qx-warn); border: 1px solid rgba(255, 170, 0, 0.30); }
.qx-tier-wait    { background: rgba(0, 200, 255, 0.12); color: var(--qx-cyan); border: 1px solid rgba(0, 200, 255, 0.34); box-shadow: 0 0 12px rgba(0, 200, 255, 0.16); }

.qx-confidence-bar-track {
  height: 5px;
  background: rgba(0, 200, 255, 0.14);
  border-radius: 3px;
  overflow: hidden;
  box-shadow:
    0 0 14px rgba(0, 200, 255, 0.18),
    inset 0 0 8px rgba(0, 200, 255, 0.10);
}

.qx-confidence-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(0, 200, 255, 0.60) 0%, var(--qx-cyan) 100%);
  transition: width 0.5s ease;
  animation: qxConfidencePulse 2s ease-in-out infinite;
  box-shadow:
    0 0 16px rgba(0, 200, 255, 0.58),
    0 0 32px rgba(0, 200, 255, 0.28);
}

@keyframes qxConfidencePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.75; }
}

/* ── Heatmap ─────────────────────────────────────────────────────────────────── */
.qx-heatmap {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  min-height: 48px;
}

.qx-heat-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 2px 4px;
  border-radius: 5px;
  background: rgba(0, 200, 255, 0.04);
  border: 1px solid rgba(0, 200, 255, 0.08);
  cursor: default;
  transition: transform 0.12s;
  min-width: 0;
}

.qx-heat-cell:hover {
  transform: translateY(-2px);
}

.qx-heat-cell.hot {
  border-color: rgba(0, 200, 255, 0.40);
  animation: qxHeatPulse 2s ease-in-out infinite;
}

.qx-heat-cell.warm {
  border-color: rgba(0, 200, 255, 0.22);
}

.qx-heat-cell.best-m {
  background: rgba(0, 200, 255, 0.18);
  border-color: var(--qx-cyan);
  box-shadow: 0 0 8px rgba(0, 200, 255, 0.30);
}

.qx-heat-cell.best-d {
  background: rgba(245, 166, 35, 0.18);
  border-color: var(--qx-gold);
  box-shadow: 0 0 8px rgba(245, 166, 35, 0.28);
}

@keyframes qxHeatPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(0, 200, 255, 0.15); }
  50%       { box-shadow: 0 0 10px rgba(0, 200, 255, 0.35); }
}

.qx-heat-digit {
  font-size: 10px;
  font-weight: 700;
  color: var(--qx-text);
  line-height: 1;
}

.qx-heat-score {
  font-size: 8px;
  color: var(--qx-text-dim);
  line-height: 1;
}

.qx-heat-bar {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: rgba(0, 200, 255, 0.12);
  overflow: hidden;
  margin-top: 2px;
}

.qx-heat-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--qx-cyan);
  transition: width 0.4s ease;
}

/* ── Rhythm stream ───────────────────────────────────────────────────────────── */
.qx-rhythm-stream {
  display: flex;
  gap: 3px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
  min-height: 26px;
  align-items: center;
}

.qx-warmup-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  min-width: 100%;
}

.qx-warmup-row {
  display: grid;
  grid-template-columns: minmax(88px, 1fr) minmax(90px, 1.4fr) 56px;
  align-items: center;
  gap: 7px;
  width: 100%;
  font-size: 9.5px;
}

.qx-warmup-sym {
  color: var(--qx-text-mid);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qx-warmup-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(0, 200, 255, 0.10);
  overflow: hidden;
}

.qx-warmup-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(0, 200, 255, 0.50), var(--qx-cyan));
  transition: width 0.25s ease;
}

.qx-warmup-count {
  color: var(--qx-text-dim);
  text-align: right;
  white-space: nowrap;
}

.qx-stream-tick {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(122, 128, 153, 0.10);
  color: var(--qx-text-dim);
  border: 1px solid transparent;
  transition: all 0.15s;
}

.qx-stream-tick.match {
  background: rgba(0, 200, 255, 0.20);
  color: var(--qx-cyan);
  border-color: rgba(0, 200, 255, 0.45);
}

.qx-stream-tick.latest {
  border-color: rgba(0, 200, 255, 0.70);
  box-shadow: 0 0 6px rgba(0, 200, 255, 0.30);
}

/* ── Contract intelligence panel ────────────────────────────────────────────── */
.qx-contract-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.qx-contract-box {
  background: rgba(0, 12, 28, 0.60);
  border: 1px solid rgba(0, 200, 255, 0.10);
  border-radius: 7px;
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s;
}

.qx-contract-box:hover {
  border-color: rgba(0, 200, 255, 0.22);
}

.qx-contract-box.selected-m {
  border-color: var(--qx-cyan);
  background: rgba(0, 200, 255, 0.07);
  box-shadow: 0 0 10px rgba(0, 200, 255, 0.12);
}

.qx-contract-box.selected-d {
  border-color: var(--qx-gold);
  background: rgba(245, 166, 35, 0.07);
  box-shadow: 0 0 10px rgba(245, 166, 35, 0.12);
}

.qx-contract-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--qx-text-dim);
}

.qx-contract-digit {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: var(--qx-text);
}

.qx-contract-score {
  font-size: 11px;
  font-weight: 700;
  color: var(--qx-cyan);
}

.qx-contract-box.selected-d .qx-contract-score {
  color: var(--qx-gold);
}

.qx-contract-reasons {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 3px;
}

.qx-contract-reason {
  font-size: 9px;
  color: var(--qx-text-dim);
  line-height: 1.35;
}

/* ── Auto panel ──────────────────────────────────────────────────────────────── */
.qx-auto-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qx-auto-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.qx-auto-status-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--qx-text-mid);
}

.qx-auto-status-text.scanning { color: var(--qx-cyan); }
.qx-auto-status-text.placing  { color: var(--qx-gold); }
.qx-auto-status-text.active   { color: var(--qx-success); }
.qx-auto-status-text.trade_active { color: var(--qx-success); }
.qx-auto-status-text.reconnecting { color: var(--qx-warn); }
.qx-auto-status-text.cooldown { color: var(--qx-warn); }
.qx-auto-status-text.off { color: var(--qx-text-dim); }
.qx-auto-status-text.error    { color: var(--qx-error); }

.qx-auto-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.qx-auto-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(0, 200, 255, 0.04);
  border: 1px solid rgba(0, 200, 255, 0.08);
  border-radius: 6px;
  padding: 6px 4px;
}

.qx-auto-stat-val {
  font-size: 14px;
  font-weight: 800;
  color: var(--qx-text);
  line-height: 1;
}

.qx-auto-stat-val.green  { color: var(--qx-success); }
.qx-auto-stat-val.red    { color: var(--qx-error); }
.qx-auto-stat-val.cyan   { color: var(--qx-cyan); }
.qx-auto-stat-val.gold   { color: var(--qx-gold); }

.qx-auto-stat-lbl {
  font-size: 8.5px;
  color: var(--qx-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.qx-auto-current {
  background: rgba(0, 12, 28, 0.70);
  border: 1px solid rgba(0, 200, 255, 0.10);
  border-radius: 7px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.qx-auto-current-symbol {
  font-size: 12px;
  font-weight: 700;
  color: var(--qx-text);
}

.qx-auto-current-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.qx-auto-current-item {
  font-size: 10px;
  color: var(--qx-text-dim);
}

.qx-auto-current-item span {
  color: var(--qx-text-mid);
  font-weight: 600;
}

/* ── Execute buttons ─────────────────────────────────────────────────────────── */
.qx-exec-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
}

.qx-exec-option {
  display: grid;
  grid-template-rows: 34px 36px;
  gap: 6px;
  min-width: 0;
}

.qx-btn-match,
.qx-btn-differs {
  width: 100%;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qx-btn-match {
  background: linear-gradient(135deg, #041422 0%, #082230 50%, #0b3040 100%);
  border: 1px solid rgba(0, 200, 255, 0.30);
  color: rgba(0, 200, 255, 0.80);
  padding: 10px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.20s;
  letter-spacing: 0.03em;
  text-align: center;
  box-shadow: 0 0 8px rgba(0, 200, 255, 0.08);
}

.qx-btn-match:hover:not(:disabled) {
  background: linear-gradient(135deg, #051c2e 0%, #0a2e40 50%, #104455 100%);
  border-color: var(--qx-cyan);
  color: var(--qx-cyan);
  box-shadow: 0 0 18px rgba(0, 200, 255, 0.28);
  transform: translateY(-1px);
}

.qx-btn-differs {
  background: linear-gradient(135deg, #201200 0%, #321c00 50%, #4a2c00 100%);
  border: 1px solid rgba(245, 166, 35, 0.30);
  color: rgba(245, 166, 35, 0.80);
  padding: 10px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.20s;
  letter-spacing: 0.03em;
  text-align: center;
  box-shadow: 0 0 8px rgba(245, 166, 35, 0.08);
}

.qx-btn-differs:hover:not(:disabled) {
  background: linear-gradient(135deg, #2e1a00 0%, #4a2800 50%, #663c00 100%);
  border-color: var(--qx-gold);
  color: var(--qx-gold);
  box-shadow: 0 0 18px rgba(245, 166, 35, 0.28);
  transform: translateY(-1px);
}

.qx-btn-match:disabled,
.qx-btn-differs:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ── Auto toggle button ──────────────────────────────────────────────────────── */
.qx-btn-auto {
  width: 100%;
  background: linear-gradient(135deg, #041020 0%, #061828 50%, #080c1a 100%);
  border: 1px solid rgba(0, 200, 255, 0.22);
  color: rgba(0, 200, 255, 0.60);
  padding: 10px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s;
  letter-spacing: 0.03em;
  text-align: center;
  box-shadow: 0 0 6px rgba(0, 200, 255, 0.06);
}

.qx-btn-auto:hover:not(:disabled) {
  border-color: rgba(0, 200, 255, 0.50);
  color: var(--qx-cyan);
  box-shadow: 0 0 16px rgba(0, 200, 255, 0.20);
}

.qx-btn-auto.on {
  background: linear-gradient(135deg, #041422 0%, #0a2a40 50%, #0d3850 100%);
  border-color: rgba(0, 200, 255, 0.65);
  color: var(--qx-cyan);
  box-shadow: 0 0 20px rgba(0, 200, 255, 0.28), 0 0 40px rgba(0, 200, 255, 0.10);
  animation: qxAutoPulse 2.2s ease-in-out infinite;
}

.qx-btn-auto.trading {
  background: linear-gradient(135deg, #041808 0%, #082812 50%, #0c3818 100%);
  border-color: rgba(0, 230, 118, 0.65);
  color: var(--qx-success);
  box-shadow: 0 0 24px rgba(0, 230, 118, 0.35), 0 0 48px rgba(0, 230, 118, 0.12);
  animation: qxTradingPulse 0.90s ease-in-out infinite;
  cursor: not-allowed;
  pointer-events: none;
}

.qx-btn-auto:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
}

@keyframes qxAutoPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 200, 255, 0.28), 0 0 40px rgba(0, 200, 255, 0.10); }
  50%       { box-shadow: 0 0 32px rgba(0, 200, 255, 0.46), 0 0 64px rgba(0, 200, 255, 0.18); }
}

@keyframes qxTradingPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(0, 230, 118, 0.35), 0 0 48px rgba(0, 230, 118, 0.12); }
  50%       { box-shadow: 0 0 40px rgba(0, 230, 118, 0.60), 0 0 80px rgba(0, 230, 118, 0.22); }
}

/* ── Proposal info strip ─────────────────────────────────────────────────────── */
.qx-proposal-strip {
  background: rgba(0, 200, 255, 0.05);
  border: 1px solid rgba(0, 200, 255, 0.12);
  border-radius: 6px;
  padding: 0 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  line-height: 1;
  color: var(--qx-text-dim);
  min-height: 34px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.qx-proposal-payout {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: var(--qx-success);
  white-space: nowrap;
}

/* ── Status bar ──────────────────────────────────────────────────────────────── */
.qx-status-bar {
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 10px;
  font-weight: 500;
  display: none;
  min-height: 26px;
}

.qx-status-bar.show { display: block; }
.qx-status-bar.info    { background: rgba(0, 200, 255, 0.08); border: 1px solid rgba(0, 200, 255, 0.18); color: var(--qx-cyan); }
.qx-status-bar.success { background: rgba(0, 230, 118, 0.08); border: 1px solid rgba(0, 230, 118, 0.20); color: var(--qx-success); }
.qx-status-bar.error   { background: rgba(255, 68, 68, 0.08);  border: 1px solid rgba(255, 68, 68, 0.22);  color: var(--qx-error); }
.qx-status-bar.warn    { background: rgba(255, 170, 0, 0.08);  border: 1px solid rgba(255, 170, 0, 0.20);  color: var(--qx-warn); }

/* ── History ─────────────────────────────────────────────────────────────────── */
.qx-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.qx-history-card {
  border-color: rgba(0, 200, 255, 0.18);
}

.qx-history-card.tx-history-card {
  background:
    radial-gradient(circle at 20% 0%, rgba(0, 200, 255, 0.08), transparent 42%),
    linear-gradient(150deg, rgba(8, 14, 24, 0.96), rgba(6, 8, 14, 0.98));
}

.qx-trade-card.trade-card {
  border-color: rgba(0, 200, 255, 0.13);
}

.qx-trade-card.trade-card.won {
  border-color: rgba(0, 230, 118, 0.32);
}

.qx-trade-card.trade-card.lost {
  border-color: rgba(255, 68, 68, 0.30);
}

.qx-trade-card .tc-strategy-badge {
  color: var(--qx-cyan);
  border-color: rgba(0, 200, 255, 0.26);
  background: rgba(0, 200, 255, 0.08);
}

.qx-history-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.qx-hist-stat-box {
  background: rgba(0, 12, 28, 0.55);
  border: 1px solid rgba(0, 200, 255, 0.08);
  border-radius: 6px;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}

.qx-hist-stat-label {
  font-size: 8.5px;
  color: var(--qx-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.qx-hist-stat-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--qx-text);
  line-height: 1;
}

.qx-hist-stat-value.green  { color: var(--qx-success); }
.qx-hist-stat-value.red    { color: var(--qx-error); }
.qx-hist-stat-value.neutral { color: var(--qx-text-mid); }

.qx-history-filter-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.qx-hist-filter-btn {
  background: rgba(0, 200, 255, 0.05);
  border: 1px solid rgba(0, 200, 255, 0.12);
  color: var(--qx-text-dim);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.qx-hist-filter-btn:hover {
  border-color: rgba(0, 200, 255, 0.28);
  color: var(--qx-text-mid);
}

.qx-hist-filter-btn.active {
  background: rgba(0, 200, 255, 0.14);
  border-color: rgba(0, 200, 255, 0.40);
  color: var(--qx-cyan);
}

.qx-history-list {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.qx-history-empty {
  text-align: center;
  color: var(--qx-text-dim);
  font-size: 11px;
  padding: 18px 0;
}

.qx-history-entry {
  background: rgba(0, 12, 28, 0.55);
  border: 1px solid rgba(0, 200, 255, 0.08);
  border-radius: 7px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s;
}

.qx-history-entry:hover {
  border-color: rgba(0, 200, 255, 0.18);
}

.qx-history-entry.won {
  border-left: 3px solid var(--qx-success);
}

.qx-history-entry.lost {
  border-left: 3px solid var(--qx-error);
}

.qx-history-entry.pending {
  border-left: 3px solid var(--qx-warn);
}

.qx-hist-entry-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.qx-hist-entry-symbol {
  font-size: 11px;
  font-weight: 700;
  color: var(--qx-text);
}

.qx-hist-entry-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.qx-hist-entry-type {
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.qx-hist-entry-type.matches {
  background: rgba(0, 200, 255, 0.14);
  color: var(--qx-cyan);
}

.qx-hist-entry-type.differs {
  background: rgba(245, 166, 35, 0.14);
  color: var(--qx-gold);
}

.qx-hist-entry-status {
  font-size: 9.5px;
  font-weight: 700;
}

.qx-hist-entry-status.won  { color: var(--qx-success); }
.qx-hist-entry-status.lost { color: var(--qx-error); }
.qx-hist-entry-status.pending { color: var(--qx-warn); }
.qx-hist-entry-status.error { color: var(--qx-text-dim); }

.qx-hist-entry-bottom {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.qx-hist-entry-detail {
  font-size: 9.5px;
  color: var(--qx-text-dim);
}

.qx-hist-entry-detail span {
  color: var(--qx-text-mid);
}

/* ── Btn variations ──────────────────────────────────────────────────────────── */
.qx-btn-sm {
  background: rgba(0, 200, 255, 0.08);
  border: 1px solid rgba(0, 200, 255, 0.18);
  color: var(--qx-cyan);
  padding: 4px 10px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.qx-btn-sm:hover:not(:disabled) {
  background: rgba(0, 200, 255, 0.16);
  border-color: rgba(0, 200, 255, 0.40);
}

.qx-btn-danger {
  background: rgba(255, 68, 68, 0.08);
  border: 1px solid rgba(255, 68, 68, 0.18);
  color: var(--qx-error);
  padding: 4px 10px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.qx-btn-danger:hover:not(:disabled) {
  background: rgba(255, 68, 68, 0.16);
  border-color: rgba(255, 68, 68, 0.40);
}

/* ── Strategy row icon for QX ────────────────────────────────────────────────── */
.strategy-icon-qx {
  background: radial-gradient(circle at 40% 40%, rgba(0, 200, 255, 0.22), rgba(0, 80, 140, 0.30));
  box-shadow: 0 0 14px rgba(0, 200, 255, 0.18);
}

.strategy-mark-qx {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--qx-cyan) 0%, rgba(0, 200, 255, 0.30) 100%);
  box-shadow: 0 0 8px rgba(0, 200, 255, 0.60);
}

/* ── Scrollbar styling ───────────────────────────────────────────────────────── */
.qx-history-list::-webkit-scrollbar { width: 4px; }
.qx-history-list::-webkit-scrollbar-track { background: transparent; }
.qx-history-list::-webkit-scrollbar-thumb { background: rgba(0, 200, 255, 0.18); border-radius: 2px; }

.qx-rhythm-stream::-webkit-scrollbar { height: 3px; }
.qx-rhythm-stream::-webkit-scrollbar-track { background: transparent; }
.qx-rhythm-stream::-webkit-scrollbar-thumb { background: rgba(0, 200, 255, 0.18); border-radius: 2px; }

/* ── Scan loading spinner ────────────────────────────────────────────────────── */
.qx-scan-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0, 200, 255, 0.20);
  border-top-color: var(--qx-cyan);
  border-radius: 50%;
  animation: qxSpin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes qxSpin {
  to { transform: rotate(360deg); }
}

/* ── Distribution row ────────────────────────────────────────────────────────── */
.qx-dist-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.qx-dist-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qx-dist-label {
  font-size: 9.5px;
  color: var(--qx-text-dim);
  width: 16px;
  text-align: right;
  flex-shrink: 0;
}

.qx-dist-bar-track {
  flex: 1;
  height: 4px;
  background: rgba(0, 200, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.qx-dist-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--qx-cyan);
  transition: width 0.4s ease;
}

.qx-dist-pct {
  font-size: 9px;
  color: var(--qx-text-dim);
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   QX PREMIUM UI ADDITIONS  v20260521-qx-v2
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Rhythm stream placeholder / scanning state ───────────────────────────── */
.qx-stream-placeholder {
  color: var(--qx-text-dim);
  font-size: 10px;
  font-style: italic;
  padding: 10px 4px;
  text-align: center;
  width: 100%;
}

.qx-stream-scanning {
  color: var(--qx-cyan);
  font-size: 10px;
  font-weight: 600;
  padding: 10px 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.qx-stream-scanning::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 2px solid rgba(0, 200, 255, 0.22);
  border-top-color: var(--qx-cyan);
  border-radius: 50%;
  animation: qxSpin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ── Stream legend ────────────────────────────────────────────────────────── */
.qx-stream-legend {
  font-size: 9px;
  color: var(--qx-text-dim);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}

.qx-stream-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.qx-stream-legend-dot.match {
  background: rgba(0, 200, 255, 0.40);
  border: 1px solid rgba(0, 200, 255, 0.60);
}

/* ── Heatmap touch % label ────────────────────────────────────────────────── */
.qx-heat-touch {
  font-size: 7.5px;
  color: var(--qx-text-dim);
  text-align: center;
  line-height: 1;
  margin-top: 1px;
}

/* Sniper cell (score >= 90) */
.qx-heat-cell.sniper {
  background: rgba(255, 50, 50, 0.12);
  border-color: rgba(255, 60, 60, 0.30);
}
.qx-heat-cell.sniper .qx-heat-digit { color: #ff6060; }
.qx-heat-cell.sniper .qx-heat-bar-fill { background: #ff6060; }

/* ── Empty-state hint inside contract boxes ───────────────────────────────── */
.qx-hint {
  font-size: 9px;
  color: var(--qx-text-dim);
  font-style: italic;
  padding: 2px 0;
}

/* ── Contract box recommended glow ───────────────────────────────────────── */
.qx-contract-box.recommended {
  position: relative;
}

.qx-contract-box.recommended::after {
  content: 'AI PICK';
  position: absolute;
  top: 6px;
  right: 7px;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--qx-gold);
  background: rgba(245, 166, 35, 0.14);
  border: 1px solid rgba(245, 166, 35, 0.30);
  border-radius: 3px;
  padding: 1px 4px;
}

.qx-contract-box.selected-m.recommended::after { color: var(--qx-cyan); background: rgba(0,200,255,0.12); border-color: rgba(0,200,255,0.30); }

/* ── Confidence bar tier colours ──────────────────────────────────────────── */
.qx-confidence-bar-fill[data-tier="sniper"] { background: linear-gradient(90deg, #c00, #ff4040); }
.qx-confidence-bar-fill[data-tier="strong"] { background: linear-gradient(90deg, #007bb5, var(--qx-cyan)); }
.qx-confidence-bar-fill[data-tier="good"]   { background: linear-gradient(90deg, #008848, var(--qx-success)); }
.qx-confidence-bar-fill[data-tier="caution"]{ background: linear-gradient(90deg, #a06000, var(--qx-gold)); }
.qx-confidence-bar-fill[data-tier="wait"]   { background: linear-gradient(90deg, rgba(0, 120, 180, 0.58), var(--qx-cyan)); }

/* ── Proposal strip loaded state ──────────────────────────────────────────── */
.qx-proposal-strip.loaded {
  background: rgba(0, 230, 118, 0.05);
  border-color: rgba(0, 230, 118, 0.18);
  color: var(--qx-text-mid);
}

/* ── Execute buttons — active glow when scan result is ready ──────────────── */
.qx-btn-match:not(:disabled) {
  box-shadow: 0 0 14px rgba(0, 200, 255, 0.16);
}

.qx-btn-differs:not(:disabled) {
  box-shadow: 0 0 14px rgba(245, 166, 35, 0.16);
}

/* ── Auto status text trade_active animation ──────────────────────────────── */
.qx-auto-status-text.trade_active {
  color: var(--qx-success);
  animation: qxTextPulse 1.2s ease-in-out infinite;
}

@keyframes qxTextPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

/* ── Auto current tier badge ──────────────────────────────────────────────── */
.qx-auto-current-tier {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(122, 128, 153, 0.12);
  color: var(--qx-text-dim);
  border: 1px solid rgba(122, 128, 153, 0.20);
}

/* ── History entry improved layout ───────────────────────────────────────── */
.qx-hist-entry-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.qx-hist-entry-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.qx-hist-entry-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.qx-hist-entry-time {
  font-size: 8.5px;
  color: var(--qx-text-dim);
}

/* ── Tier badge in history entries ───────────────────────────────────────── */
.qx-hist-tier {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 3px;
}

/* Reuse the confidence-tier colour rules */
.qx-hist-tier.qx-tier-sniper  { background: rgba(255, 50, 50, 0.18); color: #ff6060; border: 1px solid rgba(255,50,50,0.30); }
.qx-hist-tier.qx-tier-strong  { background: rgba(0, 200, 255, 0.14); color: var(--qx-cyan); border: 1px solid rgba(0,200,255,0.28); }
.qx-hist-tier.qx-tier-good    { background: rgba(0, 230, 118, 0.12); color: var(--qx-success); border: 1px solid rgba(0,230,118,0.24); }
.qx-hist-tier.qx-tier-caution { background: rgba(255, 170, 0, 0.12); color: var(--qx-warn); border: 1px solid rgba(255,170,0,0.24); }
.qx-hist-tier.qx-tier-wait    { background: rgba(122,128,153,0.10); color: var(--qx-text-dim); border: 1px solid rgba(122,128,153,0.18); }

/* ── History entry profit colour helpers ──────────────────────────────────── */
.qx-hist-entry-bottom .green { color: var(--qx-success); font-weight: 700; }
.qx-hist-entry-bottom .red   { color: var(--qx-error);   font-weight: 700; }

/* ── Status bar — slightly taller for readability ────────────────────────── */
.qx-status-bar.show {
  display: block;
  animation: qxStatusFade 0.25s ease;
}

@keyframes qxStatusFade {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Workspace two-section split for Config + Pressure Engine ─────────────── */
@media (min-width: 700px) {
  .qx-top-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 9px;
  }
  .qx-top-grid > .qx-card {
    margin: 0;
  }
}

@media (max-width: 699px) {
  .qx-workspace {
    padding-left: 0;
    padding-right: 0;
    gap: 8px;
  }

  .qx-card {
    padding: 11px 11px;
  }

  .qx-header {
    padding: 12px 12px 11px;
  }

  .qx-header-row,
  .qx-pressure-top,
  .qx-auto-status-row,
  .qx-history-header,
  .qx-confidence-label-row {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    min-width: 0;
  }

  .qx-header-title,
  .qx-pressure-pair,
  .qx-auto-current-symbol,
  .qx-hist-entry-symbol {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .qx-config-grid,
  .qx-contract-grid,
  .qx-exec-btns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .qx-auto-stats,
  .qx-history-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

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

  .qx-heat-cell {
    min-height: 43px;
    padding: 4px 1px 3px;
  }

  .qx-heat-digit {
    font-size: 9.5px;
  }

  .qx-heat-score,
  .qx-heat-touch {
    font-size: 7.5px;
  }

  .qx-contract-box,
  .qx-auto-stat,
  .qx-hist-stat-box {
    min-width: 0;
    padding-left: 8px;
    padding-right: 8px;
  }

  .qx-contract-label,
  .qx-auto-stat-lbl,
  .qx-hist-stat-label {
    font-size: 8.5px;
  }

  .qx-contract-digit {
    font-size: 21px;
  }

  .qx-auto-stat-val,
  .qx-hist-stat-value {
    font-size: 12px;
    white-space: nowrap;
  }

  .qx-auto-current-meta {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .qx-auto-current-item {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .qx-btn-match,
  .qx-btn-differs,
  .qx-btn-auto {
    min-height: 34px;
    white-space: nowrap;
    font-size: 10px;
    padding-left: 6px;
    padding-right: 6px;
  }

  .qx-proposal-strip {
    min-height: 31px;
    font-size: 9.5px;
    line-height: 1.25;
  }

  .qx-history-filter-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .qx-hist-filter-btn {
    min-width: 0;
    padding-left: 4px;
    padding-right: 4px;
    white-space: nowrap;
  }

  .qx-history-list {
    max-height: 430px;
  }
}

@media (max-width: 420px) {
  .qx-card {
    padding: 10px 9px;
  }

  .qx-header {
    padding: 11px 10px 10px;
  }

  .qx-header-title {
    font-size: 11.5px;
  }

  .qx-header-subtitle,
  .qx-pressure-pair-sub {
    font-size: 9px;
  }

  .qx-live-badge {
    padding: 3px 7px;
    font-size: 8.5px;
    flex-shrink: 0;
  }

  .qx-config-grid,
  .qx-contract-grid,
  .qx-exec-btns {
    gap: 6px;
  }

  .qx-field label,
  .qx-confidence-label,
  .qx-contract-label,
  .qx-auto-stat-lbl,
  .qx-hist-stat-label {
    font-size: 8px;
  }

  .qx-select,
  .qx-input {
    font-size: 10px;
    padding: 6px 6px;
  }

  .qx-auto-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .qx-history-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .qx-heatmap {
    gap: 2px;
  }

  .qx-heat-cell {
    min-height: 39px;
    border-radius: 4px;
  }

  .qx-heat-digit {
    font-size: 9px;
  }

  .qx-heat-score,
  .qx-heat-touch {
    font-size: 7px;
  }

  .qx-contract-box {
    padding: 9px 7px;
  }

  .qx-contract-digit {
    font-size: 19px;
  }

  .qx-contract-score {
    font-size: 10px;
  }

  .qx-contract-reasons {
    font-size: 8px;
  }

  .qx-auto-stat,
  .qx-hist-stat-box {
    padding: 8px 4px;
  }

  .qx-auto-stat-val,
  .qx-hist-stat-value {
    font-size: 11px;
  }

  .qx-history-filter-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .qx-stream-tick {
    width: 20px;
    height: 20px;
  }

  .qx-hist-filter-btn {
    font-size: 9px;
  }
}
