/* Phone-only layout; desktop controls continue to use the original styles. */
.mobile-nav,.mobile-tool-tray,.mobile-sheet-handle{display:none}
@media(max-width:900px){
  .app-shell{height:100dvh;min-height:0}
  .topbar{min-height:96px;padding:7px 12px;gap:5px}
  .brand h1{font-size:16px}.search-wrap input{height:40px;font-size:16px}
  .map-tool-stack{display:none}
  .mobile-nav{order:4;display:grid;grid-template-columns:repeat(4,1fr);flex-shrink:0;min-height:62px;padding:5px 8px calc(5px + env(safe-area-inset-bottom));border-top:1px solid #e4eaf4;background:#fff;z-index:20}
  .mobile-nav button{display:flex;flex-direction:column;gap:4px;min-height:48px;border:0;border-radius:9px;background:white;color:#6a7d97;font-size:11px}
  .mobile-nav button::before{width:21px;height:21px;flex-basis:21px}
  .mobile-nav button[aria-pressed=true]{background:#edf3ff;color:#2563eb;font-weight:600}
  .interaction-status{min-height:22px;padding:2px 10px;font-size:10px}.map-attribution{display:none}
  .workspace{min-height:0}
  .mobile-tool-tray:not([hidden]){display:grid;grid-template-columns:repeat(3,1fr);gap:8px;position:absolute;bottom:8px;left:8px;right:8px;z-index:16;padding:12px;border:1px solid #e0e7f2;border-radius:16px;background:white;box-shadow:0 -6px 30px #22385b20}
  .mobile-tool-tray header{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;font-weight:600;font-size:14px;color:#233c61}
  .mobile-tool-tray header button{border:0;background:transparent;color:#7184a0;min-height:36px}
  .mobile-tool-tray>button{min-height:56px;display:flex;flex-direction:column;gap:6px;border:0;border-radius:9px;background:#f3f6fc;color:#365985;font-size:12px}
  .drawing-properties,.drawing-list-panel,.result-panel,.weather-panel{top:auto!important;bottom:0!important;left:0!important;right:0!important;width:100%!important;max-width:none!important;max-height:54%!important;height:auto;padding:0 16px 14px!important;border:1px solid #e0e7f2;border-bottom:0;border-radius:18px 18px 0 0!important;box-shadow:0 -6px 26px #23395c20;z-index:12;box-sizing:border-box;overscroll-behavior:contain}
  .drawing-properties,.drawing-list-panel{height:54%;display:flex;flex-direction:column}
  .drawing-properties[hidden],.drawing-list-panel[hidden],.result-panel[hidden],.weather-panel[hidden]{display:none!important}
  .mobile-sheet-expanded{height:88%!important;max-height:88%!important}
  .mobile-sheet-handle{display:flex;align-items:center;justify-content:center;flex-shrink:0;gap:8px;width:100%;min-height:32px;padding:6px;border:0!important;background:white!important;color:#7d8da5!important;font-size:10px!important;touch-action:none;position:sticky;top:0;z-index:3}
  .mobile-sheet-handle::before{content:'';width:32px;height:4px;border-radius:4px;background:#d6dfeb}
  .drawing-properties .drawing-properties-heading,.weather-panel-heading,.panel-heading{position:sticky;top:32px;margin:0 0 8px!important;padding:3px 0 8px!important;background:white;z-index:2;flex-shrink:0}
  .drawing-properties .inspector-body{min-height:0}.drawing-list-rows{flex:1;min-height:0;overflow:auto}
  .drawing-properties input:not([type=color]):not([type=checkbox]):not([type=range]),.drawing-properties select,.drawing-properties textarea{font-size:16px;min-height:42px}
  .drawing-properties-actions{margin-top:8px;padding-top:8px;gap:6px}.drawing-properties-actions button,.navigation-actions button,.navigation-actions a{min-height:44px!important}
  .drawing-list-row{min-height:56px;grid-template-columns:24px 20px minmax(0,1fr) repeat(3,36px);gap:3px}.drawing-list-row button{width:36px;min-width:36px;min-height:44px}.drawing-list-row input[type=checkbox]{width:20px;height:20px}
  .drawing-list-row input[type=text]{font-size:16px}.drawing-list-footer{padding:8px 0;margin-top:5px}
  .mobile-drawing-actions:not([hidden]){display:grid;bottom:10px;grid-template-columns:repeat(3,minmax(0,1fr));width:min(350px,calc(100% - 24px));box-sizing:border-box;z-index:17}.mobile-drawing-actions button{min-height:46px;font-size:14px}
  .layer-control{min-width:0;left:10px;bottom:10px}.layer-control:not([open]) summary{padding:10px 13px;min-height:38px;box-sizing:border-box}
  .workspace:has(>.drawing-properties:not([hidden]))>.layer-control,.workspace:has(>.result-panel:not([hidden]))>.layer-control,.workspace:has(>.weather-panel:not([hidden]))>.layer-control,.workspace:has(>.drawing-list-panel:not([hidden]))>.layer-control{display:none}
  .workspace:has(>.mobile-drawing-actions:not([hidden]))>.layer-control{bottom:80px}
  .maplibregl-ctrl-group button{width:38px;height:38px}
  .location-notice,.maintenance-notice{width:calc(100% - 28px);max-width:350px;font-size:11px}
  dialog{max-height:calc(100dvh - 24px);overflow:auto}button,input,select,textarea{scroll-margin-bottom:90px}
}
@media(max-width:900px) and (max-height:500px){
 .topbar{height:54px;min-height:54px;grid-template-columns:1fr auto;padding:5px 10px}.brand{display:none}.search-wrap{grid-row:1;grid-column:1}.locate-button{grid-column:2}.mobile-nav{min-height:48px;padding-top:2px;padding-bottom:2px}.mobile-nav button{min-height:42px;flex-direction:row;font-size:12px}.interaction-status{display:none}.drawing-properties,.drawing-list-panel,.result-panel,.weather-panel{max-height:85%!important}.drawing-properties,.drawing-list-panel{height:85%}
}
