/* ═══════════════════════════════════════════════════════════
   Crypto-Monster — base.css
   Shared foundation: tokens, reset, aurora, glass primitives,
   form/button atoms. Imported by every page-level stylesheet.
   ═══════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────
   1. DESIGN TOKENS
   ─────────────────────────────────────────────────────────── */
:root {
  /* Surface */
  --bg: #05070d;
  --fg: #e8eef7;
  --fg-dim: #8a93a8;
  --fg-faint: #4a5163;

  /* Accents */
  --cyan: #00d4ff;
  --cyan-glow: rgba(0, 212, 255, 0.45);
  --cyan-soft: rgba(0, 212, 255, 0.12);
  --cyan-text: #00d4ff;          /* contrast-aware cyan for text/borders */
  --lime: #84ff00;
  --lime-glow: rgba(132, 255, 0, 0.5);
  --crimson: #ff3060;
  --crimson-soft: rgba(255, 48, 96, 0.15);

  /* Glass primitives */
  --glass-bg: rgba(15, 22, 35, 0.55);
  --glass-bg-soft: rgba(15, 22, 35, 0.4);
  --glass-border: rgba(0, 212, 255, 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.06);

  /* Form inputs */
  --input-bg: rgba(8, 12, 22, 0.85);
  --input-border: rgba(255, 255, 255, 0.08);

  /* Typography */
  --font-display: 'Manrope', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Geometry */
  --radius: 18px;
  --radius-sm: 10px;
  --radius-tile: 12px;
}

/* ───────────────────────────────────────────────────────────
   2. RESET
   ─────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--fg);
  font-family: var(--font-display);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ───────────────────────────────────────────────────────────
   3. AURORA BACKGROUND
   3 floating radial gradients + SVG noise + vignette.
   Use as fixed-position layer behind page content.
   ─────────────────────────────────────────────────────────── */
.aurora { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.aurora__layer { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.55; will-change: transform; }
.aurora__layer--1 { width: 60vmax; height: 60vmax; top: -20vmax; left: -10vmax; background: radial-gradient(circle at 50% 50%, #00d4ff 0%, transparent 60%); animation: float-1 28s ease-in-out infinite; }
.aurora__layer--2 { width: 55vmax; height: 55vmax; bottom: -25vmax; right: -15vmax; background: radial-gradient(circle at 50% 50%, #1aa1ff 0%, transparent 60%); opacity: 0.4; animation: float-2 32s ease-in-out infinite; }
.aurora__layer--3 { width: 45vmax; height: 45vmax; top: 30vh; right: -10vmax; background: radial-gradient(circle at 50% 50%, #00ffaa 0%, transparent 65%); opacity: 0.18; animation: float-3 36s ease-in-out infinite; }

@keyframes float-1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(8vw,12vh) scale(1.15); } }
@keyframes float-2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-10vw,-8vh) scale(1.1); } }
@keyframes float-3 { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(-5vw,4vh) scale(1.2); } 66% { transform: translate(6vw,-6vh) scale(0.9); } }

.aurora__noise {
  position: absolute; inset: -50%; width: 200%; height: 200%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.18; mix-blend-mode: overlay;
}
.aurora__vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(5,7,13,0.85) 100%),
              linear-gradient(180deg, rgba(5,7,13,0.4) 0%, transparent 25%, transparent 75%, rgba(5,7,13,0.6) 100%);
}

/* ───────────────────────────────────────────────────────────
   4. BRAND STRIP (top-of-page header)
   ─────────────────────────────────────────────────────────── */
.brand-strip {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; max-width: 1200px; margin: 0 auto;
}
.brand-mark { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-weight: 700; font-size: 13px; letter-spacing: 0.18em; }
.brand-mark__icon { font-size: 22px; color: var(--cyan); filter: drop-shadow(0 0 12px var(--cyan-glow)); }
.brand-mark__sep { color: var(--cyan); margin: 0 2px; }

.status-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--glass-bg); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-border);
  font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.15em;
  color: var(--fg-dim);
}
.status-pill__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime-glow); animation: pulse-dot 2s ease-in-out infinite; }
@keyframes pulse-dot { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.8); } }

/* ───────────────────────────────────────────────────────────
   5. GLASS CARD (base primitive)
   Page-level layouts compose these into grids/columns.
   ─────────────────────────────────────────────────────────── */
.card {
  position: relative; width: 100%; max-width: 460px;
  border-radius: var(--radius); background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(180%); -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 25px 80px -20px rgba(0,0,0,0.6), 0 0 0 1px var(--glass-highlight) inset;
  animation: card-enter 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.card::before { content: ''; position: absolute; inset: 0; border-radius: var(--radius); background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 30%); pointer-events: none; }
@keyframes card-enter { 0% { opacity: 0; transform: translateY(20px) scale(0.98); } 100% { opacity: 1; transform: translateY(0) scale(1); } }

.card.is-shaking, form.is-shaking { animation: shake 0.45s cubic-bezier(0.36,0.07,0.19,0.97); }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }

.card__inner { position: relative; padding: 36px 32px 28px; }
.card__head { margin-bottom: 26px; }
.card__eyebrow { margin: 0 0 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.22em; color: var(--cyan-text); text-transform: uppercase; }
.card__title { margin: 0 0 6px; font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--fg); }
.card__subtitle { margin: 0; font-size: 13px; color: var(--fg-dim); line-height: 1.4; }
.card__foot { margin: 22px 0 0; text-align: center; font-size: 13px; color: var(--fg-dim); }

/* ───────────────────────────────────────────────────────────
   6. ALERT
   ─────────────────────────────────────────────────────────── */
