/*
 * TraderX — Professional Trading Terminal Design System
 * ════════════════════════════════════════════════════════════
 * Palette: Obsidian / Slate Dark Theme
 * Fonts:   Outfit (display/metrics) + DM Mono (numbers/prices) + DM Sans / Inter (UI)
 * Contrast: High contrast, WCAG AA compliant, maximum legibility
 * ════════════════════════════════════════════════════════════
 */

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

/* ─── Design Tokens ───────────────────────────────────────── */
:root {
  /* ── Background & Surfaces (Stealth Black) ───────────── */
  --bg:              #050507;      /* pure carbon black */
  --bg-subtle:       #08080C;
  --surface-1:       #0E0E14;      /* stealth cards base */
  --surface-2:       #14141C;      /* elevated elements */
  --surface-3:       #1A1A24;      /* active / hover states */
  --surface-input:   #09090D;      /* inputs background */

  /* Glassmorphism */
  --glass-bg:        rgba(14, 14, 20, 0.85);
  --glass-border:    rgba(245, 197, 24, 0.12);
  --glass-blur:      blur(16px);

  /* ── Borders & Highlights ─────────────────────────────── */
  --border:          rgba(255, 255, 255, 0.08);
  --border-hover:    rgba(245, 197, 24, 0.3);
  --border-focus:    #F5C518;
  --border-subtle:   rgba(255, 255, 255, 0.05);
  --inner-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.05);

  /* ── Typography & Contrast (High Legibility) ──────────── */
  --fg:              #F8FAFC;      /* primary titles & numbers */
  --fg-2:            #E2E8F0;      /* secondary values */
  --fg-3:            #94A3B8;      /* legible labels & descriptions */
  --fg-4:            #64748B;      /* muted helpers / borders */

  /* ── Semantic Colors ──────────────────────────────────── */
  /* Batman Yellow / Tactical Gold Accent */
  --cyan:            #F5C518;
  --cyan-light:      #FDE047;
  --cyan-dim:        rgba(245, 197, 24, 0.12);
  --cyan-glow:       rgba(245, 197, 24, 0.28);
  --cyan-border:     rgba(245, 197, 24, 0.38);

  /* Emerald / Target / Profit */
  --emerald:         #10B981;
  --emerald-light:   #34D399;
  --emerald-dim:     rgba(16, 185, 129, 0.12);
  --emerald-glow:    rgba(16, 185, 129, 0.25);
  --emerald-border:  rgba(16, 185, 129, 0.35);

  /* Rose / Stop Loss / Loss */
  --rose:            #F43F5E;
  --rose-light:      #FB7185;
  --rose-dim:        rgba(244, 63, 94, 0.12);
  --rose-glow:       rgba(244, 63, 94, 0.25);
  --rose-border:     rgba(244, 63, 94, 0.35);

  /* Amber / Time Exit / Warning */
  --amber:           #F59E0B;
  --amber-light:     #FBBF24;
  --amber-dim:       rgba(245, 158, 11, 0.12);
  --amber-glow:      rgba(245, 158, 11, 0.25);
  --amber-border:    rgba(245, 158, 11, 0.35);

  /* Violet / Secondary Accent */
  --violet:          #8B5CF6;
  --violet-dim:      rgba(139, 92, 246, 0.15);

  /* Compatibility Aliases */
  --blue:            var(--cyan);
  --blue-bg:         var(--cyan-dim);
  --blue-hover:      #FBBF24;
  --text-primary:    var(--fg);
  --text-secondary:  var(--fg-3);
  --text-muted:      var(--fg-4);
  --bg-card:         var(--surface-1);
  --bg-input:        var(--surface-input);

  /* ── Typography Stacks ────────────────────────────────── */
  --font-display:    'Outfit', 'Inter', -apple-system, sans-serif;
  --font-mono:       'DM Mono', 'SF Mono', monospace;
  --font-sans:       'DM Sans', 'Inter', -apple-system, sans-serif;

  /* ── Font Sizes ───────────────────────────────────────── */
  --text-2xs:        0.6875rem; /* 11px */
  --text-xs:         0.75rem;   /* 12px */
  --text-sm:         0.8125rem; /* 13px */
  --text-base:       0.875rem;  /* 14px */
  --text-lg:         1rem;      /* 16px */
  --text-xl:         1.125rem;  /* 18px */
  --text-2xl:        1.375rem;  /* 22px */
  --text-3xl:        1.75rem;   /* 28px */
  --text-4xl:        2.5rem;    /* 40px */
  --text-5xl:        3.25rem;   /* 52px */

  /* ── Spacing ──────────────────────────────────────────── */
  --space-1:         0.25rem;
  --space-2:         0.5rem;
  --space-3:         0.75rem;
  --space-4:         1rem;
  --space-5:         1.25rem;
  --space-6:         1.5rem;
  --space-8:         2rem;
  --space-10:        2.5rem;

  /* ── Radii ────────────────────────────────────────────── */
  --radius-sm:       6px;
  --radius-md:       10px;
  --radius-lg:       14px;
  --radius-full:     9999px;

  /* ── Transitions ──────────────────────────────────────── */
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-norm: 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) var(--bg);
}

