/**
 * SHELL CSS SYNC WARNING - THREE COPIES OF THIS STYLESHEET EXIST.
 *   This copy (paper-trading-shell.20260723c.css) is loaded by: shared.html, faq.html, all 40 stock/*.html.
 *   Siblings:
 *     - paper-trading-shell.20260723e.css  (options, portfolio, portfolio-hub, research, news-desk, coach-hub) [canonical/newest]
 *     - paper-trading-shell.css            (chart.html)
 *   ANY change to SHARED chrome must be applied to all three, or it silently misses
 *   those pages. Known INTENTIONAL per-copy deltas (do not "fix" by blind-merging):
 *     - this copy alone has the prod coach-hide block (html:not(.is-preview) [data-coach-header]) + .tf-btn in the 40px tap-target rule + white/orange coach-btn theme
 *     - .20260723e alone has the 2026-07-30 coach in-flow positioning (is-preview gated)
 *     - paper-trading-shell.css alone has the "More stays clickable when active" rule
 *   Full physical consolidation is tracked as audit finding #26 (needs before/after verification).
 *
 * Shared chrome for Paper Trading: Hub, Chart (/game?mode=invest), Portfolio.
 * One header height, one stats strip shape — switching tabs should feel seamless.
 */

/* iOS Safari: kill native search chrome, inset hairlines, and icon separators. */
.symbol-input,
#symbolSearch,
.pt-search,
input.symbol-input,
input.pt-search {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: none !important;
  -webkit-background-clip: padding-box;
  background-clip: padding-box;
}
input[type="search"] {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: none !important;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: none !important;
}

.pt-appbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 88px;
  min-height: 88px;
  max-height: 88px;
  padding: 0 16px;
  /* Flex + order: Switch + logo + Hub/Chart/Portfolio cluster left;
     search/stats mid; auth (avatar + Report + Sign out + settings) right. */
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border-bottom: 1px solid #e4e8ee;
  box-sizing: border-box;
  flex-shrink: 0;
}

/* Chart search dropdown must paint below the 56px bar — not clipped */
body.invest-mode #stickyHud {
  overflow: visible !important;
  z-index: 200 !important;
}

/* Chart page uses #stickyHud — same flex shell as .pt-appbar (desktop only).
   Never pin 88px/nowrap on phones — that clips the wrapped search row and the
   header border-bottom cuts through #symbolSearch (~390px iPhone Safari). */
@media (min-width: 901px) {
  body.invest-mode #stickyHud {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 10px !important;
    height: 88px !important;
    min-height: 88px !important;
    max-height: 88px !important;
    padding: 0 16px !important;
    background: #ffffff !important;
    border-bottom: 1px solid #e4e8ee !important;
  }
}

body.invest-mode #stickyHud .pt-appbar-center,
body.invest-mode #stickyHud .header-center {
  position: relative;
  z-index: 210;
  overflow: visible;
}

.pt-appbar-left {
  order: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
}

.pt-nav-slot {
  order: 2;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 6;
  flex: 0 0 auto;
}

.pt-appbar-center {
  order: 3;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

.pt-stats-slot {
  order: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 1 auto;
  max-width: 320px;
  min-width: 0;
  overflow: hidden;
  margin-left: auto !important; /* pin money + auth far right (Coach slot is absolute / out of flow) */
}

.pt-auth-slot {
  order: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
  box-sizing: border-box;
  margin-left: auto !important; /* Sign out far right when stats absent */
}
.pt-stats-slot + .pt-auth-slot {
  margin-left: 0 !important; /* stats already absorbed free space */
}
/* Chart invest: hide Portfolio / Buying power from header (ticket has BP).
   Stats leave flex when display:none — force auth margin-left back on. */
body.invest-mode #stickyHud .pt-stats-slot {
  display: none !important;
}
body.invest-mode #stickyHud .pt-auth-slot,
body.invest-mode #stickyHud .header-right {
  margin-left: auto !important;
}

