/* ══════════════════════════════════════════════════════════════════════════
   Stratalyx Mobile — Build 201
   Premium dark fintech design system.
   Coinbase 4-level surface elevation · Inter + JetBrains Mono typography
   Scoped entirely to #mobileShell — zero impact on desktop or portal.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Design tokens (mobile-specific overrides inside shell) ─────────────── */
#mobileShell {
  --m-base:      #0A0B0D;
  --m-card:      #131518;
  --m-elevated:  #1C1F26;
  --m-hover:     #252830;
  --m-border:    rgba(255,255,255,0.07);
  --m-border2:   rgba(255,255,255,0.12);

  --m-acc:       #3B82F6;
  --m-acc-dim:   rgba(59,130,246,0.15);
  --m-acc-glow:  rgba(59,130,246,0.25);

  --m-grn:       #27AD75;
  --m-grn-dim:   rgba(39,173,117,0.14);
  --m-red:       #F0616D;
  --m-red-dim:   rgba(240,97,109,0.14);
  --m-ylw:       #F59E0B;
  --m-ylw-dim:   rgba(245,158,11,0.14);
  --m-purp:      #A78BFA;

  --m-txt:       #F1F5F9;
  --m-txt2:      #94A3B8;
  --m-txt3:      #475569;

  --m-mono:      'JetBrains Mono', ui-monospace, monospace;
  --m-sans:      'Inter', system-ui, -apple-system, sans-serif;

  --m-r-sm:      10px;
  --m-r-md:      14px;
  --m-r-lg:      18px;
  --m-r-xl:      22px;
}

/* ── Global reset ───────────────────────────────────────────────────────── */
#mobileShell *, #mobileShell *::before, #mobileShell *::after {
  box-sizing: border-box;
  margin: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ── Root shell ─────────────────────────────────────────────────────────── */
#mobileShell {
  display: none;
  flex-direction: column;
  height: 100dvh;
  width: 100%;
  position: fixed;
  inset: 0;
  background: var(--m-base);
  color: var(--m-txt);
  font-family: var(--m-sans);
  font-size: 15px;
  overflow: hidden;
  z-index: 500;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
#mobileShell.active { display: flex; }

/* ── Suppress desktop floaters ──────────────────────────────────────────── */
body:has(#mobileShell.active) #chatBubble,
body:has(#mobileShell.active) #chatPanel { display: none !important; }

/* ══════════════════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════════════════ */
.m-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  flex-shrink: 0;
  background: var(--m-base);
  border-bottom: 1px solid var(--m-border);
  position: relative;
  z-index: 10;
}
.m-header-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--m-sans);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
  color: var(--m-txt);
}
.m-header-logo img {
  width: 30px;
  height: 30px;
  display: block;
  border-radius: 9px;
  flex-shrink: 0;
}
.m-header-logo-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.m-header-right { display: flex; align-items: center; gap: 4px; }

.m-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--m-txt2);
  padding: 10px;
  border-radius: var(--m-r-sm);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  min-width: 44px; min-height: 44px;
  transition: color .15s, background .15s;
}
.m-icon-btn:active { background: var(--m-hover); color: var(--m-txt); }

.m-notif-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--m-red);
  border: 2px solid var(--m-base);
}

.m-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a5f, var(--m-acc));
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: 1.5px solid var(--m-border2);
  flex-shrink: 0;
  transition: border-color .15s;
}
.m-avatar:active { border-color: var(--m-acc); }

/* ══════════════════════════════════════════════════════════════════════════
   SCROLLABLE CONTENT + PANELS
   ══════════════════════════════════════════════════════════════════════════ */
.m-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  position: relative;
  background: var(--m-base);
}
.m-panel {
  display: none;
  min-height: 100%;
  padding-bottom: 32px;
}
.m-panel.active { display: block; }

/* ══════════════════════════════════════════════════════════════════════════
   BOTTOM TAB BAR
   ══════════════════════════════════════════════════════════════════════════ */
.m-tabbar {
  display: flex;
  align-items: stretch;
  height: 64px;
  flex-shrink: 0;
  background: var(--m-card);
  border-top: 1px solid var(--m-border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.m-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--m-txt3);
  font-family: var(--m-sans);
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: color .2s;
  padding: 6px 2px;
  min-width: 0;
  position: relative;
}
.m-tab svg { transition: color .2s; }
.m-tab.active { color: var(--m-acc); }
.m-tab.active svg { filter: drop-shadow(0 0 6px var(--m-acc-glow)); }
.m-tab:active { color: var(--m-txt2); }
.m-tab-indicator {
  position: absolute;
  top: 0; left: 25%; right: 25%;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--m-acc);
  opacity: 0;
  transition: opacity .2s;
  box-shadow: 0 0 8px var(--m-acc-glow);
}
.m-tab.active .m-tab-indicator { opacity: 1; }

.m-tab-badge {
  position: absolute;
  top: 6px; right: calc(50% - 14px);
  min-width: 15px; height: 15px;
  border-radius: 8px;
  background: var(--m-red);
  color: #fff;
  font-size: .55rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--m-card);
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════════════════
   HOME — Hero value block + stat chips
   ══════════════════════════════════════════════════════════════════════════ */
.m-hero {
  padding: 28px 20px 20px;
  border-bottom: 1px solid var(--m-border);
}
.m-hero-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--m-txt3);
  margin-bottom: 8px;
}
.m-hero-value {
  font-family: var(--m-mono);
  font-size: 2.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--m-txt);
  margin-bottom: 10px;
}
.m-hero-value.grn { color: var(--m-grn); }
.m-hero-value.red { color: var(--m-red); }
.m-hero-delta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--m-mono);
  font-size: .82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 4px 10px;
  border-radius: 20px;
}
.m-hero-delta.grn { background: var(--m-grn-dim); color: var(--m-grn); }
.m-hero-delta.red { background: var(--m-red-dim); color: var(--m-red); }
.m-hero-delta.neu { background: var(--m-hover); color: var(--m-txt2); }

/* Stat chip row below hero */
.m-stat-row {
  display: flex;
  gap: 0;
  padding: 0 20px;
  border-bottom: 1px solid var(--m-border);
}
.m-stat-chip {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 6px;
  gap: 4px;
  cursor: default;
  border-right: 1px solid var(--m-border);
  transition: background .15s;
}
.m-stat-chip:last-child { border-right: none; }
.m-stat-chip.clickable { cursor: pointer; }
.m-stat-chip.clickable:active { background: var(--m-hover); }
.m-stat-label {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--m-txt3);
}
.m-stat-val {
  font-family: var(--m-mono);
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--m-txt);
  line-height: 1;
}
.m-stat-val.grn { color: var(--m-grn); }
.m-stat-val.red { color: var(--m-red); }
.m-stat-val.acc { color: var(--m-acc); }

/* ══════════════════════════════════════════════════════════════════════════
   SECTION HEADERS
   ══════════════════════════════════════════════════════════════════════════ */
.m-section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 20px 20px 10px;
}
.m-section-hd-title {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--m-txt3);
}
.m-section-hd-link {
  background: none; border: none; cursor: pointer;
  color: var(--m-acc);
  font-size: .75rem;
  font-weight: 600;
  font-family: var(--m-sans);
  padding: 4px 0;
  min-height: 44px;
  display: flex; align-items: center;
}

/* ══════════════════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════════════════ */
.m-card {
  background: var(--m-card);
  border: 1px solid var(--m-border);
  border-radius: var(--m-r-lg);
  margin: 0 16px 12px;
  overflow: hidden;
}

/* Row inside a card */
.m-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px;
  border-bottom: 1px solid var(--m-border);
  gap: 12px;
  min-height: 60px;
  transition: background .15s;
}
.m-row:last-child { border-bottom: none; }
.m-row.pressable { cursor: pointer; }
.m-row.pressable:active { background: var(--m-hover); }

.m-row-left  { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.m-row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }

/* Ticker / name */
.m-ticker {
  font-family: var(--m-mono);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--m-txt);
  white-space: nowrap;
}
.m-name {
  font-size: .73rem;
  color: var(--m-txt2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Score / price */
.m-score {
  font-family: var(--m-mono);
  font-size: .82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--m-acc);
}
.m-score.grn { color: var(--m-grn); }
.m-score.red { color: var(--m-red); }
.m-score.ylw { color: var(--m-ylw); }
.m-price {
  font-family: var(--m-mono);
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
  color: var(--m-txt3);
}

/* ══════════════════════════════════════════════════════════════════════════
   PILLS / BADGES
   ══════════════════════════════════════════════════════════════════════════ */
.m-pill {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.m-pill.grn  { background: var(--m-grn-dim);  color: var(--m-grn); }
.m-pill.red  { background: var(--m-red-dim);  color: var(--m-red); }
.m-pill.acc  { background: var(--m-acc-dim);  color: var(--m-acc); }
.m-pill.ylw  { background: var(--m-ylw-dim);  color: var(--m-ylw); }
.m-pill.muted { background: var(--m-hover);   color: var(--m-txt2); }
.m-pill.bull { background: var(--m-grn-dim);  color: var(--m-grn); }
.m-pill.bear { background: var(--m-red-dim);  color: var(--m-red); }

/* ══════════════════════════════════════════════════════════════════════════
   SCAN TABS  (horizontal scroll pill rail)
   ══════════════════════════════════════════════════════════════════════════ */
.m-pill-rail {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 16px 16px 0;
  gap: 7px;
  flex-shrink: 0;
}
.m-pill-rail::-webkit-scrollbar { display: none; }
.m-pill-rail-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--m-border2);
  background: transparent;
  color: var(--m-txt2);
  font-family: var(--m-sans);
  font-size: .73rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
  min-height: 36px;
}
.m-pill-rail-btn.active {
  background: var(--m-acc);
  color: #fff;
  border-color: var(--m-acc);
}
.m-pill-rail-btn:not(.active):active { background: var(--m-hover); color: var(--m-txt); }

/* ══════════════════════════════════════════════════════════════════════════
   JOURNAL  — big P&L hero + trade rows
   ══════════════════════════════════════════════════════════════════════════ */
.m-pnl-hero {
  padding: 24px 20px;
  border-bottom: 1px solid var(--m-border);
}
.m-pnl-label {
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--m-txt3);
  margin-bottom: 6px;
}
.m-pnl-val {
  font-family: var(--m-mono);
  font-size: 2.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 14px;
}
.m-pnl-val.grn { color: var(--m-grn); }
.m-pnl-val.red { color: var(--m-red); }
.m-pnl-val.neu { color: var(--m-txt); }
.m-pnl-stats {
  display: flex;
  gap: 0;
  border-radius: var(--m-r-md);
  background: var(--m-card);
  border: 1px solid var(--m-border);
  overflow: hidden;
}
.m-pnl-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  gap: 4px;
  border-right: 1px solid var(--m-border);
}
.m-pnl-stat:last-child { border-right: none; }
.m-pnl-stat-label {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--m-txt3);
}
.m-pnl-stat-val {
  font-family: var(--m-mono);
  font-size: .88rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--m-txt);
}
.m-pnl-stat-val.grn { color: var(--m-grn); }
.m-pnl-stat-val.red { color: var(--m-red); }
.m-pnl-stat-val.acc { color: var(--m-acc); }

