/* ─────────────────────────────────────────────────────
   Options Lotto — Robinhood-style dark trading platform
   ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root,
html[data-theme="dark"] {
  /* Core palette */
  --bg:        #050608;
  --surface:   #0f1117;
  --surface2:  #161b26;
  --surface3:  #1c2333;
  --border:    #1e2535;
  --border2:   #28344a;

  /* Text */
  --text:      #f0f4ff;
  --text2:     #8a9bb5;
  --text3:     #4a5a72;

  /* Accent colors */
  --green:     #00d97e;
  --green2:    #00b866;
  --green-bg:  rgba(0,217,126,.09);
  --red:       #ff4757;
  --red2:      #e03545;
  --red-bg:    rgba(255,71,87,.09);
  --blue:      #4f8ef7;
  --blue-bg:   rgba(79,142,247,.10);
  --yellow:    #ffb830;
  --yellow-bg: rgba(255,184,48,.10);
  --purple:    #9b7fe8;
  --purple-bg: rgba(155,127,232,.10);
  --orange:    #f97316;
  --orange-bg: rgba(249,115,22,.10);

  /* Brand accent — stays constant across themes */
  --claude-1:  #7c3aed;
  --claude-2:  #4f46e5;

  /* Premium hero-card gradient (Analyzer header, etc.) */
  --hero-grad-start: #0b0f1c;

  /* Aliases used across panels/badges/tables */
  --bg2:    var(--surface2);
  --card:   var(--surface2);
  --hover:  var(--surface3);
  --hover-tint: rgba(255,255,255,.04);
  --muted:  var(--text2);
  --text1:  var(--text);
  --bg3:    var(--surface3);
  --fg:     var(--text);
  --accent: var(--blue);

  /* Elevation */
  --shadow-color: rgba(0,0,0,.5);
  --shadow-sm: 0 2px 14px rgba(0,0,0,.25);
  --shadow-md: 0 8px 28px rgba(0,0,0,.35);
  --shadow-lg: 0 24px 70px rgba(0,0,0,.65);

  /* Typography */
  --font:    system-ui,-apple-system,'Segoe UI',Helvetica,Arial,sans-serif;
  --mono:    'SF Mono','Fira Code','Consolas',monospace;

  /* Shape — rounder corners across the app for a softer, app-like feel */
  --r:       10px;
  --r-sm:    7px;
  --r-lg:    18px;

  /* Sidebar */
  --sidebar-w: 210px;

  color-scheme: dark;
}

html[data-theme="light"] {
  /* Core palette — soft off-white, not stark white */
  --bg:        #f4f6fa;
  --surface:   #ffffff;
  --surface2:  #f1f3f8;
  --surface3:  #e7eaf2;
  --border:    #e1e5ee;
  --border2:   #c9cedb;

  /* Text */
  --text:      #161a23;
  --text2:     #5b6472;
  --text3:     #8893a3;

  /* Accent colors — deepened for AA contrast on a light surface */
  --green:     #16a34a;
  --green2:    #0f7c38;
  --green-bg:  rgba(22,163,74,.10);
  --red:       #dc2626;
  --red2:      #b91c1c;
  --red-bg:    rgba(220,38,38,.09);
  --blue:      #2563eb;
  --blue-bg:   rgba(37,99,235,.08);
  --yellow:    #b45309;
  --yellow-bg: rgba(180,83,9,.10);
  --purple:    #7c3aed;
  --purple-bg: rgba(124,58,237,.09);
  --orange:    #ea580c;
  --orange-bg: rgba(234,88,12,.10);

  --claude-1:  #7c3aed;
  --claude-2:  #4f46e5;

  --hero-grad-start: #ffffff;

  --bg2:    var(--surface2);
  --card:   #ffffff;
  --hover:  var(--surface2);
  --hover-tint: rgba(15,23,42,.045);
  --muted:  var(--text2);
  --text1:  var(--text);
  --bg3:    var(--surface3);
  --fg:     var(--text);
  --accent: var(--blue);

  --shadow-color: rgba(30,41,59,.12);
  --shadow-sm: 0 2px 10px rgba(30,41,59,.06);
  --shadow-md: 0 8px 24px rgba(30,41,59,.08);
  --shadow-lg: 0 24px 60px rgba(30,41,59,.16);

  color-scheme: light;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

/* Keyboard focus ring — only shows for keyboard nav, not mouse clicks */
button:focus-visible, .btn:focus-visible, a:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}
input:disabled, select:disabled, textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--surface3);
}

/* Light/dark theme toggle */
.theme-toggle {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.theme-toggle:hover { background: var(--surface3); color: var(--text); border-color: var(--border2); }
.theme-icon-sun, .theme-icon-moon { display: none; }
html[data-theme="dark"]  .theme-icon-sun  { display: block; }
html[data-theme="light"] .theme-icon-moon { display: block; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
}

/* ═══════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 50;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}
.logo-mark {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-dot {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--green), var(--blue));
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  color: #000;
  flex-shrink: 0;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--green) 35%, transparent);
}
.logo-sub {
  font-size: 10px;
  color: var(--text3);
  margin-top: 1px;
  letter-spacing: 0.5px;
}

.sidebar-section {
  padding: 16px 10px 4px;
}
.sidebar-section-label {
  font-size: 9.5px;
  color: var(--text3);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: var(--r);
  background: transparent;
  color: var(--text2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.13s, color 0.13s;
  text-align: left;
  white-space: nowrap;
  margin-bottom: 1px;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--blue-bg); color: var(--blue); font-weight: 600; }
.nav-item.active .nav-icon { color: var(--blue); }
.nav-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--surface3);
  color: var(--text3);
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
}
.nav-badge.active { background: var(--red); color: #fff; }

.recent-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.13s;
  margin-bottom: 1px;
}
.recent-item:hover { background: var(--surface2); }
.recent-item:hover .recent-item-remove { opacity: 1; }
.recent-item-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.recent-item-sym { font-size: 12.5px; font-weight: 700; font-family: var(--mono); color: var(--text); }
.recent-item-meta { font-size: 10px; font-weight: 600; letter-spacing: 0.2px; }
.recent-item-remove {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--text3);
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  padding: 2px 4px;
  border-radius: 4px;
  transition: opacity 0.13s, color 0.13s;
}
.recent-item-remove:hover { color: var(--red); }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}

.et-status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: var(--r-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.13s;
  width: 100%;
}
.et-status-pill:hover { border-color: var(--border2); }
.et-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border2);
  flex-shrink: 0;
}
.et-label { font-size: 11px; font-weight: 600; color: var(--text2); flex: 1; }
.et-value { font-size: 10.5px; color: var(--text3); }

/* ═══════════════════════════════════════════════════════
   MAIN AREA
══════════════════════════════════════════════════════ */
.main {
  margin-left: var(--sidebar-w);
  padding-top: 52px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* Top bar */
.topbar {
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 45;
}
.topbar-title {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
}
.topbar-chips { display: flex; gap: 6px; }

.chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface2);
  font-size: 11.5px;
  cursor: pointer;
  transition: border-color 0.13s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--border2); }
.chip-label { color: var(--text3); font-size: 10px; font-weight: 700; letter-spacing: 0.5px; }
.chip-val { font-weight: 700; font-family: var(--mono); font-size: 12px; }

/* Hero chip — the one number that matters most gets visual priority over the rest */
.chip-primary {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-color: transparent;
  padding: 5px 14px;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--blue) 35%, transparent);
}
.chip-primary:hover { opacity: 0.92; }
.chip-primary .chip-label { color: #fff; opacity: 0.85; }
.chip-primary .chip-val { font-size: 13.5px; color: #fff; }

/* User menu */
.user-menu { position: relative; margin-left: 8px; flex-shrink: 0; }
.user-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  background: var(--surface2);
  color: var(--text1);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .13s;
}
.user-btn:hover { border-color: var(--green); }
.user-dropdown {
  display: none;
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 6px;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 200;
}
.user-dropdown.open { display: block; }
.user-dropdown-name { font-size: 13px; font-weight: 700; padding: 6px 8px 2px; }
.user-dropdown-email { font-size: 11px; color: var(--muted); padding: 0 8px 6px; }
.user-dropdown-sep { border-top: 1px solid var(--border); margin: 4px 0; }
.user-dropdown-item {
  display: block; width: 100%;
  text-align: left;
  background: none; border: none;
  color: var(--text1); font-size: 13px;
  padding: 7px 10px; border-radius: 6px;
  cursor: pointer;
  transition: background .1s;
}
.user-dropdown-item:hover { background: var(--surface2); }
.user-dropdown-item.danger { color: var(--red); }
.user-dropdown-item.danger:hover { background: var(--red-bg); }

/* Settings input helper */
.input-sm {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text1);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color .13s;
  width: 100%;
}
.input-sm:focus { border-color: var(--green); }

/* Page content */
.page {
  display: none;
  padding: 28px 28px;
  flex: 1;
}
.page.active { display: block; }

