/* ============================================================
   flowbot design tokens — emerald + warm-dark, own identity
   ============================================================ */
:root {
  /* Warm dark backgrounds */
  --bg: #0b0f0d;
  --surface: #141a17;
  --surface-2: #1b2220;
  --surface-3: #232b27;
  --border: #2a3330;
  --border-soft: #1d2421;

  /* Text */
  --text: #e8ece9;
  --text-soft: #aab2ad;
  --muted: #6e7773;

  /* Brand emerald (own — not Robinhood lime) */
  --accent: #10b981;
  --accent-bright: #34d399;
  --accent-soft: rgba(16, 185, 129, 0.12);
  --accent-glow: rgba(16, 185, 129, 0.28);

  /* Directional colors */
  --bullish: #10b981;
  --bearish: #f43f5e;
  --neutral: #fbbf24;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.6), 0 4px 8px -4px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 24px rgba(16, 185, 129, 0.14);

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
}

/* ============================================================
   reset / base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--bg); }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 5px; }
*::-webkit-scrollbar-thumb:hover { background: var(--border); }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}

/* ============================================================
   header / nav
   ============================================================ */
header {
  background: rgba(11, 15, 13, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border-soft);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 28px;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 24px;
  height: 24px;
  color: var(--accent);
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.3));
}

.brand-text {
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 15px;
}

main { padding: 24px 0 0; }

.bottom-spacer {
  height: calc(72px + env(safe-area-inset-bottom));
  width: 100%;
  pointer-events: none;
}

/* ============================================================
   bottom tab bar (TradingView-style)
   ============================================================ */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  background: rgba(11, 15, 13, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--border-soft);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bn-item {
  flex: 1 1 0;
  min-width: 0;
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--text-soft);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.15s;
}
.bn-item svg {
  width: 22px;
  height: 22px;
}
.bn-item:hover { color: var(--text); }
.bn-item.active {
  color: var(--accent-bright);
}

/* ============================================================
   menu drawer (bottom sheet)
   ============================================================ */
.menu-drawer {
  border: 0;
  padding: 0;
  background: linear-gradient(180deg, #181f1c 0%, var(--surface) 100%);
  color: var(--text);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 540px;
  margin: auto auto 0;
  position: fixed;
  inset: auto 0 0 0;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}
.menu-drawer::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}
.menu-form {
  display: flex;
  flex-direction: column;
  padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
  position: relative;
}
.menu-form::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  width: 42px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
}
.menu-close {
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--text-soft);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  position: absolute;
  top: 16px;
  right: 14px;
}
.menu-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.20);
}
.menu-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 26px 0 4px;
}
.menu-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
}
.menu-user-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.install-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.08), var(--surface));
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.install-banner[hidden] { display: none; }
.install-banner-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}
.install-banner-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.install-banner-text strong { font-size: 14px; }
.install-banner-text .muted { font-size: 12px; line-height: 1.35; }
.install-banner .btn { padding: 8px 14px; font-size: 13px; flex-shrink: 0; }
.install-banner-close {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
}
.install-banner-close:hover { color: var(--text); }

.menu-user-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-bright);
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.menu-link {
  color: var(--text);
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 600;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0%, rgba(255, 255, 255, 0.008) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.12s;
}
.menu-link:hover {
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.08) 0%, rgba(46, 204, 113, 0.02) 100%);
  border-color: rgba(46, 204, 113, 0.30);
  transform: translateX(2px);
}
.menu-link.active {
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.14) 0%, rgba(46, 204, 113, 0.04) 100%);
  border-color: rgba(46, 204, 113, 0.40);
  color: var(--accent-bright);
}
.menu-logout {
  color: var(--bearish);
  margin-top: 8px;
}
.menu-logout:hover {
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.10) 0%, rgba(244, 63, 94, 0.02) 100%);
  border-color: rgba(244, 63, 94, 0.35);
  color: var(--bearish);
  transform: translateX(2px);
}

.menu-push {
  appearance: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
  justify-content: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.menu-push:disabled { opacity: 0.55; cursor: default; }
.menu-push .push-icon { font-size: 17px; line-height: 1; }

/* Help button — same shape as other menu items, neutral accent on hover. */
.menu-help {
  appearance: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

/* ---- admin invites ---- */
.invite-form {
  display: flex;
  gap: 8px;
  margin: 12px 0 4px;
  flex-wrap: wrap;
}
.invite-form input[type="text"] {
  flex: 1 1 200px;
  min-width: 0;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.invite-form input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}
.invite-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}
.invite-status-open    { background: var(--accent-soft); color: var(--accent-bright); border: 1px solid rgba(16,185,129,0.35); }
.invite-status-used    { background: var(--surface-3); color: var(--text-soft); border: 1px solid var(--border-soft); }
.invite-status-revoked { background: rgba(244,63,94,0.12); color: #fda4af; border: 1px solid rgba(244,63,94,0.3); }
.invite-code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  letter-spacing: 0;
}
.invite-card.invite-used    { opacity: 0.6; }
.invite-card.invite-revoked { opacity: 0.5; }

/* ---- owner email banner ---- */
.email-banner {
  background: linear-gradient(90deg, rgba(16,185,129,0.06), var(--surface));
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.email-banner h3 { margin: 0 0 4px; font-size: 14px; }
.email-banner p { margin: 0 0 10px; color: var(--text-soft); font-size: 13px; }
.email-banner-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.email-banner-form input[type="email"] {
  flex: 1 1 220px;
  min-width: 0;
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.email-banner-form input[type="email"]:focus { outline: none; border-color: var(--accent); }
.email-banner-pending {
  background: rgba(251, 191, 36, 0.06);
  border-left-color: var(--neutral);
}

/* ============================================================
   typography
   ============================================================ */
h1 {
  font-size: 28px;
  margin: 0 0 6px;
  font-weight: 800;
  letter-spacing: -0.025em;
}
h2 {
  font-size: 18px;
  margin: 0 0 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h2.section {
  margin-top: 36px;
  color: var(--text-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.bucket-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text);
}
.bucket-section-header a,
.bucket-section-header a:link,
.bucket-section-header a:visited,
.bucket-section-header a:hover,
.bucket-section-header a:active {
  color: var(--text);
  text-decoration: none;
  transition: color 0.12s;
}
.bucket-section-header a:hover { color: var(--accent-bright); }
.bucket-count {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
h3 { font-size: 15px; margin: 0 0 4px; font-weight: 600; letter-spacing: -0.01em; }

.muted { color: var(--muted); font-size: 13px; }

/* ============================================================
   hero
   ============================================================ */
.hero { padding: 12px 0 28px; }
.hero h1 {
  font-size: 36px;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tagline {
  color: var(--text-soft);
  font-size: 15px;
  max-width: 640px;
  margin: 0;
}

/* ============================================================
   stat grid — modernized to match the home-dashboard dash-tile
   design: subtle white gradient on the dark bg, soft hairline
   border, larger numerals, accent-tinted hover.
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 6px 0 18px;
}
.stat-grid-3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid-2 { grid-template-columns: repeat(2, 1fr); }

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 14px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.015) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.15s, transform 0.12s, background 0.15s;
}
.stat:hover {
  border-color: rgba(46, 204, 113, 0.35);
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.08) 0%, rgba(46, 204, 113, 0.02) 100%);
  transform: translateY(-1px);
}

.stat-link,
.stat-link:link,
.stat-link:visited,
.stat-link:hover,
.stat-link:active {
  text-decoration: none;
  color: var(--text);
}
.stat-link { display: flex; cursor: pointer; }
.stat-link:hover {
  border-color: rgba(46, 204, 113, 0.35);
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.08) 0%, rgba(46, 204, 113, 0.02) 100%);
}

.stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.stat-value.tiny { font-size: 15px; font-weight: 700; }

.stat-sub {
  color: var(--text-soft);
  font-size: 11px;
  margin-top: 2px;
}

/* ============================================================
   cards
   ============================================================ */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.card-link, .bucket-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.card-link:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}
.card-link p { margin: 6px 0 0; color: var(--text-soft); font-size: 13px; }

/* ============================================================
   bucket card on home (matches alert-card schema)
   ============================================================ */
/* =============================================================
   Modernized home dashboard (Active / Win Rate / Closed hero tiles
   + bucket cards with per-bucket accent colors).
   ============================================================= */

/* Top stat tiles — three across, larger numerals, neutral background
   with a soft surface gradient so they read as "cards" not buttons. */
.dash-hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 6px 0 24px;
}
.dash-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 14px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.015) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.12s, background 0.15s;
}
.dash-tile:hover {
  border-color: rgba(46, 204, 113, 0.35);
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.08) 0%, rgba(46, 204, 113, 0.02) 100%);
  transform: translateY(-1px);
}
.dash-tile-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.dash-tile-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.dash-tile-sub {
  font-size: 11px;
  margin-top: 2px;
}