.alert { display: flex; gap: 12px; padding: 14px 16px; margin-bottom: 22px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.4; }
.alert--error { background: var(--crimson-soft); border: 1px solid rgba(255,48,96,0.3); color: #ffb0c1; }
.alert__icon { flex-shrink: 0; margin-top: 1px; color: var(--crimson); }
.alert__msg { margin: 0; font-weight: 500; color: #ffd0db; }
.alert__sub { margin: 4px 0 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; opacity: 0.75; }

/* ───────────────────────────────────────────────────────────
   7. FORM FIELDS
   Robust against browser autofill on Edge/Chrome.
   ─────────────────────────────────────────────────────────── */
.field { display: block; margin-bottom: 18px; }
.field__label { display: block; margin-bottom: 7px; font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.16em; color: var(--fg-dim); text-transform: uppercase; }

.field__wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  overflow: hidden;
}
.field__wrap:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}

.field__icon { position: absolute; left: 14px; color: var(--fg-faint); pointer-events: none; transition: color 0.2s; z-index: 2; }
.field__wrap:focus-within .field__icon { color: var(--cyan); }

.field__input {
  flex: 1;
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  background: transparent !important;
  border: none;
  color: var(--fg) !important;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  outline: none;
}
.field__input::placeholder { color: var(--fg-faint); }

/* The autofill killer — nuclear option */
.field__input:-webkit-autofill,
.field__input:-webkit-autofill:hover,
.field__input:-webkit-autofill:focus,
.field__input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--fg) !important;
  -webkit-box-shadow: 0 0 0 100px var(--input-bg) inset !important;
  box-shadow: 0 0 0 100px var(--input-bg) inset !important;
  caret-color: var(--cyan) !important;
  transition: background-color 99999s ease-in-out 0s;
  -webkit-transition: background-color 99999s ease-in-out 0s;
  background-clip: content-box !important;
}

.field__toggle { background: none; border: none; padding: 0 14px; height: 48px; cursor: pointer; color: var(--fg-faint); display: flex; align-items: center; transition: color 0.2s; z-index: 2; position: relative; }
.field__toggle:hover { color: var(--cyan); }

/* ───────────────────────────────────────────────────────────
   8. CHECKBOX
   ─────────────────────────────────────────────────────────── */
.checkbox { display: flex; align-items: center; gap: 10px; margin: 18px 0 24px; font-size: 13px; color: var(--fg-dim); cursor: pointer; user-select: none; }
.checkbox input { position: absolute; opacity: 0; pointer-events: none; }
.checkbox__box { display: flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 5px; background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.1); color: var(--bg); transition: all 0.2s; }
.checkbox__box svg { opacity: 0; transform: scale(0.5); transition: all 0.2s; }
.checkbox input:checked + .checkbox__box { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 12px var(--cyan-soft); }
.checkbox input:checked + .checkbox__box svg { opacity: 1; transform: scale(1); }
.checkbox input:focus-visible + .checkbox__box { box-shadow: 0 0 0 3px var(--cyan-soft); }

/* ───────────────────────────────────────────────────────────
   9. SUBMIT BUTTON (primary)
   ─────────────────────────────────────────────────────────── */
.btn-submit {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 52px; padding: 0 24px;
  background: linear-gradient(180deg, #00d4ff 0%, #00a8cc 100%); color: #000814;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: 0.02em;
  cursor: pointer; overflow: hidden;
  box-shadow: 0 8px 24px -8px var(--cyan-glow), 0 0 0 1px rgba(255,255,255,0.1) inset;
  transition: transform 0.15s, box-shadow 0.2s;
}
.btn-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 32px -8px var(--cyan-glow), 0 0 0 1px rgba(255,255,255,0.15) inset; }
.btn-submit:active:not(:disabled) { transform: translateY(0); }
.btn-submit:disabled { cursor: wait; }
.btn-submit__text { position: relative; z-index: 2; }
.btn-submit__arrow { position: relative; z-index: 2; transition: transform 0.2s; }
.btn-submit:hover:not(:disabled) .btn-submit__arrow { transform: translateX(3px); }
.btn-submit__pulse { position: absolute; inset: 0; background: linear-gradient(90deg, transparent 0%, var(--lime) 50%, transparent 100%); transform: translateX(-100%); opacity: 0; }
.btn-submit.is-pending .btn-submit__pulse { opacity: 0.7; animation: pulse-sweep 1.2s linear infinite; }
.btn-submit.is-pending .btn-submit__text::after { content: '...'; animation: dots 1s steps(3, end) infinite; }
@keyframes pulse-sweep { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes dots { 0%,20% { content: ''; } 40% { content: '.'; } 60% { content: '..'; } 80%,100% { content: '...'; } }

/* ───────────────────────────────────────────────────────────
   10. LINKS
   ─────────────────────────────────────────────────────────── */
.link { color: var(--cyan-text); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.link:hover { border-bottom-color: var(--cyan); }
.link--muted { color: var(--fg); border-bottom-color: rgba(255,255,255,0.2); }

/* ───────────────────────────────────────────────────────────
   11. LEGAL FOOTER
   ─────────────────────────────────────────────────────────── */
.legal {
  position: relative; z-index: 2;
  display: flex; justify-content: center; align-items: center; gap: 12px;
  padding: 18px 16px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 400; letter-spacing: 0.15em;
  color: var(--fg-faint); text-transform: uppercase;
}
.legal__sep { opacity: 0.5; }

/* ───────────────────────────────────────────────────────────
   12. MOTION PREFERENCES
   ─────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .aurora__layer,
  .status-pill__dot,
  .btn-submit.is-pending .btn-submit__pulse,
  .card,
  .powered-card { animation: none !important; }
  * { transition-duration: 0.01ms !important; }
}

/* ═══════════════════════════════════════════════════════════
   PHASE 2.2 — DASHBOARD APP SHELL
   ═══════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────
   13. APP SHELL LAYOUT
   Three-row stack: header / nav / content.
   ─────────────────────────────────────────────────────────── */
.app-shell {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  max-width: 1400px; margin: 0 auto;
  padding: 0 24px;
}

.app-shell__header {
  display: flex; align-items: center; gap: 24px;
  padding: 18px 0;
}

.app-shell__brand { flex-shrink: 0; }

.app-shell__center {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  gap: 24px;
}

.app-shell__user { flex-shrink: 0; }

.app-shell__nav {
  position: sticky; top: 0; z-index: 10;
  margin: 0 -24px; padding: 0 24px;
  background: rgba(5, 7, 13, 0.6);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
}

.app-shell__main {
  flex: 1;
  padding: 32px 0 48px;
}

/* ───────────────────────────────────────────────────────────
   14. TRADER STATUS DOTS (header-center)
   3 dots: BSC, Solana, Copy. Each labelled, color-coded.
   States: off (gray), running (lime), error (crimson).
   ─────────────────────────────────────────────────────────── */
.trader-dots {
  display: flex; align-items: center; gap: 18px;
  list-style: none; margin: 0; padding: 0;
}

.trader-dot {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500; letter-spacing: 0.16em;
  color: var(--fg-dim); text-transform: uppercase;
}

.trader-dot__indicator {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--fg-faint);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.04);
  transition: all 0.3s;
}

