@media(max-width:760px){
  body{padding-bottom:calc(74px + env(safe-area-inset-bottom));background:radial-gradient(circle at 100% 0,#17413955,transparent 24%),var(--bg)}
  body.sheet-open{overflow:hidden}
  .topbar{height:62px;padding:0 14px;background:#071118f2}
  .brand{gap:9px;min-width:0}.brand>div{min-width:0}.brand-mark.small{width:35px;height:35px;border-radius:11px;font-size:16px}.brand strong{max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}.brand small{font-size:10px}
  .top-actions{gap:7px}.sync-pill{max-width:132px;padding:6px 9px;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.top-actions .logout{display:none}
  .dashboard{padding:18px 14px 54px}
  .hero-row{display:grid;grid-template-columns:1fr;align-items:start;gap:12px;margin-bottom:15px}
  .hero-row h1{font-size:30px;line-height:1.05;margin:5px 0 6px}.hero-row .muted{font-size:12px;margin:0}.hero-row select{width:100%;min-width:0;min-height:44px;padding:10px 13px;border-radius:13px;font-size:13px}
  .mobile-context{display:flex;align-items:center;justify-content:space-between;margin:0 2px 8px;color:var(--muted);font-size:11px}.mobile-context button{border:1px solid #48e0b244;border-radius:999px;background:#48e0b210;color:var(--accent);padding:6px 11px;font:inherit;font-weight:750}.mobile-context button:disabled{opacity:.55}
  .mobile-swipe-hint{display:none}
  .metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:0 0 11px;padding:0;overflow:visible}
  .metric{min-width:0;min-height:118px;padding:15px;border-radius:16px;box-shadow:0 12px 32px #0003}
  .metric span{font-size:12px}.metric strong{font-size:clamp(19px,4.5vw,27px);line-height:1.08;margin:8px 0 5px;white-space:nowrap;letter-spacing:-.055em}.metric small{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .metric-arrow{font-size:15px}.stock-metric:after{width:90px;height:90px}
  .grid-two,.grid-two.lower{grid-template-columns:1fr;gap:10px;margin-bottom:10px}.panel{min-height:250px;padding:16px;border-radius:16px;box-shadow:0 12px 32px #0003}.panel h2{font-size:17px;margin:4px 0 16px}.eyebrow{font-size:9px}.legend{font-size:10px}
  .chart{height:185px;overflow-x:auto;justify-content:flex-start;gap:3px;scrollbar-width:none}.chart::-webkit-scrollbar{display:none}.chart-group{flex:0 0 14px}
  .rank-row,.warehouse-row{grid-template-columns:28px minmax(0,1fr) auto;gap:8px;padding:10px 0}.rank-number{width:27px;height:27px;border-radius:8px;font-size:11px}.rank-row div strong,.warehouse-row div strong{display:block;font-size:12px;line-height:1.35}.rank-row small,.warehouse-row small{font-size:10px}.rank-row>strong,.warehouse-row>strong{font-size:11px;white-space:nowrap}
  .status-panel{min-height:125px}.status-light{width:56px;height:56px}
  .sheet-backdrop:not([hidden]){display:block;position:fixed;inset:0;background:#02070acc;backdrop-filter:blur(5px);z-index:40;animation:fade-in .2s ease}
  .stock-groups-panel:not([hidden]){display:block;position:fixed;left:0;right:0;bottom:0;z-index:41;height:min(88dvh,760px);margin:0;padding:12px 14px calc(22px + env(safe-area-inset-bottom));border-radius:24px 24px 0 0;border-color:#48e0b255;overflow-y:auto;overscroll-behavior:contain;animation:sheet-up .28s cubic-bezier(.2,.8,.2,1)}
  .sheet-handle{display:block;width:44px;height:5px;border-radius:999px;background:#49616a;margin:0 auto 15px}.stock-groups-head{position:sticky;top:-12px;z-index:2;background:linear-gradient(#10242d 78%,transparent);padding:10px 0 14px;margin-bottom:2px}.stock-groups-head h2{font-size:20px}.stock-groups-head .muted{font-size:11px;margin-right:42px}.icon-button{position:absolute;right:0;top:8px;width:42px;height:42px}.stock-group-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding-bottom:10px}.stock-group-card{padding:13px;border-radius:14px}.stock-group-top strong{font-size:11px}.group-quantity{font-size:22px;margin:11px 0 6px}.group-meta{font-size:9px}
  .mobile-nav{display:grid;grid-template-columns:repeat(4,1fr);position:fixed;left:10px;right:10px;bottom:calc(8px + env(safe-area-inset-bottom));z-index:35;height:60px;padding:5px;border:1px solid #29414b;border-radius:19px;background:#0b171eed;backdrop-filter:blur(18px);box-shadow:0 16px 45px #0009}.mobile-nav button{border:0;border-radius:13px;background:transparent;color:#7f969e;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;font:inherit;font-size:9px;transition:.2s}.mobile-nav button i{font-style:normal;font-size:18px;line-height:1}.mobile-nav button.active{color:var(--accent);background:#48e0b211}.mobile-nav button:active{transform:scale(.94)}
  #overview,#salesSection,#warehouseSection{scroll-margin-top:76px}
}

@media(max-width:390px){
  .brand strong{max-width:150px}.sync-pill{max-width:105px}.dashboard{padding-left:11px;padding-right:11px}.metrics{gap:7px}.metric{padding:13px;min-height:112px}.metric strong{font-size:clamp(18px,5.15vw,21px)}.stock-group-grid{grid-template-columns:1fr}
}