/* ═══════════════════════════════════════════════════════
   PORTFOLIO / HOME
══════════════════════════════════════════════════════ */
.portfolio-hero {
  margin-bottom: 28px;
}
.portfolio-value {
  font-size: 42px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 6px;
}
.portfolio-change {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.portfolio-meta {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.pmeta-item { display: flex; flex-direction: column; gap: 2px; }
.pmeta-label { font-size: 10px; color: var(--text3); font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; }
.pmeta-val { font-size: 15px; font-weight: 700; font-family: var(--mono); }

.pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.pos-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 18px;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.pos-card:hover { border-color: var(--border2); box-shadow: 0 4px 20px rgba(0,0,0,.4); }
.pos-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.pos-sym { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.pos-name { font-size: 10.5px; color: var(--text3); margin-top: 1px; }
.pos-pnl-big { font-size: 15px; font-weight: 700; font-family: var(--mono); text-align: right; }
.pos-pnl-pct { font-size: 11px; font-weight: 600; text-align: right; }
.pos-card-bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.pos-detail { font-size: 11px; color: var(--text2); }
.pos-value { font-size: 13px; font-weight: 700; font-family: var(--mono); }

.pos-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.pos-tag.call { background: var(--green-bg); color: var(--green); }
.pos-tag.put  { background: var(--red-bg);   color: var(--red);   }
.pos-tag.open { background: var(--blue-bg);  color: var(--blue);  }

/* ═══════════════════════════════════════════════════════
   SECTION HEADERS
══════════════════════════════════════════════════════ */
.sec-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.sec-head h2 { font-size: 18px; font-weight: 700; }
.sec-head h3 { font-size: 14px; font-weight: 600; }
.sec-sub { color: var(--text3); font-size: 11.5px; flex: 1; }

/* ═══════════════════════════════════════════════════════
   STAT CARDS ROW
══════════════════════════════════════════════════════ */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 15px 17px;
}
.stat-card-label { font-size: 10px; color: var(--text3); font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 6px; }
.stat-card-val   { font-size: 22px; font-weight: 700; font-family: var(--mono); }

/* ═══════════════════════════════════════════════════════
   FILTER / CONTROLS BAR
══════════════════════════════════════════════════════ */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 18px;
  margin-bottom: 16px;
}
.ctrl-group { display: flex; flex-direction: column; gap: 4px; }
.ctrl-group label {
  font-size: 9px;
  color: var(--text3);
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.ctrl-group input,
.ctrl-group select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 5px 9px;
  width: 90px;
  outline: none;
  transition: border-color 0.15s;
}
.ctrl-group input:focus,
.ctrl-group select:focus { border-color: var(--blue); }
.ctrl-group select { cursor: pointer; }
.ctrl-group.wide input { width: 200px; }

/* ═══════════════════════════════════════════════════════
   PRESET PILLS
══════════════════════════════════════════════════════ */
.preset-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.preset-row-label { font-size: 10px; color: var(--text3); font-weight: 700; letter-spacing: 0.5px; }
.preset-pill {
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text2);
  font-size: 11.5px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.preset-pill:hover { border-color: var(--border2); color: var(--text); background: var(--surface2); }
.preset-pill.active { background: var(--blue); border-color: var(--blue); color: #000; font-weight: 700; }
.preset-pill.lotto.active  { background: var(--claude-1); border-color: var(--claude-1); color: #fff; }
.preset-pill.normal.active { background: var(--green); border-color: var(--green); color: #000; }
.preset-pill.leaps.active  { background: var(--yellow); border-color: var(--yellow); color: #000; }

/* Claude brand button — gradient stays constant across themes */
.btn-claude {
  background: linear-gradient(135deg, var(--claude-1), var(--claude-2));
  color: #fff; border: none; padding: 7px 14px; border-radius: var(--r);
  font-size: 12px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  transition: opacity 0.13s, box-shadow 0.13s;
}
.btn-claude:hover { opacity: 0.9; box-shadow: 0 3px 14px color-mix(in srgb, var(--claude-1) 35%, transparent); }
.btn-claude .icon { font-size: 13px; }

/* ═══════════════════════════════════════════════════════
   TABLES — clean and minimal
══════════════════════════════════════════════════════ */
.tbl-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; }

thead th {
  background: var(--surface2);
  color: var(--text3);
  font-size: 10px;
  letter-spacing: 0.7px;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-family: var(--font);
  font-weight: 700;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  cursor: pointer;
  user-select: none;
}
thead th:hover { color: var(--text2); }

th[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: #111;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
  white-space: normal;
  width: 210px;
  z-index: 9999;
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
  pointer-events: none;
}
thead th { position: relative; }

tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--hover-tint); }
tbody td { padding: 11px 12px; white-space: nowrap; font-size: 13px; font-family: var(--mono); vertical-align: middle; }
tbody td.label-col { font-family: var(--font); }

/* ═══════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════ */
.btn {
  border: none;
  border-radius: var(--r-sm);
  padding: 9px 18px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  transition: opacity 0.13s, box-shadow 0.13s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-trade {
  background: var(--green);
  color: #000;
  border: none;
  border-radius: var(--r-sm);
  padding: 5px 13px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 700;
  transition: opacity 0.12s, box-shadow 0.12s;
}
.btn-trade:hover { opacity: 0.86; box-shadow: 0 2px 12px rgba(0,217,126,.35); }

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { opacity: 0.87; box-shadow: 0 3px 12px rgba(79,142,247,.3); }

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 14px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 12px;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--border2); background: var(--surface2); }
.btn-ghost:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-sm { padding: 4px 10px !important; font-size: 11px !important; }

.btn-danger {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: 6px 14px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
}
.btn-danger:hover { opacity: 0.84; }

/* Row action cluster */
.row-actions { display: flex; gap: 4px; align-items: center; flex-wrap: nowrap; }

/* ═══════════════════════════════════════════════════════
   STATUS / ALERTS
══════════════════════════════════════════════════════ */
.alert {
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 12px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.alert.loading { background: var(--blue-bg);   border-color: rgba(79,142,247,.25); color: var(--blue); }
.alert.error   { background: var(--red-bg);    border-color: rgba(255,71,87,.25);  color: var(--red); }
.alert.success { background: var(--green-bg);  border-color: rgba(0,217,126,.25);  color: var(--green); }
.alert.hidden  { display: none !important; }
.hidden { display: none !important; }

.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Progress bar */
.progress-wrap { height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; margin-bottom: 14px; }
.progress-wrap.hidden { display: none; }
.progress-bar-slide {
  height: 100%; width: 36%; background: var(--blue); border-radius: 2px;
  animation: pslide 1.2s ease-in-out infinite;
}
.progress-bar-fill { height: 100%; width: 0%; background: var(--green); border-radius: 2px; transition: width 0.4s ease; }
@keyframes pslide { 0% { transform: translateX(-100%); } 100% { transform: translateX(380%); } }

/* ═══════════════════════════════════════════════════════
   SCORE / VERDICT BADGES
══════════════════════════════════════════════════════ */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font);
}
.score-badge.high  { background: var(--green-bg); color: var(--green); }
.score-badge.mid   { background: var(--yellow-bg); color: var(--yellow); }
.score-badge.low   { background: rgba(138,155,181,.1); color: var(--text2); }
.score-badge.avoid { background: var(--red-bg); color: var(--red); }

.verdict-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  font-family: var(--font);
}
.verdict-pill.strong   { background: var(--green-bg); color: var(--green); }
.verdict-pill.moderate { background: var(--yellow-bg); color: var(--yellow); }
.verdict-pill.weak     { background: rgba(138,155,181,.1); color: var(--text2); }
.verdict-pill.avoid    { background: var(--red-bg); color: var(--red); }

/* ═══════════════════════════════════════════════════════
   TYPE TAGS
══════════════════════════════════════════════════════ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  font-family: var(--font);
  border: 1px solid transparent;
}
.tag-call    { background: var(--green-bg); color: var(--green); border-color: rgba(0,217,126,.2); }
.tag-put     { background: var(--red-bg);   color: var(--red);   border-color: rgba(255,71,87,.2); }
.tag-open    { background: var(--blue-bg);  color: var(--blue);  border-color: rgba(79,142,247,.2); }
.tag-closed  { background: var(--surface3); color: var(--text2); border-color: var(--border); }
.tag-expired { background: var(--red-bg);   color: var(--red);   border-color: rgba(255,71,87,.2); }

/* ═══════════════════════════════════════════════════════
   EARNINGS CARDS
══════════════════════════════════════════════════════ */
.earnings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 12px;
}
.earnings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  transition: border-color 0.15s;
}
.earnings-card:hover { border-color: var(--border2); }
.earnings-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.ec-symbol { font-size: 17px; font-weight: 700; color: var(--blue); font-family: var(--mono); }
.ec-price  { color: var(--text2); font-size: 12px; margin-top: 2px; font-family: var(--mono); }
.ec-date-badge { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 4px 10px; font-size: 11px; text-align: right; }
.ec-date-badge .days { font-weight: 700; color: var(--yellow); font-size: 13px; font-family: var(--mono); }
.ec-moves { display: flex; gap: 5px; margin-bottom: 12px; flex-wrap: wrap; }
.ec-move-tag { background: var(--surface2); border: 1px solid var(--border); border-radius: 20px; padding: 2px 9px; font-size: 10.5px; font-family: var(--mono); }
.ec-options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.ec-option { background: var(--surface2); border-radius: var(--r-sm); padding: 11px; border: 1px solid transparent; transition: border-color 0.15s; cursor: pointer; }
.ec-option.call { border-color: rgba(0,217,126,.15); }
.ec-option.put  { border-color: rgba(255,71,87,.15);  }
.ec-option.call:hover { border-color: var(--green); }
.ec-option.put:hover  { border-color: var(--red); }
.ec-option-type { font-size: 9px; letter-spacing: 1px; margin-bottom: 4px; font-weight: 700; text-transform: uppercase; }
.ec-option.call .ec-option-type { color: var(--green); }
.ec-option.put  .ec-option-type { color: var(--red); }
.ec-option-price  { font-size: 17px; font-weight: 700; font-family: var(--mono); }
.ec-option-detail { font-size: 10px; color: var(--text2); margin-top: 2px; font-family: var(--mono); }

