/* Prop Pilot UI Foundation / Review pass 1
   Dark graphite + deep crimson; logo SVGs and model logic are unchanged.
   Canonical UI tokens live here until the visual system is approved. */
:root {
  --pp-bg: #0b0d12;
  --pp-surface: #171a22;
  --pp-surface-raised: #20242e;
  --pp-surface-deep: #11141b;
  --pp-border: #323743;
  --pp-border-soft: #292e39;
  --pp-text: #f5f5f7;
  --pp-muted: #acb0bd;
  --pp-subtle: #8e94a3;
  --pp-red: #c9273d;
  --pp-red-hover: #e03750;
  --pp-red-glow: rgba(201, 39, 61, 0.14);
  --pp-positive: #60d7b2;
  --pp-warning: #f0c474;
  --pp-negative: #ff9ca9;
  --pp-info: #8fc9ff;
  color-scheme: dark;
  background: var(--pp-bg);
  color: var(--pp-text);
}
html { scrollbar-color: #434955 var(--pp-bg); }
body { background: var(--pp-bg); color: var(--pp-text); -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1220px; }
.top { padding-block: 6px 3px; margin-bottom: 24px; }
.badge { color: var(--pp-subtle); }
.logo { color: var(--pp-text); letter-spacing: -0.035em; }
.muted, .field label, .kv div:nth-child(odd) { color: var(--pp-muted); }
.foot { color: var(--pp-subtle); }
h1, h2, h3 { color: var(--pp-text); letter-spacing: -0.018em; }
h1 { line-height: 1.15; }
h2, h3 { line-height: 1.25; }
.card, .auth {
  background: var(--pp-surface);
  border: 1px solid var(--pp-border);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.11);
}
.card { padding: clamp(16px, 2.3vw, 24px); }
.metric, .summaryCell, .legMetric, .liveAdviceMetric, .modelLine, .builderSummary {
  background: var(--pp-surface-deep);
  border: 1px solid var(--pp-border-soft);
}
.metric { border-radius: 14px; }
.metric b { color: var(--pp-text); font-variant-numeric: tabular-nums; }
.summaryLabel, .summaryHelp, .liveAdviceNote { color: var(--pp-muted); }
.summaryValue { color: var(--pp-text); font-variant-numeric: tabular-nums; }
.liveAdvice, .comboCall, .notice {
  background: var(--pp-surface-deep);
  border: 1px solid var(--pp-border);
}
.dangerNotice { background: #291319; border-color: #7d3541; }
.explainBox summary { color: var(--pp-text); }
.explainBox summary:hover { color: var(--pp-red-hover); }
.positionCard, .status, .market, .position, .leg, .builderLeg { border-bottom-color: var(--pp-border-soft); }
.legs { border-left-color: var(--pp-border); }
.liveAdviceReason, .builderSelected { color: #d6d9e0; }
.modelEdge.pos, .positive, .ok, .liveTag, .decisionChip.good { color: var(--pp-positive); }
.modelEdge.neg, .negative, .error, .decisionChip.bad { color: var(--pp-negative); }
.warn, .decisionChip.warn { color: var(--pp-warning); }
.builderBig { color: var(--pp-positive); }
.gameTag, .positionKicker { color: var(--pp-muted); }
.liveDot { background: var(--pp-positive); }
.ask { color: var(--pp-text); }
.nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #444956 transparent;
  padding: 2px 0 9px;
  margin-bottom: 16px;
}
.nav button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 11px 15px;
  background: var(--pp-surface);
  color: var(--pp-muted);
  border: 1px solid var(--pp-border);
  border-radius: 11px;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.nav button:hover { background: var(--pp-surface-raised); color: var(--pp-text); }
.nav button.active, .nav button[aria-selected="true"] {
  color: var(--pp-text);
  background: var(--pp-red-glow);
  border-color: var(--pp-red);
  box-shadow: inset 0 -2px var(--pp-red);
}
.btn {
  min-height: 44px;
  background: var(--pp-red);
  color: #fff;
  border: 1px solid var(--pp-red);
  border-radius: 11px;
  font: inherit;
  font-weight: 800;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.btn:hover:not(:disabled) { background: var(--pp-red-hover); border-color: var(--pp-red-hover); }
.btn.secondary, .btn.link {
  background: var(--pp-surface-raised);
  border: 1px solid var(--pp-border);
  color: var(--pp-text);
}
.btn.secondary:hover:not(:disabled), .btn.link:hover:not(:disabled) {
  background: #303542;
  border-color: #585e6c;
}
.btn.danger { background: #441c25; border-color: #8b394a; color: #ffdce1; }
.btn.danger:hover:not(:disabled) { background: #602531; border-color: #b74759; }
.nav button:focus-visible, .btn:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--pp-red-hover);
  outline-offset: 3px;
}
.field input:not([type="checkbox"]), .field textarea,
.field select, .builderLeg select, .builderToolbar select {
  background: var(--pp-surface-deep);
  border-color: #454b59;
  color: var(--pp-text);
  min-height: 44px;
  border-radius: 11px;
}
.field input::placeholder, .field textarea::placeholder { color: var(--pp-subtle); }
.pill, .decisionChip.neutral { border-color: var(--pp-border); color: var(--pp-muted); }
.spinner { border-color: #505666; border-top-color: var(--pp-red); }
code { background: var(--pp-surface-deep); color: var(--pp-text); }
@media (max-width: 700px) {
  .wrap { padding: 14px; }
  .top { gap: 8px; margin-bottom: 18px; }
  .nav { margin-right: -14px; padding-right: 14px; }
  .nav button { font-size: 13px; }
  .card { border-radius: 15px; }
  .metric b { font-size: 22px; }
  .builderToolbar .field { min-width: min(260px, 100%); }
}
@media (prefers-reduced-motion: reduce) {
  .nav button, .btn { transition: none; }
}

/* Today dashboard: desktop overview + mobile-first progressive detail */
.today-heading { display:flex; justify-content:space-between; align-items:end; gap:18px; margin:6px 0 20px; }
.today-heading h1 { font-size:clamp(28px,3vw,36px); margin:7px 0 7px; }
.today-heading p { margin:0; max-width:680px; line-height:1.5; }
.today-overline { font-size:10px; font-weight:850; letter-spacing:.12em; color:var(--pp-subtle); text-transform:uppercase; }
.today-grid { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(330px,.8fr); gap:16px; align-items:start; }
.today-main, .today-side { display:grid; gap:16px; min-width:0; }
.today-grid .card { margin:0; min-width:0; }
.today-feature { border-top:2px solid var(--pp-red); }
.today-section-head { display:flex; justify-content:space-between; align-items:start; gap:12px; margin-bottom:14px; }
.today-section-head h2 { margin:5px 0 0; font-size:clamp(18px,2vw,22px); }
.today-section-head .btn { padding:9px 11px; font-size:12px; }
.today-state { flex:0 0 auto; font-size:11px; font-weight:700; color:#f5be86; border:1px solid #6c543c; background:#252018; padding:6px 10px; border-radius:999px; }
.today-feature > p { margin:0 0 15px; line-height:1.55; }
.today-empty { background:var(--pp-surface-deep); padding:15px 16px; border:1px solid var(--pp-border-soft); border-radius:13px; display:grid; gap:5px; }
.today-empty b { font-size:14px; color:var(--pp-text); }
.today-empty span { font-size:13px; color:var(--pp-muted); line-height:1.5; }
.today-actions { display:flex; flex-wrap:wrap; gap:9px; margin-top:16px; }
.today-actions .btn { font-size:12px; }
.today-positions .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
.today-positions .metric { margin:0; padding:12px; }
.today-positions .metric b { font-size:clamp(18px,2vw,23px); line-height:1.25; overflow-wrap:anywhere; }
.today-positions .metric > span { display:block; font-size:10px; line-height:1.3; letter-spacing:.04em; font-weight:750; min-height:25px; }
.today-positions .metric small { display:block; color:var(--pp-muted); line-height:1.35; margin-top:5px; }
.today-positions .today-actions .btn { width:100%; }
.today-game { display:flex; gap:12px; align-items:start; padding:13px 0; border-bottom:1px solid var(--pp-border-soft); }
.today-game:last-of-type { border-bottom:none; }
.today-game b { font-size:14px; color:var(--pp-text); }
.today-game .small { margin-top:4px; }
.today-game-dot { flex:0 0 auto; width:7px; height:7px; margin-top:7px; border-radius:50%; background:var(--pp-red); }
.today-market-card .market { overflow-wrap:anywhere; }
.today-market-card .ask { font-size:17px; color:var(--pp-text); }
.today-system { margin-top:16px; }
.today-system summary { cursor:pointer; font-weight:750; color:var(--pp-muted); padding:0; }
.today-system summary:hover { color:var(--pp-text); }
.today-system #security { margin-top:15px; }
@media (max-width:900px) {
  .today-grid { grid-template-columns:1fr; }
  .today-main, .today-side { gap:14px; }
}
@media (max-width:700px) {
  .today-heading { display:block; }
  .today-heading .btn { margin-top:13px; }
  .today-grid { gap:14px; }
  .today-section-head { align-items:start; flex-wrap:wrap; }
  .today-positions .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .today-actions .btn { flex:1 1 170px; }
}

/* Existing LIVE-EXIT-v1 actionable positions precede new recommendations. */
.today-alerts { display:grid; gap:9px; margin:0 0 20px; }
.today-alert-heading { display:flex; justify-content:space-between; align-items:center; gap:14px; }
.today-alert-heading strong { font-size:17px; color:var(--pp-text); }
.today-alert-heading span { font-size:11px; color:var(--pp-muted); }
.today-alert {
 display:flex; align-items:center; justify-content:space-between; gap:14px;
 padding:15px 17px; background:#222028; border:1px solid #806440;
 border-left:3px solid var(--pp-warning); border-radius:14px;
}
.today-alert.urgent { background:#291a21; border-color:#924454; border-left-color:var(--pp-red-hover); }
.today-alert-copy { min-width:0; }
.today-alert-action { color:#ffcb89; font-size:11px; font-weight:900; letter-spacing:.10em; }
.today-alert.urgent .today-alert-action { color:#ff9ba9; }
.today-alert-title { color:var(--pp-text); font-weight:800; line-height:1.35; margin:5px 0; }
.today-alert-reason { color:#dde0e7; font-size:13px; line-height:1.48; }
.today-alert-value { color:#c5cad4; font-size:12px; line-height:1.4; margin-top:9px; }
.today-alert-value b { color:var(--pp-text); font-variant-numeric:tabular-nums; }
.today-alert-value span { color:var(--pp-muted); }
.today-alert .btn { flex:0 0 auto; font-size:12px; }
@media(max-width:700px) {
 .today-alert { flex-direction:column; align-items:stretch; }
 .today-alert .btn { width:100%; }
}


/* DESKTOP TRADING DESK UI
   One backend, distinct information density and navigation for wide screens. */
.pp-app-active .top,.pp-app-active .foot { display:none; }
.pp-app-active .wrap { max-width:none; margin:0; padding:0; }
.app-shell { display:grid; grid-template-columns:244px minmax(0,1fr); min-height:100dvh; }
.desktop-sidebar {
  position:sticky; top:0; height:100dvh; overflow-y:auto;
  display:flex; flex-direction:column; padding:28px 14px 18px;
  background:#111319; border-right:1px solid #2b303b; z-index:5;
}
.sidebar-brand { padding:6px 12px 27px; border-bottom:1px solid #303540; }
.sidebar-brand-wordmark { color:#f3f3f6; font-weight:900; font-size:22px; letter-spacing:.085em; line-height:1.2; }
.sidebar-brand-wordmark span { color:#d13a4d; }
.sidebar-brand-caption { margin-top:10px; color:#999fab; font-size:9px; font-weight:750; letter-spacing:.11em; }
.sidebar-workspace { display:flex; flex-wrap:wrap; align-items:center; gap:7px; margin:20px 11px 22px; color:#e1e2e8; font-size:10px; font-weight:800; letter-spacing:.04em; }
.sidebar-workspace>span:last-child { margin-left:21px; display:block; width:100%; color:#858b9b; font-size:9px; letter-spacing:.12em; }
.sidebar-signal-dot { width:7px; height:7px; background:#d54458; border-radius:50%; }
.sidebar-nav-group { color:#858b9b; padding:0 12px; margin:14px 0 9px; font-size:10px; font-weight:850; letter-spacing:.12em; }
.sidebar-links { display:grid; gap:3px; }
.sidebar-links button {
  appearance:none; display:grid; grid-template-columns:22px minmax(0,1fr) 10px;
  align-items:center; gap:9px; background:transparent; color:#aeb3c0;
  text-align:left; padding:12px 12px; border:0; border-left:3px solid transparent;
  border-radius:6px; font-size:13px; line-height:1.25; font-weight:700;
  font-family:inherit; cursor:pointer; transition:background-color 140ms ease,color 140ms ease;
}
.sidebar-links button:hover { background:#20242e; color:#f5f5f7; }
.sidebar-links button.active { background:#282027; border-left-color:#cc2e45; color:#fff; }
.sidebar-links button:focus-visible { outline:2px solid var(--pp-red-hover); outline-offset:2px; }
.side-nav-icon { color:#6f7685; font-size:10px; font-weight:800; font-variant-numeric:tabular-nums; }
.sidebar-links button.active .side-nav-icon { color:#f36e81; }
.side-nav-arrow { justify-self:end; font-size:17px; color:#737988; }
.sidebar-spacer { flex:1; min-height:18px; }
.sidebar-footer { border-top:1px solid #303540; margin:12px 9px 0; padding:17px 3px 6px; display:grid; gap:7px; font-size:11px; color:#858b9b; line-height:1.4; }
.sidebar-footer strong { color:#d0d4dd; font-size:10px; letter-spacing:.09em; }
.sidebar-footer>span:last-child { color:#6c7483; font-size:9px; margin-top:6px; font-weight:800; letter-spacing:.04em; }
.side-nav-indicator { width:7px; height:7px; border-radius:50%; background:#ba3651; }
.app-workspace { min-width:0; background:#0b0d12; }
.workspace-toolbar {
  position:sticky; top:0; z-index:4; min-height:64px;
  background:rgba(16,18,25,.97); border-bottom:1px solid #2b303b;
  display:flex; align-items:center; justify-content:space-between; gap:18px;
  padding:0 clamp(20px,2.2vw,38px);
}
.workspace-breadcrumb { display:flex; align-items:center; gap:12px; color:#7f8795; font-size:10px; font-weight:850; letter-spacing:.09em; white-space:nowrap; }
.workspace-breadcrumb b { color:#e3e5eb; }
.workspace-separator { color:#515968; }
.workspace-toolbar-right { display:flex; align-items:center; gap:16px; color:#a6adba; min-width:0; font-size:11px; }
.workspace-stage { border:1px solid #6d3340; background:#28181f; color:#f0a4b0; border-radius:3px; padding:5px 7px; font-weight:850; letter-spacing:.09em; font-size:9px; }
.workspace-connection { white-space:nowrap; font-size:10px; font-weight:800; letter-spacing:.05em; }
.workspace-account { color:#7d8594; font-size:11px; max-width:210px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.workspace-main { width:min(100%,1770px); margin:0 auto; padding:24px clamp(20px,2.2vw,38px) 42px; }
.mobile-nav { display:none; }
#today .today-heading { margin:0 0 18px; align-items:center; }
#today .today-heading h1 { margin:5px 0 4px; font-size:30px; font-weight:820; letter-spacing:-.035em; }
#today .today-heading p { font-size:12px; }
#today .today-heading .btn { min-height:35px; padding:8px 12px; font-size:12px; border-radius:6px; }
.terminal-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:0 0 16px; }
.terminal-kpi {
  background:#151820; border:1px solid #303541; border-radius:7px; padding:15px 17px;
  min-width:0; display:grid; gap:6px;
}
.terminal-kpi>span { color:#858c9b; font-size:10px; font-weight:850; letter-spacing:.11em; }
.terminal-kpi>strong { color:#f0f1f5; font-size:clamp(20px,2vw,28px); font-weight:820; font-variant-numeric:tabular-nums; line-height:1.1; overflow-wrap:anywhere; }
.terminal-kpi>small { color:#858b9b; font-size:10px; line-height:1.3; }
.terminal-kpi .terminal-kpi-mode { color:#e5e7ed; font-size:20px; letter-spacing:.015em; }
#today .today-grid { grid-template-columns:minmax(0,1.45fr) minmax(330px,.82fr); gap:14px; }
#today .today-main,#today .today-side { gap:14px; }
#today .card { padding:17px 18px; border-radius:7px; box-shadow:none; background:#151820; }
#today .today-section-head { margin-bottom:12px; }
#today .today-section-head h2 { font-size:17px; font-weight:780; margin:5px 0 0; letter-spacing:-.015em; }
#today .today-overline { font-size:9px; color:#969baa; font-weight:850; letter-spacing:.12em; }
#today .today-state { border-radius:4px; font-size:9px; padding:5px 7px; }
#today .btn { min-height:34px; font-size:11px; border-radius:5px; }
#today .today-feature { border-top:1px solid #70414b; }
#today .today-empty { background:#101319; border-radius:5px; padding:13px; }
#today .today-empty b { font-size:12px; }
#today .today-empty span { font-size:11px; }
#today .today-feature>p { color:#9ea6b2; font-size:12px; }
.terminal-table-explainer { margin-bottom:12px; line-height:1.45; }
.terminal-table-meta { color:#a8afbe; font-size:9px; font-weight:900; border:1px solid #3e4553; border-radius:4px; padding:5px 7px; white-space:nowrap; }
.terminal-scroll { overflow-x:auto; max-width:100%; scrollbar-width:thin; scrollbar-color:#404756 transparent; }
.desk-table { width:100%; border-spacing:0; border-collapse:collapse; text-align:left; font-size:11px; line-height:1.35; font-variant-numeric:tabular-nums; }
.desk-table th { color:#878d9d; background:#101219; font-size:9px; letter-spacing:.065em; font-weight:850; padding:11px 10px; border-bottom:1px solid #343945; text-align:left; white-space:nowrap; }
.desk-table td { padding:11px 10px; border-bottom:1px solid #292e38; color:#d8dce5; vertical-align:middle; }
.desk-table tbody tr:last-child td { border-bottom:0; }
.desk-table tbody tr:hover td { background:#1c202b; }
.desk-table td.number,.desk-table th.number { text-align:right; white-space:nowrap; font-weight:750; }
.desk-table td.positive { color:var(--pp-positive); }
.desk-table td.negative { color:var(--pp-negative); }
.desk-market-label { min-width:140px; max-width:340px; }
.desk-market-label b,.desk-market-label small { display:block; }
.desk-market-label b { color:#ebedf4; font-weight:730; overflow-wrap:anywhere; }
.desk-market-label small { color:#8a919f; font-size:10px; font-weight:500; margin-top:3px; word-break:break-word; }
.desk-confidence { display:inline-block; font-size:10px; color:#c7cbd5; font-weight:850; }
.desk-row-link { font:inherit; font-weight:740; color:#e9ebf1; appearance:none; border:0; background:transparent; text-align:left; padding:0; cursor:pointer; white-space:normal; }
.desk-row-link:hover { color:#f18da0; text-decoration:underline; }
.desk-row-link:focus-visible { outline:2px solid var(--pp-red-hover); }
.terminal-card-footer { display:flex; justify-content:space-between; align-items:center; gap:12px; border-top:1px solid #303540; padding-top:11px; margin-top:9px; }
.terminal-card-footer>span { color:#838b9c; font-size:10px; line-height:1.35; }
.terminal-more-rows { border-top:1px solid #303540; padding:10px; }
#today .today-held-intro { margin-bottom:11px; line-height:1.5; }
#today .today-market-card .small { font-size:11px; line-height:1.45; }
#today .today-game { border-bottom:1px solid #2e3340; padding:9px 0; gap:10px; }
#today .today-game b { font-size:12px; }
#today .today-game .small { font-size:10px; }
#today .today-game-dot { width:5px; height:5px; margin-top:6px; }
#today .today-system { margin-top:14px; }
#today .today-system summary { font-size:12px; }
.more-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.more-card { text-align:left; display:grid; gap:10px; padding:20px; border:1px solid #303541; background:#161922; border-radius:8px; cursor:pointer; color:#efeff4; font:inherit; }
.more-card span { color:#aa8c97; font-size:10px; font-weight:900; letter-spacing:.11em; }
.more-card strong { font-size:17px; }
.more-card small { color:#9ea4b1; line-height:1.4; }
.more-card:hover { border-color:#9b3446; background:#20212b; }
.more-card:focus-visible { outline:2px solid var(--pp-red-hover); outline-offset:3px; }
@media (min-width:960px) and (max-width:1230px) {
 .app-shell { grid-template-columns:218px minmax(0,1fr); }
 #today .today-grid { grid-template-columns:minmax(0,1.1fr) minmax(300px,.9fr); }
 .workspace-toolbar-right { gap:8px; }
 .workspace-account { max-width:120px; }
 .desk-table th,.desk-table td { padding:9px 7px; }
}
@media (max-width:959px) {
 .app-shell { display:block; min-height:100dvh; }
 .desktop-sidebar { display:none; }
 .app-workspace { min-height:100dvh; padding-bottom:calc(78px + env(safe-area-inset-bottom)); }
 .workspace-toolbar { position:relative; min-height:58px; padding:0 15px; }
 .workspace-breadcrumb>span:first-child,.workspace-separator { display:none; }
 .workspace-breadcrumb { letter-spacing:.035em; font-size:10px; }
 .workspace-toolbar-right { gap:9px; }
 .workspace-account { display:none; }
 .workspace-connection { font-size:9px; }
 .workspace-main { padding:18px 14px 22px; }
 .mobile-nav {
   position:fixed; bottom:0; left:0; right:0; z-index:50;
   display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:2px;
   background:#13161d; border-top:1px solid #3b414b;
   padding:7px 6px calc(8px + env(safe-area-inset-bottom)); margin:0;
   overflow:visible; box-shadow:0 -6px 20px rgba(0,0,0,.25);
 }
 .mobile-nav button {
   min-width:0; padding:5px 2px; min-height:49px;
   border:0; border-top:2px solid transparent; border-radius:3px;
   display:flex; align-items:center; justify-content:center; flex-direction:column; gap:4px;
   font-size:10px; font-weight:780; color:#959dac; background:transparent;
   box-shadow:none; white-space:nowrap;
 }
 .mobile-nav button:hover { background:#1c2029; }
 .mobile-nav button.active { border:0; border-top:2px solid var(--pp-red); color:#fff; background:#272029; box-shadow:none; }
 .mobile-nav-glyph { font-size:18px; line-height:1; font-weight:600; }
 #today .today-grid { grid-template-columns:1fr; }
 #today .today-research-card { display:none; }
 .terminal-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
 .terminal-kpi { padding:13px; }
 .terminal-kpi>strong { font-size:22px; }
 #today .card { padding:16px; }
 .more-grid { grid-template-columns:1fr; }
 .desk-table { font-size:11px; }
}
@media (max-width:430px) {
 .workspace-stage { display:none; }
 .workspace-breadcrumb { font-size:9px; }
 #today .today-heading h1 { font-size:27px; }
 .terminal-kpi>strong { font-size:20px; }
 .mobile-nav button { font-size:9px; }
}
@media (prefers-reduced-motion:reduce) {
 .sidebar-links button { transition:none; }
}