/* ─── Stealth Custom Scrollbar (Eliminates Jitter & Clunky OS Bars) ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg);
  transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 197, 24, 0.5);
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, rgba(245, 197, 24, 0.04) 0%, transparent 60%),
              radial-gradient(circle at 100% 100%, rgba(217, 119, 6, 0.03) 0%, transparent 50%),
              var(--bg);
  color: var(--fg);
  line-height: 1.5;
  overflow-x: hidden;
}

/* ─── App Container ───────────────────────────────────────── */
.app-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--space-4) var(--space-8);
}

/* ─── Connection / Alert Banner ───────────────────────────── */
.connection-banner {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: var(--rose-dim);
  border: 1px solid var(--rose-border);
  color: var(--rose-light);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 8px var(--space-4);
  border-radius: var(--radius-sm);
  margin-top: var(--space-2);
}

.connection-banner .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rose);
  animation: pulse 1.5s infinite;
}

/* ─── Header ──────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-4);
}

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

.logo svg {
  display: block;
}

.logo h1 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-paper {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  background: rgba(6, 182, 212, 0.12);
  color: var(--cyan-light);
  border: 1px solid var(--cyan-border);
  border-radius: var(--radius-full);
}

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

.nav-link {
  color: var(--fg-3);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.07);
}

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

.auth-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--fg-3);
  background: var(--surface-1);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fg-4);
  transition: background var(--transition-fast);
}

.dot.connected {
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald-glow);
}

.dot.disconnected {
  background: var(--rose);
  box-shadow: 0 0 8px var(--rose-glow);
}

.btn-login {
  background: linear-gradient(135deg, rgba(245, 197, 24, 0.15), rgba(245, 197, 24, 0.05));
  border: 1px solid var(--cyan-border);
  color: var(--cyan-light);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-login:hover {
  background: var(--cyan);
  color: #050507;
  box-shadow: 0 0 16px var(--cyan-glow);
  font-weight: 800;
}

/* ─── Tab Bar (Segmented Control) ─────────────────────────── */
.tab-bar {
  display: inline-flex;
  background: var(--surface-1);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
  margin-bottom: var(--space-5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--fg-3);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 8px 18px;
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn svg {
  color: currentColor;
  opacity: 0.8;
}

.tab-btn:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: #F5C518;
  background: var(--surface-3);
  border: 1px solid rgba(245, 197, 24, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(245, 197, 24, 0.15);
}

.tab-badge {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 700;
  background: var(--cyan-dim);
  color: var(--cyan-light);
  border: 1px solid var(--cyan-border);
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

/* ─── TAB 1: Live Trading Session ─────────────────────────── */

/* Session Countdown & IST Clock Widget */
.countdown-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: linear-gradient(180deg, var(--surface-1) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  margin-bottom: var(--space-5);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), var(--inner-highlight);
}

.countdown-left, .countdown-right {
  display: flex;
  flex-direction: column;
}

.countdown-right {
  align-items: flex-end;
}

.countdown-label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-3);
  margin-bottom: 2px;
}