/* ═══════════════════════════════════════════════════════
   IV CARDS
══════════════════════════════════════════════════════ */
.iv-display { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 11px; margin-top: 8px; }
.iv-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 17px; transition: border-color 0.13s; }
.iv-card:hover { border-color: var(--border2); }
.iv-label-badge { display: inline-block; padding: 2px 11px; border-radius: 20px; font-size: 10px; font-weight: 700; letter-spacing: 0.8px; margin-bottom: 12px; text-transform: uppercase; }
.iv-label-badge.CHEAP     { background: var(--green-bg);  color: var(--green);  }
.iv-label-badge.FAIR      { background: var(--surface3);  color: var(--text2);  }
.iv-label-badge.RICH      { background: var(--yellow-bg); color: var(--yellow); }
.iv-label-badge.VERY-RICH { background: var(--red-bg);    color: var(--red);    }
.iv-gauge-wrap  { margin: 12px 0; }
.iv-gauge-track { height: 4px; background: var(--surface2); border-radius: 3px; overflow: hidden; margin-top: 5px; }
.iv-gauge-fill  { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.iv-stats-grid  { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 10px; }
.iv-stat-label  { font-size: 9.5px; color: var(--text3); letter-spacing: 0.4px; }
.iv-stat-val    { font-size: 13px; font-weight: 700; font-family: var(--mono); }
.iv-suggestion  { margin-top: 10px; padding: 8px 11px; background: var(--surface2); border-radius: var(--r-sm); font-size: 11px; color: var(--text2); line-height: 1.6; }
.iv-scan-table td.iv-label-cell .iv-label-badge { margin-bottom: 0; padding: 2px 8px; font-size: 10px; }
.iv-rank-bar-wrap  { display: flex; align-items: center; gap: 5px; }
.iv-rank-bar-track { flex: 1; height: 4px; background: var(--surface2); border-radius: 3px; overflow: hidden; min-width: 50px; }
.iv-rank-bar-fill  { height: 100%; border-radius: 3px; }
.iv-scan-expand-row td { padding: 0 !important; border-top: none !important; }
.iv-scan-expand-inner  { padding: 10px 14px 14px; background: var(--surface); border-top: 1px solid var(--border); }

/* ═══════════════════════════════════════════════════════
   ANALYZER
══════════════════════════════════════════════════════ */
/* ── Analyzer input bar ───────────────────────────────── */
.az-input-bar {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px 20px; margin-bottom: 20px;
}
.az-input-field { display: flex; flex-direction: column; gap: 5px; }
.az-input-field label { font-size: 9.5px; font-weight: 700; letter-spacing: 0.8px; color: var(--text3); text-transform: uppercase; }
.az-input-ticker input { width: 100px; }
.az-input-expiry select { width: 140px; }
.az-input-strike select { width: 110px; }
.az-input-field input, .az-input-field select {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text); font-family: var(--mono); font-size: 13px;
  padding: 7px 10px; outline: none; transition: border-color 0.15s;
}
.az-input-field input:focus, .az-input-field select:focus { border-color: var(--blue); }
.az-type-toggle { display: flex; background: var(--bg); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.az-type-btn {
  padding: 5px 14px; font-size: 12px; font-weight: 700; border: none;
  border-radius: 4px; cursor: pointer; color: var(--text3); background: transparent; transition: all 0.15s;
}
.az-type-btn.active.call { background: var(--green-bg); color: var(--green); }
.az-type-btn.active.put  { background: var(--red-bg);   color: var(--red); }
.az-input-actions { display: flex; gap: 6px; align-items: center; padding-bottom: 1px; }

/* ── Analyzer results layout ──────────────────────────── */
.az-page { display: flex; flex-direction: column; gap: 10px; max-width: 100%; overflow-x: hidden; }

/* ── Analyzer header ─────────────────────────────────────────────────────── */
.az-header { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px 18px; }
.az-header-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.az-header-sym { font-size: 32px; font-weight: 900; font-family: var(--mono); letter-spacing: -1px; line-height: 1; }
.az-header-meta { font-size: 12px; color: var(--text3); margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.az-header-price { font-size: 28px; font-weight: 800; font-family: var(--mono); letter-spacing: -0.5px; text-align: right; }
.az-header-chg { font-size: 13px; font-weight: 600; text-align: right; margin-top: 3px; }
.az-header-actions { display: flex; gap: 6px; margin-top: 10px; justify-content: flex-end; }

/* ── Price track visualization ───────────────────────────────────────────── */
.az-price-track { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.az-pt-labels-top { display: flex; justify-content: space-between; font-size: 10px; font-weight: 700; letter-spacing: 0.3px; margin-bottom: 8px; flex-wrap: wrap; gap: 4px; }
.az-pt-bar { position: relative; height: 6px; background: var(--surface2); border-radius: 3px; overflow: visible; margin: 0 4px; }
.az-pt-fill { height: 100%; background: linear-gradient(90deg, var(--blue), rgba(79,142,247,0.5)); border-radius: 3px; position: relative; }
.az-pt-dot { position: absolute; right: -7px; top: -5px; width: 16px; height: 16px; border-radius: 50%; background: var(--blue); border: 2px solid var(--bg); box-shadow: 0 0 0 2px var(--blue); }
.az-pt-marker { position: absolute; top: -2px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.az-pt-marker-line { width: 1px; height: 10px; background: currentColor; margin-top: 8px; opacity: 0.7; }
.az-pt-marker-label { font-size: 9px; font-weight: 800; white-space: nowrap; margin-top: 3px; letter-spacing: 0.4px; }
.az-pt-marker.be { color: var(--yellow); }
.az-pt-marker.tx { color: var(--green); }
.az-pt-bottom { display: flex; justify-content: space-between; font-size: 9px; color: var(--text3); margin-top: 20px; letter-spacing: 0.3px; }

/* ── Quick stats strip ───────────────────────────────────────────────────── */
.az-quickstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.az-qs-item { padding: 13px 15px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-width: 0; }
.az-qs-item:last-child { border-right: none; }
.az-qs-val { font-size: 15px; font-weight: 800; font-family: var(--mono); line-height: 1; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.az-qs-lbl { font-size: 9px; color: var(--text3); font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
@media (max-width: 700px) { .az-quickstats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .az-quickstats { grid-template-columns: repeat(2, 1fr); } }

/* ── Conviction row ──────────────────────────────────────────────────────── */
.az-conviction-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; display: flex; gap: 0; align-items: stretch; flex-wrap: wrap; overflow: hidden; }
.az-conv-score-block {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 14px 22px; min-width: 110px; flex-shrink: 0; border-radius: var(--r-lg);
  background: color-mix(in srgb, currentColor 10%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
}
.az-conv-num { font-size: 40px; font-weight: 900; font-family: var(--mono); line-height: 1; }
.az-conv-denom { font-size: 12px; color: var(--text3); font-weight: 400; margin-top: 1px; }
.az-conv-verdict { font-size: 10px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; margin-top: 4px; }
.az-conv-divider { width: 1px; background: var(--border); align-self: stretch; flex-shrink: 0; margin: 0 16px; }
.az-conv-signals { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 5px; padding-right: 12px; }
.az-conv-signal { font-size: 11px; display: flex; gap: 6px; align-items: flex-start; line-height: 1.4; }
.az-conv-bars { display: flex; flex-direction: column; gap: 8px; min-width: 160px; }
.az-conv-bar-row { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.az-conv-bar-lbl { width: 72px; color: var(--text3); white-space: nowrap; flex-shrink: 0; font-size: 10px; }
.az-conv-bar-track { flex: 1; height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.az-conv-bar-fill { height: 100%; border-radius: 2px; }
.az-conv-bar-val { width: 30px; text-align: right; font-weight: 700; color: var(--text); flex-shrink: 0; font-size: 11px; }
@media (max-width: 700px) { .az-conv-bars { display: none; } .az-conv-divider:last-of-type { display: none; } }

/* Accordion (details/summary) */
.az-acc {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden;
}
.az-acc summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; cursor: pointer; list-style: none;
  font-size: 12px; font-weight: 700; letter-spacing: 0.3px;
  user-select: none; transition: background 0.12s;
}
.az-acc summary::-webkit-details-marker { display: none; }
.az-acc summary:hover { background: var(--hover); }
.az-acc[open] summary { border-bottom: 1px solid var(--border); }
.az-acc-chevron { font-size: 12px; color: var(--text3); transition: transform 0.2s; }
.az-acc[open] .az-acc-chevron { transform: rotate(90deg); }
.az-acc-badge { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 10px; }
.az-acc-body { padding: 16px 18px; }

/* Reuse .az-card for inner panels without border */
.az-grid        { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.az-full-width  { grid-column: 1 / -1; }
.az-header-card { grid-column: 1 / -1; }
.az-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; }
.az-card-title { font-size: 9.5px; letter-spacing: 0.8px; color: var(--text3); margin-bottom: 12px; font-weight: 700; text-transform: uppercase; }
.az-stats      { display: flex; flex-wrap: wrap; gap: 18px; }
.az-stat       { min-width: 80px; }
.az-stat-label { font-size: 9.5px; color: var(--text3); letter-spacing: 0.4px; margin-bottom: 2px; }
.az-stat-val   { font-size: 14px; font-weight: 700; font-family: var(--mono); }

/* ── Flip Target Ladder ──────────────────────────────────────────────────── */
.az-flip-ladder {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px 18px;
}
.az-flip-ladder-title {
  font-size: 9px; font-weight: 800; letter-spacing: 0.9px;
  color: var(--text3); text-transform: uppercase; margin-bottom: 12px;
}
.az-flip-rungs { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.az-flip-rung {
  border-radius: 10px; padding: 13px 14px; border: 1px solid;
  display: flex; flex-direction: column; gap: 2px;
  transition: transform .15s, box-shadow .15s; cursor: default;
}
.az-flip-rung:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
.az-rung-2x  { background: color-mix(in srgb, var(--green)  7%, transparent); border-color: color-mix(in srgb, var(--green)  25%, transparent); }
.az-rung-3x  { background: color-mix(in srgb, var(--yellow) 7%, transparent); border-color: color-mix(in srgb, var(--yellow) 25%, transparent); }
.az-rung-5x  { background: color-mix(in srgb, var(--orange) 7%, transparent); border-color: color-mix(in srgb, var(--orange) 25%, transparent); }
.az-rung-10x { background: color-mix(in srgb, var(--purple) 7%, transparent); border-color: color-mix(in srgb, var(--purple) 25%, transparent); }
.az-rung-mult { font-size: 22px; font-weight: 900; font-family: var(--mono); line-height: 1; }
.az-rung-2x  .az-rung-mult { color: var(--green); }
.az-rung-3x  .az-rung-mult { color: var(--yellow); }
.az-rung-5x  .az-rung-mult { color: var(--orange); }
.az-rung-10x .az-rung-mult { color: var(--purple); }
.az-rung-sell  { font-size: 10px; color: var(--text3); margin-top: 5px; font-weight: 600; }
.az-rung-price { font-size: 17px; font-weight: 800; font-family: var(--mono); margin-top: 5px; }
.az-rung-move  { font-size: 11px; font-weight: 700; margin-top: 2px; }
.az-rung-2x  .az-rung-move { color: var(--green); }
.az-rung-3x  .az-rung-move { color: var(--yellow); }
.az-rung-5x  .az-rung-move { color: var(--orange); }
.az-rung-10x .az-rung-move { color: var(--purple); }
.az-rung-na { opacity: .35; filter: grayscale(1); pointer-events: none; }
@media (max-width: 600px) { .az-flip-rungs { grid-template-columns: repeat(2,1fr); } }

/* ── BB Squeeze pulse badge ──────────────────────────────────────────────── */
.az-squeeze-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.4px;
  padding: 3px 9px; border-radius: 20px;
  background: var(--orange-bg); color: var(--orange);
  border: 1px solid color-mix(in srgb, var(--orange) 35%, transparent);
  animation: az-squeeze-pulse 2s ease-in-out infinite;
}
@keyframes az-squeeze-pulse {
  0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--orange) 30%, transparent); }
  50%      { box-shadow: 0 0 0 5px transparent; }
}

/* ── Bigger stat numbers ─────────────────────────────────────────────────── */
.az-qs-val { font-size: 18px !important; }

/* Claude panel — premium gradient card */
.az-claude-card {
  background: linear-gradient(135deg, color-mix(in srgb, var(--claude-1) 7%, transparent) 0%, var(--surface) 55%);
  border: 1px solid color-mix(in srgb, var(--claude-1) 28%, transparent);
  border-radius: var(--r-lg); padding: 20px;
}
.az-claude-hdr {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.az-claude-hdr-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.az-claude-desc { font-size: 12px; color: var(--text3); line-height: 1.5; }
.az-claude-desc strong { color: var(--text2); }
.az-claude-response {
  margin-top: 14px; padding: 16px 18px;
  background: var(--bg); border-radius: var(--r-sm);
  border-left: 3px solid var(--claude-1);
  font-size: 13px; line-height: 1.75; color: var(--text);
}
.az-claude-label { display: block; font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--claude-1); margin-bottom: 6px; }
.az-structured-section { margin-bottom: 12px; }
.az-structured-section:last-child { margin-bottom: 0; }
.az-structured-key { font-size: 9.5px; font-weight: 800; letter-spacing: 0.8px; color: var(--text3); text-transform: uppercase; margin-bottom: 4px; }
.az-structured-val { font-size: 13px; line-height: 1.6; color: var(--text); }

/* ═══════════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════════ */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; margin-bottom: 16px; }
.form-card h3 { margin-bottom: 16px; font-size: 14px; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 9.5px; color: var(--text3); font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }
.form-group input,
.form-group select { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text); font-family: var(--mono); font-size: 12px; padding: 6px 9px; width: 115px; outline: none; transition: border-color 0.15s; }
.form-group input:focus,
.form-group select:focus { border-color: var(--blue); }
.form-group.wide input { width: 280px; }
.form-actions { display: flex; gap: 8px; }

/* ═══════════════════════════════════════════════════════
   MODALS
══════════════════════════════════════════════════════ */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.8); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal-box { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--r-lg); padding: 26px; min-width: 340px; box-shadow: 0 28px 70px rgba(0,0,0,.7); }
.modal-box h3 { margin-bottom: 10px; }
.modal-box p  { color: var(--text2); font-size: 12px; margin-bottom: 14px; }

/* ═══════════════════════════════════════════════════════
   MINI TABLE
══════════════════════════════════════════════════════ */
.mini-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow-x: auto; min-height: 50px; }

/* ═══════════════════════════════════════════════════════
   TWO-COL LAYOUT
══════════════════════════════════════════════════════ */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ═══════════════════════════════════════════════════════
   COMING SOON
══════════════════════════════════════════════════════ */
.coming-soon-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  text-align: center;
  border: 1px dashed var(--border2);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.coming-soon-box h2 { font-size: 26px; font-weight: 700; margin-bottom: 10px; }
.coming-soon-box p  { color: var(--text2); max-width: 380px; line-height: 1.7; }
.coming-soon-badge { display: inline-block; padding: 4px 14px; background: var(--yellow-bg); color: var(--yellow); border: 1px solid rgba(255,184,48,.3); border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: 0.8px; margin-bottom: 16px; }

/* ═══════════════════════════════════════════════════════
   GUIDE CARD
══════════════════════════════════════════════════════ */
.guide-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.guide-item { display: flex; gap: 10px; align-items: flex-start; }
.guide-icon { font-size: 7px; margin-top: 6px; flex-shrink: 0; }
.guide-item strong { font-size: 12px; display: block; margin-bottom: 2px; }
.guide-item p { color: var(--text2); font-size: 11.5px; line-height: 1.6; }

/* ═══════════════════════════════════════════════════════
   UTILITIES
══════════════════════════════════════════════════════ */
.green  { color: var(--green)  !important; }
.red    { color: var(--red)    !important; }
.blue   { color: var(--blue)   !important; }
.yellow { color: var(--yellow) !important; }
.muted  { color: var(--text3)  !important; }
.muted2 { color: var(--text2)  !important; }
.bold   { font-weight: 700; }
.mono   { font-family: var(--mono); }