/* Section header sits above the bucket grid. */
.dash-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 10px;
}
.dash-section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.dash-section-sub { font-size: 11px; }

/* Bucket cards — single column on mobile, two columns on wide screens.
   Each card uses a `--bucket-accent` CSS var to color the left border
   and the slots progress bar, so the four buckets are visually distinct. */
.bucket-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
@media (min-width: 720px) {
  .bucket-grid { grid-template-columns: repeat(2, 1fr); }
}
.bucket-card {
  --bucket-accent: #6b7280;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.012) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--bucket-accent);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
  position: relative;
}
.bucket-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.18);
  border-left-color: var(--bucket-accent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
.bucket-card-top {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bucket-card-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bucket-card-meta {
  font-size: 11px;
  color: var(--text-soft);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.bucket-card-progress {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.bucket-card-progress-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.bucket-card-progress-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.bucket-card-progress-value {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bucket-card-progress-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.bucket-card-progress-fill {
  height: 100%;
  background: var(--bucket-accent);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.bucket-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.bucket-card-holding {
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.bucket-card-holding-count {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.bucket-card-holding-label {
  font-size: 11px;
  color: var(--text-soft);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.bucket-card-tickers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}
.ticker-chip-more {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
}

/* Hide legacy classes that we replaced. */
.bucket-list { display: none; }
.bucket-link { display: none; }
.bucket-link-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}
.bucket-link-name {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bucket-link-meta {
  font-size: 12px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.bucket-link-stats {
  display: flex;
  gap: 14px;
  align-items: center;
}
.bucket-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}
.bucket-stat-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.bucket-stat-value {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bucket-link-tickers {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 4px;
  border-top: 1px dashed var(--border-soft);
  margin-top: 2px;
}

/* Legacy classes kept for any remaining references (no longer rendered on home) */
.bucket-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.bucket-stats { display: flex; gap: 18px; text-align: right; }
.mini-stat { display: flex; flex-direction: column; gap: 2px; }
.mini-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.mini-val { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bucket-tickers { margin-top: 12px; }

/* ============================================================
   bucket page
   ============================================================ */
.bucket-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 8px;
}
.bucket-header h1 {
  font-size: 26px;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.bucket-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0 14px;
}

/* Search + sort controls above the Incoming Alerts list. */
.bucket-controls {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
  align-items: stretch;
}
.bucket-search-input {
  flex: 1 1 auto;
  min-width: 0;  /* let the input shrink below its intrinsic content width */
}
.bucket-sort-select {
  flex: 0 0 auto;
  max-width: 220px;
  /* Native select picker — keep arrow visible */
  padding-right: 28px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.55) 50%),
    linear-gradient(135deg, rgba(255,255,255,0.55) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 9px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  appearance: none;
  -webkit-appearance: none;
}
.bucket-sort-select option {
  background: var(--surface);
  color: var(--text);
}
@media (max-width: 480px) {
  .bucket-controls { flex-wrap: wrap; }
  .bucket-search-input { flex-basis: 100%; }
  .bucket-sort-select { flex: 1 1 auto; max-width: none; }
}

.meta-pill {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.012) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 13px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.meta-label {
  font-size: 10px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-weight: 700;
}

.meta-value {
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ============================================================
   slot bar (bucket status)
   ============================================================ */
.slot-bar {
  display: flex;
  gap: 4px;
  align-items: center;
  margin: 12px 0 14px;
}

.slot {
  flex: 1;
  height: 8px;
  background: var(--surface-3);
  border-radius: 2px;
  transition: background 0.2s;
}
.slot.filled {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.slot-count {
  margin-left: 10px;
  font-weight: 700;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ============================================================
   ticker chip
   ============================================================ */
.ticker-chip {
  display: inline-block;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 9px;
  margin: 2px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

/* ============================================================
   tables
   ============================================================ */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.010) 100%);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.trades-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 760px;
}

.trades-table th,
.trades-table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
.trades-table tr:last-child td { border-bottom: none; }

.trades-table th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: sticky;
  top: 0;
}

.trades-table td { font-variant-numeric: tabular-nums; }
.trades-table tr:hover td { background: var(--surface-2); }
.trades-table .row-related td { opacity: 0.62; }
.trades-table .row-related:hover td { opacity: 1; }

/* When trades-table isn't inside a .table-scroll wrapper (existing templates) */
.trades-table:not(.table-scroll > *) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.010) 100%);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================================
   bias colors
   ============================================================ */
.bias-bullish { color: var(--bullish); font-weight: 600; }
.bias-bearish { color: var(--bearish); font-weight: 600; }
.bias-neutral { color: var(--neutral); font-weight: 600; }

/* ============================================================
   code / monospace
   ============================================================ */
code {
  font-family: var(--font-mono);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
  color: var(--text-soft);
}

/* ============================================================
   "updated" pill with pulsing dot
   ============================================================ */
.updated {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.updated::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--accent-glow);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

/* ============================================================
   empty state
   ============================================================ */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0%, rgba(255, 255, 255, 0.008) 100%);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  margin-top: 10px;
}
.empty .icon { font-size: 36px; margin-bottom: 12px; opacity: 0.55; }
.empty p { margin: 4px 0; }

/* ============================================================
   dialog (filter popup)
   ============================================================ */
.filter-dialog {
  background: linear-gradient(180deg, #181f1c 0%, var(--surface) 100%);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  padding: 0;
  width: 100%;
  max-width: 540px;
  max-height: min(90vh, 800px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.filter-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.dialog-head, .dialog-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
}
.dialog-head { border-bottom: 1px solid var(--border-soft); }
.dialog-head h2 { margin: 0; }
.dialog-foot { border-top: 1px solid var(--border-soft); gap: 10px; justify-content: flex-end; }
.dialog-body { padding: 20px; display: grid; gap: 18px; }
.filter-toggles { display: grid; gap: 0; border-top: 1px solid var(--border-soft); padding-top: 16px; }

.dialog-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  line-height: 1;
}
.dialog-close:hover { background: var(--surface-2); color: var(--text); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field input, .field textarea {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.12s, background 0.12s;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: rgba(46, 204, 113, 0.55);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input { font-variant-numeric: tabular-nums; }
.field textarea { font-family: var(--font-mono); resize: vertical; min-height: 60px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { color: var(--muted); font-size: 12px; }
.label-text {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* ============================================================
   buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  color: #04211a;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent-bright));
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.14);
}
.btn-secondary:hover {
  background: rgba(46, 204, 113, 0.10);
  border-color: rgba(46, 204, 113, 0.35);
  color: var(--accent-bright);
}
.btn-danger {
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.35);
}
.btn-danger:hover {
  background: rgba(244, 63, 94, 0.22);
  border-color: rgba(244, 63, 94, 0.55);
  color: #fecdd3;
  transform: translateY(-1px);
}

/* Bot settings page — danger zone holds the irreversible Reset button.
   Separated by a hairline + danger-tinted card so the destructive action
   doesn't sit next to the routine Save/Cancel buttons. */
.cfg-danger-zone {
  margin-top: 28px;
  padding: 16px 16px 18px;
  border: 1px solid rgba(244, 63, 94, 0.30);
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.06) 0%, rgba(244, 63, 94, 0.015) 100%);
  border-radius: 12px;
}
.cfg-danger-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #fda4af;
}
.cfg-danger-zone .cfg-hint {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.5;
}

/* ============================================================
   banners
   ============================================================ */
.banner {
  padding: 11px 14px;
  border-radius: 10px;
  margin: 12px 0;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid;
  letter-spacing: 0.01em;
}
.banner-success { background: rgba(16, 185, 129, 0.10); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.35); }
.banner-warning { background: rgba(251, 191, 36, 0.10); color: #fde68a; border-color: rgba(251, 191, 36, 0.35); }

/* ============================================================
   chart wrap
   ============================================================ */
.chart-wrap {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.012) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 18px;
  margin: 12px 0 18px;
}
.chart-wrap canvas { width: 100% !important; height: 220px !important; }

/* ============================================================
   responsive
   ============================================================ */
@media (max-width: 1000px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
  main { padding: 22px 0 0; }
  .hero h1 { font-size: 28px; }
  .bucket-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .bucket-row { flex-direction: column; gap: 10px; }
  .bucket-stats { justify-content: flex-start; text-align: left; }
  .field-row { grid-template-columns: 1fr; }
}

/* Mobile: hide non-essential table columns marked .mobile-hide */
@media (max-width: 700px) {
  .mobile-hide { display: none !important; }
  .trades-table { min-width: 0; font-size: 12px; }
  .trades-table th, .trades-table td { padding: 8px 6px; white-space: nowrap; }
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

.legend {
  font-size: 11px;
  margin-top: 8px;
}

/* ---------- action buttons in tables ---------- */
.actions-cell {
  white-space: nowrap;
}
.act-btn {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  margin-right: 4px;
  transition: all 0.12s;
}
.act-btn:hover { transform: translateY(-1px); }
.act-btn:active { transform: translateY(0); }
.act-take:hover    { background: rgba(16, 185, 129, 0.2); border-color: var(--bullish); }
.act-exit:hover    { background: rgba(16, 185, 129, 0.2); border-color: var(--bullish); }
.act-dismiss:hover { background: rgba(244, 63, 94, 0.18); border-color: var(--bearish); }
.state-done {
  font-size: 14px;
  opacity: 0.7;
}

/* Non-interactive state indicator (filled chip showing current action state) */
.act-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  font-size: 14px;
  line-height: 1;
  border-radius: 6px;
  margin-right: 4px;
  cursor: default;
  user-select: none;
  flex-shrink: 0;
}
.act-state.act-dismiss-filled {
  background: rgba(244, 63, 94, 0.22);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #fda4af;
}

/* Exit-signal badge on active trade cards when the bot has detected a
   closing fill on the underlying contract. The user still has to ✅
   manually — the badge is just a heads-up, not an auto-exit. */
.exit-signal-pill {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #fda4af;
  white-space: nowrap;
  flex-shrink: 0;
}
/* Skew tier pill — different color from the red EXIT? pill so the user can
   tell at a glance which detector fired. Skew = cumulative bid-side volume
   reaching a tier (40/50/60/70/80%); EXIT? = a single large closing fill. */
.skew-pill {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fbbf24;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Bot trader page — paper-trading dashboard. The snapshot tiles mirror the
   home dash-tile schema (subtle gradient bg, accent hover, bold numerals)
   so the bot page reads as part of the same surface as the rest of the app. */
.bot-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}
.bot-header h1 { margin: 0 0 4px; font-size: 22px; }
.bot-snapshot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.bot-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 14px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.015) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.15s, transform 0.12s, background 0.15s;
}
.bot-stat:hover {
  border-color: rgba(46, 204, 113, 0.35);
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.08) 0%, rgba(46, 204, 113, 0.02) 100%);
  transform: translateY(-1px);
}
.bot-stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.10em;
}
.bot-stat-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.bot-stat-sub {
  font-size: 11px;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
}

