@import url(https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap);

/*
 * Toast.css — Bloomberg Terminal 2.0
 * Premium notification toasts with glass-morphism.
 */

.boc-toast-container {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  z-index: 1000;
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-2);
  pointer-events: none;
}

.boc-toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 280px;
  max-width: 420px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  animation: boc-toast-in 0.25s var(--easing-decelerate);
}

@keyframes boc-toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

.boc-toast--exit {
  animation: boc-toast-out 0.2s ease-in forwards;
}

@keyframes boc-toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}

.boc-toast__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.boc-toast--info    .boc-toast__icon { background: var(--color-accent-primary);  color: #fff; }
.boc-toast--success .boc-toast__icon { background: var(--color-profit); color: #fff; }
.boc-toast--warning .boc-toast__icon { background: var(--color-warning); color: #000; }
.boc-toast--error   .boc-toast__icon { background: var(--color-loss);  color: #fff; }

.boc-toast__msg {
  flex: 1;
  font-size: 13px;
  color: var(--color-text-primary);
  line-height: 1.4;
}

.boc-toast__close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 2px;
  border-radius: var(--radius-sm);
  transition: color var(--duration-fast) var(--easing-default);
}

.boc-toast__close:hover {
  color: var(--color-text-primary);
}

@media (max-width: 480px) {
  .boc-toast-container {
    left: var(--space-3);
    right: var(--space-3);
    bottom: calc(78px + env(safe-area-inset-bottom) + var(--space-3));
  }
  .boc-toast { max-width: 100%; min-width: 0; }
}

.app-shell-skeleton {
  min-height: 100vh;
  padding: 1rem;
  background: var(--color-bg-primary);
}

.app-shell-skeleton__row {
  height: 56px;
  border-radius: 14px;
  margin-bottom: 0.75rem;
}

.app-shell-skeleton__row--strong {
  background: rgba(148, 163, 184, 0.12);
}

.app-shell-skeleton__row--mid {
  background: rgba(148, 163, 184, 0.1);
}

.app-shell-skeleton__row--light {
  margin-bottom: 0;
  background: rgba(148, 163, 184, 0.08);
}


/*
 * Sidebar.css
 */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-bg-base);
  border-right: 1px solid var(--color-border-default);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--duration-normal) var(--easing-default);
  overflow: hidden;
}

.sidebar--collapsed {
  width: var(--sidebar-collapsed);
}

/* ─── Logo ──────────────────────────────────────────────────────────── */

.sidebar__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  height: var(--topbar-height);
  padding: 0 var(--space-4);
  cursor: pointer;
  flex-shrink: 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.sidebar__logo-img {
  height: 36px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  flex-shrink: 0;
  transition: height var(--duration-fast) var(--easing-default);
}

.sidebar__logo-img--collapsed {
  height: 28px;
}

/* ─── Navigation ────────────────────────────────────────────────────── */

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-2);
}

.sidebar__nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: 44px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--easing-default),
    color var(--duration-fast) var(--easing-default);
  position: relative;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar__nav-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.sidebar__nav-item--active {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
  font-weight: 500;
}

.sidebar__nav-item--active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--color-accent-teal, var(--color-accent-primary));
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  box-shadow: var(--glow-teal);
}

.sidebar__nav-icon {
  width: 20px;
  font-size: 16px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar__nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar__nav-shortcut {
  font-size: 11px;
  color: var(--color-text-muted);
  background: var(--color-bg-surface);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

/* ─── Watchlist ─────────────────────────────────────────────────────── */

.sidebar__watchlist {
  flex: 1;
  overflow-y: auto;
  border-top: 1px solid var(--color-border-subtle);
  padding-top: var(--space-2);
}

.sidebar__section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-2) var(--space-4);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
}

.sidebar__section-title {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar__chevron {
  font-size: 14px;
  transition: transform var(--duration-fast) var(--easing-default);
}
.sidebar__chevron--open {
  transform: rotate(90deg);
}

.sidebar__watchlist-content {
  padding: 0 var(--space-2);
}

.sidebar__watchlist-group {
  margin-bottom: var(--space-2);
}

.sidebar__watchlist-group-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--space-1) var(--space-3);
}

.sidebar__watchlist-pair {
  display: flex;
  align-items: center;
  width: 100%;
  height: 32px;
  padding: 0 var(--space-3);
  color: var(--color-text-secondary);
  font-size: 13px;
  font-family: var(--font-mono);
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast) var(--easing-default);
}

.sidebar__watchlist-pair:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.sidebar__pair-name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.sidebar__shortlist-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent-gold, #d97706);
  flex-shrink: 0;
}

/* ─── Footer / Account ──────────────────────────────────────────────── */

.sidebar__footer {
  flex-shrink: 0;
  border-top: 1px solid var(--color-border-subtle);
  padding: var(--space-3);
}

.sidebar__account {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

.sidebar__account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar__account-label {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sidebar__account-value {
  font-size: 13px;
  color: var(--color-text-primary);
}

.sidebar__actions {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
}

.sidebar__action-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 16px;
  cursor: pointer;
  border: none;
  background: none;
  transition: background var(--duration-fast) var(--easing-default);
}
.sidebar__action-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

/* ─── Mobile ────────────────────────────────────────────────────────── */

@media (max-width: 1279px) {
  .sidebar:not(.sidebar--mobile-open) {
    width: var(--sidebar-collapsed);
  }
}

@media (max-width: 767px) {
  .sidebar {
    width: 280px;
    transform: translateX(-100%);
    transition: transform var(--duration-normal) var(--easing-default);
    box-shadow: none;
  }
  .sidebar--mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
}


/*
 * SessionBadge.css — Bloomberg Terminal 2.0
 * Styled to match topnav__counter metrics.
 */

.session-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm, 8px);
  background: var(--color-bg-surface, rgba(71, 85, 105, 0.06));
  border: 1px solid var(--color-border-subtle, rgba(71, 85, 105, 0.12));
  white-space: nowrap;
  flex-shrink: 0;
}

.session-badge--md {
  padding: 5px 12px;
}

/* ─── Label (small muted text, matches counter-label) ──────────── */

.session-badge__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-text-muted, #64748b);
  text-transform: uppercase;
}

/* ─── Value (session name, matches counter-value) ──────────────── */

.session-badge__value {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Session-specific value colors */
.session-badge--asian  .session-badge__value { color: var(--color-session-asian); }
.session-badge--london .session-badge__value { color: var(--color-session-london); }
.session-badge--ny     .session-badge__value { color: var(--color-session-ny); }
.session-badge--dc     .session-badge__value { color: var(--color-loss, #dc2626); }

/* ─── Dot (status indicator) ───────────────────────────────────── */

.session-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.session-badge__dot--active {
  animation: sessionPulse 2s ease-in-out infinite;
}

/* Session-specific dot colors */
.session-badge--asian  .session-badge__dot { background: var(--color-session-asian); }
.session-badge--london .session-badge__dot { background: var(--color-session-london); }
.session-badge--ny     .session-badge__dot { background: var(--color-session-ny); }

/* Disconnected */
.session-badge--dc .session-badge__dot {
  background: var(--color-loss, #dc2626);
}
.session-badge__dot--dc {
  animation: sessionPulse 1.2s ease-in-out infinite;
}

@keyframes sessionPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}


/*
 * TopNav.css
 */

.topnav {
  display: flex;
  align-items: center;
  height: var(--topbar-height);
  padding: 0 var(--space-5);
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border-subtle);
  flex-shrink: 0;
  gap: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 50;
  overflow: visible;
}

/* ─── Hamburger (mobile) ────────────────────────────────────────────── */

.topnav__hamburger {
  width: 36px;
  height: 36px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  transition: background var(--duration-fast) var(--easing-default);
}
.topnav__hamburger:hover {
  background: var(--color-bg-hover);
}

/* ─── Breadcrumb ────────────────────────────────────────────────────── */

.topnav__breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  min-width: 120px;
}

.topnav__crumb {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}
.topnav__crumb:hover {
  color: var(--color-text-secondary);
}
.topnav__crumb--current {
  color: var(--color-text-primary);
  cursor: default;
}

.topnav__crumb-sep {
  color: var(--color-text-muted);
  font-size: 12px;
}

/* ─── Right Zone ────────────────────────────────────────────────────── */

.topnav__right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
  flex-shrink: 0;
  min-width: 0;
}

/* group logout + notifications together with tighter spacing */
.topnav__icon-group {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.topnav__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-loss);
  flex-shrink: 0;
}
.topnav__status-dot--connected {
  background: var(--color-profit);
}

/* ─── Counters (BAL / P&L / POS) ───────────────────────────────────── */

.topnav__counter {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm, 8px);
  background: var(--color-bg-surface, rgba(71, 85, 105, 0.06));
  border: 1px solid var(--color-border-subtle, rgba(71, 85, 105, 0.12));
  flex-shrink: 0;
}

.topnav__counter-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-text-muted, #64748B);
  text-transform: uppercase;
}

.topnav__counter-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary, #F0F2F5);
  white-space: nowrap;
}

.topnav__pnl {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

/* ─── Alert button ──────────────────────────────────────────────────── */

.topnav__alert-wrap {
  position: relative;
}

.topnav__icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 16px;
  color: var(--color-text-secondary);
  transition: background var(--duration-fast) var(--easing-default);
  position: relative;
  border: none;
  background: none;
  cursor: pointer;
}
.topnav__icon-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}
.topnav__logout-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
}

.topnav__icon-btn--has-alerts::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-semantic-loss, #EF4444);
  animation: topnav-pulse 2s ease-in-out infinite;
}

@keyframes topnav-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.topnav__alert-badge {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--color-semantic-loss, #EF4444);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* ─── Alert Dropdown ────────────────────────────────────────────────── */

.topnav__alert-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 340px;
  background: var(--color-bg-surface, #111827);
  border: 1px solid var(--color-border-subtle, rgba(71, 85, 105, 0.12));
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(71, 85, 105, 0.08);
  z-index: 100;
  overflow: hidden;
}

.topnav__alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-subtle, rgba(148, 163, 184, 0.06));
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-primary, #F0F2F5);
}

.topnav__alert-mark-read {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-accent-primary, #3B82F6);
  border: none;
  background: none;
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
}
.topnav__alert-mark-read:hover {
  text-decoration: underline;
}

.topnav__alert-list {
  max-height: 300px;
  overflow-y: auto;
}

.topnav__alert-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border-subtle, rgba(148, 163, 184, 0.06));
  cursor: pointer;
  transition: background 150ms ease;
}
.topnav__alert-item:hover {
  background: var(--color-bg-hover, #131C2E);
}
.topnav__alert-item:last-child {
  border-bottom: none;
}

.topnav__alert-item--unread {
  border-left: 3px solid var(--color-accent-primary, #3B82F6);
}

.topnav__alert-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary, #F0F2F5);
  margin-bottom: 2px;
}

.topnav__alert-item-msg {
  font-size: 12px;
  color: var(--color-text-secondary, #94A3B8);
  line-height: 1.4;
}

.topnav__alert-item-time {
  font-size: 11px;
  color: var(--color-text-muted, #64748B);
  margin-top: 4px;
}

.topnav__alert-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted, #64748B);
}

/* ─── Responsive ────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .topnav__counter { display: none; }
}

@media (max-width: 767px) {
  .topnav {
    padding: 0 var(--space-3);
    gap: var(--space-3);
  }
}


/*
 * Card.css — Bloomberg Terminal 2.0
 * Tremor-style cards with layered depth, subtle borders, hover lift.
 */

.card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  transition:
    border-color var(--duration-fast) var(--easing-default),
    box-shadow var(--duration-fast) var(--easing-default),
    transform var(--duration-fast) var(--easing-default);
}

/* Hover: stronger border + elevated shadow + subtle lift */
.card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-hover);
}

/* Padding variants */
.card--pad-sm { padding: var(--space-3); }
.card--pad-md { padding: var(--space-4); }
.card--pad-lg { padding: var(--space-5); }

/* Interactive (clickable) */
.card--interactive {
  cursor: pointer;
}
.card--interactive:hover {
  transform: translateY(-1px);
}
.card--interactive:active {
  transform: translateY(0);
  box-shadow: var(--card-shadow);
}
.card--interactive:focus-visible {
  outline: 2px solid var(--color-accent-teal, var(--color-border-focus));
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(14, 165, 161, 0.15);
}

/* Accent bar (top) */
.card__accent-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--color-accent-primary));
  border-radius: 0 0 2px 2px;
}

/* Header — Tremor style: uppercase, tracking-widest, muted */
.card__header {
  font-size: 11px;
  font-weight: var(--fw-semi, 600);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border-subtle);
}

/* ─── StatCard ──────────────────────────────────────────────────────── */

.card--stat {
  text-align: center;
}

.stat-card__label {
  font-size: 11px;
  font-weight: var(--fw-semi, 600);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.stat-card__value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-text-primary);
  margin-bottom: var(--space-1);
}

.stat-card__sub {
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* ─── KPICard ───────────────────────────────────────────────────────── */

.kpi-card__title {
  font-size: 11px;
  font-weight: var(--fw-semi, 600);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.kpi-card__value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-text-primary);
}

.kpi-card__sub {
  font-size: 12px;
  font-weight: var(--fw-medium, 500);
  color: var(--color-text-secondary);
  margin-top: 4px;
}

/* KPI variant polish */
.card--kpi {
  position: relative;
}

.card--kpi .card__accent-bar {
  height: 3px;
  border-radius: 0 0 2px 2px;
}

/* ── Utility for centering single-element content (eg. loading spinner) */
.card--centered .card__body {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Insight variant — elevated bg for callout cards */
.card--insight {
  background: var(--color-bg-elevated);
  border-color: var(--color-border-default);
}


/*
 * Spinner.css — Bloomberg Terminal 2.0
 */

.boc-spinner {
  display: inline-block;
  border: 2px solid var(--color-bg-active);
  border-top-color: var(--color-accent-teal, var(--color-accent-primary));
  border-radius: 50%;
  animation: spinnerRotate 0.8s linear infinite;
}
.boc-spinner--sm { width: 16px; height: 16px; border-width: 2px; }
.boc-spinner--md { width: 24px; height: 24px; border-width: 2px; }
.boc-spinner--lg { width: 40px; height: 40px; border-width: 3px; }

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


/*
 * Button.css — Bloomberg Terminal 2.0
 * Micro-interactions, glow shadows, teal variant.
 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-radius: var(--radius-md);
  font-weight: var(--fw-semi, 600);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background var(--duration-fast) var(--easing-default),
    color var(--duration-fast) var(--easing-default),
    border-color var(--duration-fast) var(--easing-default),
    box-shadow var(--duration-fast) var(--easing-default),
    transform var(--duration-instant) var(--easing-default),
    opacity var(--duration-fast) var(--easing-default);
  border: 1px solid transparent;
  -webkit-user-select: none;
  user-select: none;
}

/* Active micro-interaction — Bloomberg press feedback */
.btn:active:not(:disabled) {
  transform: scale(0.98);
}

/* Sizes */
.btn--sm  { height: 28px; padding: 0 var(--space-3); font-size: 12px; }
.btn--md  { height: 36px; padding: 0 var(--space-4); font-size: 14px; }
.btn--lg  { height: 44px; padding: 0 var(--space-5); font-size: 16px; }

/* Primary — blue glow */
.btn--primary {
  background: var(--color-accent-primary);
  color: #fff;
  border-color: var(--color-accent-primary);
  box-shadow: var(--glow-blue);
}
.btn--primary:hover:not(:disabled) {
  background: var(--color-accent-primary-hover);
  border-color: var(--color-accent-primary-hover);
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.5);
}
.btn--primary:active:not(:disabled) {
  box-shadow: var(--glow-blue);
}

/* Teal — new institutional accent */
.btn--teal {
  background: var(--color-accent-teal);
  color: #fff;
  border-color: var(--color-accent-teal);
  box-shadow: var(--glow-teal);
}
.btn--teal:hover:not(:disabled) {
  background: var(--color-accent-teal-hover);
  border-color: var(--color-accent-teal-hover);
  box-shadow: 0 2px 12px rgba(14, 165, 161, 0.4);
}
.btn--teal:active:not(:disabled) {
  box-shadow: var(--glow-teal);
}

/* Secondary */
.btn--secondary {
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  border-color: var(--color-border-default);
  box-shadow: var(--shadow-sm);
}
.btn--secondary:hover:not(:disabled) {
  background: var(--color-bg-hover);
  border-color: var(--color-border-strong);
}
.btn--secondary:active:not(:disabled) {
  background: var(--color-bg-active);
}

/* Ghost — subtle border on hover */
.btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
}
.btn--ghost:hover:not(:disabled) {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
  border-color: var(--color-border-subtle);
}
.btn--ghost:active:not(:disabled) {
  background: var(--color-bg-active);
  border-color: var(--color-border-strong);
}

/* Danger */
.btn--danger {
  background: transparent;
  color: var(--color-loss);
  border-color: var(--color-loss);
}
.btn--danger:hover:not(:disabled) {
  background: var(--color-loss);
  color: #fff;
  box-shadow: var(--glow-loss);
}
.btn--danger:active:not(:disabled) {
  box-shadow: none;
}

/* States */
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn--loading {
  pointer-events: none;
}
.btn--full {
  width: 100%;
}

/* Focus ring — teal accent */
.btn:focus-visible {
  outline: 2px solid var(--color-accent-teal, var(--color-border-focus));
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(14, 165, 161, 0.15);
}

.btn__icon {
  display: flex;
  align-items: center;
  font-size: 1.1em;
}


/*
 * Badge.css — Bloomberg Terminal 2.0
 * Bordered variants, WCAG AA contrast, desaturated premium accents.
 */

.boc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: var(--fw-semi, 600);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1;
  border: 1px solid transparent;
}

/* ─── Shapes ────────────────────────────────────────────────────────── */

.boc-badge--badge {
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.boc-badge--pill {
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
}

.boc-badge--tag {
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* ─── Dot ───────────────────────────────────────────────────────────── */

.boc-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ─── Variants (all bordered for Bloomberg premium feel) ───────────── */

.boc-badge--default {
  background: var(--color-bg-hover);
  border-color: var(--color-border-default);
  color: var(--color-text-secondary);
}

/* Semantic */
.boc-badge--success,
.boc-badge--bullish,
.boc-badge--confidence-high {
  background: rgba(5, 150, 105, 0.10);
  border-color: rgba(5, 150, 105, 0.20);
  color: #34d399;
}

.boc-badge--danger,
.boc-badge--bearish {
  background: rgba(220, 38, 38, 0.10);
  border-color: rgba(220, 38, 38, 0.20);
  color: #f87171;
}

.boc-badge--warning,
.boc-badge--neutral,
.boc-badge--confidence-medium {
  background: rgba(217, 119, 6, 0.10);
  border-color: rgba(217, 119, 6, 0.20);
  color: #fbbf24;
}

.boc-badge--info {
  background: rgba(59, 130, 246, 0.10);
  border-color: rgba(59, 130, 246, 0.20);
  color: #60a5fa;
}

.boc-badge--confidence-low {
  background: rgba(100, 116, 139, 0.10);
  border-color: rgba(100, 116, 139, 0.18);
  color: var(--color-text-muted);
}

/* Trap (orange accent) */
.boc-badge--trap {
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.25);
  color: #fb923c;
}

/* Sessions */
.boc-badge--session-asian {
  background: var(--color-session-asian-bg);
  border-color: rgba(167, 139, 250, 0.20);
  color: var(--color-session-asian);
}

.boc-badge--session-london {
  background: var(--color-session-london-bg);
  border-color: rgba(56, 189, 248, 0.20);
  color: var(--color-session-london);
}

.boc-badge--session-ny {
  background: var(--color-session-ny-bg);
  border-color: rgba(52, 211, 153, 0.20);
  color: var(--color-session-ny);
}

/* Cycle phases */
.boc-badge--cycle-accumulation {
  background: rgba(167, 139, 250, 0.10);
  border-color: rgba(167, 139, 250, 0.20);
  color: var(--color-cycle-accumulation);
}

.boc-badge--cycle-markup {
  background: rgba(5, 150, 105, 0.10);
  border-color: rgba(5, 150, 105, 0.20);
  color: #34d399;
}

.boc-badge--cycle-distribution {
  background: rgba(217, 119, 6, 0.10);
  border-color: rgba(217, 119, 6, 0.20);
  color: #fbbf24;
}

.boc-badge--cycle-markdown {
  background: rgba(220, 38, 38, 0.10);
  border-color: rgba(220, 38, 38, 0.20);
  color: #f87171;
}

.boc-badge--cycle-reset {
  background: rgba(100, 116, 139, 0.10);
  border-color: rgba(100, 116, 139, 0.18);
  color: var(--color-cycle-reset);
}

/* Trade states */
.boc-badge--planned {
  background: rgba(59, 130, 246, 0.10);
  border-color: rgba(59, 130, 246, 0.20);
  color: #60a5fa;
}

.boc-badge--open {
  background: rgba(217, 119, 6, 0.10);
  border-color: rgba(217, 119, 6, 0.20);
  color: #fbbf24;
}

.boc-badge--closed {
  background: rgba(5, 150, 105, 0.10);
  border-color: rgba(5, 150, 105, 0.20);
  color: #34d399;
}

.boc-badge--archived {
  background: rgba(100, 116, 139, 0.10);
  border-color: rgba(100, 116, 139, 0.18);
  color: var(--color-text-muted);
}

/* ─── Color shorthand (used via color prop) ─────────────────────────── */

.boc-badge--color-green {
  background: rgba(5, 150, 105, 0.10);
  border-color: rgba(5, 150, 105, 0.20);
  color: #34d399;
}

.boc-badge--color-red {
  background: rgba(220, 38, 38, 0.10);
  border-color: rgba(220, 38, 38, 0.20);
  color: #f87171;
}

.boc-badge--color-amber {
  background: rgba(217, 119, 6, 0.10);
  border-color: rgba(217, 119, 6, 0.20);
  color: #fbbf24;
}

.boc-badge--color-muted {
  background: rgba(100, 116, 139, 0.10);
  border-color: rgba(100, 116, 139, 0.18);
  color: var(--color-text-muted);
}

.boc-badge--color-cyan {
  background: rgba(6, 182, 212, 0.10);
  border-color: rgba(6, 182, 212, 0.20);
  color: #22d3ee;
}

.boc-badge--color-blue {
  background: rgba(59, 130, 246, 0.10);
  border-color: rgba(59, 130, 246, 0.20);
  color: #60a5fa;
}

.boc-badge--color-violet {
  background: rgba(139, 92, 246, 0.10);
  border-color: rgba(139, 92, 246, 0.20);
  color: #a78bfa;
}

.boc-badge--color-rose {
  background: rgba(244, 63, 94, 0.10);
  border-color: rgba(244, 63, 94, 0.20);
  color: #fb7185;
}


/*
 * Table.css — Bloomberg Terminal 2.0
 * Data-dense tables with sticky headers and premium hover states.
 */

.boc-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-surface);
  box-shadow: var(--card-shadow);
}

.boc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.boc-table--compact {
  font-size: 12px;
}

/* ─── Head ──────────────────────────────────────────────────────────── */

.boc-table thead {
  background: var(--color-bg-elevated);
}

.boc-table__thead--sticky {
  position: sticky;
  top: 0;
  z-index: 2;
}

.boc-table th {
  padding: var(--space-2) var(--space-3);
  font-size: 11px;
  font-weight: var(--fw-semi, 600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-border-default);
  -webkit-user-select: none;
  user-select: none;
}

.boc-table__th--sortable {
  cursor: pointer;
}
.boc-table__th--sortable:hover {
  color: var(--color-text-secondary);
}

.boc-table .boc-table__th--right  { text-align: right; }
.boc-table .boc-table__th--center { text-align: center; }

.boc-table__sort-icon {
  font-size: 10px;
  color: var(--color-accent-teal, var(--color-accent-primary));
}

/* ─── Body ──────────────────────────────────────────────────────────── */

.boc-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text-primary);
  vertical-align: middle;
}

.boc-table--compact td {
  padding: var(--space-1) var(--space-3);
}

.boc-table__td--right  { text-align: right; }
.boc-table__td--center { text-align: center; }

/* Row hover */
.boc-table tbody tr {
  transition: background var(--duration-fast) var(--easing-default);
}