/* ── Explain rows ── */
.explain-row { transition: none; }
.explain-row.hidden { display: none; }
.explain-row td { line-height: 1.6; }

/* ── Watchlist ── */
canvas.sparkline { display: block; }
.lotto-score { font-weight: 700; font-size: 14px; font-family: var(--mono); }
.score-high  { color: var(--green); }
.score-mid   { color: var(--yellow); }
.score-low   { color: var(--text2); }

/* ── Queue panel ── */
#queuePanel { background: var(--surface); border-top: 2px solid var(--claude-1); }

/* ── Backward compat aliases ── */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow-x: auto; }
.section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-header h2 { font-size: 16px; font-weight: 700; }
.section-header h3 { font-size: 13px; font-weight: 600; }
.section-header .subtitle { color: var(--text2); font-size: 11px; flex: 1; }
.status-bar { padding: 9px 14px; border-radius: var(--r-sm); font-size: 12px; margin-bottom: 14px; border: 1px solid var(--border); background: var(--surface2); color: var(--text2); }
.status-bar.loading { background: var(--blue-bg);  border-color: rgba(79,142,247,.3); color: var(--blue);  }
.status-bar.error   { background: var(--red-bg);   border-color: rgba(255,71,87,.3);  color: var(--red);   }
.status-bar.success { background: var(--green-bg); border-color: rgba(0,217,126,.3);  color: var(--green); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 18px; margin-bottom: 16px; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 9.5px; color: var(--text3); font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }
.filter-group input, .filter-group select { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text); font-family: var(--mono); font-size: 12px; padding: 5px 9px; width: 90px; outline: none; transition: border-color 0.15s; }
.filter-group input:focus, .filter-group select:focus { border-color: var(--blue); }
.filter-group select { cursor: pointer; }
.scan-options-row { display: flex; align-items: center; gap: 10px; padding: 6px 0 10px; flex-wrap: wrap; }
.scan-toggle-label { display: flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.scan-toggle-cb { accent-color: var(--green); width: 14px; height: 14px; cursor: pointer; }
.scan-toggle-name { font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.4px; }
.scan-toggle-note { font-size: 11px; color: var(--text3); line-height: 1.4; }
.scan-toggle-note em { font-style: normal; color: var(--text2); }
.preset-bar { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.preset-bar-label { font-size: 9.5px; color: var(--text3); font-weight: 700; letter-spacing: 0.6px; }
.preset-btn { padding: 3px 13px; border: 1px solid var(--border); border-radius: 20px; background: transparent; color: var(--text2); font-size: 11px; font-family: var(--font); cursor: pointer; transition: all 0.12s; white-space: nowrap; }
.preset-btn:hover { color: var(--text); border-color: var(--border2); background: var(--surface2); }
.preset-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 700; }
.preset-btn.lotto.active { background: var(--claude-1); border-color: var(--claude-1); }
.preset-btn.normal.active { background: var(--green); border-color: var(--green); color: #000; }
.preset-btn.leaps.active  { background: var(--yellow); border-color: var(--yellow); color: #000; }
.btn-primary { background: var(--blue); color: #fff; border: none; border-radius: var(--r-sm); padding: 7px 16px; cursor: pointer; font-family: var(--font); font-size: 12px; font-weight: 600; transition: opacity 0.13s; }
.btn-primary:hover { opacity: 0.87; }
.btn-primary:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 6px 13px; cursor: pointer; font-family: var(--font); font-size: 12px; transition: color 0.12s, border-color 0.12s, background 0.12s; }
.btn-ghost:hover { color: var(--text); border-color: var(--border2); background: var(--surface2); }
.btn-ghost:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-sm { padding: 3px 9px !important; font-size: 11px !important; }
.btn-red { background: var(--red); color: #fff; border: none; border-radius: var(--r-sm); padding: 4px 10px; cursor: pointer; font-family: var(--font); font-size: 11px; font-weight: 600; }
.btn-green { background: var(--green); color: #000; border: none; border-radius: var(--r-sm); padding: 4px 10px; cursor: pointer; font-family: var(--font); font-size: 11px; font-weight: 600; }
.cards-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; }
.card:hover { border-color: var(--border2); }
.card-label { font-size: 9.5px; color: var(--text3); letter-spacing: 0.9px; margin-bottom: 6px; font-weight: 700; text-transform: uppercase; }
.card-value { font-size: 21px; font-weight: 700; font-family: var(--mono); }

/* ── Pagination ── */
.pager-bar { display: flex; align-items: center; gap: 5px; padding: 10px 14px; flex-wrap: wrap; }
.pager-btn { background: transparent; color: var(--text2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 4px 12px; cursor: pointer; font-family: var(--font); font-size: 12px; transition: all 0.12s; }
.pager-btn:hover:not(:disabled) { color: var(--text); border-color: var(--border2); background: var(--surface2); }
.pager-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.pager-num { background: transparent; color: var(--text2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 4px 9px; cursor: pointer; font-family: var(--font); font-size: 12px; min-width: 30px; transition: all 0.12s; }
.pager-num:hover { background: var(--surface2); color: var(--text); }
.pager-num.active { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 700; }
.pager-ellipsis { color: var(--text3); padding: 0 3px; font-size: 12px; }
.pager-info { font-size: 11px; color: var(--text3); margin-left: 6px; white-space: nowrap; }
.pager-size-btn { background: transparent; color: var(--text3); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 4px 10px; cursor: pointer; font-family: var(--font); font-size: 11px; margin-left: auto; transition: all 0.12s; }
.pager-size-btn:hover { color: var(--text); border-color: var(--border2); background: var(--surface2); }

/* ── Portfolio (Robinhood + E*TRADE hybrid) ── */
.pf-hero {
  background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 5%, transparent) 0%, var(--surface) 45%);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 24px 26px 0; margin-bottom: 16px;
}
.pf-hero-top { display: flex; justify-content: flex-end; margin-bottom: 6px; gap: 6px; }
.pf-value { font-size: 44px; font-weight: 800; font-family: var(--mono); letter-spacing: -1.5px; line-height: 1; }
.pf-gain-row { display: flex; align-items: center; margin: 8px 0 14px; flex-wrap: wrap; gap: 4px; }
.pf-gain-chip { font-size: 13.5px; font-weight: 700; font-family: var(--mono); padding: 3px 9px; border-radius: 20px; background: var(--bg2); }
.pf-chart-wrap { margin: 0 -26px; }
#pfChart { width: 100%; display: block; }
.pf-period-row { display: flex; gap: 4px; padding: 12px 26px 0; margin: 0 -26px; border-top: 1px solid var(--border); margin-top: 12px; }
.pf-period-note { font-size: 11px; color: var(--text3); padding: 5px 0; line-height: 1.5; }
.pf-period { background: transparent; color: var(--text3); border: none; border-radius: 20px; padding: 5px 12px; cursor: pointer; font-family: var(--font); font-size: 12px; font-weight: 700; transition: all 0.12s; }
.pf-period:hover { color: var(--text); background: var(--surface2); }
.pf-period.active { color: #fff; background: var(--blue); font-weight: 800; }
.pf-metrics-strip { display: flex; gap: 0; border-top: 1px solid var(--border); margin: 0 -24px; flex-wrap: wrap; }
.pf-metric { flex: 1; min-width: 90px; padding: 14px; border-right: 1px solid var(--border); transition: background 0.15s; }
.pf-metric:last-child { border-right: none; }
.pf-metric:hover { background: var(--hover-tint); }
.pf-metric-label { font-size: 9px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text3); margin-bottom: 5px; }
.pf-metric-val { font-size: 16px; font-weight: 800; font-family: var(--mono); color: var(--text); letter-spacing: -0.2px; }

/* Positions section */
.pf-positions-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.pf-section-hdr { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text3); }
.pf-pos-count { background: var(--surface2); color: var(--text2); border-radius: 10px; padding: 1px 7px; font-size: 10px; }
.pf-section-icon { font-size: 14px; }
.pf-section-tag { margin-left: auto; font-size: 9.5px; font-weight: 700; letter-spacing: 0.4px; text-transform: none; padding: 2px 8px; border-radius: 20px; }

/* E*TRADE = real money → blue accent */
.pf-section-etrade { border-top: 3px solid var(--blue); }
.pf-section-hdr-etrade { color: var(--blue); }
.pf-section-hdr-etrade .pf-section-tag { background: var(--blue-bg); color: var(--blue); }

/* Lotto plays = tracked from scans, not necessarily live trades → purple accent */
.pf-section-lotto { border-top: 3px solid var(--purple); }
.pf-section-hdr-lotto { color: var(--purple); }
.pf-section-hdr-lotto .pf-section-tag { background: var(--purple-bg); color: var(--purple); }

/* E*TRADE-style positions table */
.pf-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 900px; }
.pf-table thead tr { border-bottom: 1px solid var(--border); }
.pf-table thead th { padding: 7px 12px; font-size: 9px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text3); text-align: right; white-space: nowrap; }
.pf-table thead th:first-child { text-align: left; }
.pf-table tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
.pf-table tbody tr:last-child { border-bottom: none; }
.pf-table tbody tr:hover { background: var(--surface2); }
.pf-table td { padding: 9px 12px; text-align: right; vertical-align: middle; white-space: nowrap; font-family: var(--mono); font-size: 12px; }
.pf-table td:first-child { text-align: left; font-family: var(--font); }
.pf-table td.bold { font-weight: 700; }
.pf-table .pf-sym-cell { min-width: 130px; }
.pf-table .pf-sym-name { font-size: 14px; font-weight: 700; color: var(--text); }
.pf-table .pf-sym-desc { font-size: 10px; color: var(--text3); margin-top: 1px; }
.pf-table .pf-sym-tag { font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 3px; margin-left: 5px; vertical-align: middle; }
.pf-table .tag-stock { background: rgba(79,142,247,.15); color: var(--blue); }
.pf-table .tag-call  { background: rgba(0,217,126,.12); color: var(--green); }
.pf-table .tag-put   { background: rgba(255,71,87,.12); color: var(--red); }
.pf-group-row td { padding: 5px 12px; font-size: 9px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text3); background: var(--surface2); text-align: left; font-family: var(--font); }
.pf-empty { padding: 32px 18px; text-align: center; color: var(--text3); font-size: 13px; }

/* ── Lotto-play cards (tracked positions — NOT the E*TRADE <table>, see .pf-pos-row
   below for that) ──────────────────────────────────────────────────────────── */
.pf-col-labels, .pf-pos-card {
  display: grid;
  grid-template-columns: 1fr 90px 110px 110px 130px;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
}
.pf-col-labels {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text3); border-bottom: 1px solid var(--border);
}
.pf-col-labels .right  { text-align: right; }
.pf-col-labels .center { text-align: center; }
.pf-pos-card { border-bottom: 1px solid var(--border); transition: background 0.13s; }
.pf-pos-card:last-child { border-bottom: none; }
.pf-pos-card:hover { background: var(--hover-tint); }
.pf-pos-sym { font-weight: 700; font-size: 13px; }
.pf-pos-detail { font-size: 11px; color: var(--text3); margin-top: 2px; }
.pf-col-cell { text-align: right; font-family: var(--mono); font-size: 12.5px; }
.pf-pos-actions { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }

/* ── E*TRADE positions table — actual <tr>, must stay table-row, never grid ── */
.pf-pos-row:hover { background: var(--hover-tint) !important; }
.pf-lot-container { background: var(--bg2); }
.pf-lot-container td { font-family: var(--font); }
.pf-expand-icon { display: inline-block; font-size: 8px; color: var(--text3); margin-right: 6px; transition: transform 0.15s; vertical-align: middle; }