/* Trade card */
.m-trade-card {
  background: var(--m-card);
  border: 1px solid var(--m-border);
  border-radius: var(--m-r-lg);
  margin: 0 16px 10px;
  padding: 16px;
  transition: background .15s;
}
.m-trade-card:active { background: var(--m-hover); }
.m-trade-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
}
.m-trade-ticker {
  font-family: var(--m-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--m-txt);
  letter-spacing: .02em;
}
.m-trade-sub {
  font-size: .72rem;
  color: var(--m-txt2);
  margin-top: 3px;
}
.m-trade-pnl {
  font-family: var(--m-mono);
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.m-trade-pnl.grn { color: var(--m-grn); }
.m-trade-pnl.red { color: var(--m-red); }
.m-trade-pnl.neu { color: var(--m-txt2); }
.m-trade-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
}
.m-trade-meta-item {
  font-size: .7rem;
  color: var(--m-txt3);
}
.m-trade-meta-item strong { color: var(--m-txt2); font-weight: 600; }

/* ══════════════════════════════════════════════════════════════════════════
   POSITIONS  — composite score card
   ══════════════════════════════════════════════════════════════════════════ */
.m-pos-card {
  background: var(--m-card);
  border: 1px solid var(--m-border);
  border-radius: var(--m-r-lg);
  margin: 0 16px 10px;
  padding: 16px;
  transition: background .15s;
}
.m-pos-card:active { background: var(--m-hover); }
.m-pos-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
}
.m-pos-ticker {
  font-family: var(--m-mono);
  font-size: .95rem;
  font-weight: 700;
  color: var(--m-txt);
}
.m-pos-score {
  font-family: var(--m-mono);
  font-size: .88rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.m-pos-score.hi  { color: var(--m-grn); }
.m-pos-score.md  { color: var(--m-ylw); }
.m-pos-score.lo  { color: var(--m-red); }
.m-pos-narrative {
  font-size: .76rem;
  color: var(--m-txt2);
  line-height: 1.55;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.m-pos-drivers {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}
.m-driver {
  font-size: .62rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--m-r-sm);
}
.m-driver.pos { background: var(--m-grn-dim); color: var(--m-grn); }
.m-driver.neg { background: var(--m-red-dim); color: var(--m-red); }

/* Alert row */
.m-alert-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--m-border);
  min-height: 56px;
}
.m-alert-row:last-child { border-bottom: none; }
.m-alert-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.m-alert-dot.high   { background: var(--m-red); box-shadow: 0 0 6px var(--m-red); }
.m-alert-dot.medium { background: var(--m-ylw); box-shadow: 0 0 6px var(--m-ylw); }
.m-alert-dot.low    { background: var(--m-grn); }
.m-alert-dot.info   { background: var(--m-acc); }
.m-alert-body { flex: 1; min-width: 0; }
.m-alert-ticker { font-size: .82rem; font-weight: 700; color: var(--m-txt); margin-bottom: 3px; font-family: var(--m-mono); }
.m-alert-msg    { font-size: .73rem; color: var(--m-txt2); line-height: 1.4; }
.m-alert-time   { font-size: .63rem; color: var(--m-txt3); flex-shrink: 0; white-space: nowrap; }

/* ══════════════════════════════════════════════════════════════════════════
   AI CHAT
   ══════════════════════════════════════════════════════════════════════════ */
.m-chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 56px - 64px);
}
.m-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}
.m-chat-bubble {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: .83rem;
  line-height: 1.55;
  word-wrap: break-word;
}
.m-chat-bubble.user {
  align-self: flex-end;
  background: var(--m-acc);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.m-chat-bubble.ai {
  align-self: flex-start;
  background: var(--m-card);
  border: 1px solid var(--m-border);
  color: var(--m-txt);
  border-bottom-left-radius: 4px;
}
.m-chat-bubble.thinking {
  color: var(--m-txt3);
  font-style: italic;
  font-size: .78rem;
}
.m-chat-quick-rail {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 10px 14px;
  gap: 7px;
  flex-shrink: 0;
  border-top: 1px solid var(--m-border);
  background: var(--m-base);
}
.m-chat-quick-rail::-webkit-scrollbar { display: none; }
.m-chat-quick-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--m-border2);
  background: var(--m-card);
  color: var(--m-txt2);
  font-family: var(--m-sans);
  font-size: .73rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
  min-height: 36px;
}
.m-chat-quick-btn:active { background: var(--m-elevated); color: var(--m-txt); }
.m-chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px;
  background: var(--m-card);
  border-top: 1px solid var(--m-border);
  flex-shrink: 0;
}
.m-chat-input {
  flex: 1;
  background: var(--m-elevated);
  border: 1px solid var(--m-border2);
  border-radius: 22px;
  padding: 11px 16px;
  color: var(--m-txt);
  font-family: var(--m-sans);
  font-size: .83rem;
  resize: none;
  line-height: 1.4;
  max-height: 120px;
  outline: none;
  transition: border-color .15s;
}
.m-chat-input::placeholder { color: var(--m-txt3); }
.m-chat-input:focus { border-color: var(--m-acc); }
.m-chat-send {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--m-acc);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
  transition: opacity .15s, transform .1s;
  box-shadow: 0 2px 12px var(--m-acc-glow);
}
.m-chat-send:active { transform: scale(.92); }
.m-chat-send:disabled { opacity: .35; box-shadow: none; }

/* ══════════════════════════════════════════════════════════════════════════
   MORE PANEL
   ══════════════════════════════════════════════════════════════════════════ */
.m-user-block {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--m-border);
}
.m-user-avatar-lg {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a5f, var(--m-acc));
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 2px solid var(--m-border2);
}
.m-user-name {
  font-size: .95rem;
  font-weight: 700;
  color: var(--m-txt);
  margin-bottom: 3px;
}
.m-user-meta { font-size: .72rem; color: var(--m-txt3); }
.m-user-meta strong { color: var(--m-acc); font-weight: 700; }

/* Feature list */
.m-feature-list { padding: 8px 0; }
.m-feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  min-height: 64px;
  cursor: pointer;
  transition: background .15s;
  border-bottom: 1px solid var(--m-border);
}
.m-feature-item:last-child { border-bottom: none; }
.m-feature-item:active { background: var(--m-card); }
.m-feature-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}
.m-feature-text { flex: 1; min-width: 0; }
.m-feature-label {
  font-size: .88rem;
  font-weight: 600;
  color: var(--m-txt);
}
.m-feature-sub {
  font-size: .72rem;
  color: var(--m-txt3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-chevron {
  color: var(--m-txt3);
  flex-shrink: 0;
}

.m-signout-row {
  padding: 16px 20px;
}
.m-signout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: var(--m-red-dim);
  color: var(--m-red);
  border: 1px solid rgba(240,97,109,.2);
  border-radius: var(--m-r-md);
  font-family: var(--m-sans);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  transition: background .15s;
}
.m-signout-btn:active { background: rgba(240,97,109,.25); }

/* ══════════════════════════════════════════════════════════════════════════
   SUB-SCREENS  (full-screen overlays for More features)
   ══════════════════════════════════════════════════════════════════════════ */
.m-subscreen {
  display: none;
  position: absolute;
  inset: 0;
  background: var(--m-base);
  z-index: 20;
  flex-direction: column;
  overflow: hidden;
}
.m-subscreen.active { display: flex; }
.m-subscreen-hd {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px 0 4px;
  height: 56px;
  flex-shrink: 0;
  background: var(--m-base);
  border-bottom: 1px solid var(--m-border);
}
.m-back-btn {
  background: none; border: none;
  cursor: pointer;
  color: var(--m-acc);
  display: flex; align-items: center; gap: 4px;
  font-family: var(--m-sans);
  font-size: .85rem;
  font-weight: 600;
  padding: 8px 12px;
  min-height: 44px; min-width: 44px;
}
.m-subscreen-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--m-txt);
  flex: 1;
}
.m-subscreen-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 28px;
}

/* ══════════════════════════════════════════════════════════════════════════
   PAPER TRADING sub-screen
   ══════════════════════════════════════════════════════════════════════════ */
.m-paper-kpi-row {
  display: flex;
  gap: 0;
  padding: 0 16px;
  margin: 20px 0 0;
}
.m-paper-kpi {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 6px;
  background: var(--m-card);
  border: 1px solid var(--m-border);
}
.m-paper-kpi:first-child { border-radius: var(--m-r-md) 0 0 var(--m-r-md); }
.m-paper-kpi:last-child  { border-radius: 0 var(--m-r-md) var(--m-r-md) 0; border-left: none; }
.m-paper-kpi:not(:first-child):not(:last-child) { border-left: none; }
.m-paper-kpi-label {
  font-size: .57rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--m-txt3);
}
.m-paper-kpi-val {
  font-family: var(--m-mono);
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--m-txt);
}
.m-paper-kpi-val.grn { color: var(--m-grn); }
.m-paper-kpi-val.red { color: var(--m-red); }

/* ══════════════════════════════════════════════════════════════════════════
   BROKERAGE SYNC sub-screen
   ══════════════════════════════════════════════════════════════════════════ */
.m-info-card {
  background: var(--m-card);
  border: 1px solid var(--m-border);
  border-radius: var(--m-r-lg);
  margin: 16px;
  padding: 20px;
}
.m-info-card-icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 12px;
}
.m-info-card-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--m-txt);
  margin-bottom: 6px;
}
.m-info-card-body {
  font-size: .77rem;
  color: var(--m-txt2);
  line-height: 1.55;
  margin-bottom: 16px;
}
.m-btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%;
  padding: 13px;
  background: var(--m-acc);
  color: #fff;
  border: none;
  border-radius: var(--m-r-sm);
  font-family: var(--m-sans);
  font-size: .83rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
  transition: opacity .15s;
  box-shadow: 0 2px 12px var(--m-acc-glow);
}
.m-btn-primary:active { opacity: .8; }
.m-btn-ghost {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--m-txt2);
  border: 1px solid var(--m-border2);
  border-radius: var(--m-r-sm);
  font-family: var(--m-sans);
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  margin-top: 8px;
  transition: background .15s;
}
.m-btn-ghost:active { background: var(--m-hover); }

/* ══════════════════════════════════════════════════════════════════════════
   WATCHLIST
   ══════════════════════════════════════════════════════════════════════════ */
.m-watch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--m-border);
  gap: 10px;
  min-height: 64px;
  transition: background .15s;
}
.m-watch-row:last-child { border-bottom: none; }
.m-watch-row:active { background: var(--m-hover); }
.m-watch-ticker { font-family: var(--m-mono); font-size: .9rem; font-weight: 600; color: var(--m-txt); }
.m-watch-name   { font-size: .7rem; color: var(--m-txt3); margin-top: 2px; }
.m-watch-price  { font-family: var(--m-mono); font-size: .9rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--m-txt); text-align: right; }
.m-watch-chg    { font-family: var(--m-mono); font-size: .72rem; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.m-watch-chg.grn { color: var(--m-grn); }
.m-watch-chg.red { color: var(--m-red); }

/* ══════════════════════════════════════════════════════════════════════════
   CRYPTO
   ══════════════════════════════════════════════════════════════════════════ */
.m-crypto-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px;
  border-bottom: 1px solid var(--m-border);
  gap: 10px;
  min-height: 60px;
}
.m-crypto-row:last-child { border-bottom: none; }
.m-crypto-sym  { font-family: var(--m-mono); font-size: .88rem; font-weight: 600; color: var(--m-txt); }
.m-crypto-name { font-size: .7rem; color: var(--m-txt3); margin-top: 2px; }
.m-crypto-price { font-family: var(--m-mono); font-size: .88rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--m-txt); text-align: right; }
.m-crypto-chg   { font-family: var(--m-mono); font-size: .72rem; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.m-crypto-chg.grn { color: var(--m-grn); }
.m-crypto-chg.red { color: var(--m-red); }

/* ══════════════════════════════════════════════════════════════════════════
   LOADING / EMPTY STATES
   ══════════════════════════════════════════════════════════════════════════ */
.m-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 20px;
  gap: 14px;
}
.m-spinner {
  width: 26px; height: 26px;
  border: 2.5px solid var(--m-border2);
  border-top-color: var(--m-acc);
  border-radius: 50%;
  animation: mSpin .65s linear infinite;
}
@keyframes mSpin { to { transform: rotate(360deg); } }
.m-loading-text { font-size: .78rem; color: var(--m-txt3); }