/* Auth column — room for avatar + Report + Sign out + settings */
body.invest-mode .pt-auth-slot,
body.paper-trading .pt-auth-slot {
  min-width: 0;
  max-width: none;
  width: auto;
  padding-left: 12px;
  padding-right: 2px;
  border-left: 1px solid #e4e8ee;
}

body.invest-mode #stickyHud .pt-appbar-left,
body.invest-mode #stickyHud .header-left { order: 1; flex: 0 0 auto; }
body.invest-mode #stickyHud .pt-nav-slot { order: 2; flex: 0 0 auto; }
body.invest-mode #stickyHud .pt-appbar-center,
body.invest-mode #stickyHud .header-center { order: 3; flex: 1 1 auto; min-width: 0; }
body.invest-mode #stickyHud .pt-stats-slot { order: 4; flex: 0 1 auto; max-width: 320px; }
body.invest-mode #stickyHud .pt-auth-slot,
body.invest-mode #stickyHud .header-right { order: 5; flex: 0 0 auto; }

.pt-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #1a1f29;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.pt-brand-logo {
  height: 56px !important;
  width: auto !important;
  display: block;
  max-height: 56px;
}

.pt-brand-mark {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: #117a37;
  flex-shrink: 0;
}

.pt-back {
  font-size: 12px;
  font-weight: 600;
  color: #6b7480;
  text-decoration: none;
  border: 1px solid #d6dce4;
  border-radius: 6px;
  padding: 5px 11px;
  white-space: nowrap;
  line-height: 1.2;
}

.pt-back:hover { color: #1a1f29; border-color: #006E4E; }

.pt-view-nav {
  display: inline-flex;
  border: 1px solid #d6dce4;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  height: 34px;
}

.pt-view-tab {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  height: 34px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: #006E4E;
  background: #fff;
  border: none;
  border-right: 1px solid #d6dce4;
  font-family: inherit;
  white-space: nowrap;
  line-height: 1;
  box-sizing: border-box;
}

/* Keep every tab (incl. Research / Options) the same brand green + weight — visited/
   unvisited defaults and nested PRO chips must not recolor the label. */
.pt-view-tab:link,
.pt-view-tab:visited,
.pt-view-tab:hover,
.pt-view-tab:active {
  color: #006E4E;
  font-weight: 600;
}

.pt-view-tab:last-child { border-right: none; }

.pt-view-tab.active {
  background: #e8f7ef;
  color: #00563d;
  pointer-events: none;
}
.pt-view-tab.active:link,
.pt-view-tab.active:visited,
.pt-view-tab.active:hover {
  color: #00563d;
}

.pt-view-tab:not(.active):hover { background: #f7f9fb; }

/* Preview-only rooms (Research / Options primary tabs + News under More).
   Default HIDDEN; boot script adds html.is-preview on non-production hosts. */
.pt-feature-tab { display: none !important; }
html.is-preview .pt-feature-tab { display: inline-flex !important; }

/* More dropdown — preview only (News; Research/Options are primary tabs). */
.pt-more {
  position: relative;
  display: none !important;
  align-items: stretch;
  flex: 0 0 auto;
}
html.is-preview .pt-more.pt-feature-tab { display: inline-flex !important; }
.pt-more-btn {
  border-right: none;
  cursor: pointer;
  font-family: inherit;
}
.pt-more-btn::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  vertical-align: 1px;
  opacity: 0.7;
}
.pt-more.is-open .pt-more-btn {
  background: #e8f7ef;
  color: #00563d;
}
.pt-more-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 168px;
  background: #fff;
  border: 1px solid #d6dce4;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  padding: 6px;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pt-more-menu[hidden] { display: none !important; }
.pt-more-menu a,
.pt-more-menu span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #006E4E;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
}
.pt-more-menu a:hover { background: #f7f9fb; }
.pt-more-menu span.on,
.pt-more-menu a[aria-current="page"] {
  background: #e8f7ef;
  color: #00563d;
  pointer-events: none;
}

/* Preview: More menu must not clip under overflow. */

/* Preview: More menu must not clip under overflow. */
html.is-preview .pt-nav-slot,
html.is-preview .pt-nav-slot .pt-view-nav,
html.is-preview .pt-view-nav {
  overflow: visible !important;
}
html.is-preview .pt-more.is-open { z-index: 10040; }
html.is-preview .pt-nav-slot {
  max-width: min(78vw, 760px);
  position: relative;
  z-index: 40;
}

/* Coach toggle — preview only. Never show on jagsim.com / www. */
#coachSlot,
.coach-toggle-row,
#coachPanel { display: none !important; }
html.is-preview #coachSlot { display: block !important; }
html.is-preview .coach-toggle-row { display: flex !important; }
html.is-preview #coachPanel.is-open { display: block !important; }

/* Header Coach Jag + soft Pro cards — PREVIEW ONLY. Hard-kill on production. */
html:not(.is-preview) [data-coach-header],
html:not(.is-preview) #coachHeaderSlot,
html:not(.is-preview) .sim-coach-btn,
html:not(.is-preview) .coachjag-fab,
html:not(.is-preview) #coachjagFab,
html:not(.is-preview) .jag-pro-upsell,
html:not(.is-preview) #hubProUpsell,
html:not(.is-preview) #holdingsProUpsell,
html:not(.is-preview) .coachjag-panel,
html:not(.is-preview) .coachjag-tour-bubble,
html:not(.is-preview) .coachjag-tour-backdrop,
html:not(.is-preview) .coachjag-tut {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  left: -9999px !important;
}

/* Header Coach Jag + soft Pro cards — preview only until owner unlocks. */
html:not(.is-preview) [data-coach-header],
html:not(.is-preview) #coachHeaderSlot,
html:not(.is-preview) .sim-coach-btn,
html:not(.is-preview) .coachjag-fab,
html:not(.is-preview) #coachjagFab,
html:not(.is-preview) .jag-pro-upsell,
html:not(.is-preview) #hubProUpsell,
html:not(.is-preview) #holdingsProUpsell {
  display: none !important;
}