.trader-dot[data-status="running"] .trader-dot__indicator {
  background: var(--lime);
  box-shadow: 0 0 12px var(--lime-glow), 0 0 0 2px rgba(132, 255, 0, 0.15);
  animation: pulse-dot 2s ease-in-out infinite;
}
.trader-dot[data-status="error"] .trader-dot__indicator {
  background: var(--crimson);
  box-shadow: 0 0 12px rgba(255, 48, 96, 0.45), 0 0 0 2px var(--crimson-soft);
}
.trader-dot[data-status="running"] .trader-dot__label { color: var(--fg); }

/* ───────────────────────────────────────────────────────────
   15. USER MENU
   Avatar/initial + dropdown trigger. Phase 2 = static, no dropdown logic yet.
   ─────────────────────────────────────────────────────────── */
.user-menu {
  display: flex; align-items: center; gap: 12px;
}
.user-menu__name {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500; letter-spacing: 0.16em;
  color: var(--fg-dim); text-transform: uppercase;
}
.user-menu__avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan) 0%, #1aa1ff 100%);
  display: flex; align-items: center; justify-content: center;
  color: #000814; font-weight: 700; font-size: 14px;
  box-shadow: 0 4px 12px -2px var(--cyan-glow);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.user-menu__logout {
  background: none; border: 1px solid var(--glass-border);
  color: var(--fg-dim);
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.user-menu__logout:hover {
  border-color: var(--crimson); color: var(--crimson);
  background: var(--crimson-soft);
}

/* ───────────────────────────────────────────────────────────
   16. TAB NAVIGATION (horizontal scrollable)
   ─────────────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 4px;
  list-style: none; margin: 0; padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 14px 18px;
  background: none; border: none;
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 500; letter-spacing: 0.14em;
  color: var(--fg-dim); text-transform: uppercase;
  cursor: pointer; white-space: nowrap;
  transition: color 0.2s;
}
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { color: var(--cyan-text); }
.tab[aria-selected="true"]::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 18px; right: 18px;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow);
  border-radius: 2px 2px 0 0;
}

.tab__icon {
  width: 14px; height: 14px;
  flex-shrink: 0;
}

/* ───────────────────────────────────────────────────────────
   17. TAB PANELS (content area)
   Hidden via [hidden] HTML attr. Active panel fades in.
   ─────────────────────────────────────────────────────────── */
.tab-panel {
  animation: panel-enter 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tab-panel[hidden] { display: none; }
@keyframes panel-enter {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ───────────────────────────────────────────────────────────
   18. PLACEHOLDER CARD (Phase X coming-soon stub)
   ─────────────────────────────────────────────────────────── */
.placeholder {
  position: relative;
  border-radius: var(--radius);
  background: var(--glass-bg-soft);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-border);
  padding: 64px 48px;
  text-align: center;
  box-shadow: 0 15px 45px -15px rgba(0, 0, 0, 0.5);
}
.placeholder::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 30%);
  pointer-events: none;
}
.placeholder__phase {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--cyan-soft);
  border: 1px solid var(--glass-border);
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500; letter-spacing: 0.22em;
  color: var(--cyan-text); text-transform: uppercase;
  margin-bottom: 20px;
}
.placeholder__title {
  margin: 0 0 12px;
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.placeholder__text {
  margin: 0 auto;
  max-width: 480px;
  font-size: 14px; line-height: 1.6;
  color: var(--fg-dim);
}
.placeholder__icon {
  display: block;
  width: 64px; height: 64px;
  margin: 0 auto 24px;
  color: var(--cyan);
  opacity: 0.5;
}

/* ───────────────────────────────────────────────────────────
   19. APP SHELL — RESPONSIVE
   Phase 2.3 will refine mobile (hamburger, bottom-tabs).
   For now: ensure nothing breaks below 768px.
   ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .app-shell { padding: 0 16px; }
  .app-shell__header { gap: 12px; flex-wrap: wrap; }
  .app-shell__center { gap: 14px; order: 3; flex-basis: 100%; justify-content: flex-start; }
  .trader-dots { gap: 14px; }
  .user-menu__name { display: none; }
  .placeholder { padding: 48px 24px; }
  .placeholder__title { font-size: 22px; }
}
@media (max-width: 480px) {
  .app-shell { padding: 0 12px; }
  .tab { padding: 12px 14px; font-size: 11px; }
  .placeholder { padding: 36px 18px; }
}

/* ═══════════════════════════════════════════════════════════
   PHASE 2.2.1 — MOBILE QUICK-FIX
   ═══════════════════════════════════════════════════════════ */

/* Avatar must never grow/shrink — was rendering huge on mobile */
.user-menu__avatar {
  flex-shrink: 0;
  flex-grow: 0;
  min-width: 36px;
  min-height: 36px;
}

/* Logout button: keep compact on mobile */
.user-menu__logout {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Footer: allow wrapping cleanly, hide separators when wrapped */
.legal {
  flex-wrap: wrap;
  text-align: center;
  line-height: 1.6;
}

/* Tab-bar: visual hint that there's more to scroll (right-edge fade) */
.app-shell__nav { position: relative; }
.app-shell__nav::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 32px;
  background: linear-gradient(90deg, transparent, rgba(5, 7, 13, 0.85));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
@media (max-width: 900px) {
  .app-shell__nav::after { opacity: 1; }
}

/* Mobile header polish */
@media (max-width: 900px) {
  .app-shell__header {
    align-items: center;
    gap: 10px;
  }
  .app-shell__center {
    order: 3;
    flex-basis: 100%;
    justify-content: center;
    padding: 8px 0 4px;
    border-top: 1px solid var(--glass-border);
  }
  .user-menu { gap: 8px; }
  .user-menu__avatar {
    width: 32px; height: 32px;
    min-width: 32px; min-height: 32px;
    font-size: 13px;
  }
  .user-menu__logout {
    padding: 6px 10px;
    font-size: 9px;
    letter-spacing: 0.14em;
  }
  /* Brand: shrink slightly on mobile so avatar+logout fit */
  .brand-mark { font-size: 11px; }
  .brand-mark__icon { font-size: 18px; }
  /* Footer compact */
  .legal {
    gap: 8px;
    font-size: 9px;
    padding: 14px 12px;
  }
}

@media (max-width: 480px) {
  .app-shell__header { padding: 14px 0 10px; }
  .app-shell__center { gap: 16px; }
  .trader-dot { font-size: 10px; gap: 6px; }
  .brand-mark__text {
    /* Hide separator dot on tiny screens */
    font-size: 10px;
  }
}

/* ═══════════════════════════════════════════════════════════
   PHASE 2.3 — MOBILE NAVIGATION
   Hamburger drawer (slide-down), bottom tabs, more-sheet.
   ═══════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────
   20. HAMBURGER BUTTON (mobile only, hidden on desktop)
   ─────────────────────────────────────────────────────────── */
.hamburger {
  display: none;
  width: 44px; height: 44px;
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s;
  flex-shrink: 0;
}
.hamburger:hover { border-color: var(--cyan); color: var(--cyan); }
.hamburger:active { transform: scale(0.95); }
.hamburger svg { width: 22px; height: 22px; }

/* Tap-animation for user avatar (mobile-first design) */
.user-menu__avatar {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}
.user-menu__avatar:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px -1px var(--cyan-glow);
}

/* ───────────────────────────────────────────────────────────
   21. SLIDE-DOWN DRAWER
   Slides in from top of viewport, contains full nav + actions.
   Sits above everything except possibly a higher modal.
   ─────────────────────────────────────────────────────────── */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(5, 7, 13, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 99;
}
.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0; left: 0; right: 0;
  max-height: 80vh;
  overflow-y: auto;
  background: rgba(10, 16, 28, 0.96);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.7);
  transform: translateY(-100%);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 100;
  padding-top: env(safe-area-inset-top, 0);
}
.drawer.is-open { transform: translateY(0); }

.drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--glass-border);
}
.drawer__title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500; letter-spacing: 0.22em;
  color: var(--cyan-text); text-transform: uppercase;
}
.drawer__close {
  width: 36px; height: 36px;
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--fg-dim);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.drawer__close:hover { color: var(--crimson); border-color: var(--crimson); }
.drawer__close svg { width: 18px; height: 18px; }

.drawer__list {
  list-style: none; margin: 0; padding: 8px 0;
}
.drawer__item {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 16px 22px;
  background: none;
  border: none;
  color: var(--fg-dim);
  font-family: var(--font-display);
  font-size: 16px; font-weight: 600;
  text-align: left;
  cursor: pointer;
  min-height: 56px;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.drawer__item:hover,
.drawer__item:focus-visible { background: var(--cyan-soft); color: var(--fg); }
.drawer__item[aria-current="true"] {
  color: var(--cyan-text);
  background: var(--cyan-soft);
}
.drawer__item[aria-current="true"]::before {
  content: '';
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow);
  border-radius: 0 2px 2px 0;
}

.drawer__divider {
  height: 1px;
  margin: 8px 22px;
  background: var(--glass-border);
}

.drawer__action {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 16px 22px;
  background: none;
  border: none;
  color: var(--crimson);
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  min-height: 56px;
}
.drawer__action:hover { background: var(--crimson-soft); }
.drawer__action svg { width: 18px; height: 18px; }

/* ───────────────────────────────────────────────────────────
   22. BOTTOM TAB BAR (fixed, ≤480px only)
   Contains 5 tabs: BSC, SOL, Copy, Total, More.
   ─────────────────────────────────────────────────────────── */