.m-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
  gap: 10px;
  text-align: center;
}
.m-empty-icon { font-size: 2.2rem; opacity: .6; }
.m-empty-text { font-size: .82rem; color: var(--m-txt3); line-height: 1.55; }

/* ══════════════════════════════════════════════════════════════════════════
   DIVIDER + TOAST
   ══════════════════════════════════════════════════════════════════════════ */
.m-divider {
  height: 1px;
  background: var(--m-border);
  margin: 4px 0;
}
.m-thick-divider {
  height: 8px;
  background: rgba(255,255,255,0.025);
  border-top: 1px solid var(--m-border);
  border-bottom: 1px solid var(--m-border);
  margin: 4px 0;
}

.m-toast {
  position: fixed;
  bottom: 86px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--m-elevated);
  border: 1px solid var(--m-border2);
  color: var(--m-txt);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transition: opacity .2s;
  white-space: nowrap;
  max-width: calc(100vw - 40px);
  text-align: center;
  pointer-events: none;
  box-shadow: var(--sh, 0 4px 24px rgba(0,0,0,.5));
}

/* ══════════════════════════════════════════════════════════════════════════
   SETTINGS  (inside More)
   ══════════════════════════════════════════════════════════════════════════ */
.m-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--m-border);
  min-height: 56px;
}
.m-settings-key { font-size: .78rem; color: var(--m-txt3); font-weight: 600; }
.m-settings-val { font-size: .78rem; color: var(--m-txt); font-weight: 500; font-family: var(--m-mono); }

/* ══════════════════════════════════════════════════════════════════════════
   BUILD 204 — Executive mobile PWA blend
   System/dark/light theme support, command home, and full-screen Copilot.
   All selectors remain scoped to #mobileShell so desktop is unaffected.
   ══════════════════════════════════════════════════════════════════════════ */
#mobileShell[data-theme="light"] {
  --m-base: #F7F9FC;
  --m-card: #FFFFFF;
  --m-elevated: #EEF3F9;
  --m-hover: #E8EEF7;
  --m-border: rgba(18,32,51,0.10);
  --m-border2: rgba(18,32,51,0.16);
  --m-acc: #2563EB;
  --m-acc-dim: rgba(37,99,235,0.12);
  --m-acc-glow: rgba(37,99,235,0.20);
  --m-grn: #15803D;
  --m-grn-dim: rgba(22,163,74,0.13);
  --m-red: #B91C1C;
  --m-red-dim: rgba(220,38,38,0.13);
  --m-ylw: #B45309;
  --m-ylw-dim: rgba(245,158,11,0.18);
  --m-purp: #6D28D9;
  --m-txt: #122033;
  --m-txt2: #516174;
  --m-txt3: #74849A;
}
#mobileShell[data-theme="light"] .m-card,
#mobileShell[data-theme="light"] .m-trade-card,
#mobileShell[data-theme="light"] .m-pos-card,
#mobileShell[data-theme="light"] .m-feature-item,
#mobileShell[data-theme="light"] .m-info-card,
#mobileShell[data-theme="light"] .m-paper-kpi,
#mobileShell[data-theme="light"] .m-subscreen,
#mobileShell[data-theme="light"] .m-chat-bubble.ai {
  box-shadow: 0 8px 24px rgba(25,42,70,.055);
}
#mobileShell[data-theme="light"] .m-header,
#mobileShell[data-theme="light"] .m-content {
  background: var(--m-base);
}
#mobileShell[data-theme="light"] .m-tabbar {
  background: rgba(255,255,255,.94);
  box-shadow: 0 -12px 30px rgba(25,42,70,.08);
}

.m-notif-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--m-red);
  color: #fff;
  border: 2px solid var(--m-base);
  font-size: .55rem;
  font-weight: 800;
  line-height: 12px;
  text-align: center;
}

.m-header {
  height: 62px;
  padding: 0 16px;
}
.m-header-logo {
  gap: 10px;
  letter-spacing: 0;
}
.m-header-logo svg {
  width: 26px;
  height: 26px;
  padding: 5px;
  border-radius: 8px;
  background: linear-gradient(135deg,var(--m-acc),#22D3EE);
}
.m-header-logo svg polyline {
  stroke: #fff !important;
}
.m-header-logo img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(15,23,42,.16);
}
.m-icon-btn {
  background: var(--m-card);
  border: 1px solid var(--m-border);
}
.m-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.m-tabbar {
  height: calc(72px + env(safe-area-inset-bottom, 0px));
  margin: 0 10px 10px;
  border: 1px solid var(--m-border);
  border-radius: 18px;
  padding: 4px 4px env(safe-area-inset-bottom, 0px);
  background: rgba(19,21,24,.94);
  backdrop-filter: blur(14px);
}
.m-tab {
  border-radius: 14px;
  font-size: .61rem;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 800;
}
.m-tab.active {
  background: var(--m-acc-dim);
  color: var(--m-acc);
}
.m-tab.active svg {
  filter: none;
}

.m-command-hero {
  padding: 20px 16px 14px;
}
.m-command-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 12px;
}
.m-command-title-main {
  color: var(--m-txt);
  font-size: 1.85rem;
  font-weight: 850;
  line-height: 1.05;
  letter-spacing: 0;
}
.m-ask-ai-btn {
  border: 0;
  min-height: 42px;
  border-radius: 12px;
  padding: 0 15px;
  background: var(--m-acc-dim);
  color: var(--m-acc);
  font: 800 .82rem var(--m-sans);
  cursor: pointer;
}
.m-market-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
}
.m-market-strip div {
  min-height: 58px;
  border-radius: 10px;
  border: 1px solid var(--m-border);
  background: var(--m-card);
  padding: 9px 10px;
}
.m-market-strip span {
  display: block;
  color: var(--m-txt3);
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.m-market-strip strong {
  display: block;
  margin-top: 4px;
  color: var(--m-txt);
  font: 800 1rem var(--m-mono);
}
.m-pulse-card {
  margin: 0 16px 12px;
  border: 1px solid var(--m-border);
  border-radius: 14px;
  background: var(--m-card);
  padding: 14px;
}
.m-card-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--m-txt);
  font-size: .92rem;
  font-weight: 850;
}
.m-metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.m-metric {
  text-align: left;
  min-height: 68px;
  border-radius: 10px;
  border: 1px solid var(--m-border);
  background: var(--m-elevated);
  padding: 10px;
  color: var(--m-txt);
  font-family: var(--m-sans);
}
.m-metric span {
  display: block;
  color: var(--m-txt3);
  font-size: .64rem;
  font-weight: 800;
  margin-bottom: 5px;
}
.m-metric strong {
  font: 850 1.1rem var(--m-mono);
}
.m-metric strong.grn,
.m-quick-actions strong.grn { color: var(--m-grn); }
.m-metric strong.red,
.m-quick-actions strong.red { color: var(--m-red); }
.m-metric strong.ylw { color: var(--m-ylw); }

.m-command-card {
  border-radius: 14px;
}
.m-command-row {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--m-border);
}
.m-command-row:last-child {
  border-bottom: 0;
}
.m-command-ticker {
  width: 46px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--m-acc-dim);
  color: var(--m-acc);
  font: 850 .74rem var(--m-mono);
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-command-main {
  flex: 1;
  min-width: 0;
}
.m-command-title {
  color: var(--m-txt);
  font-size: .82rem;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-command-sub {
  color: var(--m-txt2);
  font-size: .68rem;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: .62rem;
  font-weight: 850;
  white-space: nowrap;
}
.m-status-badge.ok { background: var(--m-grn-dim); color: var(--m-grn); }
.m-status-badge.warn { background: var(--m-ylw-dim); color: var(--m-ylw); }
.m-status-badge.red { background: var(--m-red-dim); color: var(--m-red); }
.m-status-badge.info { background: var(--m-acc-dim); color: var(--m-acc); }
.m-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px 16px 20px;
}
.m-quick-actions button {
  border: 1px solid var(--m-border);
  border-radius: 12px;
  background: var(--m-card);
  min-height: 62px;
  padding: 10px;
  color: var(--m-txt);
  text-align: left;
  font-family: var(--m-sans);
}
.m-quick-actions strong {
  display: block;
  font: 850 1.1rem var(--m-mono);
}
.m-quick-actions span {
  display: block;
  color: var(--m-txt3);
  font-size: .66rem;
  margin-top: 4px;
}

.m-copilot {
  height: calc(100dvh - 62px - 82px);
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 8%, var(--m-acc-dim), transparent 135px), var(--m-base);
}
.m-copilot-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 16px 8px;
}
.m-ai-mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg,var(--m-acc),#22D3EE);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  flex-shrink: 0;
}
.m-copilot-title {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--m-txt);
}
.m-copilot-sub {
  color: var(--m-txt3);
  font-size: .62rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.m-chat-clear {
  margin-left: auto;
  border: 0;
  border-radius: 10px;
  min-height: 36px;
  padding: 0 10px;
  background: var(--m-card);
  color: var(--m-txt2);
  font: 800 .72rem var(--m-sans);
}
.m-context-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
  padding: 0 16px 10px;
}
.m-context-grid button {
  border: 1px solid var(--m-border);
  border-radius: 10px;
  background: var(--m-card);
  color: var(--m-txt);
  min-height: 56px;
  padding: 8px;
  text-align: left;
  font-family: var(--m-sans);
}
.m-context-grid strong {
  display: block;
  font-size: .77rem;
}
.m-context-grid span {
  display: block;
  color: var(--m-txt2);
  font-size: .62rem;
  margin-top: 3px;
}
.m-copilot .m-chat-messages {
  padding-top: 4px;
}
.m-chat-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 16px 10px;
  flex-shrink: 0;
}
.m-chat-quick-grid button {
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid var(--m-acc-glow);
  background: var(--m-acc-dim);
  color: var(--m-acc);
  padding: 9px;
  text-align: left;
  font: 850 .72rem var(--m-sans);
}
.m-copilot .m-chat-input-row {
  margin: 0 12px 12px;
  border: 1px solid var(--m-border2);
  border-radius: 18px;
  background: var(--m-card);
  padding: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.m-copilot .m-chat-input {
  border-radius: 12px;
}
.m-copilot .m-chat-send {
  border-radius: 12px;
  width: 42px;
  height: 42px;
  color: #fff;
  font-weight: 900;
  font-size: .82rem;
}

.m-theme-card {
  padding: 14px;
}
.m-theme-segment {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 12px;
  background: var(--m-elevated);
  border: 1px solid var(--m-border);
}
.m-theme-segment button {
  border: 0;
  border-radius: 9px;
  min-height: 38px;
  color: var(--m-txt2);
  background: transparent;
  font: 850 .74rem var(--m-sans);
}
.m-theme-segment button.active {
  background: var(--m-acc);
  color: #fff;
}
.m-settings-help {
  margin-top: 10px;
  color: var(--m-txt2);
  font-size: .72rem;
  line-height: 1.5;
}

@media (prefers-color-scheme: light) {
  #mobileShell[data-theme-mode="system"] {
    --m-base: #F7F9FC;
    --m-card: #FFFFFF;
    --m-elevated: #EEF3F9;
    --m-hover: #E8EEF7;
    --m-border: rgba(18,32,51,0.10);
    --m-border2: rgba(18,32,51,0.16);
    --m-acc: #2563EB;
    --m-acc-dim: rgba(37,99,235,0.12);
    --m-acc-glow: rgba(37,99,235,0.20);
    --m-grn: #15803D;
    --m-grn-dim: rgba(22,163,74,0.13);
    --m-red: #B91C1C;
    --m-red-dim: rgba(220,38,38,0.13);
    --m-ylw: #B45309;
    --m-ylw-dim: rgba(245,158,11,0.18);
    --m-txt: #122033;
    --m-txt2: #516174;
    --m-txt3: #74849A;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   BUILD 205 — full mobile app revamp and iPhone fixes
   ══════════════════════════════════════════════════════════════════════════ */
#mobileShell {
  background:
    radial-gradient(circle at 50% -8%, rgba(59,130,246,.16), transparent 210px),
    var(--m-base);
}
#mobileShell .m-content {
  background:
    radial-gradient(circle at 50% 0%, rgba(59,130,246,.09), transparent 180px),
    var(--m-base);
}
#mobileShell .m-panel.active {
  min-height: 100%;
}
#mobileShell .m-card,
#mobileShell .m-pulse-card,
#mobileShell .m-trade-card,
#mobileShell .m-pos-card,
#mobileShell .m-feature-item,
#mobileShell .m-info-card {
  border-radius: 12px;
  background: color-mix(in srgb, var(--m-card) 92%, transparent);
  border-color: var(--m-border2);
}
.m-loading {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.m-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 4px solid var(--m-border);
  border-top-color: var(--m-acc);
  animation: mSpin .8s linear infinite;
}
@keyframes mSpin { to { transform: rotate(360deg); } }
.m-loading-text {
  margin-top: 14px;
  color: var(--m-txt2);
  font-size: .82rem;
}

