/* ================================================================
   GAPSTRIKE DESIGN SYSTEM — MOBILE FIRST
   Default = mobile. @media (min-width) adds desktop.
   ================================================================ */

/* --- Tokens --- */
:root {
  --bg-base: #050505;
  --bg-surface: #0D0D0F;
  --bg-card: #16161A;
  --bg-card-hover: #1F1F24;
  --border: #222226;
  --border-light: #2D2D33;
  --red: #FF3B30;
  --red-dim: rgba(255, 59, 48, 0.12);
  --red-glow: rgba(255, 59, 48, 0.35);
  --red-bright: #FF453A;
  --green: #00FF85;
  --green-dim: rgba(0, 255, 133, 0.1);
  --green-glow: rgba(0, 255, 133, 0.25);
  --amber: #FFD60A;
  --amber-dim: rgba(255, 214, 10, 0.1);
  --blue: #0A84FF;
  --blue-dim: rgba(10, 132, 255, 0.1);
  --text: #F5F5F7;
  --text2: #A1A1AA;
  --text3: #636366;
  --text4: #3A3A3C;
  --mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --tactical: 'Barlow Condensed', sans-serif;
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --safe-bottom: max(8px, env(safe-area-inset-bottom));
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg-base); color: var(--text);
  font-family: var(--sans); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; min-height: 100dvh;
  overflow-x: hidden;
}
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-bright); }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text4); }

/* ================================================================
   LAYOUT — mobile default
   ================================================================ */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.app-content {
  flex: 1;
  padding: 12px 12px 80px;
  width: 100%;
}
@media (min-width: 768px) {
  .app-content { padding: 24px 32px 40px; max-width: 1600px; margin: 0 auto; }
  html { font-size: 15px; }
}

/* ================================================================
   NAVBAR — mobile: compact top bar + bottom nav
   ================================================================ */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--tactical); font-weight: 700; font-size: 18px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--text);
}
.nav-brand .strike { color: var(--red); }
.nav-brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px var(--red-glow);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 8px var(--red-glow); }
  50% { opacity: 0.7; transform: scale(0.9); box-shadow: 0 0 20px var(--red-glow); }
}

/* Desktop nav links — hidden on mobile */
.nav-links { display: none; list-style: none; gap: 8px; }
.nav-link {
  font-family: var(--tactical); font-size: 14px; font-weight: 600; color: var(--text2);
  padding: 6px 16px; border-radius: var(--radius-sm);
  transition: all 0.2s; text-decoration: none;
  letter-spacing: 1px; text-transform: uppercase;
}
.nav-link:hover { color: var(--text); background: var(--bg-surface); }
.nav-link.active { color: var(--red); background: var(--red-dim); }

/* Right nav — visible on mobile (compact) */
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-status { display: none; font-family: var(--mono); font-size: 11px; color: var(--text3); }
.nav-logout {
  display: none; /* shown on desktop only, mobile uses bottom nav */
  font-size: 11px; color: var(--text3);
  padding: 5px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); text-decoration: none;
  transition: all 0.15s;
}
.nav-logout:hover { color: var(--red); border-color: var(--red); background: var(--red-dim); }

.btn-panic {
  background: var(--red); color: white; border: none;
  padding: 5px 12px; border-radius: var(--radius-sm);
  font-family: var(--tactical); font-size: 11px; font-weight: 800;
  letter-spacing: 1.5px; cursor: pointer;
  box-shadow: 0 0 10px var(--red-glow);
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-panic:hover {
  background: var(--red-bright);
  box-shadow: 0 0 20px var(--red-glow);
  transform: scale(1.05);
}
.btn-panic:active { transform: scale(0.95); }

@media (min-width: 768px) {
  .navbar { padding: 0 32px; height: 60px; }
  .nav-brand { font-size: 20px; letter-spacing: 3px; }
  .nav-links { display: flex; }
  .nav-right { gap: 16px; }
  .nav-status { display: inline; }
  .nav-logout { display: inline-block; }
  .btn-panic { padding: 6px 16px; font-size: 13px; }
}

/* Mobile bottom nav — shown by default */
.mobile-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10, 10, 11, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 6px 0 var(--safe-bottom);
}
.mobile-nav-inner { display: flex; justify-content: space-around; }
.mobile-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; color: var(--text3); text-decoration: none;
  padding: 4px 12px; min-width: 60px;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-item.active { color: var(--red); }