.bottom-tabs {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(8, 12, 22, 0.92);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-top: 1px solid var(--glass-border);
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -8px 24px -8px rgba(0, 0, 0, 0.5);
}
.bottom-tabs__list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  list-style: none; margin: 0; padding: 0;
}
.bottom-tabs__item {
  /* Block-level button; text-align centers inline-flex content row.   */
  /* This pattern is the most rock-solid way to perfectly center icon+ */
  /* label across all browsers, including any SVG sub-pixel quirks.    */
  display: block;
  width: 100%;
  padding: 8px 4px;
  background: none;
  border: none;
  color: var(--fg-faint);
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  min-height: 56px;
  transition: color 0.2s;
  position: relative;
}
.bottom-tabs__item > svg,
.bottom-tabs__item > span:not(.bottom-tabs__indicator) {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.bottom-tabs__item > svg + span {
  margin-top: 4px;
}
.bottom-tabs__item:hover { color: var(--fg-dim); }
.bottom-tabs__item[aria-current="true"] {
  color: var(--cyan-text);
}
.bottom-tabs__item[aria-current="true"]::after {
  content: '';
  position: absolute;
  top: 0; left: 25%; right: 25%;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow);
  border-radius: 0 0 2px 2px;
}
.bottom-tabs__icon {
  width: 22px; height: 22px;
  flex-shrink: 0;
}

/* ───────────────────────────────────────────────────────────
   23. MORE-SHEET (slides up from bottom, ≤480px only)
   Triggered by the "More" bottom-tab — shows leftover tabs.
   ─────────────────────────────────────────────────────────── */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(5, 7, 13, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 60;
}
.sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(10, 16, 28, 0.96);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-top: 1px solid var(--glass-border);
  border-radius: 18px 18px 0 0;
  max-height: 70vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 70;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -25px 60px -10px rgba(0, 0, 0, 0.7);
}
.sheet.is-open { transform: translateY(0); }

.sheet__handle {
  width: 40px; height: 4px;
  margin: 10px auto 8px;
  background: var(--fg-faint);
  border-radius: 2px;
  opacity: 0.6;
}
.sheet__head {
  padding: 6px 22px 14px;
  border-bottom: 1px solid var(--glass-border);
}
.sheet__title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500; letter-spacing: 0.22em;
  color: var(--cyan-text); text-transform: uppercase;
}

/* Reuse drawer__list styling for sheet items via .sheet__list */
.sheet__list {
  list-style: none; margin: 0; padding: 8px 0;
}

/* ───────────────────────────────────────────────────────────
   24. BODY SCROLL LOCK (when drawer/sheet open)
   ─────────────────────────────────────────────────────────── */
body.is-scroll-locked {
  overflow: hidden;
  /* Prevent layout shift from scrollbar disappear on desktop */
  /* On mobile this is a no-op since there's no persistent scrollbar */
}

/* ───────────────────────────────────────────────────────────
   25. RESPONSIVE — show/hide elements per breakpoint
   ─────────────────────────────────────────────────────────── */

/* Tablet & small laptop (481-768px): hamburger active, top-tabs hidden */
@media (max-width: 900px) {
  .hamburger { display: flex; }
  .app-shell__nav { display: none; }
  /* Trader-dots and center-cluster disappear, hamburger takes that slot */
  .app-shell__center { display: none; }
  .app-shell__header {
    justify-content: space-between;
    flex-wrap: nowrap;
  }
  /* User-menu compresses to just avatar (no name, no logout button — both in drawer) */
  .user-menu__name { display: none; }
  .user-menu__logout { display: none; }
  .user-menu form { display: none; }
}

/* Phone (≤480px): bottom-tabs visible, content needs bottom-padding */
@media (max-width: 480px) {
  .bottom-tabs { display: block; }
  .app-shell__main {
    /* Reserve space for bottom-tabs */
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0));
  }
  /* Footer pushed up so it doesn't hide behind bottom-tabs */
  .legal {
    padding-bottom: calc(20px + 76px + env(safe-area-inset-bottom, 0));
  }
}