.m-scan-hero,
.m-admin-hero,
.m-mobile-scan-command,
.m-crypto-command {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 16px 12px;
}
.m-scan-title {
  color: var(--m-txt);
  font-size: 1.72rem;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
}
.m-scan-sub {
  margin-top: 6px;
  color: var(--m-txt2);
  font-size: .74rem;
  line-height: 1.45;
}
.m-pill-rail {
  position: sticky;
  top: 0;
  z-index: 7;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 16px 10px;
  background: color-mix(in srgb, var(--m-base) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--m-border);
  scrollbar-width: none;
}
.m-pill-rail::-webkit-scrollbar { display: none; }
.m-pill-rail-btn {
  flex: 0 0 auto;
  min-height: 40px;
  border-radius: 11px;
  border: 1px solid var(--m-border2);
  background: var(--m-card);
  color: var(--m-txt2);
  padding: 0 14px;
  font: 850 .78rem var(--m-sans);
}
.m-pill-rail-btn.active {
  background: var(--m-acc);
  border-color: var(--m-acc);
  color: #fff;
  box-shadow: 0 8px 20px var(--m-acc-glow);
}
.m-scan-library {
  padding-bottom: 22px;
}
.m-library-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px;
}
.m-library-grid button {
  min-height: 118px;
  text-align: left;
  border-radius: 12px;
  border: 1px solid var(--m-border2);
  background: var(--m-card);
  color: var(--m-txt);
  padding: 16px;
  font-family: var(--m-sans);
}
.m-library-grid strong {
  display: block;
  font-size: 1.28rem;
  font-weight: 950;
  letter-spacing: 0;
  margin-bottom: 10px;
}
.m-library-grid span {
  display: block;
  color: var(--m-txt2);
  font-size: .72rem;
  line-height: 1.35;
}
.m-crypto-actions,
.m-admin-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.m-crypto-pick-list {
  margin: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--m-border2);
  overflow: hidden;
  background: var(--m-card);
}
.m-crypto-pick {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--m-border);
}
.m-crypto-pick:last-child { border-bottom: 0; }
.m-empty-compact {
  min-height: 150px;
  margin: 0 16px;
  border: 1px solid var(--m-border2);
  border-radius: 12px;
  background: var(--m-card);
}

#mPanel-chat.active {
  height: 100%;
  min-height: 0;
  padding-bottom: 0;
  overflow: hidden;
}
.m-copilot {
  height: calc(100dvh - 62px - 88px);
  min-height: 0;
  overflow: hidden;
}
.m-copilot .m-chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 16px 12px;
}
.m-copilot .m-chat-bubble {
  max-width: 92%;
  overflow-wrap: anywhere;
  line-height: 1.55;
}
.m-copilot .m-chat-input-row {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 12;
}
#mobileShell.m-chat-focus .m-tabbar {
  display: none;
}
#mobileShell.m-chat-focus .m-copilot {
  height: calc(100dvh - 62px);
}
#mobileShell.m-chat-focus .m-context-grid,
#mobileShell.m-chat-focus .m-chat-quick-grid {
  display: none;
}
#mobileShell.m-chat-focus .m-copilot .m-chat-input-row {
  margin-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
}

.m-admin-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 16px 12px;
}
.m-admin-kpis div {
  border: 1px solid var(--m-border2);
  border-radius: 12px;
  background: var(--m-card);
  padding: 12px;
}
.m-admin-kpis span,
.m-admin-kpis em {
  display: block;
  color: var(--m-txt3);
  font-size: .64rem;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}
.m-admin-kpis strong {
  display: block;
  color: var(--m-txt);
  font: 900 1.35rem var(--m-mono);
  margin: 5px 0 2px;
}
.m-admin-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 12px;
  scrollbar-width: none;
}
.m-admin-tabs::-webkit-scrollbar { display:none; }
.m-admin-tabs button {
  flex: 0 0 auto;
  border: 1px solid var(--m-border2);
  border-radius: 999px;
  background: var(--m-card);
  color: var(--m-txt2);
  min-height: 36px;
  padding: 0 12px;
  font: 850 .72rem var(--m-sans);
}
.m-admin-tabs button.active {
  background: var(--m-acc);
  border-color: var(--m-acc);
  color: #fff;
}
.m-admin-grid {
  padding-top: 4px;
}
.m-admin-user-row .m-row-right {
  align-items: flex-end;
}
.m-mini-tag {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--m-ylw-dim);
  color: var(--m-ylw);
  font-size: .55rem;
}
.m-admin-pre {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--m-txt2);
  font: 700 .66rem var(--m-mono);
  line-height: 1.45;
}
.m-btn-primary.mini,
.m-btn-ghost.mini {
  min-height: 30px;
  padding: 4px 10px;
  font-size: .68rem;
}
.m-btn-ghost.wide {
  width: calc(100% - 32px);
  margin: 12px 16px 0;
}
.m-admin-actions {
  padding: 12px 16px 20px;
}
.m-admin-actions .m-btn-primary,
.m-admin-actions .m-btn-ghost {
  flex: 1 1 150px;
}

#mobileShell[data-theme="light"] .m-pill-rail,
#mobileShell[data-theme="light"] .m-tabbar {
  background: rgba(255,255,255,.94);
}
#mobileShell[data-theme="light"] .m-library-grid button,
#mobileShell[data-theme="light"] .m-admin-kpis div,
#mobileShell[data-theme="light"] .m-crypto-pick-list,
#mobileShell[data-theme="light"] .m-empty-compact {
  box-shadow: 0 8px 24px rgba(25,42,70,.055);
}

/* ══════════════════════════════════════════════════════════════════════════
   BUILD 206 — hard mobile viewport reset
   Wins over all older mobile rules above.
   ══════════════════════════════════════════════════════════════════════════ */
html:has(#mobileShell.active),
body:has(#mobileShell.active) {
  width: 100%;
  height: 100%;
  overflow: hidden !important;
  background: var(--m-base, #0A0B0D) !important;
}
body:has(#mobileShell.active) #mainShell,
body:has(#mobileShell.active) #authScreen:not([style*="display: none"]) + #mainShell,
body:has(#mobileShell.active) #chatBubble,
body:has(#mobileShell.active) #chatWindow,
body:has(#mobileShell.active) #chatPanel {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
#mobileShell,
#mobileShell * {
  max-width: 100%;
}
#mobileShell {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh;
  height: 100dvh;
  overflow: hidden !important;
  isolation: isolate;
}
#mobileShell .m-header {
  width: 100%;
  height: 64px;
  padding: 0 14px;
  background: var(--m-base);
  border-bottom: 1px solid var(--m-border);
}
#mobileShell .m-header-logo {
  min-width: 0;
  font-size: 1.02rem;
  font-weight: 900;
}
#mobileShell .m-header-right {
  flex: 0 0 auto;
}
#mobileShell .m-content {
  width: 100%;
  max-width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden !important;
  overflow-y: auto;
  padding: 0;
}
#mobileShell .m-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden !important;
  padding-bottom: 96px;
}
#mobileShell .m-tabbar {
  flex: 0 0 auto;
  width: calc(100% - 16px);
  max-width: calc(100% - 16px);
  height: calc(72px + env(safe-area-inset-bottom, 0px));
  margin: 0 8px 8px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  border-radius: 18px;
}
#mobileShell .m-tab {
  min-width: 0;
  width: auto;
  overflow: hidden;
  gap: 4px;
  padding: 8px 2px;
  font-size: .54rem;
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
}
#mobileShell .m-tab svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

#mobileShell .m-command-hero,
#mobileShell .m-scan-hero,
#mobileShell .m-admin-hero,
#mobileShell .m-crypto-command {
  width: 100%;
  padding: 18px 14px 12px;
  align-items: flex-end;
}
#mobileShell .m-command-title-main,
#mobileShell .m-scan-title {
  font-size: clamp(1.55rem, 8vw, 1.95rem);
  line-height: 1;
}
#mobileShell .m-market-strip,
#mobileShell .m-metric-grid,
#mobileShell .m-admin-kpis,
#mobileShell .m-library-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#mobileShell .m-market-strip {
  display: grid;
  gap: 8px;
}
#mobileShell .m-market-strip div,
#mobileShell .m-metric,
#mobileShell .m-admin-kpis div,
#mobileShell .m-library-grid button {
  min-width: 0;
  overflow: hidden;
}
#mobileShell .m-pulse-card,
#mobileShell .m-card,
#mobileShell .m-command-card,
#mobileShell .m-crypto-pick-list,
#mobileShell .m-scan-result-list,
#mobileShell .m-empty-compact {
  width: calc(100% - 28px);
  margin-left: 14px;
  margin-right: 14px;
  border-radius: 12px;
}
#mobileShell .m-section-hd {
  padding: 16px 14px 9px;
}

.m-scan-result-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.m-scan-result-card {
  min-width: 0;
  min-height: 74px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--m-border2);
  border-radius: 12px;
  background: var(--m-card);
}
.m-scan-symbol {
  width: 48px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--m-acc-dim);
  color: var(--m-acc);
  font: 900 .76rem var(--m-mono);
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-scan-copy {
  min-width: 0;
}
.m-scan-copy strong,
.m-scan-copy span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-scan-copy strong {
  color: var(--m-txt);
  font-size: .82rem;
  font-weight: 900;
}
.m-scan-copy span {
  margin-top: 4px;
  color: var(--m-txt2);
  font-size: .68rem;
}
.m-scan-score {
  min-width: 34px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  background: var(--m-acc-dim);
  color: var(--m-acc);
  font: 900 .7rem var(--m-mono);
}
.m-scan-score.grn { background: var(--m-grn-dim); color: var(--m-grn); }
.m-scan-score.ylw { background: var(--m-ylw-dim); color: var(--m-ylw); }

#mobileShell .m-pill-rail {
  width: 100%;
  max-width: 100%;
  padding: 8px 14px 10px;
}
#mobileShell .m-pill-rail-btn {
  max-width: none;
  white-space: nowrap;
}
#mobileShell .m-library-grid button {
  min-height: 98px;
  padding: 14px;
}