/* Canonical PRO chip on Research / Options tabs — one style site-wide. Soft
   green fill + green ink (matches hub pills / design system; not solid white-on-green
   and not outline-only). */
.pt-nav-pro,
.pt-tab-pro {
  display: inline-block;
  margin-left: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.4;
  padding: 1px 5px;
  border-radius: 4px;
  /* GOLD "PRO" badge (owner 2026-08-08): premium gold, not green, so Pro features read as paid. */
  background: #fbf4dd;
  color: #9c6f00;
  border: 1px solid #e6cf83;
  vertical-align: middle;
  box-sizing: border-box;
}

/* Status / meta row under the app bar (Hub + Holdings): every chip is the same
   pill — same size, weight, radius, separator style. No plain-text mix-ins. */
.disclaim-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.disclaim-row > .pill,
.disclaim-row > .market-status-pill,
.disclaim-row > .disclaim-note,
.disclaim-row > .mkt-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7480;
  background: #f7f9fb;
  border: 1px solid #e3e8ee;
  padding: 4px 9px;
  border-radius: 4px;
  line-height: 1.35;
  box-sizing: border-box;
  margin: 0;
}
.disclaim-row .market-dot,
.disclaim-row .mkt-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

/* Three equal stat pills — Chart + Portfolio use identical markup.
   Must fit the stats column (≤320px) so they never cover Hub/Chart/Portfolio. */
.pt-stats {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  max-width: 320px;
  height: 40px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  box-sizing: border-box;
  flex-shrink: 1;
  min-width: 0;
}

.pt-stat-pill {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  max-width: none;
  height: 40px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  padding: 5px 8px;
  background: #f7f9fb;
  border: 1px solid #e3e8ee;
  border-radius: 6px;
  flex-shrink: 1;
}

.pt-stat-pill .pt-stat-k {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7480;
  line-height: 1;
}

