.desktop-sidebar,.desktop-only{display:none}

@media (min-width:900px){
  html,body{background:#edf5f8}
  body{display:block}
  .app-shell{min-height:100vh;padding-left:248px}
  .desktop-sidebar{display:flex;position:fixed;inset:0 auto 0 0;width:248px;background:#fff;border-right:1px solid var(--line);z-index:50;flex-direction:column;padding:24px 16px}
  .desktop-sidebar .brand{font-size:21px;padding:0 10px 22px;border-bottom:1px solid #edf3f6;margin-bottom:18px}
  .desktop-sidebar .brand .horsemark{font-size:32px}
  .desktop-nav{display:flex;flex-direction:column;gap:5px}
  .desktop-nav a{display:flex;align-items:center;gap:12px;padding:11px 13px;border-radius:11px;text-decoration:none;color:#567083;font-size:14px;font-weight:650}
  .desktop-nav a span{width:24px;text-align:center;font-size:19px;color:#6d8797}
  .desktop-nav a:hover{background:#f1f8fa;color:var(--navy)}
  .desktop-nav a.active{background:#e5f4f6;color:var(--teal);font-weight:800}
  .desktop-nav a.active span{color:var(--teal)}
  .desktop-nav-section{margin:18px 12px 7px;color:#91a4af;font-size:10px;font-weight:800;letter-spacing:.11em;text-transform:uppercase}
  .desktop-account{margin-top:auto;border-top:1px solid #edf3f6;padding:16px 8px 0;display:flex;align-items:center;gap:10px;text-decoration:none}
  .desktop-account .avatar{flex:none}
  .desktop-account b{display:block;font-size:13px}.desktop-account small{color:var(--muted);font-size:10px}

  .global-bottom-nav{display:none!important}
  .screen{max-width:none;min-height:100vh;margin:0;background:#fffaf2;box-shadow:none;padding-bottom:0}
  .screen>.topbar{height:76px;padding:18px 32px;background:#fff;border-bottom:1px solid var(--line)}
  .screen>.topbar .brand{display:none}
  .screen>.topbar:before{content:'EquiiTrack Web';font-size:18px;font-weight:800;color:var(--navy)}
  .content{max-width:1440px;margin:0 auto;padding:28px 32px 48px}
  .page-head{grid-template-columns:44px minmax(0,1fr) 44px;max-width:none;margin-bottom:20px}
  .page-head h1{font-size:24px;text-align:left}
  .global-back{background:#fff;border:1px solid var(--line)}
  .topbar.has-global-back:before{display:none}

  .desktop-only{display:block}
  .desktop-dashboard-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(340px,.75fr);gap:22px;align-items:start}
  .desktop-dashboard-grid>.desktop-main,.desktop-dashboard-grid>.desktop-side{min-width:0}
  .desktop-side .card:first-child{margin-top:0}
  .desktop-section-head{display:flex;align-items:center;justify-content:space-between;margin:4px 0 10px}
  .desktop-section-head h2{font-size:17px}.desktop-section-head a{font-size:12px;color:var(--teal);font-weight:750;text-decoration:none}
  .desktop-quick-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .desktop-quick-grid a{background:#fff;border:1px solid var(--line);border-radius:14px;padding:15px;text-decoration:none;min-height:104px;display:flex;flex-direction:column;justify-content:space-between;box-shadow:0 4px 15px #29333d08}
  .desktop-quick-grid span{font-size:23px;color:var(--teal)}.desktop-quick-grid b{font-size:13px}.desktop-quick-grid small{font-size:10px;color:var(--muted)}
  .desktop-web-note{background:linear-gradient(135deg,#17384c,#1c6571);color:#fff;border:0}.desktop-web-note p{color:#d8edf1}.desktop-web-note b{font-size:16px}

  .welcome{margin:0 0 18px}.welcome h1{font-size:30px}
  #live-horses{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:12px}
  #live-horses>.horse-card,#live-horses>.card{margin:0}
  .map-preview{margin:18px 0}.map-preview .leaflet-mini{height:360px!important}
  .map-copy{padding:15px 18px}
  .content>.primary[href="/Map"]{width:220px;margin-left:auto}

  .map-content{max-width:none;padding:0;height:100vh}
  .map-full{height:100vh;min-height:600px;border-radius:0}
  .leaflet-live{height:100%!important}
  .map-controls{left:28px;right:28px;top:24px}
  .map-location-card{left:auto;right:28px;bottom:28px;width:390px}

  .horse-card,.boundary-card{padding:15px}
  .product-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .status-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
  .shortcut-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
  .history-map{height:480px}
  .chart{height:260px}
  .form-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
  .alert-card{padding:16px}

  .screen:has(.draw-map){min-height:100vh}
  .screen:has(.draw-map) .content{max-width:none;padding:0;min-height:100vh}
  .screen:has(.draw-map) .page-head.overlay{position:absolute;left:28px;top:24px;width:420px;margin:0;padding:0 12px}
  .draw-map{inset:0 420px 0 0}
  .editor-panel{left:auto;right:0;top:0;bottom:0;width:420px;border-radius:0;border-left:1px solid var(--line);overflow:auto;padding:28px 24px}
}

@media (min-width:1250px){
  .app-shell{padding-left:264px}.desktop-sidebar{width:264px}
  .content{padding-left:40px;padding-right:40px}
}