.boc-table tbody tr:hover {
  background: var(--color-bg-hover);
}

.boc-table__row--clickable {
  cursor: pointer;
}

/* Monospace number alignment */
.boc-table .mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Empty state */
.boc-table__empty {
  text-align: center;
  padding: var(--space-8) var(--space-4) !important;
  color: var(--color-text-muted);
  font-size: 14px;
}


/*
 * Input.css — Bloomberg Terminal 2.0
 * Consistent form controls with teal focus rings.
 */

/* ─── Field Wrapper ─────────────────────────────────────────────────── */

.boc-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.boc-field__label {
  font-size: 12px;
  font-weight: var(--fw-medium, 500);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
}

.boc-field__error {
  font-size: 12px;
  color: var(--color-loss);
}

/* ─── Input ─────────────────────────────────────────────────────────── */

.boc-input {
  height: 36px;
  padding: 0 var(--space-3);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-size: 14px;
  transition: border-color var(--duration-fast) var(--easing-default),
              box-shadow var(--duration-fast) var(--easing-default);
}

.boc-input::placeholder {
  color: var(--color-text-muted);
}

.boc-input:focus {
  outline: none;
  border-color: var(--color-accent-teal, var(--color-border-focus));
  box-shadow: 0 0 0 3px rgba(14, 165, 161, 0.15);
}

.boc-field--error .boc-input {
  border-color: var(--color-loss);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* ─── Select ────────────────────────────────────────────────────────── */

.boc-select {
  height: 36px;
  padding: 0 var(--space-6) 0 var(--space-3);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-size: 14px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%2712%27 viewBox=%270 0 12 12%27%3E%3Cpath d=%27M3 5l3 3 3-3%27 fill=%27none%27 stroke=%27%2394A3B8%27 stroke-width=%271.5%27 stroke-linecap=%27round%27/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 10px) center;
  transition: border-color var(--duration-fast) var(--easing-default);
  cursor: pointer;
}

.boc-select:focus {
  outline: none;
  border-color: var(--color-accent-teal, var(--color-border-focus));
  box-shadow: 0 0 0 3px rgba(14, 165, 161, 0.15);
}

.boc-select option {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
}

/* ─── Textarea ──────────────────────────────────────────────────────── */

.boc-textarea {
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
  transition: border-color var(--duration-fast) var(--easing-default);
}
.boc-textarea:focus {
  outline: none;
  border-color: var(--color-accent-teal, var(--color-border-focus));
  box-shadow: 0 0 0 3px rgba(14, 165, 161, 0.15);
}

/* ─── Toggle ────────────────────────────────────────────────────────── */

.boc-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}
.boc-toggle-wrap--disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.boc-toggle-label {
  font-size: 14px;
  color: var(--color-text-primary);
}

.boc-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-active);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background var(--duration-fast) var(--easing-default);
}
.boc-toggle--on {
  background: var(--color-accent-teal, var(--color-accent-primary));
}
.boc-toggle:disabled {
  cursor: not-allowed;
}

.boc-toggle__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-fast) var(--easing-default);
}
.boc-toggle--on .boc-toggle__knob {
  transform: translateX(20px);
}


.boc-progress {
  height: 8px;
  background: var(--color-bg-active);
  border-radius: var(--radius-pill);
  overflow: hidden;
  width: 100%;
}
.boc-progress--thin { height: 4px; }

.boc-progress__fill {
  height: 100%;
  background: var(--color-accent-primary);
  border-radius: var(--radius-pill);
  transition: width var(--duration-normal) var(--easing-default);
}


.boc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-8) var(--space-4);
}
.boc-empty__icon { font-size: 48px; margin-bottom: var(--space-4); opacity: 0.6; }
.boc-empty__title { font-size: 16px; font-weight: 600; color: var(--color-text-secondary); margin-bottom: var(--space-2); }
.boc-empty__desc { font-size: 14px; color: var(--color-text-muted); max-width: 320px; }
.boc-empty__action { margin-top: var(--space-4); }


/*
 * Modal.css — Bloomberg Terminal 2.0
 * Glass-morphism backdrop, Tremor-style card, smooth animations.
 */

.boc-modal__backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  animation: boc-modal-fade-in 0.15s ease-out;
}

@keyframes boc-modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.boc-modal {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(71, 85, 105, 0.08);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: boc-modal-slide-up 0.2s var(--easing-decelerate);
}

@keyframes boc-modal-slide-up {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.boc-modal--sm { width: 400px; }
.boc-modal--md { width: 560px; }
.boc-modal--lg { width: 760px; }

.boc-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border-subtle);
}

.boc-modal__title {
  font-size: 16px;
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-primary);
  margin: 0;
}

.boc-modal__close {
  background: none;
  border: 1px solid transparent;
  color: var(--color-text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition:
    color var(--duration-fast) var(--easing-default),
    background var(--duration-fast) var(--easing-default),
    border-color var(--duration-fast) var(--easing-default);
}

.boc-modal__close:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-hover);
  border-color: var(--color-border-subtle);
}

.boc-modal__body {
  padding: var(--space-5);
  overflow-y: auto;
}

/* ─── Mobile: bottom sheet ─────────────────────────────────────────── */

@media (max-width: 640px) {
  .boc-modal__backdrop {
    align-items: flex-end;
  }

  .boc-modal--sm,
  .boc-modal--md,
  .boc-modal--lg {
    width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    animation: boc-modal-slide-up-mobile 0.25s var(--easing-decelerate);
  }

  @keyframes boc-modal-slide-up-mobile {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
  }
}


/*
 * SlideOver.css — Bloomberg Terminal 2.0
 * Glass-morphism backdrop, consistent with Modal treatment.
 */

.boc-slide__backdrop {
  position: fixed;
  inset: 0;
  z-index: 850;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: boc-slide-fade 0.15s ease-out;
}

@keyframes boc-slide-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.boc-slide {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  max-width: 100vw;
  background: var(--color-bg-surface);
  border-left: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: boc-slide-in 0.25s var(--easing-decelerate);
}

@keyframes boc-slide-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.boc-slide__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border-subtle);
  flex-shrink: 0;
}

.boc-slide__title {
  font-size: 16px;
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-primary);
  margin: 0;
}

.boc-slide__close {
  background: none;
  border: 1px solid transparent;
  color: var(--color-text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition:
    color var(--duration-fast) var(--easing-default),
    background var(--duration-fast) var(--easing-default);
}

.boc-slide__close:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-hover);
}

.boc-slide__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
}

@media (max-width: 480px) {
  .boc-slide {
    width: 100vw !important;
  }
}


/*
 * BTMMStrip.css
 */

.btmm-strip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--color-text-secondary);
  flex: 1;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  padding: 0 var(--space-2);
}

.btmm-strip__sep {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* Phase */
.btmm-strip__phase {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 11px;
  white-space: nowrap;
}
.btmm-strip__phase--accumulation { color: var(--color-cycle-accumulation); }
.btmm-strip__phase--markup       { color: var(--color-cycle-markup); }
.btmm-strip__phase--distribution { color: var(--color-cycle-distribution); }
.btmm-strip__phase--markdown     { color: var(--color-cycle-markdown); }
.btmm-strip__phase--reset        { color: var(--color-cycle-reset); }

/* Cycle */
.btmm-strip__cycle {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
}

.btmm-strip__level {
  font-weight: 700;
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.btmm-strip__adr {
  font-size: 11px;
  color: var(--color-text-secondary);
}

/* Risk Regime */
.btmm-strip__regime {
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.btmm-strip__regime--on {
  background: var(--color-profit-muted);
  color: var(--color-profit);
}
.btmm-strip__regime--off {
  background: var(--color-loss-muted);
  color: var(--color-loss);
}
.btmm-strip__regime--mixed {
  background: var(--color-warning-muted);
  color: var(--color-warning);
}

/* Countdown */
.btmm-strip__countdown {
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Responsive: condense on medium screens */
@media (max-width: 1439px) {
  .btmm-strip {
    font-size: 11px;
    gap: var(--space-1);
  }
  .btmm-strip__countdown {
    display: none;
  }
}

/* KpiCard — TradeZella-inspired stat card */

.kpi-card {
  --kpi-accent: var(--color-accent-teal);
  position: relative;
  background: var(--color-bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  border-left: 3px solid var(--kpi-accent);
  padding: var(--space-4);
  overflow: hidden;
  min-width: 0;
}

.kpi-card--teal   { --kpi-accent: var(--color-accent-teal); }
.kpi-card--green  { --kpi-accent: var(--color-profit); }
.kpi-card--red    { --kpi-accent: var(--color-loss); }
.kpi-card--blue   { --kpi-accent: var(--color-accent-primary); }
.kpi-card--purple { --kpi-accent: var(--color-accent-secondary); }
.kpi-card--amber  { --kpi-accent: var(--color-warning); }
.kpi-card--gold   { --kpi-accent: var(--color-accent-gold); }

.kpi-card__spark {
  position: absolute;
  bottom: 0;
  right: 0;
  opacity: 0.45;
  pointer-events: none;
}

.kpi-card__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.kpi-card__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: var(--fw-medium);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kpi-card__icon {
  font-size: 14px;
  display: inline-flex;
}

.kpi-card__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.kpi-card__value {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--color-text-primary);
  line-height: 1.2;
}

.kpi-card__visual {
  flex-shrink: 0;
}

.kpi-card__sub {
  font-size: 11px;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
}

/* Responsive: in narrow containers, reduce value size */
@container (max-width: 180px) {
  .kpi-card__value {
    font-size: 18px;
  }
}

/* StatusPill */

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  font-weight: var(--fw-semi, 600);
  letter-spacing: 0.03em;
  white-space: nowrap;
  line-height: 1;
}

.status-pill--sm {
  font-size: 11px;
  padding: 3px 10px;
  min-width: 44px;
}

.status-pill--md {
  font-size: var(--text-xs);
  padding: 4px 14px;
  min-width: 52px;
}

.status-pill--win {
  background: var(--color-profit-muted);
  color: var(--color-profit);
}

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

.status-pill--be {
  background: var(--color-warning-muted);
  color: var(--color-warning);
}

.status-pill--open {
  background: rgba(148, 163, 184, 0.1);
  color: var(--color-text-muted);
}

/* CalendarView — TradeZella-inspired monthly P&L calendar */

.cal {
  background: var(--color-bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  overflow: hidden;
}

/* Header */
.cal__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
}

.cal__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-default);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 16px;
  transition: color var(--duration-fast), background var(--duration-fast);
}
.cal__nav:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }

.cal__title {
  font-weight: var(--fw-semi, 600);
  font-size: var(--text-base);
  color: var(--color-text-primary);
}

.cal__today {
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-default);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast);
}
.cal__today:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }

.cal__monthly-stat {
  margin-left: auto;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
}
.cal__monthly-stat--profit { color: var(--color-profit); }
.cal__monthly-stat--loss { color: var(--color-loss); }

/* Grid: 7 day columns + 1 week summary column */
.cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr) 100px;
  gap: 1px;
  background: var(--color-border-subtle);
}

/* Day of week header */
.cal__dow {
  padding: var(--space-2);
  text-align: center;
  font-size: 11px;
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--color-bg-surface);
}
.cal__dow--week {
  font-size: 10px;
}

/* Day cell */
.cal__cell {
  background: var(--color-bg-elevated);
  padding: var(--space-2);
  min-height: 72px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}

.cal__cell--outside {
  background: var(--color-bg-base);
  opacity: 0.4;
}

.cal__cell--today {
  outline: 2px solid var(--color-accent-primary);
  outline-offset: -2px;
  border-radius: 2px;
}

.cal__cell--profit {
  background: rgba(5, 150, 105, 0.06);
}

.cal__cell--loss {
  background: rgba(220, 38, 38, 0.06);
}

.cal__cell--be {
  background: rgba(217, 119, 6, 0.04);
}

.cal__cell--clickable {
  cursor: pointer;
}
.cal__cell--clickable:hover {
  background: var(--color-bg-hover);
}

.cal__date {
  font-size: 12px;
  font-weight: var(--fw-medium);
  color: var(--color-text-secondary);
}

.cal__cell--today .cal__date {
  background: var(--color-accent-primary);
  color: #fff;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
}

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

.cal__pnl {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.cal__pnl--profit { color: var(--color-profit); }
.cal__pnl--loss { color: var(--color-loss); }

.cal__trades {
  font-size: 10px;
  color: var(--color-text-muted);
}

.cal__wr {
  font-size: 10px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

/* Week summary column */
.cal__week-summary {
  background: var(--color-bg-surface);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 72px;
}

.cal__week-label {
  font-size: 10px;
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-muted);
  text-transform: uppercase;
}
.cal__week-label--empty { opacity: 0.4; }

.cal__week-pnl {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.cal__week-summary--profit .cal__week-pnl { color: var(--color-profit); }
.cal__week-summary--loss .cal__week-pnl { color: var(--color-loss); }

.cal__week-days {
  font-size: 10px;
  color: var(--color-text-muted);
}

/* Responsive */
@media (max-width: 900px) {
  .cal__grid {
    grid-template-columns: repeat(7, 1fr);
  }
  .cal__dow--week,
  .cal__week-summary {
    display: none;
  }
  .cal__cell {
    min-height: 56px;
    padding: var(--space-1);
  }
  .cal__pnl { font-size: 10px; }
}

/* ProgressHeatmap — GitHub-style contribution grid */

.heatmap {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.heatmap__months {
  display: grid;
  gap: 2px;
}

.heatmap__month-label {
  font-size: 10px;
  color: var(--color-text-muted);
  text-align: left;
  padding-left: 2px;
}

.heatmap__grid {
  display: grid;
  gap: 2px;
}

.heatmap__day-label {
  font-size: 10px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 4px;
  height: 14px;
}

.heatmap__cell {
  width: 100%;
  aspect-ratio: 1;
  max-width: 14px;
  max-height: 14px;
  border-radius: 2px;
  transition: transform var(--duration-fast);
}

.heatmap__cell:hover {
  transform: scale(1.3);
  outline: 1px solid var(--color-text-muted);
}

.heatmap__cell--empty {
  visibility: hidden;
}

.heatmap__legend {
  display: flex;
  align-items: center;
  gap: 3px;
  justify-content: flex-end;
  padding-top: var(--space-1);
}

.heatmap__legend-text {
  font-size: 10px;
  color: var(--color-text-muted);
  padding: 0 4px;
}

.heatmap__legend-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   CommandCenter — layout & component styles
   Uses design-token CSS custom properties exclusively.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Base layout ────────────────────────────────────────────────────────── */

.cc {
  display: flex;
  flex-direction: column;
  gap: var(--space-5, 24px);
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  overflow-x: clip;
}

.cc > section,
.cc .card,
.cc__context-strip,
.cc__brief-row,
.cc__setups-row,
.cc__bottom-row {
  min-width: 0;
}

.cc-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

/* ─── Stop Hunt Alert Banner (removed per Bloomberg 2.0 — alerts via toast) ─ */

.cc__stop-hunt-banner {
  display: none;
}

/* ─── KPI Row ────────────────────────────────────────────────────────────── */

.cc__kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4, 16px);
}

@media (max-width: 1024px) {
  .cc__kpi-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .cc {
    gap: var(--space-3, 12px);
  }

  .cc__kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2, 8px);
  }

  .cc__kpi-row .kpi-card__title {
    font-size: 10px;
  }

  .cc__kpi-row .kpi-card__value {
    font-size: 16px;
  }

  .cc__kpi-row .kpi-card__sub {
    font-size: 10px;
  }
}

/* ─── BTMM Context Strip ────────────────────────────────────────────────── */

.cc__strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4, 16px);
}

.cc__strip--single {
  grid-template-columns: 1fr;
  max-width: 480px;
}

@media (max-width: 768px) {
  .cc__strip { grid-template-columns: 1fr; }
  .cc__strip--single { max-width: 100%; }
}

/* ─── Tile internals ─────────────────────────────────────────────────────── */

.cc-tile {
  min-height: 160px;
}

.cc-tile__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3, 12px);
}

.cc-tile__label {
  font-size: var(--text-xs, 11px);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted, #64748B);
  font-weight: 600;
}

.cc-tile__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 8px);
}

.cc-tile__metric {
  display: flex;
  align-items: baseline;
  gap: var(--space-2, 8px);
}

.cc-tile__value {
  font-size: var(--text-2xl, 28px);
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: var(--color-text-primary, #F0F2F5);
}

.cc-tile__value--phase {
  font-size: var(--text-base, 14px);
  letter-spacing: 0.02em;
}

.cc-tile__sub {
  font-size: var(--text-xs, 11px);
  color: var(--color-text-muted, #64748B);
  font-weight: 500;
}

.cc-tile__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-1, 4px) 0;
}

.cc-tile__label-sm {
  font-size: var(--text-xs, 11px);
  color: var(--color-text-muted, #64748B);
}

.cc-tile__mono {
  font-family: var(--font-mono, monospace);
  font-size: var(--text-sm, 13px);
  font-weight: 600;
  color: var(--color-text-secondary, #94A3B8);
}

.cc-tile__countdown {
  color: var(--color-accent-primary, #3B82F6);
  font-weight: 700;
}

.cc-tile__badge-mt {
  margin-top: var(--space-2, 8px);
}

/* Cycle level dots */
.cc-tile__level-indicator {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin-right: var(--space-2, 8px);
}

.cc-tile__level-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border-default, rgba(148, 163, 184, 0.10));
  transition: background var(--duration-fast, 200ms) var(--easing-default, ease);
}

.cc-tile__level-dot--active {
  background: var(--color-accent-primary, #3B82F6);
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
}

/* Peak conditions */
.cc-tile__conditions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1, 4px) var(--space-3, 12px);
  margin-top: var(--space-2, 8px);
}

.cc-tile__cond {
  font-size: var(--text-xs, 11px);
  color: var(--color-text-muted, #64748B);
  white-space: nowrap;
}

.cc-tile__cond--met {
  color: var(--color-semantic-profit, #10B981);
}

/* ─── Context Strip (Session · Risk Regime · Fear & Greed · Sentiment) ───── */

.cc__context-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3, 12px);
}

.cc__context-strip > .card {
  background: var(--color-bg-elevated, #0f1623);
  border: 1px solid var(--color-border-subtle, rgba(71, 85, 105, 0.12));
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--card-shadow);
  transition:
    border-color var(--duration-fast, 200ms) ease,
    box-shadow var(--duration-fast, 200ms) ease;
}

.cc__context-strip > .card:hover {
  border-color: var(--color-border-strong, rgba(71, 85, 105, 0.24));
  box-shadow: var(--shadow-hover);
}

@media (max-width: 1024px) {
  .cc__context-strip {
    grid-template-columns: repeat(3, 1fr);
  }
  .cc__context-strip > :first-child {
    grid-column: 1 / -1;
  }
}

/* ─── Context Row (legacy) ───────────────────────────────────────────────── */

.cc__context-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-4, 16px);
}

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

/* Shared card title */
.cc__card-title {
  font-size: var(--text-xs, 11px);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted, #64748B);
  font-weight: 600;
}

/* ─── Shared Gauge Meter ─────────────────────────────────────────────────── */

.cc__gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: var(--space-2, 8px) 0 0;
}

.cc__gauge-svg {
  width: 100%;
  max-width: 160px;
  height: auto;
  display: block;
}

/* animate needle rotation */
.cc__gauge-needle-group {
  transition: transform 0.5s ease;
}
.cc__gauge-needle,
.cc__gauge-needle-shadow {
  transition: stroke-width 0.3s ease;
}

/* tick labels */
.cc__gauge-tick text {
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.cc__gauge-value {
  font-size: var(--text-2xl, 28px);
  font-weight: 700;
  margin-top: -6px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.cc__gauge-ends {
  display: none; /* labels now rendered inside SVG */
}

.cc__gauge-end-left,
.cc__gauge-end-right {
  display: none;
}

.cc__gauge-label {
  font-size: var(--text-xs, 11px);
  color: var(--color-text-secondary, #93C5FD);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: var(--space-1, 4px);
  font-weight: 600;
}

/* ─── Risk Regime ────────────────────────────────────────────────────────── */

.cc__regime-rec {
  font-size: var(--text-xs, 11px);
  color: var(--color-text-muted, #64748B);
  line-height: 1.5;
  margin: var(--space-2, 8px) 0 0 0;
  padding-top: var(--space-2, 8px);
  border-top: 1px solid var(--color-border-subtle, rgba(148, 163, 184, 0.06));
  text-align: center;
}

/* ─── Retail Sentiment Trap ──────────────────────────────────────────────── */

.cc__sent-trap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2, 8px);
  margin-top: var(--space-2, 8px);
  padding-top: var(--space-2, 8px);
  border-top: 1px solid var(--color-border-subtle, rgba(148, 163, 184, 0.06));
}

/* ─── Brief Row (Market Brief + Econ Cal) ────────────────────────────────── */

.cc__brief-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4, 16px);
  align-items: stretch;
  min-height: 420px;
}

@media (max-width: 1024px) {
  .cc__brief-row { grid-template-columns: 1fr; min-height: auto; }
}