.mobile-nav-item svg { width: 20px; height: 20px; }

@media (min-width: 768px) {
  .mobile-nav { display: none; }
}

/* ================================================================
   STATE STRIP — compact on mobile, expanded on desktop
   ================================================================ */
.state-strip {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
}
.state-strip-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.state-item { display: flex; flex-direction: column; gap: 2px; }
.state-label {
  font-family: var(--tactical); font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 1.2px;
}
.state-value { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--text); }

@media (min-width: 768px) {
  .state-strip { padding: 12px 20px; }
  .state-strip-inner {
    display: flex; gap: 32px; align-items: center;
  }
  .state-value { font-size: 14px; }
  .state-label { font-size: 12px; }
}

/* Phase badges */
.phase-badge {
  font-family: var(--tactical); font-size: 12px; font-weight: 700;
  letter-spacing: 1.5px; padding: 3px 10px; border-radius: 4px;
  text-transform: uppercase;
}
.phase-premarket { color: var(--amber); background: var(--amber-dim); border: 1px solid var(--amber-dim); }
.phase-bar1 { color: var(--amber); background: var(--amber-dim); border: 1px solid var(--amber); animation: pulse-phase 2s ease-in-out infinite; }
.phase-trading { color: var(--green); background: var(--green-dim); border: 1px solid var(--green-dim); }
.phase-closed { color: var(--text3); background: var(--bg-card); border: 1px solid var(--border); }
@keyframes pulse-phase { 0%, 100% { opacity: 1; box-shadow: 0 0 5px var(--amber-dim); } 50% { opacity: 0.7; box-shadow: 0 0 15px var(--amber-dim); } }

/* Bar 1 instruction */
.bar1-instruction {
  font-family: var(--mono); font-size: 12px; color: var(--amber);
  margin-top: 12px; padding: 10px 14px;
  background: var(--amber-dim); border-radius: var(--radius-sm);
  border-left: 3px solid var(--amber);
}

/* ================================================================
   HERO BANNER — compact mobile, larger desktop
   ================================================================ */
.hero {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-base) 100%);
}
.hero::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
}
.hero.status-open::before { background: linear-gradient(90deg, var(--green), transparent 80%); }
.hero.status-premarket::before { background: linear-gradient(90deg, var(--amber), transparent 80%); }
.hero.status-closed::before { background: linear-gradient(90deg, var(--text3), transparent 80%); }

.hero-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 16px;
}
.hero-title {
  font-family: var(--tactical); font-size: 12px; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase; color: var(--text3);
}
.hero-status {
  font-family: var(--tactical); font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 4px; letter-spacing: 1px;
}
.hero-status.open { color: var(--green); background: var(--green-dim); box-shadow: 0 0 10px var(--green-glow); }
.hero-status.pre-market { color: var(--amber); background: var(--amber-dim); }
.hero-status.closed { color: var(--text3); background: var(--bg-card); }

.hero-pnl {
  font-family: var(--mono); font-size: 32px; font-weight: 700;
  line-height: 1.1; margin-bottom: 6px; letter-spacing: -1px;
}
.hero-pnl.positive { color: var(--green); text-shadow: 0 0 15px var(--green-glow); }
.hero-pnl.negative { color: var(--red); text-shadow: 0 0 15px var(--red-glow); }
.hero-sub { font-size: 13px; color: var(--text2); }
.hero-sub span { font-family: var(--mono); color: var(--text); }

@media (min-width: 768px) {
  .hero { padding: 32px 40px; margin-bottom: 24px; }
  .hero-pnl { font-size: 42px; }
  .hero-title { font-size: 13px; }
  .hero-sub { font-size: 14px; }
}

/* ================================================================
   KPI CARDS — 2 columns mobile, auto-fill desktop
   ================================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: transform 0.2s, border-color 0.2s;
}
.kpi:hover { transform: translateY(-2px); border-color: var(--border-light); }
.kpi-label {
  font-family: var(--tactical); font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 6px;
}
.kpi-value {
  font-family: var(--mono); font-size: 20px; font-weight: 700;
  line-height: 1.2; color: var(--text);
}
.kpi-detail {
  font-size: 11px; color: var(--text3); margin-top: 4px;
  font-family: var(--mono);
}

@media (min-width: 768px) {
  .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
  .kpi { padding: 20px; }
  .kpi-value { font-size: 24px; }
}

/* ================================================================
   SECTIONS
   ================================================================ */