/* Desktop (>768px): hide all mobile-only elements */
@media (min-width: 901px) {
  .hamburger { display: none !important; }
  .drawer, .drawer-backdrop,
  .bottom-tabs, .sheet, .sheet-backdrop { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════
   PHASE 2.4 — LIGHT THEME TOKENS
   Activated by <html data-theme="light"> set via inline JS
   in the page <head>. Cyan accent stays unchanged.
   ═══════════════════════════════════════════════════════════ */
[data-theme="light"] {
  /* Surface */
  --bg: #f0f4fa;
  --fg: #0a1422;
  --fg-dim: #4a5468;
  --fg-faint: #5a6478;          /* darker for AA contrast on light bg */

  /* Cyan: brand accent UNCHANGED, but text-cyan gets a darker variant
     so labels/borders stay readable on light surfaces. */
  --cyan-text: #0070a0;          /* ~5.1:1 on --bg, AA compliant */
  --cyan-glow: rgba(0, 168, 204, 0.30);
  --cyan-soft: rgba(0, 168, 204, 0.16);

  /* Glass primitives — light frosted */
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-bg-soft: rgba(255, 255, 255, 0.45);
  --glass-border: rgba(0, 168, 204, 0.18);
  --glass-highlight: rgba(255, 255, 255, 0.9);

  /* Form inputs */
  --input-bg: rgba(255, 255, 255, 0.85);
  --input-border: rgba(10, 20, 34, 0.12);
}

/* Smooth transition when toggling */
html { transition: background-color 0.3s, color 0.3s; }

/* ───────────────────────────────────────────────────────────
   Light-mode component-level adjustments
   (Anywhere we hardcoded white/black colors in the dark theme.)
   ─────────────────────────────────────────────────────────── */

/* Submit button: in light mode, use a slightly lighter cyan gradient
   with darker text retained for legibility (cyan-on-white = bad contrast). */
[data-theme="light"] .btn-submit {
  background: linear-gradient(180deg, #00d4ff 0%, #0098bc 100%);
  color: #00141f;
  box-shadow: 0 8px 24px -8px var(--cyan-glow), 0 0 0 1px rgba(0,0,0,0.08) inset;
}
[data-theme="light"] .btn-submit:hover:not(:disabled) {
  box-shadow: 0 12px 32px -8px var(--cyan-glow), 0 0 0 1px rgba(0,0,0,0.12) inset;
}

/* Glass card insets need adjusting (white highlight makes no sense on white) */
[data-theme="light"] .card::before {
  background: linear-gradient(180deg, rgba(255,255,255,0.6) 0%, transparent 30%);
}
[data-theme="light"] .placeholder::before {
  background: linear-gradient(180deg, rgba(255,255,255,0.5) 0%, transparent 30%);
}

/* Aurora: turn down opacity & shift blend for light bg */
[data-theme="light"] .aurora__layer { opacity: 0.25; }
[data-theme="light"] .aurora__layer--2 { opacity: 0.18; }
[data-theme="light"] .aurora__layer--3 { opacity: 0.10; }
[data-theme="light"] .aurora__noise { opacity: 0.08; mix-blend-mode: multiply; }
[data-theme="light"] .aurora__vignette {
  background: radial-gradient(ellipse at center, transparent 30%, rgba(240,244,250,0.7) 100%),
              linear-gradient(180deg, rgba(240,244,250,0.3) 0%, transparent 25%, transparent 75%, rgba(240,244,250,0.5) 100%);
}

/* App-shell nav — softer stickiness on light */
[data-theme="light"] .app-shell__nav {
  background: rgba(240, 244, 250, 0.8);
}

/* Drawer & sheet on light: brighter base */
[data-theme="light"] .drawer,
[data-theme="light"] .sheet {
  background: rgba(248, 251, 255, 0.96);
}
[data-theme="light"] .drawer-backdrop,
[data-theme="light"] .sheet-backdrop {
  background: rgba(10, 20, 34, 0.4);
}

/* Bottom-tabs: lighter base */
[data-theme="light"] .bottom-tabs {
  background: rgba(248, 251, 255, 0.92);
}

/* Avatar in light mode: keep cyan but adjust border for contrast */
[data-theme="light"] .user-menu__avatar {
  border: 1px solid rgba(0, 0, 0, 0.06);
}

/* Hamburger / drawer-close: softer borders on light */
[data-theme="light"] .hamburger,
[data-theme="light"] .drawer__close,
[data-theme="light"] .user-menu__logout {
  border-color: rgba(10, 20, 34, 0.12);
}

/* Status-pill: keep readable on light */
[data-theme="light"] .status-pill {
  background: rgba(255, 255, 255, 0.7);
}

/* Alert: darker text in light mode for legibility */
[data-theme="light"] .alert--error {
  background: rgba(255, 48, 96, 0.08);
  color: #b8002d;
}
[data-theme="light"] .alert__msg { color: #8c0021; }

/* ───────────────────────────────────────────────────────────
   THEME TOGGLE BUTTON
   Two icons stacked, swap visibility per theme.
   ─────────────────────────────────────────────────────────── */
.theme-toggle {
  width: 36px; height: 36px;
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--fg-dim);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  position: relative;
}
.theme-toggle:hover { color: var(--cyan); border-color: var(--cyan); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle svg {
  width: 18px; height: 18px;
  position: absolute;
  inset: 0;
  margin: auto;
  transition: opacity 0.25s, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.theme-toggle__moon { opacity: 1; transform: rotate(0); }
.theme-toggle__sun  { opacity: 0; transform: rotate(-90deg); }
[data-theme="light"] .theme-toggle__moon { opacity: 0; transform: rotate(90deg); }
[data-theme="light"] .theme-toggle__sun  { opacity: 1; transform: rotate(0); }

/* Drawer-internal theme toggle: full-width row */
.drawer__theme-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 16px 22px;
  background: none;
  border: none;
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  min-height: 56px;
}
.drawer__theme-toggle:hover { background: var(--cyan-soft); color: var(--fg); }
.drawer__theme-toggle__icon {
  position: relative;
  width: 20px; height: 20px;
  flex-shrink: 0;
}
.drawer__theme-toggle__icon svg {
  position: absolute;
  inset: 0;
  width: 20px; height: 20px;
  transition: opacity 0.25s, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.drawer__theme-toggle__icon .theme-toggle__moon { opacity: 1; transform: rotate(0); }
.drawer__theme-toggle__icon .theme-toggle__sun  { opacity: 0; transform: rotate(-90deg); }
[data-theme="light"] .drawer__theme-toggle__icon .theme-toggle__moon { opacity: 0; transform: rotate(90deg); }
[data-theme="light"] .drawer__theme-toggle__icon .theme-toggle__sun  { opacity: 1; transform: rotate(0); }

/* Hide the desktop toggle on mobile (hamburger has theme inside) */
@media (max-width: 900px) {
  .theme-toggle--desktop { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   PHASE 2.4.1 — LIGHT-MODE CONTRAST PASS
   Specific overrides where token-changes alone aren't enough.
   ═══════════════════════════════════════════════════════════ */

/* Footer: bumped contrast in light mode */
[data-theme="light"] .legal {
  color: #3d4756;
}

/* "PHASE X" pill: also stronger background in light mode for AA */
[data-theme="light"] .placeholder__phase {
  background: rgba(0, 168, 204, 0.16);
  border-color: rgba(0, 168, 204, 0.25);
}

/* status-pill (login): readable text on light glass */
[data-theme="light"] .status-pill {
  color: #3d4756;
}

/* Trader-dot label running-state: cyan-text variant */
[data-theme="light"] .trader-dot[data-status="running"] .trader-dot__label {
  color: var(--cyan-text);
}

/* Hamburger / theme-toggle: better hover-cyan that's actually visible */
[data-theme="light"] .hamburger:hover,
[data-theme="light"] .theme-toggle:hover {
  color: var(--cyan-text);
  border-color: var(--cyan-text);
}

/* Field icon focus: --cyan was unreadable on light bg in some cases */
[data-theme="light"] .field__wrap:focus-within .field__icon {
  color: var(--cyan-text);
}

/* ═══════════════════════════════════════════════════════════
   PHASE 2.5.1 — MOBILE STATUS INDICATORS
   Mini-dots on bottom-tabs + full status list in drawer.
   ═══════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────
   Bottom-tab mini-indicator (top-right corner of trader tabs)
   ─────────────────────────────────────────────────────────── */
.bottom-tabs__item {
  position: relative;
}
.bottom-tabs__indicator {
  position: absolute;
  top: 6px;
  right: 50%;
  transform: translateX(20px);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: transparent;
  pointer-events: none;
  transition: background 0.3s, box-shadow 0.3s;
}
.bottom-tabs__item[data-status="running"] .bottom-tabs__indicator {
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime-glow), 0 0 0 2px rgba(132, 255, 0, 0.15);
  animation: pulse-dot 2s ease-in-out infinite;
}
.bottom-tabs__item[data-status="error"] .bottom-tabs__indicator {
  background: var(--crimson);
  box-shadow: 0 0 8px rgba(255, 48, 96, 0.5), 0 0 0 2px var(--crimson-soft);
}

/* ───────────────────────────────────────────────────────────
   Drawer status block (between title and tab list)
   ─────────────────────────────────────────────────────────── */
.drawer__status {
  padding: 14px 22px 16px;
  border-bottom: 1px solid var(--glass-border);
}
.drawer__status-title {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 500; letter-spacing: 0.22em;
  color: var(--fg-faint); text-transform: uppercase;
}
.drawer__status-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.drawer__status-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.drawer__status-name {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600;
  color: var(--fg);
}
.drawer__status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(74, 81, 99, 0.18);
  border: 1px solid rgba(74, 81, 99, 0.3);
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 600; letter-spacing: 0.18em;
  color: var(--fg-faint);
  text-transform: uppercase;
  transition: all 0.3s;
}
.drawer__status-pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--fg-faint);
  transition: background 0.3s, box-shadow 0.3s;
}
[data-status="running"] .drawer__status-pill {
  background: rgba(132, 255, 0, 0.1);
  border-color: rgba(132, 255, 0, 0.3);
  color: var(--lime);
}
[data-theme="light"] [data-status="running"] .drawer__status-pill {
  /* lime is too bright on light bg — darker green-text variant */
  color: #2d8800;
  background: rgba(45, 136, 0, 0.12);
  border-color: rgba(45, 136, 0, 0.3);
}
[data-status="running"] .drawer__status-pill::before {
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime-glow);
  animation: pulse-dot 2s ease-in-out infinite;
}
[data-status="error"] .drawer__status-pill {
  background: var(--crimson-soft);
  border-color: rgba(255, 48, 96, 0.35);
  color: var(--crimson);
}
[data-theme="light"] [data-status="error"] .drawer__status-pill {
  color: #b8002d;
  background: rgba(184, 0, 45, 0.1);
  border-color: rgba(184, 0, 45, 0.3);
}
[data-status="error"] .drawer__status-pill::before {
  background: var(--crimson);
  box-shadow: 0 0 8px rgba(255, 48, 96, 0.5);
}

/* ═══════════════════════════════════════════════════════════
   PHASE 2.5.2 — STATUS-PILL SPECIFICITY HARDENING
   Earlier rules used loose [data-status="..."] descendant selectors
   which lost cascade fights. These bind the state to .drawer__status-row
   directly and use higher specificity to win regardless of cascade.
   ═══════════════════════════════════════════════════════════ */

/* Drawer status row — running */
.drawer__status-row[data-status="running"] .drawer__status-pill {
  background: rgba(132, 255, 0, 0.1);
  border-color: rgba(132, 255, 0, 0.35);
  color: var(--lime);
}
.drawer__status-row[data-status="running"] .drawer__status-pill::before {
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime-glow);
  animation: pulse-dot 2s ease-in-out infinite;
}
[data-theme="light"] .drawer__status-row[data-status="running"] .drawer__status-pill {
  color: #2d8800;
  background: rgba(45, 136, 0, 0.12);
  border-color: rgba(45, 136, 0, 0.35);
}

/* Drawer status row — error */
.drawer__status-row[data-status="error"] .drawer__status-pill {
  background: var(--crimson-soft);
  border-color: rgba(255, 48, 96, 0.4);
  color: var(--crimson);
}
.drawer__status-row[data-status="error"] .drawer__status-pill::before {
  background: var(--crimson);
  box-shadow: 0 0 8px rgba(255, 48, 96, 0.5);
  animation: none;
}
[data-theme="light"] .drawer__status-row[data-status="error"] .drawer__status-pill {
  color: #b8002d;
  background: rgba(184, 0, 45, 0.1);
  border-color: rgba(184, 0, 45, 0.35);
}

/* Bottom-tab indicator — recheck binding to data-status, in case absolute pos got lost */
.bottom-tabs__item .bottom-tabs__indicator {
  position: absolute;
  top: 6px;
  right: 50%;
  transform: translateX(20px);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: transparent;
  pointer-events: none;
  display: block !important;  /* override any 2.3.3 layout rule */
  margin: 0 !important;
  transition: background 0.3s, box-shadow 0.3s;
}
.bottom-tabs__item[data-status="running"] .bottom-tabs__indicator {
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime-glow), 0 0 0 2px rgba(132, 255, 0, 0.15);
  animation: pulse-dot 2s ease-in-out infinite;
}
.bottom-tabs__item[data-status="error"] .bottom-tabs__indicator {
  background: var(--crimson);
  box-shadow: 0 0 8px rgba(255, 48, 96, 0.5), 0 0 0 2px var(--crimson-soft);
}