/* ── Order Ticket ──────────────────────────────────────────────────────────── */
.ot-modal-box { max-width: 860px !important; width: 95vw !important; padding: 0 !important; overflow: hidden; }
.ot-modal-hdr { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.ot-body { display: flex; min-height: 420px; max-height: 80vh; overflow: hidden; }

/* Left form panel */
.ot-form { flex: 1; padding: 18px 20px; overflow-y: auto; min-width: 0; border-right: 1px solid var(--border); }

/* Balance strip */
.ot-bal-strip { display: flex; gap: 24px; flex-wrap: wrap; padding: 10px 14px; background: var(--bg2); border-radius: 6px; margin-bottom: 14px; }
.ot-bal-item > .ot-bal-lbl { font-size: 10px; color: var(--text3); }
.ot-bal-item > .ot-bal-val { font-size: 13px; font-weight: 700; font-family: var(--mono); }

/* Quote strip */
.ot-quote { border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; margin-bottom: 14px; }
.ot-quote-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.ot-quote-exch { font-size: 9px; font-weight: 700; color: var(--blue); letter-spacing: 0.6px; }
.ot-quote-name { font-size: 13px; font-weight: 700; }
.ot-quote-main { font-size: 15px; font-weight: 700; font-family: var(--mono); }
.ot-quote-nums { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11px; margin-top: 6px; }
.ot-quote-nums > div > .ot-ql { color: var(--text3); display: block; font-size: 10px; }
.ot-quote-nums > div > .ot-qv { font-weight: 600; font-family: var(--mono); }
.ot-refresh-link { background: none; border: none; color: var(--blue); font-size: 11px; cursor: pointer; padding: 0; }
.ot-refresh-link:hover { text-decoration: underline; }

/* Form fields */
.ot-fields { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.ot-row { display: flex; gap: 12px; align-items: flex-end; }
.ot-field { flex: 1; }
.ot-field > label { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text3); margin-bottom: 4px; }
.ot-field select, .ot-field input[type=number], .ot-field input[type=text] {
  width: 100%; padding: 8px 10px; background: var(--bg3); color: var(--fg);
  border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-family: var(--font);
}
.ot-field select:focus, .ot-field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(79,142,247,.15); }
.ot-aon-lbl { display: flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; padding: 9px 0; }
.ot-btn-row { display: flex; gap: 8px; margin-bottom: 12px; }
.ot-btn-ghost { flex: 1; padding: 10px; background: var(--bg3); color: var(--text3); border: 1px solid var(--border); border-radius: 6px; font-size: 13px; cursor: not-allowed; }
.ot-btn-primary { flex: 2; padding: 10px; background: var(--blue); color: #fff; border: none; border-radius: 6px; font-size: 13px; font-weight: 700; cursor: pointer; transition: opacity .15s; }
.ot-btn-primary:hover:not(:disabled) { opacity: .88; }
.ot-btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.ot-btn-danger { flex: 2; padding: 10px; background: var(--red); color: #fff; border: none; border-radius: 6px; font-size: 13px; font-weight: 700; cursor: pointer; }

/* Preview box */
.ot-preview { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; font-size: 12px; }
.ot-preview-title { font-weight: 700; color: var(--yellow); margin-bottom: 8px; font-size: 11px; letter-spacing: 0.4px; text-transform: uppercase; }
.ot-preview-grid { display: flex; gap: 16px; flex-wrap: wrap; }
.ot-preview-grid > div > span { display: block; font-size: 10px; color: var(--text3); }
.ot-preview-grid > div > strong { font-family: var(--mono); font-size: 13px; }
.ot-err { color: var(--red); font-size: 12px; margin-top: 6px; }

/* Leg table (options) */
.ot-leg-wrap { margin-bottom: 14px; }
.ot-leg-label { font-size: 11px; color: var(--text3); margin-bottom: 8px; }
.ot-leg-table { width: 100%; border-collapse: collapse; }
.ot-leg-table th { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text3); padding: 4px 6px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.ot-leg-table td { padding: 5px 4px; vertical-align: middle; }
.ot-leg-table td select, .ot-leg-table td input { padding: 7px 8px; background: var(--bg3); color: var(--fg); border: 1px solid var(--border); border-radius: 6px; font-size: 12px; width: 100%; }
.ot-leg-table td select:focus, .ot-leg-table td input:focus { outline: none; border-color: var(--blue); }
.ot-leg-bid, .ot-leg-ask, .ot-leg-last { font-family: var(--mono); font-weight: 700; font-size: 13px; text-align: center; min-width: 40px; display: inline-block; }
.ot-leg-bid { color: var(--green); }
.ot-leg-ask { color: var(--red); }

/* Right panel */
.ot-right { width: 260px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--bg2); overflow: hidden; }
.ot-right-tabs { display: flex; border-bottom: 1px solid var(--border); }
.ot-right-tab { padding: 10px 14px; font-size: 12px; font-weight: 600; color: var(--text3); border-bottom: 2px solid transparent; }
.ot-right-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.ot-right-body { flex: 1; overflow-y: auto; }

/* Snapshot stats */
.ot-stat { display: flex; justify-content: space-between; padding: 6px 14px; font-size: 11px; border-bottom: 1px solid var(--border); }
.ot-stat:last-child { border-bottom: none; }
.ot-stat-lbl { color: var(--text3); }
.ot-stat-val { font-weight: 600; font-family: var(--mono); }

/* Chain panel */
.ot-chain-nav { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700; }
.ot-chain-nav button { background: none; border: 1px solid var(--border); color: var(--blue); cursor: pointer; font-size: 13px; padding: 1px 7px; border-radius: 4px; }
.ot-chain-nav button:disabled { opacity: .35; cursor: default; }
.ot-chain-cols { display: flex; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text3); border-bottom: 1px solid var(--border); }
.ot-chain-cols > span { flex: 1; padding: 4px 8px; }
.ot-chain-cols > span:last-child { text-align: right; }
.ot-chain-tbl { width: 100%; border-collapse: collapse; font-size: 11px; }
.ot-chain-tbl th { font-size: 9px; font-weight: 700; text-transform: uppercase; color: var(--text3); padding: 3px 6px; text-align: right; border-bottom: 1px solid var(--border); }
.ot-chain-tbl th.ot-th-strike { text-align: center; background: var(--bg3); }
.ot-chain-tbl th:first-child, .ot-chain-tbl th:nth-child(2) { text-align: left; color: var(--green); }
.ot-chain-tbl th:nth-child(4), .ot-chain-tbl th:last-child { color: var(--red); }
.ot-chain-tbl td { padding: 4px 6px; font-family: var(--mono); text-align: right; cursor: pointer; white-space: nowrap; }
.ot-chain-tbl td.ot-td-strike { text-align: center; background: var(--bg3); font-weight: 700; color: var(--fg); cursor: default; }
.ot-chain-tbl tr:hover td:not(.ot-td-strike) { background: var(--hover-tint); }
.ot-chain-tbl tr.ot-atm td { background: rgba(79,142,247,.07) !important; }
.ot-chain-tbl tr.ot-selected td { background: rgba(79,142,247,.2) !important; }
.ot-chain-call { color: var(--green); }
.ot-chain-put  { color: var(--red); }
.ot-chain-zero { color: var(--text3); }
.ot-chain-foot { padding: 8px 14px; font-size: 10px; color: var(--text3); text-align: center; border-top: 1px solid var(--border); }

/* ── Trade Pages ──────────────────────────────────────────────────────────── */
.trade-sym-bar { display: flex; gap: 8px; max-width: 600px; }
.sym-input-wrap { position: relative; flex: 1; }
.trade-sym-bar input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text); border-radius: var(--r); padding: 11px 16px;
  font-size: 14px; font-family: var(--font); box-sizing: border-box;
  transition: border-color .15s;
}
.trade-sym-bar input:focus { outline: none; border-color: var(--blue); }
.trade-sym-bar input::placeholder { color: var(--text3); font-size: 13px; }
.trade-sym-bar button {
  padding: 11px 24px; background: var(--blue); color: #fff;
  border: none; border-radius: var(--r); cursor: pointer; font-size: 13px;
  font-weight: 700; white-space: nowrap; transition: opacity .15s, box-shadow .15s;
}
.trade-sym-bar button:hover { opacity: .87; box-shadow: 0 3px 12px rgba(79,142,247,.35); }

/* Autocomplete dropdown */
.sym-dropdown {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,0.35);
  z-index: 500; overflow: hidden; max-height: 280px; overflow-y: auto;
}
.sym-dropdown.open { display: block; }
.sym-drop-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer; transition: background 0.1s;
}
.sym-drop-item:hover { background: var(--surface2); }
.sym-drop-sym  { font-family: var(--mono); font-weight: 700; font-size: 14px; min-width: 60px; color: var(--text1); }
.sym-drop-name { flex: 1; font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sym-drop-tag  { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; padding: 2px 7px; border-radius: 4px; background: var(--surface3); color: var(--text3); flex-shrink: 0; }
.trade-page-empty {
  padding: 52px 32px; text-align: center; color: var(--text3);
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; font-size: 13px;
}
.trade-page-empty p { margin: 0; }
#soPageFormArea .ot-body,
#otPageFormArea .ot-body { max-height: none; border-radius: 10px; border: 1px solid var(--border); }

/* ── Market bar ──────────────────────────────────────────────────────────── */
.market-bar {
  display: flex; align-items: center; gap: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 7px 20px; font-size: 12px; overflow-x: auto;
  position: sticky; top: 52px; z-index: 40; flex-shrink: 0;
  scrollbar-width: none;
}
.market-bar::-webkit-scrollbar { display: none; }
.mb-item   { display: flex; align-items: center; gap: 7px; padding: 2px 14px 2px 0; white-space: nowrap; }
.mb-sym    { color: var(--text3); font-weight: 700; font-size: 11px; letter-spacing: 0.5px; }
.mb-price  { font-family: var(--mono); font-weight: 600; font-size: 12px; }
.mb-chg    { font-size: 11px; font-weight: 600; }
.mb-sep    { width: 1px; height: 14px; background: var(--border); flex-shrink: 0; margin: 0 14px 0 0; }
.mb-right  { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding-left: 16px; }
.mb-kbd-hint { font-size: 11px; color: var(--text3); white-space: nowrap; }
.mb-kbd-hint kbd {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 4px; padding: 1px 5px; font-size: 10px; color: var(--text2);
  font-family: var(--mono);
}
.mb-search-btn {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2); border-radius: 6px; padding: 4px 12px;
  font-size: 12px; cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.mb-search-btn:hover { border-color: var(--text3); color: var(--text); }

.mb-cost-btn {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--purple); border-radius: 6px; padding: 4px 12px;
  font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: all 0.15s; font-family: var(--mono); letter-spacing: 0.2px;
}
.mb-cost-btn:hover { border-color: var(--purple); background: var(--purple-bg); }

/* ── Claude cost panel ───────────────────────────────────────────────────── */
.cost-panel {
  position: fixed; top: 90px; right: 16px; width: 380px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  z-index: 800; overflow: hidden;
}
.cost-panel.hidden { display: none; }
.cost-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--border);
}
.cost-panel-title { font-size: 13px; font-weight: 700; color: var(--purple); }
.cost-panel-close {
  background: none; border: none; color: var(--text3); cursor: pointer;
  font-size: 14px; padding: 2px 6px; border-radius: 4px;
}
.cost-panel-close:hover { background: var(--surface2); color: var(--text); }