.countdown-time {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--amber-light);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.current-time {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--fg);
  line-height: 1.1;
}

.session-status {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--fg-3);
}

.countdown-ring-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.countdown-ring {
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 6;
}

.ring-fill {
  fill: none;
  stroke: var(--amber);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 238.76;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.5s ease;
}

.ring-center-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--fg-2);
}

/* Candidate Quick-Entry Section */
.input-section {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), var(--inner-highlight);
}

.input-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 2px;
}

.input-hint {
  font-size: var(--text-xs);
  color: var(--fg-3);
  margin-bottom: var(--space-3);
}

.input-hint code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.05);
  color: var(--cyan-light);
  padding: 1px 5px;
  border-radius: 4px;
}

.input-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.input-field {
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 10px 14px;
  outline: none;
  transition: all var(--transition-fast);
}

.input-field:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-dim);
  background: rgba(6, 182, 212, 0.03);
}

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

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #F5C518 0%, #D97706 100%);
  border: none;
  color: #050507;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 800;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 14px var(--cyan-glow);
  transition: all var(--transition-fast);
}

.btn-submit:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.submit-error {
  color: var(--rose-light);
  font-size: var(--text-xs);
  font-weight: 600;
}

/* 3 Position Cards Grid */
.positions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.position-card {
  background: linear-gradient(180deg, var(--surface-1) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), var(--inner-highlight);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: all var(--transition-norm);
}

.position-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

/* Empty Card State */
.position-card.empty {
  min-height: 240px;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  border-color: var(--border);
  background: rgba(14, 19, 31, 0.4);
}

.empty-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--fg-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Active Card Styles */
.pos-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--space-2);
}

.pos-title-block {
  display: flex;
  flex-direction: column;
}

.pos-symbol {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.pos-option {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--cyan-light);
  font-weight: 600;
}

.status-badge {
  font-family: var(--font-sans);
  font-size: var(--text-2xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.status-badge.open {
  background: var(--cyan-dim);
  color: var(--cyan-light);
  border: 1px solid var(--cyan-border);
}

.status-badge.target {
  background: var(--emerald-dim);
  color: var(--emerald-light);
  border: 1px solid var(--emerald-border);
}

.status-badge.sl {
  background: var(--rose-dim);
  color: var(--rose-light);
  border: 1px solid var(--rose-border);
}

.status-badge.time_exit {
  background: var(--amber-dim);
  color: var(--amber-light);
  border: 1px solid var(--amber-border);
}

/* Price & PnL Hero in Card */
.pos-hero-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: var(--space-2) 0;
}

.pos-ltp-wrap {
  display: flex;
  flex-direction: column;
}

.pos-ltp-label {
  font-size: var(--text-2xs);
  font-weight: 700;
  color: var(--fg-3);
  text-transform: uppercase;
}

.pos-ltp-val {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  transition: background 0.3s;
}

.pos-pnl-wrap {
  text-align: right;
}

.pos-pnl-pct {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.1;
}

.pos-pnl-val {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fg-3);
}

.positive { color: var(--emerald-light) !important; }
.negative { color: var(--rose-light) !important; }
.neutral  { color: var(--fg-3) !important; }

/* Visual Target / SL Progress Meter */
.pos-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pos-progress-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--fg-3);
}

.pos-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  position: relative;
  overflow: hidden;
}

.pos-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* Card Layout & Content */
.card-slot-num {
  position: absolute;
  top: 10px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 700;
  color: var(--fg-4);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-2);
}

.card-symbol {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.card-symbol-sub {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--cyan-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 170px;
}

.pnl-display {
  text-align: center;
  padding: var(--space-3) 0;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
}

.pnl-value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1;
}

.pnl-label {
  font-size: var(--text-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-3);
  margin-top: 4px;
}

.gauge-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: var(--space-2) 0;
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 600;
}

.gauge-sl { color: var(--rose-light); }
.gauge-target { color: var(--emerald-light); }

.gauge-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  position: relative;
  overflow: visible;
}

.gauge-center-line {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 50%;
  width: 2px;
  background: rgba(255, 255, 255, 0.35);
  transform: translateX(-50%);
  z-index: 2;
}