/* Summary contract count — one size smaller than .bot-pnl, no background */
.summary-ct {
  display: inline-flex;
  align-items: center;
  font-size: 8px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  background: none;
  padding: 0;
}

/* Closed positions collapsible section */
.closed-section { margin-top: 36px; }
.closed-section-toggle {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: 12px;
  user-select: none;
}
.closed-section-toggle::-webkit-details-marker { display: none; }
.closed-section-toggle::after {
  content: '›';
  font-size: 14px;
  line-height: 1;
  transition: transform 0.18s;
}
.closed-section[open] > .closed-section-toggle::after { transform: rotate(90deg); }

/* Buying Power card — clickable */
.bp-trigger { cursor: pointer; }
.bp-chevron { font-size: 14px; color: var(--text-soft); margin-left: 2px; }

/* Buying Power dialog / bottom sheet */
.bp-dialog {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  margin: 0 auto;
  max-width: 480px;
  width: 100%;
  border: none;
  border-radius: 16px 16px 0 0;
  background: var(--surface, #1a1a1a);
  color: var(--text, #fff);
  padding: 0;
  box-shadow: 0 -4px 32px rgba(0,0,0,0.5);
}
.bp-dialog::backdrop { background: rgba(0,0,0,0.55); }
.bp-dialog-inner { padding: 20px 20px 36px; }
.bp-back {
  background: none; border: none; color: var(--text-soft);
  font-size: 22px; cursor: pointer; padding: 0; line-height: 1;
}
.bp-dialog-title {
  font-size: 18px; font-weight: 700; margin: 12px 0 4px;
}
.bp-dialog-amount {
  font-size: 32px; font-weight: 800;
  letter-spacing: -0.02em; margin-bottom: 24px;
}
.bp-dialog-rows {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bp-dialog-row { display: flex; justify-content: space-between; font-size: 14px; }
.bp-dialog-row-label { color: var(--text-soft); }
.bp-dialog-row-value { font-variant-numeric: tabular-nums; }
.bp-dialog-row--total .bp-dialog-row-label,
.bp-dialog-row--total .bp-dialog-row-value { font-weight: 700; color: var(--text, #fff); }

.bot-pnl {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}

.bot-er-loss, .bot-er-win, .bot-er-skew, .bot-er-neutral {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  flex-shrink: 0;
  white-space: nowrap;
  border: 1px solid;
}
.bot-er-loss    { background: rgba(244,63,94,0.18);   color: #fda4af; border-color: rgba(244,63,94,0.4); }
.bot-er-win     { background: rgba(16,185,129,0.18);  color: #6ee7b7; border-color: rgba(16,185,129,0.4); }
.bot-er-skew    { background: rgba(251,146,60,0.18);  color: #fdba74; border-color: rgba(251,146,60,0.4); }
.bot-er-neutral { background: rgba(251,191,36,0.14);  color: #fde68a; border-color: rgba(251,191,36,0.35); }

/* Bias stack — wraps the BULL/BEAR pill. When an exit/skew alert is firing,
   the wrapper switches to a vertical column with the alert pill on TOP and
   a slightly shrunk bias pill below. With no alert, it's just the normal
   bias pill — looks identical to before. Score chip stays in its slot. */
.bias-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  gap: 2px;
}
.bias-stack--alert .bias-pill {
  font-size: 9px;
  padding: 1px 5px;
  height: 15px;
  letter-spacing: 0.06em;
}
.bias-stack--alert .skew-pill,
.bias-stack--alert .exit-signal-pill,
.bias-stack--alert .agg-pill,
.bias-stack--alert .spread-pill {
  font-size: 9px;
  padding: 1px 5px;
  letter-spacing: 0.04em;
  line-height: 1.1;
  height: 15px;
}
.alert-card.has-exit-signal .exit-signal-pill {
  animation: exit-pulse 2.4s ease-in-out infinite;
}
@keyframes exit-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.0); }
  50%      { box-shadow: 0 0 8px 1px rgba(244, 63, 94, 0.35); }
}

@media (max-width: 640px) {
  header .container { padding: 0 14px; }
  header { padding: 10px 0; }
  .header-inner { gap: 14px; }
  .stat-grid, .stat-grid-3, .stat-grid-2 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 12px 12px 10px; }
  .stat-value { font-size: 22px; }
  .stat-value.tiny { font-size: 14px; }
  .bot-snapshot { grid-template-columns: repeat(2, 1fr); }
  .bot-stat { padding: 12px 12px 10px; }
  .bot-stat-value { font-size: 18px; }
  .meta-pill { padding: 8px 12px; }
  .bucket-meta { grid-template-columns: 1fr; }
  .filter-dialog { max-width: calc(100vw - 24px); margin: 12px; }
  .dialog-body { padding: 16px; }
  .ticker-chip { font-size: 10px; padding: 2px 6px; }
  .bn-item { font-size: 10px; }
  .bn-item svg { width: 20px; height: 20px; }
}

@media (max-width: 400px) {
  .hero h1 { font-size: 24px; }
  .stat-value { font-size: 20px; }
  .bot-stat-value { font-size: 17px; }
  h1 { font-size: 22px; }
  .bucket-header h1 { font-size: 22px; }
}

/* ============================================================
   login page
   ============================================================ */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 24px;
  background: radial-gradient(ellipse at top, rgba(16, 185, 129, 0.08) 0%, var(--bg) 60%);
}

.login-shell {
  width: 100%;
  max-width: 380px;
}

.login-card {
  background: linear-gradient(180deg, #181f1c 0%, var(--surface) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.login-mark {
  width: 32px;
  height: 32px;
  color: var(--accent);
  filter: drop-shadow(0 0 12px var(--accent-glow));
}

.login-brand h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.login-tag {
  margin: 0 0 22px;
  font-size: 13px;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-submit {
  width: 100%;
  justify-content: center;
  padding: 11px 16px;
  margin-top: 4px;
}

.login-meta {
  margin-top: 20px;
  font-size: 12px;
  text-align: center;
}

/* ============================================================
   confirm modal (replaces browser's "amyotrades.com says" prompt)
   ============================================================ */
.confirm-dialog {
  background: linear-gradient(180deg, #161d1a 0%, var(--surface) 100%);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 340px;
  width: calc(100vw - 40px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--accent-glow);
}
.confirm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
}
.confirm-body { padding: 24px 22px 18px; }
#confirm-message {
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  margin: 0 0 20px;
  color: var(--text);
  line-height: 1.45;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.btn-confirm {
  appearance: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.1s, background 0.15s, border-color 0.15s;
  min-width: 100px;
}
.btn-confirm:active { transform: translateY(1px); }
.btn-confirm-cancel {
  background: var(--surface-2);
  border-color: var(--border-soft);
  color: var(--text-soft);
}
.btn-confirm-cancel:hover { background: var(--surface-3); color: var(--text); border-color: var(--border); }
.btn-confirm-ok {
  background: var(--accent);
  color: #052e1c;
}
.btn-confirm-ok:hover { background: var(--accent-bright); }

/* ============================================================
   alert cards (expandable rows, replaces trades-table)
   ============================================================ */
.alert-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.alert-card {
  --side-color: rgba(255, 255, 255, 0.10);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.012) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--side-color);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
/* Side-based left edge — replaces the small side-dot inside the summary.
   ASK fills = bullish (green), BID fills = bearish (red), MID = neutral (yellow).
   Uses :has() so the bar follows the primary alert's side and ignores nested
   related-fill dots inside the expanded card. */
.alert-card:has(> .alert-summary > .side-dot.side-ask) { --side-color: var(--bullish); }
.alert-card:has(> .alert-summary > .side-dot.side-bid) { --side-color: var(--bearish); }
.alert-card:has(> .alert-summary > .side-dot.side-mid) { --side-color: #3b82f6; }
.alert-card:hover {
  border-top-color: rgba(255, 255, 255, 0.16);
  border-right-color: rgba(255, 255, 255, 0.16);
  border-bottom-color: rgba(255, 255, 255, 0.16);
}
.alert-card[open] {
  border-top-color: rgba(46, 204, 113, 0.30);
  border-right-color: rgba(46, 204, 113, 0.30);
  border-bottom-color: rgba(46, 204, 113, 0.30);
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.05) 0%, rgba(255, 255, 255, 0.012) 100%);
}
.alert-card.alert-related { opacity: 0.78; }
/* Hide the small side-dot inside the summary — its job is now done by the
   left-edge color bar. Keep .side-dot visible inside .related-fills so the
   per-fill side is still readable there. */
.alert-summary > .side-dot { display: none; }

.alert-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 40px 8px 12px;  /* right padding reserves space for the abs-positioned chevron + a gap so chips don't touch it */
  cursor: pointer;
  list-style: none;
  user-select: none;
  position: relative;
  /* Let the browser keep vertical scrolling but hand horizontal pans to our
     swipe-to-action handler. Without this, the browser fights the JS for
     horizontal touch events and the swipe never registers. */
  touch-action: pan-y;
}
.alert-summary .actions { flex-shrink: 0; }
/* Chevron pinned to the top-right of the summary regardless of how much
   content sits in the row. Pills are free to wrap below; the chev stays put. */
.alert-summary .chev {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--text-soft);
}
.alert-card[open] .alert-summary .chev {
  transform: translateY(-50%) rotate(180deg);
}
.alert-summary .multi-chip { flex-shrink: 0; }
.alert-summary .score-chip { flex-shrink: 0; }

/* Stack the expiry date on top of the score-chip, sitting next to the
   contract pill. Frees up the right side of the summary for the in-line
   action buttons (Take/Dismiss/Exit) while keeping the score visible
   without expanding the card. */
.alert-summary .expiry-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}
.alert-summary .expiry-stack .expiry {
  font-size: 11px;
  line-height: 1.1;
}
.alert-summary .expiry-stack .score-chip {
  height: 18px;
  width: 32px;
  font-size: 11px;
  padding: 0;
  line-height: 18px;
}