#mobileShell .m-feature-list {
  display: grid;
  gap: 8px;
  padding: 10px 14px;
}
#mobileShell .m-feature-item {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--m-border2);
  border-radius: 12px;
  padding: 13px;
  background: var(--m-card);
}
#mobileShell .m-feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  font-size: .75rem;
  font-weight: 950;
  color: var(--m-acc);
}
#mobileShell .m-feature-text {
  min-width: 0;
}

#mobileShell .m-subscreen {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
}
#mobileShell .m-subscreen-body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
  padding-bottom: 96px;
}
#mobileShell .m-admin-tabs {
  width: 100%;
  padding: 0 14px 12px;
}
#mobileShell .m-admin-tabs button {
  min-width: auto;
}
#mobileShell .m-admin-grid {
  grid-template-columns: 1fr;
}
#mobileShell .m-admin-grid button {
  min-height: 88px;
}
#mobileShell .m-admin-kpis {
  padding: 0 14px 12px;
}

#mobileShell #mPanel-chat.active {
  height: 100%;
  padding-bottom: 0;
}
#mobileShell .m-copilot {
  height: calc(100dvh - 64px - 88px);
  background: var(--m-base);
}
#mobileShell .m-copilot-head {
  padding: 16px 14px 8px;
}
#mobileShell .m-context-grid,
#mobileShell .m-chat-quick-grid {
  padding-left: 14px;
  padding-right: 14px;
}
#mobileShell .m-context-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
#mobileShell .m-chat-quick-grid button {
  min-width: 0;
  overflow: hidden;
}
#mobileShell .m-copilot .m-chat-input-row {
  width: calc(100% - 20px);
  margin: 0 10px 10px;
}
#mobileShell .m-copilot .m-chat-input {
  min-width: 0;
  overflow: hidden;
}
#mobileShell.m-chat-focus .m-copilot {
  height: calc(100dvh - 64px);
}

#mobileShell[data-theme="light"] {
  --m-base: #F5F7FB;
  --m-card: #FFFFFF;
  --m-elevated: #EEF3FA;
  --m-hover: #E8EEF8;
  --m-border: rgba(23,36,58,.10);
  --m-border2: rgba(23,36,58,.16);
  --m-txt: #111827;
  --m-txt2: #475569;
  --m-txt3: #64748B;
}
@media (max-width: 370px) {
  #mobileShell .m-tab { font-size: .5rem; }
  #mobileShell .m-tab svg { width: 18px; height: 18px; }
  #mobileShell .m-context-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════════
   BUILD 207/208 — desktop data parity, structured saved AI scans, usable composer
   ══════════════════════════════════════════════════════════════════════════ */
.m-home-total {
  margin-top: 10px;
  padding: 10px 12px 0;
  border-top: 1px solid var(--m-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.m-home-total span {
  color: var(--m-txt3);
  font-size: .66rem;
  font-weight: 850;
  text-transform: uppercase;
}
.m-home-total strong {
  font: 900 .95rem var(--m-mono);
}
.m-home-total strong.grn { color: var(--m-grn); }
.m-home-total strong.red { color: var(--m-red); }

.m-ai-report-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 14px 10px;
}
.m-ai-ticker-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 14px 10px;
  scrollbar-width: none;
}
.m-ai-ticker-strip::-webkit-scrollbar { display: none; }
.m-ai-ticker-strip span {
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid var(--m-border2);
  background: var(--m-card);
  color: var(--m-acc);
  padding: 6px 9px;
  font: 900 .64rem var(--m-mono);
}
.m-ai-report {
  width: calc(100% - 28px);
  margin: 0 14px 16px;
  border: 1px solid var(--m-border2);
  border-radius: 12px;
  background: var(--m-card);
  padding: 14px;
  color: var(--m-txt);
  font-size: .82rem;
  line-height: 1.62;
  overflow-wrap: anywhere;
}
.m-ai-report strong {
  color: var(--m-txt);
  font-weight: 900;
}
.m-ai-summary-card {
  width: calc(100% - 28px);
  margin: 0 14px 10px;
  border: 1px solid var(--m-border2);
  border-radius: 12px;
  background: var(--m-card);
  padding: 12px 14px;
  color: var(--m-txt2);
  font-size: .78rem;
  line-height: 1.5;
}
.m-ai-summary-card strong { color: var(--m-txt); }
.m-ai-structured-list {
  width: calc(100% - 28px);
  margin: 0 14px 16px;
  border: 1px solid var(--m-border2);
  border-radius: 12px;
  background: var(--m-card);
  overflow: hidden;
}
.m-ai-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px 12px;
  border-bottom: 1px solid var(--m-border);
}
.m-ai-row:last-child { border-bottom: 0; }
.m-ai-row-left {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.m-ai-row-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.m-ai-row-title strong {
  min-width: 0;
  color: var(--m-txt);
  font-size: .78rem;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-ai-row-detail {
  color: var(--m-txt2);
  font-size: .72rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.m-ai-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.m-ai-row-meta span {
  border-radius: 999px;
  background: var(--m-elevated);
  color: var(--m-txt3);
  padding: 3px 7px;
  font-size: .6rem;
  font-weight: 850;
}
.m-ai-row-right {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 6px;
}
.m-ai-deep-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.m-ai-deep-actions button,
.m-ai-thesis-toggle {
  border: 1px solid color-mix(in srgb, var(--m-acc) 34%, var(--m-border));
  background: color-mix(in srgb, var(--m-acc) 10%, var(--m-card));
  color: var(--m-acc);
  border-radius: 999px;
  min-height: 30px;
  padding: 0 10px;
  font-size: .64rem;
  font-weight: 900;
}
.m-ai-thesis-toggle {
  margin-top: 8px;
}
.m-ai-thesis-preview {
  margin-top: 8px;
  color: var(--m-txt2);
  font-size: .73rem;
  line-height: 1.45;
}
.m-ai-thesis-panel {
  display: grid;
  gap: 8px;
  margin-top: 9px;
  padding: 10px;
  border: 1px solid var(--m-border2);
  border-radius: 12px;
  background: color-mix(in srgb, var(--m-elevated) 72%, transparent);
}
.m-ai-thesis-panel[hidden] {
  display: none;
}
.m-ai-field {
  display: grid;
  gap: 3px;
}
.m-ai-field strong {
  color: var(--m-acc);
  font-size: .6rem;
  font-weight: 950;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.m-ai-field span {
  color: var(--m-txt2);
  font-size: .7rem;
  line-height: 1.42;
}
.m-ai-option-card {
  display: block;
}
.m-mobile-thesis-card {
  display: block;
}
.m-ai-stock-card .m-ai-stock-thesis {
  grid-column: 1 / -1;
}
.m-ai-option-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.m-ai-option-card .m-ai-row-detail {
  margin-bottom: 7px;
}
.m-ai-live-check,
.m-ai-verify-note {
  display: grid;
  gap: 4px;
  border: 1px solid color-mix(in srgb, var(--m-acc) 26%, transparent);
  background: color-mix(in srgb, var(--m-acc) 8%, var(--m-card));
  border-radius: 10px;
  padding: 9px 10px;
  margin: 9px 0 0;
}
.m-ai-live-check strong,
.m-ai-verify-note strong {
  color: var(--m-acc);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.m-ai-live-check span,
.m-ai-verify-note span {
  color: var(--m-txt2);
  font-size: .7rem;
  line-height: 1.42;
}
.m-ai-verify-note {
  width: calc(100% - 28px);
  margin: 0 14px 12px;
}
.m-mobile-filter-row {
  width: calc(100% - 28px);
  margin: 0 14px 10px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.m-mobile-filter-row::-webkit-scrollbar { display: none; }
.m-mobile-filter-row button {
  flex: 0 0 auto;
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid var(--m-border2);
  background: var(--m-card);
  color: var(--m-txt2);
  padding: 0 12px;
  font-size: .68rem;
  font-weight: 900;
  white-space: nowrap;
}
.m-mobile-filter-row button.active {
  border-color: var(--m-acc);
  background: var(--m-acc);
  color: #fff;
}
.m-ai-option-card[hidden] {
  display: none !important;
}
.m-fund-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 7px 0 9px;
}
.m-fund-chip-row span {
  border-radius: 8px;
  background: var(--m-elevated);
  color: var(--m-txt3);
  padding: 4px 7px;
  font-size: .62rem;
  font-weight: 850;
}
.m-fund-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}
.m-fund-metric {
  min-width: 0;
  border: 1px solid var(--m-border2);
  border-radius: 10px;
  background: color-mix(in srgb, var(--m-card) 88%, var(--m-elevated));
  padding: 8px 8px;
}
.m-fund-metric strong {
  display: block;
  color: var(--m-txt3);
  font-size: .56rem;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.m-fund-metric span {
  display: block;
  color: var(--m-txt);
  font-size: .92rem;
  font-weight: 950;
  line-height: 1.1;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.m-fund-metric.good span { color: var(--m-grn); }
.m-fund-metric.info span { color: var(--m-acc); }
.m-fund-holdings {
  display: grid;
  gap: 4px;
  margin-top: 9px;
  color: var(--m-txt2);
  font-size: .7rem;
  line-height: 1.35;
}
.m-fund-holdings strong {
  color: var(--m-txt3);
  font-size: .58rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.m-ai-row-thesis {
  color: var(--m-txt2);
  font-size: .72rem;
  line-height: 1.45;
  margin-top: 8px;
}
.m-ai-row-notes {
  display: grid;
  gap: 4px;
  color: var(--m-txt3);
  font-size: .66rem;
  line-height: 1.35;
  margin-top: 8px;
}
.m-ai-row-notes strong {
  color: var(--m-txt2);
}
.m-ai-raw[hidden] { display: none; }
.m-ai-raw-wrap {
  width: calc(100% - 28px);
  margin: 0 14px 16px;
}
.m-ai-raw-wrap summary {
  cursor: pointer;
  color: var(--m-txt3);
  font-size: .68rem;
  font-weight: 900;
  padding: 8px 2px;
}
.m-ai-raw-wrap .m-ai-report {
  width: 100%;
  margin: 0;
}

#mobileShell .m-copilot .m-chat-input-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) 48px;
  align-items: end;
  gap: 10px;
  width: calc(100% - 20px);
  margin: 0 10px 10px;
  padding: 12px;
  border-radius: 22px;
}
#mobileShell .m-copilot .m-chat-input {
  width: 100%;
  min-height: 48px;
  max-height: 132px;
  padding: 14px 12px;
  border-radius: 16px;
  font-size: .9rem;
  line-height: 1.35;
}
#mobileShell .m-copilot .m-chat-send {
  width: 48px;
  height: 48px;
  border-radius: 16px;
}

.m-broker-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 14px 10px;
}
.m-broker-list {
  display: grid;
  gap: 10px;
  padding: 0 14px 16px;
}
.m-broker-card {
  border: 1px solid var(--m-border2);
  border-radius: 12px;
  background: var(--m-card);
  padding: 14px;
}
.m-broker-card-head,
.m-broker-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.m-broker-card-head strong {
  display: block;
  color: var(--m-txt);
  font-size: .9rem;
  font-weight: 900;
}
.m-broker-card-head span,
.m-broker-actions span,
.m-broker-muted {
  color: var(--m-txt2);
  font-size: .68rem;
}
.m-broker-accounts,
.m-broker-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.m-broker-accounts span,
.m-broker-chip-grid span {
  border: 1px solid var(--m-border);
  border-radius: 999px;
  background: var(--m-elevated);
  color: var(--m-txt2);
  padding: 5px 8px;
  font-size: .64rem;
  font-weight: 750;
}
.m-broker-actions {
  margin-top: 12px;
  flex-wrap: wrap;
}
.m-broker-error {
  margin-top: 8px;
  color: var(--m-red);
  font-size: .68rem;
  line-height: 1.4;
}
.m-btn-ghost.danger {
  color: var(--m-red);
}

#mobileShell .m-admin-tabs {
  justify-content: flex-start;
}
#mobileShell .m-admin-kpis strong {
  font-size: 1.18rem;
}

/* ══════════════════════════════════════════════════════════════════════════
   BUILD 260 — mobile feature access parity + desktop-view switch
   ══════════════════════════════════════════════════════════════════════════ */
#mobileShell .m-tab.locked {
  color: var(--m-txt3);
}
#mobileShell .m-tab.locked::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 30%;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--m-ylw);
  box-shadow: 0 0 0 3px rgba(245,158,11,.14);
}
#mobileShell .m-icon-btn.locked::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--m-ylw);
}
#mobileShell .m-pill-rail-btn.locked {
  border-style: dashed;
  border-color: rgba(245,158,11,.42);
  color: var(--m-txt2);
  background: rgba(245,158,11,.08);
}
#mobileShell .m-pill-rail-btn.locked.active {
  color: var(--m-ylw);
  background: rgba(245,158,11,.16);
  border-color: rgba(245,158,11,.62);
}
#mobileShell .m-pill-lock {
  display: inline-flex;
  align-items: center;
  margin-left: 7px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(245,158,11,.16);
  color: var(--m-ylw);
  font-size: .54rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}