.cost-filter-bar {
  display: flex; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.cost-filter-btn {
  background: none; border: 1px solid transparent; color: var(--text3);
  border-radius: 5px; padding: 4px 10px; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all 0.12s;
}
.cost-filter-btn:hover  { background: var(--surface2); color: var(--text); }
.cost-filter-btn.active { background: color-mix(in srgb, var(--purple) 15%, transparent); border-color: color-mix(in srgb, var(--purple) 40%, transparent); color: var(--purple); }

.cost-panel-body { padding: 14px 16px; max-height: 420px; overflow-y: auto; }

.cost-summary {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px;
}
.cost-stat {
  background: var(--bg); border-radius: var(--r-sm); padding: 10px 12px;
}
.cost-stat-val { font-family: var(--mono); font-size: 15px; font-weight: 800; color: var(--text1); margin-bottom: 2px; }
.cost-stat-lbl { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }

.cost-breakdown-title { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 8px; }
.cost-breakdown { display: flex; flex-direction: column; gap: 6px; }
.cost-ep-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.cost-ep-name { min-width: 80px; color: var(--text2); font-weight: 600; font-size: 11px; }
.cost-ep-bar-wrap { flex: 1; height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.cost-ep-bar { height: 100%; background: var(--purple); border-radius: 2px; }
.cost-ep-val { font-family: var(--mono); font-size: 11px; color: var(--text); min-width: 64px; text-align: right; }
.cost-ep-calls { font-size: 10px; color: var(--text3); min-width: 22px; text-align: right; }

.cost-recent { display: flex; flex-direction: column; gap: 4px; }
.cost-recent-row { display: flex; align-items: center; gap: 8px; font-size: 11px; padding: 5px 0; border-bottom: 1px solid var(--border2); }
.cost-recent-row:last-child { border-bottom: none; }
.cost-recent-ts { flex: 1; color: var(--text3); }

/* ── Toast system ────────────────────────────────────────────────────────── */
#toastContainer {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
  max-width: 380px;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--r); padding: 12px 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.55);
  pointer-events: all;
  transform: translateX(110%); opacity: 0;
  transition: transform 0.28s cubic-bezier(0.22,1,0.36,1), opacity 0.28s;
}
.toast.toast-show { transform: translateX(0); opacity: 1; }
.toast.toast-hide { transform: translateX(110%); opacity: 0; }
.toast-success { border-left: 3px solid var(--green); }
.toast-error   { border-left: 3px solid var(--red); }
.toast-warning { border-left: 3px solid var(--yellow); }
.toast-info    { border-left: 3px solid var(--blue); }
.toast-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; line-height: 1; }
.toast-success .toast-icon { color: var(--green); }
.toast-error   .toast-icon { color: var(--red); }
.toast-warning .toast-icon { color: var(--yellow); }
.toast-info    .toast-icon { color: var(--blue); }
.toast-msg   { flex: 1; font-size: 13px; line-height: 1.45; }
.toast-close { background: none; border: none; color: var(--text3); cursor: pointer; padding: 0; font-size: 13px; line-height: 1; flex-shrink: 0; }
.toast-close:hover { color: var(--text); }