/* Action buttons sitting in the summary row, just before the chevron.
   Compact icon-only style — emoji is the affordance, the `title` attr
   gives accessibility. clicks stopPropagation/preventDefault on the
   buttons so they don't toggle the details element. */
.alert-summary .summary-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.act-btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  border-radius: 8px;
  margin: 0;
}
.summary-sweep {
  color: var(--neutral);
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.4));
}
.alert-summary::-webkit-details-marker { display: none; }
.alert-summary::marker { content: ""; }

.alert-summary .ticker {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.side-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}
.side-ask  { background: var(--bullish); color: var(--bullish); }
.side-bid  { background: var(--bearish); color: var(--bearish); }
.side-mid  { background: var(--neutral); color: var(--neutral); }

.contract-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.contract-call {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.contract-put {
  background: rgba(244, 63, 94, 0.16);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.expiry {
  font-size: 12px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.score-chip {
  background: var(--surface-3);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  padding: 3px 0;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  width: 34px;
  text-align: center;
  flex-shrink: 0;
}
.score-chip.high {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  color: #052e1c;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.45);
}

/* P&L chips (closed-trade cards) */
.pnl-chip {
  font-weight: 700;
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pnl-chip-win {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.pnl-chip-loss {
  background: rgba(244, 63, 94, 0.18);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.4);
}
.pnl-chip-na {
  background: var(--surface-3);
  color: var(--text-soft);
}
/* Active trade card layout: contract pill + date/score form a compact column */
.contract-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
/* Smaller pill when inside the active-trade contract column */
.contract-col .contract-pill {
  font-size: 11px;
  padding: 2px 7px;
}
/* Live P&L chip cell — sits between bias stack and action buttons, no stretching */
.live-pnl-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
}

/* Live P&L chip — shown on active trade summary rows */
.live-pnl {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.live-pnl-win  { background: rgba(16, 185, 129, 0.15); color: var(--bullish); }
.live-pnl-loss { background: rgba(244, 63, 94, 0.12);  color: var(--bearish); }
.live-pnl-flat { background: var(--surface-3); color: var(--text-soft); }

/* Closed-trade cards intentionally have no accent border — the green/red
   pnl-chip alone communicates win/loss without doubling up on the card. */

.alert-summary .actions {
  display: inline-flex;
  gap: 4px;
}
.alert-summary .act-btn { margin: 0; }

.chev {
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
.alert-card[open] .chev {
  transform: rotate(180deg);
}

.alert-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.015);
}
.detail-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.alert-summary .expiry-stack .contract-pill {
  font-size: 11px;
  padding: 2px 7px;
}
.detail-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.detail-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.detail-value {
  font-size: 13px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-value code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-soft);
}
.oi-detail { font-size: 11px; }
.oi-stamp {
  font-size: 9px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}

.sweep { color: var(--neutral); }

/* Tighter pack on phones; ticker + pill stay readable, score + actions stay tappable */
@media (max-width: 640px) {
  .alert-summary {
    gap: 6px;
    padding: 8px 30px 8px 11px;
  }
  .alert-summary .ticker { font-size: 14px; }
  .contract-pill { font-size: 12px; padding: 3px 7px; }
  .expiry { font-size: 11px; }
  .score-chip { font-size: 12px; width: 30px; }
  .alert-detail { grid-template-columns: 1fr 1fr; padding: 11px 12px 13px; gap: 8px 14px; }
  .act-btn { padding: 5px 8px; font-size: 13px; margin-right: 2px; }
}
@media (max-width: 380px) {
  .alert-summary { gap: 5px; padding: 10px 9px; }
  .alert-summary .actions { gap: 2px; }
  .act-btn { padding: 4px 6px; }
  .expiry { font-size: 10px; }
}

/* Notification badges — top-right pill on bucket cards (home), inline pill
   on menu links, small red dot on the bottom-nav menu button. Visibility is
   controlled by the .is-visible class rather than the [hidden] attribute —
   Safari has quirky behavior toggling the boolean attribute via el.hidden on
   absolute-positioned elements after htmx swaps. */
.notif-badge {
  display: none;
  position: absolute;
  top: 10px;
  right: 12px;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  pointer-events: none;
  z-index: 100;
}
.notif-badge.is-visible { display: inline-flex; }
.notif-badge-inline {
  position: static;
  margin-left: auto;
}
.bn-menu-icon-wrap {
  position: relative;
  display: inline-flex;
}
.notif-dot {
  display: none;
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bearish, #e74c3c);
  box-shadow: 0 0 0 2px var(--surface);
  pointer-events: none;
}
.notif-dot.is-visible { display: block; }

/* Swipe-to-action visual feedback. The .alert-card gets overflow:hidden so
   the translated summary doesn't escape the card; colored gradients reveal
   on either side as the user drags, signaling what action will fire if they
   complete the swipe (left = take/exit green, right = dismiss red). */
.alert-card { overflow: hidden; }
.alert-card.swiping summary.alert-summary {
  will-change: transform;
  position: relative;
  z-index: 1;
}
.alert-card::before,
.alert-card::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #fff;
  z-index: 0;
}
/* Left half — revealed when swiping LEFT (positive action) */
.alert-card::before {
  left: 0;
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.95), rgba(34, 197, 94, 0));
  content: "✓ TAKE";
  justify-content: flex-start;
}
.alert-card.swiping-left::before { opacity: 1; }
.alert-card.swipe-armed.swiping-left::before {
  background: linear-gradient(90deg, rgba(34, 197, 94, 1), rgba(34, 197, 94, 0.2));
}
/* Right half — revealed when swiping RIGHT (negative action) */
.alert-card::after {
  right: 0;
  background: linear-gradient(270deg, rgba(239, 68, 68, 0.95), rgba(239, 68, 68, 0));
  content: "DISMISS ✕";
  justify-content: flex-end;
}
.alert-card.swiping-right::after { opacity: 1; }
.alert-card.swipe-armed.swiping-right::after {
  background: linear-gradient(270deg, rgba(239, 68, 68, 1), rgba(239, 68, 68, 0.2));
}
/* On active-trade cards the swipe-left action is EXIT not TAKE — re-label
   based on which action button the card actually carries. */