.section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.section-title {
  font-family: var(--tactical); font-size: 13px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; color: var(--text2);
}
.section-body { padding: 16px; }

.grid-2, .grid-3 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 768px) {
  .section-header { padding: 16px 24px; }
  .section-body { padding: 20px 24px; }
  .section-title { font-size: 14px; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* ================================================================
   SCANNER TABLE — stacked on mobile, table on desktop
   ================================================================ */
.scanner-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.scanner-table th {
  text-align: left; padding: 12px 14px;
  font-family: var(--tactical); font-size: 12px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 1.5px;
  border-bottom: 1px solid var(--border);
}
.scanner-table td {
  padding: 12px 14px; font-family: var(--mono); font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.scanner-table tr:last-child td { border-bottom: none; }
.scanner-table tr:hover { background: var(--bg-card); }

/* Hide less important columns on mobile */
.scanner-hide-mobile { display: none; }
@media (min-width: 768px) {
  .scanner-hide-mobile { display: table-cell; }
  .scanner-table td { font-size: 14px; padding: 14px 16px; }
  .scanner-table th { padding: 14px 16px; }
}

/* ================================================================
   BADGES — touch-friendly on mobile
   ================================================================ */
.badge {
  display: inline-flex; align-items: center;
  font-family: var(--tactical); font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 4px;
}
.badge-hidden {
  color: var(--red); background: var(--red-dim);
  border: 1px solid var(--red-dim);
  box-shadow: 0 0 15px var(--red-glow);
  animation: badge-glow 3s ease-in-out infinite;
}
@keyframes badge-glow {
  0%, 100% { box-shadow: 0 0 12px var(--red-glow); }
  50% { box-shadow: 0 0 25px var(--red-glow), 0 0 4px var(--red-dim); }
}
.badge-standard { color: var(--text2); background: var(--bg-base); border: 1px solid var(--border); }
.badge-long { color: var(--green); background: var(--green-dim); border: 1px solid var(--green-dim); }
.badge-short { color: var(--red); background: var(--red-dim); border: 1px solid var(--red-dim); }
.badge-triggered, .badge-filled { color: var(--green); background: var(--green-dim); border: 1px solid var(--green-dim); }
.badge-watching, .badge-planned { color: var(--amber); background: var(--amber-dim); border: 1px solid var(--amber-dim); }
.badge-filtered, .badge-scanned { color: var(--text3); background: var(--bg-base); border: 1px solid var(--border); }

/* ================================================================
   POSITION CARDS — mobile first, full width stacked
   ================================================================ */
.position-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--text3);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.position-card:hover { transform: scale(1.01); }
.position-card.pos-long { border-left-color: var(--green); box-shadow: -4px 0 15px var(--green-glow); }
.position-card.pos-short { border-left-color: var(--red); box-shadow: -4px 0 15px var(--red-glow); }

.pos-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.pos-ticker { font-family: var(--tactical); font-size: 20px; font-weight: 800; letter-spacing: 1px; }
.pos-badges { display: flex; gap: 6px; flex-wrap: wrap; }

/* Prices — stacked on mobile */
.pos-prices {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.pos-price-item { display: flex; flex-direction: column; }
.pos-price-label { font-family: var(--tactical); font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 1.2px; }
.pos-price-val { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--text); }
.pos-price-arrow { color: var(--text3); font-size: 14px; }
.pos-pnl-box { margin-left: auto; text-align: right; }
.pos-pnl-box.positive .pos-price-val { color: var(--green); text-shadow: 0 0 10px var(--green-glow); }
.pos-pnl-box.negative .pos-price-val { color: var(--red); text-shadow: 0 0 10px var(--red-glow); }

/* Details grid — 2x2 on mobile */
.pos-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.pos-detail-label {
  font-family: var(--tactical); font-size: 10px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 1.2px;
  margin-bottom: 4px;
}
.pos-detail-val { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--text); }
.pos-detail-sub { font-size: 10px; color: var(--text3); margin-top: 2px; }

/* Push bar */
.push-bar { display: flex; gap: 4px; margin-bottom: 4px; }
.push-seg { width: 22px; height: 8px; border-radius: 2px; }
.push-filled { background: var(--green); box-shadow: 0 0 8px var(--green-glow); }
.push-empty { background: var(--text4); }
.push-exit { background: var(--red); animation: pulse-dot 1s ease-in-out infinite; }

/* Add status */
.add-status {
  font-family: var(--tactical); font-size: 12px; font-weight: 700;
  padding: 3px 8px; border-radius: 4px; display: inline-block;
  text-transform: uppercase; letter-spacing: 1px;
}
.add-waiting { color: var(--text3); background: var(--bg-surface); border: 1px solid var(--border); }
.add-red_marked { color: var(--red); background: var(--red-dim); border: 1px solid var(--red-dim); }
.add-green_cross { color: var(--amber); background: var(--amber-dim); border: 1px solid var(--amber-dim); }
.add-added { color: var(--green); background: var(--green-dim); border: 1px solid var(--green-dim); }

.pos-footer {
  font-size: 11px; color: var(--text3);
  font-family: var(--mono);
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.pos-empty {
  text-align: center; padding: 48px 20px;
  color: var(--text3); font-size: 14px;
  background: var(--bg-surface);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}
.pos-empty-icon { font-size: 32px; margin-bottom: 10px; opacity: 0.2; }

@media (min-width: 768px) {
  .position-card { padding: 20px 24px; margin-bottom: 16px; }
  .pos-ticker { font-size: 24px; }
  .pos-price-val { font-size: 17px; }
  .pos-details { grid-template-columns: 1fr 1fr 1fr 1fr; gap: 16px; }
  .pos-detail-val { font-size: 14px; }
}

/* ================================================================
   TRADE ROW
   ================================================================ */
.trade-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.trade-row:hover { background: rgba(255,255,255,0.01); }
.trade-row:last-child { border-bottom: none; }
.trade-bar-indicator { width: 4px; height: 32px; border-radius: 2px; flex-shrink: 0; }
.trade-ticker { font-family: var(--tactical); font-size: 16px; font-weight: 700; min-width: 60px; letter-spacing: 1px; }
.trade-meta { flex: 1; font-size: 12px; color: var(--text2); }
.trade-pnl { font-family: var(--mono); font-size: 14px; font-weight: 700; text-align: right; }
.trade-pnl.positive { color: var(--green); }
.trade-pnl.negative { color: var(--red); }

/* ================================================================
   LOGIN — mobile friendly
   ================================================================ */
.login-shell {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; min-height: 100dvh;
  background: var(--bg-base);
  position: relative; overflow: hidden;
  padding: 24px;
}
.login-shell::before {
  content: '';
  position: absolute; top: -150px; left: 50%; transform: translateX(-50%);
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--red-glow) 0%, transparent 70%);
  pointer-events: none;
  animation: login-glow 6s ease-in-out infinite;
}
@keyframes login-glow {
  0%, 100% { opacity: 0.3; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.6; transform: translateX(-50%) scale(1.2); }
}
.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  width: 100%; max-width: 420px;
  position: relative; z-index: 1;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.login-brand { text-align: center; margin-bottom: 40px; }