#mobileShell .m-feature-item.locked {
  border-color: rgba(245,158,11,.32);
  background: linear-gradient(135deg, rgba(245,158,11,.08), var(--m-card));
}
#mobileShell .m-feature-lock-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(245,158,11,.14);
  color: var(--m-ylw);
  font-size: .58rem;
  font-weight: 900;
  text-transform: uppercase;
}
#mobileShell .m-mobile-upgrade {
  width: calc(100% - 28px);
  margin: 18px 14px;
  padding: 18px;
  border: 1px solid rgba(59,130,246,.26);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(59,130,246,.14), rgba(39,173,117,.07)),
    var(--m-card);
  box-shadow: 0 18px 48px rgba(0,0,0,.24);
}
#mobileShell .m-upgrade-kicker {
  color: var(--m-acc);
  font-size: .66rem;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}
#mobileShell .m-upgrade-title {
  margin-top: 8px;
  color: var(--m-txt);
  font-size: 1.35rem;
  line-height: 1.08;
  font-weight: 950;
}
#mobileShell .m-upgrade-body {
  margin-top: 10px;
  color: var(--m-txt2);
  font-size: .86rem;
  line-height: 1.55;
}
#mobileShell .m-upgrade-bullets {
  display: grid;
  gap: 9px;
  margin-top: 15px;
}
#mobileShell .m-upgrade-bullets div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--m-txt);
  font-size: .82rem;
}
#mobileShell .m-upgrade-bullets span {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--m-acc);
  box-shadow: 0 0 0 5px rgba(59,130,246,.12);
}
#mobileShell .m-upgrade-bullets strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
#mobileShell .m-upgrade-note {
  margin-top: 15px;
  padding: 11px 12px;
  border: 1px solid var(--m-border);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  color: var(--m-txt2);
  font-size: .72rem;
  line-height: 1.45;
}
#mobileShell .m-upgrade-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin-top: 15px;
}
#mobileShell .m-upgrade-actions .m-btn-primary,
#mobileShell .m-upgrade-actions .m-btn-ghost {
  width: 100%;
}
#mobileShell .m-upgrade-later {
  width: 100%;
  margin-top: 10px;
  border: 0;
  background: transparent;
  color: var(--m-txt2);
  font: 800 .78rem var(--m-sans);
  min-height: 40px;
}
#mobileShell .m-desktop-switch-card {
  border-color: rgba(39,173,117,.28);
}
body.force-desktop-mobile {
  overflow: auto !important;
  background: #0A0B0D;
}
body.force-desktop-mobile #mobileShell {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
body.force-desktop-mobile #mainShell {
  display: flex !important;
  min-width: 1024px;
}
#mReturnMobileBtn {
  position: fixed;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 10000;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  padding: 10px 14px;
  font: 800 12px Inter, system-ui, sans-serif;
  box-shadow: 0 14px 36px rgba(0,0,0,.28);
}

/* ══════════════════════════════════════════════════════════════════════════
   BUILD 261 - modern brokerage mobile polish
   ══════════════════════════════════════════════════════════════════════════ */