.alert-card:has(.act-btn.act-exit)::before { content: "✓ EXIT"; }

/* Action buttons inside the expanded details — desktop / fallback when swipe
   isn't practical. Spans full width, two side-by-side. */
.detail-actions {
  display: flex;
  gap: 10px;
  padding: 8px 14px 14px;
  border-top: 1px dashed var(--border-soft);
}
.detail-actions .act-btn {
  flex: 1 1 0;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
}
.detail-actions .act-state {
  flex: 1 1 0;
  text-align: center;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-soft);
}
.detail-actions .state-done {
  flex: 1 1 0;
  text-align: center;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--bullish);
}

/* Inline "5.40 ASK" cell — option contract price + trigger side, sitting next
   to the expiry. Same font-size as expiry; only the side label is color-coded. */
.price-cell {
  font-size: 12px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.price-side { color: var(--text-soft); font-weight: 700; }
.price-side[data-side="ask"],
.price-side[data-side="bid"],
.price-side[data-side="mid"] { color: var(--text-soft); }

/* Yellow "new since last visit" dot — inline inside the summary, half the
   size of the side-dot so it reads as a marker, not a competing indicator.
   Hidden once the user expands the card or after a tap (.alert-seen) so we
   never depend on the flaky toggle-event capture path to dismiss it. */
.alert-card { position: relative; }
.alert-card[open] .new-dot,
.alert-card.alert-seen .new-dot { display: none; }
.new-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 6px 1px rgba(251, 191, 36, 0.85);
  pointer-events: none;
}