/* ── Global symbol search ────────────────────────────────────────────────── */
.sym-search-overlay {
  position: fixed; inset: 0; background: rgba(5,6,8,.8);
  z-index: 9000; display: flex; align-items: flex-start;
  justify-content: center; padding-top: 12vh;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.sym-search-overlay.hidden { display: none; }
.sym-search-box {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--r-lg); width: 580px; max-width: 92vw;
  box-shadow: 0 24px 80px rgba(0,0,0,.7); overflow: hidden;
  animation: searchPop 0.18s ease;
}
@keyframes searchPop { from { transform: scale(0.96) translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.sym-search-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.sym-search-icon { font-size: 18px; color: var(--text3); flex-shrink: 0; }
.sym-search-bar input {
  flex: 1; background: none; border: none; color: var(--text);
  font-size: 18px; font-family: var(--mono); text-transform: uppercase;
  letter-spacing: 1px; min-width: 0;
}
.sym-search-bar input::placeholder { text-transform: none; letter-spacing: 0; color: var(--text3); font-family: var(--font); font-size: 15px; }
.sym-search-bar input:focus { outline: none; }
.sym-search-esc {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 7px; font-size: 11px; color: var(--text3);
  cursor: pointer; flex-shrink: 0; font-family: var(--font);
}
.sym-search-results { padding: 4px 0 8px; min-height: 120px; }
.sym-search-hint { padding: 16px 18px 8px; color: var(--text3); font-size: 13px; }
.sym-search-quick-row { display: flex; gap: 6px; padding: 8px 18px 10px; flex-wrap: wrap; }
.sym-search-quick {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 12px; font-size: 12px;
  font-family: var(--mono); cursor: pointer; font-weight: 700; color: var(--text2);
  transition: all 0.12s;
}
.sym-search-quick:hover { background: var(--blue-bg); border-color: var(--blue); color: var(--blue); }
.sym-search-item {
  display: flex; align-items: center; padding: 10px 18px;
  cursor: pointer; gap: 14px; transition: background 0.1s;
}
.sym-search-item:hover { background: var(--hover); }
.sym-search-item .ssr-sym  { font-weight: 800; font-family: var(--mono); min-width: 60px; font-size: 14px; }
.sym-search-item .ssr-name { color: var(--text2); font-size: 12px; flex: 1; }
.sym-search-item .ssr-tag  { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.sym-search-item .ssr-tag-stock  { background: var(--blue-bg);   color: var(--blue); }
.sym-search-item .ssr-tag-option { background: var(--green-bg);  color: var(--green); }
.sym-search-item .ssr-tag-screen { background: var(--yellow-bg); color: var(--yellow); }
.sym-search-item .ssr-tag-analyze { background: rgba(155,127,232,.15); color: var(--purple); }

/* ── Stock Detail Page ───────────────────────────────────────────────────── */
.sd-page { display: flex; flex-direction: column; }

.sd-header { padding: 16px 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.sd-symbol-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.sd-left  {}
.sd-exchange { font-size: 10px; color: var(--text3); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.sd-ticker  { font-size: 26px; font-weight: 900; font-family: var(--mono); letter-spacing: -0.5px; line-height: 1.1; }
.sd-company { font-size: 13px; color: var(--text2); margin-top: 3px; }
.sd-price-block { text-align: right; }
.sd-price   { font-size: 34px; font-weight: 800; font-family: var(--mono); line-height: 1.1; letter-spacing: -1px; }
.sd-price-hover { font-size: 22px; color: var(--text2); }
.sd-change  { font-size: 13px; font-weight: 600; margin-top: 4px; }
.sd-change.green { color: var(--green); }
.sd-change.red   { color: var(--red); }
.sd-quote-src { font-size: 10px; color: var(--text3); margin-top: 4px; text-align: right; }

.sd-chart-wrap { padding: 0 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.sd-chart { height: 280px; width: 100%; }
.sd-period-bar { display: flex; gap: 2px; margin-top: 10px; }
.sd-period {
  background: none; border: none; color: var(--text3); cursor: pointer;
  font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 6px;
  transition: background 0.12s, color 0.12s;
}
.sd-period:hover  { background: var(--surface2); color: var(--text); }
.sd-period.active { background: var(--surface2); color: var(--text); }

.sd-body {
  display: grid; grid-template-columns: 1fr 320px;
  gap: 28px; padding: 20px 0 24px; align-items: start;
}
@media (max-width: 900px) { .sd-body { grid-template-columns: 1fr; } }
.sd-left-col { min-width: 0; }

.sd-section-title {
  font-size: 10px; font-weight: 700; color: var(--text3);
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 14px;
}

.sd-stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0;
}
.sd-stat-item {
  padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border);
}
.sd-stat-item:nth-last-child(-n+2) { border-bottom: none; }
.sd-stat-wide { grid-column: 1 / -1; }
.sd-stat-lbl { font-size: 11px; color: var(--text3); margin-bottom: 3px; }
.sd-stat-val { font-size: 13px; font-weight: 600; font-family: var(--mono); }

.sd-order-col { }
.sd-order-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px; position: sticky; top: 55px;
}
.sd-order-tabs {
  display: flex; background: var(--bg); border-radius: 8px;
  padding: 3px; margin-bottom: 16px; gap: 3px;
}
.sd-order-tab {
  flex: 1; padding: 8px; background: none; border: none;
  border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 700;
  color: var(--text3); transition: all 0.15s;
}
.sd-order-tab.active.buy  { background: var(--green-bg); color: var(--green); }
.sd-order-tab.active.sell { background: var(--red-bg);   color: var(--red); }
.sd-order-tab:not(.active):hover { background: var(--surface2); color: var(--text); }

.sd-bal-strip {
  background: var(--bg); border-radius: var(--r-sm); padding: 10px 12px;
  margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center;
}
.sd-bal-lbl { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 1px; }
.sd-bal-val { font-family: var(--mono); font-weight: 700; font-size: 13px; }

.sd-order-fields { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.sd-order-field label { display: block; font-size: 10px; color: var(--text3); font-weight: 700; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.5px; }
.sd-order-field input,
.sd-order-field select {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--r-sm); padding: 10px 12px;
  font-size: 14px; font-family: var(--font); transition: border-color 0.15s;
}
.sd-order-field input:focus,
.sd-order-field select:focus { outline: none; border-color: var(--blue); }

.sd-est-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 0; border-top: 1px solid var(--border); margin-bottom: 12px;
}
.sd-est-lbl { font-size: 12px; color: var(--text2); }
.sd-est-val { font-size: 15px; font-weight: 800; font-family: var(--mono); }

.sd-review-btn {
  width: 100%; padding: 13px; font-size: 14px; font-weight: 700;
  border: none; border-radius: var(--r); cursor: pointer;
  background: linear-gradient(135deg, var(--green), var(--green2));
  color: #000; transition: opacity 0.15s; letter-spacing: 0.2px;
}
.sd-review-btn:hover { opacity: 0.88; }
.sd-review-btn.sell { background: linear-gradient(135deg, var(--red), var(--red2)); color: #fff; }
.sd-review-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* About / analyst */
.sd-about-wrap { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; }
.sd-about-text { font-size: 13px; color: var(--text2); line-height: 1.7; max-height: 76px; overflow: hidden; transition: max-height 0.3s; }
.sd-about-text.expanded { max-height: 400px; }
.sd-about-more { font-size: 12px; color: var(--blue); cursor: pointer; margin-top: 4px; display: inline-block; }

.sd-analyst-wrap { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sd-analyst-badge { padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase; }
.sd-analyst-STRONG_BUY, .sd-analyst-strong_buy { background: rgba(0,217,126,.18); color: var(--green); }
.sd-analyst-BUY, .sd-analyst-buy               { background: rgba(0,217,126,.10); color: var(--green2); }
.sd-analyst-HOLD, .sd-analyst-hold, .sd-analyst-neutral { background: var(--yellow-bg); color: var(--yellow); }
.sd-analyst-SELL, .sd-analyst-sell, .sd-analyst-underperform { background: var(--red-bg); color: var(--red); }

/* News */
.sd-news-section { padding: 20px 0; }
.sd-news-grid { }
.sd-news-item {
  display: flex; gap: 12px; padding: 13px 0;
  border-bottom: 1px solid var(--border); cursor: pointer;
  text-decoration: none; color: inherit; transition: background 0.12s;
  border-radius: 4px;
}
.sd-news-item:last-child { border-bottom: none; }
.sd-news-item:hover .sd-news-title { color: var(--blue); }
.sd-news-dot { flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; }
.sd-news-dot.positive { background: var(--green); }
.sd-news-dot.negative { background: var(--red); }
.sd-news-dot.neutral  { background: var(--text3); }
.sd-news-body { flex: 1; min-width: 0; }
.sd-news-title { font-size: 13px; font-weight: 500; line-height: 1.4; margin-bottom: 5px; }
.sd-news-meta  { font-size: 11px; color: var(--text3); display: flex; gap: 6px; align-items: center; }
.sd-news-loading { padding: 28px; text-align: center; color: var(--text3); font-size: 13px; }

/* Skeleton loading animation */
@keyframes sk-shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
  background-size: 200% 100%; animation: sk-shimmer 1.6s infinite;
  border-radius: 4px; color: transparent !important; pointer-events: none;
  display: inline-block;
}

/* ── Orders Page ──────────────────────────────────────────────────────────── */
.ord-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ord-table th {
  padding: 8px 12px; text-align: left; color: var(--muted); font-size: 11px;
  font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase;
  border-bottom: 1px solid var(--border); background: var(--bg2); position: sticky; top: 0;
}
.ord-table td { padding: 10px 12px; border-bottom: 1px solid var(--border2); vertical-align: middle; }
.ord-table tbody tr:hover { background: var(--hover); }
.ord-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}
.ord-badge-open      { background: rgba(30,185,128,.15); color: var(--green); }
.ord-badge-filled    { background: rgba(0,125,210,.15);  color: var(--blue); }
.ord-badge-cancelled { background: var(--card);          color: var(--muted); }
.ord-badge-rejected  { background: rgba(255,70,70,.12);  color: var(--red); }
.ord-badge-expired   { background: var(--card);          color: var(--text3); }
.ord-badge-other     { background: var(--card);          color: var(--text2); }

/* ── Sidebar drag-and-drop ───────────────────────────────────────────────── */
.sidebar-section-label { cursor: grab; user-select: none; }
.sidebar-section-label:active { cursor: grabbing; }
.sidebar-section.sb-dragging  { opacity: 0.35; }
.sidebar-section.sb-drag-over { box-shadow: inset 0 2px 0 0 var(--accent); }

@media (max-width: 880px) {
  :root { --sidebar-w: 60px; }
  .sidebar-section-label, .nav-item span:not(.nav-icon), .logo-sub, .et-label, .et-value { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .sidebar-section[data-section-id="recent"] { display: none; }
  .logo-mark { justify-content: center; }
  .et-status-pill { justify-content: center; padding: 9px; }

  /* Stock detail responsive */
  .sd-body { grid-template-columns: 1fr; gap: 20px; }
  .sd-order-col .sd-order-card { position: static; }
  .sd-ticker { font-size: 22px; }
  .sd-price  { font-size: 28px; }
  .sd-chart  { height: 220px; }
}
@media (max-width: 900px) {
  .sd-body { grid-template-columns: 1fr; }
  .sd-order-col .sd-order-card { position: static; }
  .sd-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .cards-row { grid-template-columns: repeat(2, 1fr); }
  .two-col   { grid-template-columns: 1fr; }
  .az-grid   { grid-template-columns: 1fr; }
  .earnings-grid { grid-template-columns: 1fr; }

  /* Stock detail small screen */
  .sd-symbol-row { flex-direction: column; gap: 8px; }
  .sd-price-block { text-align: left; }
  .sd-quote-src   { text-align: left; }
  .sd-chart  { height: 180px; }
  .sd-stats-grid { grid-template-columns: 1fr; }
  .trade-sym-bar { max-width: 100%; }

  /* Analyzer input bar wraps nicely */
  .az-input-bar { gap: 8px; }
  .az-input-field { min-width: 0; }
}
@media (max-width: 480px) {
  .sd-ticker { font-size: 20px; }
  .sd-price  { font-size: 24px; }
  .sd-order-tabs { gap: 2px; }
  .sd-order-tab  { font-size: 12px; padding: 7px 6px; }
  .section-header h2 { font-size: 18px; }
}

/* ═══════════════════════════════════════════════════════
   MOBILE / iOS — only fires on small touch screens
   Desktop layout is completely unaffected
══════════════════════════════════════════════════════ */
.mobile-bottom-nav { display: none; }
.mobile-more-sheet { display: none; }

/* Bottom nav items (defined outside media query so desktop doesn't get them either) */
.mbn-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; padding: 8px 4px 6px;
  background: none; border: none;
  color: var(--text3); font-family: var(--font);
  cursor: pointer; transition: color 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.mbn-item.active { color: var(--blue); }
.mbn-item.active .mbn-icon { transform: scale(1.1); }
.mbn-icon  { font-size: 20px; line-height: 1; transition: transform 0.15s; }
.mbn-label { font-size: 10px; font-weight: 600; letter-spacing: 0.1px; }

/* More sheet (visible only when toggled) */
.mms-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.mms-body {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  animation: mmsSlideUp 0.25s cubic-bezier(0.22,1,0.36,1);
}
@keyframes mmsSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.mms-title {
  font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; padding: 0 4px;
}
.mms-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mms-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 16px 8px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--r);
  color: var(--text); font-family: var(--font); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.mms-item:active { background: var(--surface3); border-color: var(--border2); }
.mms-icon { font-size: 18px; }

/* ── Core mobile layout: applies to ALL phones regardless of pointer type ── */
@media (max-width: 768px) {
  .sidebar { display: none !important; }
  .main    { margin-left: 0 !important; padding-top: calc(48px + env(safe-area-inset-top)) !important; }
  .topbar  { left: 0 !important; padding: env(safe-area-inset-top) 14px 0; height: calc(48px + env(safe-area-inset-top)); width: 100% !important; box-sizing: border-box; }
  .topbar-title { font-size: 14px; }
  .topbar-chips { display: none; }
  .mb-kbd-hint  { display: none; }
  .market-bar   { top: calc(48px + env(safe-area-inset-top)); left: 0 !important; right: 0 !important; padding: 5px 12px; }
  /* Leave room for bottom nav (68px) — pointer:coarse block shows it, but safe to reserve space anyway */
  .page { padding: 14px 14px calc(72px + env(safe-area-inset-bottom)) 14px !important; }

  /* ── Lotto-play cards: stacked layout instead of a cramped 5-column grid.
     The E*TRADE <table> is untouched here — it scrolls horizontally via its
     existing overflow-x:auto wrapper instead. ── */
  .pf-col-labels { display: none; }
  .pf-pos-card {
    display: flex; flex-direction: column; align-items: stretch; gap: 8px;
    padding: 14px; margin-bottom: 10px; border: 1px solid var(--border);
    border-radius: var(--r);
  }
  .pf-section-lotto { background: transparent; border: none; box-shadow: none; }
  .pf-pos-card:last-child { margin-bottom: 0; }
  .pf-pos-card .pf-col-cell {
    display: inline-flex; justify-content: space-between; text-align: left;
    font-size: 13px; width: 100%;
  }
  .pf-pos-card .pf-col-cell::before { content: attr(data-label); color: var(--text3); font-size: 11px; font-weight: 600; }
  .pf-pos-actions { justify-content: stretch; }
  .pf-pos-actions button { flex: 1; }
}

@media (max-width: 768px) and (pointer: coarse) {
  /* ── Kill desktop nav (already hidden above, kept for clarity) ── */
  .topbar-chips { display: none; }
  .mb-kbd-hint  { display: none; }

  /* ── Market bar — keep scrollable, just compact ── */
  .market-bar { top: 48px; padding: 5px 12px; }

  /* ── Prevent iOS auto-zoom on input focus (requires 16px) ── */
  input, select, textarea { font-size: 16px !important; }

  /* ── Bottom nav ── */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }

  /* ── More sheet ── */
  .mobile-more-sheet {
    display: block !important;
    position: fixed; inset: 0; z-index: 300;
  }
  .mobile-more-sheet.hidden { display: none !important; }

  /* ── Cost panel — full-width on mobile ── */
  .cost-panel { left: 8px; right: 8px; width: auto; top: 96px; }

  /* ── Modal ── */
  .modal-box { min-width: 0; width: calc(100vw - 32px) !important; }

  /* ── Analyzer ── */
  .az-conv-divider { display: none; }
  .az-conviction-row { flex-direction: column; gap: 14px; }
  .az-conv-bars { min-width: 0; width: 100%; }
  .az-conv-signals { padding-right: 0; }
  .az-header-sym { font-size: 24px; }
  .az-header-price { font-size: 22px; }

  /* ── Portfolio ── */
  .pf-value { font-size: 30px; }

  /* ── Stock detail ── */
  .sd-price  { font-size: 26px; }
  .sd-ticker { font-size: 20px; }
  .sd-chart  { height: 200px; }

  /* ── Two-col → single col ── */
  .two-col { grid-template-columns: 1fr; }
  .az-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .cards-row { grid-template-columns: repeat(2, 1fr); }
  .earnings-grid { grid-template-columns: 1fr; }

  /* ── Tables ── */
  .tbl-wrap { -webkit-overflow-scrolling: touch; }

  /* ── Screener controls wrap tighter ── */
  .controls-bar { padding: 12px 14px; gap: 8px; }
  .ctrl-group input, .ctrl-group select { width: 80px; }

  /* ── Make user menu always visible ── */
  .user-menu { display: flex; }

  /* ── Cards full-width ── */
  .card { border-radius: 8px; }

  /* ── Section headers stack on small screens ── */
  .section-header { flex-direction: column; gap: 8px; }
  .section-header > div:last-child { width: 100%; }

  /* ── Tables: readable font + horizontal scroll + momentum ── */
  table { font-size: 13px; }
  tbody td { font-size: 13px; padding: 13px 10px; }
  .table-wrap, .results-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* ── Settings panel full-width ── */
  #tab-settings > div { max-width: 100%; }

  /* ── Analyzer: input bar → 2-col grid ── */
  .az-input-bar {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 12px 14px !important;
    margin-bottom: 12px !important;
  }
  .az-input-ticker  { grid-column: 1 / -1; }
  .az-input-actions { grid-column: 1 / -1; }
  .az-input-actions .btn-primary { width: 100%; justify-content: center; }
  .az-input-ticker input,
  .az-input-expiry select,
  .az-input-strike select { width: 100% !important; box-sizing: border-box; }

  /* ── Analyzer: compact header ── */
  .az-header { padding: 14px 16px 12px !important; }
  .az-header-sym   { font-size: 24px !important; }
  .az-header-price { font-size: 22px !important; }
  .az-header-meta  { font-size: 11px !important; }
  .az-header-actions { flex-wrap: wrap; margin-top: 10px !important; }
  .az-header-actions button { flex: 1; min-width: 0; font-size: 11px !important; }

  /* ── Analyzer: compact cards ── */
  .az-card { padding: 12px 14px !important; }
  .az-flip-ladder { padding: 12px 14px !important; }
  .az-flip-rung { padding: 12px 14px !important; }
  .az-rung-mult  { font-size: 20px !important; }
  .az-rung-price { font-size: 15px !important; }
  .az-qs-item { padding: 10px 12px !important; }
  .az-qs-val  { font-size: 14px !important; }

  /* ── Portfolio: fix negative margins for 14px page padding ── */
  .pf-hero { padding: 16px 14px 0 !important; }
  .pf-chart-wrap  { margin: 0 -14px !important; }
  .pf-period-row  { margin: 0 -14px !important; padding-left: 14px !important; }
  .pf-metrics-strip { margin: 0 -14px !important; }
  .pf-value { font-size: 28px !important; }

  /* ── Period buttons (analyzer chart) ── */
  .az-period-btn { padding: 3px 8px !important; font-size: 10px !important; }

  /* ── Table rows: comfortable on mobile ── */
  thead th { padding: 10px !important; font-size: 10px !important; }
  tbody td  { padding: 13px 10px !important; font-size: 13px !important; }

  /* ── Section headers: tighter ── */
  .section-header { margin-bottom: 12px; padding-bottom: 10px; }
}

/* ═══════════════════════════════════════════════════════
   DESIGN REFRESH — clean, spacious, professional
══════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════
   DESIGN REFRESH — optimised for 1920×1080
══════════════════════════════════════════════════════ */

/* ── Root adjustments for 1920 ─────────────────────────────────────────── */
:root {
  --sidebar-w: 230px;   /* slightly wider sidebar on big screens */
}

/* ── Global ─────────────────────────────────────────────────────────────── */
body { font-size: 14px; line-height: 1.6; }

/* ── Pages: fill full width, no artificial max-width cap ─────────────────  */
.page {
  padding: 28px 36px;
  max-width: none;       /* let content stretch edge-to-edge */
  width: 100%;
  box-sizing: border-box;
}

/* ── Main: fill remaining viewport ──────────────────────────────────────── */
.main { flex: 1; min-width: 0; width: calc(100vw - var(--sidebar-w)); }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  padding: 0 30px;
  left: var(--sidebar-w);
  right: 0;
  width: auto;
}
.topbar-title { font-size: 15px; font-weight: 800; letter-spacing: -0.2px; }