#mobileShell {
  --m-base: #090D12;
  --m-card: #10161D;
  --m-elevated: #151E27;
  --m-hover: #1B2632;
  --m-border: rgba(226,232,240,.08);
  --m-border2: rgba(226,232,240,.13);
  --m-acc: #00A66A;
  --m-acc-dim: rgba(0,166,106,.14);
  --m-acc-glow: rgba(0,166,106,.20);
  --m-grn: #14B878;
  --m-grn-dim: rgba(20,184,120,.14);
  --m-red: #EF4444;
  --m-red-dim: rgba(239,68,68,.13);
  --m-ylw: #D97706;
  --m-ylw-dim: rgba(217,119,6,.14);
  --m-txt: #F8FAFC;
  --m-txt2: #A8B3C2;
  --m-txt3: #6F7F91;
  --m-r-sm: 8px;
  --m-r-md: 8px;
  --m-r-lg: 8px;
  --m-r-xl: 8px;
}
#mobileShell[data-theme="light"] {
  --m-base: #F4F6F8;
  --m-card: #FFFFFF;
  --m-elevated: #F8FAFC;
  --m-hover: #EDF2F7;
  --m-border: rgba(15,23,42,.08);
  --m-border2: rgba(15,23,42,.12);
  --m-acc: #008F5D;
  --m-acc-dim: rgba(0,143,93,.11);
  --m-acc-glow: rgba(0,143,93,.16);
  --m-grn: #008F5D;
  --m-grn-dim: rgba(0,143,93,.12);
  --m-red: #C24141;
  --m-red-dim: rgba(194,65,65,.11);
  --m-ylw: #A16207;
  --m-ylw-dim: rgba(161,98,7,.12);
  --m-txt: #111827;
  --m-txt2: #526173;
  --m-txt3: #7A8796;
}
@media (prefers-color-scheme: light) {
  #mobileShell[data-theme-mode="system"] {
    --m-base: #F4F6F8;
    --m-card: #FFFFFF;
    --m-elevated: #F8FAFC;
    --m-hover: #EDF2F7;
    --m-border: rgba(15,23,42,.08);
    --m-border2: rgba(15,23,42,.12);
    --m-acc: #008F5D;
    --m-acc-dim: rgba(0,143,93,.11);
    --m-acc-glow: rgba(0,143,93,.16);
    --m-grn: #008F5D;
    --m-grn-dim: rgba(0,143,93,.12);
    --m-red: #C24141;
    --m-red-dim: rgba(194,65,65,.11);
    --m-ylw: #A16207;
    --m-ylw-dim: rgba(161,98,7,.12);
    --m-txt: #111827;
    --m-txt2: #526173;
    --m-txt3: #7A8796;
  }
}
#mobileShell,
#mobileShell .m-content,
#mobileShell .m-copilot {
  background:
    linear-gradient(180deg, rgba(0,166,106,.05), transparent 170px),
    var(--m-base);
}
#mobileShell[data-theme="light"],
#mobileShell[data-theme="light"] .m-content,
#mobileShell[data-theme="light"] .m-copilot {
  background:
    linear-gradient(180deg, rgba(0,143,93,.045), transparent 170px),
    var(--m-base);
}
#mobileShell .m-header {
  height: 60px;
  padding: 0 16px;
  border-bottom: 0;
  background: color-mix(in srgb, var(--m-base) 88%, transparent);
  backdrop-filter: blur(18px) saturate(1.1);
}
#mobileShell .m-header-logo {
  gap: 10px;
  font-size: 1rem;
  font-weight: 850;
}
#mobileShell .m-header-logo img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(15,23,42,.15);
}
#mobileShell .m-header-right {
  gap: 8px;
}
#mobileShell .m-icon-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 14px;
  background: var(--m-card);
  border: 1px solid var(--m-border2);
  box-shadow: 0 8px 18px rgba(0,0,0,.08);
}
#mobileShell .m-avatar {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--m-acc), #2563EB);
  box-shadow: 0 8px 18px rgba(0,0,0,.12);
}
#mobileShell .m-tabbar {
  width: calc(100% - 24px);
  max-width: calc(100% - 24px);
  height: calc(68px + env(safe-area-inset-bottom, 0px));
  margin: 0 12px 10px;
  padding: 5px 5px env(safe-area-inset-bottom, 0px);
  border-radius: 22px;
  border: 1px solid var(--m-border2);
  background: color-mix(in srgb, var(--m-card) 92%, transparent);
  backdrop-filter: blur(20px) saturate(1.12);
  box-shadow: 0 -10px 28px rgba(0,0,0,.18);
}
#mobileShell[data-theme="light"] .m-tabbar,
#mobileShell[data-theme-mode="system"][data-theme="light"] .m-tabbar {
  background: rgba(255,255,255,.94);
  box-shadow: 0 -12px 28px rgba(15,23,42,.08);
}
#mobileShell .m-tab {
  border-radius: 17px;
  padding: 7px 2px;
  color: var(--m-txt3);
  font-size: .54rem;
  font-weight: 850;
}
#mobileShell .m-tab svg {
  width: 18px;
  height: 18px;
}
#mobileShell .m-tab.active {
  background: var(--m-acc);
  color: #FFFFFF;
  box-shadow: 0 8px 18px var(--m-acc-glow);
}
#mobileShell .m-tab.active svg {
  filter: none;
}
#mobileShell .m-tab.locked::after {
  top: 7px;
  right: calc(50% - 18px);
  width: 6px;
  height: 6px;
}
#mobileShell .m-command-hero,
#mobileShell .m-scan-hero,
#mobileShell .m-ai-report-head,
#mobileShell .m-admin-hero,
#mobileShell .m-mobile-scan-command,
#mobileShell .m-crypto-command,
#mobileShell .m-broker-hero {
  padding: 18px 16px 10px;
  align-items: center;
}
#mobileShell .m-command-hero-top {
  align-items: center;
}
#mobileShell .m-hero-label {
  margin-bottom: 5px;
  color: var(--m-txt3);
  font-size: .6rem;
  letter-spacing: .08em;
}
#mobileShell .m-command-title-main,
#mobileShell .m-scan-title {
  font-size: clamp(1.42rem, 6vw, 1.72rem);
  line-height: 1.05;
  font-weight: 950;
}
#mobileShell .m-scan-sub {
  max-width: 245px;
  color: var(--m-txt2);
  font-size: .72rem;
}
#mobileShell .m-ask-ai-btn,
#mobileShell .m-btn-primary.mini,
#mobileShell .m-btn-ghost.mini {
  width: auto;
  min-width: 0;
  min-height: 36px;
  border-radius: 999px;
  padding: 0 13px;
  margin-top: 0;
  white-space: nowrap;
  box-shadow: none;
}
#mobileShell .m-ask-ai-btn,
#mobileShell .m-btn-ghost.mini {
  background: var(--m-card);
  color: var(--m-txt2);
  border: 1px solid var(--m-border2);
}
#mobileShell .m-pill-rail {
  position: sticky;
  top: 0;
  z-index: 8;
  gap: 8px;
  padding: 8px 16px 9px;
  border-bottom: 0;
  background: color-mix(in srgb, var(--m-base) 90%, transparent);
  backdrop-filter: blur(18px);
}
#mobileShell .m-pill-rail-btn {
  min-height: 36px;
  border-radius: 999px;
  padding: 0 13px;
  font-size: .72rem;
  font-weight: 850;
  background: var(--m-card);
  border-color: var(--m-border2);
  box-shadow: 0 6px 14px rgba(0,0,0,.05);
}
#mobileShell .m-pill-rail-btn.active {
  background: var(--m-txt);
  border-color: var(--m-txt);
  color: var(--m-base);
  box-shadow: none;
}
#mobileShell .m-pill-rail-btn.locked {
  border-style: solid;
  background: color-mix(in srgb, var(--m-card) 86%, var(--m-ylw-dim));
}
#mobileShell .m-pill-rail-btn.locked.active {
  background: var(--m-ylw-dim);
  border-color: rgba(217,119,6,.30);
  color: var(--m-ylw);
}
#mobileShell .m-pill-lock {
  margin-left: 6px;
  padding: 2px 6px;
  font-size: .5rem;
}
#mobileShell .m-card,
#mobileShell .m-pulse-card,
#mobileShell .m-command-card,
#mobileShell .m-ai-structured-list,
#mobileShell .m-ai-summary-card,
#mobileShell .m-ai-report,
#mobileShell .m-trade-card,
#mobileShell .m-pos-card,
#mobileShell .m-crypto-pick-list,
#mobileShell .m-scan-result-list,
#mobileShell .m-empty-compact,
#mobileShell .m-feature-item,
#mobileShell .m-info-card,
#mobileShell .m-broker-card,
#mobileShell .m-mobile-upgrade {
  width: calc(100% - 32px);
  margin-left: 16px;
  margin-right: 16px;
  border-radius: 8px;
  border-color: var(--m-border2);
  background: var(--m-card);
}
#mobileShell[data-theme="light"] .m-card,
#mobileShell[data-theme="light"] .m-pulse-card,
#mobileShell[data-theme="light"] .m-command-card,
#mobileShell[data-theme="light"] .m-ai-structured-list,
#mobileShell[data-theme="light"] .m-ai-summary-card,
#mobileShell[data-theme="light"] .m-ai-report,
#mobileShell[data-theme="light"] .m-trade-card,
#mobileShell[data-theme="light"] .m-pos-card,
#mobileShell[data-theme="light"] .m-crypto-pick-list,
#mobileShell[data-theme="light"] .m-scan-result-list,
#mobileShell[data-theme="light"] .m-feature-item,
#mobileShell[data-theme="light"] .m-info-card,
#mobileShell[data-theme="light"] .m-broker-card,
#mobileShell[data-theme="light"] .m-mobile-upgrade {
  box-shadow: 0 8px 22px rgba(15,23,42,.055);
}
#mobileShell .m-section-hd {
  padding: 17px 16px 9px;
}
#mobileShell .m-section-hd-title {
  font-size: .63rem;
  letter-spacing: .08em;
}
#mobileShell .m-section-hd-link {
  min-height: 36px;
  color: var(--m-acc);
  font-weight: 850;
}
#mobileShell .m-market-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
#mobileShell .m-market-strip div,
#mobileShell .m-metric,
#mobileShell .m-quick-actions button,
#mobileShell .m-context-grid button,
#mobileShell .m-chat-quick-grid button {
  border-radius: 8px;
}
#mobileShell .m-command-row,
#mobileShell .m-row,
#mobileShell .m-ai-row,
#mobileShell .m-alert-row,
#mobileShell .m-crypto-row,
#mobileShell .m-watch-row {
  min-height: 66px;
  padding: 13px 14px;
}
#mobileShell .m-command-ticker,
#mobileShell .m-scan-symbol {
  border-radius: 8px;
  background: var(--m-acc-dim);
  color: var(--m-acc);
}
#mobileShell .m-command-title,
#mobileShell .m-ai-row-title strong,
#mobileShell .m-ticker {
  letter-spacing: 0;
}
#mobileShell .m-command-sub,
#mobileShell .m-ai-row-detail,
#mobileShell .m-name {
  color: var(--m-txt2);
}
#mobileShell .m-ai-row-title {
  gap: 9px;
}
#mobileShell .m-ai-row-title .m-ticker {
  color: var(--m-txt);
  font-size: .82rem;
  font-weight: 950;
}
#mobileShell .m-ai-row-right .m-price {
  color: var(--m-txt2);
}
#mobileShell .m-status-badge {
  min-height: 22px;
  padding: 0 8px;
  font-size: .58rem;
}
#mobileShell .m-feature-list {
  gap: 9px;
  padding: 10px 16px;
}
#mobileShell .m-feature-item {
  min-height: 66px;
  padding: 13px 14px;
}
#mobileShell .m-feature-icon {
  border-radius: 8px;
}
#mobileShell .m-user-block {
  padding: 20px 16px 16px;
}
#mobileShell .m-mobile-upgrade {
  padding: 18px;
  box-shadow: none;
}
#mobileShell .m-upgrade-actions {
  grid-template-columns: 1fr 1fr;
}
#mobileShell .m-upgrade-actions .m-btn-primary,
#mobileShell .m-upgrade-actions .m-btn-ghost {
  min-height: 44px;
  margin-top: 0;
}
#mobileShell .m-copilot {
  height: calc(100dvh - 60px - 84px);
}
#mobileShell .m-copilot-head {
  padding: 14px 16px 8px;
}
#mobileShell .m-ai-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--m-acc), #2563EB);
}
#mobileShell .m-copilot-title {
  font-size: 1.06rem;
}
#mobileShell .m-copilot-sub {
  max-width: 210px;
  font-size: .6rem;
  line-height: 1.25;
}
#mobileShell .m-context-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 10px;
  scrollbar-width: none;
}
#mobileShell .m-context-grid::-webkit-scrollbar {
  display: none;
}
#mobileShell .m-context-grid button {
  flex: 0 0 116px;
  min-height: 58px;
}
#mobileShell .m-chat-quick-grid {
  padding: 0 16px 10px;
}
#mobileShell .m-copilot .m-chat-messages {
  padding: 6px 16px 12px;
}
#mobileShell .m-copilot .m-chat-bubble {
  border-radius: 16px;
  max-width: 90%;
  font-size: .84rem;
}
#mobileShell .m-chat-bubble.ai {
  background: var(--m-card);
}
#mobileShell .m-chat-bubble.user {
  background: var(--m-acc);
}
#mobileShell .m-copilot .m-chat-input-row {
  width: calc(100% - 24px);
  margin: 0 12px 10px;
  padding: 9px;
  border-radius: 22px;
  background: var(--m-card);
  box-shadow: 0 12px 28px rgba(0,0,0,.16);
}
#mobileShell .m-copilot .m-chat-input {
  min-height: 46px;
  border-radius: 16px;
  background: var(--m-elevated);
}
#mobileShell .m-copilot .m-chat-send {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: var(--m-acc);
}
#mobileShell.m-chat-focus .m-copilot {
  height: calc(100dvh - 60px);
}
#mobileShell .m-subscreen-hd {
  height: 58px;
  border-bottom: 0;
  background: color-mix(in srgb, var(--m-base) 92%, transparent);
  backdrop-filter: blur(16px);
}
#mobileShell .m-back-btn {
  color: var(--m-acc);
}
@media (max-width: 370px) {
  #mobileShell .m-command-title-main,
  #mobileShell .m-scan-title {
    font-size: 1.35rem;
  }
  #mobileShell .m-upgrade-actions {
    grid-template-columns: 1fr;
  }
}

/* BUILD 263 - mobile upgrade billing sheet */
#mobileShell .m-upgrade-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(2,6,23,.58);
  padding: 0;
}
#mobileShell .m-upgrade-sheet {
  width: 100%;
  max-height: 88dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 18px 18px 0 0;
  border: 1px solid var(--m-border2);
  border-bottom: 0;
  background: var(--m-base);
  box-shadow: 0 -24px 60px rgba(0,0,0,.34);
  padding: 10px 0 calc(env(safe-area-inset-bottom, 0px) + 18px);
}
#mobileShell .m-upgrade-sheet-grip {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: var(--m-border2);
  margin: 0 auto 10px;
}
#mobileShell .m-upgrade-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 12px;
}
#mobileShell .m-upgrade-sheet-title {
  color: var(--m-txt);
  font-size: 1.28rem;
  font-weight: 950;
}
#mobileShell .m-upgrade-close {
  border: 1px solid var(--m-border2);
  border-radius: 999px;
  background: var(--m-card);
  color: var(--m-txt2);
  min-height: 36px;
  padding: 0 12px;
  font: 850 .72rem var(--m-sans);
}
#mobileShell .m-upgrade-status {
  width: calc(100% - 32px);
  margin: 0 16px 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#mobileShell .m-upgrade-status div {
  border: 1px solid var(--m-border2);
  border-radius: 8px;
  background: var(--m-card);
  padding: 10px 12px;
}
#mobileShell .m-upgrade-status span {
  display: block;
  color: var(--m-txt3);
  font-size: .6rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}
#mobileShell .m-upgrade-status strong {
  display: block;
  color: var(--m-txt);
  font: 950 .9rem var(--m-mono);
  margin-top: 4px;
}
#mobileShell .m-plan-list {
  display: grid;
  gap: 10px;
  padding: 0 16px 12px;
}
#mobileShell .m-plan-card {
  border: 1px solid var(--m-border2);
  border-radius: 8px;
  background: var(--m-card);
  padding: 14px;
}
#mobileShell .m-plan-card.current {
  border-color: var(--m-acc);
}
#mobileShell .m-plan-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
#mobileShell .m-plan-name {
  color: var(--m-txt);
  font-size: 1rem;
  font-weight: 950;
}
#mobileShell .m-plan-copy {
  color: var(--m-txt2);
  font-size: .72rem;
  line-height: 1.4;
  margin-top: 4px;
}
#mobileShell .m-plan-current {
  border-radius: 999px;
  background: var(--m-acc-dim);
  color: var(--m-acc);
  padding: 4px 8px;
  font-size: .58rem;
  font-weight: 950;
  text-transform: uppercase;
}
#mobileShell .m-plan-points {
  display: grid;
  gap: 5px;
  margin: 12px 0;
  padding-left: 16px;
  color: var(--m-txt2);
  font-size: .72rem;
  line-height: 1.35;
}
#mobileShell .m-plan-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#mobileShell .m-plan-action {
  border: 1px solid var(--m-border2);
  border-radius: 8px;
  min-height: 48px;
  padding: 8px 10px;
  text-align: left;
  font-family: var(--m-sans);
}
#mobileShell .m-plan-action.primary {
  background: var(--m-acc);
  color: #fff;
  border-color: var(--m-acc);
}
#mobileShell .m-plan-action.secondary {
  background: var(--m-elevated);
  color: var(--m-txt);
}
#mobileShell .m-plan-action:disabled {
  opacity: .55;
}
#mobileShell .m-plan-action strong,
#mobileShell .m-plan-action span {
  display: block;
}
#mobileShell .m-plan-action strong {
  font-size: .82rem;
  font-weight: 950;
}
#mobileShell .m-plan-action span {
  font-size: .58rem;
  font-weight: 850;
  margin-top: 2px;
  opacity: .82;
}
#mobileShell .m-portal-btn {
  width: calc(100% - 32px);
  margin: 0 16px 12px;
}
#mobileShell .m-upgrade-error {
  width: calc(100% - 32px);
  margin: 0 16px 12px;
  border: 1px solid rgba(239,68,68,.25);
  border-radius: 8px;
  background: var(--m-red-dim);
  color: var(--m-red);
  padding: 12px;
  font-size: .76rem;
  line-height: 1.45;
}
#mobileShell .m-upgrade-error strong,
#mobileShell .m-upgrade-error span {
  display: block;
}
#mobileShell .m-upgrade-error .m-btn-primary {
  margin-top: 10px;
}
@media (min-width: 700px) {
  #mobileShell .m-upgrade-sheet {
    max-width: 520px;
    border-radius: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--m-border2);
  }
}