/* MID side gets blue — the original neutral color was yellow, which clashed
   with the new-since-last-visit dot. */
.side-dot.side-mid { background: #3b82f6; color: #3b82f6; }

/* Bias pill in the alert summary row — shows the directional read of the
   flow (Bullish = call buys / put sells, Bearish = call sells / put buys). */
.bias-pill {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}
.bias-pill.bias-bullish { background: rgba(46, 204, 113, 0.18); color: var(--bullish, #2ECC71); }
.bias-pill.bias-bearish { background: rgba(244, 63, 94, 0.18); color: var(--bearish, #f43f5e); }
.bias-pill.bias-neutral { background: rgba(59, 130, 246, 0.18); color: #3b82f6; }

/* Spread / multileg indicator — warns the viewer that the flow comes from a
   paired spread leg or other multileg structure, not a clean directional
   bet. Same shape as bias-pill so the row stays visually consistent. */
.spread-pill {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  flex-shrink: 0;
  background: rgba(234, 179, 8, 0.16);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.35);
}

/* Dismissed alert card — dim the whole card so it's visually distinct from
   fresh/undecided cards. The dim state persists through hover and expansion;
   the only way to bring it back to full brightness is the 👍 Re-take action,
   which removes the alert-dismissed class. */
.alert-card.alert-dismissed {
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

/* Today's Alerts / Past Alerts collapsible sections in the incoming-alerts
   list. Wraps the existing card lists in a slim native <details>. */
.alert-section {
  margin-bottom: 14px;
}
.alert-section-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 8px;
}
.alert-section-summary::-webkit-details-marker { display: none; }
.alert-section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.alert-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
}
.alert-section-summary .chev {
  margin-left: auto;
  width: 16px;
  height: 16px;
  color: var(--text-soft);
  transition: transform 0.18s ease;
}
.alert-section[open] > .alert-section-summary .chev {
  transform: rotate(180deg);
}
.alert-section-empty {
  font-size: 12px;
  margin: 6px 4px 0;
}

/* Bot status pill (enabled / disabled) shown above the bot account snapshot.
   Same shape as the bias / agg / spread pills so the page feels consistent. */
.bot-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 10px;
}
.bot-status-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.bot-status-on  { background: rgba(46, 204, 113, 0.18); color: #2ECC71; border: 1px solid rgba(46, 204, 113, 0.35); }
.bot-status-off { background: rgba(255, 255, 255, 0.06); color: var(--text-soft); border: 1px solid rgba(255, 255, 255, 0.18); }

.bot-config-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin-bottom: 14px;
}

.bot-config-intro {
  margin: 0 0 18px;
  font-size: 12px;
}
.cfg-section-heading {
  font-size: 15px;
  font-weight: 700;
  margin: 28px 0 2px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text, #fff);
}
.cfg-section-heading--first {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.bot-config-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 560px;
}
.cfg-section {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cfg-section:last-of-type {
  border-bottom: none;
}
.cfg-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cfg-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}
.cfg-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 6px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
.cfg-input:focus {
  outline: none;
  border-color: rgba(46, 204, 113, 0.55);
  background: rgba(255, 255, 255, 0.06);
}
.cfg-input--narrow {
  width: 90px;
}
.cfg-hint {
  font-size: 11px;
  color: var(--text-soft);
  margin: 8px 0 0;
}

/* Bucket / category chip group — multi-select pills. Hide the native
   checkbox visually but keep it accessible. Selected pills get a green
   tint so the user can see at a glance which are on. */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  cursor: pointer;
}
.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.chip-pill {
  display: inline-block;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.02em;
  text-transform: capitalize;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.chip input:checked + .chip-pill {
  background: rgba(46, 204, 113, 0.16);
  border-color: rgba(46, 204, 113, 0.45);
  color: #2ECC71;
}
.chip input:focus-visible + .chip-pill {
  outline: 2px solid rgba(46, 204, 113, 0.55);
  outline-offset: 2px;
}

/* Toggle rows (Skip spread / Skip aggregate). Checkbox left, title +
   sub-text right. Compact stack so they don't dominate the form. */
.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  cursor: pointer;
}
.toggle-row + .toggle-row {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: #2ECC71;
  cursor: pointer;
  flex-shrink: 0;
}
.toggle-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
  line-height: 1.35;
}
.toggle-title {
  font-weight: 600;
  color: var(--text);
}
.toggle-sub {
  font-size: 11px;
  color: var(--text-soft);
}
.toggle-sub .spread-pill,
.toggle-sub .agg-pill {
  height: 14px;
  padding: 0 5px;
  font-size: 9px;
  vertical-align: 1px;
}

.bot-config-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Aggregate indicator — flags alerts that qualified via the session-cumulative
   bypass rather than a single qualifying print. Tells the viewer "this entry
   is the sum of N prints across the session, not one big trade". White, to
   sit visually neutral next to the colored bias / spread pills. */
.agg-pill {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

/* Multi-fill chip on the alert summary — shown when one contract had more
   than one alert today and they've been consolidated into a single card. */
.multi-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-soft);
  border: 1px solid var(--border-soft);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* "Related fills" sub-list inside an expanded alert card. Shown when there
   are sibling alerts on the same contract grouped under this primary one. */
.related-fills {
  border-top: 1px dashed var(--border-soft);
  padding: 8px 14px 12px;
}
.related-fills-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  margin-bottom: 6px;
}
.related-fills-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.related-fill {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.related-fill:not(:last-child) {
  border-bottom-color: rgba(255, 255, 255, 0.03);
}
.related-fill-time { color: var(--text-soft); white-space: nowrap; }
.related-fill-vol  { color: var(--text); white-space: nowrap; }
.related-fill-prem { color: var(--text); white-space: nowrap; }
/* Push the bias + score chips to the far right, leaving the left cluster
   (dot, time, premium, vol) to sit naturally next to each other. */
.related-fill .bias-pill { margin-left: auto; }

/* ============================================================
   help dialog — in-app guide opened from the menu drawer
   ============================================================ */
.help-dialog {
  border: 0;
  padding: 0;
  background: linear-gradient(180deg, #181f1c 0%, var(--surface) 100%);
  color: var(--text);
  border-radius: 14px;
  width: calc(100% - 20px);
  max-width: 560px;
  max-height: 88vh;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.help-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}
.help-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #181f1c 0%, rgba(20, 26, 23, 0.92) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1;
}
.help-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.help-body {
  padding: 16px 18px 22px;
  overflow-y: auto;
  max-height: calc(88vh - 56px);
  -webkit-overflow-scrolling: touch;
}
.help-body h3 {
  margin: 18px 0 6px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-bright);
}
.help-body h3:first-child { margin-top: 4px; }
.help-body p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-soft);
}
.help-body p strong { color: var(--text); }
.help-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0%, rgba(255, 255, 255, 0.008) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}
.help-row > .help-row-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-soft);
}
.help-row > .help-row-text strong { color: var(--text); font-weight: 700; }
.help-row > .help-row-visual {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
}
.help-edge-demo {
  width: 50px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.help-edge-demo.ask { border-left: 3px solid var(--bullish); }
.help-edge-demo.bid { border-left: 3px solid var(--bearish); }
.help-edge-demo.mid { border-left: 3px solid #3b82f6; }
.help-dot-demo {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 8px 2px rgba(251, 191, 36, 0.85);
}

/* Example alert card shown inside the help dialog. Uses real .alert-card
   classes so it renders exactly like a live alert — green left bar from
   the ASK side-dot, BULL+AGG pills stacked, glowing 92 score. We force
   the yellow new-dot visible even though the card is rendered `open`. */
.help-example-card {
  margin: 4px 0 6px;
  cursor: default;
}
.help-example-card .alert-summary { cursor: pointer; }
.help-example-card.alert-card[open] .new-dot,
.help-example-card .new-dot {
  display: inline-block;
}

/* Welcome banner — only visible when the help dialog is opened via the
   welcome-mode flow (new accounts). Tells the user to scroll to the bottom. */
.welcome-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.10) 0%, rgba(46, 204, 113, 0.02) 100%);
  border: 1px solid rgba(46, 204, 113, 0.35);
}
.welcome-banner-icon {
  font-size: 22px;
  line-height: 1.1;
  flex-shrink: 0;
}
.welcome-banner strong {
  font-size: 14px;
  color: var(--accent-bright);
  display: block;
  margin-bottom: 2px;
}
.welcome-banner .muted { font-size: 12px; line-height: 1.45; }