/* ═══════════════════════════════════════════════════════════
   PHASE 2.6 — SETTINGS UI
   Sub-tabs, password form, toast snackbar.
   ═══════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────
   26. SUB-TABS (pill-row inside a tab panel)
   ─────────────────────────────────────────────────────────── */
.subtabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  list-style: none; margin: 0 0 24px; padding: 0;
}
.subtab {
  padding: 8px 16px;
  background: var(--glass-bg-soft);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.subtab:hover { color: var(--fg); border-color: var(--cyan-text); }
.subtab[aria-selected="true"] {
  background: var(--cyan-soft);
  border-color: var(--cyan-text);
  color: var(--cyan-text);
}

.subpanel { animation: panel-enter 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.subpanel[hidden] { display: none; }

/* ───────────────────────────────────────────────────────────
   27. SETTINGS FORM
   Card-bound, reuses .field/.btn-submit primitives from base.
   ─────────────────────────────────────────────────────────── */
.settings-card {
  position: relative;
  border-radius: var(--radius);
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-border);
  padding: 32px;
  box-shadow: 0 25px 80px -20px rgba(0,0,0,0.6), 0 0 0 1px var(--glass-highlight) inset;
  margin-bottom: 24px;
}
.settings-card::before {
  content: ''; position: absolute; inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 30%);
  pointer-events: none;
}
[data-theme="light"] .settings-card::before {
  background: linear-gradient(180deg, rgba(255,255,255,0.5) 0%, transparent 30%);
}