.login-brand h1 {
  font-family: var(--tactical); font-size: 28px; font-weight: 800;
  letter-spacing: 4px; text-transform: uppercase; margin-bottom: 8px;
}
.login-brand h1 span { color: var(--red); }
.login-brand p { font-family: var(--mono); font-size: 11px; color: var(--text3); letter-spacing: 1.5px; text-transform: uppercase; }

.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-family: var(--tactical); font-size: 12px; font-weight: 700;
  color: var(--text3); text-transform: uppercase;
  letter-spacing: 1.5px; margin-bottom: 8px;
}
.form-input {
  width: 100%; padding: 14px 16px;
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--mono); font-size: 14px;
  outline: none; transition: all 0.2s;
  -webkit-appearance: none;
}
.form-input:focus { border-color: var(--red); box-shadow: 0 0 10px var(--red-dim); }
.form-input::placeholder { color: var(--text4); }
.form-button {
  width: 100%; padding: 16px;
  background: var(--red); color: white;
  border: none; border-radius: var(--radius);
  font-family: var(--tactical); font-size: 16px; font-weight: 800;
  letter-spacing: 3px; text-transform: uppercase;
  cursor: pointer; transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 15px var(--red-glow);
}
.form-button:hover { background: var(--red-bright); transform: translateY(-1px); box-shadow: 0 6px 20px var(--red-glow); }
.form-button:active { transform: scale(0.98); }
.form-error {
  background: var(--red-dim); color: var(--red);
  font-family: var(--mono); font-size: 12px; padding: 12px 16px;
  border-radius: var(--radius); margin-bottom: 20px;
  border-left: 4px solid var(--red);
}