/* BUILD 264 - mobile admin user management */
#mobileShell .m-admin-user-tools {
  width: calc(100% - 32px);
  margin: 12px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#mobileShell .m-admin-user-tools strong,
#mobileShell .m-admin-user-tools span {
  display: block;
}
#mobileShell .m-admin-user-tools strong {
  color: var(--m-txt);
  font-size: .94rem;
  font-weight: 950;
}
#mobileShell .m-admin-user-tools span {
  margin-top: 2px;
  color: var(--m-txt3);
  font-size: .66rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .05em;
}
#mobileShell .m-admin-user-list {
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  display: grid;
  gap: 10px;
}
#mobileShell .m-admin-user-card {
  border: 1px solid var(--m-border2);
  border-radius: 12px;
  background: var(--m-card);
  padding: 13px;
}
#mobileShell .m-admin-user-top {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
#mobileShell .m-admin-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--m-acc-dim);
  color: var(--m-acc);
  font: 950 .76rem var(--m-sans);
}
#mobileShell .m-admin-user-main {
  min-width: 0;
}
#mobileShell .m-admin-user-name {
  color: var(--m-txt);
  font-size: .88rem;
  font-weight: 950;
  display: flex;
  align-items: center;
  gap: 6px;
}
#mobileShell .m-admin-user-meta {
  margin-top: 3px;
  color: var(--m-txt2);
  font-size: .68rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#mobileShell .m-mini-tag {
  border-radius: 999px;
  background: var(--m-ylw-dim);
  color: var(--m-ylw);
  padding: 3px 6px;
  font-size: .52rem;
  font-weight: 950;
  letter-spacing: .04em;
}
#mobileShell .m-admin-user-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
#mobileShell .m-admin-user-facts div {
  border: 1px solid var(--m-border);
  border-radius: 8px;
  background: var(--m-elevated);
  padding: 9px 10px;
  min-width: 0;
}
#mobileShell .m-admin-user-facts span,
#mobileShell .m-admin-user-facts strong {
  display: block;
}
#mobileShell .m-admin-user-facts span {
  color: var(--m-txt3);
  font-size: .56rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}
#mobileShell .m-admin-user-facts strong {
  margin-top: 4px;
  color: var(--m-txt);
  font: 900 .68rem var(--m-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#mobileShell .m-admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
#mobileShell .m-admin-protected {
  color: var(--m-txt3);
  font-size: .68rem;
  font-weight: 850;
}
#mobileShell .m-admin-user-overlay {
  position: fixed;
  inset: 0;
  z-index: 12100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(2,6,23,.62);
}
#mobileShell .m-admin-user-sheet {
  width: 100%;
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--m-border2);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: var(--m-base);
  box-shadow: 0 -24px 60px rgba(0,0,0,.38);
  padding: 10px 0 calc(env(safe-area-inset-bottom, 0px) + 18px);
}
#mobileShell .m-admin-user-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 12px;
}
#mobileShell .m-admin-user-sheet-title {
  color: var(--m-txt);
  font-size: 1.24rem;
  font-weight: 950;
}
#mobileShell .m-admin-form {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
}
#mobileShell .m-admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
#mobileShell .m-admin-form label {
  display: grid;
  gap: 6px;
  color: var(--m-txt3);
  font-size: .62rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .05em;
}
#mobileShell .m-admin-form input,
#mobileShell .m-admin-form select,
#mobileShell .m-admin-form textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--m-border2);
  border-radius: 10px;
  background: var(--m-card);
  color: var(--m-txt);
  padding: 10px 12px;
  font: 800 16px var(--m-sans);
  outline: 0;
}
#mobileShell .m-admin-form textarea {
  min-height: 82px;
  resize: vertical;
  line-height: 1.35;
}
#mobileShell .m-admin-form label.disabled {
  opacity: .58;
}
#mobileShell .m-admin-check {
  display: flex !important;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 9px !important;
  min-height: 40px;
}
#mobileShell .m-admin-check input {
  width: 18px;
  min-height: 18px;
}
#mobileShell .m-admin-form .m-btn-primary.wide {
  width: 100%;
  margin-top: 2px;
}
#mobileShell .m-admin-sheet-summary {
  display: grid;
  grid-template-columns: 42px minmax(0,1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--m-border2);
  border-radius: 12px;
  background: var(--m-card);
  padding: 12px;
}
#mobileShell .m-admin-sheet-summary strong,
#mobileShell .m-admin-sheet-summary span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#mobileShell .m-admin-sheet-summary strong {
  color: var(--m-txt);
  font-size: .9rem;
  font-weight: 950;
}
#mobileShell .m-admin-sheet-summary span {
  color: var(--m-txt2);
  font-size: .7rem;
  margin-top: 3px;
}
#mobileShell .m-admin-danger-zone {
  border: 1px solid rgba(239,68,68,.18);
  border-radius: 12px;
  background: var(--m-red-dim);
  padding: 12px;
}
#mobileShell .m-admin-danger-zone strong,
#mobileShell .m-admin-danger-zone span {
  display: block;
}
#mobileShell .m-admin-danger-zone strong {
  color: var(--m-txt);
  font-size: .82rem;
  font-weight: 950;
}
#mobileShell .m-admin-danger-zone span {
  color: var(--m-txt2);
  font-size: .68rem;
  line-height: 1.35;
  margin-top: 3px;
}
#mobileShell .m-admin-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
#mobileShell .m-admin-action-grid .m-btn-ghost {
  min-height: 42px;
  margin-top: 0;
}
@media (max-width: 370px) {
  #mobileShell .m-admin-form-grid,
  #mobileShell .m-admin-action-grid {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 700px) {
  #mobileShell .m-admin-user-sheet {
    max-width: 540px;
    border-radius: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--m-border2);
  }
}

/* BUILD 265 - align mobile brand theme with desktop blue/purple Stratalyx */
#mobileShell {
  --m-base: #0F172A;
  --m-card: #1E293B;
  --m-elevated: #26344D;
  --m-hover: #334155;
  --m-border: rgba(226,232,240,.08);
  --m-border2: rgba(226,232,240,.14);
  --m-acc: #3B82F6;
  --m-acc-dim: rgba(59,130,246,.16);
  --m-acc-glow: rgba(124,58,237,.24);
  --m-purp: #8B5CF6;
  --m-purp-dim: rgba(124,58,237,.14);
  --m-grn: #22C55E;
  --m-grn-dim: rgba(34,197,94,.14);
  --m-red: #F87171;
  --m-red-dim: rgba(248,113,113,.13);
  --m-ylw: #F59E0B;
  --m-ylw-dim: rgba(245,158,11,.14);
  --m-txt: #F8FAFC;
  --m-txt2: #CBD5E1;
  --m-txt3: #94A3B8;
}
#mobileShell[data-theme="light"] {
  --m-base: #F8FAFC;
  --m-card: #FFFFFF;
  --m-elevated: #F1F5F9;
  --m-hover: #EAF1FE;
  --m-border: rgba(15,23,42,.08);
  --m-border2: rgba(15,23,42,.13);
  --m-acc: #2563EB;
  --m-acc-dim: rgba(37,99,235,.12);
  --m-acc-glow: rgba(124,58,237,.18);
  --m-purp: #7C3AED;
  --m-purp-dim: rgba(124,58,237,.11);
  --m-grn: #16A34A;
  --m-grn-dim: rgba(22,163,74,.12);
  --m-red: #DC2626;
  --m-red-dim: rgba(220,38,38,.11);
  --m-ylw: #CA8A04;
  --m-ylw-dim: rgba(202,138,4,.12);
  --m-txt: #0F172A;
  --m-txt2: #334155;
  --m-txt3: #64748B;
}
@media (prefers-color-scheme: light) {
  #mobileShell[data-theme-mode="system"] {
    --m-base: #F8FAFC;
    --m-card: #FFFFFF;
    --m-elevated: #F1F5F9;
    --m-hover: #EAF1FE;
    --m-border: rgba(15,23,42,.08);
    --m-border2: rgba(15,23,42,.13);
    --m-acc: #2563EB;
    --m-acc-dim: rgba(37,99,235,.12);
    --m-acc-glow: rgba(124,58,237,.18);
    --m-purp: #7C3AED;
    --m-purp-dim: rgba(124,58,237,.11);
    --m-grn: #16A34A;
    --m-grn-dim: rgba(22,163,74,.12);
    --m-red: #DC2626;
    --m-red-dim: rgba(220,38,38,.11);
    --m-ylw: #CA8A04;
    --m-ylw-dim: rgba(202,138,4,.12);
    --m-txt: #0F172A;
    --m-txt2: #334155;
    --m-txt3: #64748B;
  }
}
#mobileShell,
#mobileShell .m-content,
#mobileShell .m-copilot {
  background:
    linear-gradient(180deg, rgba(59,130,246,.13), rgba(124,58,237,.07) 300px, transparent 560px),
    var(--m-base);
}
#mobileShell[data-theme="light"],
#mobileShell[data-theme="light"] .m-content,
#mobileShell[data-theme="light"] .m-copilot {
  background:
    linear-gradient(180deg, rgba(37,99,235,.10), rgba(124,58,237,.055) 280px, transparent 520px),
    var(--m-base);
}
@media (prefers-color-scheme: light) {
  #mobileShell[data-theme-mode="system"],
  #mobileShell[data-theme-mode="system"] .m-content,
  #mobileShell[data-theme-mode="system"] .m-copilot {
    background:
      linear-gradient(180deg, rgba(37,99,235,.10), rgba(124,58,237,.055) 280px, transparent 520px),
      var(--m-base);
  }
}
#mobileShell .m-avatar,
#mobileShell .m-ai-mark,
#mobileShell .m-user-block .m-avatar,
#mobileShell .m-admin-user-avatar {
  background: linear-gradient(135deg, var(--m-acc), var(--m-purp));
  color: #FFFFFF;
}
#mobileShell .m-tab.active,
#mobileShell .m-btn-primary,
#mobileShell .m-chat-send,
#mobileShell .m-copilot .m-chat-send,
#mobileShell .m-plan-action.primary {
  background: linear-gradient(135deg, var(--m-acc), var(--m-purp));
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 8px 20px var(--m-acc-glow);
}
#mobileShell .m-pill-rail-btn.active,
#mobileShell .m-admin-tabs button.active,
#mobileShell .m-status-badge.info,
#mobileShell .m-plan-current,
#mobileShell .m-feature-icon,
#mobileShell .m-scan-symbol {
  background: linear-gradient(135deg, var(--m-acc-dim), var(--m-purp-dim));
  color: var(--m-acc);
}
#mobileShell .m-mobile-upgrade {
  background:
    linear-gradient(135deg, rgba(59,130,246,.14), rgba(124,58,237,.12)),
    var(--m-card);
  border-color: rgba(124,58,237,.26);
}
#mobileShell .m-header-logo img {
  box-shadow: 0 8px 22px rgba(59,130,246,.18);
}
#mobileShell .m-tabbar {
  box-shadow: 0 -10px 30px rgba(15,23,42,.28), 0 0 0 1px rgba(124,58,237,.04);
}
