/*
 * NinjaTrading • Sparrow-inspired financial palette
 * Visual layer only. This is an independent NinjaTrading design, not Magpie CSS.
 * The pre-change app snapshot is stored under /state/appearance-backups/.
 * Loaded AFTER all existing styles so the desktop and mobile experiences use
 * one consistent set of finance colours without changing their layouts.
 */
:root,
html[data-theme="dark"] {
  --nt-canvas:#0b0c0f;
  --nt-surface:#191b20;
  --nt-paper:#1d2026;
  --nt-raised:#272a31;
  --nt-text:#f3f5f8;
  --nt-muted:#adb4c0;
  --nt-border:rgba(235,240,249,.12);
  --nt-input:#232630;
  --nt-accent:#d8c2a1;   /* retain NinjaTrading's restrained bronze identity */
  --nt-metal:#c7ad88;
  --nt-fin-blue:#8fc2eb;
  --nt-fin-blue-strong:#4c86b7;
  --nt-fin-blue-rgb:76,134,183;
  --nt-fin-up:#5fda95;
  --nt-fin-down:#f07c89;
  --nt-fin-chart:#6ab0e8;
  --nt-fin-grid:rgba(201,218,239,.17);
  --nt-fin-card:rgba(26,29,35,.90);
  --nt-fin-card-alt:rgba(34,38,47,.87);
  --nt-fin-spot:rgba(76,134,183,.15);
  --nt-fin-shadow:0 13px 32px rgba(0,0,0,.20);
}
html[data-theme="light"] {
  --nt-canvas:#f0f2f6;
  --nt-surface:#ffffff;
  --nt-paper:#f9fafc;
  --nt-raised:#e7edf5;
  --nt-text:#1b2029;
  --nt-muted:#626d7d;
  --nt-border:rgba(56,75,101,.17);
  --nt-input:#f6f8fb;
  --nt-accent:#7d6246;
  --nt-metal:#8b7050;
  --nt-fin-blue:#295c88;
  --nt-fin-blue-strong:#356f9d;
  --nt-fin-blue-rgb:76,134,183;
  --nt-fin-up:#177a51;
  --nt-fin-down:#bb3046;
  --nt-fin-chart:#397cac;
  --nt-fin-grid:rgba(50,79,111,.19);
  --nt-fin-card:rgba(255,255,255,.96);
  --nt-fin-card-alt:rgba(248,250,253,.97);
  --nt-fin-spot:rgba(76,134,183,.095);
  --nt-fin-shadow:0 11px 28px rgba(35,52,78,.065);
}
/* Cool atmospheric light above the page, not a saturated green/military surface. */
html body.dashboard-page,
html body.login-body {
  background:
    radial-gradient(ellipse 39rem 23rem at 18% -5%,var(--nt-fin-spot),transparent 83%),
    linear-gradient(180deg,rgba(var(--nt-fin-blue-rgb),.028),transparent 30rem),
    var(--nt-canvas)!important;
  color:var(--nt-text);
}
html .site-header,
html .dashboard-header {
  background:color-mix(in srgb,var(--nt-canvas) 88%,transparent)!important;
  border-color:var(--nt-border)!important;
}
@supports (backdrop-filter:blur(12px)){
  html .site-header, html .dashboard-header {
    backdrop-filter:saturate(125%) blur(15px);
    -webkit-backdrop-filter:saturate(125%) blur(15px);
  }
}
html .site-header .brand-symbol {border-color:var(--nt-metal)}
html .ninja-native-header .ninja-header-links a.active,
html .dashboard-header .ninja-header-links a.active,
html .ticker-tabs a.selected {
  color:var(--nt-fin-blue)!important;
}
html .ninja-native-header .ninja-header-links a:hover,
html .dashboard-header .ninja-header-links a:hover {
  color:var(--nt-text)!important;
}
html .ticker-tabs a.selected{
  border-color:rgba(var(--nt-fin-blue-rgb),.55);
  background:rgba(var(--nt-fin-blue-rgb),.12);
}
html .ninja-panel,
html .dashboard-sections article,
html .dojo-feature-card,
html .ticker-frame-wrap {
  background:var(--nt-fin-card);
  border-color:var(--nt-border);
  box-shadow:var(--nt-fin-shadow);
}
html .ninja-panel .ninja-tag,
html .ninja-note .ninja-tag {
  background:rgba(var(--nt-fin-blue-rgb),.10);
  color:var(--nt-fin-blue);
  border-color:rgba(var(--nt-fin-blue-rgb),.27);
}
html .ninja-quick-links a:hover,
html .ninja-small-button:hover {
  border-color:var(--nt-fin-blue)!important;
  color:var(--nt-fin-blue)!important;
}
/* Real gains and losses: never infer profit from an ordinary cash balance. */
html .ninja-dual-value[data-tone="positive"],
html .nt-period-card .ninja-dual-value[data-tone="positive"],
html .nt-journal-result .ninja-dual-value[data-tone="positive"],
html .nt-gain {color:var(--nt-fin-up)!important}
html .ninja-dual-value[data-tone="negative"],
html .nt-period-card .ninja-dual-value[data-tone="negative"],
html .nt-journal-result .ninja-dual-value[data-tone="negative"],
html .nt-loss {color:var(--nt-fin-down)!important}
html .ninja-dual-value[data-tone="neutral"]{color:var(--nt-text)}
html .nt-fin-info {color:var(--nt-fin-blue)!important}
/* Journal: neutral notes; cool blue source badges; only actual outcomes red/green. */
html .ninja-note,
html .ninja-note-form {
  background:var(--nt-fin-card);
  border-color:var(--nt-border);
}
html .ninja-note-form input:focus-visible,
html .ninja-note-form textarea:focus-visible,
html .ninja-upload-form input:focus-visible {
  outline:2px solid var(--nt-fin-blue-strong);
  outline-offset:2px;
}
html .ninja-history,
html .ninja-period,
html .ninja-format-grid .ninja-panel {
  background:var(--nt-fin-card);
}
html .ninja-history canvas,
html .nt-mobile-chart-box canvas {
  touch-action:pan-y;
}
html .nt-chart-inspector {
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:8px;
  font-size:12px;
  color:var(--nt-muted);
  padding:9px 0 0;
  min-height:30px;
}
html .nt-chart-inspector strong {
  font-size:13px;
  letter-spacing:.1px;
  font-variant-numeric:tabular-nums;
  color:var(--nt-fin-blue);
}
@media(max-width:800px){
  :root,
  html[data-theme="dark"]{
    --ntm-bg:#0b0c0f;
    --ntm-surface:#191b20;
    --ntm-elevated:#242832;
    --ntm-text:#f3f5f8;
    --ntm-muted:#b2b8c3;
    --ntm-soft:#929bab;
    --ntm-line:rgba(235,240,249,.13);
    --ntm-gold:#c7ad88;
    --ntm-accent:#8fc2eb;
    --ntm-green:#5fda95;
  }
  html[data-theme="light"]{
    --ntm-bg:#f0f2f6;
    --ntm-surface:#ffffff;
    --ntm-elevated:#eaf0f7;
    --ntm-text:#1b2029;
    --ntm-muted:#626d7d;
    --ntm-soft:#747f90;
    --ntm-line:rgba(56,75,101,.17);
    --ntm-gold:#896b48;
    --ntm-accent:#295c88;
    --ntm-green:#177a51;
  }
  html[data-nt-quiet="true"][data-theme="dark"]{
    --ntm-bg:#090a0c;
    --ntm-surface:#13161b;
    --ntm-elevated:#1c2028;
    --ntm-text:#dce3eb;
    --ntm-muted:#a3adbb;
    --ntm-soft:#8895a4;
    --ntm-line:rgba(220,229,243,.11);
    --ntm-gold:#b7a38c;
    --ntm-accent:#8cafcd;
    --nt-fin-spot:rgba(76,134,183,.065);
    --nt-fin-up:#74c69a;
    --nt-fin-down:#e98e98;
    --nt-fin-blue:#8cafcd;
  }
  html[data-nt-quiet="true"][data-theme="light"]{
    --ntm-bg:#eaedf1;
    --ntm-surface:#f9fafb;
    --ntm-elevated:#e4e9f0;
    --ntm-text:#28303b;
    --ntm-line:rgba(56,75,101,.16);
    --nt-fin-spot:rgba(76,134,183,.05);
  }
  html body.dashboard-page {
    background:
      radial-gradient(ellipse 31rem 25rem at 16% 0%,var(--nt-fin-spot),transparent 84%),
      var(--ntm-bg)!important;
  }
  html body.dashboard-page .site-header{
    background:color-mix(in srgb,var(--ntm-bg) 90%,transparent)!important;
  }
  html body.dashboard-page .nt-mobile-dock {
    background:color-mix(in srgb,var(--ntm-surface) 94%,transparent)!important;
    border-top-color:var(--ntm-line)!important;
  }
  html body.dashboard-page .nt-dock-link.is-active {
    color:var(--ntm-accent)!important;
    background:rgba(var(--nt-fin-blue-rgb),.15)!important;
  }
  html body.dashboard-page .nt-mobile-balance,
  html body.dashboard-page .nt-mobile-mini-stats>div,
  html body.dashboard-page .nt-period-card,
  html body.dashboard-page .nt-mobile-chart-box,
  html body.dashboard-page .nt-mobile-rows,
  html body.dashboard-page .nt-journal-card,
  html body.dashboard-page .nt-journal-compose,
  html body.dashboard-page .nt-research-card,
  html body.dashboard-page .nt-research-metric,
  html body.dashboard-page .nt-discovery-card,
  html body.dashboard-page .nt-portfolio-item,
  html body.dashboard-page .ninja-panel {
    background:var(--nt-fin-card)!important;
    border-color:var(--ntm-line)!important;
    box-shadow:0 9px 24px rgba(0,0,0,.09);
  }
  html body.dashboard-page .nt-mobile-balance {
    background:
      radial-gradient(circle at 95% 0%,rgba(var(--nt-fin-blue-rgb),.13),transparent 69%),
      var(--nt-fin-card)!important;
  }
  html body.dashboard-page .nt-mobile-balance::before{
    background:linear-gradient(90deg,var(--nt-fin-blue-strong),rgba(var(--nt-fin-blue-rgb),.10))!important;
  }
  html body.dashboard-page .nt-balance-dot {
    background:var(--nt-fin-blue-strong)!important;
    box-shadow:0 0 0 4px rgba(var(--nt-fin-blue-rgb),.11);
  }
  html body.dashboard-page .nt-inline-action,
  html body.dashboard-page .nt-text-button,
  html body.dashboard-page .nt-text-link,
  html body.dashboard-page .nt-mobile-shortcuts a span {
    color:var(--ntm-accent)!important;
  }
  html body.dashboard-page .nt-mobile-rows,
  html body.dashboard-page .nt-journal-card,
  html body.dashboard-page .nt-research-card {
    backdrop-filter:blur(8px);
    -webkit-backdrop-filter:blur(8px);
  }
  html body.dashboard-page .nt-ticker-dot,
  html body.dashboard-page .nt-activity-symbol{
    color:var(--nt-fin-blue)!important;
    border-color:rgba(var(--nt-fin-blue-rgb),.25)!important;
    background:rgba(var(--nt-fin-blue-rgb),.12)!important;
  }
  html body.dashboard-page .nt-journal-card-head span,
  html body.dashboard-page .nt-research-metric>span{
    color:var(--ntm-accent)!important;
  }
  html body.dashboard-page .nt-portfolio-quote,
  html body.dashboard-page .nt-mobile-note-form input,
  html body.dashboard-page .nt-mobile-note-form textarea{
    background:var(--ntm-elevated)!important;
    border-color:var(--ntm-line)!important;
  }
  html body.dashboard-page .nt-mobile-chart-box {
    padding:14px 14px 11px!important;
  }
  html body.dashboard-page .nt-quick-hero {
    background:
      radial-gradient(circle at 90% 0%,rgba(var(--nt-fin-blue-rgb),.17),transparent 70%),
      var(--ntm-elevated)!important;
  }
  html body.dashboard-page .nt-dock-link svg {stroke-width:1.8}
}
@media(prefers-reduced-transparency:reduce){
  html body.dashboard-page .nt-mobile-rows,
  html body.dashboard-page .nt-journal-card,
  html body.dashboard-page .nt-research-card {
    backdrop-filter:none;
    -webkit-backdrop-filter:none;
  }
}