/* Continue button at the bottom of the welcome-mode help. Only visible in
   welcome-mode, and only reachable after the user has scrolled all the way
   down through the guide. */
.welcome-continue {
  margin: 18px 0 8px;
  text-align: center;
}
.welcome-continue-btn {
  width: 100%;
  justify-content: center;
  padding: 14px 18px;
  font-size: 15px;
}

/* In welcome-mode the dialog has no × close button, no ESC dismiss. The only
   way out is the continue button at the very bottom of the body. */
.help-dialog.welcome-mode .dialog-close {
  display: none;
}

/* iOS install prompt — modal popup that fires on home page load for iOS
   users who haven't installed AMYO yet. Replaces the old inline banner so
   users can't miss it. */
.install-prompt {
  border: 0;
  padding: 0;
  background: linear-gradient(180deg, #181f1c 0%, var(--surface) 100%);
  color: var(--text);
  border-radius: 16px;
  width: calc(100% - 28px);
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}
.install-prompt::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}
.install-prompt-close-x {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--text-soft);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.install-prompt-close-x:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}
.install-prompt-body {
  padding: 26px 22px 22px;
  text-align: center;
}
.install-prompt-icon {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px rgba(46, 204, 113, 0.35));
}
.install-prompt-body h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.install-prompt-tagline {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
}
.install-prompt-hint-box {
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.10) 0%, rgba(46, 204, 113, 0.02) 100%);
  border: 1px solid rgba(46, 204, 113, 0.30);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 16px;
}
.install-prompt-hint-box p {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
}
.install-prompt-hint-box strong { color: var(--text); }
.share-icon {
  display: inline-block;
  font-size: 14px;
  color: #0a84ff;
  vertical-align: -1px;
  padding: 0 2px;
}
.install-prompt-steps {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  counter-reset: step;
  text-align: left;
}
.install-prompt-steps li {
  position: relative;
  padding: 8px 8px 8px 36px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-soft);
  counter-increment: step;
}
.install-prompt-steps li strong { color: var(--text); }
.install-prompt-steps li::before {
  content: counter(step);
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  color: #04211a;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.install-prompt-ok-btn {
  width: 100%;
  justify-content: center;
  padding: 12px 16px;
  font-size: 15px;
}