@media (min-width: 768px) {
  .login-card { padding: 56px 48px; }
  .login-brand h1 { font-size: 32px; letter-spacing: 6px; }
}

/* ================================================================
   VALIDATION GATES
   ================================================================ */
.gate { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.gate:last-child { border-bottom: none; }
.gate-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.gate-dot.pass { background: var(--green); box-shadow: 0 0 6px var(--green-dim); }
.gate-dot.fail { background: var(--red); box-shadow: 0 0 6px var(--red-dim); }
.gate-name { font-size: 12px; flex: 1; }
.gate-value { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--text2); }

/* ================================================================
   TOAST — positioned above mobile nav
   ================================================================ */
.toast-container {
  position: fixed; bottom: 68px; left: 12px; right: 12px; z-index: 200;
  display: flex; flex-direction: column; gap: 6px;
}
.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  font-family: var(--mono); font-size: 12px; color: var(--text);
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 4px solid var(--text3);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.toast.success { border-left-color: var(--green); box-shadow: 0 5px 20px var(--green-dim); }
.toast.error { border-left-color: var(--red); box-shadow: 0 5px 20px var(--red-dim); }
.toast.info { border-left-color: var(--blue); box-shadow: 0 5px 20px var(--blue-dim); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 768px) {
  .toast-container { bottom: 24px; left: auto; right: 24px; width: 320px; }
}

/* ================================================================
   UTILITIES
   ================================================================ */
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-blue { color: var(--blue); }
.text-muted { color: var(--text3); }
.text-mono { font-family: var(--mono); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 10px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

/* Alpine cloak */
[x-cloak] { display: none !important; }

/* ================================================================
   SIMULATION PAGE
   ================================================================ */

/* Controls bar */
.sim-controls {
  background: rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
}
.sim-clock {
  display: flex; align-items: center; gap: 8px;
}
.sim-clock-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text4); flex-shrink: 0;
}
.sim-clock-live {
  background: var(--red);
  box-shadow: 0 0 10px var(--red-glow);
  animation: pulse-dot 1.5s ease-in-out infinite;
}
.sim-clock-time {
  font-family: var(--mono); font-size: 16px; font-weight: 700;
  color: var(--text); letter-spacing: 1px;
}
.sim-btns { display: flex; gap: 6px; margin-left: auto; }
.sim-btn {
  background: var(--bg-card); color: var(--text2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--tactical); font-size: 11px; font-weight: 700;
  letter-spacing: 1px; padding: 5px 10px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; -webkit-tap-highlight-color: transparent;
}
.sim-btn:hover { border-color: var(--border-light); color: var(--text); }
.sim-btn-play { min-width: 36px; }
.sim-btn-active { background: var(--red-dim); border-color: var(--red); color: var(--red); }
.sim-btn-speed-on { background: var(--amber-dim); border-color: var(--amber); color: var(--amber); }
.sim-btn-reset { color: var(--text3); }
.sim-progress {
  width: 100%; height: 2px; background: var(--bg-base);
  border-radius: 1px; overflow: hidden;
}
.sim-progress-fill {
  height: 100%; background: var(--red);
  border-radius: 1px; transition: width 0.3s;
  box-shadow: 0 0 6px var(--red-glow);
}
.sim-runner-clock {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--green); letter-spacing: 0.5px;
  padding: 2px 8px; border-radius: var(--radius-sm);
  background: var(--green-dim); border: 1px solid var(--green-dim);
  animation: runner-pulse 2s ease-in-out infinite;
}
@keyframes runner-pulse {
  0%, 100% { box-shadow: 0 0 5px var(--green-dim); }
  50% { box-shadow: 0 0 15px var(--green-glow); }
}

