/* US Top 50 Scanner — Mobile-first dark UI */

:root {
  --bg: #0a0e17;
  --surface: #111827;
  --surface2: #1a2234;
  --border: #1e2a3a;
  --text: #e5e7eb;
  --text-dim: #6b7280;
  --green: #00e676;
  --red: #ff1744;
  --blue: #2196f3;
  --yellow: #ffc107;
  --radius: 12px;
  --font: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html { font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* Sticky header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px 6px;
  transition: background 0.3s;
}
/* Header fresh blink — subtle green glow when data is recent */
@keyframes header-pulse {
  0%, 100% { border-bottom-color: var(--green); box-shadow: 0 1px 8px rgba(0,230,118,0.15); }
  50% { border-bottom-color: rgba(0,230,118,0.3); box-shadow: 0 1px 4px rgba(0,230,118,0.05); }
}
.header--fresh {
  border-bottom: 2px solid var(--green);
  animation: header-pulse 3s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .header--fresh { animation: none; } }
body.reduce-motion .header--fresh { animation: none !important; }

.header__top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header__title {
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
  margin-right: auto;
}
/* Header indices scrolling ticker */
.header__indices {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
  height: 20px;
  margin: 0 6px;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.header__indices.scrolling .indices-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 6px;
  animation: indicesScroll 28s linear infinite;
}
.indices-track { line-height: 20px; }
@keyframes indicesScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.idx-item {
  font-size: 0.62rem;
  white-space: nowrap;
}
.idx-item b {
  color: var(--text);
  font-weight: 700;
  margin-right: 2px;
}
.idx-horizon {
  font-size: 0.58rem;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 600;
  margin: 0 1px;
}
.idx-horizon.positive { background: rgba(0,230,118,0.1); color: var(--green); }
.idx-horizon.negative { background: rgba(255,23,68,0.1); color: var(--red); }
.idx-macro {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.62rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  margin: 0 2px;
  white-space: nowrap;
}
.idx-macro b { font-weight: 800; font-size: 0.68rem; }
.idx-macro.band-calm     { background: rgba(0,230,118,0.18);  color: #00e676; }
.idx-macro.band-low      { background: rgba(102,187,106,0.18); color: #66bb6a; }
.idx-macro.band-neutral  { background: rgba(255,193,7,0.18);  color: #ffc107; }
.idx-macro.band-elevated { background: rgba(255,152,0,0.18);  color: #ff9800; }
.idx-macro.band-panic    { background: rgba(255,82,82,0.22);  color: #ff5252; }
.idx-sep {
  color: var(--border);
  font-size: 0.55rem;
  margin: 0 2px;
}

.header__session {
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface2);
}
.header__status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}
.header--fresh .header__status-dot {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}
.header__toggle-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}
.header__toggle-btn:active { background: var(--surface2); }
.header__toggle-btn.active { color: var(--blue); border-color: var(--blue); }
.header__info-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.header__info-bar > span {
  font-size: 0.62rem;
  color: var(--text-dim);
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface2);
  white-space: nowrap;
}
.header__source { border-left: 2px solid var(--blue); }
.header__rate { border-left: 2px solid var(--green); }
.header__next { border-left: 2px solid var(--yellow); }
.header__updated { border-left: 2px solid var(--text-dim); }

/* Compact controls row: Search + Positions + Activity on one line */
.controls-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 6px;
  position: sticky;
  top: 56px;
  z-index: 99;
  background: var(--bg);
}
.controls-row__search {
  flex: 1;
  min-width: 0;
}
.controls-row__search input {
  width: 100%;
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.8rem;
  outline: none;
}
.controls-row__search input:focus { border-color: var(--blue); }
.controls-row__search input::placeholder { color: var(--text-dim); }
.controls-row__btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
}
.controls-row__btn:active { background: var(--surface2); }
.controls-row__btn.expanded { color: var(--blue); border-color: var(--blue); }
.controls-row__count {
  font-size: 0.6rem;
  background: var(--surface2);
  padding: 1px 5px;
  border-radius: 999px;
  color: var(--text-dim);
}
.controls-row__badge {
  font-size: 0.5rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0,230,118,0.15);
  color: var(--green);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  animation: pulse-badge 2s ease-in-out infinite;
}
.controls-row__arrow {
  font-size: 0.55rem;
  color: var(--text-dim);
  transition: transform 0.2s;
}
.controls-row__btn.expanded .controls-row__arrow { transform: rotate(0deg); }
.controls-row__btn:not(.expanded) .controls-row__arrow { transform: rotate(-90deg); }
/* Hide Activity & Jenie on mobile — accessed via desktop only */
@media (max-width: 768px) {
  #scanLogToggle, #agentToggle { display: none; }
}

/* Stock Position List */
.position-list {
  margin: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
.position-list:not(.expanded) { display: none; }
.position-list__body {
  display: block;
  padding: 6px 10px 8px;
}
.position-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.pos-chip {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-dim);
}
.pos-chip.in-scan {
  color: var(--text);
  border-color: rgba(0,230,118,0.3);
}
.pos-chip.in-scan.up {
  border-color: var(--green);
  color: var(--green);
}
.pos-chip.in-scan.down {
  border-color: var(--red);
  color: var(--red);
}
.pos-chip.not-in-scan {
  opacity: 0.45;
}
.pos-chip.selected {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  opacity: 1;
}
.pos-chip .pos-price {
  font-weight: 400;
  font-size: 0.6rem;
  margin-left: 3px;
  opacity: 0.7;
}
.pos-chip .pos-change {
  font-size: 0.6rem;
  margin-left: 2px;
}