/* Related BID activity inside an active-trade card. Shown when BID alerts
   exist on the same ticker but a DIFFERENT contract than the one being
   held — they're confluence/exit-signal context for the held position,
   not standalone tradeable signals. Includes a bucket badge so the user
   knows the natural DTE bucket of the cross-contract alert. */
.related-bids {
  border-top: 1px dashed rgba(244, 63, 94, 0.25);
  background: rgba(244, 63, 94, 0.025);
  padding: 8px 14px 12px;
}
.related-bids-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fda4af;
  margin-bottom: 6px;
}
.related-bids-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.related-bid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.related-bid:not(:last-child) {
  border-bottom-color: rgba(244, 63, 94, 0.06);
}
.related-bid-prem,
.related-bid-vol { color: var(--text); white-space: nowrap; }
.related-bid .score-chip { margin-left: auto; }

/* Bucket badge — small pill inside the related-bid row showing the BID
   alert's natural DTE bucket (e.g., "Leaps" on a 1/15/27 BID surfaced
   under a Weeklies position). Color-matched to the home dashboard's
   bucket accent palette so the user can recognize which DTE bucket the
   cross-contract alert is from at a glance. */
.bucket-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  border: 1px solid rgba(255, 255, 255, 0.10);
}
.bucket-badge.bucket-badge-weeklies {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}
.bucket-badge.bucket-badge-short_term {
  background: rgba(236, 72, 153, 0.14);
  color: #f9a8d4;
  border-color: rgba(236, 72, 153, 0.35);
}
.bucket-badge.bucket-badge-mid_term {
  background: rgba(168, 85, 247, 0.14);
  color: #d8b4fe;
  border-color: rgba(168, 85, 247, 0.35);
}
.bucket-badge.bucket-badge-leaps {
  background: rgba(6, 182, 212, 0.14);
  color: #67e8f9;
  border-color: rgba(6, 182, 212, 0.35);
}

/* ---- Push gear icon (span inside the push button) ---- */
.menu-push-gear {
  margin-left: auto;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1;
  cursor: pointer;
}
.menu-push[data-state="subscribed"] .menu-push-gear {
  color: rgba(52, 211, 153, 0.65);
}

/* ── Bot chooser landing (/bot/select) ──────────────────────────────────── */
.bot-select-sub {
  margin-top: -4px;
  margin-bottom: 18px;
}
.bot-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 700px) {
  .bot-select-grid { grid-template-columns: 1fr; }
}
.bot-select-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px 16px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.bot-select-card:hover {
  transform: translateY(-2px);
  border-color: rgba(52, 211, 153, 0.35);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.08);
}
.bot-select-options { border-left-color: var(--accent); }
.bot-select-rh     { border-left-color: #cdef47; } /* Robinhood-y lime accent */
.bot-select-rh:hover {
  border-color: rgba(205, 239, 71, 0.35);
  box-shadow: 0 6px 24px rgba(205, 239, 71, 0.08);
}
.bot-select-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bot-select-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  border-radius: 9px;
  color: var(--text-soft);
  flex-shrink: 0;
}
.bot-select-icon svg { width: 20px; height: 20px; }
.bot-select-rh .bot-select-icon { color: #cdef47; }
.bot-select-options .bot-select-icon { color: var(--accent-bright); }
.bot-select-titles {
  flex: 1;
  min-width: 0;
}
.bot-select-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.1;
}
.bot-select-titles .bot-select-sub {
  font-size: 12px;
  line-height: 1.2;
  margin: 2px 0 0;
}
.bot-select-status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  white-space: nowrap;
}
.bot-select-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.bot-select-stat-empty {
  grid-column: span 3;
  font-size: 13px;
  padding: 6px 0;
}
.bot-select-stat {
  background: var(--surface-3);
  padding: 10px 10px 9px;
  border-radius: 9px;
  min-width: 0;
}
.bot-select-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 4px;
}
.bot-select-stat-value {
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

/* ── Robinhood bot card extras ──────────────────────────────────────────── */
.rh-tier-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  margin-right: 4px;
}
.rh-tier-pill.rh-tier-hit {
  background: rgba(16, 185, 129, 0.18);
  color: var(--accent-bright);
}
.rh-chain {
  font-size: 11px;
  word-break: break-all;
}
.rh-orders-table th,
.rh-orders-table td {
  font-size: 12px;
}
.rh-order-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-soft);
  text-transform: lowercase;
}
.rh-status-filled  { background: rgba(16, 185, 129, 0.18); color: var(--accent-bright); }
.rh-status-submitted,
.rh-status-pending,
.rh-status-confirmed,
.rh-status-queued  { background: rgba(251, 191, 36, 0.18); color: #fcd34d; }
.rh-status-rejected,
.rh-status-failed,
.rh-status-cancelled { background: rgba(244, 63, 94, 0.18); color: #fb7185; }
.bias-neutral { color: var(--text-soft); }

/* Bot-header breadcrumb (Switch bot link above the h1) */
.bot-header-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.bot-header-since {
  font-size: 12px;
  margin-top: -2px;
}
.bot-switch-link {
  display: inline-block;
  font-size: 12px;
  color: var(--text-soft);
  text-decoration: none;
  letter-spacing: 0.3px;
  padding: 2px 0;
  width: max-content;
}
.bot-switch-link:hover {
  color: var(--accent-bright);
}

/* ── Performance cycling pill ───────────────────────────────────────────── */
.perf-pill {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.perf-pill:active { background: var(--surface-2); }