.gauge-fill-positive {
  position: absolute;
  left: 50%;
  height: 100%;
  background: var(--emerald);
  border-radius: 0 4px 4px 0;
}

.gauge-fill-negative {
  position: absolute;
  right: 50%;
  height: 100%;
  background: var(--rose);
  border-radius: 4px 0 0 4px;
}

.gauge-marker {
  position: absolute;
  top: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--surface-1);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
  transform: translateX(-50%);
  z-index: 3;
  transition: left 0.3s ease;
}

.gauge-marker.positive { background: var(--emerald-light); box-shadow: 0 0 8px var(--emerald-glow); }
.gauge-marker.negative { background: var(--rose-light); box-shadow: 0 0 8px var(--rose-glow); }

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  padding: 4px 0;
}

.price-label { color: var(--fg-3); }
.price-value { font-family: var(--font-mono); font-weight: 600; color: var(--fg-2); }
.price-value.ltp { font-size: var(--text-base); font-weight: 700; color: #fff; }

.card-separator {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-2) 0;
}

.actual-pick-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
}

.actual-pick-label { color: var(--fg-3); font-weight: 600; }

.toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: .2s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}

input:checked + .toggle-slider {
  background: var(--cyan);
  border-color: var(--cyan);
}

input:checked + .toggle-slider:before {
  transform: translateX(16px);
  background: #050811;
}

.entry-time {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--fg-4);
  text-align: right;
  margin-top: 4px;
}

.exit-info {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin: 6px 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.exit-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
}

.exit-label { color: var(--fg-3); }
.exit-val { font-family: var(--font-mono); font-weight: 600; color: var(--fg); }

/* Flash overlay */
.exit-flash-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.exit-flash-overlay.flash-target {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, transparent 70%);
  opacity: 1;
}

.exit-flash-overlay.flash-sl {
  background: radial-gradient(circle, rgba(244, 63, 94, 0.25) 0%, transparent 70%);
  opacity: 1;
}

.exit-flash-overlay.flash-time {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, transparent 70%);
  opacity: 1;
}

.btn-actual-pick {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--fg-2);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-actual-pick.active {
  background: var(--cyan-dim);
  border-color: var(--cyan-border);
  color: var(--cyan-light);
  font-weight: 700;
}

.btn-exit-pos {
  background: var(--rose-dim);
  border: 1px solid var(--rose-border);
  color: var(--rose-light);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-exit-pos:hover {
  background: var(--rose);
  color: #fff;
}

/* Performance Stats Bar */
.stats-panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), var(--inner-highlight);
}

.stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.stats-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--fg);
}

.stats-filter {
  display: inline-flex;
  background: var(--surface-input);
  border: 1px solid var(--border);
  padding: 2px;
  border-radius: var(--radius-sm);
  gap: 2px;
}

.stats-filter button {
  background: transparent;
  border: none;
  color: var(--fg-3);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.stats-filter button.active {
  background: var(--surface-3);
  color: #fff;
}

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

.stat-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  text-align: center;
}

.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 2px;
}

.stat-label {
  font-size: var(--text-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-3);
}

/* ─── TAB 2: Stock Picker ─────────────────────────────────── */
.picker-header {
  margin-bottom: var(--space-4);
}

.picker-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: 4px;
}

.picker-heading {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.picker-demo-badge {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 700;
  color: var(--amber-light);
  background: var(--amber-dim);
  border: 1px solid var(--amber-border);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.picker-subhead {
  font-size: var(--text-sm);
  color: var(--fg-3);
  max-width: 800px;
}

/* Pipeline Stepper Banner */
.pipeline-stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.step-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--inner-highlight);
}

.step-badge {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  background: var(--surface-3);
  color: var(--cyan-light);
  border: 1px solid var(--cyan-border);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.step-info {
  display: flex;
  flex-direction: column;
}

.step-name {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--fg);
}

.step-desc {
  font-size: var(--text-2xs);
  color: var(--fg-3);
}