.pt-stat-pill .pt-stat-v {
  font-size: 11px;
  font-weight: 700;
  color: #1a1f29;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pt-stat-pill--pnl.pt-stat-pill--up .pt-stat-v { color: #117a37; }
.pt-stat-pill--pnl.pt-stat-pill--down .pt-stat-v { color: #b4232a; }
.pt-stat-pill .pt-stat-v.pos { color: #117a37; }
.pt-stat-pill .pt-stat-v.neg { color: #b4232a; }

/* Legacy single-strip stats (hub etc.) */
.hud-pnl-equity.pt-stats-compact {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: none;
  flex-shrink: 0;
  min-width: 0;
  box-sizing: border-box;
}

.pt-stat,
.hud-pnl-equity.pt-stats-compact .hud-stat-line {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  align-items: flex-start;
  white-space: nowrap;
  min-width: 0;
}

.pt-stat-k,
.hud-pnl-equity.pt-stats-compact .hud-stat-lbl {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7480;
  line-height: 1;
  font-family: 'Inter', sans-serif;
}

.pt-stat-v,
.hud-pnl-equity.pt-stats-compact .hud-equity,
.hud-pnl-equity.pt-stats-compact .hud-pnl-val,
.hud-pnl-equity.pt-stats-compact .hud-cash-val {
  font-size: 13px;
  font-weight: 700;
  color: #1a1f29;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  font-family: 'Inter', sans-serif;
}

.pt-stat-v.pos,
.hud-pnl-equity.pt-stats-compact .hud-stat-line--pnl.hud-pnl-up .hud-pnl-val { color: #117a37; }

.pt-stat-v.neg,
.hud-pnl-equity.pt-stats-compact .hud-stat-line--pnl.hud-pnl-down .hud-pnl-val { color: #b4232a; }

[data-sim-header-auth] {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-shrink: 1;
}

/* Header control pills (Report / Settings / Sign out) are now unified in
   auth-modal.js via CSS custom properties and already read correctly on the
   light Paper Trading shell (white bg, dark ink). The old per-mode !important
   overrides here duplicated — and fought with — that spec (they also forced
   Report to stay red). Removed so there is one source of truth; Sign-out keeps
   its red destructive hover from the base spec. Only the Sign-out sizing floor
   and the user-name ink fix (which the light shell still needs) remain. */
body.paper-trading .sim-signout-btn,
body.paper-trading #sim-signout-btn,
body.invest-mode .sim-signout-btn,
body.invest-mode #sim-signout-btn {
  flex-shrink: 0;
}

body.paper-trading [data-sim-header-auth] #sim-user-name,
body.invest-mode [data-sim-header-auth] #sim-user-name,
body.paper-trading .sim-user-name,
body.invest-mode .sim-user-name {
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* Light Paper Trading header: the name span inherits a near-white color
     (#e2e8f0) which is invisible on the light shell. Force a dark readable ink.
     Targets the .sim-user-name CLASS — the element has no #sim-user-name id. */
  color: #1a1f29 !important;
}

/* Page shell — footer pinned to bottom */
.pt-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f4f6f8;
}

.pt-main {
  flex: 1 0 auto;
  width: 100%;
}

.pt-wrap {
  max-width: 1480px;
  margin: 0 auto;
  padding: 22px 24px 32px;
  width: 100%;
  box-sizing: border-box;
}

.pt-layout {
  display: grid;
  /* Side board: fits full trader names (≤20 chars) + Value + Return.
     Badges sit under the name so they never ellipsize it to "g…". */
  grid-template-columns: minmax(0, 1fr) minmax(440px, 480px);
  gap: 22px;
  align-items: stretch;
}

.pt-col-main { min-width: 0; }

.pt-col-side {
  position: sticky;
  top: 68px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.pt-lb-panel {
  background: #ffffff;
  border: 1px solid #e4e8ee;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 680px;
}

.pt-lb-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid #e4e8ee;
  background: #f7f9fb;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pt-lb-title {
  font-size: 16px;
  font-weight: 800;
  color: #1a1f29;
  margin: 0;
}

.pt-lb-meta {
  font-size: 11px;
  color: #8a93a0;
}

.pt-lb-scroll {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 620px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

/* Full-width compact leaderboard. NEVER set display:flex on <td> itself
   — that drops table-cell layout and breaks row borders. */
.pt-lb-panel .lb-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
}
.pt-lb-panel .lb-table th:nth-child(1),
.pt-lb-panel .lb-table td:nth-child(1) { width: 44px; }
.pt-lb-panel .lb-table th:nth-child(2),
.pt-lb-panel .lb-table td:nth-child(2) { width: auto; }
.pt-lb-panel .lb-table th:nth-child(3),
.pt-lb-panel .lb-table td:nth-child(3) { width: 100px; }
.pt-lb-panel .lb-table th:nth-child(4),
.pt-lb-panel .lb-table td:nth-child(4) { width: 84px; }
.pt-lb-panel .lb-table td,
.pt-lb-panel .lb-table th {
  border-bottom: 1px solid #e4e8ee;
  vertical-align: middle;
}
.pt-lb-panel .lb-table tbody tr:last-child td { border-bottom: none; }
/* Name + "View portfolio" pill on ONE line, name fully visible (never ellipsis). */
.pt-lb-panel .lb-table .td-name-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  max-width: 100%;
  overflow: visible;
  min-width: 0;
}
.pt-lb-panel .lb-table .td-uname {
  display: block;
  font-weight: 600;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  max-width: none;
}
.pt-lb-panel .lb-table .td-uname .lb-name-btn {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  max-width: none;
}
.pt-lb-panel .lb-table .td-name-meta {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.pt-lb-panel .lb-table .td-val,
.pt-lb-panel .lb-table .td-ret {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pt-lb-fade {
  /* Disabled 20260723e: overlay washed the last visible Top Portfolios row
     light-gray (looked like a muted/dormant trader at ~#13/#14). Keep the
     element for DOM compat but never paint it. Scroll hint text remains. */
  display: none !important;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36px;
  background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.98));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.pt-lb-fade.show { opacity: 0; display: none !important; }

.pt-lb-panel .lb-table td,
.pt-lb-panel .lb-table th {
  padding-top: 11px;
  padding-bottom: 11px;
}

.pt-footer {
  flex-shrink: 0;
  margin-top: auto;
  width: 100%;
  border-top: 1px solid #e4e8ee;
  background: #ffffff;
  padding: 16px 24px;
  font-size: 11px;
  color: #8a93a0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  box-sizing: border-box;
}

.pt-footer a { color: #6b7480; text-decoration: none; }
.pt-footer a:hover { color: #1a1f29; }

.pt-footer-disc {
  flex: 1;
  min-width: 200px;
  margin: 0;
  line-height: 1.5;
}

@media (max-width: 960px) {
  .pt-layout {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  /* Never sticky-overlay the main hub column on phones. */
  .pt-col-side {
    position: static !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    z-index: auto !important;
    align-self: stretch;
  }
  .pt-col-main { min-width: 0; width: 100%; }
  .pt-lb-panel { max-height: none; width: 100%; }
  .pt-lb-scroll { max-height: 420px; overflow-x: auto; }
  .pt-wrap { overflow-x: clip; max-width: 100%; }
}


/* Hide empty spacer centers; keep Coach mount. */
.pt-appbar-center:not([data-coach-header]):not(:has(.sim-coach-btn)) { display: none !important; }

/* Reserved FIXED mid-header Coach slot — absolute center so stats/auth never shift it.
   PREVIEW ONLY — on production this absolute slot yanked the flex spacer and left Sign out mid-bar. */
@media (min-width: 901px) {
  html.is-preview .pt-appbar [data-coach-header],
  html.is-preview .pt-appbar #coachHeaderSlot,
  html.is-preview body.invest-mode #stickyHud [data-coach-header],
  html.is-preview body.invest-mode #stickyHud #coachHeaderSlot,
  html.is-preview body.invest-mode #stickyHud .header-center[data-coach-header] {
    position: absolute !important;
    left: 50% !important;
    top: 0 !important;
    bottom: 0 !important;
    transform: translateX(-50%) !important;
    width: 152px !important;
    min-width: 152px !important;
    max-width: 152px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: none !important;
    order: unset !important;
    overflow: visible !important;
    z-index: 220 !important;
    pointer-events: none;
  }
  html.is-preview .pt-appbar [data-coach-header] .sim-coach-btn,
  html.is-preview .pt-appbar #coachHeaderSlot .sim-coach-btn,
  html.is-preview body.invest-mode #stickyHud [data-coach-header] .sim-coach-btn,
  html.is-preview body.invest-mode #stickyHud #coachHeaderSlot .sim-coach-btn {
    pointer-events: auto;
    width: 136px;
    justify-content: center;
    color: #E86B1F !important;
    background: #ffffff !important;
    border-color: #E86B1F !important;
    border: 1.5px solid #E86B1F !important;
  }
  html.is-preview .pt-appbar [data-coach-header] .sim-coach-btn .cj-fab-label,
  html.is-preview body.invest-mode #stickyHud [data-coach-header] .sim-coach-btn .cj-fab-label {
    color: #E86B1F !important;
  }
  html.is-preview .pt-appbar [data-coach-header] .sim-coach-btn .cj-fab-dot,
  html.is-preview body.invest-mode #stickyHud [data-coach-header] .sim-coach-btn .cj-fab-dot {
    background: #E86B1F !important;
  }
}

@media (max-width: 900px) {
  .pt-stats,
  .hud-pnl-equity.pt-stats-compact { display: none !important; }
  /* Two-row mobile appbar: logo+auth on row 1, FULL tab strip scrollable on row 2.
     Old single-row + overflow:hidden clipped "Holdings" to "Ho…" and fought Report/Settings. */
  .pt-appbar {
    padding: 6px 10px 8px;
    gap: 6px 8px;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    flex-wrap: wrap;
    align-items: center;
  }
  /* Chart #stickyHud must wrap like .pt-appbar. Fixed 88px + nowrap left the
     header border-bottom cutting through the mobile search input (~390px). */
  body.invest-mode #stickyHud {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    flex-wrap: wrap !important;
    overflow: visible !important;
    padding: 6px 10px 8px !important;
    gap: 6px 8px !important;
    align-items: center !important;
  }
  body.invest-mode #stickyHud .pt-appbar-center,
  body.invest-mode #stickyHud .header-center {
    display: flex !important;
    order: 4;
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    justify-content: center;
    align-items: center;
    padding: 6px 0 8px !important;
    margin: 0 !important;
    border: none !important;
    position: relative !important;
    z-index: 3 !important;
    isolation: isolate !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }
  body.invest-mode #stickyHud #symbolSearch,
  body.invest-mode #stickyHud .symbol-input {
    width: min(420px, 100%);
    max-width: 420px;
    margin: 0 auto;
    position: relative;
    z-index: 4;
    box-sizing: border-box !important;
    min-height: 40px !important;
    height: 40px !important;
    padding: 0 14px !important;
    line-height: 40px !important;
    border: 1px solid #cfd6df !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    background: #ffffff !important;
    background-image: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    transform: translateZ(0);
  }
  /* One hairline under the FULL wrapped header — never border-bottom on the
     88px box or .header-center (that drew a line through the search input). */
  body.invest-mode #stickyHud {
    border-bottom: none !important;
    box-shadow: 0 1px 0 0 #e4e8ee !important;
  }
  body.invest-mode #stickyHud:has(+ #cryptoOpenBanner.is-shown) {
    box-shadow: none !important;
  }
  body.invest-mode #stickyHud:has(+ #cryptoOpenBanner.is-shown) .pt-appbar-center,
  body.invest-mode #stickyHud:has(+ #cryptoOpenBanner.is-shown) .header-center {
    padding-bottom: 4px !important;
  }
  body.invest-mode #stickyHud.app-header {
    border-top: none !important;
  }
  body.invest-mode #cryptoOpenBanner.is-shown {
    border-top: none;
  }
  /* Logo stays readable on mobile (desktop is 56px; 32px was illegible in ads). */
  .pt-brand-logo { height: 44px !important; max-height: 44px; width: auto !important; }

  /* Hub/Holdings: hide empty spacer centers; keep Coach header mount visible. */
  .pt-appbar-center:not([data-coach-header]):not(:has(.sim-coach-btn)) { display: none !important; }
  .pt-appbar-center[data-coach-header],
  #coachHeaderSlot {
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 152px;
    min-width: 152px;
    max-width: 152px;
    position: relative !important;
    left: auto !important;
    transform: none !important;
    pointer-events: auto;
  }
  .pt-appbar-center[data-coach-header] .sim-coach-btn,
  #coachHeaderSlot .sim-coach-btn {
    color: #E86B1F !important;
    background: #ffffff !important;
    border-color: #E86B1F !important;
    border: 1.5px solid #E86B1F !important;
  }
  .pt-appbar-center[data-coach-header] .sim-coach-btn .cj-fab-label,
  #coachHeaderSlot .sim-coach-btn .cj-fab-label { color: #E86B1F !important; }
  .pt-appbar-center[data-coach-header] .sim-coach-btn .cj-fab-dot,
  #coachHeaderSlot .sim-coach-btn .cj-fab-dot { background: #E86B1F !important; }
  .pt-appbar-left {
    order: 1;
    gap: 6px;
    flex: 0 1 auto; /* never steal space from Log In / Sign Up */
    min-width: 0;
    max-width: 42%;
  }
  .pt-nav-slot {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .pt-nav-slot::-webkit-scrollbar { display: none; }
  .pt-nav-slot .pt-view-nav {
    display: inline-flex;
    width: max-content;
    max-width: none;
  }
  .pt-stats-slot { display: none; }
  .pt-auth-slot {
    order: 2;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    padding-left: 4px;
    padding-right: 0;
    max-width: none;
    width: auto;
    flex: 0 0 auto; /* pinned — always fully visible */
    margin-left: auto;
    border-left: none;
  }
  /* Mobile: hide name text; keep Report + icon-only Sign out + settings */
  .pt-auth-slot .sim-user-name { display: none !important; }
  .pt-auth-slot .sim-signout-btn .signout-label { display: none !important; }
  /* Mobile tap targets ~40px (Apple/Google guidance is ≥44px; 40 fits the
     compact app bar without clipping). Bumped up from 32px. */
  .pt-auth-slot .sim-signout-btn {
    display: inline-flex !important;
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
  }
  .pt-auth-slot .sim-help-btn {
    padding: 0 10px;
    height: 40px;
    font-size: 11px;
    min-width: 40px;
  }
  .pt-auth-slot .sim-user-avatar { width: 26px; height: 26px; font-size: 12px; }
  .pt-auth-slot .sim-settings-btn { font-size: 16px; padding: 4px 6px; min-width: 40px; min-height: 40px; }
  /* Back button: compact + shorten text on mobile */
  .pt-back { font-size: 11px; padding: 4px 8px; }
  .pt-back { font-size: 0 !important; }
  .pt-back::before { content: "← Switch"; font-size: 11px; font-weight: 600; }
  /* Nav tabs: never truncate mid-label — scroll the strip instead */
  .pt-view-tab {
    font-size: 13px;
    padding: 0 12px;
    white-space: nowrap;
    flex-shrink: 0;
    overflow: visible;
    text-overflow: clip;
  }
}