/* Phase indicator */
.sim-phase {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 14px; margin-bottom: 10px;
  background: var(--bg-surface); border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.sim-phase-label {
  font-family: var(--tactical); font-size: 12px; font-weight: 700;
  color: var(--amber); letter-spacing: 1.5px; text-transform: uppercase;
}
.sim-phase-stats { font-size: 11px; color: var(--text3); display: flex; gap: 6px; }

/* Empty state */
.sim-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; text-align: center;
}
.sim-empty-icon { margin-bottom: 16px; opacity: 0.3; }

/* Event feed */
.sim-feed {
  display: flex; flex-direction: column; gap: 6px;
  min-height: 200px;
}

/* Single event */
.sim-evt {
  display: flex; gap: 10px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border-left: 3px solid var(--text4);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: background 0.2s;
}
.sim-evt-time {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  color: var(--text3); min-width: 38px; flex-shrink: 0;
  padding-top: 1px;
}
.sim-evt-content { flex: 1; min-width: 0; }
.sim-evt-head {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 2px;
}
.sim-evt-ticker {
  font-family: var(--tactical); font-size: 14px; font-weight: 800;
  letter-spacing: 1px; color: var(--text);
}
.sim-evt-ticker-long { color: var(--green); }
.sim-evt-ticker-short { color: var(--red); }
.sim-evt-sys {
  font-family: var(--tactical); font-size: 10px; font-weight: 700;
  color: var(--text4); letter-spacing: 1.5px;
}
.sim-evt-title {
  font-family: var(--tactical); font-size: 12px; font-weight: 700;
  color: var(--text2); letter-spacing: 1px; text-transform: uppercase;
}
.sim-evt-desc {
  font-size: 11px; color: var(--text3); margin-top: 2px; line-height: 1.4;
}
.sim-evt-pnl {
  font-family: var(--mono); font-size: 16px; font-weight: 700;
  margin-top: 4px;
}

/* Color variants */
.sim-evt-blue { border-left-color: var(--blue); }
.sim-evt-amber { border-left-color: var(--amber); }
.sim-evt-green { border-left-color: var(--green); }
.sim-evt-red { border-left-color: var(--red); }
.sim-evt-gray { border-left-color: var(--text4); }

/* STRIKE — prominent glow */
.sim-evt-strike {
  background: var(--bg-card);
  border-left-width: 4px;
  padding: 14px;
  box-shadow: 0 0 20px rgba(0, 255, 133, 0.08);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.sim-evt-strike .sim-evt-title {
  font-size: 14px; color: var(--text);
}
.sim-evt-strike.sim-evt-red {
  box-shadow: 0 0 20px rgba(255, 59, 48, 0.08);
}

/* Summary event */
.sim-evt-summary {
  background: var(--bg-card);
  border-left-color: var(--text3);
  border-left-width: 4px;
}
.sim-evt-summary .sim-evt-title { color: var(--text); font-size: 14px; }

/* Checkmarks */
.sim-checks {
  display: inline-flex; gap: 3px;
  font-family: var(--mono); font-size: 11px;
}
.sim-chk-off { color: var(--text4); }
.sim-chk-on { font-weight: 700; }
.sim-chk-blue { color: var(--blue); }
.sim-chk-amber { color: var(--amber); }
.sim-chk-green { color: var(--green); }

/* Slide-in animation */
.sim-enter { transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.sim-enter-from { opacity: 0; transform: translateY(10px); }
.sim-enter-to { opacity: 1; transform: translateY(0); }

/* Session result card */
.sim-result {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--green);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
}
.sim-result-title {
  font-family: var(--tactical); font-size: 14px; font-weight: 800;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--green); text-align: center; margin-bottom: 16px;
}
.sim-result-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px;
}
.sim-result-item { text-align: center; }
.sim-result-label {
  font-family: var(--tactical); font-size: 10px; font-weight: 700;
  color: var(--text3); text-transform: uppercase; letter-spacing: 1.2px;
  margin-bottom: 4px;
}
.sim-result-val {
  font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--text);
}

@media (min-width: 768px) {
  .sim-controls { padding: 12px 20px; }
  .sim-clock-time { font-size: 18px; }
  .sim-evt { padding: 12px 16px; }
  .sim-evt-time { min-width: 48px; font-size: 12px; }
  .sim-evt-ticker { font-size: 16px; }
  .sim-evt-title { font-size: 13px; }
  .sim-evt-strike .sim-evt-title { font-size: 15px; }
  .sim-result-val { font-size: 22px; }
}