/* Config Chips Strip */
.config-strip {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.config-strip-title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.config-from-file {
  font-size: var(--text-2xs);
  color: var(--fg-4);
  text-transform: none;
}

.config-chips {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.config-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-input);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
}

.chip-label {
  color: var(--fg-3);
}

.chip-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--cyan-light);
}

/* Picker Action Buttons */
.picker-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.btn-scan {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #F5C518 0%, #D97706 100%);
  border: none;
  color: #050507;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 800;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 14px var(--cyan-glow);
  transition: all var(--transition-fast);
}

.btn-scan:hover:not(:disabled) {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.btn-scan:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

.btn-scan-s3 {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 14px var(--emerald-glow);
}

.scan-status-line {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fg-3);
  margin-left: auto;
}

.picker-error {
  background: var(--rose-dim);
  border: 1px solid var(--rose-border);
  color: var(--rose-light);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.picker-warnings {
  background: var(--amber-dim);
  border: 1px solid var(--amber-border);
  color: var(--amber-light);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  margin-bottom: var(--space-4);
}

/* Candidate Cards Grid */
.picker-results {
  margin-bottom: var(--space-6);
}

.picker-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.picker-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--fg);
}

.section-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot-emerald { background: var(--emerald); box-shadow: 0 0 8px var(--emerald-glow); }
.dot-cyan    { background: var(--cyan);    box-shadow: 0 0 8px var(--cyan-glow); }
.dot-rose    { background: var(--rose);    box-shadow: 0 0 8px var(--rose-glow); }

.picker-count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg-2);
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

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

.picker-card {
  background: linear-gradient(180deg, var(--surface-1) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), var(--inner-highlight);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: all var(--transition-fast);
}

.picker-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.picker-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.picker-card-rank {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 800;
  color: var(--cyan-light);
  background: var(--cyan-dim);
  border: 1px solid var(--cyan-border);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.picker-card-symbol {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: #fff;
}

.picker-card-sector {
  font-size: var(--text-xs);
  color: var(--fg-3);
}

.picker-gap-badge {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--rose-light);
  background: var(--rose-dim);
  border: 1px solid var(--rose-border);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.picker-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px var(--space-3);
  font-size: var(--text-xs);
  background: rgba(0, 0, 0, 0.2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}

.picker-data-item {
  display: flex;
  justify-content: space-between;
}

.picker-data-label { color: var(--fg-3); }
.picker-data-val   { font-family: var(--font-mono); font-weight: 600; color: var(--fg); }

.picker-pe-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  background: var(--cyan-dim);
  border: 1px solid var(--cyan-border);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.picker-pe-key { font-family: var(--font-mono); font-weight: 600; color: var(--cyan-light); }
.picker-pe-ltp { font-family: var(--font-mono); font-weight: 700; color: #fff; }

.btn-push-dashboard {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--fg-2);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-push-dashboard:hover {
  background: var(--cyan);
  color: #050811;
  border-color: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.corp-action-flag {
  font-size: var(--text-2xs);
  font-weight: 600;
  color: var(--amber-light);
  background: var(--amber-dim);
  border: 1px solid var(--amber-border);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

/* Excluded Stocks Table */
.picker-section-toggle {
  background: transparent;
  border: none;
  color: var(--fg-2);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.toggle-chevron {
  transition: transform var(--transition-fast);
}

.toggle-chevron.expanded {
  transform: rotate(180deg);
}

.exclusion-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-xs);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: var(--space-3);
}

.exclusion-table th {
  background: var(--surface-2);
  color: var(--fg-3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.exclusion-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--fg-2);
}

.exclusion-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.exclusion-table .tag {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--rose-dim);
  color: var(--rose-light);
  border: 1px solid var(--rose-border);
}

/* ─── TAB 3: Historical Backtester ────────────────────────── */

/* Date & Controls Row */
.bt-date-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-4);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), var(--inner-highlight);
  flex-wrap: wrap;
}

.bt-date-input-wrap, .bt-universe-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bt-date-label {
  font-size: var(--text-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-3);
}

.bt-date-input {
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  padding: 8px 12px;
  outline: none;
  color-scheme: dark;
  transition: all var(--transition-fast);
}