/* ── Positions / Orders / History tabs (Paper Trading chart) ─────────────────
   Dark-theme .poshist-tab rules bleed through on the light shell — inactive
   tabs were nearly invisible gray-on-gray. These override only in invest mode. */
body.invest-mode .poshist-tabs {
  padding: 0 0 10px;
  gap: 8px;
}

body.invest-mode .poshist-tab {
  background: #ffffff;
  border: 1px solid #c5d0de;
  color: #1e293b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

body.invest-mode .poshist-tab:hover:not(.active) {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

body.invest-mode .poshist-tab.active {
  color: #00563d;
  border-color: #006E4E;
  background: #e8f7ef;
  box-shadow: 0 0 0 1px rgba(0, 110, 78, 0.2);
}


/* Logged-in traders get the clean app chart, not the SEO marketing wall (that stays for search visitors). */
html.is-signed-in .seo-blurb, html.is-signed-in .seo-related { display:none !important; }

/* Signed-OUT visitors on a public stock page don't need the in-app nav (Chart / Hub /
   Holdings just bounce them to a login wall, which is confusing). Hide the whole view-nav
   for logged-out visitors; logged-in users still get it to jump back into the app. The
   "← JagSim" back link + Log In / Sign Up in the header remain the clear paths out. */
html:not(.is-signed-in) .pt-view-nav .pt-view-tab { display: none !important; }
html:not(.is-signed-in) .pt-nav-slot { pointer-events: none; }

/* ─── PHONES: auth always visible; tabs on their own scrollable row (≤900px) ─
   Sign-up must never leave the screen. Leaderboard scrolls sideways in-box. */
@media (max-width: 700px) {
  .pt-auth-slot .sim-signup-btn-pill {
    padding: 0 10px !important;
    font-size: 12.5px !important;
    white-space: nowrap;
    max-width: none;
  }
  .pt-auth-slot .sim-login-btn {
    padding: 0 8px !important;
    font-size: 12.5px !important;
    white-space: nowrap;
  }
  /* Thumbs need something to hit: 40px minimum on the auth controls. */
  .pt-auth-slot .sim-signup-btn-pill,
  .pt-auth-slot .sim-login-btn { min-height: 40px; display: inline-flex; align-items: center; }

  /* The leaderboard table is 423px wide against a 375px screen, and its wrapper
     was overflow-x:hidden -- so the right-hand columns were CLIPPED with no way
     to reach them. Let it scroll sideways inside its own box instead. The page
     itself still never scrolls sideways. (measured 2026-07-20) */
  .pt-lb-scroll { overflow-x: auto; }

  /* Tab strip: 38px is the smallest a thumb reliably hits without mis-taps. */
  .pt-view-tab { min-height: 38px; display: inline-flex; align-items: center; }
}
@media (max-width: 430px) {
  .pt-view-tab { padding: 0 10px !important; font-size: 13px !important; }
  .pt-auth-slot .sim-login-btn { padding: 0 7px !important; font-size: 12px !important; }
  /* Shorter CTA label so both buttons fit on a 390px phone next to the logo */
  .pt-auth-slot .sim-signup-btn-pill { font-size: 0 !important; padding: 0 11px !important; }
  .pt-auth-slot .sim-signup-btn-pill::after {
    content: "Sign up";
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.01em;
  }
}

/* ── Mobile baseline (2026-07-31) ──────────────────────────────────────────
   iOS Safari auto-zooms a focused input whose font-size is under 16px, which then
   scrolls the viewport and cuts the header/nav/content off the left edge (owner bug,
   recurring). Force 16px on every input at phone widths + guard horizontal overflow.
   Lives in the shared shells so every page that loads one inherits it. */
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px !important; }
  html, body { overflow-x: hidden; max-width: 100%; }
}

/* ── Tap targets (mobile) ───────────────────────────────────────────────────
   Interactive chips, pills, toggles, tabs and small buttons get a 40px touch
   floor so phone taps do not miss. min-height only lifts, never shrinks, so
   controls already >=40px are untouched. Shared here so JS-injected components
   (same class names) inherit it too. */
@media (max-width: 640px) {
  .chip, .pill, .tool-btn, .seg-btn, .poshist-tab, .iwl-chip, .tf-btn,
  [role="switch"], [role="tab"], [role="button"] {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Go Pro is monetization: preview-only, HIDDEN on production until launch (like .pt-feature-tab). */
.pt-view-tab.pt-gopro{display:none!important}
html.is-preview .pt-view-tab.pt-gopro{display:inline-flex!important;align-items:center;color:#fff!important;background:#BB5C2D;border-radius:8px;font-weight:800;padding:6px 12px!important;margin-left:2px}
html.is-preview .pt-view-tab.pt-gopro:hover{background:#a04f26}
/* Never upsell a Pro user: hide "Go Pro" once entitlement.js stamps html.is-pro (server-truthful). */
html.is-pro .pt-view-tab.pt-gopro{display:none!important}