/* ── Market bar ──────────────────────────────────────────────────────────── */
.market-bar { padding: 7px 30px; top: 52px; }
.mb-sym   { font-size: 11.5px; }
.mb-price { font-size: 13px; }

/* ── Section headers ─────────────────────────────────────────────────────── */
.section-header {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  gap: 14px;
}
.section-header h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; }
.section-header .subtitle { font-size: 12px; color: var(--text3); }

/* ── Tables ──────────────────────────────────────────────────────────────── */
thead th { font-size: 10px; padding: 11px 13px; letter-spacing: 0.65px; }
tbody td  { padding: 12px 13px; font-size: 13px; }
tbody tr:hover { background: rgba(79,142,247,.05) !important; }
.table-wrap { border-radius: var(--r-lg); box-shadow: 0 2px 16px rgba(0,0,0,.25); width: 100%; }

/* ── Filter bars ─────────────────────────────────────────────────────────── */
.filter-bar {
  padding: 14px 20px;
  gap: 14px;
  border-radius: var(--r-lg);
  width: 100%;
  box-sizing: border-box;
}
.filter-group label { font-size: 10px; margin-bottom: 4px; }
.filter-group input, .filter-group select {
  padding: 7px 10px; font-size: 13px; border-radius: var(--r); width: 96px;
}

/* ── Preset pills ────────────────────────────────────────────────────────── */
.preset-btn { padding: 5px 14px; font-size: 11.5px; }
.preset-bar { margin-bottom: 13px; gap: 6px; }

/* ── Status bars ─────────────────────────────────────────────────────────── */
.status-bar { padding: 10px 16px; font-size: 12.5px; border-radius: var(--r); }

/* ── Progress bar ────────────────────────────────────────────────────────── */
.progress-wrap { height: 3px; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar { width: var(--sidebar-w); }
.nav-item { padding: 9px 14px; font-size: 13px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary { padding: 8px 18px; font-size: 13px; border-radius: var(--r); }
.btn-ghost   { padding: 7px 15px; font-size: 12.5px; border-radius: var(--r); }
.btn-sm { padding: 5px 11px !important; font-size: 11.5px !important; }
.action-col { gap: 5px; }
.score-badge { min-width: 36px; padding: 3px 8px; font-size: 11.5px; }

/* ── Portfolio hero fills width ──────────────────────────────────────────── */
.pf-hero { max-width: none; }

/* ══════════════════════════════════════════════════════
   ANALYZER — trading terminal redesign
══════════════════════════════════════════════════════ */

/* ── Page container: strict vertical stack, full width ──────────────────── */
.az-page {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ── Kill any old side-by-side wrapper silently ─────────────────────────── */
.az-metrics-row {
  display: contents !important; /* wrapper becomes invisible; children join parent flex */
}

/* ── Header: premium dark hero card ─────────────────────────────────────── */
.az-header {
  background: linear-gradient(135deg, var(--hero-grad-start) 0%, var(--surface2) 100%);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  padding: 24px 28px 20px;
  box-shadow: 0 4px 28px rgba(0,0,0,.45);
  width: 100%;
  box-sizing: border-box;
}
.az-header-top   { width: 100%; }
.az-header-sym   { font-size: 36px; font-weight: 900; letter-spacing: -1px; }
.az-header-meta  { font-size: 12.5px; gap: 10px; margin-top: 7px; }
.az-header-price { font-size: 32px; font-weight: 800; letter-spacing: -1px; }
.az-header-chg   { font-size: 14px; font-weight: 700; margin-top: 4px; }
.az-header-actions { gap: 8px; margin-top: 14px; }

/* ── Quick stats: FULL-WIDTH horizontal metric strip ────────────────────── */
.az-quickstats {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
  width: 100% !important;
  box-sizing: border-box !important;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(0,0,0,.25);
  flex-shrink: 0;
}
.az-qs-item {
  padding: 16px 18px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.az-qs-item:last-child { border-right: none; }
.az-qs-lbl {
  font-size: 9px !important; letter-spacing: 0.7px; color: var(--text3);
  text-transform: uppercase; font-weight: 700; margin-bottom: 6px;
}
.az-qs-val {
  font-size: 18px !important; font-weight: 800;
  font-family: var(--mono); line-height: 1.1;
}

/* ── Flip ladder: FULL-WIDTH, 4 cards in a single row ───────────────────── */
.az-flip-ladder {
  width: 100% !important;
  box-sizing: border-box !important;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: 0 2px 14px rgba(0,0,0,.25);
  flex-shrink: 0;
}
.az-flip-ladder-title {
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.8px;
  color: var(--text3); text-transform: uppercase; margin-bottom: 14px;
}
.az-flip-rungs {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 10px;
  width: 100%;
}
.az-flip-rung {
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: transform .15s, box-shadow .15s;
}
.az-flip-rung:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.az-rung-mult  { font-size: 26px; font-weight: 900; font-family: var(--mono); line-height: 1; }
.az-rung-sell  { font-size: 11px; color: var(--text3); margin-top: 7px; font-weight: 600; }
.az-rung-price { font-size: 19px; font-weight: 800; font-family: var(--mono); margin-top: 6px; }
.az-rung-move  { font-size: 12px; font-weight: 700; margin-top: 3px; }

/* ── Conviction, Claude, accordions: all full-width ─────────────────────── */
.az-conviction-row {
  width: 100%; box-sizing: border-box;
  border-radius: var(--r-lg);
  box-shadow: 0 2px 14px rgba(0,0,0,.2);
}
.az-claude-card {
  width: 100%; box-sizing: border-box;
  border-radius: var(--r-lg);
  box-shadow: 0 4px 24px color-mix(in srgb, var(--claude-1) 15%, transparent);
}
.az-acc { border-radius: var(--r-lg); width: 100%; box-sizing: border-box; }

/* ── Input bar ───────────────────────────────────────────────────────────── */
.az-input-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  box-shadow: 0 2px 14px rgba(0,0,0,.2);
  width: 100%; box-sizing: border-box;
}

/* ── Explain rows ────────────────────────────────────────────────────────── */
.explain-row td { padding: 14px 18px; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (min-width: 1600px) {
  .stat-row { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 900px) {
  .az-flip-rungs { grid-template-columns: repeat(2, 1fr) !important; }
  .az-qs-val { font-size: 15px !important; }
}

/* ═══════════════════════════════════════════════════════
   FRIENDS PAGE
══════════════════════════════════════════════════════ */
.friend-card { padding: 20px; box-shadow: var(--shadow-sm); }
.friend-card-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  color: var(--muted); letter-spacing: .5px; margin-bottom: 14px;
}
.friend-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.friend-row:last-child { border-bottom: none; }
.friend-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff; font-weight: 800; font-size: 14px;
}
.friend-info { flex: 1; min-width: 0; }
.friend-name { font-weight: 700; font-size: 13.5px; }
.friend-meta { font-size: 11px; color: var(--text3); margin-top: 1px; }
.friend-actions { display: flex; gap: 6px; flex-shrink: 0; }

.shared-card {
  border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px;
  margin-bottom: 10px; background: var(--bg2); position: relative;
}
.shared-card:last-child { margin-bottom: 0; }
.shared-card.unread { border-color: color-mix(in srgb, var(--blue) 40%, transparent); }
.shared-card.unread::before {
  content: ''; position: absolute; top: 14px; left: -1px; width: 3px; height: calc(100% - 28px);
  background: var(--blue); border-radius: 0 2px 2px 0;
}
.shared-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.shared-card-from { font-size: 11px; color: var(--text3); }
.shared-card-note { font-size: 12px; color: var(--text2); margin: 6px 0; font-style: italic; }
.shared-card-actions { display: flex; gap: 6px; margin-top: 8px; }

/* ═══════════════════════════════════════════════════════
   CHAT MODAL
══════════════════════════════════════════════════════ */
.chat-modal-box { width: 420px; max-width: 92vw; display: flex; flex-direction: column; }
.chat-modal-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.chat-modal-hdr h3 { margin-bottom: 0; }
.chat-messages {
  display: flex; flex-direction: column; gap: 8px;
  height: 360px; overflow-y: auto; padding: 4px 2px;
  border: 1px solid var(--border); border-radius: var(--r); background: var(--bg2);
  margin-bottom: 12px;
}
.chat-bubble {
  max-width: 78%; padding: 8px 11px; border-radius: 12px; font-size: 13px;
  line-height: 1.4; word-break: break-word;
}
.chat-bubble.theirs { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); }
.chat-bubble.mine   { align-self: flex-end;   background: var(--blue); color: #fff; }
.chat-bubble-time   { font-size: 10px; opacity: .65; margin-top: 3px; }
.chat-shared-card   { align-self: center; width: 92%; border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; background: var(--surface); }
.chat-input-row     { display: flex; gap: 8px; }
.chat-input-row input { flex: 1; }

/* ═══════════════════════════════════════════════════════
   MOBILE POLISH — touch targets, readable tables, scroll
══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Bigger body font on phone */
  body { font-size: 15px !important; line-height: 1.65 !important; }

  /* Section headings — bolder and bigger on phone */
  .section-header h2 { font-size: 18px !important; font-weight: 800 !important; }

  /* Page: tighter side padding on phone */
  .page { padding-left: 12px !important; padding-right: 12px !important; }

  /* Momentum scrolling on ALL horizontally-scrolling containers */
  .table-wrap, .tbl-wrap, .results-table-wrap,
  #tpResults > div, #spResults > div, #zdResults > div,
  #earningsResults > div, #screenerResults > div, #spreadResults > div {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none; /* cleaner look on phone */
  }

  /* Sticky first column in scan tables so symbol stays visible while scrolling */
  #tpResults tbody td:first-child,
  #spResults tbody td:first-child,
  #zdResults tbody td:first-child,
  #earningsResults tbody td:first-child,
  #screenerResults tbody td:first-child,
  #spreadResults tbody td:first-child {
    position: sticky;
    left: 0;
    background: var(--surface);
    z-index: 2;
    box-shadow: 2px 0 6px rgba(0,0,0,.25);
  }
}

@media (max-width: 768px) and (pointer: coarse) {
  /* ── 44px minimum touch targets (Apple HIG / Material guidance) ── */
  .btn, .btn-primary, .btn-ghost, .btn-trade,
  .pager-btn, .pager-num, .pager-size-btn,
  .nav-item, .mbn-item,
  .scan-btn, .preset-btn { min-height: 44px; }

  /* Primary action buttons on phone: full width, larger text */
  .btn-primary { font-size: 15px !important; padding: 12px 22px !important; }

  /* Select / input comfortable tap size already guaranteed by the 16px rule;
     add min-height so they're not too short to tap accurately */
  select, input[type="text"], input[type="number"],
  input[type="email"], input[type="password"] {
    min-height: 44px;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }

  /* Controls bar: inputs stack nicely at 44px height */
  .ctrl-group input, .ctrl-group select { width: 100%; min-height: 44px; }

  /* Larger nav items in the bottom tab bar */
  .mbn-icon  { font-size: 22px; }
  .mbn-label { font-size: 11px; }

  /* Action buttons in scan rows: bigger tap target */
  .action-col button { min-height: 40px; padding: 8px 10px !important; font-size: 12px !important; }
}