.cc__brief-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Make Market Brief fill its column to match calendar height */
.cc__brief-row > .cc__brief {
  display: flex;
  flex-direction: column;
  min-height: 400px;
}
.cc__brief-row > .cc__brief > .card__body {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ─── Terminal skin ─────────────────────────────────────────────────────── */
.cc__brief--terminal {
  background: var(--color-bg-elevated, #0f1623) !important;
  border: 1px solid var(--color-border-subtle, rgba(71, 85, 105, 0.12)) !important;
  border-radius: var(--radius-lg, 16px) !important;
  box-shadow: var(--card-shadow, 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.4)) !important;
}

.cc__brief--terminal > .card__body {
  padding: 14px 16px !important;
}

.cc__brief-terminal-body {
  flex: 1 1 0;
  overflow-y: auto;
  padding-bottom: 4px;
}

.cc__brief-text {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--color-text-primary, #F0F2F5);
  margin: 0;
  white-space: pre-line;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  flex: 1 1 0;
  overflow-y: auto;
}

.cc__brief-terminal-placeholder {
  font-size: 12px;
  color: var(--color-text-muted, #64748B);
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-style: italic;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.cc__brief-terminal-cursor {
  display: inline-block;
  color: var(--color-accent-primary, #3B82F6);
  animation: blink-cursor 1s step-end infinite;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

/* ─── Chat (terminal style) ──────────────────────────────────────────────── */

.cc__chat {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border-subtle, rgba(148, 163, 184, 0.06));
}

.cc__chat-messages {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  padding-right: 4px;
}

.cc__chat-msg {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: baseline;
  font-size: 12px;
  line-height: 1.55;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.cc__chat-msg--user {
  color: var(--color-text-primary, #F0F2F5);
}

.cc__chat-msg--assistant {
  color: var(--color-text-secondary, #94A3B8);
}

.cc__chat-role {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-accent-primary, #3B82F6);
  flex-shrink: 0;
  line-height: 1;
  margin-top: 1px;
}

.cc__chat-content {
  white-space: pre-wrap;
  word-break: break-word;
}

.cc__chat-prompt {
  flex-shrink: 0;
  font-size: 16px;
  color: var(--color-accent-primary, #3B82F6);
  line-height: 1;
  align-self: center;
  margin-right: 2px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.cc__chat-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cc__chat-input {
  flex: 1;
  padding: 6px 0;
  border-radius: 0;
  border: none;
  background: transparent;
  color: var(--color-text-primary, #F0F2F5);
  font-size: 12px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  outline: none;
  caret-color: var(--color-accent-primary, #3B82F6);
}

.cc__chat-input::placeholder {
  color: var(--color-text-muted, #64748B);
}

.cc__chat-input:focus,
.cc__chat-input:focus-visible {
  border: none;
  box-shadow: none;
  outline: none; /* override global focus ring */
}

/* ensure the terminal card itself doesn’t get a focus highlight */
.cc__brief--terminal:focus-visible {
  outline: none;
}

.cc__chat-input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cc__chat-send {
  background: transparent;
  border: none;
  color: var(--color-text-muted, #64748B);
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 14px;
  padding: 4px 6px;
  cursor: pointer;
  transition: color 150ms ease;
  line-height: 1;
}

.cc__chat-send:hover:not(:disabled) {
  color: var(--color-accent-primary, #3B82F6);
}

.cc__chat-send:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ─── Recommendations ────────────────────────────────────────────────────── */

.cc__recs-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 12px);
}

.cc__recs-title {
  padding-left: var(--space-1, 4px);
}

.cc__recs-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 12px);
}

.cc__rec-card {
  cursor: pointer;
}

.cc__rec-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2, 8px);
}

.cc__rec-pair {
  font-size: var(--text-base, 14px);
  font-weight: 700;
  color: var(--color-text-primary, #F0F2F5);
}

.cc__rec-confidence {
  font-size: var(--text-xl, 20px);
  font-weight: 700;
  color: var(--color-accent-primary, #3B82F6);
  margin-bottom: var(--space-2, 8px);
}

.cc__rec-entry {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  font-size: var(--text-sm, 13px);
  margin-bottom: var(--space-2, 8px);
}

.cc__rec-entry-label {
  color: var(--color-text-muted, #64748B);
  font-size: var(--text-xs, 11px);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cc__rec-reason {
  font-size: var(--text-xs, 11px);
  color: var(--color-text-muted, #64748B);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Setups Row ─────────────────────────────────────────────────────────── */

.cc__setups-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-4, 16px);
  align-items: start;
}

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

.cc__setups-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* ─── Active Setups Table Layout ─────────────────────────────────────────── */

.cc__setups-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cc__setups-table-head {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.7fr 1fr 1.5fr 1.2fr 1.2fr;
  gap: 0;
  padding: var(--space-2, 8px) var(--space-3, 12px);
  font-size: var(--text-xs, 11px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted, #64748B);
  border-bottom: 1px solid var(--color-border-default, rgba(148, 163, 184, 0.10));
}

.cc__setups-table-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.7fr 1fr 1.5fr 1.2fr 1.2fr;
  gap: 0;
  align-items: center;
  padding: var(--space-3, 12px);
  border-bottom: 1px solid var(--color-border-subtle, rgba(148, 163, 184, 0.06));
  cursor: pointer;
  transition: background var(--duration-fast, 200ms) ease;
}

.cc__setups-table-row:hover {
  background: var(--color-bg-hover, #131C2E);
}

.cc__setups-table-row:last-child {
  border-bottom: none;
}

.cc__setup-col {
  font-size: var(--text-sm, 13px);
  color: var(--color-text-secondary, #94A3B8);
}

.cc__setup-col--type {
  font-size: 12px;
  text-transform: capitalize;
}

.cc__setup-col--pair {
  font-weight: 700;
  color: var(--color-text-primary, #F0F2F5);
  font-size: 14px;
}

.cc__setup-col--time {
  font-size: 12px;
  color: var(--color-text-muted, #64748B);
}

.cc__setup-direction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill, 999px);
  width: fit-content;
}

.cc__setup-direction--bullish {
  color: var(--color-semantic-profit, #10B981);
  background: rgba(16, 185, 129, 0.12);
}

.cc__setup-direction--bearish {
  color: var(--color-semantic-loss, #EF4444);
  background: rgba(239, 68, 68, 0.12);
}

.cc__setup-col--cycle {
  font-size: 12px;
  color: var(--color-text-secondary, #94A3B8);
}

.cc__setup-col--center {
  text-align: center;
  justify-content: center;
}

.cc__setups-head--center {
  text-align: center;
}

/* confluence column styling removed */

.cc__setup-col--actions {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  justify-content: center;
}

.cc__setup-confidence {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill, 999px);
}

.cc__setup-confidence--high {
  color: var(--color-semantic-profit, #10B981);
  background: rgba(16, 185, 129, 0.15);
}

.cc__setup-confidence--medium {
  color: var(--color-accent-amber, #F59E0B);
  background: rgba(245, 158, 11, 0.15);
}

.cc__setup-confidence--low {
  color: var(--color-text-muted, #64748B);
  background: rgba(148, 163, 184, 0.10);
}

.cc__setup-view-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent-primary, #3B82F6);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-sm, 4px);
  transition: background var(--duration-fast, 200ms) ease;
}

.cc__setup-view-btn:hover {
  background: rgba(59, 130, 246, 0.12);
}

/* Legacy setup cards — keep for compatibility */
.cc__setups-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 8px);
}

.cc__setup-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 8px);
  padding: var(--space-3, 12px);
  border-radius: var(--radius-md, 12px);
  background: var(--color-bg-elevated, #0f1623);
  border: 1px solid var(--color-border-subtle, rgba(71, 85, 105, 0.12));
  cursor: pointer;
  transition: background var(--duration-fast, 200ms) var(--easing-default, ease),
              border-color var(--duration-fast, 200ms) var(--easing-default, ease),
              box-shadow var(--duration-fast, 200ms) var(--easing-default, ease);
}

.cc__setup-card:hover {
  background: var(--color-bg-hover, #161e2e);
  border-color: var(--color-border-strong, rgba(71, 85, 105, 0.24));
  box-shadow: var(--shadow-hover);
}

.cc__setup-card:focus-visible {
  outline: 2px solid var(--color-border-focus, #3B82F6);
  outline-offset: 2px;
}

.cc__setup-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cc__setup-pair {
  font-size: var(--text-sm, 13px);
  font-weight: 700;
  color: var(--color-text-primary, #F0F2F5);
}

.cc__setup-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  flex-wrap: wrap;
}

.cc__setup-type {
  font-size: var(--text-xs, 11px);
  color: var(--color-text-muted, #64748B);
}

.cc__setup-cycle {
  font-size: var(--text-xs, 11px);
  color: var(--color-text-secondary, #94A3B8);
}

/* ─── NYC Reversal ───────────────────────────────────────────────────────── */

.cc__nyc-status {
  margin-bottom: var(--space-3, 12px);
}

.cc__nyc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2, 8px) 0;
  border-bottom: 1px solid var(--color-border-subtle, rgba(148, 163, 184, 0.06));
}

.cc__nyc-row:last-child {
  border-bottom: none;
}

.cc__nyc-label {
  font-size: var(--text-xs, 11px);
  color: var(--color-text-muted, #64748B);
}

/* ─── Bottom Row (FXC Matrix + FX Perf) ──────────────────────────────────── */

.cc__bottom-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--space-4, 16px);
}

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

/* ─── Economic Calendar ──────────────────────────────────────────────────── */

.cc__calendar {
  display: flex;
  flex-direction: column;
  max-height: 100%;
  overflow: hidden;
}

/* Force Card component flex layout when used in brief-row — both cards stretch to equal height */
.cc__brief-row > .card {
  display: flex;
  flex-direction: column;
  min-height: 400px;
}
.cc__brief-row > .card > .card__body {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cc__cal-scroll {
  flex: 1 1 0;
  overflow-y: auto;
  min-height: 0;
}

.cc__cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.cc__cal-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1, 4px);
}

.cc__cal-nav-today--active {
  color: var(--color-accent-primary, #3B82F6) !important;
  font-weight: 600 !important;
}

.cc__cal-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: var(--radius-full, 999px);
  border: 1px solid var(--color-border-subtle, rgba(148, 163, 184, 0.15));
  background: transparent;
  color: var(--color-text-muted, #64748B);
  font-size: var(--text-xs, 11px);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  margin-right: var(--space-1, 4px);
}

.cc__cal-toggle:hover {
  border-color: var(--color-semantic-loss, #EF4444);
  color: var(--color-semantic-loss, #EF4444);
}

.cc__cal-toggle--active {
  background: rgba(239, 68, 68, 0.12);
  border-color: var(--color-semantic-loss, #EF4444);
  color: var(--color-semantic-loss, #EF4444);
}

.cc__cal-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1, 4px);
}

.cc__cal-group {
  padding-bottom: var(--space-2, 8px);
}

.cc__cal-day-header {
  font-size: var(--text-xs, 11px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary, #94a3b8);
  padding: var(--space-2, 8px) 0 var(--space-1, 4px);
  margin-top: var(--space-2, 8px);
  border-top: 1px solid var(--color-border-subtle, rgba(148, 163, 184, 0.08));
}

.cc__cal-day-header:first-child {
  margin-top: 0;
  border-top: none;
}

.cc__cal-group-time {
  font-size: var(--text-xs, 11px);
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  color: var(--color-accent-primary, #3B82F6);
  padding: var(--space-1, 4px) 0;
  margin-bottom: var(--space-1, 4px);
  border-bottom: 1px solid var(--color-border-subtle, rgba(148, 163, 184, 0.06));
}

.cc__cal-item {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  padding: var(--space-1, 4px) 0;
  font-size: var(--text-sm, 13px);
}

.cc__cal-impact {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--color-text-muted, #64748B);
}

.cc__cal-impact--high {
  background: var(--color-semantic-loss, #EF4444);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.cc__cal-impact--medium {
  background: var(--color-accent-amber, #F59E0B);
}

.cc__cal-impact--low {
  background: var(--color-text-muted, #64748B);
}

.cc__cal-currency {
  width: 36px;
  flex-shrink: 0;
  font-size: var(--text-xs, 11px);
  font-weight: 600;
  color: var(--color-text-secondary, #94A3B8);
}

.cc__cal-title {
  flex: 1;
  color: var(--color-text-secondary, #94A3B8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc__cal-values {
  display: flex;
  gap: var(--space-2, 8px);
  flex-shrink: 0;
}

.cc__cal-val {
  font-family: var(--font-mono, monospace);
  font-size: var(--text-xs, 11px);
  font-weight: 500;
  min-width: 40px;
  text-align: right;
}

.cc__cal-val--actual {
  color: var(--color-text-primary, #F0F2F5);
  font-weight: 700;
}

.cc__cal-val--forecast {
  color: var(--color-text-secondary, #94A3B8);
}

.cc__cal-val--prev {
  color: var(--color-text-muted, #64748B);
}

/* Highlighted row for high-impact in main list */
.cc__cal-item--high {
  background: rgba(239, 68, 68, 0.06);
  border-radius: var(--radius-sm, 4px);
  font-weight: 600;
  margin-bottom: 2px;
}

.cc__cal-item--high .cc__cal-title {
  color: var(--color-text-primary, #F0F2F5);
}

/* ─── FX Performance ─────────────────────────────────────────────────────── */

.cc__fx-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.cc__fx-periods {
  display: flex;
  gap: 2px;
}

/* Shared period / toggle button */
.cc__period-btn {
  all: unset;
  cursor: pointer;
  padding: var(--space-1, 4px) var(--space-2, 8px);
  font-size: var(--text-xs, 11px);
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-muted, #64748b);
  border-radius: var(--radius-sm, 8px);
  border: 1px solid transparent;
  transition: background var(--duration-fast, 200ms) var(--easing-default, ease),
              color var(--duration-fast, 200ms) var(--easing-default, ease),
              border-color var(--duration-fast, 200ms) var(--easing-default, ease);
}

.cc__period-btn:hover {
  color: var(--color-text-secondary, #94a3b8);
  background: var(--color-bg-hover, #161e2e);
  border-color: var(--color-border-subtle, rgba(71, 85, 105, 0.12));
}

.cc__period-btn--active {
  color: var(--color-accent-primary, #3B82F6);
  background: rgba(59, 130, 246, 0.10);
  border-color: rgba(59, 130, 246, 0.20);
}

.cc__fx-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 8px);
}

.cc__fx-bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
}

.cc__fx-bar-name {
  width: 44px;
  flex-shrink: 0;
  font-size: var(--text-xs, 11px);
  font-weight: 600;
  color: var(--color-text-secondary, #94A3B8);
  text-align: right;
}

.cc__fx-bar-track {
  flex: 1;
  position: relative;
  height: 16px;
  background: var(--color-bg-elevated, #0f1623);
  border-radius: var(--radius-sm, 8px);
  overflow: hidden;
}

.cc__fx-bar-fill {
  position: absolute;
  top: 2px;
  left: 0;
  height: 12px;
  border-radius: var(--radius-sm, 4px);
  transition: width var(--duration-normal, 250ms) var(--easing-default, ease);
}

.cc__fx-bar-fill--pos {
  background: var(--color-semantic-profit, #10B981);
  opacity: 0.7;
}

.cc__fx-bar-fill--neg {
  background: var(--color-semantic-loss, #EF4444);
  opacity: 0.7;
}

/* grey/neutral bar used when movement is minimal */
.cc__fx-bar-fill--neutral {
  background: var(--color-text-secondary, #94A3B8);
  opacity: 0.7;
}

.cc__fx-bar-zero {
  display: none; /* bars are now one-directional */
}

.cc__fx-bar-val {
  width: 60px;
  flex-shrink: 0;
  font-size: var(--text-xs, 11px);
  font-weight: 600;
  text-align: right;
}

/* ─── Fractional Disparity Meter ─────────────────────────────────────────── */

.cc__fx-disparity {
  margin-top: var(--space-4, 16px);
  padding-top: var(--space-3, 12px);
  border-top: 1px solid var(--color-border-subtle, rgba(148, 163, 184, 0.06));
}

.cc__fx-disparity-heading {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-secondary, #94A3B8);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-3, 12px);
}

.cc__fx-bar-dir {
  width: 60px;
  flex-shrink: 0;
  font-size: var(--text-xs, 11px);
  color: var(--color-text-muted, #64748B);
  white-space: nowrap;
}

/* ─── Money Flow ─────────────────────────────────────────────────────────── */

.cc__flow-row {
  /* full-width section */
}

.cc__mf-header {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
  gap: var(--space-2, 8px);
}

.cc__mf-controls {
  display: flex;
  gap: var(--space-3, 12px);
  order: 1;
}

.cc__mf-toggle-group {
  display: flex;
  gap: 2px;
}

.cc__mf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-2, 8px);
}

.cc__mf-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1, 4px);
  padding: var(--space-3, 12px) var(--space-2, 8px);
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--color-border-subtle, rgba(71, 85, 105, 0.12));
  transition: transform var(--duration-fast, 200ms) var(--easing-default, ease),
              border-color var(--duration-fast, 200ms) var(--easing-default, ease);
  cursor: default;
}

.cc__mf-cell:hover {
  transform: scale(1.04);
  border-color: var(--color-border-strong, rgba(71, 85, 105, 0.24));
}

.cc__mf-cell-label {
  font-size: var(--text-xs, 11px);
  font-weight: 600;
  color: var(--color-text-secondary, #94A3B8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cc__mf-cell-val {
  font-size: var(--text-sm, 13px);
  font-weight: 700;
}

/* ─── Shared mono utility ────────────────────────────────────────────────── */

.mono {
  font-family: var(--font-mono, monospace);
}

/* ─── Responsive tweaks ──────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .cc__strip { grid-template-columns: 1fr; }
  .cc__context-row { grid-template-columns: 1fr; }
  .cc__context-strip { grid-template-columns: repeat(3, 1fr); }
  .cc__brief-row { grid-template-columns: 1fr; min-height: auto; }
  .cc__setups-row { grid-template-columns: 1fr; }
  .cc__bottom-row { grid-template-columns: 1fr; }
  .cc__mf-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
  .cc__cal-values { display: none; }
  .cc__fxc-grid { font-size: 9px; }
  .cc__setups-table-head { display: none; }
  .cc__setups-table-row {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2, 8px);
  }
  .cc__setup-col--cycle,
  .cc__setup-col--time { display: none; }
}

/* ─── FXC Matrix ─────────────────────────────────────────────────────────── */

.cc__fxc-matrix {
  overflow-x: auto;
}

.cc__fxc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
  gap: var(--space-2, 8px);
}

.cc__fxc-grid {
  display: grid;
  gap: 3px;
  align-items: stretch;
  width: 100%;
}

.cc__fxc-corner,
.cc__fxc-head,
.cc__fxc-rowlab,
.cc__fxc-cell {
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--color-border-subtle, rgba(71, 85, 105, 0.12));
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono, monospace);
  font-size: var(--text-xs, 11px);
  line-height: 1;
}

.cc__fxc-corner,
.cc__fxc-head,
.cc__fxc-rowlab {
  background: transparent;
  color: var(--color-text-primary, #F0F2F5);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.cc__fxc-corner {
  border: none;
}

.cc__fxc-cell {
  font-weight: 700;
  padding: 2px;
}

.cc__fxc-cell--diag {
  color: var(--color-text-muted, #64748B);
  background: rgba(148, 163, 184, 0.06);
}

.cc__fxc-cell--na {
  color: var(--color-text-muted, #64748B);
  background: rgba(148, 163, 184, 0.04);
}

@media (max-width: 768px) {
  .cc__fxc-grid {
    font-size: 10px;
    gap: 2px;
  }
  .cc__fxc-corner,
  .cc__fxc-head,
  .cc__fxc-rowlab,
  .cc__fxc-cell {
    min-height: 32px;
    font-size: 9px;
  }
}


/*
 * Scanner view — full-featured setup scanner styles.
 * Uses BoCapital design-token CSS variables.
 */

/* ─── Layout ────────────────────────────────────────────────────────────────── */

.scanner {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ─── Header row ────────────────────────────────────────────────────────────── */

.sc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.sc-header__stats {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.sc-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sc-stat__label {
  font-size: 10px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sc-stat__value {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.sc-new-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-profit-muted);
  color: var(--color-profit);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(16, 185, 129, 0.3);
  transition: opacity var(--duration-fast) var(--easing-default);
}

.sc-new-badge:hover {
  opacity: 0.8;
}

/* outcome badge displayed on setup cards */
.sc-outcome-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

.sc-outcome-win {
  background: var(--color-profit-muted);
  color: var(--color-profit);
}

.sc-outcome-loss {
  background: var(--color-loss-muted);
  color: var(--color-loss);
}

/* ─── Filters ───────────────────────────────────────────────────────────────── */

.sc-filters {
  display: flex;
  align-items: flex-end;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.sc-filters .boc-select {
  min-width: 130px;
}

.sc-filter-toggle {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 var(--space-2);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.sc-filter-toggle input {
  margin: 0;
}

/* ── Filter stats (Total / Filtered inside filter bar) ──────────────────── */

.sc-filter-stats {
  display: flex;
  align-items: flex-end;
  gap: var(--space-4);
  margin-left: auto;
  padding-left: var(--space-4);
  border-left: 1px solid var(--color-border-subtle);
}

/* Each stat mirrors .boc-field: label on top (normal flow) + fixed-height value */
.sc-filter-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 48px;
  text-align: center;
}

.sc-filter-stat__label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
}

.sc-filter-stat__value {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1;
}

/* ─── Loading state ─────────────────────────────────────────────────────────── */

.sc-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) 0;
}

/* ─── Cards list ────────────────────────────────────────────────────────────── */

.sc-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ─── Setup card ────────────────────────────────────────────────────────────── */

.sc-card {
  position: relative;
  background: var(--color-bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  cursor: pointer;
  transition:
    border-color var(--duration-fast) var(--easing-default),
    transform var(--duration-fast) var(--easing-default),
    box-shadow var(--duration-fast) var(--easing-default);
}

/* Direction accent stripe — LONG/SHORT top bar via data attribute */
.sc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-border-subtle);
  transition: background var(--duration-fast) var(--easing-default);
}

.sc-card[data-direction="LONG"]::before,
.sc-card[data-direction="BULLISH"]::before {
  background: var(--color-profit);
  box-shadow: var(--glow-profit);
}

.sc-card[data-direction="SHORT"]::before,
.sc-card[data-direction="BEARISH"]::before {
  background: var(--color-loss);
  box-shadow: var(--glow-loss);
}

.sc-card:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.sc-card:focus-visible {
  outline: 2px solid var(--color-accent-teal, var(--color-border-focus));
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(14, 165, 161, 0.15);
}

/* Gated card */
.sc-card--gated {
  opacity: 0.6;
  border-left: 3px solid var(--color-loss);
}

/* Fading card — setup no longer in current scan but within grace period.
   This class is deprecated; the UI no longer dims these cards.  Kept for
   backwards‑compatibility only. */
.sc-card--fading {
  opacity: 0.5;
  border-left: 3px solid var(--color-text-secondary, #6b7280);
}

.sc-card--fading::after {
  content: 'FADING';
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary, #6b7280);
  background: var(--color-bg-surface, #0B1120);
  padding: 1px 6px;
  border-radius: 3px;
  z-index: 1;
}

/* Fade reason label shown when card is fading */
.sc-card__fade-reason {
  font-size: 10px;
  color: var(--color-text-secondary);
  margin-top: var(--space-1, 4px);
  text-align: right;
  font-style: italic;
}

/* ─── Card grid (7 columns) ─────────────────────────────────────────────────── */

.sc-card__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: center;
}

.sc-card__col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--space-4) var(--space-3);
  border-right: 1px solid var(--color-border-subtle);
}

.sc-card__col:last-child {
  border-right: none;
}

.sc-card__label {
  font-size: 11px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-2);
}

.sc-card__value {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
}

.sc-card__value--sm {
  font-size: 13px;
}

.sc-card__value--pair {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  gap: var(--space-2);
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.sc-card__actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  justify-content: center;
}

/* ─── Pattern badges ────────────────────────────────────────────────────────── */

.sc-pbadge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  height: 20px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sc-pbadge--mw {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-accent-primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.sc-pbadge--hb {
  background: rgba(139, 92, 246, 0.15);
  color: var(--color-accent-secondary);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.sc-pbadge--rrt {
  background: rgba(52, 211, 153, 0.15);
  color: var(--color-session-ny);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.sc-pbadge--alt {
  background: rgba(148, 163, 184, 0.1);
  color: var(--color-text-muted);
  border: 1px solid rgba(148, 163, 184, 0.22);
  cursor: default;
}

/* ─── Alt-patterns block (modal) ────────────────────────────────────────────── */

.sc-alt-patterns {
  grid-column: 1 / -1;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.sc-alt-patterns__title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.sc-alt-patterns__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px 0;
}

.sc-alt-patterns__item + .sc-alt-patterns__item {
  border-top: 1px solid rgba(148, 163, 184, 0.07);
}

.sc-alt-patterns__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.sc-alt-patterns__type {
  font-size: 11px;
  color: var(--color-text-muted);
  flex: 1;
}

.sc-alt-patterns__rel {
  font-size: 12px;
  font-weight: 600;
}

/* ─── Direction badge ───────────────────────────────────────────────────────── */

.sc-dir-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
}

.sc-dir-badge--bull {
  background: var(--color-profit-muted);
  color: var(--color-profit);
}

.sc-dir-badge--bear {
  background: var(--color-loss-muted);
  color: var(--color-loss);
}

/* ─── Confluence badges ─────────────────────────────────────────────────────── */

.sc-conf-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.sc-conf-badge {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-session-ny);
  white-space: nowrap;
}

/* ─── Trap badge ────────────────────────────────────────────────────────────── */

.sc-trap-badge {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  height: 20px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 2;
}

.sc-trap-badge--bearish {
  background: linear-gradient(135deg, #ef4444, #f97316);
}

.sc-trap-badge--bullish {
  background: linear-gradient(135deg, #10b981, #06b6d4);
}

/* ─── BTMM context strip ───────────────────────────────────────────────────── */

.sc-btmm-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: var(--space-1) var(--space-3);
  align-items: center;
}

.sc-btmm-chip {
  font-size: 11px;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-weight: 600;
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
}

.sc-btmm-chip--up {
  background: var(--color-profit-muted);
  color: var(--color-profit);
}

.sc-btmm-chip--down {
  background: var(--color-loss-muted);
  color: var(--color-loss);
}

.sc-btmm-chip--warn {
  background: var(--color-warning-muted);
  color: var(--color-warning);
}

.sc-btmm-chip--ok {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-profit);
}

.sc-btmm-chip--win {
  background: var(--color-profit-muted);
  color: var(--color-profit);
}

.sc-btmm-chip--be {
  background: var(--color-warning-muted, rgba(234, 179, 8, 0.15));
  color: var(--color-warning, #eab308);
}

.sc-btmm-chip--loss {
  background: var(--color-loss-muted);
  color: var(--color-loss);
}

.sc-btmm-chip--gated {
  background: var(--color-loss-muted);
  color: var(--color-loss);
  font-weight: 600;
}

.sc-veto-reasons {
  font-size: 10px;
  padding: 2px var(--space-3) var(--space-1);
  color: var(--color-loss);
  opacity: 0.85;
}

/* ─── Confidence breakdown ──────────────────────────────────────────────────── */

.sc-breakdown {
  padding: 6px 14px 10px;
  border-top: 1px solid var(--color-border-subtle);
  background: rgba(0, 0, 0, 0.15);
}

.sc-breakdown summary {
  font-size: 11px;
  color: var(--color-text-secondary);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  padding: 2px 0;
  list-style: none;
}

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

.sc-breakdown summary::before {
  content: '▸ ';
}

.sc-breakdown[open] summary::before {
  content: '▾ ';
}

.sc-breakdown summary:hover {
  color: var(--color-text-primary);
}

.sc-breakdown__badge {
  font-size: 10px !important;
  padding: 1px 5px !important;
}

.sc-breakdown__grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: var(--space-2);
}

.sc-breakdown__row {
  display: grid;
  grid-template-columns: 68px 1fr 28px;
  align-items: center;
  gap: 6px;
}

.sc-breakdown__label {
  font-size: 10px;
  color: var(--color-text-secondary);
  text-align: right;
}

.sc-breakdown__bar-bg {
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.sc-breakdown__bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width var(--duration-normal) var(--easing-default);
}

.sc-breakdown__pct {
  font-size: 10px;
  color: var(--color-text-muted);
  text-align: left;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Detail Modal
   ═══════════════════════════════════════════════════════════════════════════════ */

.sc-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.sc-detail__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.sc-detail__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border-subtle);
  padding-bottom: var(--space-2);
}

.sc-detail__subtitle {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 400;
}

.sc-detail__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3);
}

.sc-detail__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-3);
  background: var(--color-bg-elevated, var(--color-bg-surface));
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  border-left: 3px solid transparent;
}

.sc-detail__item--entry {
  border-left-color: var(--color-accent-primary);
}

.sc-detail__item--sl {
  border-left-color: var(--color-loss);
}

.sc-detail__item--tp {
  border-left-color: var(--color-profit);
}

.sc-detail__lbl {
  font-size: 11px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sc-detail__val {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.sc-detail__val--sm {
  font-size: 12px;
}

.sc-detail__val--lg {
  font-size: 18px;
  font-weight: 700;
}

.sc-detail__val--xl {
  font-size: 20px;
  font-weight: 700;
}

.sc-detail__desc {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* ─── TP Engine ─────────────────────────────────────────────────────────────── */

.sc-detail__tp-loading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  color: var(--color-text-muted);
  font-size: 13px;
}

.sc-detail__tp-error {
  font-size: 12px;
  color: var(--color-text-muted);
  padding: var(--space-2) 0;
}

.sc-tp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.sc-tp-card {
  background: var(--color-bg-elevated, var(--color-bg-surface));
  border-radius: var(--radius-md);
  padding: var(--space-3);
  border: 1px solid var(--color-border-subtle);
  border-left: 3px solid transparent;
}

.sc-tp-card__label {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.sc-tp-card__val {
  font-size: 1rem;
  font-weight: 700;
}

.sc-tp-rationale {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-top: var(--space-1);
}

/* ─── Shift candle status ───────────────────────────────────────────────────── */

.sc-shift {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
}

.sc-shift--confirmed {
  background: var(--color-profit-muted);
  color: var(--color-profit);
}

.sc-shift--pending {
  background: var(--color-warning-muted);
  color: var(--color-warning);
}

/* ─── Summary box ───────────────────────────────────────────────────────────── */

.sc-summary {
  background: var(--color-bg-elevated, var(--color-bg-surface));
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  padding: var(--space-4);
}

.sc-summary h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.sc-summary p {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 960px) {
  .sc-card__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .sc-card__col:nth-child(n + 5) {
    border-top: 1px solid var(--color-border-subtle);
  }

  .sc-tp-grid {
    grid-template-columns: 1fr;
  }

  .sc-detail__grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 600px) {
  /* Keep controls on one compact row with horizontal scroll on narrow mobile. */
  .sc-filters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: var(--space-2);
    align-items: flex-end;
    padding-bottom: 2px;
  }

  .sc-filters .boc-field {
    min-width: 108px;
    flex: 0 0 auto;
  }

  .sc-filters .boc-field__label {
    font-size: 10px;
  }

  .sc-filters .boc-select {
    min-width: 108px;
    height: 32px;
    font-size: 12px;
  }

  .sc-filter-toggle {
    height: 32px;
    font-size: 10px;
    flex: 0 0 auto;
  }

  .sc-filter-stats {
    flex: 0 0 auto;
    margin-left: 0;
    padding-left: var(--space-2);
    border-left: 1px solid var(--color-border-subtle);
    justify-content: center;
  }

  .sc-header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Setup cards: hide Time (col 1) and Level (col 5) → 5 items fit on one line */
  .sc-card__grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .sc-card__col:nth-child(1),
  .sc-card__col:nth-child(5) {
    display: none;
  }

  /* Reset border-top from the 960px rule (no longer wraps) */
  .sc-card__col:nth-child(n + 5) {
    border-top: none;
  }

  .sc-card__col {
    padding: var(--space-3) var(--space-2);
  }

  .sc-card__value--pair {
    font-size: 15px;
  }

  .sc-detail__grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Analysis 3.0 — Column Layout
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Layout root ────────────────────────────────────────────────────────── */

.anl {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-bottom: var(--space-10);
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding-inline: var(--space-4);
}

.anl-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 60vh;
}

.anl-loading__text {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.anl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.anl-header__left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.anl-header__select .boc-select {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 700;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  min-width: 140px;
}

.anl-header__price {
  font-size: var(--text-xl);
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--color-accent-primary);
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LEVEL HERO — full-width band at top
   ═══════════════════════════════════════════════════════════════════════════ */

.anl-hero {
  width: 100%;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.anl-hero__accentbar {
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg,
    var(--color-profit) 0%,
    var(--color-warning) 50%,
    var(--color-loss) 100%
  );
}

.anl-hero__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: var(--space-5) var(--space-8);
  padding: var(--space-6) var(--space-8);
}

/* Left column: level label + description — centered */
.anl-hero__left {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: center;
  text-align: center;
}

/* Centre column: pair + numeral */
.anl-hero__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

/* Right column: direction pill (top) + retail positioning (bottom) */
.anl-hero__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  align-self: stretch;
  gap: var(--space-3);
}

.anl-hero__pair {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

.anl-hero__level-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.anl-hero__numeral {
  font-family: var(--font-mono);
  font-size: 5.5rem;
  font-weight: 900;
  line-height: 1;
  color: var(--color-text-primary);
}

.anl-hero__sublabels {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.anl-hero__level-label {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-text-secondary);
}

.anl-hero__desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  max-width: 280px;
  text-align: center;
  line-height: 1.5;
}

/* Timeline — centered under numeral */
.anl-hero__timeline-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 280px;
  margin-top: var(--space-2);
}

.anl-hero__track {
  display: flex;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  overflow: visible;
  gap: 2px;
  position: relative;
}

.anl-hero__seg {
  height: 100%;
  flex: 1;
  border-radius: var(--radius-pill);
  opacity: 0.28;
  transition: opacity 0.2s;
}

.anl-hero__seg--1 { background: var(--color-profit); }
.anl-hero__seg--2 { background: var(--color-warning); }
.anl-hero__seg--3 { background: var(--color-loss); }

.anl-hero__seg--active { opacity: 1; }

.anl-hero__marker {
  position: absolute;
  top: -2px;
  width: 12px;
  height: 12px;
  background: var(--color-text-primary);
  border-radius: 50%;
  border: 2px solid var(--color-bg-elevated);
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
  transition: left 0.3s ease;
  pointer-events: none;
}

.anl-hero__adr-mult {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: center;
  letter-spacing: 0.04em;
}

/* KPI bar: Day | Price | ADR × 3 */
.anl-hero__kpis {
  grid-column: 1 / -1;
  display: flex;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border-subtle);
  width: 100%;
}

.anl-hero__kpi {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.anl-hero__kpi-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-primary);
}

.anl-hero__kpi--price .anl-hero__kpi-value {
  font-size: 1.75rem;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

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

/* Retail positioning — bottom of right column */
.anl-hero__sentiment {
  display: flex;
  flex-direction: row;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.anl-hero__sentiment-item {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
}

.anl-hero__sentiment-item--long {
  color: var(--color-profit);
}

.anl-hero__sentiment-item--short {
  color: var(--color-loss);
}

.anl-hero__sentiment-item--net {
  color: var(--color-text-secondary);
}

/* AI Summary card */
.anl-ai-loading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.anl-ai-loading__text {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.anl-ai-summary-text {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   2-COLUMN BODY
   ═══════════════════════════════════════════════════════════════════════════ */

.anl-body {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--space-4);
  align-items: start;
}

.anl-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (max-width: 1100px) {
  .anl-body {
    grid-template-columns: 1fr;
  }

  .anl-col--right {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .anl-body { grid-template-columns: 1fr; }
  .anl-col--right { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANALYSIS CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.anl-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.anl-card--prominent {
  border-color: color-mix(in srgb, var(--color-accent-primary) 30%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-accent-primary) 15%, transparent);
}

.anl-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
  background: color-mix(in srgb, var(--color-bg-surface) 40%, transparent);
}

.anl-card__icon {
  font-size: var(--text-base);
  flex-shrink: 0;
}

.anl-card__title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  flex: 1;
}

.anl-card__detail-btn {
  background: none;
  border: none;
  color: var(--color-accent-primary);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  font-family: inherit;
}

.anl-card__detail-btn:hover {
  background: color-mix(in srgb, var(--color-accent-primary) 12%, transparent);
}

.anl-card__score-chip {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-mono);
  font-weight: 700;
}

.anl-card__score-denom {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 400;
}

.anl-card__view-more {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  cursor: pointer;
  padding: 2px var(--space-2);
  transition: color 0.15s;
  font-family: inherit;
}

.anl-card__view-more:hover { color: var(--color-accent-primary); }

.anl-card__body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ── Subsection within a card ──────────────────────────────────────────── */

.anl-subsection {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.anl-subsection__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

/* ── Row grids ─────────────────────────────────────────────────────────── */

.anl-row-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}

.anl-labeled-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
}

.anl-labeled-bar__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  width: 72px;
  flex-shrink: 0;
}

.anl-labeled-bar__value {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Quality score widget ──────────────────────────────────────────────── */

.anl-quality-row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.anl-quality-score {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  flex-shrink: 0;
  padding-top: 2px;
}

.anl-quality-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

/* ── Management grid ───────────────────────────────────────────────────── */

.anl-mgmt-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.anl-mgmt-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
}

.anl-mgmt-item__icon {
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.anl-mgmt-item__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  flex: 1;
}

.anl-mgmt-item__right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.anl-mgmt-item__value {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
}

/* ── Confluence list ───────────────────────────────────────────────────── */

.anl-conf-summary {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.anl-conf-summary__aligned {
  font-weight: 700;
  color: var(--color-profit);
}

.anl-conf-summary__sep {
  color: var(--color-border-default);
  margin: 0 2px;
}

.anl-conf-summary__total {
  color: var(--color-text-secondary);
}

.anl-conf-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.anl-conf-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 3px var(--space-1);
  border-radius: var(--radius-sm);
}

.anl-conf-row__name {
  font-size: var(--text-xs);
  text-transform: capitalize;
  color: var(--color-text-secondary);
  flex: 1;
}

.anl-conf-row__detail {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ── Setup card ────────────────────────────────────────────────────────── */

.anl-setup__name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  flex-wrap: wrap;
}

.anl-setup__status-text {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-style: italic;
}

/* ── Empty state ───────────────────────────────────────────────────────── */

.anl-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-4);
  text-align: center;
}

.anl-empty-state__icon {
  font-size: 2rem;
  opacity: 0.4;
}

.anl-empty-state__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.anl-empty-state__sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ── Chip rows ─────────────────────────────────────────────────────────── */

.anl-chip-row {
  display: flex;
  gap: var(--space-1);
  flex-wrap: nowrap;
  overflow-x: auto;
}

.anl-chip-row--wrap {
  flex-wrap: wrap;
  overflow: visible;
}

.anl-chip-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* ── MTF pills (in modal) ──────────────────────────────────────────────── */

.anl-mtf-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.anl-mtf-pill__tf {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-muted);
}

.anl-mtf-pill__trend {
  font-size: var(--text-xs);
  font-weight: 600;
}

/* ── Modal content helpers ─────────────────────────────────────────────── */

.anl-modal-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.anl-modal-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.anl-modal-section-label--spaced {
  margin-top: var(--space-4);
}

.anl-modal-kv-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   KV ROWS (shared utility)
   ═══════════════════════════════════════════════════════════════════════════ */

.anl-kv {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.anl-kv__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.anl-kv__value {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  font-family: var(--font-mono);
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* KV with bar variant */
.anl-kv--bar {
  width: 100%;
}

.anl-kv--bar .anl-kv__label {
  width: 70px;
  flex-shrink: 0;
}

.anl-kv--bar .anl-kv__value {
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MINI BAR (shared utility)
   ═══════════════════════════════════════════════════════════════════════════ */

.anl-minibar {
  flex: 1;
  height: 6px;
  background: var(--color-bg-surface);
  border-radius: var(--radius-pill);
  overflow: hidden;
  min-width: 40px;
}

.anl-minibar__fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--color-accent-primary);
  transition: width 0.4s ease;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONFLUENCE ICONS (shared utility)
   ═══════════════════════════════════════════════════════════════════════════ */

.anl-conf-icon--yes   { color: var(--color-profit);  font-weight: 700; flex-shrink: 0; width: 16px; text-align: center; }
.anl-conf-icon--no    { color: var(--color-loss);    font-weight: 700; flex-shrink: 0; width: 16px; text-align: center; }
.anl-conf-icon--maybe { color: var(--color-warning); font-weight: 700; flex-shrink: 0; width: 16px; text-align: center; }

/* ═══════════════════════════════════════════════════════════════════════════
   EMA HEATMAP (inside TechnicalsCard modal)
   ═══════════════════════════════════════════════════════════════════════════ */

.anl-ema-heatmap {
  display: grid;
  grid-template-columns: 40px repeat(5, 1fr);
  gap: 2px;
}

.anl-ema-heatmap__corner { /* empty top-left */ }

.anl-ema-heatmap__col-header {
  font-size: 10px;
  color: var(--color-text-muted);
  text-align: center;
  padding: 2px 0;
  font-weight: 600;
}

.anl-ema-heatmap__row-header {
  font-size: 10px;
  color: var(--color-text-secondary);
  font-weight: 600;
  display: flex;
  align-items: center;
  padding: 2px;
}

.anl-ema-heatmap__cell {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  min-height: 24px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.anl-ema-heatmap__cell:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 2px var(--color-accent-primary);
  z-index: 1;
}

.anl-ema-heatmap__cell--above { background: color-mix(in srgb, var(--color-profit) 60%, var(--color-bg-surface)); }
.anl-ema-heatmap__cell--below { background: color-mix(in srgb, var(--color-loss)   60%, var(--color-bg-surface)); }
.anl-ema-heatmap__cell--none  { background: var(--color-bg-surface); }

/* ═══════════════════════════════════════════════════════════════════════════
   MTF GRID (inside TechnicalsCard modal)
   ═══════════════════════════════════════════════════════════════════════════ */

.anl-mtf-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-2);
}

@media (max-width: 768px) {
  .anl-mtf-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  .anl-mtf-grid { grid-template-columns: repeat(2, 1fr); }
}

.anl-mtf-tf {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-surface);
  border-top: 2px solid;
}

.anl-mtf-tf--bullish { border-top-color: var(--color-profit); }
.anl-mtf-tf--bearish { border-top-color: var(--color-loss); }

.anl-mtf-tf__name {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.anl-mtf-tf__trend {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-primary);
}

.anl-mtf-tf__badges {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   AI DRAWER — Collapsible bottom panel
   ═══════════════════════════════════════════════════════════════════════════ */

.anl-drawer {
  position: sticky;
  bottom: 0;
  z-index: 50;
  margin-top: auto;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -4px 24px -4px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.anl-drawer__tab {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  width: 100%;
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: var(--font-mono);
}

.anl-drawer__tab:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.anl-drawer__tab-icon { font-size: var(--text-base); }
.anl-drawer__tab-chevron { margin-left: auto; font-size: var(--text-xs); color: var(--color-text-muted); }

.anl-drawer__body {
  padding: var(--space-3) var(--space-4);
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  animation: anl-drawer-in 0.25s ease-out;
}

@keyframes anl-drawer-in {
  from { opacity: 0; max-height: 0; }
  to   { opacity: 1; max-height: 320px; }
}

.anl-drawer__summary { min-height: 40px; }

.anl-drawer__text {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--color-text-primary);
  margin: 0;
  white-space: pre-line;
  font-family: var(--font-mono);
}

.anl-drawer__placeholder {
  font-size: 12px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-style: italic;
}

@keyframes anl-blink-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.anl-drawer__cursor {
  display: inline-block;
  color: var(--color-accent-primary);
  animation: anl-blink-cursor 1s step-end infinite;
  font-family: var(--font-mono);
  font-style: normal;
}

.anl-drawer__chat {
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border-subtle);
}

.anl-drawer__messages {
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--space-2);
}

.anl-drawer__msg {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-size: 12px;
  line-height: 1.55;
  font-family: var(--font-mono);
}

.anl-drawer__msg--user      { color: var(--color-text-primary); }
.anl-drawer__msg--assistant { color: var(--color-text-secondary); }

.anl-drawer__role {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-accent-primary);
  flex-shrink: 0;
  line-height: 1;
}

.anl-drawer__msg-text { white-space: pre-wrap; word-break: break-word; }

.anl-drawer__prompt {
  flex-shrink: 0;
  font-size: 16px;
  color: var(--color-accent-primary);
  line-height: 1;
  align-self: center;
  font-family: var(--font-mono);
}

.anl-drawer__input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.anl-drawer__input {
  flex: 1;
  padding: 6px 0;
  border: none;
  background: transparent;
  color: var(--color-text-primary);
  font-size: 12px;
  font-family: var(--font-mono);
  outline: none;
  caret-color: var(--color-accent-primary);
}

.anl-drawer__input::placeholder { color: var(--color-text-muted); }

.anl-drawer__input:focus,
.anl-drawer__input:focus-visible {
  border: none;
  box-shadow: none;
  outline: none;
}

.anl-drawer__input:disabled { opacity: 0.4; cursor: not-allowed; }

.anl-drawer__btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 4px 6px;
  cursor: pointer;
  transition: color 150ms ease;
  line-height: 1;
}

.anl-drawer__btn:hover:not(:disabled) { color: var(--color-accent-primary); }
.anl-drawer__btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Utility ────────────────────────────────────────────────────────────── */

.mono { font-family: var(--font-mono); }




/* ═══════════════════════════════════════════════════════════════════════════
 *  Matrix view — design-token CSS
 *  Uses project CSS custom-property tokens for all colours, spacing, type.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* ── Layout ─────────────────────────────────────────────────────────────── */

.mx {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.mx-summary { order: 1; }
.mx-filters { order: 2; }
.mx-table-wrap { order: 3; }
.mx-heatmap { order: 4; }
.mx > .boc-empty-state { order: 3; }
.mx-footer { order: 5; }

.mx-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

/* ── BTMM cycle confluence heatmap ─────────────────────────────────────── */

.mx-heatmap {
  background: linear-gradient(160deg, rgba(13, 20, 36, 0.9) 0%, rgba(11, 26, 28, 0.9) 100%);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: var(--card-shadow);
}

.mx-heatmap__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.mx-heatmap__title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--fw-semi, 600);
  letter-spacing: 0.01em;
  color: var(--color-text-primary);
}

.mx-heatmap__subtitle {
  margin: var(--space-1) 0 0;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  max-width: 48rem;
}

.mx-heatmap__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.mx-heatmap__count-chip,
.mx-heatmap__signal-chip {
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-default);
  padding: 4px 10px;
  font-size: var(--text-xs);
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

.mx-heatmap__signal-chip {
  color: #d9f99d;
  border-color: rgba(163, 230, 53, 0.35);
}

.mx-heatmap__signal-chip--active {
  color: #ecfccb;
  background: rgba(132, 204, 22, 0.18);
  border-color: rgba(163, 230, 53, 0.75);
  box-shadow: 0 0 0 1px rgba(163, 230, 53, 0.2), 0 0 12px rgba(163, 230, 53, 0.25);
}

.mx-heatmap__legend {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.mx-heatmap__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
}

.mx-heatmap__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.mx-heatmap__dot--aligned { background: var(--color-profit); }
.mx-heatmap__dot--contrarian { background: #f97316; }
.mx-heatmap__dot--mixed { background: var(--color-warning); }

.mx-heatmap__table-wrap {
  overflow-x: auto;
}

.mx-heatmap__table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

.mx-heatmap__table th,
.mx-heatmap__table td {
  border: 1px solid var(--color-border-strong);
  padding: 8px 10px;
}

.mx-heatmap__table thead th {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.mx-heatmap__table tbody tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

.mx-heatmap__pair,
.mx-heatmap__retail {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-primary);
  white-space: nowrap;
}

.mx-heatmap__retail {
  text-align: center;
}

.mx-heatmap__cell {
  min-width: 120px;
  height: 52px;
  text-align: center;
  vertical-align: middle;
}

.mx-heatmap__cell--inactive {
  background: var(--color-border-subtle);
}

.mx-heatmap__cell--active {
  position: relative;
}

.mx-heatmap__cell--active::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.mx-heatmap__cell--aligned {
  background: rgba(5, 150, 105, 0.2);
}

.mx-heatmap__cell--aligned::after {
  border: 1px solid rgba(5, 150, 105, 0.6);
}

.mx-heatmap__cell--contrarian {
  background: rgba(249, 115, 22, 0.2);
}

.mx-heatmap__cell--contrarian::after {
  border: 1px solid rgba(253, 186, 116, 0.9);
}

.mx-heatmap__cell--mixed,
.mx-heatmap__cell--unknown {
  background: rgba(234, 179, 8, 0.2);
}

.mx-heatmap__cell--mixed::after,
.mx-heatmap__cell--unknown::after {
  border: 1px solid rgba(254, 240, 138, 0.9);
}

.mx-heatmap__cell-level {
  display: block;
  font-size: 11px;
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-primary);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mx-heatmap__cell-detail {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mx-heatmap__cell-empty {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

@media (max-width: 768px) {
  .mx-heatmap {
    padding: var(--space-3);
  }

  .mx-heatmap__title {
    font-size: var(--text-md);
  }

  .mx-heatmap__subtitle {
    font-size: var(--text-xs);
  }
}

/* ── Summary cards ──────────────────────────────────────────────────────── */

.mx-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

@media (max-width: 1200px) { .mx-summary { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .mx-summary { grid-template-columns: 1fr; } }

/* ── Filter bar ─────────────────────────────────────────────────────────── */

.mx-filters {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.mx-filter-btn {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium, 500);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.mx-filter-btn:hover {
  border-color: var(--color-accent-primary);
  color: var(--color-text-primary);
}
.mx-filter-btn--active {
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--color-accent-primary);
  color: var(--color-accent-primary);
}
.mx-filter-btn:focus-visible {
  outline: 2px solid var(--color-accent-teal);
  outline-offset: 2px;
}

.mx-filter-sep {
  width: 1px;
  height: 28px;
  background: var(--color-border-default);
  margin: 0 var(--space-1);
  flex-shrink: 0;
}

.mx-filter-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.mx-ws-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.mx-ws-dot--on  { background: var(--color-profit); box-shadow: 0 0 6px var(--color-profit); }
.mx-ws-dot--off { background: var(--color-loss); }

.mx-last-update {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

/* ── Table wrapper ──────────────────────────────────────────────────────── */

.mx-table-wrap {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

@media (max-width: 900px) {
  .mx-table-wrap { overflow-x: auto; }
  .mx-table { min-width: 820px; }
}

/* ── Table ──────────────────────────────────────────────────────────────── */

.mx-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* Column widths */
.mx-col--pair  { width: 15%; }
.mx-col--phase { width: 12%; }
.mx-col--dir   { width: 7%; }
.mx-col--peak  { width: 13%; }
.mx-col--tdi   { width: 15%; }
.mx-col--adr   { width: 14%; }
.mx-col--day   { width: 9%; }
.mx-col--trade { width: 8%; text-align: center; }

/* Header */
.mx-table thead th {
  background: var(--color-bg-elevated);
  padding: 10px 14px;
  font-size: var(--text-xs);
  font-weight: var(--fw-semi, 600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  text-align: left;
  border-bottom: 1px solid var(--color-border-strong);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  white-space: nowrap;
  transition: color 0.2s;
}
.mx-table thead th:hover { color: var(--color-accent-primary); }
.mx-th--sorted { color: var(--color-accent-primary) !important; }
.mx-sort-icon { font-size: 10px; }

/* Body */
.mx-table tbody td {
  padding: 10px 14px;
  font-size: var(--text-sm);
  white-space: nowrap;
  vertical-align: middle;
}

/* ── Data rows ──────────────────────────────────────────────────────────── */

.mx-row {
  border-bottom: 1px solid var(--color-border-subtle);
  cursor: pointer;
  transition: background 0.15s;
}
.mx-row:hover { background: rgba(59, 130, 246, 0.04); }
.mx-row--expanded { background: rgba(59, 130, 246, 0.06); }
.mx-row--gated { opacity: 0.45; }
.mx-row--gated:hover { opacity: 0.7; }
.mx-row--shortlisted { border-left: 3px solid var(--color-warning); }

/* Flash animation for WS updates */
@keyframes mx-flash {
  0%   { background: rgba(59, 130, 246, 0.15); }
  100% { background: transparent; }
}
.mx-row--flash { animation: mx-flash 1.2s ease-out; }

/* ── Pair cell ──────────────────────────────────────────────────────────── */

.mx-pair-cell {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.mx-pair-name {
  font-weight: var(--fw-semi, 600);
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  color: var(--color-text-primary);
}
.mx-pair-price {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}
.mx-star {
  color: var(--color-warning);
  font-size: 14px;
  flex-shrink: 0;
}

/* ── Direction arrow ────────────────────────────────────────────────────── */

.mx-dir { font-size: 18px; font-weight: 700; }
.mx-dir--up   { color: var(--color-profit); }
.mx-dir--down { color: var(--color-loss); }
.mx-dir--flat { color: var(--color-text-muted); }

/* ── TDI cell ───────────────────────────────────────────────────────────── */

.mx-tdi-cell {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.mx-tdi-rsi {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

/* ── ADR bar ────────────────────────────────────────────────────────────── */

.mx-adr-cell {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.mx-adr-bar-track {
  width: 60px;
  height: 6px;
  background: rgba(107, 114, 128, 0.2);
  border-radius: 3px;
  overflow: hidden;
}
.mx-adr-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.mx-adr-pct {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  min-width: 38px;
}

/* ── Gate icon ──────────────────────────────────────────────────────────── */

.mx-gate { font-size: 16px; }
.mx-gate--ok      { /* default */ }
.mx-gate--blocked  { /* inherits emoji styling */ }
.mx-gate--warning  { /* inherits emoji styling */ }
.mx-td--center { text-align: center; }

/* ── Mono helper ────────────────────────────────────────────────────────── */

.mx-mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
 *  Detail panel (expanded row)
 * ═══════════════════════════════════════════════════════════════════════════ */

.mx-detail-tr td {
  background: var(--color-bg-elevated);
}

.mx-detail-panel {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-border-strong);
}

.mx-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

@media (max-width: 1200px) { .mx-detail-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .mx-detail-grid { grid-template-columns: 1fr; } }

/* Section titles */
.mx-detail-title {
  font-size: var(--text-xs);
  font-weight: var(--fw-semi, 600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-accent-primary);
  margin-bottom: var(--space-2);
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  padding-bottom: var(--space-1);
}
.mx-detail-title--sub {
  margin-top: var(--space-3);
}

/* Detail rows */
.mx-drow {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  font-size: var(--text-xs);
}
.mx-drow-label {
  color: var(--color-text-secondary);
}
.mx-drow-value {
  font-family: var(--font-mono);
  font-weight: var(--fw-medium, 500);
  color: var(--color-text-primary);
}

/* Boolean badges */
.mx-bool--true  { color: var(--color-profit); font-weight: var(--fw-semi, 600); }
.mx-bool--false { color: var(--color-text-muted); }

/* ── Peak override button ───────────────────────────────────────────────── */

.mx-override-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.mx-override-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  font-size: var(--text-xs);
  font-weight: var(--fw-semi, 600);
  color: var(--color-accent-primary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.mx-override-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: var(--color-accent-primary);
}
.mx-override-btn:focus-visible {
  outline: 2px solid var(--color-accent-teal);
  outline-offset: 2px;
}
.mx-override-btn--high {
  background: var(--color-loss-muted);
  border-color: rgba(220, 38, 38, 0.4);
  color: var(--color-loss);
}
.mx-override-btn--low {
  background: var(--color-profit-muted);
  border-color: rgba(5, 150, 105, 0.4);
  color: var(--color-profit);
}

.mx-override-src {
  font-size: 13px;
  color: var(--color-text-muted);
}
.mx-override-src--auto {
  color: var(--color-warning);
}

/* ── Condition chips ────────────────────────────────────────────────────── */

.mx-cond-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: var(--space-2);
}
.mx-cond-chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: var(--fw-semi, 600);
  letter-spacing: 0.3px;
}
.mx-cond-chip--met {
  background: var(--color-profit-muted);
  color: var(--color-profit);
}
.mx-cond-chip--unmet {
  background: rgba(107, 114, 128, 0.12);
  color: var(--color-text-muted);
}

/* ── ADR range bar (detail panel 0×–5×) ─────────────────────────────────── */

.mx-adr-range {
  margin-top: var(--space-2);
}
.mx-adr-range-label {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-bottom: 3px;
}
.mx-adr-range-track {
  height: 6px;
  background: rgba(107, 114, 128, 0.2);
  border-radius: 3px;
  overflow: hidden;
}
.mx-adr-range-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.mx-adr-range-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ── Gate reasons ───────────────────────────────────────────────────────── */

.mx-gate-reasons {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-loss-muted);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: var(--radius-md);
}
.mx-gate-reasons-title {
  font-size: var(--text-xs);
  font-weight: var(--fw-semi, 600);
  color: var(--color-loss);
  margin-bottom: 4px;
}
.mx-gate-reason {
  font-size: var(--text-xs);
  color: var(--color-loss);
  padding: 2px 0;
}

/* ── Active setup box ───────────────────────────────────────────────────── */

.mx-setup-box {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
}
.mx-setup-title {
  font-size: 10px;
  font-weight: var(--fw-semi, 600);
  color: var(--color-accent-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.mx-setup-body {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--color-text-primary);
}

/* ── Trap badge ─────────────────────────────────────────────────────────── */

.mx-trap-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: var(--fw-semi, 600);
  margin-top: 4px;
}
.mx-trap-badge--bear {
  background: var(--color-loss-muted);
  color: var(--color-loss);
  border: 1px solid rgba(220, 38, 38, 0.25);
}
.mx-trap-badge--bull {
  background: var(--color-profit-muted);
  color: var(--color-profit);
  border: 1px solid rgba(5, 150, 105, 0.25);
}

/* ── Retry button ───────────────────────────────────────────────────────── */

.mx-retry-btn {
  background: var(--color-accent-primary);
  color: #fff;
  border: none;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--fw-medium, 500);
  transition: opacity 0.2s;
}
.mx-retry-btn:focus-visible {
  outline: 2px solid var(--color-accent-teal);
  outline-offset: 2px;
}
.mx-retry-btn:hover { opacity: 0.85; }

/* ── Footer ─────────────────────────────────────────────────────────────── */

.mx-footer {
  text-align: center;
  padding: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* JournalOverview — Dashboard tab styles */

.jov {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.jov__loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-10) 0;
}

/* KPI Strip */
.jov__kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
}

@media (max-width: 1200px) {
  .jov__kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .jov__kpis { grid-template-columns: repeat(2, 1fr); }
}

/* Win/Loss bar visual */
.jov__winloss-bar {
  display: flex;
  width: 48px;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}
.jov__winloss-bar__win {
  background: var(--color-profit);
  border-radius: 4px 0 0 4px;
}
.jov__winloss-bar__loss {
  background: var(--color-loss);
  border-radius: 0 4px 4px 0;
}

/* Calendar + Recent side-by-side */
.jov__middle {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-4);
  align-items: start;
}

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

.jov__calendar {
  min-width: 0;
}

/* Recent trades panel */
.jov__recent {
  background: var(--color-bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.jov__section-title {
  font-size: 13px;
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.jov__recent-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.jov__recent-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: var(--text-sm);
}
.jov__recent-row:last-child { border-bottom: none; }

.jov__recent-date {
  color: var(--color-text-muted);
  min-width: 80px;
  font-size: 12px;
}

.jov__recent-pair {
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-primary);
  min-width: 70px;
}

.jov__recent-pnl {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
}
.jov__recent-pnl--profit { color: var(--color-profit); }
.jov__recent-pnl--loss { color: var(--color-loss); }

.jov__empty-mini {
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  padding: var(--space-5) 0;
}

/* Bottom: Heatmap */
.jov__bottom {
  display: flex;
  gap: var(--space-4);
}

.jov__heatmap-card {
  flex: 1;
  background: var(--color-bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow-x: auto;
}

/* TradeTable ─ clean Bloomberg-dark table */

.tt__wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
}

.tt {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  white-space: nowrap;
}

.tt thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.65rem 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.tt thead th:hover { color: var(--text-primary); }

.tt tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}
.tt tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.tt tbody tr:not(:last-child) td { border-bottom: 1px solid var(--border-subtle); }

.tt td {
  padding: 0.55rem 0.75rem;
  color: var(--text-secondary);
}

.tt__mono { font-family: var(--font-mono); }

.tt__sort {
  display: inline-block;
  margin-left: 0.3rem;
  opacity: 0.35;
  font-size: 0.65rem;
}
.tt__sort--active { opacity: 1; color: var(--accent-teal); }

/* Direction pills */
.tt__dir--long { color: var(--accent-green); font-weight: 600; }
.tt__dir--short { color: var(--accent-red); font-weight: 600; }

/* Archetype badge */
.tt__arch {
  display: inline-block;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.tt__arch--teal   { background: rgba(var(--accent-teal-rgb, 0 200 175), 0.15); color: var(--accent-teal); }
.tt__arch--blue   { background: rgba(89, 156, 255, 0.15); color: var(--accent-blue); }
.tt__arch--amber  { background: rgba(255, 193, 7, 0.15); color: var(--accent-amber); }
.tt__arch--green  { background: rgba(var(--accent-green-rgb, 16 185 129), 0.15); color: var(--accent-green); }
.tt__arch--red    { background: rgba(var(--accent-red-rgb, 239 68 68), 0.15); color: var(--accent-red); }
.tt__arch--purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.tt__arch--gold   { background: rgba(234, 179, 8, 0.15); color: var(--accent-gold, #eab308); }

/* P&L color */
.tt__text-profit { color: var(--accent-green); }
.tt__text-loss   { color: var(--accent-red); }

/* Stars */
.tt__stars { color: var(--accent-amber); letter-spacing: -1px; }
.tt__stars--empty { color: var(--text-muted); opacity: 0.3; letter-spacing: -1px; }

/* Delete button */
.tt__delete {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.3;
  font-size: 0.85rem;
  transition: opacity 0.15s;
  padding: 4px;
}
.tt__delete:hover { opacity: 1; }

/* TradeModal — sectioned trade form */

.tm {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Sections */
.tm__section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tm__section-title {
  margin: 0;
  padding-bottom: 0.35rem;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-teal);
  border-bottom: 1px solid var(--border-subtle);
}

/* Grid for form fields */
.tm__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .tm__grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* TP Engine row */
.tm__tp-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.tm__tp-results {
  display: flex;
  gap: 0.5rem;
}

.tm__tp-badge {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  font-weight: 600;
  background: rgba(var(--accent-teal-rgb, 0 200 175), 0.15);
  color: var(--accent-teal);
}

.tm__tp-rationale {
  width: 100%;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Field labels (reused in Emotions, Rating, Tags) */
.tm__field-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

/* Emotion pills */
.tm__emotion-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tm__emotion-pill {
  padding: 4px 10px;
  border-radius: var(--radius-full, 999px);
  font-size: var(--text-xs);
  font-weight: 500;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.tm__emotion-pill:hover {
  border-color: var(--accent-teal);
  color: var(--accent-teal);
}
.tm__emotion-pill--selected {
  background: rgba(var(--accent-teal-rgb, 0 200 175), 0.18);
  border-color: var(--accent-teal);
  color: var(--accent-teal);
  font-weight: 600;
}

/* Rating stars */
.tm__star-row {
  display: flex;
  gap: 0.25rem;
}

.tm__star {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s, transform 0.12s;
}
.tm__star:hover { transform: scale(1.2); }
.tm__star--active { color: var(--accent-amber); }

/* Tags */
.tm__tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.tm__tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  background: var(--surface-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.tm__tag-x {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-left: 2px;
}
.tm__tag-x:hover { color: var(--accent-red); }

.tm__tag-input-row {
  display: flex;
  gap: 0.4rem;
  align-items: flex-end;
}
.tm__tag-input-row > *:first-child { flex: 1; }

/* Actions */
.tm__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

/* JournalTrades — Tab 2 */

.jt { display: flex; flex-direction: column; gap: 1rem; }

/* ── Filter Bar ── */
.jt__filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
}

/* ── Actions bar ── */
.jt__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.jt__actions-spacer { flex: 1; }
.jt__count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ── Loading ── */
.jt__loading { display: flex; justify-content: center; padding: 3rem; }

/* ── Day View ── */
.jt__days { display: flex; flex-direction: column; gap: 0.75rem; }

.jt__day {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  overflow: hidden;
}

.jt__day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.jt__day-header:hover { background: rgba(255, 255, 255, 0.02); }

.jt__day-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.jt__day-chevron {
  display: inline-block;
  transition: transform 0.2s;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.jt__day-chevron--open { transform: rotate(0); }
.jt__day-chevron:not(.jt__day-chevron--open) { transform: rotate(-90deg); }

.jt__day-date {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.jt__day-stats {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.jt__day-chip {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font-mono);
  background: var(--surface-elevated);
  color: var(--text-secondary);
}
.jt__day-chip--green { color: var(--accent-green); background: rgba(16, 185, 129, 0.1); }
.jt__day-chip--red   { color: var(--accent-red); background: rgba(239, 68, 68, 0.1); }

.jt__day-body {
  border-top: 1px solid var(--border-subtle);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Day KPIs strip ── */
.jt__day-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
}

.jt__day-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
}

.jt__day-kpi-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.jt__day-kpi-val {
  font-size: var(--text-base);
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}
.jt__day-kpi--chart { justify-content: flex-start; }

.jt__text-profit { color: var(--accent-green); }
.jt__text-loss   { color: var(--accent-red); }

/* ── Daily Review ── */
.jt__day-review {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface-elevated);
}

.jt__day-review-toggle {
  padding: 0.5rem 0.75rem;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
}
.jt__day-review-toggle::marker { display: none; }
.jt__day-review-toggle::-webkit-details-marker { display: none; }

.jt__day-review-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 0.75rem 0.75rem;
}

.jt__day-review-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.jt__day-review-stars {
  display: flex;
  gap: 0.2rem;
}

.jt__star {
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s;
}
.jt__star--active { color: var(--accent-amber); }

/* ── CSV Import ── */
.jt__import {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.jt__import-drop {
  padding: 2rem;
  text-align: center;
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.jt__import-drop:hover {
  border-color: var(--accent-teal);
  color: var(--text-secondary);
}

.jt__import-name {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* JournalAnalytics — Tab 3: Reports */

.ja { display: flex; flex-direction: column; gap: 1rem; }
.ja__loading { display: flex; justify-content: center; padding: 3rem; }

/* ── Sub-tab bar ── */
.ja__subtabs {
  display: flex;
  gap: 0.25rem;
  padding: 4px;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.ja__subtab {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.ja__subtab:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.03); }
.ja__subtab--active {
  background: var(--accent-teal);
  color: var(--surface-base);
  font-weight: 700;
}

/* ── Panel container ── */
.ja__panel { display: flex; flex-direction: column; gap: 1rem; }

/* ── KPI strip ── */
.ja__kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem;
}

/* ── Chart card ── */
.ja__chart-card {
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
}

.ja__chart-title {
  margin: 0 0 0.75rem;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Two-column layout ── */
.ja__two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 800px) {
  .ja__two-col { grid-template-columns: 1fr; }
}

/* ── Stat block (TradeZella-style left-right rows) ── */
.ja__stat-block {
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
}

.ja__block-title {
  margin: 0 0 0.65rem;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.ja__block-title--green { color: var(--accent-green); }
.ja__block-title--red { color: var(--accent-red); }

.ja__stat-rows { display: flex; flex-direction: column; gap: 0.35rem; }

.ja__stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.ja__stat-row:last-child { border-bottom: none; }

.ja__stat-row-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.ja__stat-row-val {
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Accent colors */
.ja__accent--green  { color: var(--accent-green); }
.ja__accent--red    { color: var(--accent-red); }
.ja__accent--teal   { color: var(--accent-teal); }
.ja__accent--blue   { color: var(--accent-blue); }
.ja__accent--purple { color: var(--accent-purple); }
.ja__accent--amber  { color: var(--accent-amber); }
.ja__accent--muted  { color: var(--text-secondary); }

/* ── Table card ── */
.ja__table-card {
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
}

/* ── Table ── */
.ja__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.ja__table thead th {
  padding: 0.5rem 0.65rem;
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.ja__table tbody tr:not(:last-child) td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.ja__table td {
  padding: 0.45rem 0.65rem;
  color: var(--text-secondary);
}

.ja__mono { font-family: var(--font-mono); }

/* R-class accents (reuse from helpers) */
.jnl-r--great { color: var(--accent-green); font-weight: 700; }
.jnl-r--good  { color: var(--accent-green); }
.jnl-r--meh   { color: var(--text-muted); }
.jnl-r--bad   { color: var(--accent-red); }
.jnl-r--awful { color: var(--accent-red); font-weight: 700; }

/* JournalStrategy — Tab 4: Strategy & Tools */

.js { display: flex; flex-direction: column; gap: 1rem; }

/* ── Sub-tab bar ── */
.js__subtabs {
  display: flex;
  gap: 0.25rem;
  padding: 4px;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.js__subtab {
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.js__subtab:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.03); }
.js__subtab--active {
  background: var(--accent-teal);
  color: var(--surface-base);
  font-weight: 700;
}

.js__content { display: flex; flex-direction: column; gap: 1rem; }

/* ── Panel ── */
.js__panel { display: flex; flex-direction: column; gap: 0.75rem; }

/* ── KPI strip ── */
.js__kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.65rem;
}

/* ── Filter row ── */
.js__filter-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

/* ── Actions row ── */
.js__actions-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* ── Meta text ── */
.js__meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ── Table card ── */
.js__table-card {
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
}

.js__title {
  margin: 0 0 0.5rem;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* ── Table ── */
.js__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  white-space: nowrap;
}

.js__table thead th {
  padding: 0.5rem 0.6rem;
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.js__table tbody tr:not(:last-child) td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.js__table td {
  padding: 0.4rem 0.6rem;
  color: var(--text-secondary);
}

.js__mono { font-family: var(--font-mono); }

/* ── Two-col ── */
.js__two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 800px) { .js__two-col { grid-template-columns: 1fr; } }

/* ── Form grid ── */
.js__form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
}
.js__form-full { grid-column: 1 / -1; }

/* ── Archetype badge ── */
.js__arch {
  display: inline-block;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.js__arch--ar00   { background: rgba(0, 200, 175, 0.15); color: var(--accent-teal); }
.js__arch--ar50   { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.js__arch--ar30   { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.js__arch--id50   { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.js__arch--mw     { background: rgba(89, 156, 255, 0.15); color: var(--accent-blue); }
.js__arch--hb     { background: rgba(255, 193, 7, 0.15); color: var(--accent-amber); }
.js__arch--rrt    { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.js__arch--nyc    { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }

/* Direction */
.js__dir--long  { color: var(--accent-green); font-weight: 600; }
.js__dir--short { color: var(--accent-red); font-weight: 600; }

/* Result */
.js__result { font-weight: 600; }
.js__result--win  { color: var(--accent-green); }
.js__result--loss { color: var(--accent-red); }
.js__text-profit  { color: var(--accent-green); }
.js__text-loss    { color: var(--accent-red); }

/* ── ML Status ── */
.js__ml-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.js__ml-actions {
  display: flex;
  gap: 0.5rem;
}

/* ── Recommendations ── */
.js__recs { display: flex; flex-direction: column; gap: 0.5rem; }
.js__rec {
  padding: 0.75rem;
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  border-left: 3px solid var(--accent-teal);
}
.js__rec-title { font-weight: 700; font-size: var(--text-sm); color: var(--text-primary); margin-bottom: 0.25rem; }
.js__rec-body { font-size: var(--text-sm); color: var(--text-secondary); }

/* ── Library grid ── */
.js__lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.js__lib-card {
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.js__lib-card-head { display: flex; align-items: center; justify-content: space-between; }
.js__lib-card-name { font-weight: 700; font-size: var(--text-sm); color: var(--text-primary); }
.js__lib-card-mono { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }
.js__lib-card-desc { font-size: var(--text-sm); color: var(--text-secondary); }
.js__lib-card-pairs { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.js__lib-card-actions { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.25rem; }

/* ── Docs list ── */
.js__docs-list { display: flex; flex-direction: column; gap: 0.35rem; }
.js__doc-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
}
.js__doc-name { flex: 1; font-weight: 600; font-size: var(--text-sm); color: var(--text-primary); }

.js__field-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

/* ── Delete button ── */
.js__delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.3;
  font-size: 0.85rem;
  transition: opacity 0.15s;
  padding: 4px;
}
.js__delete-btn:hover { opacity: 1; }

/* ── Backtest grid ── */
.js__backtest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 800px) { .js__backtest-grid { grid-template-columns: 1fr; } }

/* ─── Journal v3 — shared layout ──────────────────────────────────────── */

.jnl {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-5);
  min-height: 100%;
  background:
    radial-gradient(circle at 10% 0%, rgba(14, 165, 161, 0.09), transparent 35%),
    radial-gradient(circle at 90% 18%, rgba(59, 130, 246, 0.08), transparent 34%);
}

/* ─── Tab Bar ─────────────────────────────────────────────────────────── */

.jnl-tabs {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  scrollbar-width: thin;
  border-bottom: 1px solid var(--color-border-default);
  padding-bottom: 0;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: 0;
  z-index: 3;
  background: color-mix(in srgb, var(--color-bg-base) 90%, transparent);
  backdrop-filter: blur(8px);
}

.jnl-tabs::-webkit-scrollbar { height: 3px; }
.jnl-tabs::-webkit-scrollbar-thumb {
  background: var(--color-border-subtle);
  border-radius: var(--radius-pill);
}

.jnl-tab {
  flex-shrink: 0;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--color-text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--duration-fast) var(--easing-default),
              border-color var(--duration-fast) var(--easing-default);
}

.jnl-tab:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-hover);
}

.jnl-tab:focus-visible {
  outline: 2px solid var(--color-accent-teal);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

.jnl-tab--active {
  color: var(--color-accent-primary);
  border-bottom-color: var(--color-accent-primary);
  font-weight: var(--fw-semi, 600);
}

/* ─── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .jnl {
    padding: var(--space-3);
    gap: var(--space-4);
  }

  .jnl-tab {
    padding: var(--space-2) var(--space-2);
    font-size: var(--text-xs);
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
 * AutoTrader view — styles
 * Professional trading terminal layout with design-token CSS variables.
 * Bloomberg Terminal 2.0 redesign — updated tokens, radii, shadows.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* ── Root layout ──────────────────────────────────────────────────────────── */

.at {
  display: flex;
  flex-direction: column;
  gap: var(--space-5, 1.25rem);
}

.at-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

/* ── EA Waiting state ─────────────────────────────────────────────────────── */

.at__waiting-header {
  font-weight: 700;
}

.at__waiting-body {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-text-secondary, #94A3B8);
}

.at__waiting-title {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.at__waiting-detail {
  font-size: 0.85rem;
  opacity: 0.7;
  line-height: 1.6;
}

/* ── Utility classes ──────────────────────────────────────────────────────── */

.at__mono {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-weight: var(--fw-semi, 600);
}

.at__text-xs {
  font-size: var(--text-xs, 0.75rem);
}

/* ═══════════════════════════════════════════════════════════════════════════
 * Row 0: Alert Banners
 * ═══════════════════════════════════════════════════════════════════════════ */

.at__firestore-banner {
  background: #78350f;
  color: #fde68a;
  border-left: 4px solid #f59e0b;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-md, 12px);
  font-size: var(--text-sm, 0.875rem);
  line-height: 1.5;
}

.at__firestore-banner strong {
  color: #fef3c7;
}

.at__regime-banner {
  background: var(--color-loss-muted, rgba(220, 38, 38, 0.12));
  color: #fca5a5;
  border-left: 4px solid var(--color-loss, #dc2626);
  padding: 0.625rem 1rem;
  border-radius: var(--radius-md, 12px);
  font-size: var(--text-sm, 0.875rem);
  line-height: 1.5;
}

.at__regime-banner strong {
  color: #fee2e2;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * Row 1: Hero KPI Bar (8 cards)
 * ═══════════════════════════════════════════════════════════════════════════ */

.at__kpi {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: var(--space-3, 0.75rem);
}

@media (max-width: 1400px) {
  .at__kpi {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .at__kpi {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .at__kpi {
    grid-template-columns: 1fr;
  }
}

/* Deprecated wrapper for drawdown card; bar is now inside KPI card.
   kept for backward compatibility if referenced elsewhere but flex is removed. */
.at__kpi-gauge-card {
  position: relative;
}
.at__kpi-gauge-card > * {
  /* nothing special any more */
}

.at__kpi-bar {
  /* when placed inside a KPI card we want a little space from the value */
  margin-top: 4px;
  width: 100%;
  border-radius: 0 0 var(--radius-md, 12px) var(--radius-md, 12px);
}

/* Pulsing progress bar when drawdown is approaching the limit */
@keyframes at-bar-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}
.at__kpi-bar--pulse {
  animation: at-bar-pulse 1.4s ease-in-out infinite;
}

/* Drawdown card subtitle: bar + limit label stacked */
.at__kpi-drawdown-sub {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

/* Win-rate mini bar container */
.at__kpi-winrate-bar {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

/* Small label below a KPI progress bar */
.at__kpi-limit-label {
  font-size: 0.65rem;
  color: var(--color-text-muted, #64748b);
  text-align: right;
}

/* Currency sub-text in Balance card */
.at__kpi-currency {
  font-size: 0.65rem;
  color: var(--color-text-muted, #64748b);
  font-style: italic;
}

/* Equity delta: +/- indicator below equity value */
.at__equity-delta {
  font-size: 0.72rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-weight: 600;
}

/* Animated counter: smooth font-variant-numeric for number transitions */
.at__counter {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
  display: inline-block;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * Row 2: System Status Strip
 * ═══════════════════════════════════════════════════════════════════════════ */

.at__strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3, 0.75rem);
}

@media (max-width: 768px) {
  .at__strip {
    grid-template-columns: 1fr;
  }
}

.at__strip-tile {
  background: var(--color-bg-surface, #111827);
  border: 1px solid var(--color-border-default, rgba(71, 85, 105, 0.18));
  border-radius: var(--radius-md, 12px);
  padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 0.5rem);
  box-shadow: var(--card-shadow);
}

.at__strip-tile--clickable {
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.at__strip-tile--clickable:hover {
  border-color: var(--color-accent-primary, #3b82f6);
}

.at__strip-tile-head {
  display: flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
}

.at__strip-tile-label {
  font-size: var(--text-xs, 0.75rem);
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.at__strip-tile-value {
  font-size: var(--text-sm, 0.875rem);
  font-weight: 700;
  color: var(--color-text-primary, #f8fafc);
}

.at__strip-tile-row {
  display: flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
}

.at__strip-tile-sub {
  font-size: var(--text-xs, 0.75rem);
  color: var(--color-text-muted, #64748b);
}

.at__strip-progress {
  margin-top: var(--space-1, 0.25rem);
}

/* Sparkline */
.at__sparkline {
  width: 60px;
  height: 20px;
  flex-shrink: 0;
}

/* Gate sub-checks */
.at__gate-checks {
  display: flex;
  flex-direction: column;
  gap: var(--space-1, 0.25rem);
  padding-top: var(--space-2, 0.5rem);
  border-top: 1px solid var(--color-border-subtle, rgba(71, 85, 105, 0.12));
  margin-top: var(--space-2, 0.5rem);
}

.at__gate-check-row {
  display: flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  font-size: var(--text-xs, 0.75rem);
  color: var(--color-text-secondary, #94a3b8);
}

.at__gate-check-name {
  text-transform: capitalize;
}

.at__dot-sm {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.at__gate-reasons {
  padding-top: var(--space-1, 0.25rem);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.at__gate-reason-text {
  font-size: 11px;
  color: var(--color-loss, #dc2626);
  padding-left: var(--space-4, 1rem);
}

/* ═══════════════════════════════════════════════════════════════════════════
 * Row 3: Controls (2/3 + 1/3)
 * ═══════════════════════════════════════════════════════════════════════════ */

.at__row {
  display: grid;
  gap: var(--space-4, 1rem);
}

.at__row--controls {
  grid-template-columns: 2fr 1fr;
}

@media (max-width: 900px) {
  .at__row--controls {
    grid-template-columns: 1fr;
  }
}

/* Auto-Trader Control */
.at__auto-toggle-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-6, 1.5rem);
}

.at__auto-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3, 0.75rem);
}

.at__auto-left {
  display: flex;
  align-items: center;
  gap: var(--space-5, 1.25rem);
}

.at__auto-hint {
  font-size: var(--text-xs, 0.75rem);
  color: var(--color-text-muted, #64748b);
}

.at__auto-stats {
  display: flex;
  gap: var(--space-6, 1.5rem);
  flex-wrap: wrap;
}

.at__auto-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.at__auto-stat-label {
  font-size: 10px;
  color: var(--color-text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: var(--fw-semi, 600);
}

.at__auto-stat-value {
  font-size: var(--text-xl, 1.25rem);
  font-weight: 700;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  color: var(--color-text-primary, #f8fafc);
}

.at__auto-stat-value--sm {
  font-size: var(--text-sm, 0.875rem);
  margin-top: 4px;
}

.at__auto-stat-value--warn {
  color: var(--color-warning, #d97706);
}

/* Conviction Weight Bars */


.at__weight-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.at__weight-pct {
  font-size: 11px;
  color: var(--color-text-secondary, #94a3b8);
  text-align: right;
}

/* Combined Emergency + MT5 card */
.at__emergency-card {
  display: flex;
  flex-direction: column;
}

.at__emergency-btn {
  width: 100%;
  padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
  border: 2px solid var(--color-loss, #dc2626);
  border-radius: var(--radius-md, 12px);
  background: var(--color-loss-muted, rgba(220, 38, 38, 0.12));
  color: var(--color-loss, #dc2626);
  font-size: var(--text-base, 1rem);
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: at-pulse-border 2s ease-in-out infinite;
}

.at__emergency-btn:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.3);
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.4);
  transform: scale(1.02);
}

.at__emergency-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.at__emergency-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  animation: none;
}

@keyframes at-pulse-border {
  0%, 100% {
    border-color: var(--color-loss, #dc2626);
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.2);
  }
  50% {
    border-color: rgba(220, 38, 38, 0.6);
    box-shadow: 0 0 16px rgba(220, 38, 38, 0.4);
  }
}

/* Compact connection status */
.at__conn-compact {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 0.5rem);
  padding-bottom: var(--space-3, 0.75rem);
  margin-bottom: var(--space-3, 0.75rem);
  border-bottom: 1px solid var(--color-border-subtle, rgba(71, 85, 105, 0.12));
}

.at__conn-compact-status {
  display: flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  font-size: var(--text-sm, 0.875rem);
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-primary, #f8fafc);
}

.at__pill-row--compact {
  gap: var(--space-1, 0.25rem);
}

.at__pill-row--compact .at__pill {
  font-size: 11px;
  padding: 2px var(--space-2, 0.5rem);
}

.at__disconnect-btn {
  align-self: flex-start;
}

/* Status dots (shared) */
.at__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.at__dot--green {
  background: var(--color-profit, #059669);
  box-shadow: 0 0 6px var(--color-profit, #059669);
}

.at__dot--red {
  background: var(--color-loss, #dc2626);
  box-shadow: 0 0 6px var(--color-loss, #dc2626);
}

.at__pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2, 0.5rem);
}

.at__pill {
  padding: var(--space-1, 0.25rem) var(--space-3, 0.75rem);
  border-radius: var(--radius-pill, 999px);
  background: var(--color-bg-elevated, #0f1623);
  color: var(--color-text-secondary, #94a3b8);
  font-size: var(--text-xs, 0.75rem);
  font-weight: var(--fw-medium, 500);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * Row 4: Active Trade Cards
 * ═══════════════════════════════════════════════════════════════════════════ */

.at__trade-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 0.75rem);
  /* Cap height so many open trades don't push the rest of the page off-screen */
  max-height: 600px;
  overflow-y: auto;
  padding-right: 2px; /* prevent scrollbar from clipping card box-shadows */
}

.at__trade-card {
  background: var(--color-bg-elevated, #0f1623);
  border: 1px solid var(--color-border-default, rgba(71, 85, 105, 0.18));
  border-radius: var(--radius-md, 12px);
  padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 0.75rem);
  transition: border-color 0.15s ease;
  box-shadow: var(--card-shadow);
}

.at__trade-card:hover {
  border-color: var(--color-accent-teal, #0ea5a1);
}

.at__trade-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2, 0.5rem);
}

.at__trade-card-left {
  display: flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
}

.at__trade-card-right {
  display: flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
}

.at__trade-symbol {
  font-size: var(--text-base, 1rem);
  font-weight: 700;
  color: var(--color-text-primary, #f8fafc);
}

.at__conviction-badge {
  font-size: 11px;
  font-weight: var(--fw-semi, 600);
  color: var(--color-accent-primary, #3b82f6);
  background: rgba(59, 130, 246, 0.12);
  padding: 2px var(--space-2, 0.5rem);
  border-radius: var(--radius-pill, 999px);
}

.at__trade-card-body {
  display: flex;
  align-items: center;
  gap: var(--space-5, 1.25rem);
  flex-wrap: wrap;
}

.at__trade-prices {
  display: flex;
  gap: var(--space-4, 1rem);
  flex-wrap: wrap;
}

.at__trade-price-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.at__trade-price-label {
  font-size: 10px;
  color: var(--color-text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--fw-semi, 600);
}

.at__trade-price-cell .at__mono {
  font-size: var(--text-sm, 0.875rem);
}

.at__trade-metrics {
  display: flex;
  align-items: center;
  gap: var(--space-3, 0.75rem);
  margin-left: auto;
}

.at__trade-pips {
  font-size: var(--text-sm, 0.875rem);
  font-family: var(--font-mono, monospace);
  font-weight: var(--fw-semi, 600);
}

.at__trade-r {
  font-size: var(--text-sm, 0.875rem);
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  padding: 2px var(--space-2, 0.5rem);
  border-radius: var(--radius-sm, 8px);
  background: var(--color-bg-surface, #111827);
}

/* Multi-leg dots */
.at__trade-legs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.at__leg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--color-text-muted, #64748b);
  background: transparent;
}

.at__leg-dot--filled {
  background: var(--color-accent-primary, #3b82f6);
  border-color: var(--color-accent-primary, #3b82f6);
}

/* Management advisory */
.at__trade-advisory {
  font-size: var(--text-xs, 0.75rem);
  font-weight: var(--fw-semi, 600);
  color: var(--color-warning, #d97706);
  background: var(--color-warning-muted, rgba(217, 119, 6, 0.12));
  padding: var(--space-1, 0.25rem) var(--space-3, 0.75rem);
  border-radius: var(--radius-sm, 8px);
  align-self: flex-start;
}

.at__trade-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2, 0.5rem);
  border-top: 1px solid var(--color-border-subtle, rgba(71, 85, 105, 0.12));
}

/* ═══════════════════════════════════════════════════════════════════════════
 * Row 5: Performance + Gating (2/3 + 1/3)
 * ═══════════════════════════════════════════════════════════════════════════ */

.at__row--perf {
  grid-template-columns: 2fr 1fr;
}

@media (max-width: 900px) {
  .at__row--perf {
    grid-template-columns: 1fr;
  }
}

/* Performance Summary */
.at__perf {
  display: flex;
  flex-direction: column;
  gap: var(--space-5, 1.25rem);
}

.at__perf-stats {
  display: grid;
  /* allow the number of columns to grow/shrink with available space
     minimum 120px per card, otherwise share equally */
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3, 0.75rem);
}

@media (max-width: 600px) {
  .at__perf-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.at__perf-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-3, 0.75rem);
  background: var(--color-bg-elevated, #0f1623);
  border-radius: var(--radius-sm, 8px);
  box-shadow: var(--card-shadow);
}

.at__perf-stat-label {
  font-size: 10px;
  color: var(--color-text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: var(--fw-semi, 600);
}

.at__perf-stat-value {
  font-size: var(--text-lg, 1.125rem);
  font-weight: 700;
  color: var(--color-text-primary, #f8fafc);
}

/* R-Multiple Distribution */
.at__r-dist {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 0.5rem);
}

.at__r-dist-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 0.5rem);
}

.at__r-dist-row {
  display: grid;
  grid-template-columns: 90px 1fr 36px;
  align-items: center;
  gap: var(--space-2, 0.5rem);
}

.at__r-dist-label {
  font-size: var(--text-xs, 0.75rem);
  color: var(--color-text-secondary, #94a3b8);
  text-transform: capitalize;
  font-weight: var(--fw-medium, 500);
}

.at__r-dist-track {
  height: 12px;
  background: var(--color-bg-elevated, #0f1623);
  border-radius: 6px;
  overflow: hidden;
}

.at__r-dist-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.3s ease;
  min-width: 2px;
}

.at__r-dist-count {
  font-size: 11px;
  color: var(--color-text-muted, #64748b);
  text-align: right;
}

/* Archetype Leaderboard */
.at__archetypes {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 0.5rem);
}

.at__archetype-row {
  display: grid;
  grid-template-columns: 1fr 80px 80px;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  padding: var(--space-1, 0.25rem) 0;
}

.at__archetype-name {
  font-size: var(--text-xs, 0.75rem);
  color: var(--color-text-primary, #f8fafc);
  font-weight: var(--fw-medium, 500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.at__archetype-bar {
  flex-shrink: 0;
}

.at__archetype-stat {
  font-size: 11px;
  color: var(--color-text-muted, #64748b);
  text-align: right;
  white-space: nowrap;
}

/* Gating + Shortlist Card */
.at__gating-shortlist {
  display: flex;
  flex-direction: column;
  gap: var(--space-5, 1.25rem);
}

.at__gating {
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 0.75rem);
}

.at__gating-summary {
  display: flex;
  align-items: center;
  gap: var(--space-3, 0.75rem);
}

.at__gating-count {
  font-family: var(--font-mono, monospace);
  font-size: var(--text-2xl, 1.5rem);
  font-weight: 700;
  color: var(--color-text-primary, #f8fafc);
}

.at__gating-label {
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text-muted, #64748b);
}

.at__sub-heading {
  font-size: var(--text-sm, 0.875rem);
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-secondary, #94a3b8);
  margin: 0 0 var(--space-2, 0.5rem) 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.at__gating-breakdown {
  padding-top: var(--space-2, 0.5rem);
  border-top: 1px solid var(--color-border-subtle, rgba(71, 85, 105, 0.12));
}

.at__gating-reasons {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 0.5rem);
}

.at__gating-reason {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
  background: var(--color-bg-elevated, #0f1623);
  border-radius: var(--radius-sm, 8px);
}

.at__gating-reason-name {
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text-primary, #f8fafc);
}

.at__gating-cycles {
  padding-top: var(--space-2, 0.5rem);
  border-top: 1px solid var(--color-border-subtle, rgba(71, 85, 105, 0.12));
}

.at__chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2, 0.5rem);
}

.at__cycle-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
  background: var(--color-bg-elevated, #0f1623);
  border-radius: var(--radius-md, 12px);
  font-size: var(--text-sm, 0.875rem);
}

.at__cycle-chip strong {
  color: var(--color-text-primary, #f8fafc);
  font-family: var(--font-mono, monospace);
}

/* Weekly Shortlist */
.at__shortlist {
  padding-top: var(--space-3, 0.75rem);
  border-top: 1px solid var(--color-border-subtle, rgba(71, 85, 105, 0.12));
}

.at__shortlist-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 0.5rem);
}

.at__shortlist-item {
  display: flex;
  align-items: center;
  gap: var(--space-3, 0.75rem);
  padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
  background: var(--color-bg-elevated, #0f1623);
  border-radius: var(--radius-sm, 8px);
}

.at__shortlist-rank {
  font-size: var(--text-xs, 0.75rem);
  font-weight: 700;
  color: var(--color-accent-primary, #3b82f6);
  min-width: 20px;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * Row 6: Config + Calculator (1/2 + 1/2)
 * ═══════════════════════════════════════════════════════════════════════════ */

.at__row--config {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 900px) {
  .at__row--config {
    grid-template-columns: 1fr;
  }
}

.at__config {
  display: flex;
  flex-direction: column;
  gap: var(--space-5, 1.25rem);
}

.at__config-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3, 0.75rem);
}

@media (max-width: 600px) {
  .at__config-grid {
    grid-template-columns: 1fr;
  }
}

/* Sliders */
.at__slider-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1, 0.25rem);
}

.at__slider-label {
  font-size: var(--text-sm, 0.875rem);
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-secondary, #94a3b8);
}

.at__slider-label strong {
  color: var(--color-accent-primary, #3b82f6);
}

.at__range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--color-bg-elevated, #0f1623);
  outline: none;
  cursor: pointer;
}

.at__range:focus-visible {
  outline: 2px solid var(--color-accent-teal, #0ea5a1);
  outline-offset: 2px;
}

.at__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-accent-primary, #3b82f6);
  cursor: pointer;
  border: 2px solid var(--color-bg-surface, #111827);
  box-shadow: 0 0 4px rgba(59, 130, 246, 0.4);
}

.at__range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-accent-primary, #3b82f6);
  cursor: pointer;
  border: 2px solid var(--color-bg-surface, #111827);
  box-shadow: 0 0 4px rgba(59, 130, 246, 0.4);
}

.at__range-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs, 0.75rem);
  color: var(--color-text-muted, #64748b);
}

/* Radio */
.at__radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 0.5rem);
}

.at__radio-label {
  font-size: var(--text-sm, 0.875rem);
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-secondary, #94a3b8);
}

.at__radio-row {
  display: flex;
  gap: var(--space-4, 1rem);
  flex-wrap: wrap;
}

.at__radio-item {
  display: flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  cursor: pointer;
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text-primary, #f8fafc);
}

.at__radio-item input[type='radio'] {
  accent-color: var(--color-accent-primary, #3b82f6);
  width: 16px;
  height: 16px;
  margin: 0;
}

/* Chip sections */
.at__chip-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 0.5rem);
}

.at__chip-label {
  font-size: var(--text-sm, 0.875rem);
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-secondary, #94a3b8);
}

.at__toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1, 0.25rem);
  padding: var(--space-1, 0.25rem) var(--space-3, 0.75rem);
  border: 1px solid var(--color-border-default, rgba(71, 85, 105, 0.18));
  border-radius: var(--radius-sm, 8px);
  background: var(--color-bg-elevated, #0f1623);
  color: var(--color-text-secondary, #94a3b8);
  font-size: var(--text-xs, 0.75rem);
  font-weight: var(--fw-medium, 500);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}

.at__toggle-chip:hover {
  border-color: var(--color-accent-primary, #3b82f6);
  color: var(--color-text-primary, #f8fafc);
}

.at__toggle-chip:focus-visible {
  outline: 2px solid var(--color-accent-teal, #0ea5a1);
  outline-offset: 2px;
}

.at__toggle-chip--active {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--color-accent-primary, #3b82f6);
  color: var(--color-accent-primary, #3b82f6);
  font-weight: var(--fw-semi, 600);
}

.at__chip-check {
  font-size: 10px;
  line-height: 1;
}

.at__config-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: var(--space-3, 0.75rem);
  border-top: 1px solid var(--color-border-subtle, rgba(71, 85, 105, 0.12));
}

/* ═══════════════════════════════════════════════════════════════════════════
 * Position Size Calculator
 * ═══════════════════════════════════════════════════════════════════════════ */

.at__calc {
  display: flex;
  flex-direction: column;
  gap: var(--space-4, 1rem);
}

.at__calc-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: var(--space-3, 0.75rem);
  align-items: flex-end;
}

@media (max-width: 768px) {
  .at__calc-inputs {
    grid-template-columns: 1fr;
  }
}

.at__calc-btn-wrap {
  padding-bottom: 2px;
}

/* manual trade form styles */
.at__manual-trade {
  display: flex;
  flex-direction: column;
  gap: var(--space-4, 1rem);
}
.at__manual-scan {
  margin-bottom: var(--space-2, 0.5rem);
}
.at__manual-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-3, 0.75rem);
}
.at__manual-actions {
  text-align: right;
}

/* zebra stripes in history table */
.at__history-table tbody tr:nth-child(odd) {
  background: var(--color-bg-surface, #111827);
}
.at__history-table tbody tr:nth-child(even) {
  background: var(--color-bg-elevated, #0f1623);
}

/* directional border indicators */
.at__trade-card--buy {
  border-left: 4px solid var(--color-profit, #059669);
}
.at__trade-card--sell {
  border-left: 4px solid var(--color-loss, #dc2626);
}

.at__calc-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4, 1rem);
}

@media (max-width: 600px) {
  .at__calc-results {
    grid-template-columns: 1fr;
  }
}

.at__calc-result-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1, 0.25rem);
  padding: var(--space-3, 0.75rem);
  background: var(--color-bg-elevated, #0f1623);
  border-radius: var(--radius-md, 12px);
  box-shadow: var(--card-shadow);
}

.at__calc-result-label {
  font-size: var(--text-xs, 0.75rem);
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.at__calc-result-value {
  font-size: var(--text-xl, 1.25rem);
  font-weight: 700;
  color: var(--color-text-primary, #f8fafc);
}

.at__calc-result-sub {
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text-secondary, #94a3b8);
}

/* ═══════════════════════════════════════════════════════════════════════════
 * P&L Summary Row (shared)
 * ═══════════════════════════════════════════════════════════════════════════ */

.at__pl-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2, 0.5rem);
  padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
  margin-top: var(--space-2, 0.5rem);
  background: var(--color-bg-elevated, #0f1623);
  border-radius: var(--radius-sm, 8px);
  font-size: var(--text-sm, 0.875rem);
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-secondary, #94a3b8);
}

.at__pl-summary .at__mono {
  font-size: var(--text-base, 1rem);
}

/* ── History footer: P&L + pagination on the same row ─────────────── */

.at__history-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
  margin-top: var(--space-2, 0.5rem);
  background: var(--color-bg-elevated, #0f1623);
  border-radius: var(--radius-sm, 8px);
}

.at__history-footer .at__pl-summary {
  padding: 0;
  margin: 0;
  background: transparent;
  border-radius: 0;
}

.at__pagination {
  display: flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
}

.at__page-btn {
  padding: 0.25rem 0.75rem;
  background: var(--color-bg-surface, #1a2236);
  border: 1px solid var(--color-border-default, #2d3748);
  border-radius: var(--radius-sm, 6px);
  color: var(--color-text-secondary, #94a3b8);
  font-size: var(--text-xs, 0.75rem);
  font-weight: var(--fw-semi, 600);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.at__page-btn:hover:not(:disabled) {
  background: var(--color-bg-elevated, #0f1623);
  color: var(--color-text-primary, #e2e8f0);
}

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

.at__page-info {
  font-size: var(--text-xs, 0.75rem);
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-muted, #64748b);
  min-width: 3.5rem;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * Trade History Header
 * ═══════════════════════════════════════════════════════════════════════════ */

.at__history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.at__day-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--color-border-default, rgba(71, 85, 105, 0.18));
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
}

.at__day-btn {
  padding: var(--space-1, 0.25rem) var(--space-3, 0.75rem);
  border: none;
  background: transparent;
  color: var(--color-text-secondary, #94a3b8);
  font-size: var(--text-xs, 0.75rem);
  font-weight: var(--fw-semi, 600);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
}

.at__day-btn:not(:last-child) {
  border-right: 1px solid var(--color-border-default, rgba(71, 85, 105, 0.18));
}

.at__day-btn:hover {
  background: var(--color-bg-elevated, #0f1623);
}

.at__day-btn:focus-visible {
  outline: 2px solid var(--color-accent-teal, #0ea5a1);
  outline-offset: -2px;
}

.at__day-btn--active {
  background: var(--color-accent-primary, #3b82f6);
  color: #fff;
}

.at__day-btn--active:hover {
  background: var(--color-accent-primary, #3b82f6);
}

.at__history-clear {
  margin-left: var(--space-3, 0.75rem);
  padding: var(--space-1, 0.25rem) var(--space-2, 0.5rem);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: var(--radius-md, 12px);
  background: transparent;
  color: var(--color-text-secondary, #94a3b8);
  font-size: var(--text-xs, 0.75rem);
  cursor: pointer;
  transition: all 0.15s ease;
}

.at__history-clear:hover {
  background: var(--color-bg-elevated, #0f1623);
}

.at__history-clear:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * Activity Log
 * ═══════════════════════════════════════════════════════════════════════════ */

.at__log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.at__log {
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--color-bg-base, #090d1a);
  border-radius: var(--radius-sm, 8px);
  /* make the log feel like a terminal by defaulting to monospace */
  font-family: var(--font-mono, monospace);
  font-size: var(--text-xs, 0.75rem);
}

.at__log-entry {
  display: flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
  background: var(--color-bg-surface, #111827);
}

/* always show the timestamp; remove the previous responsive rule that hid it */
/* if space is really tight the entry will wrap naturally */

/* Note: the media query below is no longer needed, but kept for
legacy in case other consumers rely on it. */
@media (max-width: 600px) {
  .at__log-entry {
    /* keep flex layout; allow wrapping */
    flex-wrap: wrap;
  }
  /* .at__log-ts { display: none; } */
}

.at__log-level {
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: var(--radius-sm, 8px);
  text-align: center;
}

.at__log-entry--info .at__log-level {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-accent-primary, #3b82f6);
}

.at__log-entry--warn .at__log-level {
  background: rgba(217, 119, 6, 0.15);
  color: var(--color-warning, #d97706);
}

.at__log-entry--error .at__log-level {
  background: var(--color-loss-muted, rgba(220, 38, 38, 0.12));
  color: var(--color-loss, #dc2626);
}

.at__log-ts {
  color: var(--color-text-muted, #64748b);
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
  min-width: 130px; /* give timestamp some breathing room */
  flex-shrink: 0;
}

.at__log-msg {
  color: var(--color-text-primary, #f8fafc);
  word-break: break-word;
}

.at__log-empty {
  padding: var(--space-6, 1.5rem);
  text-align: center;
  color: var(--color-text-muted, #64748b);
  font-size: var(--text-sm, 0.875rem);
}

/* Scrollbar */
.at__log::-webkit-scrollbar {
  width: 6px;
}

.at__log::-webkit-scrollbar-track {
  background: transparent;
}

.at__log::-webkit-scrollbar-thumb {
  background: var(--color-border-strong, rgba(71, 85, 105, 0.24));
  border-radius: 3px;
}

.at__log::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted, #64748b);
}

/* ═══════════════════════════════════════════════════════════════════════════
 * Modals
 * ═══════════════════════════════════════════════════════════════════════════ */

.at__modal-text {
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text-secondary, #94a3b8);
  line-height: 1.6;
  margin-bottom: var(--space-4, 1rem);
}

.at__modal-text--danger {
  color: var(--color-loss, #dc2626);
}

.at__modal-text--danger strong {
  color: #fff;
}

.at__modal-list {
  margin: 0.5rem 0 0 1.25rem;
  padding: 0;
  list-style: disc;
  color: var(--color-text-secondary, #94a3b8);
  font-size: var(--text-sm, 0.875rem);
  line-height: 1.7;
}

.at__modal-list li {
  margin-bottom: 0.25rem;
}

.at__modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3, 0.75rem);
}

/* ─── Pattern Library v3 ───────────────────────────────────────────────── */

.pl2 {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  color: var(--color-text-primary);
  position: relative;
}

/* ── Compact page header ───────────────────────────────────────────────── */
.pl2-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 56px;
}

.pl2-page-header__title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-text-primary);
}

.pl2-page-header__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.pl2-mobile-filter-button { display: none; }

/* ── Stat Cards (KpiCard grid) ─────────────────────────────────────────── */
.pl2-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-3);
}

/* ── Tab Bar ───────────────────────────────────────────────────────────── */
.pl2-tabs {
  display: inline-flex;
  gap: var(--space-2);
  padding: 4px;
  border: 1px solid var(--color-border-subtle);
  background: rgba(8, 15, 27, 0.72);
  border-radius: var(--radius-pill);
  width: fit-content;
}

.pl2-tab {
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-3);
  color: var(--color-text-secondary);
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

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

.pl2-tab--active {
  color: var(--color-text-primary);
  border-color: rgba(94, 234, 212, 0.4);
  background: rgba(9, 61, 60, 0.44);
}

.pl2-tab-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ── Actions Bar ───────────────────────────────────────────────────────── */
.pl2-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  border: 1px solid var(--color-border-subtle);
  background: rgba(9, 13, 26, 0.72);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  position: sticky;
  top: 12px;
  z-index: 2;
  backdrop-filter: blur(8px);
}

.pl2-actions-bar__left,
.pl2-actions-bar__right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.pl2-actions-bar__right {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.pl2-desktop-filters { display: block; }

/* ── Compact Filter Bar ────────────────────────────────────────────────── */
.pl2-filter-bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pl2-filter-bar__row {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(9, 13, 26, 0.84);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  height: 48px;
  padding: 0 12px;
  overflow: hidden;
}

.pl2-filter-bar__search {
  flex: 1 1 160px;
  min-width: 80px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
  padding: 0 var(--space-2);
}

.pl2-filter-bar__search::placeholder { color: var(--color-text-muted); }
.pl2-filter-bar__search::-webkit-search-cancel-button { -webkit-appearance: none; }

.pl2-filter-bar__divider {
  width: 1px;
  height: 20px;
  background: var(--color-border-subtle);
  flex-shrink: 0;
  margin: 0 4px;
}

.pl2-filter-bar__select {
  flex-shrink: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text-secondary);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  padding: 0 20px 0 8px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2710%27 height=%276%27 viewBox=%270 0 10 6%27%3E%3Cpath fill=%27%2364748b%27 d=%27M5 6L0 0h10z%27/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  min-width: 0;
}

.pl2-filter-bar__select:focus {
  outline: 2px solid rgba(14, 165, 161, 0.35);
  border-radius: 4px;
}

.pl2-filter-bar__select option {
  background: #0f1623;
  color: var(--color-text-primary);
}

.pl2-filter-bar__spacer { flex: 1 1 0; }

.pl2-filter-bar__clear {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0 var(--space-2);
  white-space: nowrap;
  transition: color 0.15s;
}

.pl2-filter-bar__clear:hover { color: var(--color-loss); }

.pl2-filter-bar__btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  margin-left: 4px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(15, 22, 35, 0.8);
  color: var(--color-text-secondary);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.pl2-filter-bar__btn:hover {
  border-color: rgba(94, 234, 212, 0.35);
  color: var(--color-text-primary);
}

.pl2-filter-bar__btn--active {
  border-color: rgba(94, 234, 212, 0.5);
  background: rgba(9, 61, 60, 0.5);
  color: var(--color-text-primary);
}

.pl2-filter-bar__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-accent-teal);
  color: #000;
  font-size: 11px;
  font-weight: 700;
}

/* Active filter chips */
.pl2-filter-bar__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.pl2-filter-bar__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid rgba(94, 234, 212, 0.3);
  background: rgba(9, 61, 60, 0.45);
  border-radius: var(--radius-pill);
  color: var(--color-text-primary);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.pl2-filter-bar__chip:hover { background: rgba(9, 61, 60, 0.72); }

.pl2-filter-bar__chip-remove {
  font-size: 14px;
  line-height: 1;
  color: var(--color-text-muted);
}

/* Advanced filter panel */
.pl2-filter-bar__advanced {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(9, 13, 26, 0.92), rgba(11, 18, 31, 0.94));
}

.pl2-filter-bar__adv-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3);
}

/* Panel mode (mobile drawer) */
.pl2-filters {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(9, 13, 26, 0.92), rgba(11, 18, 31, 0.94));
}

.pl2-filters--compact {
  padding: 0;
  border: none;
  background: transparent;
}

.pl2-filters__eyebrow,
.pl2-modal__mini-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.pl2-filters__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.pl2-filters__count {
  margin-top: var(--space-1);
  color: var(--color-text-secondary);
}

.pl2-filters__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-3);
}

.pl2-filters__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pl2-filters__label { color: var(--color-text-muted); }

.pl2-filters__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.pl2-filters__pair-add {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.pl2-filter-chip {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-3);
  background: rgba(15, 22, 35, 0.95);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.pl2-filter-chip:hover,
.pl2-filter-chip--active {
  border-color: rgba(94, 234, 212, 0.4);
  background: rgba(9, 61, 60, 0.6);
  color: var(--color-text-primary);
}

/* ── Grid Shell (patterns) ─────────────────────────────────────────────── */
.pl2-grid-shell {
  min-height: 560px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.95), rgba(9, 13, 26, 0.98));
  overflow: hidden;
}

.pl2-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--space-3);
  padding: var(--space-4);
  align-items: start;
  contain: layout paint;
}

.pl2-grid-cell {
  padding: 0;
  contain: layout paint;
}

/* ── Skeleton loading cards ────────────────────────────────────────────── */
.pl2-grid-loading {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--space-3);
  padding: var(--space-4);
}

.pl2-grid-loading__card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: rgba(15, 22, 35, 0.6);
}

.pl2-grid-loading__card-line { border-radius: var(--radius-sm); }
.pl2-grid-loading__card-hd { display: flex; justify-content: space-between; align-items: flex-start; }
.pl2-grid-loading__card-hd-left { display: flex; flex-direction: column; gap: 6px; }
.pl2-grid-loading__card-title { height: 18px; width: 80px; }
.pl2-grid-loading__card-sub { height: 12px; width: 52px; }
.pl2-grid-loading__card-badge { height: 20px; width: 72px; border-radius: var(--radius-pill); }
.pl2-grid-loading__card-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.pl2-grid-loading__card-metric { display: flex; flex-direction: column; gap: 4px; }
.pl2-grid-loading__card-lbl { height: 10px; width: 60%; }
.pl2-grid-loading__card-val { height: 13px; width: 85%; }
.pl2-grid-loading__card-tags { display: flex; gap: 6px; margin-top: 4px; }
.pl2-grid-loading__card-tag { height: 18px; width: 56px; border-radius: var(--radius-pill); }
.pl2-grid-loading__card-tag--sm { height: 18px; width: 48px; border-radius: var(--radius-pill); }
.pl2-grid-loading__card-ft { display: flex; justify-content: space-between; border-top: 1px solid rgba(255, 255, 255, 0.06); padding-top: 8px; margin-top: auto; }
.pl2-grid-loading__card-ft-l { height: 12px; width: 60px; }
.pl2-grid-loading__card-ft-r { height: 12px; width: 48px; }

/* ── Card ──────────────────────────────────────────────────────────────── */
.pl2-card {
  height: 100%;
}

.pl2 .card {
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.pl2 .card:hover {
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.pl2-grid .card--interactive:hover,
.pl2-grid .card--interactive:active {
  transform: none;
}

.pl2-card__shell {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  height: 100%;
  padding: var(--space-1);
}

/* Row 1 — Header */
.pl2-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.pl2-card__title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pl2-card__pair {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1;
}

.pl2-card__direction {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  width: fit-content;
}

.pl2-card__direction--long {
  background: rgba(5, 150, 105, 0.14);
  color: var(--color-profit);
  border: 1px solid rgba(5, 150, 105, 0.28);
}

.pl2-card__direction--short {
  background: rgba(220, 38, 38, 0.12);
  color: var(--color-loss);
  border: 1px solid rgba(220, 38, 38, 0.24);
}

.pl2-card__pattern-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Row 2 — Metrics strip */
.pl2-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 14px;
}

.pl2-card__metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.pl2-card__metric-label {
  font-size: 10px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl2-card__metric-value {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-primary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pl2-card__metric-value--profit   { color: var(--color-profit); }
.pl2-card__metric-value--loss     { color: var(--color-loss); }
.pl2-card__metric-value--warning  { color: var(--color-warning); }
.pl2-card__metric-value--muted    { color: var(--color-text-secondary); }
.pl2-card__metric-value--conf-high { color: var(--color-profit); }
.pl2-card__metric-value--conf-med  { color: var(--color-warning); }
.pl2-card__metric-value--conf-low  { color: var(--color-loss); }

/* R-multiple next to StatusPill */
.pl2-card__r {
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.pl2-card__r--pos { color: var(--color-profit); }
.pl2-card__r--neg { color: var(--color-loss); }

/* Row 4 — Tags */
.pl2-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-top: auto;
}

.pl2-card__tag {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-subtle);
  font-size: 11px;
  color: var(--color-text-secondary);
  background: rgba(15, 22, 35, 0.5);
  white-space: nowrap;
}

.pl2-card__tag--session-asian  { border-color: rgba(167, 139, 250, 0.35); color: #c4b5fd; }
.pl2-card__tag--session-london { border-color: rgba(56, 189, 248, 0.35);  color: #7dd3fc; }
.pl2-card__tag--session-nyc    { border-color: rgba(52, 211, 153, 0.35);  color: #6ee7b7; }

/* Row 5 — Footer */
.pl2-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border-subtle);
  margin-top: auto;
}

.pl2-card__status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--color-text-secondary);
}

.pl2-card__timestamp {
  font-size: 11px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* Status dot */
.pl2-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.7);
}

.pl2-status-dot--live {
  background: var(--color-accent-teal);
  box-shadow: 0 0 0 6px rgba(14, 165, 161, 0.12);
}

/* ── Archetype Edge ────────────────────────────────────────────────────── */
.pl2-edge {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(9, 13, 26, 0.9), rgba(11, 18, 31, 0.94));
  padding: var(--space-4);
}

.pl2-edge__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.pl2-edge__title {
  margin: var(--space-1) 0 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.pl2-edge__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.pl2-edge__card {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: rgba(7, 19, 27, 0.72);
  color: var(--color-text-primary);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.pl2-edge__card:hover {
  border-color: rgba(94, 234, 212, 0.42);
}

.pl2-edge__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.pl2-edge__row--stat { color: var(--color-text-secondary); }
.pl2-edge__meta { font-size: 12px; color: var(--color-text-muted); }
.pl2-edge__empty { grid-column: 1 / -1; }

/* ── Modal ─────────────────────────────────────────────────────────────── */
.pl2-modal {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.pl2-modal__chart-card {
  min-height: 360px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(5, 12, 22, 0.96), rgba(10, 23, 33, 0.92));
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
}

.pl2-modal__chart-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pl2-modal__chart-loading,
.pl2-modal__empty {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
}

.pl2-modal__info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.pl2-modal__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.pl2-modal__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.pl2-modal__section,
.pl2-modal__backtest {
  border-radius: var(--radius-lg);
}

.pl2-modal__backtest-line {
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.pl2-modal__table {
  display: grid;
  gap: var(--space-2);
}

.pl2-modal__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.pl2-modal__row span { color: var(--color-text-muted); }
.pl2-modal__row strong { color: var(--color-text-primary); text-align: right; }

.pl2-modal__similar-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.pl2-modal__similar-body {
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.pl2-modal__masonry {
  display: flex;
  margin-left: calc(var(--space-3) * -1);
  width: auto;
}

.pl2-modal__masonry-col {
  padding-left: var(--space-3);
  background-clip: padding-box;
}

.pl2-modal__similar-card {
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: rgba(7, 19, 27, 0.75);
}

.pl2-modal__hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.pl2-modal__hero-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 260px;
}

.pl2-modal__grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: var(--space-4);
}

/* Diagram classes (for PatternModal SVG overlays) */
.pl2-modal__diagram-label { color: var(--color-text-muted); }
.pl2-modal__diagram-svg { width: 100%; display: block; }
.pl2-modal__diagram-grid { stroke: rgba(100, 116, 139, 0.24); stroke-width: 1; }
.pl2-modal__diagram-path { fill: none; stroke: #5eead4; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pl2-modal__diagram-box { fill: rgba(14, 165, 161, 0.08); stroke: rgba(94, 234, 212, 0.5); stroke-width: 2; }

/* ── Mobile Drawer ─────────────────────────────────────────────────────── */
.pl2-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 850;
  background: rgba(2, 6, 23, 0.68);
  display: none;
  justify-content: flex-start;
}

.pl2-drawer {
  width: min(92vw, 420px);
  height: 100%;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(8, 15, 27, 0.98), rgba(9, 13, 26, 0.98));
  border-right: 1px solid var(--color-border-subtle);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .pl2-stats,
  .pl2-filters__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .pl2-modal__hero,
  .pl2-modal__grid {
    flex-direction: column;
  }
}

@media (max-width: 900px) {
  .pl2-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pl2-actions-bar { position: static; }

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

@media (max-width: 760px) {
  .pl2-mobile-filter-button,
  .pl2-drawer-backdrop {
    display: flex;
  }

  .pl2-desktop-filters { display: none; }

  .pl2-stats,
  .pl2-filters__grid {
    grid-template-columns: 1fr;
  }

  .pl2-edge { padding: var(--space-3); }
  .pl2-edge__grid { grid-template-columns: 1fr; }

  .pl2-actions-bar,
  .pl2-actions-bar__left,
  .pl2-actions-bar__right {
    flex-direction: column;
    align-items: stretch;
  }

  .pl2-actions-bar__right { justify-content: flex-start; }
  .pl2-page-header__title { font-size: 20px; }
}

.cf-dash {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Header ─────────────────────────────────────────── */

.cf-dash__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.cf-dash__header h1 {
  margin: 0;
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  letter-spacing: 0.01em;
}

.cf-dash__header p {
  margin: 0.35rem 0 0;
  color: var(--text-secondary);
}

.cf-dash__controls {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.cf-dash__controls .select {
  min-width: 130px;
}

/* ── KPI Cards ──────────────────────────────────────── */

.cf-dash__kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.cf-dash__kpi .card__header {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cf-dash__kpi-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.cf-dash__kpi-value--success { color: #22c55e; }
.cf-dash__kpi-value--warning { color: #facc15; }
.cf-dash__kpi-value--danger  { color: #ef4444; }

.cf-dash__kpi-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ── Weak Gates Alert ───────────────────────────────── */

.cf-dash__alert {
  border-left: 3px solid #ef4444;
}

.cf-dash__alert-title {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.cf-dash__alert-desc {
  margin: 0 0 0.6rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.cf-dash__alert-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cf-dash__alert-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
}

.cf-dash__alert-count {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ── Tabs ───────────────────────────────────────────── */

.cf-dash__tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.cf-dash__tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.55rem 1rem;
  cursor: pointer;
  font-size: 0.88rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.cf-dash__tab:hover {
  color: var(--text-primary);
}

.cf-dash__tab--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Tables ─────────────────────────────────────────── */

.cf-dash__table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cf-dash__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.cf-dash__table th {
  text-align: left;
  padding: 0.55rem 0.6rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.cf-dash__table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.cf-dash__table tbody tr:hover {
  background: rgba(56, 189, 248, 0.04);
}

.cf-dash__veto-cell {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cf-dash__time-cell {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

/* ── Records table ──────────────────────────────────── */

.cf-dash__records h3 {
  margin: 0 0 0.6rem;
}

.cf-dash__won {
  color: #22c55e;
  font-weight: 700;
  font-size: 1.05rem;
}

.cf-dash__lost {
  color: #ef4444;
  font-weight: 700;
  font-size: 1.05rem;
}

/* ── State / empty ──────────────────────────────────── */

.cf-dash__state-card {
  min-height: 160px;
}

.cf-dash__empty-note {
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 0.5rem 0;
}

/* ── Verdict note ───────────────────────────────────── */

.cf-dash__verdict-note {
  opacity: 0.85;
}

.cf-dash__verdict-text {
  margin: 0 0 0.4rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.45;
}

.cf-dash__verdict-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 1100px) {
  .cf-dash__kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .cf-dash__controls {
    width: 100%;
  }

  .cf-dash__controls .select {
    flex: 1;
    min-width: 0;
  }

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

  .cf-dash__tabs {
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  .cf-dash__kpis {
    grid-template-columns: 1fr;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Settings — stg- prefixed styles
   ═══════════════════════════════════════════════════════════════════════════ */

.stg {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 720px;
}

/* ── Loading ─────────────────────────────────────────────────────────────── */

.stg-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

/* ── Section Title ───────────────────────────────────────────────────────── */

.stg-section-title {
  font-size: var(--text-base);
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-primary);
}

/* ── Grid Layouts ────────────────────────────────────────────────────────── */

.stg-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.stg-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 560px) {
  .stg-grid-2,
  .stg-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ── Generic Field ───────────────────────────────────────────────────────── */

.stg-field {
  margin-bottom: var(--space-4);
}

.stg-field__label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--fw-medium, 500);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

/* ── Toggle Row ──────────────────────────────────────────────────────────── */

.stg-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--color-text-primary);
}

/* ── Radio Group ─────────────────────────────────────────────────────────── */

.stg-radio-group {
  display: flex;
  gap: var(--space-2);
}

.stg-radio {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  -webkit-user-select: none;
  user-select: none;
}

.stg-radio input {
  display: none;
}

.stg-radio:hover {
  border-color: var(--color-accent-primary);
  color: var(--color-text-primary);
}

.stg-radio--active {
  border-color: var(--color-accent-primary);
  background: color-mix(in srgb, var(--color-accent-primary) 12%, transparent);
  color: var(--color-accent-primary);
  font-weight: var(--fw-semi, 600);
}

/* ── Checkbox Group ──────────────────────────────────────────────────────── */

.stg-checkbox-group {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.stg-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  -webkit-user-select: none;
  user-select: none;
}

.stg-checkbox input {
  display: none;
}

.stg-checkbox:hover {
  border-color: var(--color-accent-primary);
  color: var(--color-text-primary);
}

.stg-checkbox--active {
  border-color: var(--color-accent-primary);
  background: color-mix(in srgb, var(--color-accent-primary) 12%, transparent);
  color: var(--color-accent-primary);
  font-weight: var(--fw-semi, 600);
}

/* ── Range Slider ────────────────────────────────────────────────────────── */

.stg-sliders {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.stg-range-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stg-range-field__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stg-range-field__label {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium, 500);
  color: var(--color-text-secondary);
}

.stg-range-field__value {
  font-size: var(--text-sm);
  font-weight: var(--fw-semi, 600);
  font-family: var(--font-mono);
  color: var(--color-accent-primary);
  min-width: 40px;
  text-align: right;
}

.stg-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--color-bg-active);
  outline: none;
  cursor: pointer;
}

.stg-range-slider:focus-visible {
  outline: 2px solid var(--color-accent-teal);
  outline-offset: 2px;
}

.stg-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-accent-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--color-bg-base);
  transition: transform 0.1s;
}

.stg-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.stg-range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-accent-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--color-bg-base);
}

/* ── Integrations Grid ───────────────────────────────────────────────────── */

.stg-integrations {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}

.stg-integration {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-surface);
  box-shadow: var(--card-shadow);
  transition: background 0.15s;
}

.stg-integration:hover {
  background: var(--color-bg-hover);
}

.stg-integration__dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.stg-integration__dot--on {
  background: var(--color-profit);
  box-shadow: 0 0 6px var(--color-profit);
}

.stg-integration__dot--off {
  background: var(--color-loss);
  box-shadow: 0 0 6px var(--color-loss);
}

.stg-integration__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stg-integration__name {
  font-size: var(--text-sm);
  font-weight: var(--fw-semi, 600);
  color: var(--color-text-primary);
}

.stg-integration__desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ── Actions Row ─────────────────────────────────────────────────────────── */

.stg-actions {
  display: flex;
  gap: var(--space-3);
  padding-top: var(--space-4);
}

/* ── Confirm Modal ───────────────────────────────────────────────────────── */

.stg-confirm-text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-4);
  line-height: 1.6;
}

.stg-confirm-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* ── System Log ──────────────────────────────────────────────────────────── */

.stg-syslog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.stg-syslog {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  max-height: 280px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  line-height: 1.4;
  box-shadow: var(--card-shadow);
}

.stg-syslog-loading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-secondary);
}

.stg-syslog-empty {
  color: var(--color-text-muted);
}

.stg-syslog-error {
  color: var(--color-loss);
  margin-bottom: var(--space-2);
}

.stg-syslog-line {
  display: flex;
  gap: var(--space-2);
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stg-syslog-line:last-child {
  border-bottom: none;
}

.stg-syslog-source {
  flex-shrink: 0;
  color: var(--color-text-muted);
  margin-right: var(--space-2);
  font-family: var(--font-mono);
}

.stg-syslog-timestamp {
  flex-shrink: 0;
  color: var(--color-text-muted);
  margin-right: var(--space-2);
}

.stg-syslog-message {
  flex: 1;
  white-space: pre-wrap;
}

.stg-syslog-line--info {
  color: var(--color-text-secondary);
}

.stg-syslog-line--warning {
  color: var(--color-warning);
}

.stg-syslog-line--error {
  color: var(--color-loss);
}

.stg-syslog-line--debug {
  color: var(--color-text-muted);
}


/*
 * AppShell.css — Layout for the sidebar + topnav + content shell.
 */

.app-shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg-base);
}

/* Main area takes remaining space */
.app-shell__main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;                          /* allow flex shrink past content */
  min-height: 100dvh;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--duration-normal) var(--easing-default);
}

.app-shell--collapsed .app-shell__main {
  margin-left: var(--sidebar-collapsed);
}

/* Scrollable content area */
.app-shell__content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  padding: var(--space-5);
  max-width: var(--max-content-width);
  width: 100%;
  margin: 0 auto;
  background: var(--color-bg-base);
}

.app-shell__mobile-nav {
  display: none;
}

.app-shell__view-skeleton {
  display: grid;
  gap: 0.75rem;
}

.app-shell__view-skeleton-item {
  border-radius: 12px;
}

.app-shell__view-skeleton-item--header {
  height: 56px;
  background: rgba(148, 163, 184, 0.12);
}

.app-shell__view-skeleton-item--panel-a {
  height: 160px;
  background: rgba(148, 163, 184, 0.1);
}

.app-shell__view-skeleton-item--panel-b {
  height: 160px;
  background: rgba(148, 163, 184, 0.08);
}

/* Mobile backdrop for sidebar drawer */
.app-shell__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 90;
  animation: fadeIn var(--duration-fast) var(--easing-decelerate);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── Responsive ────────────────────────────────────────────────────────── */

/* Auto-collapse sidebar at 1280px */
@media (max-width: 1279px) {
  .app-shell__main {
    margin-left: var(--sidebar-collapsed);
  }
}

/* Full hide sidebar on tablet/mobile — drawer mode */
@media (max-width: 767px) {
  .topnav {
    display: none;
  }

  .app-shell__main {
    margin-left: 0;
  }

  .app-shell__content {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: max(var(--space-3), env(safe-area-inset-top)) var(--space-3) calc(78px + env(safe-area-inset-bottom));
  }

  .app-shell__mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: center;
    gap: 2px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: rgba(9, 13, 26, 0.96);
    border-top: 1px solid var(--color-border-subtle);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 120;
  }

  .app-shell__mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 50px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text-muted);
  }

  .app-shell__mobile-nav-btn--active {
    color: var(--color-accent-teal, var(--color-accent-primary));
    background: rgba(14, 165, 161, 0.12);
  }

  .app-shell__mobile-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    line-height: 1;
  }

  .app-shell__mobile-nav-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
  }
}


/* ── Home / Landing Page ──────────────────────────────────────────────────── */
/* Matches legacy index.html globe page design                                */

.home {
  min-height: 100vh;
  background: #090d1a;
  position: relative;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #f8fafc;
}

/* ── Globe ────────────────────────────────────────────────────────────────── */

.home__globe-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100vmax;
  height: 100vmax;
  z-index: 0;
  pointer-events: none;
}

.home__globe {
  width: 100%;
  height: 100%;
  animation: home-spin 120s linear infinite;
}

@keyframes home-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Login Button (top-right, pill shape) ─────────────────────────────────── */

.home__login-btn {
  position: fixed;
  top: 30px;
  right: 30px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: #090d1a;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(71, 85, 105, 0.3);
  border-radius: 50px;
  color: #f8fafc;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: var(--fw-semi, 600);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.15);
}

.home__login-btn:focus-visible {
  outline: 2px solid var(--color-accent-teal);
  outline-offset: 2px;
}

.home__login-btn:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: #f8fafc;
  box-shadow: 0 6px 30px rgba(0, 212, 255, 0.4);
  transform: translateY(-2px);
}

.home__login-btn svg {
  width: 20px;
  height: 20px;
}

/* ── Centered Logo Overlay ────────────────────────────────────────────────── */

.home__logo-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  text-align: center;
  animation: home-fadeInScale 1.5s ease-out;
}

.home__hero-logo {
  width: 500px;
  max-width: 80vw;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 40px rgba(0, 212, 255, 0.5)) drop-shadow(0 0 80px rgba(124, 58, 237, 0.3));
  animation: home-heroGlow 4s ease-in-out infinite;
}

@keyframes home-heroGlow {
  0%, 100% {
    filter: drop-shadow(0 0 40px rgba(0, 212, 255, 0.5)) drop-shadow(0 0 80px rgba(124, 58, 237, 0.3));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 60px rgba(0, 212, 255, 0.7)) drop-shadow(0 0 100px rgba(124, 58, 237, 0.5));
    transform: scale(1.02);
  }
}

@keyframes home-fadeInScale {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.home__tagline {
  margin-top: 25px;
  font-size: 20px;
  font-weight: 300;
  color: #cbd5e1;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0;
  animation: home-fadeInUp 1s ease-out 0.8s forwards;
}

@keyframes home-fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Login Modal ──────────────────────────────────────────────────────────── */

.home__modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  padding: 24px;
  overflow-y: auto;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.home__modal--active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.home__modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.home__modal-content {
  position: relative;
  z-index: 2001;
  max-width: 480px;
  width: 90%;
  max-height: calc(100vh - 48px);
  overflow: visible;
  animation: home-slideUp 0.4s ease-out;
}

@keyframes home-slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Login Card ───────────────────────────────────────────────────────────── */

.home__login-card {
  width: 100%;
  max-width: 540px;
  padding: 44px;
  min-height: 420px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 212, 255, 0.2);
  box-shadow: var(--card-shadow), 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.home__login-header {
  text-align: center;
  margin-bottom: 24px;
}

.home__login-header h2 {
  color: #f8fafc;
  font-weight: var(--fw-semi, 600);
  font-size: 22px;
  margin: 0 0 8px 0;
}

.home__login-header p {
  color: #64748b;
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
}

/* ── Form ─────────────────────────────────────────────────────────────────── */

.home__login-form {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.home__form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home__form-group label {
  font-size: 14px;
  font-weight: var(--fw-medium, 500);
  color: #cbd5e1;
  margin-left: 4px;
}

.home__input-wrapper {
  position: relative;
}

.home__input-wrapper input {
  width: 100%;
  padding: 20px 50px 20px 44px;
  font-size: 16px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #f8fafc;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(71, 85, 105, 0.2);
  border-radius: 12px;
  outline: none;
  transition: all 0.3s ease;
}

.home__input-wrapper input::placeholder {
  color: #64748b;
}

.home__input-wrapper input:focus {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.1);
}

.home__input-wrapper input:focus-visible {
  outline: 2px solid var(--color-accent-teal);
  outline-offset: 2px;
}

.home__input-icon {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  pointer-events: none;
}

.home__input-icon svg {
  stroke: #64748b;
  opacity: 0.95;
}

.home__toggle-password {
  background: none;
  border: none;
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 2;
  padding: 4px;
}

.home__toggle-password svg {
  stroke: #cbd5e1;
  transition: stroke 0.3s ease;
}

.home__toggle-password:hover svg {
  stroke: #f8fafc;
}

/* ── Form Options (remember me / forgot password) ─────────────────────────── */

.home__form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.home__checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.home__checkbox-wrapper input[type="checkbox"] {
  display: none;
}

.home__checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(71, 85, 105, 0.2);
  border-radius: 8px;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.25s ease, border-color 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.home__checkbox-wrapper input[type="checkbox"]:checked + .home__checkmark {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.95), rgba(0, 212, 255, 0.08));
  border-color: rgba(124, 58, 237, 0.95);
  box-shadow: 0 8px 20px rgba(0, 212, 255, 0.08), inset 0 -6px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.home__checkbox-wrapper input[type="checkbox"]:checked + .home__checkmark::after {
  content: '\2713';
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.home__checkbox-label {
  font-size: 14px;
  color: #cbd5e1;
}

.home__forgot-password {
  font-size: 14px;
  font-weight: var(--fw-medium, 500);
  color: #f8fafc;
  text-decoration: none;
  transition: color 0.3s ease;
}

.home__forgot-password:hover {
  color: #7c3aed;
}

/* ── Login Button ─────────────────────────────────────────────────────────── */

.home__login-button {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  font-size: 15px;
  font-weight: var(--fw-semi, 600);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: white;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.95), rgba(0, 212, 255, 0.08));
  border: none;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.home__login-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  transition: left 0.45s ease;
}

.home__login-button:hover::before {
  left: 100%;
}

.home__login-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 212, 255, 0.18);
}

.home__login-button:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}

.home__login-button:focus-visible {
  outline: 2px solid var(--color-accent-teal);
  outline-offset: 2px;
}

.home__login-button:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.home__button-loader svg {
  animation: home-spin-loader 1s linear infinite;
}

@keyframes home-spin-loader {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Error Message ────────────────────────────────────────────────────────── */

.home__error-message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid #dc2626;
  border-radius: 12px;
  color: #dc2626;
  font-size: 14px;
  animation: home-shake 0.5s ease;
}

@keyframes home-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-10px); }
  75%      { transform: translateX(10px); }
}

/* ── System Status ────────────────────────────────────────────────────────── */

.home__system-status {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(71, 85, 105, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.home__status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.home__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: home-pulseDot 2s ease-in-out infinite;
}

.home__status-dot--online {
  background: #059669;
  box-shadow: 0 0 10px #059669;
}

.home__status-dot--offline {
  background: #dc2626;
  box-shadow: 0 0 10px #dc2626;
}

@keyframes home-pulseDot {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

.home__status-text {
  font-size: 12px;
  color: #cbd5e1;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .home__hero-logo {
    width: 300px;
  }

  .home__tagline {
    font-size: 14px;
    letter-spacing: 2px;
  }

  .home__login-btn {
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    font-size: 13px;
  }

  .home__login-card {
    padding: 32px 24px;
  }

  .home__login-form {
    gap: 24px;
  }
}


.boc-login {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-base);
  padding: max(var(--space-4), env(safe-area-inset-top)) max(var(--space-4), env(safe-area-inset-right)) max(var(--space-4), env(safe-area-inset-bottom)) max(var(--space-4), env(safe-area-inset-left));
}

.boc-login__card {
  width: 100%;
  max-width: 380px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  box-shadow: var(--shadow-lg);
}

/* branding */
.boc-login__brand {
  text-align: center;
  margin-bottom: var(--space-8);
}

.boc-login__logo-img {
  width: 120px;
  height: auto;
  margin: 0 auto;
  display: block;
  filter: drop-shadow(0 0 12px rgba(0, 194, 255, 0.25));
}

.boc-login__logo {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-4);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-accent-blue), var(--color-accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.boc-login__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-1);
}

.boc-login__subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}

/* form */
.boc-login__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.boc-login__error {
  font-size: var(--text-sm);
  color: var(--color-semantic-loss);
  margin: 0;
  text-align: center;
}

/* footer */
.boc-login__footer {
  margin-top: var(--space-6);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.boc-login__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.boc-login__dot--green {
  background: var(--color-semantic-profit);
  box-shadow: 0 0 6px var(--color-semantic-profit);
}

@media (max-width: 430px), (max-height: 760px) {
  .boc-login {
    align-items: flex-start;
  }

  .boc-login__card {
    margin-top: var(--space-5);
    max-width: 100%;
    padding: var(--space-6) var(--space-5);
  }

  .boc-login__logo-img {
    width: 96px;
  }
}


/*
 * BoCapital Design System — CSS Custom Properties
 * Bloomberg Terminal 2.0 — data-dense, trader-first, premium dark mode.
 * Auto-generated from tokens.ts — keep in sync.
 * This file is imported once in global.css.
 */

:root {
  /* ─── Backgrounds (Bloomberg-inspired near-black) ─────────────────── */
  --color-bg-base:       #090d1a;
  --color-bg-elevated:   #0f1623;
  --color-bg-surface:    #111827;
  --color-bg-hover:      #161e2e;
  --color-bg-active:     #1e293b;

  /* ─── Text (refined hierarchy) ───────────────────────────────────── */
  --color-text-primary:   #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-text-muted:     #64748b;
  --color-text-inverse:   #090d1a;

  /* ─── Borders ────────────────────────────────────────────────────── */
  --color-border-default: rgba(71, 85, 105, 0.18);
  --color-border-subtle:  rgba(71, 85, 105, 0.12);
  --color-border-strong:  rgba(71, 85, 105, 0.24);
  --color-border-focus:   #3B82F6;

  /* ─── Accent (desaturated, premium) ──────────────────────────────── */
  --color-accent-primary:       #3B82F6;
  --color-accent-primary-hover: #2563EB;
  --color-accent-secondary:       #8B5CF6;
  --color-accent-secondary-hover: #7C3AED;
  --color-accent-teal:          #0ea5a1;
  --color-accent-teal-hover:    #0d9488;
  --color-accent-gold:          #d97706;

  /* ─── Semantic ───────────────────────────────────────────────────── */
  --color-profit:       #059669;
  --color-profit-muted: rgba(5, 150, 105, 0.12);
  --color-loss:         #dc2626;
  --color-loss-muted:   rgba(220, 38, 38, 0.12);
  --color-warning:       #d97706;
  --color-warning-muted: rgba(217, 119, 6, 0.12);

  /* ─── Sessions ───────────────────────────────────────────────────── */
  --color-session-asian:     #A78BFA;
  --color-session-asian-bg:  rgba(167, 139, 250, 0.08);
  --color-session-london:    #38BDF8;
  --color-session-london-bg: rgba(56, 189, 248, 0.08);
  --color-session-ny:        #34D399;
  --color-session-ny-bg:     rgba(52, 211, 153, 0.08);

  /* ─── Cycle Phases ───────────────────────────────────────────────── */
  --color-cycle-accumulation: #A78BFA;
  --color-cycle-markup:       #059669;
  --color-cycle-distribution: #d97706;
  --color-cycle-markdown:     #dc2626;
  --color-cycle-reset:        #64748b;

  /* ─── Chart Palette ──────────────────────────────────────────────── */
  --color-chart-1: #3B82F6;
  --color-chart-2: #0ea5a1;
  --color-chart-3: #8B5CF6;
  --color-chart-4: #059669;
  --color-chart-5: #d97706;
  --color-chart-6: #dc2626;
  --color-chart-7: #EC4899;
  --color-chart-grid: rgba(71, 85, 105, 0.08);
  --color-chart-axis: var(--color-text-muted);

  /* ─── Heatmap Intensity ──────────────────────────────────────────── */
  --color-heat-0: var(--color-bg-active);
  --color-heat-1: rgba(14, 165, 161, 0.2);
  --color-heat-2: rgba(14, 165, 161, 0.4);
  --color-heat-3: rgba(14, 165, 161, 0.65);
  --color-heat-4: rgba(14, 165, 161, 0.9);

  /* ─── Typography ─────────────────────────────────────────────────── */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --fw-medium: 500;
  --fw-semi:   600;

  /* ─── Spacing (8pt grid) ─────────────────────────────────────────── */
  --space-0:  0px;
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  40px;
  --space-8:  48px;
  --space-10: 64px;
  --space-12: 80px;

  /* ─── Border Radius ──────────────────────────────────────────────── */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-pill: 999px;

  /* ─── Shadows (Linear-inspired layered depth) ────────────────────── */
  --shadow-none: none;
  --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg:   0 8px 24px rgba(0, 0, 0, 0.5);
  --card-shadow:  0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.4);
  --shadow-hover: 0 4px 12px 0 rgb(0 0 0 / 0.35), 0 2px 4px -1px rgb(0 0 0 / 0.3);

  /* ─── Glows ──────────────────────────────────────────────────────── */
  --glow-teal:    0 0 12px rgba(14, 165, 161, 0.25);
  --glow-blue:    0 2px 8px rgba(59, 130, 246, 0.4);
  --glow-profit:  0 0 8px rgba(5, 150, 105, 0.3);
  --glow-loss:    0 0 8px rgba(220, 38, 38, 0.3);

  /* ─── Motion ─────────────────────────────────────────────────────── */
  --duration-instant: 100ms;
  --duration-fast:    200ms;
  --duration-normal:  250ms;
  --duration-slow:    400ms;
  --easing-default:    cubic-bezier(0.4, 0, 0.2, 1);
  --easing-decelerate: cubic-bezier(0, 0, 0.2, 1);
  --easing-accelerate: cubic-bezier(0.4, 0, 1, 1);

  /* ─── Layout ─────────────────────────────────────────────────────── */
  --sidebar-width:     240px;
  --sidebar-collapsed: 64px;
  --topbar-height:     56px;
  --max-content-width: 1800px;
}


/*
 * BoCapital — Global Reset & Base Styles
 */

/* ─── Reset ─────────────────────────────────────────────────────────────────── */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100%;
  background-color: var(--color-bg-base);
  overscroll-behavior-y: none;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text-primary);
  background-color: var(--color-bg-base);
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}

/* ─── Links ─────────────────────────────────────────────────────────────────── */

a {
  color: var(--color-accent-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--easing-default);
}
a:hover {
  color: var(--color-accent-primary-hover);
}

/* ─── Selection ─────────────────────────────────────────────────────────────── */

::selection {
  background: rgba(59, 130, 246, 0.3);
  color: var(--color-text-primary);
}

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--color-bg-active);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ─── Focus Rings (teal accent, subtle glow) ──────────────────────────────── */

:focus-visible {
  outline: 2px solid var(--color-accent-teal, var(--color-border-focus));
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(14, 165, 161, 0.15);
}

/* ─── Images ────────────────────────────────────────────────────────────────── */

img, svg {
  display: block;
  max-width: 100%;
}

/* ─── Tables ────────────────────────────────────────────────────────────────── */

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ─── Lists ─────────────────────────────────────────────────────────────────── */

ul, ol {
  list-style: none;
}

/* ─── Inputs ────────────────────────────────────────────────────────────────── */

button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}
button {
  cursor: pointer;
}

/* ─── Monospace Numbers ─────────────────────────────────────────────────────── */

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ─── Shimmer Skeleton (Tremor-inspired loading) ──────────────────────────── */

@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 400px 100%;
  animation: shimmer 1.6s infinite linear;
  border-radius: var(--radius-md, 12px);
}

.skeleton-text {
  height: 14px;
  border-radius: var(--radius-sm, 8px);
}

.skeleton-heading {
  height: 24px;
  width: 60%;
  border-radius: var(--radius-sm, 8px);
}

.skeleton-card {
  height: 200px;
  border-radius: var(--radius-lg, 16px);
}

/* ─── GPU-accelerated transitions ─────────────────────────────────────────── */

.gpu-transform {
  will-change: transform;
  transform: translateZ(0);
}

/* ─── App Root ──────────────────────────────────────────────────────────────── */

#root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--color-bg-base);
}


/*
 * BoCapital — Utility Classes
 * Spacing, flex, grid, and type helpers.
 * All values reference design tokens.
 */

/* ─── Flex ──────────────────────────────────────────────────────────────────── */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.items-start   { align-items: flex-start; }
.items-center  { align-items: center; }
.items-end     { align-items: flex-end; }
.items-stretch { align-items: stretch; }
.justify-start   { justify-content: flex-start; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }

/* ─── Grid ──────────────────────────────────────────────────────────────────── */
.grid      { display: grid; }
.grid-2    { grid-template-columns: repeat(2, 1fr); }
.grid-3    { grid-template-columns: repeat(3, 1fr); }
.grid-4    { grid-template-columns: repeat(4, 1fr); }
.grid-5    { grid-template-columns: repeat(5, 1fr); }

/* ─── Gap ───────────────────────────────────────────────────────────────────── */
.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-5  { gap: var(--space-5); }
.gap-6  { gap: var(--space-6); }

/* ─── Padding ───────────────────────────────────────────────────────────────── */
.p-0  { padding: var(--space-0); }
.p-1  { padding: var(--space-1); }
.p-2  { padding: var(--space-2); }
.p-3  { padding: var(--space-3); }
.p-4  { padding: var(--space-4); }
.p-5  { padding: var(--space-5); }
.p-6  { padding: var(--space-6); }
.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-5 { padding-left: var(--space-5); padding-right: var(--space-5); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

/* ─── Margin ────────────────────────────────────────────────────────────────── */
.m-0  { margin: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.ml-auto { margin-left: auto; }

/* ─── Typography ────────────────────────────────────────────────────────────── */
.type-display     { font-size: 32px; font-weight: 700; line-height: 1.2; }
.type-heading-1   { font-size: 24px; font-weight: 600; line-height: 1.3; }
.type-heading-2   { font-size: 20px; font-weight: 600; line-height: 1.35; }
.type-heading-3   { font-size: 16px; font-weight: 600; line-height: 1.4; }
.type-body        { font-size: 14px; font-weight: 400; line-height: 1.5; }
.type-body-strong { font-size: 14px; font-weight: 600; line-height: 1.5; }
.type-label       { font-size: 12px; font-weight: 500; line-height: 1.4; letter-spacing: 0.02em; text-transform: uppercase; }
.type-caption     { font-size: 11px; font-weight: 400; line-height: 1.4; }

/* ─── Colors ────────────────────────────────────────────────────────────────── */
.text-primary   { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted     { color: var(--color-text-muted); }
.text-profit    { color: var(--color-profit); }
.text-loss      { color: var(--color-loss); }
.text-warning   { color: var(--color-warning); }
.text-accent    { color: var(--color-accent-primary); }

/* ─── Misc ──────────────────────────────────────────────────────────────────── */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
.w-full  { width: 100%; }
.h-full  { height: 100%; }
.relative { position: relative; }
.absolute { position: absolute; }
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
.cursor-pointer  { cursor: pointer; }
.select-none     { user-select: none; }
.pointer-events-none { pointer-events: none; }
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }

/* ─── Responsive Visibility ─────────────────────────────────────────────────── */
.hide-below-sm { display: initial; }
.hide-below-md { display: initial; }
.hide-below-lg { display: initial; }
.show-below-sm { display: none; }
.show-below-md { display: none; }
.show-below-lg { display: none; }

@media (max-width: 479px) {
  .hide-below-sm { display: none !important; }
  .show-below-sm { display: initial !important; }
}
@media (max-width: 767px) {
  .hide-below-md { display: none !important; }
  .show-below-md { display: initial !important; }
}
@media (max-width: 1023px) {
  .hide-below-lg { display: none !important; }
  .show-below-lg { display: initial !important; }
}

/* ─── Mobile-first grid collapse ───────────────────────────────────────────── */

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4, .grid-5 {
    grid-template-columns: 1fr;
  }
  /* Journal/table: hide non-essential columns */
  .col-hide-mobile { display: none !important; }
}

@media (max-width: 480px) {
  /* Stats row: single column */
  .stats-row { grid-template-columns: 1fr !important; }
}

/* ─── Hamburger nav toggle (shown only on small screens) ───────────────────── */

.nav-hamburger { display: none; }

@media (max-width: 480px) {
  .nav-full { display: none; }
  .nav-hamburger { display: flex; }
}


/*# sourceMappingURL=main.b4544dda.css.map*/