/* First-screen cockpit density: keep decision controls above the fold even when the live feed is busy. */
@media (min-width:1181px){
  .app-shell{grid-template-columns:194px minmax(0,1fr)}
  .side-nav a{white-space:nowrap;font-size:16px;padding-left:13px;padding-right:10px}
  .overview-top{min-height:0;align-items:start;grid-template-columns:minmax(0,1.85fr) minmax(350px,.72fr);gap:12px}
  .core-panel{height:348px;min-height:348px;padding:6px 12px 10px}
  .brain-wrap{height:218px}
  .brain-svg{width:min(560px,67%)}
  .brain-floor{bottom:16px;width:300px;height:50px}
  .signal-field{top:72px;height:84px}
  .core-metrics{top:8px;right:11px}
  .market-cards{gap:8px}
  .market-card{height:94px;padding:10px 13px;grid-template-columns:1fr 78px}
  .market-card strong{font-size:26px;margin:4px 0 1px}
  .market-card span{font-size:14px}
  .market-card small{font-size:13px}
  .spark{width:74px;height:35px}

  .stream-panel{height:348px;min-height:348px;max-height:348px;padding:12px 15px;overflow:hidden;display:flex;flex-direction:column}
  .stream-panel .panel-heading{flex:0 0 auto;padding-bottom:9px}
  .stream-live{height:34px;flex:0 0 34px}
  .decision-stream{min-height:0;overflow-y:auto;overflow-x:hidden;padding-right:5px;scrollbar-width:thin;scrollbar-color:rgba(63,149,231,.42) transparent}
  .decision-stream::-webkit-scrollbar{width:5px}
  .decision-stream::-webkit-scrollbar-thumb{background:rgba(63,149,231,.42);border-radius:5px}
  .stream-row{min-height:50px;padding:7px 0;grid-template-columns:9px 66px 1fr}
  .stream-row span b{font-size:13px;line-height:1.38}
  .stream-row span small{font-size:11.5px;line-height:1.35;margin-top:2px}

  .chart-panel{margin-top:11px;min-height:390px;padding:14px 16px;gap:15px;grid-template-columns:minmax(0,1fr) 350px}
  .procurement-cockpit{margin-bottom:8px;padding:8px;gap:6px}
  .cockpit-title b{font-size:19px}
  .cockpit-metric{padding:5px 8px}
  .cockpit-metric strong{margin:3px 0 2px;font-size:16px}
  .cockpit-metric.primary strong{font-size:20px}
  .cockpit-metric small{font-size:11.5px}
  .chart-head{height:86px}
  .main-chart{height:205px}
  .decision-cards{grid-template-rows:76px 76px minmax(150px,1fr);gap:8px}
  .decision-card{padding:9px 12px}
  .decision-card.advice .advice-content>strong{font-size:22px}
}

@media (min-width:1181px) and (max-height:920px){
  .main-stage{padding-top:12px}
  .topbar{height:66px}
  .overview-top{gap:10px}
  .core-panel,.stream-panel{height:332px;min-height:332px;max-height:332px}
  .brain-wrap{height:205px}
  .market-card{height:91px}
  .chart-panel{margin-top:10px;min-height:374px}
  .main-chart{height:192px}
}

/* Live decision stream: continuous, readable, seamless upward movement. */
.decision-stream.auto-scroll{
  overflow:hidden!important;
  scrollbar-width:none;
  padding-right:5px;
  -webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 14px,#000 calc(100% - 16px),transparent 100%);
  mask-image:linear-gradient(to bottom,transparent 0,#000 14px,#000 calc(100% - 16px),transparent 100%);
}
.decision-stream.auto-scroll::-webkit-scrollbar{display:none}
.stream-scroll-track{will-change:transform;transform:translate3d(0,0,0)}
.stream-scroll-group{padding-bottom:10px}
.stream-scroll-clone{pointer-events:none}
.decision-stream.scroll-paused .stream-row{filter:brightness(1.06)}
.stream-row.critical{
  margin:2px 0;
  padding-left:6px;
  padding-right:5px;
  border-radius:7px;
  background:linear-gradient(90deg,rgba(255,92,92,.13),rgba(255,92,92,.025));
  box-shadow:inset 2px 0 0 rgba(255,104,104,.85);
}
.stream-row.critical span b{color:#ffb2b2}
.stream-row.stream-new{animation:decisionStreamNew 3.4s ease-out 1}
@keyframes decisionStreamNew{
  0%{background:rgba(49,196,255,.22);box-shadow:0 0 18px rgba(49,196,255,.22)}
  100%{background:transparent;box-shadow:none}
}
@media (prefers-reduced-motion:reduce){
  .decision-stream.auto-scroll{overflow-y:auto!important;-webkit-mask-image:none;mask-image:none}
  .stream-scroll-track{transform:none!important}
  .stream-scroll-clone{display:none}
  .stream-row.stream-new{animation:none}
}