.bt-date-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}

.bt-universe-toggle {
  display: inline-flex;
  background: var(--surface-input);
  border: 1px solid var(--border);
  padding: 2px;
  border-radius: var(--radius-sm);
  gap: 2px;
}

.bt-univ-btn {
  background: transparent;
  border: none;
  color: var(--fg-3);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 6px 14px;
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.bt-univ-btn:hover {
  color: var(--fg);
}

.bt-univ-btn.active {
  background: var(--cyan);
  color: #050811;
  font-weight: 700;
  box-shadow: 0 0 12px var(--cyan-dim);
}

.bt-date-hints {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.bt-date-hint-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.bt-date-hint-chip:hover {
  color: var(--fg);
  border-color: var(--cyan-border);
  background: var(--cyan-dim);
}

/* Backtest Summary Grid */
.bt-summary-section {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), var(--inner-highlight);
}

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

.bt-stat-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-2);
  text-align: center;
}

.bt-stat-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 3px;
}

.bt-stat-label {
  font-size: var(--text-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-3);
}

/* P&L Execution Timeline Chart */
.bt-chart-section {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), var(--inner-highlight);
}

.bt-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
  gap: var(--space-2);
}

.bt-chart-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--fg);
}

.bt-chart-legend {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.bt-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fg-2);
}

.bt-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.bt-chart-wrap {
  position: relative;
  width: 100%;
  height: 220px;
}

#bt-pnl-chart {
  width: 100%;
  height: 100%;
  display: block;
}

/* Backtest Trade Cards Grid */
.bt-trade-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: var(--space-4);
}

.bt-trade-card {
  background: linear-gradient(180deg, var(--surface-1) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3), var(--inner-highlight);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: relative;
  transition: all var(--transition-fast);
}

.bt-trade-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.bt-trade-card.outcome-TARGET {
  border-left: 4px solid var(--emerald);
}

.bt-trade-card.outcome-STOPLOSS, .bt-trade-card.outcome-SL {
  border-left: 4px solid var(--rose);
}

.bt-trade-card.outcome-TIME_EXIT {
  border-left: 4px solid var(--amber);
}

.bt-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.bt-stock-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bt-card-rank {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 800;
  color: var(--cyan-light);
  background: var(--cyan-dim);
  border: 1px solid var(--cyan-border);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.bt-card-symbol {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: #fff;
}

.bt-card-sub {
  font-size: var(--text-xs);
  color: var(--fg-3);
  margin-top: 2px;
}

.bt-pnl-display {
  text-align: center;
  padding: var(--space-2) 0;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.bt-pnl-value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1.1;
}

.bt-pnl-label {
  font-size: var(--text-2xs);
  font-weight: 600;
  color: var(--fg-3);
  margin-top: 2px;
}

.bt-trade-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: var(--text-xs);
}

.bt-detail-row {
  display: flex;
  justify-content: space-between;
}

.bt-detail-label { color: var(--fg-3); }
.bt-detail-val   { font-family: var(--font-mono); font-weight: 600; color: var(--fg-2); }

/* Inline SVG Sparklines */
.bt-sparkline-wrap {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.bt-sparkline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--fg-3);
  margin-bottom: 4px;
}

.bt-sparkline-svg {
  width: 100%;
  height: 54px;
  display: block;
}

/* Empty State */
.bt-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10);
  background: var(--surface-1);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.bt-empty-icon {
  font-size: 2.5rem;
  opacity: 0.5;
  margin-bottom: var(--space-2);
}

.bt-empty-msg {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--fg);
}

.bt-empty-hint {
  font-size: var(--text-xs);
  color: var(--fg-3);
  max-width: 440px;
  margin-top: 4px;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.9); }
}

/* ─── Responsive Media Queries ────────────────────────────── */
@media (max-width: 900px) {
  .countdown-bar {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    text-align: center;
  }
  .countdown-right { align-items: center; }
  .positions-grid, .picker-cards, .pipeline-stepper {
    grid-template-columns: 1fr;
  }
  .bt-summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .input-row {
    grid-template-columns: 1fr;
  }
}
