/* Mobile information architecture: progressive disclosure without destroying state. */
.mobile-nav,.mobile-sheet,.mobile-card-toggle,.mobile-top{display:none}
@media(max-width:760px){
  body{padding-bottom:74px}.topbar{height:58px;padding:7px 10px;flex-wrap:nowrap}.topbar .brand{font-size:18px}
  /* Section navigation on mobile lives in the bottom .mobile-nav + sheet. The top .nav used
     to wrap into extra rows that spilled OVER the page content (the sticky bar keeps
     height:58px), overlapping titles — hide it and let the action pills scroll instead. */
  .topbar .nav{display:none}.topbar .right{gap:5px;margin-left:auto;min-width:0;overflow-x:auto;scrollbar-width:none}.topbar .right::-webkit-scrollbar{display:none}.topbar .right .pill:not(#status-pill){min-width:40px;min-height:40px;justify-content:center;padding:7px}.lang-select{max-width:64px;min-height:40px}
  .wrap{padding-top:14px;padding-bottom:92px}.stepper{overflow-x:auto;justify-content:flex-start;scroll-snap-type:x proximity;scrollbar-width:none;padding-bottom:7px}.stepper::-webkit-scrollbar{display:none}.stepper .step{flex:0 0 auto;scroll-snap-align:start;min-height:40px}.section-head{margin-bottom:12px}.section-head h2{font-size:21px}.section-head p{font-size:12.5px}
  .grid{gap:12px}.card{position:relative;border-radius:13px;padding:15px}.card h4,.cell-viz-head{padding-right:42px;min-height:34px}.card.mobile-collapsed{padding-bottom:10px;background:linear-gradient(145deg,var(--panel2),var(--panel));box-shadow:none}.card.mobile-collapsed>:not(h4):not(.cell-viz-head):not(.mobile-card-toggle){display:none!important}.card.mobile-collapsed>.cell-viz-head>:not(h4):not(.mobile-card-toggle){display:none!important}.card.mobile-collapsed h4,.card.mobile-collapsed .cell-viz-head h4{margin-bottom:0!important;color:var(--txt2)}
  .mobile-card-toggle{display:grid;place-items:center;position:absolute;right:10px;top:10px;width:34px;height:34px;border:1px solid var(--line2);border-radius:9px;background:var(--panel2);color:var(--txt2);z-index:4;font-size:16px}.mobile-card-toggle[aria-expanded="true"]{color:var(--acc);border-color:rgba(52,226,196,.42)}.mobile-card-toggle:focus-visible{outline:2px solid var(--acc);outline-offset:2px}
  .mobile-nav{display:grid;grid-template-columns:42px minmax(0,1fr) 42px 42px;align-items:center;gap:6px;position:fixed;z-index:800;left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));bottom:max(8px,env(safe-area-inset-bottom));height:58px;padding:7px;border:1px solid rgba(122,157,198,.28);border-radius:16px;background:rgba(8,16,28,.94);backdrop-filter:blur(18px);box-shadow:0 14px 42px rgba(0,0,0,.48)}.mobile-nav button{height:42px;border:1px solid var(--line2);border-radius:10px;background:var(--panel2);color:var(--txt);font-size:17px}.mobile-nav .mobile-sections{min-width:0;text-align:left;padding:0 12px;font-size:12px;display:flex;flex-direction:column;justify-content:center}.mobile-nav .mobile-sections b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobile-nav .mobile-sections small{color:var(--txt3);font:10px var(--mono)}
  .mobile-sheet{display:block;position:fixed;z-index:901;left:8px;right:8px;bottom:8px;max-height:min(72vh,620px);overflow:auto;padding:16px;border:1px solid var(--line2);border-radius:18px;background:#0a1422;box-shadow:0 24px 80px rgba(0,0,0,.7);transform:translateY(calc(100% + 20px));transition:transform .22s ease}.mobile-sheet.open{transform:none}.mobile-sheet-head{display:flex;justify-content:space-between;align-items:center;position:sticky;top:-16px;background:#0a1422;padding:5px 0 11px;z-index:2}.mobile-sheet-head button{width:38px;height:38px;border:1px solid var(--line2);border-radius:9px;background:var(--panel2);color:var(--txt)}.mobile-sheet-list{display:grid;gap:7px}.mobile-sheet-list button{display:grid;grid-template-columns:30px 1fr auto;align-items:center;text-align:left;gap:8px;min-height:48px;padding:8px 10px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--txt2)}.mobile-sheet-list button.active{border-color:var(--acc);color:var(--txt)}.mobile-sheet-list i{font-style:normal;color:var(--acc);font:11px var(--mono)}.mobile-sheet-list em{font-style:normal;color:var(--txt3);font-size:11px}.mobile-sheet-backdrop{position:fixed;inset:0;z-index:900;background:rgba(0,0,0,.62);backdrop-filter:blur(4px)}
  .mobile-top{display:grid;place-items:center;position:fixed;right:14px;bottom:80px;z-index:790;width:42px;height:42px;border:1px solid var(--line2);border-radius:50%;background:rgba(8,16,28,.9);color:var(--txt);box-shadow:0 8px 24px rgba(0,0,0,.35);opacity:0;pointer-events:none;transform:translateY(8px);transition:.2s}.mobile-top.show{opacity:1;pointer-events:auto;transform:none}
  input,select,textarea,button{touch-action:manipulation}.ctrl input[type=range]{height:8px}.ctrl input[type=range]::-webkit-slider-thumb{width:22px;height:22px}.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.kpi .v{font-size:19px}canvas.chart{height:190px}.note{font-size:12px;line-height:1.6}
}
@media(max-width:390px){.topbar .nav{max-width:42vw}.kpis{grid-template-columns:1fr}.mobile-nav{grid-template-columns:40px minmax(0,1fr) 40px 40px}.card{padding:13px}}
@media(prefers-reduced-motion:reduce){.mobile-sheet,.mobile-top{transition:none}}

/* light theme — the fixed mobile bars hardcode dark backdrops */
:root[data-theme="light"] .mobile-nav{background:rgba(255,255,255,.95);border-color:var(--line2);box-shadow:0 10px 30px rgba(23,34,60,.18)}
:root[data-theme="light"] .mobile-nav button{background:var(--panel2);color:var(--txt)}
:root[data-theme="light"] .mobile-sheet{background:#fff;box-shadow:0 24px 70px rgba(23,34,60,.28)}
:root[data-theme="light"] .mobile-sheet-head{background:#fff}