/* ── Live Trading Activity — Scan Log ── */
.scan-log {
  margin: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
.scan-log:not(.expanded) { display: none; }
@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.scan-log__count-bar {
  padding: 4px 10px;
  border-top: 1px solid var(--border);
}
.scan-log__count {
  font-size: 0.62rem;
  color: var(--text-dim);
}
.scan-log__body {
  display: block;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.scan-log__empty {
  padding: 16px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-dim);
}
.scan-log__entries {
  padding: 0 6px 6px;
}

/* Scan log entry row */
.sl-entry {
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 2px;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}
.sl-entry:hover { background: var(--surface2); }
.sl-entry.sl-sig-strong-buy { border-left-color: var(--green); background: rgba(0,230,118,0.04); }
.sl-entry.sl-sig-buy { border-left-color: #66ffa6; background: rgba(0,230,118,0.02); }
.sl-entry.sl-sig-sell { border-left-color: #ff6e7a; background: rgba(255,23,68,0.02); }
.sl-entry.sl-sig-strong-sell { border-left-color: var(--red); background: rgba(255,23,68,0.04); }
.sl-entry.sl-sig-hold { border-left-color: var(--border); }

.sl-row1 {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sl-time {
  font-size: 0.58rem;
  color: var(--text-dim);
  font-family: 'SF Mono', 'Fira Code', monospace;
  min-width: 58px;
}
.sl-symbol {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  min-width: 48px;
}
.sl-price {
  font-size: 0.72rem;
  color: var(--text);
  font-weight: 500;
}
.sl-change {
  font-size: 0.65rem;
  font-weight: 600;
}
.sl-change.positive { color: var(--green); }
.sl-change.negative { color: var(--red); }
.sl-rec {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-left: auto;
}
.sl-rec-strong-buy { background: rgba(0,230,118,0.2); color: var(--green); }
.sl-rec-buy { background: rgba(0,230,118,0.12); color: #66ffa6; }
.sl-rec-hold { background: rgba(255,193,7,0.12); color: var(--yellow); }
.sl-rec-sell { background: rgba(255,23,68,0.12); color: #ff6e7a; }
.sl-rec-strong-sell { background: rgba(255,23,68,0.2); color: var(--red); }

/* Tags */
.sl-tag {
  font-size: 0.5rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sl-tag-pos { background: rgba(33,150,243,0.15); color: var(--blue); }
.sl-tag-wl { background: rgba(255,193,7,0.15); color: var(--yellow); }

/* Row 2: horizon predictions */
.sl-row2 {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  flex-wrap: wrap;
}
.sl-horizon {
  font-size: 0.58rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
}
.sl-horizon.sl-buy { background: rgba(0,230,118,0.1); color: #66ffa6; }
.sl-horizon.sl-sell { background: rgba(255,23,68,0.1); color: #ff6e7a; }
.sl-horizon.sl-hold { background: rgba(255,255,255,0.05); color: var(--text-dim); }
.sl-pct {
  font-weight: 600;
  margin-left: 2px;
}
.sl-conf {
  display: inline-block;
  width: 30px;
  height: 3px;
  border-radius: 2px;
  background: var(--surface2);
  position: relative;
  vertical-align: middle;
  margin-left: auto;
}
.sl-conf-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 2px;
  background: var(--blue);
}
.sl-conf-pct {
  font-size: 0.52rem;
  color: var(--text-dim);
  margin-left: 2px;
}

/* Mobile tightening */
@media (max-width: 480px) {
  .sl-time { display: none; }
  .sl-symbol { min-width: 36px; font-size: 0.74rem; }
  .sl-price { font-size: 0.68rem; }
  .sl-horizon { font-size: 0.54rem; padding: 1px 4px; }
  .sl-entry { padding: 5px 6px; }
  .sl-row1 { gap: 4px; }
  .sl-row2 { gap: 3px; }
  .scan-log__count { font-size: 0.6rem; }
  .controls-row__btn span:first-child { font-size: 0.65rem; }
  .controls-row__search input { padding: 6px 8px; font-size: 0.75rem; }
  .header__title { font-size: 0.95rem; }
  .controls-row { top: 50px; }
  .chips { top: 86px; }
}

@media (prefers-reduced-motion: reduce) {
  .scan-log__badge { animation: none; }
}
body.reduce-motion .scan-log__badge { animation: none !important; }

/* Filter chips */
.chips {
  display: flex;
  gap: 6px;
  padding: 6px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: 96px;
  z-index: 98;
  background: var(--bg);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}
.chip.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.chip[data-filter="watchlist"] {
  border-color: var(--yellow);
  color: var(--yellow);
}
.chip[data-filter="watchlist"].active {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #000;
}
/* DIY toggle — hidden chips */
.chip[data-diy] { display: none; }
.chips.diy-open .chip[data-diy] { display: inline; }
.chip--diy {
  background: transparent;
  border: 1px dashed var(--text-dim);
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 5px 10px;
}
.chip--diy.active {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(33,150,243,0.1);
}

/* Settings bar */
.settings-bar {
  display: flex;
  justify-content: flex-end;
  padding: 0 16px 6px;
}
.settings-bar label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-dim);
  cursor: pointer;
}

/* Card grid */
.card-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 0 12px 80px;
}
@media (min-width: 640px) {
  .card-list { grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 16px 80px; }
  .card-list.single-card { grid-template-columns: 1fr; }
}

/* Inverse pair separator */
.inverse-pair-sep { grid-column: 1 / -1; height: 2px; background: linear-gradient(90deg, transparent, #3b82f6, transparent); margin: 4px 0; }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.3s;
}
.card.glow-green { box-shadow: 0 0 12px rgba(0,230,118,0.25); }
.card.glow-red { box-shadow: 0 0 12px rgba(255,23,68,0.25); }

/* Blink animation */
@keyframes blink-green {
  0%, 100% { box-shadow: 0 0 4px rgba(0,230,118,0.1); }
  50% { box-shadow: 0 0 16px rgba(0,230,118,0.4); }
}
@keyframes blink-red {
  0%, 100% { box-shadow: 0 0 4px rgba(255,23,68,0.1); }
  50% { box-shadow: 0 0 16px rgba(255,23,68,0.4); }
}
.card.blink-up-fast { animation: blink-green 0.6s infinite; }
.card.blink-up-slow { animation: blink-green 2s infinite; }
.card.blink-down-fast { animation: blink-red 0.6s infinite; }
.card.blink-down-slow { animation: blink-red 2s infinite; }

@media (prefers-reduced-motion: reduce) {
  .card.blink-up-fast, .card.blink-up-slow,
  .card.blink-down-fast, .card.blink-down-slow { animation: none; }
  .card.blink-up-fast, .card.blink-up-slow { box-shadow: 0 0 8px rgba(0,230,118,0.3); }
  .card.blink-down-fast, .card.blink-down-slow { box-shadow: 0 0 8px rgba(255,23,68,0.3); }
}
/* User toggle for reduced motion */
body.reduce-motion .card { animation: none !important; }
body.reduce-motion .card.blink-up-fast, body.reduce-motion .card.blink-up-slow { box-shadow: 0 0 8px rgba(0,230,118,0.3); }
body.reduce-motion .card.blink-down-fast, body.reduce-motion .card.blink-down-slow { box-shadow: 0 0 8px rgba(255,23,68,0.3); }

/* Rank badge */
.rank-badge {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--yellow);
  background: rgba(255,193,7,0.15);
  padding: 1px 5px;
  border-radius: 4px;
  margin-right: 4px;
  min-width: 22px;
  text-align: center;
}
.rank-badge.rank-pos {
  color: var(--text-dim);
  background: rgba(255,255,255,0.08);
}

/* Card header */
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 6px;
}
.card__symbol {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.card__badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.card__badge.up { background: rgba(0,230,118,0.15); color: var(--green); }
.card__badge.down { background: rgba(255,23,68,0.15); color: var(--red); }
.card__badge.neutral { background: rgba(255,255,255,0.08); color: var(--text-dim); }
/* Regime badges */
.card__badge.regime-parabolic-up { background: rgba(0,230,118,0.25); color: #00ff88; font-weight: 700; }
.card__badge.regime-parabolic-down { background: rgba(255,23,68,0.25); color: #ff4466; font-weight: 700; }
.card__badge.regime-steady-up { background: rgba(0,230,118,0.15); color: var(--green); }
.card__badge.regime-steady-down { background: rgba(255,23,68,0.15); color: var(--red); }
.card__badge.regime-flat { background: rgba(255,193,7,0.15); color: #ffc107; }
.card__badge.regime-choppy { background: rgba(255,255,255,0.08); color: var(--text-dim); }

/* Regime timeline (v9) */
.regime-timeline { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.regime-timeline-item { display: inline-flex; align-items: center; gap: 2px; }
.regime-timeline-item.current .card__badge { box-shadow: 0 0 4px rgba(255,255,255,0.2); }
.regime-time { font-size: 0.5rem; color: var(--text-dim); opacity: 0.8; }
.regime-arrow { color: var(--text-dim); font-size: 0.5rem; margin: 0 1px; }
.regime-trans { font-size: 0.5rem; padding: 1px 4px; border-radius: 3px; margin-left: 4px; font-weight: 600; }
.regime-trans-pos { background: rgba(0,230,118,0.2); color: #00e676; }
.regime-trans-neg { background: rgba(255,23,68,0.2); color: #ff4466; }
.regime-trans-def { background: rgba(255,23,68,0.3); color: #ff4466; animation: pulse-defense 1.5s infinite; }

/* 5m Surge badge on cards */
.surge-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 0.6rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; animation: surge-pulse 1.2s ease-in-out infinite; text-transform: uppercase; letter-spacing: 0.03em; }
.surge-badge.positive { background: rgba(0,230,118,0.2); color: #00e676; }
.surge-badge.negative { background: rgba(255,23,68,0.2); color: #ff4466; }
@keyframes surge-pulse { 0%,100% { opacity: 1; box-shadow: 0 0 4px rgba(0,230,118,0.3); } 50% { opacity: 0.7; box-shadow: 0 0 10px rgba(0,230,118,0.6); } }
.surge-badge.negative { animation-name: surge-pulse-red; }
@keyframes surge-pulse-red { 0%,100% { opacity: 1; box-shadow: 0 0 4px rgba(255,23,68,0.3); } 50% { opacity: 0.7; box-shadow: 0 0 10px rgba(255,23,68,0.6); } }

/* v11: Momentum Breakout badge */
.momentum-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 0.6rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em; }
.momentum-badge.momentum-active { background: rgba(255,152,0,0.25); color: #ffb74d; animation: momentum-pulse 1.5s ease-in-out infinite; border: 1px solid rgba(255,152,0,0.4); }
.momentum-badge.momentum-watch { background: rgba(255,193,7,0.15); color: #ffd54f; opacity: 0.8; border: 1px solid rgba(255,193,7,0.2); }
@keyframes momentum-pulse { 0%,100% { opacity: 1; box-shadow: 0 0 4px rgba(255,152,0,0.3); } 50% { opacity: 0.85; box-shadow: 0 0 12px rgba(255,152,0,0.6); } }

/* Market context badge (v6) */
.mkt-badge { display: inline-flex; align-items: center; font-size: 0.55rem; font-weight: 700; padding: 1px 5px; border-radius: 999px; letter-spacing: 0.02em; }
.mkt-badge.mkt-up { background: rgba(0,230,118,0.15); color: #00e676; }
.mkt-badge.mkt-down { background: rgba(255,23,68,0.15); color: #ff4466; }
.mkt-badge.mkt-neutral { background: rgba(255,255,255,0.06); color: var(--text-dim); }

/* Contrarian badge (v6) */
.contra-badge { display: inline-flex; align-items: center; font-size: 0.55rem; font-weight: 700; padding: 1px 6px; border-radius: 999px; letter-spacing: 0.02em; }
.contra-badge.contra-buy { background: rgba(255,215,0,0.2); color: #ffd700; animation: contra-pulse 1.5s ease-in-out infinite; }
.contra-badge.contra-sell { background: rgba(255,23,68,0.2); color: #ff4466; }
@keyframes contra-pulse { 0%,100% { opacity: 1; box-shadow: 0 0 4px rgba(255,215,0,0.3); } 50% { opacity: 0.75; box-shadow: 0 0 10px rgba(255,215,0,0.5); } }

/* Signal count bar in prediction table (v6) */
.sgn-bar { display: flex; height: 6px; width: 36px; border-radius: 3px; overflow: hidden; background: rgba(255,255,255,0.05); }
.sgn-bull { background: var(--green); }
.sgn-bear { background: var(--red); }
.sgn-label { display: block; font-size: 0.5rem; color: var(--text-dim); text-align: center; line-height: 1.1; }

/* Method tag enhancements (v6) */
.pred-method-tag.contra { border-color: #ffd700; color: #ffd700; }
.pred-method-tag.mkt { border-right: 2px solid rgba(0,230,118,0.5); }

/* Header surge indicator */
.surge-indicator { font-size: 0.6rem; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: rgba(255,193,7,0.2); color: #ffc107; animation: surge-pulse 1.5s ease-in-out infinite; }
.surge-indicator:empty { display: none; }
.chip-slots { font-size: 0.55rem; font-weight: 700; margin-left: 4px; padding: 0 4px; border-radius: 999px; cursor: help; vertical-align: middle; color: #ff10f0; }
.chip-slots:empty { display: none; }
/* Background tint still tracks load level; text stays bright pink for visibility. */
.chip-slots--low  { background: rgba(255,16,240,0.12); color: #ff10f0; }
.chip-slots--mid  { background: rgba(255,16,240,0.18); color: #ff10f0; }
.chip-slots--full { background: rgba(255,16,240,0.28); color: #ff10f0; }
@keyframes pulse-defense { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.regime-activity { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 2px; }
.regime-rule { font-size: 0.5rem; padding: 1px 4px; border-radius: 3px; font-weight: 600; }
.regime-rule-relax { background: rgba(0,230,118,0.15); color: #00e676; border: 1px solid rgba(0,230,118,0.3); }
.regime-rule-override { background: rgba(33,150,243,0.15); color: #64b5f6; border: 1px solid rgba(33,150,243,0.3); }
.regime-rule-def { background: rgba(255,23,68,0.15); color: #ff4466; border: 1px solid rgba(255,23,68,0.3); }
.dt1m-rule.regime-positive { background: rgba(0,230,118,0.15); color: #00e676; border-color: rgba(0,230,118,0.3); }
.dt1m-rule.regime-negative { background: rgba(255,23,68,0.15); color: #ff4466; border-color: rgba(255,23,68,0.3); }
.dt1m-rule.momentum { background: rgba(255,152,0,0.2); color: #ffb74d; border-color: rgba(255,152,0,0.4); font-weight: 700; }
.dt1m-regime-row { display: flex !important; }

/* Regime Heatmap Bar (1m chart) */
.dt1m-regime-heatmap { padding: 2px 0; }
.regime-heat-bar { position: relative; height: 28px; background: #0d1117; border-radius: 4px; overflow: visible; margin: 2px 0; }
.regime-heat-zone { position: absolute; top: 0; height: 100%; transition: width 0.3s; }
.regime-heat-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 0.5rem; font-weight: 700; white-space: nowrap; text-shadow: 0 0 3px rgba(0,0,0,0.8); }
.regime-heat-trans { position: absolute; top: -2px; transform: translateX(-50%); font-size: 0.55rem; z-index: 3; text-shadow: 0 0 3px rgba(0,0,0,0.9); }
.regime-heat-trans.pos { color: #00e676; }
.regime-heat-trans.neg { color: #ff1744; }
.regime-heat-trade { position: absolute; top: -1px; transform: translateX(-50%); font-size: 0.5rem; font-weight: 700; z-index: 4; line-height: 1; }
.regime-heat-trade.entry { color: #00e676; top: 14px; }
.regime-heat-trade.exit.win { color: #42a5f5; }
.regime-heat-trade.exit.loss { color: #ff1744; }
.regime-heat-alert { position: absolute; bottom: -1px; transform: translateX(-50%); font-size: 0.55rem; z-index: 3; }
.regime-heat-alert.bull { color: #00e676; }
.regime-heat-alert.bear { color: #ff1744; }
.regime-heat-alert.defense { color: #ff1744; }
.regime-heat-ctx { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); font-size: 0.5rem; background: rgba(0,0,0,0.7); padding: 1px 4px; border-radius: 3px; z-index: 5; white-space: nowrap; }

/* Decision Alert Badges */
.dt1m-alerts { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }
.dt1m-alert { font-size: 0.6rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; animation: alert-pulse 2s infinite; }
.dt1m-alert-bull { background: rgba(0,230,118,0.2); color: #00e676; border: 1px solid rgba(0,230,118,0.4); }
.dt1m-alert-bear { background: rgba(255,23,68,0.2); color: #ff1744; border: 1px solid rgba(255,23,68,0.4); }
.dt1m-alert-regime-pos { background: rgba(0,230,118,0.15); color: #00e676; border: 1px solid rgba(0,230,118,0.3); }
.dt1m-alert-regime-neg { background: rgba(255,23,68,0.15); color: #ff1744; border: 1px solid rgba(255,23,68,0.3); }
.dt1m-alert-defense { background: rgba(255,23,68,0.25); color: #ff4466; border: 1px solid rgba(255,23,68,0.4); }
.dt1m-alert-opportunity { background: rgba(33,150,243,0.15); color: #64b5f6; border: 1px solid rgba(33,150,243,0.3); }
@keyframes alert-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.7; } }
.card__name {
  font-size: 0.7rem;
  color: var(--text-dim);
  padding: 0 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Trade/transaction/status row — appears below card header for tickers with activity */
.card__trade-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  margin-bottom: 4px;
}
.card__trade-status .ts-seg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}
.card__trade-status .ts-tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}
.card__trade-status .ts-open .ts-tag {
  background: rgba(33, 150, 243, 0.18);
  color: #64b5f6;
}
.card__trade-status .ts-closed .ts-tag {
  background: rgba(255, 255, 255, 0.06);
  color: #9aa5b1;
}
.card__trade-status .ts-prices {
  color: var(--text);
  opacity: 0.85;
}
.card__trade-status .ts-pnl {
  font-weight: 700;
}
.card__trade-status .ts-win .ts-pnl,
.card__trade-status .ts-win.ts-closed,
.card__trade-status .ts-win.ts-open {
  color: #00e676;
}
.card__trade-status .ts-loss .ts-pnl,
.card__trade-status .ts-loss.ts-closed,
.card__trade-status .ts-loss.ts-open {
  color: #ff5252;
}
.card__trade-status .ts-neutral .ts-pnl {
  color: var(--text-dim);
}
.card__trade-status .ts-held,
.card__trade-status .ts-time {
  color: var(--text-dim);
  font-size: 0.66rem;
  opacity: 0.8;
}
.card__trade-status .ts-reason {
  color: var(--text-dim);
  font-size: 0.66rem;
}
.card__trade-status .ts-sep {
  color: var(--text-dim);
  opacity: 0.5;
}
.card__trade-status .ts-sltp {
  color: var(--text-dim);
  font-size: 0.64rem;
  opacity: 0.75;
  font-weight: 400;
  letter-spacing: 0.2px;
}
/* Older closed trade (2nd most recent) — dimmed to indicate it's history context */
.card__trade-status .ts-older {
  opacity: 0.55;
}
.card__trade-status .ts-older .ts-tag {
  background: rgba(255, 255, 255, 0.04);
}

/* Metrics row */
.card__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 8px 12px;
}
.metric {
  text-align: center;
}
.metric__label {
  font-size: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
/* Price source badge (Pre-Mkt / After-Hrs) */
.price-source-badge {
  font-size: 0.45rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 4px;
  border-radius: 3px;
  vertical-align: middle;
  letter-spacing: 0;
}
.ps-pre { color: #ffa726; background: rgba(255,167,38,0.15); }
.ps-ah { color: #42a5f5; background: rgba(66,165,245,0.15); }

/* Source toggle (clickable yfinance/FMP switch) */
.price-source-toggle {
  font-size: 0.45rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  cursor: pointer;
  color: var(--text-dim);
  background: rgba(255,255,255,0.06);
  letter-spacing: 0;
  transition: all 0.2s;
  user-select: none;
}
.price-source-toggle:hover { background: rgba(255,255,255,0.12); }
.price-source-toggle.ps-fmp {
  color: #66bb6a;
  background: rgba(102,187,106,0.15);
  border: 1px solid rgba(102,187,106,0.3);
}

.metric__value {
  font-size: 0.85rem;
  font-weight: 600;
}
.metric__value.positive { color: var(--green); }
.metric__value.negative { color: var(--red); }
.metric__sub {
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 1px;
  line-height: 1.1;
}
.metric__sub .positive { color: var(--green); }
.metric__sub .negative { color: var(--red); }
.metric__tag {
  font-size: 0.5rem;
  opacity: 0.5;
  margin-right: 1px;
  margin-left: 3px;
}
.metric__tag:first-child { margin-left: 0; }

/* Mini analytics */
.card__analytics-mini {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 4px 12px 6px;
  border-top: 1px solid var(--border);
}

/* Options analytics row */
.card__analytics-opts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 4px 12px 6px;
  border-top: 1px solid var(--border);
  transition: background 0.3s;
}
/* Sentiment background tints */
.card__analytics-opts.opts-bullish {
  background: rgba(0,230,118,0.08);
  border-top-color: rgba(0,230,118,0.25);
}
.card__analytics-opts.opts-bearish {
  background: rgba(255,23,68,0.08);
  border-top-color: rgba(255,23,68,0.25);
}
.card__analytics-opts.opts-volatile {
  background: rgba(255,193,7,0.08);
  border-top-color: rgba(255,193,7,0.25);
}
/* Sentiment label pill (auto-injected left edge) */
.card__analytics-opts.opts-bullish::before,
.card__analytics-opts.opts-bearish::before,
.card__analytics-opts.opts-volatile::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}
.card__analytics-opts { position: relative; }
.card__analytics-opts.opts-bullish::before { background: var(--green); }
.card__analytics-opts.opts-bearish::before { background: var(--red); }
.card__analytics-opts.opts-volatile::before { background: var(--yellow); }
.metric__value.yellow { color: var(--yellow); }
.metric__value.dim { color: var(--text-dim); font-size: 0.7rem; }

/* Detail toggle (Boll · Vol · S/R) */
.card__detail-toggle {
  display: flex; align-items: center; gap: 6px; padding: 4px 8px; cursor: pointer;
  font-size: 0.6rem; color: var(--text-dim); user-select: none;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.card__detail-toggle:hover { color: var(--text-main); }
.detail-toggle-icon {
  font-size: 0.5rem; transition: transform 0.2s ease; display: inline-block;
}
.card__detail-toggle.open .detail-toggle-icon { transform: rotate(90deg); }
.detail-toggle-label { font-weight: 600; letter-spacing: 0.3px; }
.card__detail-rows { display: none; }
.card__detail-rows.open { display: block; }

/* BOLL & S/R rows */
.card__data-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 12px;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
}
.card__data-row .label { color: var(--text-dim); }
.card__data-row .values { display: flex; gap: 8px; }
.card__data-row .val-green { color: var(--green); }
.card__data-row .val-red { color: var(--red); }
.card__data-row .val-blue { color: var(--blue); }

/* Reasons + inline news ticker */
.card__reasons {
  display: flex;
  align-items: center;
  padding: 4px 12px 6px;
  font-size: 0.65rem;
  color: var(--yellow);
  border-top: 1px solid var(--border);
  gap: 6px;
  overflow: hidden;
}
.card__reasons-text {
  flex-shrink: 0;
  white-space: nowrap;
}
.card__reasons .news-ticker {
  margin-left: 0;
}

/* Toggle buttons */
.card__toggles {
  display: flex;
  border-top: 1px solid var(--border);
}
.card__toggle-btn {
  flex: 1;
  padding: 8px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.75rem;
  cursor: pointer;
  border-right: 1px solid var(--border);
  transition: color 0.15s, background 0.15s;
}
.card__toggle-btn:last-child { border-right: none; }
.card__toggle-btn:active { background: var(--surface2); }
.card__toggle-btn.active { color: var(--blue); background: rgba(33,150,243,0.08); }

/* Expanded chart */
.card__chart-area {
  display: none;
  border-top: 1px solid var(--border);
}
.card__chart-area.open { display: block; }
.tf-tabs {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  gap: 6px;
  overflow: hidden;
}
.tf-tab {
  padding: 4px 14px;
  border-radius: 6px;
  font-size: 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
}
.tf-tab.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.tz-toggle { padding: 3px 8px; border-radius: 4px; font-size: 0.65rem; font-weight: 700; background: rgba(255,193,7,0.15); color: #ffc107; border: 1px solid rgba(255,193,7,0.3); cursor: pointer; margin-left: auto; }
.chart-container {
  width: 100%;
  height: 320px;
  padding: 0 4px 8px;
}
.chart-container:empty {
  height: 0;
  padding: 0;
}

/* Indicator toggle pills */
.chart-indicator-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 12px 6px;
  align-items: center;
}
.ind-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: all 0.15s;
}
.ind-pill input { display: none; }
.ind-pill:has(input:checked) {
  background: rgba(33,150,243,0.15);
  border-color: var(--blue);
  color: var(--blue);
}
/* Indicator group toggle buttons */
.ind-group-toggle {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: all 0.15s;
  letter-spacing: 0.03em;
}
.ind-group-toggle:hover { border-color: var(--text-dim); }
.ind-group-toggle.active {
  background: rgba(33,150,243,0.15);
  border-color: var(--blue);
  color: var(--blue);
}
.ind-group-panel {
  display: none;
  gap: 4px;
}
.ind-group-panel.open {
  display: inline-flex;
  align-items: center;
}

.ind-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 2px;
}

/* Sub-chart panes */
.sub-charts-area {
  padding: 0 4px;
}
.sub-chart-wrap {
  position: relative;
  margin-top: 2px;
  min-width: 300px;
  width: 100%;
}
.sub-chart-label {
  position: absolute;
  top: 2px;
  left: 8px;
  z-index: 2;
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(15,19,24,0.7);
  padding: 1px 6px;
  border-radius: 3px;
  pointer-events: none;
}

/* Expanded analytics with insights */
.card__analytics-full, .card__insights {
  display: none;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
}
.card__analytics-full.open, .card__insights.open { display: block; }

.analytics-insights { display: flex; flex-direction: column; gap: 2px; }

.ai-section-title {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue);
  margin-top: 10px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(33,150,243,0.2);
}
.ai-section-title:first-child { margin-top: 0; }

.ai-row {
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.ai-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-header .a-label {
  color: var(--text-dim);
  font-size: 0.72rem;
  min-width: 85px;
  flex-shrink: 0;
}
.ai-value {
  font-weight: 600;
  font-size: 0.8rem;
  min-width: 60px;
}
.ai-signal {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-left: auto;
  white-space: nowrap;
}
.ai-signal.positive { background: rgba(0,230,118,0.12); color: var(--green); }
.ai-signal.negative { background: rgba(255,23,68,0.12); color: var(--red); }
.ai-signal:not(.positive):not(.negative) { background: rgba(255,255,255,0.06); color: var(--text-dim); }

.ai-guide {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 3px;
  line-height: 1.4;
  padding-left: 2px;
  opacity: 0.85;
}

.ai-rank-bar {
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}
.ai-rank-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--red) 0%, var(--yellow) 40%, var(--green) 80%);
  transition: width 0.3s;
}

/* Scrolling news ticker (beside 1H / 4H tabs) */
.news-ticker {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
  height: 22px;
  margin-left: 4px;
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.news-ticker .ticker-empty {
  font-size: 0.65rem;
  color: var(--text-dim);
  line-height: 22px;
}
.news-ticker.scrolling .ticker-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 10px;
  animation: tickerScroll 20s linear infinite;
}
.ticker-item {
  font-size: 0.65rem;
  line-height: 22px;
  white-space: nowrap;
}
.ticker-icon {
  margin-right: 3px;
  font-size: 0.5rem;
  vertical-align: middle;
}
.ticker-date {
  color: var(--text-dim);
  margin-right: 4px;
  font-size: 0.6rem;
}
.ticker-cat {
  font-size: 0.58rem;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}
.cat-catalyst .ticker-icon { color: var(--yellow); }
.cat-news .ticker-icon { color: var(--blue); }
.cat-catalyst .ticker-cat { background: rgba(255,193,7,0.15); color: var(--yellow); }
.cat-news .ticker-cat { background: rgba(33,150,243,0.15); color: var(--blue); }
.sent-pos { color: var(--green); }
.sent-neg { color: var(--red); }
.sent-neu { color: var(--text-dim); }
.ticker-sep {
  color: var(--text-dim);
  font-size: 0.6rem;
  opacity: 0.3;
}
@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }  /* -50% because content is duplicated */
}

/* Status banner */
.status-banner {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
}
.status-banner .spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Offline banner */
.offline-banner {
  display: none;
  background: var(--yellow);
  color: #000;
  text-align: center;
  padding: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}
body.offline .offline-banner { display: block; }

/* Bollinger alert banner on card */
.card__boll-alert {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 0.7rem;
  font-weight: 600;
  border-top: 1px solid var(--border);
}
.card__boll-alert .boll-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.card__boll-alert.alert-near_upper,
.card__boll-alert.alert-above_upper {
  background: rgba(255,23,68,0.1);
  color: var(--red);
}
.card__boll-alert.alert-near_upper .boll-dot,
.card__boll-alert.alert-above_upper .boll-dot { background: var(--red); }
.card__boll-alert.alert-near_lower,
.card__boll-alert.alert-below_lower {
  background: rgba(0,230,118,0.1);
  color: var(--green);
}
.card__boll-alert.alert-near_lower .boll-dot,
.card__boll-alert.alert-below_lower .boll-dot { background: var(--green); }
.card__boll-alert.alert-near_mid {
  background: rgba(33,150,243,0.08);
  color: var(--blue);
}
.card__boll-alert.alert-near_mid .boll-dot { background: var(--blue); }

/* Pulsing dot for active alerts */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}
.card__boll-alert .boll-dot { animation: pulse-dot 1.5s infinite; }
@media (prefers-reduced-motion: reduce) {
  .card__boll-alert .boll-dot { animation: none; }
}
body.reduce-motion .card__boll-alert .boll-dot { animation: none !important; }

/* Watchlist reason banner */
.watchlist-reasons {
  padding: 5px 12px;
  font-size: 0.68rem;
  background: rgba(255,193,7,0.08);
  border-top: 1px solid rgba(255,193,7,0.2);
  color: var(--yellow);
  line-height: 1.4;
}
.watchlist-reasons .wl-reasons { margin-bottom: 2px; }
.watchlist-reasons .wl-icon {
  margin-right: 4px;
  font-size: 0.7rem;
}
.wl-timestamp {
  font-size: 0.62rem;
  color: rgba(255,193,7,0.6);
  display: flex;
  align-items: center;
  gap: 4px;
}
.wl-active {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
}
.wl-stale {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
}

/* Sub-99 Depth Spectrogram */
.sub99-spectro {
  padding: 4px 12px 3px;
  background: rgba(233,30,99,0.06);
  border-top: 1px solid rgba(233,30,99,0.15);
  position: relative;
}
.spectro-bar {
  position: relative;
  height: 28px;
  background: linear-gradient(135deg, rgba(15,15,30,0.7), rgba(25,25,50,0.5));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: visible;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
}
.spectro-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.02) 2px, rgba(255,255,255,0.02) 3px);
  pointer-events: none;
}
.spectro-wall {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 8px;
  border-radius: 2px;
  transform: translateX(-50%);
}
.spectro-buy { background: linear-gradient(to top, rgba(0,100,40,0.6), rgba(0,200,83,0.9)); }
.spectro-sell { background: linear-gradient(to top, rgba(120,30,20,0.6), rgba(244,67,54,0.9)); }
/* VWAP line on price bar */
.spectro-vwap {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: rgba(0,188,212,0.6);
  transform: translateX(-50%);
  z-index: 1;
}
.spectro-vwap::after {
  content: 'V';
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.4rem;
  color: rgba(0,188,212,0.7);
  font-weight: 700;
}
/* Volume Profile — vertical bars on shared horizontal price axis */
.spectro-vp {
  position: relative;
  margin-top: 0;
  border: 1px solid rgba(255,255,255,0.08);
  border-top: none;
  background: linear-gradient(135deg, rgba(10,10,25,0.6), rgba(20,20,40,0.4));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow: visible;
}
.spectro-vp-1d { border-radius: 0; }
.spectro-vp-4h {
  border-radius: 0;
  border-top: 1px dashed rgba(255,255,255,0.08);
}
.spectro-vp-4h:last-child { border-radius: 0 0 4px 4px; }
/* Vertical column bars — positioned by left%, height = volume */
.vp-col {
  position: absolute;
  bottom: 0;
  border-radius: 2px 2px 0 0;
  transition: height 0.3s;
}
.vp-col::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 35%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.12), transparent);
  pointer-events: none;
  border-radius: 2px 2px 0 0;
}
/* 1D bars — green/red demand/supply */
.vp-bar-1d.demand { background: linear-gradient(to top, rgba(0,120,50,0.2), rgba(0,200,83,0.5)); }
.vp-bar-1d.supply { background: linear-gradient(to top, rgba(120,30,20,0.2), rgba(244,67,54,0.5)); }
/* 4H bars — amber tint */
.vp-bar-4h.demand { background: linear-gradient(to top, rgba(180,100,0,0.15), rgba(255,152,0,0.5)); }
.vp-bar-4h.supply { background: linear-gradient(to top, rgba(180,60,0,0.15), rgba(255,120,0,0.45)); }
/* 1H bars — blue */
.vp-bar-1h-vp.demand { background: linear-gradient(to top, rgba(20,60,160,0.15), rgba(33,150,243,0.5)); }
.vp-bar-1h-vp.supply { background: linear-gradient(to top, rgba(100,30,60,0.15), rgba(233,30,99,0.4)); }
.spectro-vp-1h-vp { border-top: 1px dashed rgba(255,255,255,0.08); }
.vp-tf-1h-vp { color: #2196f3; }
/* 30m bars — teal */
.vp-bar-30m.demand { background: linear-gradient(to top, rgba(0,100,100,0.15), rgba(0,150,136,0.5)); }
.vp-bar-30m.supply { background: linear-gradient(to top, rgba(100,40,60,0.15), rgba(233,30,99,0.42)); }
.spectro-vp-30m { border-top: 1px dashed rgba(255,255,255,0.08); }
.vp-tf-30m { color: #009688; }
/* 15m bars — cyan/teal intraday */
.vp-bar-15m.demand { background: linear-gradient(to top, rgba(0,120,130,0.15), rgba(0,188,212,0.5)); }
.vp-bar-15m.supply { background: linear-gradient(to top, rgba(120,50,80,0.15), rgba(233,30,99,0.45)); }
.spectro-vp-15m { border-top: 1px dashed rgba(255,255,255,0.08); }
.vp-tf-15m { color: #00bcd4; }
/* 5m bars — purple intraday on-demand */
.vp-bar-5m.demand { background: linear-gradient(to top, rgba(80,40,120,0.15), rgba(156,39,176,0.5)); }
.vp-bar-5m.supply { background: linear-gradient(to top, rgba(120,20,60,0.15), rgba(233,30,99,0.5)); }
.spectro-vp-5m { border-top: 1px dashed rgba(255,255,255,0.08); border-radius: 0 0 4px 4px; }
.vp-tf-5m { color: #ab47bc; }
/* 5m on-demand placeholder */
.spectro-vp-ondemand { min-height: 0; }
/* 5m toggle button */
.spectro-vp5m-toggle {
  background: rgba(156,39,176,0.15);
  color: #ab47bc;
  border: 1px solid rgba(156,39,176,0.3);
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 1px 5px;
  cursor: pointer;
  margin-left: 4px;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.spectro-vp5m-toggle:hover { background: rgba(156,39,176,0.25); }
/* VP show/hide toggle */
.spectro-vp-toggle {
  background: rgba(33,150,243,0.15);
  color: #64b5f6;
  border: 1px solid rgba(33,150,243,0.3);
  border-radius: 4px;
  font-size: 0.6rem;
  padding: 2px 6px;
  cursor: pointer;
  margin-left: 4px;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.spectro-vp-toggle:hover { background: rgba(33,150,243,0.25); }
.spectro-vp-toggle.active { background: rgba(33,150,243,0.3); color: #fff; }
/* Institutional peak labels — float above bar */
.vp-peak-label {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.42rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 0 3px rgba(0,0,0,0.9), 0 0 6px rgba(0,0,0,0.5);
  z-index: 5;
  line-height: 1.1;
  padding-bottom: 1px;
}
/* POC — vertical dashed line */
.vp-poc-v {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  border-left: 1px dashed rgba(255,255,255,0.65);
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
}
.vp-poc-v .vp-poc-label {
  position: absolute;
  top: -1px;
  left: 3px;
  font-size: 0.4rem;
  font-weight: 700;
  color: rgba(255,255,255,0.65);
  text-shadow: 0 0 4px rgba(0,0,0,0.9);
  white-space: nowrap;
}
/* Value Area — vertical shaded band */
.vp-va-v {
  position: absolute;
  top: 0; bottom: 0;
  background: rgba(255,255,255,0.04);
  border-left: 1px solid rgba(255,255,255,0.12);
  border-right: 1px solid rgba(255,255,255,0.12);
  z-index: 0;
  pointer-events: none;
}
/* TF label badge */
.vp-tf-label {
  position: absolute;
  top: 1px; right: 3px;
  font-size: 0.42rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  z-index: 4;
  opacity: 0.55;
  text-transform: uppercase;
}
.vp-tf-1d { color: #4caf50; }
.vp-tf-4h { color: #ff9800; }
.vp-vol-label {
  position: absolute;
  top: 1px; left: 3px;
  font-size: 0.42rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  z-index: 4;
  opacity: 0.5;
  color: rgba(255,255,255,0.7);
}
.spectro-boll {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(33,150,243,0.5);
  transform: translateX(-50%);
}
.spectro-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
  transform: translateX(-50%);
  z-index: 2;
}
.spectro-price {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.58rem;
  color: #fff;
  white-space: nowrap;
  font-weight: 600;
  padding-bottom: 1px;
}
.spectro-badges {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: 2px;
}
.spectro-badge {
  font-size: 0.55rem;
  font-weight: 700;
  padding: 0 4px;
  border-radius: 3px;
  line-height: 1.5;
}
.spectro-unusual { background: rgba(0,200,83,0.2); color: #00c853; }
.spectro-volspike { background: rgba(244,67,54,0.2); color: #f44336; }
.spectro-vol { background: rgba(33,150,243,0.15); color: #2196f3; }
.spectro-pc-bull { background: rgba(0,200,83,0.15); color: #00c853; }
.spectro-pc-bear { background: rgba(244,67,54,0.15); color: #f44336; }
.spectro-pc-neut { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }
/* Histogram pattern remarks */
.spectro-remarks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px 0 1px;
}
.spectro-remark {
  font-size: 0.55rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  line-height: 1.4;
}
.remark-bull  { background: rgba(0,200,83,0.15); color: #00c853; }
.remark-bear  { background: rgba(244,67,54,0.15); color: #f44336; }
.remark-warn  { background: rgba(255,193,7,0.15); color: #ffc107; }
.remark-info  { background: rgba(33,150,243,0.15); color: #4fc3f7; }
/* Spectro insight toggle + panel */
.spectro-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.spectro-header .spectro-badges { margin-bottom: 0; flex: 1; }
.spectro-insight-toggle {
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  color: rgba(255,255,255,0.4);
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 6px;
  transition: background 0.2s, color 0.2s;
}
.spectro-insight-toggle:hover,
.spectro-insight-toggle.active { background: rgba(233,30,99,0.2); color: #e91e63; }
/* RVOL toggle button */
.spectro-rvol-toggle {
  background: rgba(255,152,0,0.15);
  color: #ff9800;
  border: 1px solid rgba(255,152,0,0.3);
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 1px 5px;
  cursor: pointer;
  margin-left: 4px;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.spectro-rvol-toggle:hover { background: rgba(255,152,0,0.25); }
.spectro-rvol-toggle.active { background: rgba(255,152,0,0.3); color: #fff; }
/* RVOL price context row */
.rvol-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 8px 4px;
  font-size: 0.6rem;
  color: #999;
  gap: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 4px;
}
.rvol-price b { font-weight: 700; }
/* RVOL summary row */
.rvol-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  font-size: 0.65rem;
  color: #ccc;
  gap: 6px;
}
.rvol-current { font-weight: 700; font-size: 0.75rem; }
.rvol-cls { opacity: 0.8; }
.rvol-flow { font-weight: 600; }
/* RVOL bar chart */
.rvol-chart {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 1px;
  padding: 0 4px;
  background: rgba(0,0,0,0.15);
  border-radius: 4px;
  overflow: hidden;
}
.rvol-bar {
  min-width: 3px;
  border-radius: 2px 2px 0 0;
  transition: height 0.2s;
}
.rvol-threshold {
  position: absolute;
  left: 0; right: 0;
  border-top: 1px dashed rgba(255,255,255,0.15);
  pointer-events: none;
}
.rvol-threshold span {
  position: absolute;
  right: 4px;
  top: -8px;
  font-size: 0.5rem;
  color: rgba(255,255,255,0.3);
}
.rvol-empty {
  text-align: center;
  color: #666;
  font-size: 0.6rem;
  padding: 20px 0;
}
.rvol-remarks {
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  border-left: 2px solid rgba(255,152,0,0.4);
  font-size: 0.55rem;
  line-height: 1.5;
  color: var(--text-dim);
}
.rvol-remark-swing { margin-bottom: 3px; }
.rvol-remark-swing b { color: #ff9800; font-weight: 700; }
.rvol-remark-rx { color: #90caf9; }
.rvol-remark-rx b { color: #64b5f6; font-weight: 700; }
.spectro-insight {
  display: none;
  padding: 6px 8px;
  margin-top: 4px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  font-size: 0.55rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.6);
}
.spectro-insight.open { display: block; }
.spectro-insight dt {
  color: rgba(255,255,255,0.45);
  font-weight: 700;
  font-size: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 5px;
}
.spectro-insight dt:first-child { margin-top: 0; }
.spectro-insight dd {
  margin: 1px 0 0 0;
  color: rgba(255,255,255,0.6);
}
.spectro-conclusion {
  margin-top: 6px;
  padding: 4px 6px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.55rem;
  line-height: 1.4;
}
.spectro-conclusion.bull { background: rgba(0,200,83,0.12); color: #00c853; border-left: 2px solid #00c853; }
.spectro-conclusion.bear { background: rgba(244,67,54,0.12); color: #f44336; border-left: 2px solid #f44336; }
.spectro-conclusion.neut { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5); border-left: 2px solid rgba(255,255,255,0.2); }

.spectro-range {
  display: flex;
  justify-content: space-between;
  font-size: 0.5rem;
  color: rgba(255,255,255,0.3);
  margin-top: 1px;
}
.chip[data-filter="sub99"] { border-color: rgba(233,30,99,0.4); color: #e91e63; }
.chip[data-filter="sub99"].active { background: #e91e63; color: #fff; border-color: #e91e63; }

/* Prediction / Recommendation section */
.card__prediction-1d {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 12px;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
}
.card__prediction-1d .pred-label { color: var(--text-dim); }
.rec-badge {
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
}
.rec-badge.strong-buy { background: rgba(0,230,118,0.2); color: var(--green); }
.rec-badge.buy { background: rgba(0,230,118,0.12); color: #66ffa6; }
.rec-badge.hold { background: rgba(255,193,7,0.15); color: var(--yellow); }
.rec-badge.sell { background: rgba(255,23,68,0.12); color: #ff6e7a; }
.rec-badge.strong-sell { background: rgba(255,23,68,0.2); color: var(--red); }
.rec-badge.rec-hold { background: rgba(33,150,243,0.2); color: #42a5f5; }

/* Order Book Depth Bar */
.ob-depth-bar { padding: 4px 12px; }
.ob-bar-row { display: flex; align-items: center; gap: 6px; font-size: 0.7rem; }
.ob-signal { font-weight: 700; min-width: 70px; }
.ob-signal.ob-buy { color: #00e676; }
.ob-signal.ob-sell { color: #ff1744; }
.ob-signal.ob-neutral { color: #9ca3af; }
.ob-bar-track { flex: 1; display: flex; height: 16px; border-radius: 3px; overflow: hidden; background: #1e2530; }
.ob-bar-bid { background: rgba(0,230,118,0.3); display: flex; align-items: center; justify-content: flex-end; padding: 0 4px; }
.ob-bar-bid span { color: #00e676; font-size: 0.6rem; font-weight: 600; }
.ob-bar-ask { background: rgba(255,23,68,0.3); display: flex; align-items: center; padding: 0 4px; }
.ob-bar-ask span { color: #ff1744; font-size: 0.6rem; font-weight: 600; }
.ob-imb { font-weight: 700; min-width: 35px; text-align: right; }
.ob-wall-badge { background: rgba(255,193,7,0.2); color: #ffc107; padding: 1px 5px; border-radius: 3px; font-weight: 700; font-size: 0.65rem; }
.ob-session { padding: 1px 5px; border-radius: 3px; font-size: 0.55rem; font-weight: 600; background: rgba(99,102,241,0.15); color: #818cf8; }
.ob-loading { color: #6b7280; font-size: 0.7rem; font-style: italic; }

/* Order Book Ladder — 4 column */
.ob-ladder { padding: 0 12px 6px; max-height: 300px; overflow-y: auto; }
.ob-levels-label { color: #6b7280; font-size: 0.6rem; padding: 2px 0; text-align: center; }
.ob-ladder-table { width: 100%; border-collapse: collapse; font-size: 0.65rem; }
.ob-ladder-table th { color: #6b7280; font-weight: 600; text-align: center; padding: 2px 4px; border-bottom: 1px solid #1e2530; width: 25%; }
.ob-ladder-table td { padding: 1px 4px; }
.ob-cell-bid { text-align: right; position: relative; }
.ob-cell-ask { text-align: left; position: relative; }
.ob-cell-price { text-align: center; font-weight: 600; white-space: nowrap; }
.ob-bid-price { color: #00e676; }
.ob-ask-price { color: #ff1744; }
.ob-cell-bid span, .ob-cell-ask span { position: relative; z-index: 1; }
.ob-cell-bid span { color: #00e676; }
.ob-cell-ask span { color: #ff1744; }
.ob-vol-fill { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.ob-vol-bid { right: 0; background: rgba(0,230,118,0.15); }
.ob-vol-ask { left: 0; background: rgba(255,23,68,0.15); }
tr.ob-wall { background: rgba(255,193,7,0.1); }
tr.ob-wall .ob-cell-price { color: #ffc107; font-weight: 700; }
tr.ob-spike { background: rgba(33,150,243,0.08); }
tr.ob-spread { text-align: center; color: #4b5563; font-size: 0.55rem; border-top: 1px dashed #2d3748; border-bottom: 1px dashed #2d3748; }
tr.ob-spread td { padding: 3px 0; }

/* Multi-timeframe signal row */
.card__signals-row { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; padding: 4px 12px 2px; }
.rec-badge--sm { font-size: 0.6rem; padding: 1px 5px; border-radius: 3px; font-weight: 700; text-transform: uppercase; }
.rec-badge--sm.strong-buy { background: rgba(0,230,118,0.2); color: var(--green); }
.rec-badge--sm.buy { background: rgba(0,230,118,0.12); color: #66ffa6; }
.rec-badge--sm.hold { background: rgba(255,193,7,0.12); color: var(--yellow); }
.rec-badge--sm.sell { background: rgba(255,23,68,0.12); color: #ff6e7a; }
.rec-badge--sm.strong-sell { background: rgba(255,23,68,0.2); color: var(--red); }
.rcr-badge { background: rgba(124,58,237,0.25); color: #a78bfa; font-size: 0.6rem; padding: 1px 5px; border-radius: 3px; font-weight: 700; }

/* Bollinger Squeeze badge */
.squeeze-badge {
  background: rgba(233,30,99,0.15);
  color: #f06292;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid rgba(233,30,99,0.3);
  animation: squeeze-pulse 2s ease-in-out infinite;
}
@keyframes squeeze-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* RCR Watch button */
.rcr-watch-btn {
  background: rgba(124,58,237,0.1);
  color: #a78bfa;
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 4px;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.rcr-watch-btn:hover { background: rgba(124,58,237,0.25); }
.rcr-watch-btn.active {
  background: rgba(124,58,237,0.3);
  color: #fff;
  border-color: #7c3aed;
  box-shadow: 0 0 6px rgba(124,58,237,0.3);
}

/* RCR Live Panel */
.rcr-panel {
  padding: 6px 10px 8px;
  border-top: 1px solid rgba(124,58,237,0.2);
  background: rgba(124,58,237,0.04);
}
.rcr-loading {
  text-align: center;
  color: #a78bfa;
  font-size: 0.6rem;
  padding: 12px 0;
}
.rcr-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 4px 4px;
  font-size: 0.62rem;
  color: #ccc;
  gap: 6px;
  flex-wrap: wrap;
}
.rcr-label {
  font-weight: 700;
  color: #a78bfa;
  font-size: 0.65rem;
}

/* RCR Phase indicator */
.rcr-phases {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px;
  font-size: 0.55rem;
  color: #999;
}
.rcr-phase-chip {
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 3px;
  color: #888;
}
.rcr-phase-chip.active {
  background: rgba(124,58,237,0.3);
  color: #d4bbff;
  font-weight: 700;
  box-shadow: 0 0 4px rgba(124,58,237,0.3);
}
.rcr-conf {
  margin-left: auto;
  color: #a78bfa;
  font-weight: 600;
}

/* RCR EMA5 sparkline overlay */
.rcr-ema-spark {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* Predictions panel (expanded) */
.card__predictions {
  display: none;
  border-top: 1px solid var(--border);
  padding: 10px 12px;
}
.card__predictions.open { display: block; }
.pred-table {
  width: 100%;
  font-size: 0.72rem;
  border-collapse: collapse;
}
.pred-table th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 500;
  padding: 4px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 0.6rem;
  text-transform: uppercase;
}
.pred-table td {
  padding: 5px 4px;
  border-bottom: 1px solid var(--border);
}
.pred-table tr:last-child td { border-bottom: none; }
.pred-range {
  font-size: 0.6rem;
  color: var(--text-dim);
}
.pred-conf {
  display: inline-block;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--surface2);
  position: relative;
  vertical-align: middle;
}
.pred-conf-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 2px;
  background: var(--blue);
}
.pred-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.pred-method-tag {
  font-size: 0.55rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(33,150,243,0.12);
  color: var(--blue);
  letter-spacing: 0.03em;
}
.pred-method-tag.iv {
  background: rgba(255,193,7,0.15);
  color: var(--yellow);
}
.pred-facts-toggle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.pred-facts-toggle:active { background: var(--border); }
.pred-facts-toggle.active {
  color: var(--blue);
  border-color: var(--blue);
  background: rgba(33,150,243,0.1);
}
.pred-facts {
  background: rgba(33,150,243,0.06);
  border: 1px solid rgba(33,150,243,0.15);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.pred-facts__title {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 4px;
}
.pred-facts__list {
  font-size: 0.6rem;
  color: var(--text-dim);
  line-height: 1.5;
  padding-left: 14px;
  margin: 0;
}
.pred-facts__list li { margin-bottom: 2px; }
.pred-facts__list b { color: var(--text); }
.pred-facts__method {
  font-size: 0.58rem;
  color: var(--text-dim);
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(33,150,243,0.1);
}
.pred-facts__method b { color: var(--blue); }
.pred-rationale {
  font-size: 0.6rem;
  color: var(--text-dim);
  padding: 6px 0 2px;
  line-height: 1.4;
  font-style: italic;
}

/* Panel validation timestamp */
.panel-timestamp {
  text-align: right;
  font-size: 0.5rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  opacity: 0.7;
}

/* Legend panel */
.card__legend {
  display: none;
  border-top: 1px solid var(--border);
  padding: 10px 12px;
}
.card__legend.open { display: block; }
.legend-item {
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  line-height: 1.45;
}
.legend-item:last-child { border-bottom: none; }
.legend-term {
  font-weight: 700;
  color: var(--blue);
}
.legend-def {
  color: var(--text-dim);
}

/* (header toggle buttons styled via .header__toggle-btn above) */

/* ── Signal Details Panel (info icon toggle) ── */
.signal-details-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
  vertical-align: middle;
}
.signal-details-btn:hover,
.signal-details-btn.active {
  color: var(--blue);
}

.card__signal-details {
  display: none;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--border);
  background: rgba(17,24,39,0.6);
}
.card__signal-details.open { display: block; }

.sd-section-title {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue);
  margin-top: 8px;
  margin-bottom: 4px;
}
.sd-section-title:first-child { margin-top: 0; }

/* Criteria */
.sd-rec-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.sd-conf-label {
  font-size: 0.62rem;
  color: var(--text-dim);
  margin-left: auto;
}
.sd-conf-bar {
  display: inline-block;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--surface2);
  position: relative;
  vertical-align: middle;
}
.sd-conf-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 2px;
  background: var(--blue);
}
.sd-conf-pct {
  font-size: 0.6rem;
  color: var(--text-dim);
  min-width: 24px;
}
.sd-criteria-list {
  margin: 0;
  padding: 0 0 0 14px;
  font-size: 0.68rem;
  color: var(--text);
  line-height: 1.5;
  opacity: 0.9;
}
.sd-criteria-list li {
  margin-bottom: 2px;
}

/* Analytics grid */
.sd-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.sd-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0;
  background: var(--surface2);
  border-radius: 6px;
}
.sd-label {
  font-size: 0.55rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sd-val {
  font-size: 0.75rem;
  font-weight: 600;
}
.sd-val.positive { color: var(--green); }
.sd-val.negative { color: var(--red); }

/* Volume */
.sd-vol-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sd-vol-note {
  font-size: 0.62rem;
  color: var(--text-dim);
  font-style: italic;
}

/* BOLL range visualization */
.sd-boll { margin-top: 2px; }
.sd-boll-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.sd-boll-pos {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text);
}
.sd-boll-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sd-boll-lo, .sd-boll-hi {
  font-size: 0.6rem;
  font-weight: 500;
  white-space: nowrap;
  min-width: 48px;
}
.sd-boll-lo { color: var(--green); text-align: right; }
.sd-boll-hi { color: var(--red); }
.sd-boll-track {
  flex: 1;
  height: 8px;
  background: linear-gradient(90deg, rgba(0,230,118,0.15), rgba(33,150,243,0.1) 50%, rgba(255,23,68,0.15));
  border-radius: 4px;
  position: relative;
  min-width: 80px;
}
.sd-boll-mid {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--blue);
  opacity: 0.6;
}
.sd-boll-dot {
  position: absolute;
  top: -1px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--blue);
  transform: translateX(-50%);
  box-shadow: 0 0 4px rgba(33,150,243,0.5);
}
.sd-boll-price {
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 3px;
  text-align: center;
}

/* News items */
.sd-news-content {
  max-height: 120px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sd-loading, .sd-no-news {
  font-size: 0.65rem;
  color: var(--text-dim);
  font-style: italic;
}
.sd-news-item {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(30,42,58,0.5);
  font-size: 0.65rem;
  line-height: 1.4;
}
.sd-news-item:last-child { border-bottom: none; }
.sd-news-icon {
  flex-shrink: 0;
  font-size: 0.5rem;
  margin-top: 2px;
  color: var(--text-dim);
}
.sd-news-item.positive .sd-news-icon { color: var(--green); }
.sd-news-item.negative .sd-news-icon { color: var(--red); }
.sd-news-date {
  flex-shrink: 0;
  font-size: 0.58rem;
  color: var(--text-dim);
  min-width: 36px;
}
.sd-news-headline {
  color: var(--text);
}
.sd-news-item.positive .sd-news-headline { color: var(--green); }
.sd-news-item.negative .sd-news-headline { color: var(--red); }
.sd-empty {
  font-size: 0.65rem;
  color: var(--text-dim);
  padding: 4px 0;
}

@media (max-width: 480px) {
  .sd-grid { grid-template-columns: repeat(2, 1fr); }
  .sd-boll-lo, .sd-boll-hi { font-size: 0.55rem; min-width: 40px; }
  .sd-criteria-list { font-size: 0.62rem; }
}

/* ── Strategy Insight Panel (BOLL-Bounce HL5%) ── */
.strategy-btn {
  background: rgba(255,193,7,0.1);
  border: 1px solid rgba(255,193,7,0.3);
  color: var(--yellow);
  font-size: 0.62rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.2;
  transition: all 0.15s;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.strategy-btn:hover,
.strategy-btn.active {
  background: var(--yellow);
  color: #000;
  border-color: var(--yellow);
}

.card__strategy {
  display: none;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--border);
  background: rgba(17,24,39,0.6);
}
.card__strategy.open { display: block; }

.strat-insight { font-size: 0.82rem; }
.strat-empty { color: var(--text-dim); font-size: 0.78rem; padding: 6px 0; }

.strat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.strat-title {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--yellow);
}
.strat-signal {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}
.strat-signal-buy { background: rgba(0,230,118,0.2); color: var(--green); }
.strat-signal-watch { background: rgba(255,193,7,0.2); color: var(--yellow); }
.strat-signal-wait { background: rgba(255,255,255,0.08); color: var(--text-dim); }

.strat-section { margin-bottom: 8px; }
.strat-subtitle {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--blue);
  margin-bottom: 5px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(33,150,243,0.2);
}

/* Rules checklist */
.strat-rule {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0 0;
}
.strat-rule-icon {
  font-size: 0.78rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.strat-rule-icon:first-child { color: var(--green); }
.strat-rule .strat-rule-icon { color: var(--text-dim); }
.strat-rule:has(.positive) .strat-rule-icon { color: var(--green); }
.strat-rule:has(.negative) .strat-rule-icon { color: var(--red); }
.strat-rule-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  min-width: 80px;
}
.strat-rule-value {
  font-weight: 600;
  font-size: 0.82rem;
  min-width: 44px;
}
.strat-rule-value.positive { color: var(--green); }
.strat-rule-value.negative { color: var(--red); }
.strat-rule-target {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-left: auto;
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 3px;
}
.strat-rule-detail {
  font-size: 0.68rem;
  color: var(--text-dim);
  padding: 2px 0 5px 24px;
  opacity: 0.85;
  line-height: 1.4;
  border-bottom: 1px solid rgba(30,42,58,0.5);
}

/* Exit grid */
.strat-exit-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.strat-exit-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 2px;
  border-radius: 6px;
  background: var(--surface2);
}
.strat-exit-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.strat-exit-val {
  font-weight: 700;
  font-size: 0.85rem;
  margin: 3px 0;
}
.strat-exit-tp .strat-exit-val { color: var(--green); }
.strat-exit-boll .strat-exit-val { color: var(--blue); }
.strat-exit-sl .strat-exit-val { color: var(--red); }
.strat-exit-stale .strat-exit-val { color: var(--yellow); }
.strat-exit-price {
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* BOLL range bar with zones */
.strat-boll-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.strat-boll-lo, .strat-boll-hi {
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  min-width: 48px;
}
.strat-boll-lo { color: var(--green); text-align: right; }
.strat-boll-hi { color: var(--red); }
.strat-boll-track {
  flex: 1;
  height: 10px;
  background: var(--surface2);
  border-radius: 5px;
  position: relative;
  min-width: 80px;
}
.strat-boll-buy-zone {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(0,230,118,0.12);
  border-radius: 5px 0 0 5px;
}
.strat-boll-sell-zone {
  position: absolute;
  top: 0; bottom: 0;
  background: rgba(255,23,68,0.12);
  border-radius: 0 5px 5px 0;
}
.strat-boll-mid {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--blue);
  opacity: 0.5;
}
.strat-boll-dot {
  position: absolute;
  top: -2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--yellow);
  transform: translateX(-50%);
  box-shadow: 0 0 6px rgba(255,193,7,0.5);
}
.strat-boll-labels {
  display: flex;
  justify-content: space-between;
  padding: 3px 50px 0;
  font-size: 0.62rem;
}
.strat-zone-buy { color: var(--green); }
.strat-zone-mid { color: var(--text-dim); }
.strat-zone-sell { color: var(--red); }

/* 5-day projection */
.strat-proj {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.strat-proj-day {
  font-size: 0.72rem;
  padding: 4px 10px;
  background: var(--surface2);
  border-radius: 5px;
  color: var(--green);
}
.strat-proj-day b {
  color: var(--text-dim);
  font-weight: 600;
  margin-right: 3px;
}

/* Warning footer */
.strat-warning {
  font-size: 0.68rem;
  color: var(--yellow);
  background: rgba(255,193,7,0.06);
  padding: 6px 10px;
  border-radius: 6px;
  line-height: 1.45;
  margin-top: 6px;
}

@media (max-width: 480px) {
  .strat-exit-grid { grid-template-columns: repeat(2, 1fr); }
  .strat-boll-labels { padding: 3px 40px 0; }
  .strat-rule-target { font-size: 0.6rem; }
  .strat-proj { gap: 5px; }
  .strat-proj-day { flex: 1; text-align: center; min-width: 0; }
}

/* ── Agent Trading Panel ── */
.agent-panel {
  margin: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
.agent-panel:not(.expanded) { display: none; }
.controls-row__badge--agent {
  background: rgba(33,150,243,0.15);
  color: var(--blue);
}

.agent-panel__summary { padding: 8px 10px; }
.agent-panel__loading {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
  padding: 12px;
}

.agent-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.agent-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  background: var(--surface2);
  border-radius: 6px;
}
.agent-stat__label {
  font-size: 0.55rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.agent-stat__value {
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 2px;
}
.agent-stat__value.positive { color: var(--green); }
.agent-stat__value.negative { color: var(--red); }

.agent-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 0 0;
  font-size: 0.6rem;
  color: var(--text-dim);
}
.agent-session {
  padding: 1px 6px;
  background: var(--surface2);
  border-radius: 4px;
  text-transform: capitalize;
}

.agent-section-title {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue);
  padding: 6px 10px 4px;
  border-top: 1px solid var(--border);
}

/* Agent mode bar */
.agent-mode-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-top: 1px solid var(--border);
}
.agent-mode-label {
  font-size: 0.6rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-dim); margin-right: 2px;
}
.agent-mode-btn {
  font-size: 0.58rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 3px 10px; border-radius: 12px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-dim); cursor: pointer; transition: all 0.2s;
}
.agent-mode-btn:hover { border-color: var(--blue); color: var(--text); }
.agent-mode-btn.active[data-mode="conservative"] {
  background: rgba(33,150,243,0.15); border-color: var(--blue); color: var(--blue);
}
.agent-mode-btn.active[data-mode="normal"] {
  background: rgba(0,230,118,0.15); border-color: var(--green); color: var(--green);
}
.agent-mode-btn.active[data-mode="aggressive"] {
  background: rgba(255,23,68,0.15); border-color: var(--red); color: var(--red);
}

/* Agent trade conditions (collapsible) */
.agent-conditions-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; cursor: pointer; user-select: none;
  font-size: 0.65rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--yellow);
  border-top: 1px solid var(--border);
}
.agent-conditions-toggle:hover { color: #fff; }
.agent-conditions-arrow { font-size: 0.55rem; transition: transform 0.2s; }
.agent-conditions-toggle.open .agent-conditions-arrow { transform: rotate(90deg); }
.agent-conditions {
  display: none; padding: 4px 10px 8px;
  font-size: 0.62rem; line-height: 1.6; color: var(--muted);
  background: rgba(255,255,255,0.02); border-top: 1px solid var(--border);
}
.agent-conditions.open { display: block; }
.agent-cond-section { margin-bottom: 6px; }
.agent-cond-title {
  font-size: 0.58rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text); margin-bottom: 2px;
  cursor: pointer; display: flex; align-items: center; gap: 4px;
}
.agent-cond-arrow { font-size: 0.5rem; transition: transform 0.2s; display: inline-block; }
.agent-cond-section:not(.collapsed) .agent-cond-arrow { transform: rotate(90deg); }
.agent-cond-section.collapsed .agent-cond-items { display: none; }
.agent-cond-section.collapsed .agent-cond-remark-body { display: none; }
.agent-cond-remark { cursor: pointer; font-size: 0.6rem; margin-left: auto; opacity: 0.5; }
.agent-cond-remark:hover { opacity: 1; color: var(--blue); }
.agent-cond-remark-body {
  display: none; font-size: 0.55rem; padding: 3px 8px;
  color: var(--blue); background: rgba(100,180,255,0.08);
  border-radius: 4px; margin: 2px 0 4px; line-height: 1.4;
}
.agent-cond-remark-body.open { display: block; }
.agent-cond-item { padding-left: 12px; display: flex; align-items: baseline; gap: 5px; }
.agent-cond-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0; position: relative; top: -1px;
}
.agent-cond-dot.entry { background: var(--blue); }
.agent-cond-dot.conf { background: var(--yellow); }
.agent-cond-dot.skip { background: var(--red); }
.agent-cond-dot.half { background: var(--yellow); }
.agent-cond-dot.full { background: var(--green); }
.agent-cond-dot.exit { background: var(--red); }

/* Agent positions table */
.agent-panel__positions { padding: 0 6px 4px; }
.agent-pos-table {
  width: 100%;
  font-size: 0.68rem;
  border-collapse: collapse;
  padding: 0 10px;
}
.agent-pos-table th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 500;
  padding: 3px 4px;
  font-size: 0.58rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.agent-pos-table td {
  padding: 4px;
  border-bottom: 1px solid rgba(30,42,58,0.5);
}
.agent-pos-table td.positive { color: var(--green); }
.agent-pos-table td.negative { color: var(--red); }
.agent-pos-sym { font-weight: 700; }
.strat-badge {
  display: inline-block;
  font-size: 0.5rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  color: #000;
  vertical-align: middle;
  margin-left: 3px;
  letter-spacing: 0.5px;
}
.agent-empty {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-align: center;
  padding: 10px;
}

/* Agent watchlist table */
.agent-panel__watchlist { padding: 0 6px 4px; }
.agent-wl-table {
  width: 100%;
  font-size: 0.68rem;
  border-collapse: collapse;
  padding: 0 10px;
}
.agent-wl-table th {
  text-align: left;
  color: var(--text-dim);
  font-size: 0.55rem;
  text-transform: uppercase;
  padding: 3px 4px;
  border-bottom: 1px solid var(--border);
}
.agent-wl-table td {
  padding: 4px;
  border-bottom: 1px solid rgba(30,42,58,0.5);
}
.agent-wl-table .wl-sym { font-weight: 700; }
.agent-wl-table .wl-added { color: var(--text-dim); font-size: 0.6rem; }
.agent-wl-table .wl-days { color: var(--yellow); font-weight: 600; }
.agent-wl-table .wl-preds { display: flex; gap: 3px; flex-wrap: wrap; }
.wl-pred {
  font-size: 0.52rem;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
}
.wl-pred.positive { background: rgba(0,230,118,0.12); color: var(--green); }

/* Advisor column in watchlist tracker */
.wl-advisor { font-size: 0.52rem; }
.adv-metrics { display: flex; gap: 3px; flex-wrap: wrap; align-items: center; }
.adv-metrics span { padding: 1px 3px; border-radius: 2px; white-space: nowrap; }
.adv-1d, .adv-3d, .adv-5d { background: rgba(255,255,255,0.04); }
.adv-1d.positive, .adv-3d.positive, .adv-5d.positive { color: var(--green); }
.adv-1d.negative, .adv-3d.negative, .adv-5d.negative { color: var(--red); }
.adv-vol { font-weight: 700; font-size: 0.45rem; text-transform: uppercase; }
.adv-vol.low { color: var(--blue); }
.adv-vol.medium { color: var(--yellow); }
.adv-vol.high { color: var(--red); }
.adv-info { cursor: pointer; opacity: 0.6; font-size: 0.6rem; margin-left: 2px; }
.adv-info:hover { opacity: 1; }
.adv-rationale {
  margin-top: 3px;
  padding: 3px 5px;
  font-size: 0.5rem;
  line-height: 1.4;
  color: var(--text-dim);
  background: rgba(33,150,243,0.08);
  border-left: 2px solid var(--blue);
  border-radius: 2px;
}
.adv-facts {
  font-size: 0.48rem;
  color: var(--text-dim);
  margin-bottom: 2px;
  font-family: 'SF Mono', 'Menlo', monospace;
  letter-spacing: 0.02em;
  opacity: 0.8;
}
.adv-timestamp {
  font-size: 0.5rem;
  color: var(--text-dim);
  opacity: 0.7;
  margin-left: 8px;
  font-style: italic;
}

.wl-row-stale td { opacity: 0.45; }
.wl-summary {
  font-weight: 400;
  color: var(--text-dim);
  font-size: 0.52rem;
  margin-left: 6px;
}

/* Agent trades feed */
.agent-panel__trades { padding: 0 6px 6px; }
.agent-trades-feed {
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.agent-trade {
  padding: 5px 8px;
  border-radius: 6px;
  margin-bottom: 2px;
  border-left: 3px solid transparent;
}
.agent-trade-buy { border-left-color: var(--green); background: rgba(0,230,118,0.03); }
.agent-trade-sell { border-left-color: var(--red); background: rgba(255,23,68,0.03); }
.agent-trade-row1 {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.agent-trade-badge {
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  text-transform: uppercase;
}
.agent-trade-buy .agent-trade-badge { background: rgba(0,230,118,0.2); color: var(--green); }
.agent-trade-sell .agent-trade-badge { background: rgba(255,23,68,0.2); color: var(--red); }
.agent-trade-sym { font-size: 0.75rem; font-weight: 700; }
.agent-trade-qty { font-size: 0.65rem; color: var(--text-dim); }
.agent-trade-price { font-size: 0.7rem; }
.agent-trade-time {
  font-size: 0.55rem;
  color: var(--text-dim);
  margin-left: auto;
}
.agent-trade-reasoning {
  font-size: 0.62rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 3px;
  line-height: 1.4;
  opacity: 0.8;
}
.agent-trade .positive { color: var(--green); font-weight: 600; font-size: 0.68rem; }
.agent-trade .negative { color: var(--red); font-weight: 600; font-size: 0.68rem; }

@media (max-width: 480px) {
  .agent-summary { grid-template-columns: repeat(2, 1fr); }
  .agent-pos-table { font-size: 0.62rem; }
  .agent-trade-time { display: none; }
}

/* ── Trade Signals Panel ── */
.signals-panel {
  margin: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
.signals-panel:not(.expanded) { display: none; }
.signals-panel__filters {
  display: flex; gap: 4px; padding: 8px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.signals-filter {
  font-size: 11px; padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-dim); cursor: pointer;
}
.signals-filter.active { background: rgba(0,230,118,0.15); color: var(--green); border-color: var(--green); }
.signals-panel__body {
  max-height: 50vh; overflow-y: auto; padding: 4px 8px;
}
.signal-entry {
  display: flex; gap: 8px; padding: 6px 8px;
  border-bottom: 1px solid rgba(30,42,58,0.4);
  font-size: 12px; align-items: center;
  flex-wrap: wrap;          /* allow wrap on narrow screens — meta drops to next line */
}
.signal-entry.buy { border-left: 3px solid var(--green); }
.signal-entry.sell { border-left: 3px solid var(--red); }
.signal-entry.closed { border-left: 3px solid #6b7280; background: rgba(255,255,255,0.015); }
.signal-time { color: var(--text-dim); font-size: 10px; min-width: 60px; }
.signal-strat { font-weight: 600; padding: 1px 5px; border-radius: 3px; font-size: 10px; min-width: 42px; text-align: center; }
.signal-strat.SWING { background: rgba(33,150,243,0.2); color: var(--blue); }
.signal-strat.SCALP { background: rgba(255,171,0,0.2); color: var(--amber); }
.signal-strat.SURGE { background: rgba(0,230,118,0.2); color: var(--green); }
.signal-strat.FLOW  { background: rgba(156,77,255,0.2); color: #c688ff; }
.signal-action { font-weight: 700; min-width: 36px; }
.signal-action.buy { color: var(--green); }
.signal-action.sell { color: var(--red); }
.signal-action.closed { color: #9ca3af; font-size: 10px; letter-spacing: 0.5px; }
.signal-pnl.open { color: #64b5f6; font-size: 10px; font-weight: 700; padding: 1px 5px; border: 1px solid rgba(33,150,243,0.4); border-radius: 3px; background: rgba(33,150,243,0.08); }
.signal-sym { font-weight: 700; min-width: 50px; }
.signal-price { color: var(--amber); font-weight: 600; }
.signal-meta { color: var(--text-dim); font-size: 10px; flex: 1; }
.signal-pnl.pos { color: var(--green); font-weight: 600; }
.signal-pnl.neg { color: var(--red); font-weight: 600; }
.signal-session { font-size: 9px; padding: 1px 4px; border-radius: 3px; background: rgba(255,255,255,0.06); color: var(--text-dim); }
.signal-session.RTH { background: rgba(0,230,118,0.15); color: var(--green); }
.signal-session.PRE { background: rgba(255,171,0,0.15); color: var(--amber); }
.signal-session.AH  { background: rgba(33,150,243,0.15); color: var(--blue); }

/* Mobile (≤480px): keep the row in one viewport-width without horizontal scroll.
   Tighten gaps, shrink min-widths, and let meta wrap to a 2nd line if long. */
@media (max-width: 480px) {
  .signal-entry {
    gap: 5px;
    padding: 5px 6px;
    font-size: 11px;
  }
  .signal-time { min-width: 38px; font-size: 9px; }
  .signal-strat { min-width: 36px; font-size: 9px; padding: 1px 3px; }
  .signal-action { min-width: 28px; font-size: 11px; }
  .signal-action.closed { min-width: 44px; font-size: 9px; letter-spacing: 0.3px; }
  .signal-sym { min-width: 38px; font-size: 11px; }
  .signal-price { font-size: 11px; }
  .signal-session { font-size: 8px; padding: 1px 3px; }
  .signal-pnl.open { font-size: 9px; padding: 1px 4px; }
  /* Meta wraps to a full-width 2nd line on mobile so long text never causes overflow */
  .signal-meta {
    flex: 1 1 100%;        /* take a full row */
    order: 99;             /* push to end of wrap */
    font-size: 9px;
    padding-left: 44px;    /* indent under time column for readability */
    margin-top: 1px;
  }
}
.signal-session.ON  { background: rgba(156,77,255,0.15); color: #c688ff; }
.signals-empty { color: var(--text-dim); text-align: center; padding: 24px; font-size: 12px; }
.signals-panel__footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 12px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-dim);
}
.signals-clear {
  font-size: 10px; padding: 3px 8px; border-radius: 4px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer;
}
.controls-row__badge--signals { background: rgba(255,171,0,0.2); color: var(--amber); }

/* ── Global News Panel ── */
.news-panel {
  margin: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
.news-panel:not(.expanded) { display: none; }
.news-panel__body {
  max-height: 60vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.news-panel__empty {
  padding: 16px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-dim);
}
.news-entry {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.news-entry__header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.news-entry__time {
  font-size: 0.62rem;
  color: var(--text-dim);
}
.news-entry__headline {
  font-size: 0.78rem;
  color: #ccd6f6;
  line-height: 1.35;
}
.news-entry__symbols {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 3px;
}
.news-entry__chip {
  font-size: 0.6rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(100,255,218,.1);
  color: #64ffda;
}
.news-dot--positive { color: #4caf50; font-size: 1.1rem; line-height: 1; }
.news-dot--negative { color: #f44336; font-size: 1.1rem; line-height: 1; }
.news-dot--neutral { color: #8892b0; font-size: 1.1rem; line-height: 1; }
.controls-row__badge--news {
  background: rgba(255,193,7,.2);
  color: #ffc107;
}

/* ── Audit Row ── */
.audit-row {
  padding: 6px 10px;
  background: rgba(255,193,7,0.04);
  border: 1px solid rgba(255,193,7,0.12);
  border-radius: 6px;
  margin: 4px 0;
}
.audit-row__header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.7rem;
}
.audit-row__date {
  color: var(--text-dim);
  font-size: 0.62rem;
}
.audit-row__entry {
  color: var(--text);
  font-weight: 600;
}
.audit-row__arrow {
  color: var(--text-dim);
  font-size: 0.6rem;
}
.audit-row__now {
  font-weight: 700;
}
.audit-row__now.positive { color: var(--green); }
.audit-row__now.negative { color: var(--red); }
.audit-row__days {
  font-size: 0.58rem;
  color: var(--text-dim);
  margin-left: auto;
}
.audit-horizons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.audit-horizon {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.audit-horizon b {
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-right: 2px;
}
.audit-fc { font-weight: 600; }
.audit-fc.positive { color: var(--green); }
.audit-fc.negative { color: var(--red); }
.audit-vs { color: var(--text-dim); font-size: 0.6rem; }
.audit-ac { font-weight: 700; }
.audit-ac.positive { color: var(--green); }
.audit-ac.negative { color: var(--red); }
.audit-hit {
  border-color: rgba(0,230,118,0.25);
  background: rgba(0,230,118,0.06);
}
.audit-miss {
  border-color: rgba(255,23,68,0.25);
  background: rgba(255,23,68,0.06);
}
.audit-pending {
  opacity: 0.6;
}
.audit-verdict {
  font-weight: 700;
  font-size: 0.72rem;
}
.audit-hit .audit-verdict { color: var(--green); }
.audit-miss .audit-verdict { color: var(--red); }

/* ── v2 Outcome Summary Panel ── */
.outcome-summary {
  background: rgba(33,150,243,0.04);
  border: 1px solid rgba(33,150,243,0.15);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.outcome-summary__title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #42a5f5;
  margin-bottom: 8px;
}
.outcome-summary__period {
  font-weight: 400;
  font-size: 0.65rem;
  color: var(--text-dim);
}
.outcome-summary__empty {
  font-size: 0.65rem;
  color: var(--text-dim);
  padding: 8px 0;
}
.outcome-summary__kpi {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.outcome-kpi {
  flex: 1;
  min-width: 60px;
  text-align: center;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 6px 4px;
}
.outcome-kpi__label {
  font-size: 0.55rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.outcome-kpi__value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}
.outcome-kpi__value.positive { color: var(--green); }
.outcome-kpi__value.negative { color: var(--red); }
.outcome-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.62rem;
}
.outcome-table th {
  text-align: center;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.55rem;
  padding: 3px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-transform: uppercase;
}
.outcome-table td {
  text-align: center;
  padding: 4px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.outcome-row {
  cursor: pointer;
  transition: background 0.15s;
}
.outcome-row:hover {
  background: rgba(33,150,243,0.08);
}
.outcome-row.loading {
  opacity: 0.5;
}
.outcome-date {
  font-weight: 600;
  color: #42a5f5;
}
.outcome-val { color: var(--text); }
.outcome-val.positive { color: var(--green); }
.outcome-val.negative { color: var(--red); }
.outcome-obs {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.outcome-obs__title {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.outcome-obs ul {
  margin: 0;
  padding-left: 16px;
  font-size: 0.62rem;
  color: var(--text-dim);
}
.outcome-obs li { margin-bottom: 2px; }
/* ── Outcome Detail Drill-down ── */
.outcome-detail {
  background: rgba(33,150,243,0.03);
  border: 1px solid rgba(33,150,243,0.10);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
}
.outcome-detail__title {
  font-size: 0.68rem;
  font-weight: 700;
  color: #42a5f5;
  margin-bottom: 6px;
}
.outcome-detail__section {
  margin-bottom: 8px;
}
.outcome-detail__section b {
  font-size: 0.6rem;
  color: var(--text-dim);
  display: block;
  margin-bottom: 3px;
}
.outcome-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.6rem;
}
.outcome-detail-table th {
  text-align: center;
  font-size: 0.52rem;
  color: var(--text-dim);
  padding: 2px 3px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.outcome-detail-table td {
  text-align: center;
  padding: 3px 3px;
}

/* ── Signal Heatmap (audit drill-down) ── */
.sig-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 4px;
}
.sig-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.52rem;
  white-space: nowrap;
}
.sig-table th, .sig-table td {
  padding: 2px 3px;
  text-align: center;
}
.sig-hdr {
  color: var(--text-dim);
  font-size: 0.45rem;
  font-weight: 400;
}
.sig-cell {
  min-width: 28px;
  border-radius: 2px;
  font-weight: 600;
  font-size: 0.48rem;
}
.sig-bull {
  background: rgba(0, 230, 118, 0.15);
  color: var(--green);
}
.sig-bear {
  background: rgba(255, 23, 68, 0.15);
  color: var(--red);
}
.sig-zero {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
}
.sig-na {
  color: var(--text-dim);
  font-size: 0.5rem;
}

/* ── BOLL-M Combined Row ── */
.card__boll-combined .boll-combined-values {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}
.boll-sep {
  color: var(--text-dim);
  opacity: 0.3;
  font-size: 0.7rem;
}
.boll-tf-tag {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-dim);
  background: rgba(255,255,255,0.06);
  padding: 1px 4px;
  border-radius: 3px;
  min-width: 20px;
  text-align: center;
}
.boll-m-count {
  font-size: 0.73rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
  white-space: nowrap;
}
.boll-m-below.active {
  color: var(--green);
  background: rgba(16, 185, 129, 0.12);
}
.boll-m-above.active {
  color: var(--red);
  background: rgba(239, 68, 68, 0.12);
}
.boll-m-avg {
  font-size: 0.6rem;
  color: var(--text-dim);
  opacity: 0.55;
}

/* ── Pk/Pr(3M) Row ── */
.card__pkpr-row .label small {
  font-size: 0.6rem;
  opacity: 0.6;
}
.pkpr-scroll-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.pkpr-count {
  font-size: 0.7rem;
  font-weight: 700;
  color: #f59e0b;
  white-space: nowrap;
  flex-shrink: 0;
}
.pkpr-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}
.pkpr-scroll::-webkit-scrollbar { display: none; }
.pkpr-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.pkpr-item b {
  color: var(--accent);
  font-size: 0.6rem;
}
.pkpr-vol {
  color: #f59e0b;
  font-weight: 600;
}
.pkpr-none {
  font-size: 0.68rem;
  color: var(--text-dim);
  opacity: 0.5;
}

/* ── Gain/Loss Badge ── */
.gl-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  line-height: 1;
}
.gl-badge small {
  font-weight: 400;
  opacity: 0.7;
}
.gl-gainer {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.gl-loser {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ── Flash Splash Overlay ── */
.splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.splash-card {
  max-width: 420px;
  width: calc(100% - 32px);
  max-height: 85vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.splash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.splash-date {
  font-size: 0.78rem;
  color: var(--text-dim);
}
.splash-bias {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.splash-bias.bullish { background: rgba(0,230,118,0.2); color: var(--green); }
.splash-bias.bearish { background: rgba(255,23,68,0.2); color: var(--red); }
.splash-bias.neutral { background: rgba(255,193,7,0.2); color: var(--yellow); }
.splash-conviction {
  font-size: 0.58rem;
  color: var(--text-dim);
  margin-left: 6px;
}
.splash-indices {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.splash-idx {
  flex: 1;
  min-width: 70px;
  text-align: center;
  padding: 6px 4px;
  background: var(--surface2);
  border-radius: 8px;
}
.splash-idx-label {
  font-size: 0.58rem;
  color: var(--text-dim);
  font-weight: 600;
}
.splash-idx-price {
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 2px;
}
.splash-idx-change {
  font-size: 0.62rem;
  font-weight: 600;
}
.splash-section-title {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--border);
}
.splash-section-title.gainers { color: var(--green); border-color: rgba(0,230,118,0.2); }
.splash-section-title.losers { color: var(--red); border-color: rgba(255,23,68,0.2); }
.splash-section-title.iv { color: var(--yellow); border-color: rgba(255,193,7,0.2); }
.splash-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}
.splash-table td {
  padding: 4px 3px;
  font-size: 0.72rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.splash-table .sym { font-weight: 700; min-width: 50px; }
.splash-table .price { color: var(--text-dim); text-align: right; }
.splash-table .chg { font-weight: 700; text-align: right; min-width: 50px; }
.splash-table .signal {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  text-align: center;
}
.splash-table .signal-buy { background: rgba(0,230,118,0.12); color: var(--green); }
.splash-table .signal-sell { background: rgba(255,23,68,0.12); color: var(--red); }
.splash-table .signal-hold { background: rgba(255,193,7,0.12); color: var(--yellow); }
.splash-table .note {
  font-size: 0.6rem;
  color: var(--text-dim);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.splash-iv-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.splash-iv-pill {
  font-size: 0.68rem;
  padding: 4px 10px;
  background: rgba(255,193,7,0.1);
  border: 1px solid rgba(255,193,7,0.25);
  border-radius: 8px;
  color: var(--yellow);
}
.splash-iv-pill .iv-sym { font-weight: 700; }
.splash-iv-pill .iv-pct { margin-left: 4px; opacity: 0.8; }
.splash-iv-pill .iv-range {
  display: block;
  font-size: 0.58rem;
  color: var(--text-dim);
  margin-top: 1px;
}
.splash-insight {
  background: rgba(33,150,243,0.06);
  border: 1px solid rgba(33,150,243,0.15);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 0.72rem;
  color: var(--text);
  line-height: 1.5;
  font-style: italic;
}
.splash-check {
  font-size: 0.62rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 12px;
}
.splash-check.fresh { color: var(--green); }
.splash-check.stale { color: var(--yellow); }
.splash-ok {
  width: 100%;
  height: 44px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.splash-ok:active { opacity: 0.8; }

/* Grok comment panel */
.card__grok-panel { display: none; padding: 0 12px; }
.card__grok-panel.open { display: block; }
.card__grok-btn { color: var(--yellow) !important; }
.card__grok-btn.active { background: rgba(255,193,7,0.15) !important; }

.grok-comment {
  padding: 8px 10px;
  border-radius: 8px;
  margin: 4px 0;
  font-size: 0.65rem;
  border-left: 3px solid var(--text-dim);
}
.grok-comment.grok-bullish {
  background: rgba(0,230,118,0.06);
  border-left-color: var(--green);
}
.grok-comment.grok-bearish {
  background: rgba(255,23,68,0.06);
  border-left-color: var(--red);
}
.grok-comment.grok-neutral {
  background: rgba(255,193,7,0.06);
  border-left-color: var(--yellow);
}
.grok-header {
  display: flex; gap: 6px; align-items: center;
  margin-bottom: 4px; font-weight: 600;
}
.grok-arrow { font-size: 0.7rem; }
.grok-depth { font-size: 0.7rem; font-weight: 700; }
.grok-tf { color: var(--text-dim); font-size: 0.55rem; }
.grok-conf {
  font-size: 0.45rem; text-transform: uppercase; font-weight: 700;
  padding: 1px 4px; border-radius: 3px;
}
.grok-conf-high { color: var(--green); background: rgba(0,230,118,0.12); }
.grok-conf-medium { color: var(--yellow); background: rgba(255,193,7,0.12); }
.grok-conf-low { color: var(--text-dim); background: rgba(255,255,255,0.06); }
.grok-ts { color: var(--text-dim); font-size: 0.45rem; margin-left: auto; font-style: italic; }
.grok-body { color: var(--text-secondary, var(--text-dim)); line-height: 1.4; }
.grok-empty { color: var(--text-dim); font-size: 0.6rem; font-style: italic; padding: 6px 0; }
.grok-loading { color: var(--text-dim); font-size: 0.6rem; font-style: italic; padding: 6px 0; }

/* ── DayTrade Panel ── */
.dt-panel { background:rgba(30,30,30,0.85); border-radius:12px; padding:10px; margin:6px 0; }
.dt-empty { color:var(--text-dim); font-size:0.65rem; font-style:italic; }
.dt-active-signal { display:flex; align-items:center; gap:8px; padding:8px 12px; border-radius:8px; font-weight:700; font-size:0.75rem; }
.dt-active-signal.dt-buy { background:rgba(0,200,83,0.15); border-left:3px solid #00c853; color:#00e676; }
.dt-active-signal.dt-sell { background:rgba(244,67,54,0.15); border-left:3px solid #f44336; color:#ef5350; }
.dt-active-signal.dt-neutral { background:rgba(100,100,100,0.15); border-left:3px solid #666; color:var(--text-dim); }
.dt-signal-label { font-size:0.85rem; }
.dt-signal-conf { background:rgba(255,255,255,0.1); padding:2px 6px; border-radius:4px; font-size:0.65rem; }
.dt-signal-reason { font-weight:400; font-size:0.6rem; color:var(--text-dim); flex:1; text-align:right; }

/* RCR Phase Badge Row */
.dt-rcr-row { display:flex; align-items:center; gap:6px; margin:6px 0; flex-wrap:wrap; }
.dt-rcr-badge { padding:3px 8px; border-radius:10px; font-size:0.65rem; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; }
.dt-rcr-badge.ramp1 { background:rgba(0,200,83,0.2); color:#00e676; }
.dt-rcr-badge.ramp2 { background:rgba(0,200,83,0.3); color:#69f0ae; }
.dt-rcr-badge.consolidation { background:rgba(255,152,0,0.2); color:#ffc107; }
.dt-rcr-badge.none { background:rgba(100,100,100,0.2); color:var(--text-dim); }
.dt-rcr-conf { display:inline-flex; align-items:center; gap:3px; font-size:0.55rem; color:var(--text-dim); }
.dt-rcr-conf-bar { width:40px; height:5px; background:rgba(255,255,255,0.1); border-radius:3px; overflow:hidden; }
.dt-rcr-conf-fill { height:100%; border-radius:3px; transition:width 0.3s; }
.dt-rcr-conf-fill.high { background:#00e676; }
.dt-rcr-conf-fill.med { background:#ffc107; }
.dt-rcr-conf-fill.low { background:#ef5350; }
.dt-rcr-counts { font-size:0.55rem; color:var(--text-dim); margin-left:auto; letter-spacing:0.3px; }

/* Mini Bar Chart */
.dt-bar-chart { display:flex; align-items:flex-end; gap:1px; height:50px; background:rgba(40,40,40,0.5); border-radius:6px; padding:4px 3px 2px; margin:4px 0; position:relative; overflow:hidden; }
.dt-bar { flex:1; min-width:3px; border-radius:2px 2px 0 0; transition:height 0.2s; position:relative; }
.dt-bar.buy { background:rgba(0,200,83,0.7); }
.dt-bar.sell { background:rgba(244,67,54,0.7); }
.dt-bar.ramp { box-shadow:0 0 4px rgba(0,200,83,0.4); }
.dt-bar.ramp::after { content:''; position:absolute; bottom:0; left:0; right:0; top:0; background:rgba(0,200,83,0.08); border-radius:2px 2px 0 0; }
.dt-ema-line { position:absolute; left:3px; right:3px; top:4px; bottom:2px; pointer-events:none; }
.dt-ema-line svg { width:100%; height:100%; }
.dt-ema-line path { fill:none; stroke:rgba(255,215,0,0.6); stroke-width:1.5; stroke-linecap:round; }

/* Flow Gauge Row */
.dt-flow-row { display:flex; align-items:center; gap:6px; margin:4px 0; font-size:0.6rem; }
.dt-flow-bar-wrap { flex:1; height:8px; background:rgba(255,255,255,0.08); border-radius:4px; overflow:hidden; position:relative; }
.dt-flow-bar { height:100%; border-radius:4px; transition:width 0.4s ease; }
.dt-flow-bar.bullish { background:linear-gradient(90deg,#00c853,#00e676); }
.dt-flow-bar.bearish { background:linear-gradient(90deg,#f44336,#ef5350); }
.dt-flow-bar.neutral { background:linear-gradient(90deg,#ff9800,#ffc107); }
.dt-flow-label { font-weight:600; min-width:44px; }
.dt-flow-label.bullish { color:#00e676; }
.dt-flow-label.bearish { color:#ef5350; }
.dt-flow-label.neutral { color:#ffc107; }
.dt-flow-arrow { font-size:0.7rem; }
.dt-flow-arrow.buying { color:#00e676; }
.dt-flow-arrow.selling { color:#ef5350; }
.dt-flow-arrow.flow-neutral { color:#ffc107; }
.dt-flow-ema { font-size:0.6rem; }
.dt-flow-ema.up { color:#00e676; }
.dt-flow-ema.down { color:#ef5350; }
.dt-flow-ema.flat { color:var(--text-dim); }
.dt-flow-vol { background:rgba(255,255,255,0.08); padding:1px 5px; border-radius:3px; font-size:0.55rem; font-weight:600; color:var(--text-dim); }
.dt-flow-vol.hot { color:#ffc107; background:rgba(255,193,7,0.15); }

/* Squeeze Gauge Row */
.dt-squeeze-row { display:flex; align-items:center; gap:6px; margin:4px 0; font-size:0.55rem; color:var(--text-dim); }
.dt-squeeze-label { font-weight:600; min-width:22px; }
.dt-squeeze-bar-wrap { flex:1; height:6px; background:rgba(255,255,255,0.08); border-radius:3px; overflow:hidden; }
.dt-squeeze-bar { height:100%; border-radius:3px; background:linear-gradient(90deg,rgba(124,58,237,0.5),rgba(167,139,250,0.7)); transition:width 0.4s; }
.dt-squeeze-pct { min-width:30px; text-align:right; }
.dt-squeeze-badge { background:rgba(124,58,237,0.25); color:#a78bfa; padding:2px 6px; border-radius:4px; font-size:0.55rem; font-weight:700; animation:dt-squeeze-pulse 1.5s ease-in-out infinite; }
@keyframes dt-squeeze-pulse { 0%,100%{opacity:1;box-shadow:0 0 4px rgba(124,58,237,0.3)} 50%{opacity:0.7;box-shadow:0 0 8px rgba(124,58,237,0.6)} }
.dt-band-scale { flex:1; height:6px; background:rgba(255,255,255,0.08); border-radius:3px; position:relative; }
.dt-band-dot { position:absolute; top:-2px; width:8px; height:10px; border-radius:50%; background:#a78bfa; border:1px solid rgba(255,255,255,0.3); transform:translateX(-4px); transition:left 0.4s; }
.dt-band-labels { display:flex; justify-content:space-between; font-size:0.45rem; color:var(--text-dim); opacity:0.6; }

/* Phase Bar (enhanced) */
.dt-phases-bar { display:flex; height:10px; border-radius:5px; overflow:hidden; margin:4px 0; }
.dt-phase-seg { position:relative; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.dt-phase-seg.ramp { background:linear-gradient(90deg,#00c853,#00e676); }
.dt-phase-seg.consolidation { background:linear-gradient(90deg,#ff9800,#ffc107); }
.dt-phase-label { font-size:0.4rem; font-weight:700; color:rgba(0,0,0,0.7); white-space:nowrap; text-shadow:0 0 2px rgba(255,255,255,0.3); }

/* Signal Timeline */
.dt-timeline { height:28px; background:rgba(50,50,50,0.6); border-radius:4px; position:relative; margin:6px 0; }
.dt-timeline-labels { display:flex; justify-content:space-between; font-size:0.5rem; color:var(--text-dim); padding:0 4px; position:absolute; bottom:0; width:100%; box-sizing:border-box; z-index:1; }
.dt-timeline-marker { position:absolute; top:4px; width:0; height:0; border-left:5px solid transparent; border-right:5px solid transparent; transform:translateX(-5px); z-index:2; }
.dt-timeline-marker.buy { border-bottom:8px solid #00c853; }
.dt-timeline-marker.sell { border-top:8px solid #f44336; top:auto; bottom:12px; }
.dt-timeline-marker.active { filter:brightness(1.5); animation:dt-pulse 1.2s ease-in-out infinite; }
@keyframes dt-pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* Stats Row */
.dt-stats { display:flex; gap:10px; font-size:0.6rem; color:var(--text-dim); flex-wrap:wrap; margin-top:4px; }
.dt-boll-info { font-size:0.6rem; }

/* ── DayTrade 1m Panel ── */
.dt1m-panel { background:rgba(30,30,30,0.85); border-radius:12px; padding:10px; margin:6px 0; }
/* Multi-TF Stack — vertical charts below original 5m */
.multi-tf-stack { margin:4px 0; }
.multi-tf-charts { margin:4px 0; }
.multi-tf-charts:empty { margin: 0; display: none; }
.multi-tf-section { margin-bottom:4px; background:rgba(15,15,15,0.95); border-radius:8px; overflow:hidden; border:1px solid rgba(255,255,255,0.06); }
.multi-tf-title { font-size:0.6rem; color:#ffa500; font-weight:700; padding:3px 8px; background:rgba(255,165,0,0.08); letter-spacing:1px; border-bottom:1px solid rgba(255,165,0,0.15); }
.multi-tf-label { font-size:0.65rem; color:#4fc3f7; font-weight:700; padding:3px 8px; background:rgba(79,195,247,0.08); letter-spacing:1px; border-bottom:1px solid rgba(79,195,247,0.15); }
.multi-tf-chart { height:300px; }

.dt1m-panel-wrap { margin:4px 0; }
.dt1m-toggle-trades { background:rgba(50,50,50,0.7); color:var(--text-dim); border:1px solid rgba(255,255,255,0.1); border-radius:6px; padding:3px 10px; font-size:0.6rem; cursor:pointer; margin:2px 0; }
.dt1m-toggle-trades:hover, .dt1m-toggle-trades.active { background:rgba(255,165,0,0.2); color:#ffa500; border-color:#ffa500; }
.dt1m-empty { color:var(--text-dim); font-size:0.65rem; font-style:italic; }
.dt1m-signal { display:flex; align-items:center; gap:8px; padding:8px 12px; border-radius:8px; font-weight:700; font-size:0.75rem; flex:1; }
.dt1m-signal.dt1m-buy { background:rgba(0,200,83,0.15); border-left:3px solid #00c853; color:#00e676; }
.dt1m-signal.dt1m-sell { background:rgba(244,67,54,0.15); border-left:3px solid #f44336; color:#ef5350; }
.dt1m-signal.dt1m-neutral { background:rgba(100,100,100,0.15); border-left:3px solid #666; color:var(--text-dim); }
.dt1m-signal-label { font-size:0.85rem; }
.dt1m-signal-score { background:rgba(255,255,255,0.1); padding:2px 6px; border-radius:4px; font-size:0.65rem; }
.dt1m-signal-time { font-weight:400; font-size:0.6rem; color:var(--text-dim); margin-left:auto; }

.dt1m-rules { display:flex; flex-wrap:wrap; gap:4px; margin:6px 0; }
.dt1m-rule { padding:2px 6px; border-radius:4px; font-size:0.55rem; font-weight:600; background:rgba(255,255,255,0.08); color:var(--text-dim); }
.dt1m-rule.streak { background:rgba(255,152,0,0.2); color:#ffc107; }
.dt1m-rule.confirmed { background:rgba(0,200,83,0.2); color:#00e676; }
.dt1m-rule.blocked { background:rgba(244,67,54,0.15); color:#ef5350; }

.dt1m-streak { display:inline-flex; align-items:center; gap:4px; padding:4px 10px; border-radius:6px; font-size:0.7rem; font-weight:700; background:rgba(255,152,0,0.2); color:#ffc107; margin:4px 0; animation:dt-pulse 1.2s ease-in-out infinite; }

.dt1m-analytics { display:flex; flex-wrap:wrap; gap:8px; font-size:0.6rem; color:var(--text-dim); margin:6px 0; padding:6px 8px; background:rgba(40,40,40,0.5); border-radius:6px; }
.dt1m-analytics span { white-space:nowrap; }
.dt1m-os { color:#00e676; }
.dt1m-ob { color:#ef5350; }
.dt1m-momentum-gain { color: #ffb74d; font-weight: 700; }

.dt1m-trade-open { display:flex; align-items:center; gap:8px; padding:6px 10px; border-radius:6px; font-size:0.65rem; font-weight:600; background:rgba(33,150,243,0.12); border-left:3px solid var(--blue); margin:4px 0; }
.dt1m-trade-time { font-weight:400; font-size:0.55rem; color:var(--text-dim); margin-left:auto; }

.dt1m-trades-closed { margin:4px 0; }
.dt1m-trade-row { display:flex; align-items:center; gap:8px; padding:3px 8px; font-size:0.55rem; color:var(--text-dim); border-bottom:1px solid rgba(255,255,255,0.04); }
.dt1m-trade-row:last-child { border-bottom:none; }
.dt1m-trade-reason { font-size:0.5rem; margin-left:auto; opacity:0.7; }

.dt1m-section-header { font-size:0.7rem; font-weight:700; color:#ff9800; padding:10px 12px 4px; letter-spacing:0.5px; text-transform:uppercase; border-bottom:1px solid rgba(255,152,0,0.2); margin-bottom:6px; }

.dt1m-vol-ctx { font-size:0.55rem; color:var(--text-dim); padding:2px 8px; opacity:0.8; }

.dt1m-rule.m3-fade    { background: rgba(244,67,54,0.2); color: #ef5350; }
.dt1m-rule.m8-div     { background: rgba(255,235,59,0.2); color: #ffee58; }
.dt1m-rule.m8-cross   { background: rgba(33,150,243,0.2); color: #42a5f5; }
.dt1m-rule.m9-pause   { background: #6b4c9a; color: #e0d0ff; }
.dt1m-rule.m10-time   { background: #8b4513; color: #ffdead; }
.dt1m-rule.m10-trend  { background: #b22222; color: #ffc0c0; }
.dt1m-rule.m11-circuit { background: #dc143c; color: #fff; }
.dt1m-rule.mtf-5m     { background: #2e6b4f; color: #a0ffd0; }

.dt1m-trade-short { border-left-color: #ef5350 !important; background: rgba(244,67,54,0.12) !important; }
.dt1m-trade-momentum { border-left-color: #ffb74d !important; background: rgba(255,152,0,0.12) !important; }
.dt1m-trade-row-mtm { border-left: 2px solid rgba(255,152,0,0.4); padding-left: 6px; }

/* Trade notification banners */
.dt1m-notif { padding:8px 10px; border-radius:8px; margin-bottom:6px; animation: dt1m-notif-flash 1.5s ease-in-out 3; }
.dt1m-notif-buy { background:rgba(0,200,83,0.2); border:1px solid rgba(0,200,83,0.5); }
.dt1m-notif-short { background:rgba(244,67,54,0.2); border:1px solid rgba(244,67,54,0.5); }
.dt1m-notif-exit { background:rgba(33,150,243,0.15); border:1px solid rgba(33,150,243,0.4); }
.dt1m-notif-momentum { background:rgba(255,152,0,0.2); border:1px solid rgba(255,152,0,0.5); }
.dt1m-notif-momentum .dt1m-notif-header { color:#ffb74d; }
.dt1m-notif-header { font-size:0.8rem; font-weight:700; letter-spacing:0.3px; }
.dt1m-notif-buy .dt1m-notif-header { color:#00e676; }
.dt1m-notif-short .dt1m-notif-header { color:#ef5350; }
.dt1m-notif-exit .dt1m-notif-header { color:#90caf9; }
.dt1m-notif-details { display:flex; gap:8px; flex-wrap:wrap; font-size:0.6rem; color:var(--text-dim); margin-top:3px; }
.dt1m-notif-meta { font-size:0.55rem; color:var(--text-dim); opacity:0.8; margin-top:2px; }
@keyframes dt1m-notif-flash {
  0%, 100% { opacity:1; }
  50% { opacity:0.6; }
}

/* Session stats */
.dt1m-stats { display:flex; gap:8px; font-size:0.6rem; color:var(--text-dim); padding:4px 8px; border-top:1px solid rgba(255,255,255,0.06); margin-top:4px; }

/* Orange-to-blue spectrum flicker for DT1m cards */
@keyframes dt1m-glow-orange {
  0%, 100% { box-shadow: 0 0 6px rgba(255,152,0,0.15); background-color: rgba(255,152,0,0.03); }
  50% { box-shadow: 0 0 20px rgba(255,152,0,0.4); background-color: rgba(255,152,0,0.08); }
}
@keyframes dt1m-glow-amber {
  0%, 100% { box-shadow: 0 0 6px rgba(255,193,7,0.15); background-color: rgba(255,193,7,0.03); }
  50% { box-shadow: 0 0 16px rgba(255,193,7,0.3); background-color: rgba(255,193,7,0.06); }
}
@keyframes dt1m-glow-neutral {
  0%, 100% { box-shadow: 0 0 4px rgba(150,150,150,0.1); }
  50% { box-shadow: 0 0 10px rgba(150,150,150,0.2); }
}
@keyframes dt1m-glow-blue {
  0%, 100% { box-shadow: 0 0 6px rgba(33,150,243,0.15); background-color: rgba(33,150,243,0.03); }
  50% { box-shadow: 0 0 20px rgba(33,150,243,0.4); background-color: rgba(33,150,243,0.08); }
}
@keyframes dt1m-glow-indigo {
  0%, 100% { box-shadow: 0 0 6px rgba(63,81,181,0.15); background-color: rgba(63,81,181,0.03); }
  50% { box-shadow: 0 0 20px rgba(63,81,181,0.4); background-color: rgba(63,81,181,0.08); }
}

.card.dt1m-flicker-orange  { animation: dt1m-glow-orange 1.5s ease-in-out infinite; }
.card.dt1m-flicker-amber   { animation: dt1m-glow-amber 2s ease-in-out infinite; }
.card.dt1m-flicker-neutral { animation: dt1m-glow-neutral 3s ease-in-out infinite; }
.card.dt1m-flicker-blue    { animation: dt1m-glow-blue 1.5s ease-in-out infinite; }
.card.dt1m-flicker-indigo  { animation: dt1m-glow-indigo 1.5s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .card[class*="dt1m-flicker-"] { animation: none; }
}
body.reduce-motion .card[class*="dt1m-flicker-"] { animation: none; }

/* Day 2h active card — bright yellow edge */
.card.dt1m-active {
  border: 2px solid #ffd600 !important;
  box-shadow: 0 0 12px rgba(255,214,0,0.35), inset 0 0 4px rgba(255,214,0,0.08);
}
@keyframes dt1m-edge-pulse {
  0%, 100% { border-color: #ffd600; box-shadow: 0 0 10px rgba(255,214,0,0.25); }
  50% { border-color: #ffea00; box-shadow: 0 0 18px rgba(255,234,0,0.45); }
}
.card.dt1m-active { animation: dt1m-edge-pulse 2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .card.dt1m-active { animation: none; } }
body.reduce-motion .card.dt1m-active { animation: none; }

/* DT1m Chart */
.dt1m-chart-wrap { margin: 4px 0; border-radius: 6px; overflow: hidden; background: #0d1117; }
.dt1m-chart-main { height: 180px; }
.dt1m-chart-score { height: 120px; border-top: 1px solid rgba(255,255,255,0.05); }
.dt1m-chart-btn { font-size: 0.55rem; padding: 2px 8px; background: rgba(255,152,0,0.15); color: #ffa726; border: 1px solid rgba(255,152,0,0.3); border-radius: 4px; cursor: pointer; margin-left: auto; }
.dt1m-chart-btn.active { background: rgba(255,152,0,0.3); }
/* Score trail arrowheads (v10) */
.score-trail { display:flex; align-items:center; gap:3px; margin-left:auto; padding:2px 6px; background:rgba(255,255,255,0.05); border-radius:6px; }
.score-trail-trend { font-size:0.7rem; font-weight:800; padding:1px 4px; border-radius:3px; }
.score-trail-trend.st-strong-up { color:#00e676; background:rgba(0,200,83,0.2); }
.score-trail-trend.st-up { color:#66bb6a; }
.score-trail-trend.st-flat { color:#9e9e9e; }
.score-trail-trend.st-down { color:#ef5350; }
.score-trail-trend.st-strong-down { color:#f44336; background:rgba(244,67,54,0.2); }
.score-trail-arrows { display:flex; gap:1px; align-items:center; font-size:0.5rem; line-height:1; }
.score-arrow { font-size:0.45rem; }
.score-arrow.st-strong-up { color:#00e676; }
.score-arrow.st-up { color:#66bb6a; }
.score-arrow.st-flat { color:#616161; }
.score-arrow.st-down { color:#ef5350; }
.score-arrow.st-strong-down { color:#f44336; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Trade badges on card headers */
.trade-badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 3px;
  letter-spacing: 0.3px;
}
.trade-open {
  background: rgba(33,150,243,0.3);
  color: #64b5f6;
  border: 1px solid rgba(33,150,243,0.5);
}
.trade-flow {
  background: rgba(156,39,176,0.25);
  color: #ce93d8;
  border-color: rgba(156,39,176,0.55);
}
.trade-win {
  background: rgba(0,230,118,0.2);
  color: #00e676;
  border: 1px solid rgba(0,230,118,0.4);
}
.trade-loss {
  background: rgba(255,23,68,0.2);
  color: #ff1744;
  border: 1px solid rgba(255,23,68,0.4);
}

/* ── Closed Trades 3-Tab View ── */
.closed-view {
  width: 100vw;
  margin-left: -12px;
  box-sizing: border-box;
  overflow: hidden;
}
.closed-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 6px;
  background: rgba(15, 19, 24, 0.95);
  border-bottom: 1px solid #1e2530;
  width: 100%;
  box-sizing: border-box;
}
.closed-tab {
  flex: 1;
  padding: 8px 2px;
  border: 1px solid #2a3040;
  border-radius: 6px;
  background: transparent;
  color: #9ca3af;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  line-height: 1.3;
}
.closed-tab.active {
  background: #1e6f50;
  color: #fff;
  border-color: #22c55e;
}
/* Live View Tabs */
.live-tabs { display: flex; gap: 4px; padding: 10px 12px; background: #0f1318; position: sticky; top: 0; z-index: 10; border-bottom: 2px solid #3b82f6; margin-bottom: 8px; grid-column: 1 / -1; }
.ob-dashboard { grid-column: 1 / -1; }
.closed-view { grid-column: 1 / -1; }
.live-tab { flex: 1; padding: 10px 4px; border: 1px solid #2d3748; border-radius: 6px; background: #161b22; color: #9ca3af; font-size: 0.75rem; font-weight: 600; cursor: pointer; text-align: center; }
.live-tab.active { background: #1e3a5f; color: #60a5fa; border-color: #3b82f6; }

/* OB Dashboard */
.ob-dashboard { padding: 0 8px; }
.ob-dash-search { padding: 8px 0; }
.ob-dash-search input { width: 100%; padding: 8px 12px; background: #161b22; border: 1px solid #2d3748; border-radius: 6px; color: #e5e7eb; font-size: 0.8rem; box-sizing: border-box; }
.ob-dash-updated { font-size: 0.6rem; color: #6b7280; text-align: right; padding: 2px 4px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.cf-now { color: var(--green); font-weight: 600; }
.cf-window { color: #9ca3af; }
.cf-stale { color: var(--amber); font-weight: 600; }
.ob-stale-alert { font-size: 0.65rem; color: #fbbf24; background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.2); border-radius: 4px; padding: 4px 8px; margin-bottom: 4px; text-align: center; }
.ob-validation { font-size: 0.55rem; padding: 1px 6px; border-radius: 3px; font-weight: 600; letter-spacing: 0.02em; }
.ob-validation.fresh { color: var(--green); background: rgba(0,230,118,0.08); border: 1px solid rgba(0,230,118,0.18); }
.ob-validation.stale { color: var(--amber); background: rgba(255,171,0,0.10); border: 1px solid rgba(255,171,0,0.22); }
.ob-age-fresh { color: var(--green); font-size: 0.58rem; font-weight: 600; opacity: 0.85; }
.ob-age-warn  { color: var(--amber); font-size: 0.58rem; font-weight: 600; }
.ob-age-stale { color: var(--red); font-size: 0.58rem; font-weight: 700; }
.tf-rth-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  margin-right: 4px;
  border-radius: 3px;
  background: rgba(33,150,243,0.08);
  border: 1px solid rgba(33,150,243,0.18);
  letter-spacing: 0.02em;
}
.tf-rth-badge.pnl-pos { background: rgba(0,230,118,0.10); border-color: rgba(0,230,118,0.25); }
.tf-rth-badge.pnl-neg { background: rgba(255,23,68,0.08); border-color: rgba(255,23,68,0.22); }
/* Pro / mid-tier RTH badge — distinct purple identity so it reads as a peer of
   RTH (green/red) and R (blue/orange). RTH + Pro + R = CF Net Flow. */
.tf-rth-pro {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  margin-right: 4px;
  border-radius: 3px;
  background: rgba(171,71,188,0.12);
  border: 1px solid rgba(171,71,188,0.30);
  color: #ce93d8;
  letter-spacing: 0.02em;
}
.tf-rth-retail {
  font-size: 0.55rem;
  color: #6b7280;
  margin-left: 2px;
}
/* Retail flow colors — distinct from smart-money green/red.
   +ve (retail buying) = light blue   -ve (retail selling) = light orange.
   Easier to read alongside smart-money pnl-pos/pnl-neg without blending. */
.retail-pos     { color: #4fc3f7; font-weight: 600; }
.retail-neg     { color: #ffb74d; font-weight: 600; }
.retail-neutral { color: #6b7280; }
/* Capital Flow sub-row (Inst / Fund / Pro breakdown) — labels stay dim,
   dollar amounts inherit the pnl-pos / pnl-neg color from the value sign. */
.cf-sub   { font-size: 0.7em; }
.cf-label { color: #6b7280; }
.cf-sub .pnl-pos { font-weight: 600; }
.cf-sub .pnl-neg { font-weight: 600; }
/* When applied as additional class on .tf-rth-retail (RTH badge), preserve its sizing
   but override the dim default color. */
.tf-rth-retail.retail-pos { color: #4fc3f7; }
.tf-rth-retail.retail-neg { color: #ffb74d; }
.tf-morning {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 600;
  padding: 1px 4px;
  margin-right: 3px;
  border-radius: 3px;
  background: rgba(255,255,255,0.03);
  letter-spacing: 0.02em;
}
.tf-morning.pnl-pos { color: var(--green); }
.tf-morning.pnl-neg { color: var(--red); }
.ob-dash-table { width: 100%; max-width: 100%; border-collapse: collapse; font-size: 0.7rem; }
.ob-dash-table th { color: #6b7280; font-weight: 600; padding: 6px 4px; border-bottom: 1px solid #2d3748; text-align: left; position: sticky; top: 46px; background: #0d1117; z-index: 2; }
.ob-dash-table td { padding: 6px 4px; border-bottom: 1px solid #1a1f2e; }
/* Desktop (≥1024px): enlarge Order Books / Options / Capital Flow tables.
   All three (.ob-dash-table, .opt-dash-table, .cf-dash-table) inherit base
   styling above; this overrides for desktop only — mobile keeps compact 0.7rem
   to fit narrow viewports. TF Deltas has its own override block below. */
@media (min-width: 1024px) {
  .ob-dash-table { font-size: 0.95rem; }
  .ob-dash-table th { font-size: 0.85rem; padding: 8px 6px; }
  .ob-dash-table td { padding: 8px 6px; }
  .ob-dash-sym { font-size: 1rem; }
  .ob-dash-price { font-size: 1rem; font-weight: 700; }
  .ob-dash-spread { font-size: 0.9rem; }
  .ob-spread-pct { font-size: 0.78rem; }
  .ob-imb-inline { font-size: 0.85rem; }
  .ob-signal { font-size: 0.85rem; }
  /* Capital Flow Inst/Fund/Pro sub-row */
  .cf-sub { font-size: 0.85rem; }
  .cf-label { font-size: 0.85rem; }
}
/* TF Deltas — fixed-layout so 6 equal-width cells don't overflow mobile.
   Without this, table-auto sizes columns to longest content → wider than viewport. */
.tf-delta-table { table-layout: fixed; }
.tf-delta-table th, .tf-delta-table td {
  width: auto;
  word-break: break-word;
  overflow: hidden;
}
.tf-delta-table .tf-data-row td {
  font-size: 0.65rem;
  padding: 4px 2px !important;
  text-align: center;
  vertical-align: top;
}
/* Desktop (≥1024px): enlarge TF Deltas metrics for easier scan-reading.
   Mobile keeps the compact 0.65rem to fit narrow viewports.
   Inline styles in app.js use em units, so bumping the parent font-size
   cascades cleanly to both smart (0.85em) and retail R-prefix (0.65em) lines. */
@media (min-width: 1024px) {
  .tf-delta-table .tf-data-row td {
    font-size: 0.95rem;
    padding: 6px 4px !important;
  }
  .tf-delta-table th {
    font-size: 0.85rem;
  }
  .tf-row-sym       { font-size: 0.95rem; }
  .ob-dash-sym-flat { font-size: 0.85rem; }
  .ob-dash-sym-flat .ob-sym-name   { font-size: 0.95rem; }
  .ob-dash-sym-flat .ob-dash-price { font-size: 0.9rem;  }
  .ob-dash-sym-flat .tf-rth-badge  { font-size: 0.8rem;  }
  .ob-dash-sym-flat .tf-rth-retail { font-size: 0.75rem; }
}
.tf-delta-table .tf-ticker-header td {
  /* full-width header — let inner .ob-dash-sym-flat handle horizontal scroll */
  width: 100%;
  max-width: 100vw;
}
.ob-dash-sym { font-weight: 700; color: #e5e7eb; }
/* Flat single-row variant for TF Deltas (mobile-optimised) */
.ob-dash-sym-flat {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  max-width: 100%;
  font-size: 0.72rem;
  padding: 6px 6px;
}
.ob-dash-sym-flat::-webkit-scrollbar { height: 2px; }
.tf-delta-table .ob-dash-sym-flat {
  /* Constrain to parent <td> width so it doesn't push table wider */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;            /* clip outside scrolling track — no horizontal page scroll */
}

/* TF Deltas ticker row — td keeps display:table-cell (preserves colspan); flex is on inner div */
.tf-delta-table td.tf-row-cell {
  padding: 6px 8px !important;
  width: 100%;
}
.tf-row-flex {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
.tf-row-sym {
  flex: 0 0 auto;                  /* fixed width by content — pinned at left */
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #e5e7eb;
  padding-right: 10px;
  border-right: 1px solid rgba(33,150,243,0.25);
  margin-right: 8px;
  background: rgba(33,150,243,0.04);
}
.tf-row-marquee {
  flex: 1 1 0;                     /* fill ALL remaining row width */
  min-width: 0;                    /* CRITICAL — allows shrink below content size */
  overflow: hidden;
  position: relative;
  height: 22px;
  line-height: 22px;
}
.tf-row-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 6px;
  animation: tfRowScroll 24s linear infinite;
  will-change: transform;
}
.tf-row-gap { display: inline-block; width: 40px; }
@keyframes tfRowScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.tf-row-marquee:hover .tf-row-track,
.tf-row-marquee:active .tf-row-track { animation-play-state: paused; }
/* Desktop (≥768px): disable auto-scroll — there's room to show all content statically.
   Animation off + duplicate copy hidden + spacer gap hidden = single static row. */
@media (min-width: 768px) {
  .tf-row-marquee {
    overflow-x: auto;
  }
  .tf-row-track {
    animation: none !important;
  }
  .tf-row-track > .tf-row-dupe { display: none; }
  .tf-row-track > .tf-row-gap { display: none; }
}
/* Two-row ticker block: header row above TF data row */
.tf-ticker-header td {
  border-bottom: none !important;
  padding-top: 8px;
  padding-bottom: 4px;
  background: rgba(33,150,243,0.04);
}
.tf-data-row td {
  border-bottom: 1px solid rgba(30,42,58,0.7) !important;  /* thicker — separates ticker blocks */
  padding-top: 4px !important;
  padding-bottom: 8px !important;
}
.ob-dash-sym-flat .ob-sym-name { font-weight: 800; color: #e5e7eb; font-size: 0.78rem; flex-shrink: 0; }
.ob-dash-sym-flat .ob-dash-price { font-size: 0.7rem; color: var(--amber); font-weight: 600; flex-shrink: 0; }
.ob-dash-sym-flat .tf-rth-badge,
.ob-dash-sym-flat .tf-morning,
.ob-dash-sym-flat .tf-rth-retail { flex-shrink: 0; margin: 0; }
.ob-dash-price { font-size: 0.65rem; white-space: nowrap; }
.ob-dash-spread { font-size: 0.65rem; white-space: nowrap; }
.ob-spread-pct { font-size: 0.6rem; color: #9ca3af; }
.ob-imb-inline { font-size: 0.6rem; font-weight: 600; }
.ob-dash-row { cursor: pointer; }
.ob-dash-row:active { background: rgba(59,130,246,0.1); }
.ob-dash-row--unvalidated { opacity: 0.55; background: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255,171,0,0.04) 6px 12px); }
.ob-dash-row--unvalidated .ob-dash-price,
.ob-dash-row--unvalidated .ob-dash-spread { color: #9ca3af; }
.ob-valid-mark { display: inline-block; font-size: 0.65rem; font-weight: 700; width: 12px; text-align: center; cursor: help; }
.ob-valid-mark.ob-valid-ok   { color: var(--green); opacity: 0.8; }
.ob-valid-mark.ob-valid-warn { color: var(--blue, #2196f3); opacity: 0.7; }
.ob-valid-mark.ob-valid-bad  { color: var(--amber); }

/* Agent P&L Dashboard */
.agent-dash-summary { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 4px; }
.agent-stat { flex: 1; min-width: 60px; background: #161b22; border: 1px solid #2d3748; border-radius: 6px; padding: 8px; text-align: center; }
.agent-stat-label { display: block; font-size: 0.6rem; color: #6b7280; text-transform: uppercase; }
.agent-stat-value { display: block; font-size: 0.85rem; font-weight: 700; color: #e5e7eb; margin-top: 2px; }
.agent-dash-section { padding: 8px 4px 4px; font-size: 0.75rem; color: #9ca3af; }

/* Weekly tree view */
.closed-week { margin-bottom: 2px; }
.closed-week-header { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: #161b22; border: 1px solid #2d3748; border-radius: 6px; cursor: pointer; font-size: 0.72rem; color: #9ca3af; }
.closed-week-header:active { background: #1e2530; }
.closed-week-arrow { font-size: 0.6rem; min-width: 12px; }
.closed-week-label { flex: 1; font-weight: 600; color: #e5e7eb; }
.closed-week-body { padding: 0 4px 4px; }

.closed-trades-table {
  width: 100%;
  padding: 0;
  font-size: 11px;
}
.closed-trades-table table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.closed-trades-table th {
  text-align: left;
  padding: 6px 2px;
  color: #9ca3af;
  border-bottom: 1px solid #2a3040;
  font-weight: 500;
  font-size: 10px;
}
.closed-trades-table td {
  padding: 6px 2px;
  border-bottom: 1px solid #1a1f2e;
  color: #d1d5db;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.closed-trades-table .pnl-pos { color: #00e676; font-weight: 600; }
.closed-trades-table .pnl-neg { color: #ff1744; font-weight: 600; }
.closed-summary {
  display: flex;
  gap: 10px;
  padding: 8px 6px;
  font-size: 12px;
  color: #d1d5db;
  border-bottom: 1px solid #1e2530;
  width: 100%;
  box-sizing: border-box;
}
.closed-summary .eq { color: #00e676; font-weight: 600; }
.closed-summary .pnl-neg { color: #ff1744; font-weight: 600; }

/* 5m_pm premarket scalp row highlight in Closed records (2026-05-13).
   Per W17/18/19 audit: 100% WR, +13.22% combined — special class worth flagging. */
.trade-row-5mpm {
  background: linear-gradient(90deg,
    rgba(255,193,7,0.10) 0%,
    rgba(255,193,7,0.04) 70%,
    rgba(255,193,7,0.10) 100%);
  border-left: 2px solid rgba(255,193,7,0.55);
}
.trade-row-5mpm td { background: transparent; }
.trade-row-5mpm:hover { background: rgba(255,193,7,0.16); }
.tf-badge-5mpm {
  display: inline-block;
  font-size: 0.58rem;
  background: rgba(255,193,7,0.18);
  color: #ffc107;
  border: 1px solid rgba(255,193,7,0.40);
  border-radius: 3px;
  padding: 0 5px;
  margin-left: 4px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  vertical-align: middle;
}

/* SURGE filter status banner — added 2026-05-13 when SURGE window enforced to 08:30-12:00 ET */
.surge-filter-note {
  margin: 6px 8px 10px;
  padding: 6px 10px;
  background: rgba(255,193,7,0.08);
  border-left: 3px solid rgba(255,193,7,0.55);
  border-radius: 4px;
  font-size: 0.7rem;
  color: #ffc107;
  letter-spacing: 0.2px;
}

/* === 2026-05-26 Live tab card-grid layout (TF Deltas excluded — kept as table) ===
   OB + Options: 2 cols mobile / 4 cols desktop
   CF: 1 col mobile / 2 cols desktop */

.ob-dash-table:not(.tf-delta-table) tbody,
.opt-dash-table tbody,
.cf-dash-table tbody {
  display: grid;
  gap: 6px;
  padding: 6px;
}

/* Mobile defaults */
.ob-dash-table:not(.tf-delta-table) tbody,
.opt-dash-table tbody {
  grid-template-columns: repeat(2, 1fr);
}
.cf-dash-table tbody {
  grid-template-columns: 1fr;
}

/* Desktop ≥768px — 2026-05-26 bumped to 8 cols per user request */
@media (min-width: 768px) {
  .ob-dash-table:not(.tf-delta-table) tbody,
  .opt-dash-table tbody,
  .cf-dash-table tbody {
    grid-template-columns: repeat(8, 1fr);
  }
}

/* Each ticker row → card */
.ob-dash-table:not(.tf-delta-table) tbody tr,
.opt-dash-table tbody tr,
.cf-dash-table tbody tr {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.72rem;
  overflow: hidden;
}

/* Cells stack inside card */
.ob-dash-table:not(.tf-delta-table) tbody tr td,
.opt-dash-table tbody tr td,
.cf-dash-table tbody tr td {
  display: block;
  padding: 1px 0;
  border: none;
  white-space: normal;
  word-break: break-word;
}

/* Hide table column headers (cells use inline labels) */
.ob-dash-table:not(.tf-delta-table) thead,
.opt-dash-table thead,
.cf-dash-table thead {
  display: none;
}

/* Inline column labels — Options */
.opt-dash-table tbody tr td:nth-child(2)::before { content: 'IV: '; color: var(--text-dim); font-size: 0.62rem; font-weight: 500; }
.opt-dash-table tbody tr td:nth-child(3)::before { content: 'Vol C/P: '; color: var(--text-dim); font-size: 0.62rem; font-weight: 500; }
.opt-dash-table tbody tr td:nth-child(4)::before { content: 'OI C/P: '; color: var(--text-dim); font-size: 0.62rem; font-weight: 500; }
.opt-dash-table tbody tr td:nth-child(5)::before { content: 'P/C: '; color: var(--text-dim); font-size: 0.62rem; font-weight: 500; }
.opt-dash-table tbody tr td:nth-child(6)::before { content: 'Top + Target: '; color: var(--text-dim); font-size: 0.62rem; font-weight: 500; }

/* Inline column labels — Capital Flow */
.cf-dash-table tbody tr td:nth-child(2)::before { content: 'Net: '; color: var(--text-dim); font-size: 0.62rem; font-weight: 500; }
.cf-dash-table tbody tr td:nth-child(3)::before { content: 'Smart: '; color: var(--text-dim); font-size: 0.62rem; font-weight: 500; }
.cf-dash-table tbody tr td:nth-child(4)::before { content: 'Retail: '; color: var(--text-dim); font-size: 0.62rem; font-weight: 500; }
.cf-dash-table tbody tr td:nth-child(5)::before { content: 'Verdict: '; color: var(--text-dim); font-size: 0.62rem; font-weight: 500; }


/* === 2026-05-26 Options card — DTE urgency color tiers === */
.opt-dte-urgent {
  color: #ff1744 !important;       /* red */
  font-weight: 700;
  background: rgba(255,23,68,0.10);
  padding: 0 5px;
  border-radius: 3px;
  border: 1px solid rgba(255,23,68,0.40);
}
.opt-dte-soon {
  color: #ff9800 !important;       /* orange */
  font-weight: 600;
  background: rgba(255,152,0,0.10);
  padding: 0 5px;
  border-radius: 3px;
  border: 1px solid rgba(255,152,0,0.35);
}
.opt-dte-medium {
  color: #ffc107 !important;       /* yellow */
  background: rgba(255,193,7,0.08);
  padding: 0 5px;
  border-radius: 3px;
  border: 1px solid rgba(255,193,7,0.30);
}
.opt-dte-far {
  color: #66bb6a !important;       /* green */
  background: rgba(102,187,106,0.08);
  padding: 0 5px;
  border-radius: 3px;
  border: 1px solid rgba(102,187,106,0.25);
}

/* 2026-05-27 — 501 PWA: keep signal+imb and spread+walls on single rows */
.ob-sig-imb { display: inline-flex; gap: 4px; align-items: baseline; white-space: nowrap; }
.ob-spread-group { display: inline-flex; gap: 4px; align-items: baseline; white-space: nowrap; flex-wrap: wrap; }
.ob-wall-inline { font-size: 0.7rem; font-weight: 600; opacity: 0.85; }

/* 2026-05-27 — HELD badge for loss exits not fired to REAL accounts */
.signal-held {
  display: inline-block;
  background: rgba(255, 152, 0, 0.20);
  color: #ffb74d;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid rgba(255, 152, 0, 0.35);
  margin: 0 2px;
}
.signal-held-row {
  background: linear-gradient(90deg, rgba(255, 152, 0, 0.08), transparent 40%) !important;
  border-left: 2px solid rgba(255, 152, 0, 0.5) !important;
}

/* 2026-05-30: Blocklist remark at the bottom of each Closed-view tab. */
.closed-blocklist-note {
  margin-top: 18px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 107, 107, 0.35);
  background: rgba(255, 107, 107, 0.06);
  border-radius: 6px;
}
.closed-blocklist-title {
  font-size: 12px;
  font-weight: 600;
  color: #ff8a8a;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.closed-blocklist-empty {
  font-size: 11px;
  color: #6b7280;
  font-style: italic;
  padding: 4px 0;
}
.closed-blocklist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.closed-blocklist-table tr + tr td {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.closed-blocklist-table td {
  padding: 4px 6px;
  vertical-align: top;
}
.closed-blocklist-sym {
  width: 60px;
  font-weight: 700;
  color: #ff8a8a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.closed-blocklist-note-cell {
  color: #b7c0cc;
  line-height: 1.35;
}

/* 2026-06-01: Entry-pricing rule remark, paired with .closed-blocklist-note. */
.closed-entry-rule-note {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(74, 222, 128, 0.30);
  background: rgba(74, 222, 128, 0.05);
  border-radius: 6px;
}
.closed-entry-rule-title {
  font-size: 12px;
  font-weight: 600;
  color: #6ee7a8;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.closed-entry-rule-label {
  font-size: 12px;
  font-weight: 600;
  color: #c0c8d4;
  margin-bottom: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.closed-entry-rule-detail {
  font-size: 11px;
  color: #8b95a7;
  line-height: 1.4;
}


/* 2026-06-11: Strategy Rules & Conditions collapsible panel (below entry-pricing rule) */
.closed-strat-rules {
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  overflow: hidden;
}
.closed-strat-rules-hdr {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.closed-strat-rules-hdr:hover { background: rgba(255, 255, 255, 0.07); }
.closed-strat-rules-icon { font-size: 14px; flex-shrink: 0; }
.closed-strat-rules-label { flex: 1; }
.closed-strat-rules-arrow { font-size: 11px; flex-shrink: 0; }
.closed-strat-rules-body { padding: 8px 10px 10px; }
.closed-strat-rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.closed-strat-rules-table tr + tr td { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.closed-strat-rules-table td { padding: 4px 6px; vertical-align: top; line-height: 1.4; }
.closed-sr-key {
  width: 96px;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
}
.closed-sr-val { color: #c0ccd8; }

/* 2026-06-02: CF Signal divergence labels on Live Capital Flow table */
.cf-div-conf   { color: #00e676; }       /* CONF  green  - trend continues */
.cf-div-capi   { color: #ff9800; }       /* CAPI  amber  - capitulation, both windows negative */
.cf-div-rev-up { color: #00e676; }       /* UP    green  - reversal up */
.cf-div-rev-dn { color: #ff1744; }       /* DN    red    - distribution */

/* 2026-06-08 — closed-trade outcome outline on cards (green=win, red=lose) */
.card--win  { outline: 2px solid rgba(0,200,83,0.95);  outline-offset: -1px; box-shadow: 0 0 14px rgba(0,200,83,0.40); }
.card--lose { outline: 2px solid rgba(255,82,82,0.95); outline-offset: -1px; box-shadow: 0 0 14px rgba(255,82,82,0.40); }

/* ── STARTRAIL 2026-07-05: 📊 4h-Scores trail row (portal group-cell parity) ──
   ★ = 4H swing score ≥+5 (gold glow), shining ★ = ≥+6 (stronger glow);
   .t4-blink = entry-confluence armed (MACD red→green flip + chart BUY cross
   at/after the first ≥+5 score bar) — ~1s opacity pulse. */
.trail4h-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 3px;
  margin: 4px 10px 2px; padding: 3px 8px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid rgba(148, 163, 184, 0.14);
  backdrop-filter: blur(4px);
  font-size: 0.72rem; line-height: 1.3;
}
.trail4h-row .t4-lbl { color: #94a3b8; font-weight: 600; }
.t4-step { display: inline-flex; align-items: center; gap: 2px; opacity: 0.82; }
.t4-step.t4-last { opacity: 1; }
.t4-step.t4-last b { text-decoration: underline; }
.t4-sep { color: #475569; margin: 0 2px; }
.t4-t { opacity: 0.62; font-weight: 400; font-size: 0.9em; }
.t4-ic { font-size: 0.95em; }
.t4-star { color: #fbbf24; text-shadow: 0 0 4px rgba(251, 191, 36, 0.55); }
.t4-star6 {
  color: #fde047;
  text-shadow: 0 0 6px rgba(253, 224, 71, 0.95), 0 0 14px rgba(251, 191, 36, 0.7);
}
.t4-armed {
  color: #fbbf24; font-weight: 700;
  border: 1px solid rgba(251, 191, 36, 0.4); border-radius: 6px;
  padding: 0 4px; background: rgba(251, 191, 36, 0.08);
}
@keyframes t4blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.t4-blink { animation: t4blink 1s ease-in-out infinite; }

/* ── MBGROUPS 2026-07-05: Groups tab sections + per-TF score row ── */
.group-section { margin: 0 0 10px; }
.group-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; margin: 4px 0 6px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px; cursor: pointer; user-select: none;
  backdrop-filter: blur(6px);
}
.group-header:hover { background: rgba(148, 163, 184, 0.14); }
.group-arrow { color: #94a3b8; font-size: 0.85em; width: 14px; }
.group-name { font-weight: 700; letter-spacing: 0.06em; color: #e2e8f0; }
.group-count {
  color: #94a3b8; font-size: 0.85em; font-weight: 600;
  background: rgba(148, 163, 184, 0.12); border-radius: 8px; padding: 0 7px;
}
.group-starred {
  color: #fbbf24; font-size: 0.85em; font-weight: 700;
  border: 1px solid rgba(251, 191, 36, 0.4); border-radius: 8px;
  padding: 0 6px; background: rgba(251, 191, 36, 0.08);
  text-shadow: 0 0 4px rgba(251, 191, 36, 0.5);
}
.group-empty { color: #64748b; font-size: 0.85em; padding: 4px 14px 8px; }
.tfscore-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.78rem; padding: 2px 12px 0; flex-wrap: wrap;
}
.tfscore-row .t4-lbl { color: #94a3b8; font-weight: 600; }
.tfscore-row .tf-hot {
  color: #fbbf24; font-weight: 700;
  text-shadow: 0 0 5px rgba(251, 191, 36, 0.6);
}

/* ── OPTBAR 2026-07-05: compact options/hedges bubble-bar (Groups + Swing/Scalp cards) ── */
.optbar-row { margin: 4px 12px 2px; }
.optbar-row:empty { display: none; }
.optbar-inner {
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  padding: 4px 8px 5px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-size: 0.7rem;
  line-height: 1.35;
}
.optbar-lbl { color: #fbbf24; font-weight: 700; font-size: 0.66rem; }
.optbar-pc { font-weight: 700; }
.optbar-bull { color: #4ade80; }
.optbar-bear { color: #f87171; }
.optbar-top { color: #e2e8f0; font-weight: 600; }
.optbar-vol { color: #94a3b8; font-size: 0.64rem; }
.optbar-bar { position: relative; height: 32px; margin-top: 3px; overflow: hidden; }
.optbar-axis {
  position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: rgba(148, 163, 184, 0.35);
}
.optbar-pxtick {
  position: absolute; top: 18%; bottom: 18%; width: 2px;
  background: #e2e8f0; transform: translateX(-50%); border-radius: 1px;
  box-shadow: 0 0 4px rgba(226, 232, 240, 0.6);
}
.optbar-dot { position: absolute; border-radius: 50%; transform: translateX(-50%); }
.optbar-call {
  bottom: 52%;
  background: radial-gradient(circle at 35% 30%, rgba(59, 130, 246, 0.98), rgba(59, 130, 246, 0.45));
}
.optbar-put {
  top: 52%;
  background: rgba(234, 179, 8, 0.15);
  border: 1.2px solid rgba(234, 179, 8, 0.9);
}
.optbar-lo, .optbar-hi {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 0.56rem; color: #64748b; pointer-events: none;
}
.optbar-lo { left: 2px; }
.optbar-hi { right: 2px; }

/* MBGROWFIX 2026-07-05: Groups-view width containment — grid items default min-width:auto,
   so the lightweight-charts resize loop grew sections horizontally without bound. */
.card-list .group-section { grid-column: 1 / -1; min-width: 0; max-width: 100%; overflow-x: hidden; }
.group-body { display: grid; grid-template-columns: 1fr; gap: 10px; min-width: 0; }
@media (min-width: 640px) { .group-body { grid-template-columns: 1fr 1fr; gap: 12px; } }
.group-body > .card { min-width: 0; max-width: 100%; overflow-x: hidden; }
.group-body .card .multi-tf-chart, .group-body .card .card__chart-area { max-width: 100%; min-width: 0; }