.settings-card__head {
  position: relative;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--glass-border);
}
.settings-card__title {
  margin: 0 0 6px;
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.settings-card__subtitle {
  margin: 0;
  font-size: 13px; color: var(--fg-dim);
  line-height: 1.5;
}

.settings-form { position: relative; max-width: 480px; }

/* Password requirements helper text */
.pw-hint {
  margin: -8px 0 18px;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.1em;
  color: var(--fg-faint);
}

/* User info block (read-only key/value list) */
.info-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.info-list__row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px; flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px dashed var(--glass-border);
}
.info-list__row:last-child { border-bottom: none; }
.info-list__key {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500; letter-spacing: 0.16em;
  color: var(--fg-dim); text-transform: uppercase;
}
.info-list__val {
  font-family: var(--font-mono);
  font-size: 13px; color: var(--fg);
  word-break: break-all;
}

/* ───────────────────────────────────────────────────────────
   28. TOAST SNACKBAR (top-right, slide-in)
   ─────────────────────────────────────────────────────────── */
.toast-host {
  position: fixed;
  top: 16px; right: 16px;
  z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
  padding-top: env(safe-area-inset-top, 0);
}
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 12px;
  min-width: 280px; max-width: 380px;
  padding: 14px 18px;
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 15px 45px -10px rgba(0,0,0,0.5);
  font-size: 13px; line-height: 1.4;
  color: var(--fg);
  animation: toast-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.toast.is-leaving { animation: toast-out 0.25s ease-in both; }
@keyframes toast-in {
  0% { opacity: 0; transform: translateX(20px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  0% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(20px); }
}
.toast--success { border-color: rgba(132, 255, 0, 0.35); }
.toast--success .toast__icon { color: var(--lime); }
.toast--error { border-color: rgba(255, 48, 96, 0.35); }
.toast--error .toast__icon { color: var(--crimson); }
.toast__icon { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; }
.toast__body { flex: 1; }
.toast__title { font-weight: 600; margin: 0 0 2px; color: var(--fg); }
.toast__msg { margin: 0; color: var(--fg-dim); font-size: 12px; }
.toast__close {
  flex-shrink: 0;
  width: 24px; height: 24px;
  background: none; border: none; padding: 0;
  color: var(--fg-faint); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s;
}
.toast__close:hover { color: var(--fg); }

@media (max-width: 480px) {
  .toast-host { left: 12px; right: 12px; top: 12px; }
  .toast { min-width: 0; max-width: 100%; }
}

/* Settings-card responsive */
@media (max-width: 768px) {
  .settings-card { padding: 22px 18px; }
  .settings-card__title { font-size: 18px; }
}

/* ═══════════════════════════════════════════════════════════
   PHASE 2.6.1 — SUCCESS ALERT (login info-banner)
   ═══════════════════════════════════════════════════════════ */
.alert--success {
  background: rgba(132, 255, 0, 0.10);
  border: 1px solid rgba(132, 255, 0, 0.35);
  color: #c5ff85;
}
.alert--success .alert__icon { color: var(--lime); }
.alert--success .alert__msg { color: #d8ffa6; }

[data-theme="light"] .alert--success {
  background: rgba(45, 136, 0, 0.10);
  border-color: rgba(45, 136, 0, 0.35);
  color: #2d8800;
}
[data-theme="light"] .alert--success .alert__icon { color: #2d8800; }
[data-theme="light"] .alert--success .alert__msg { color: #1f6000; }
