/* IrriDex map responsive controls — 2026-10-31.
   Appearance/layout only; map canvas remains 100% width and height. */

/* A floating header control should never reappear from cached markup. */
html.id-map-page .id-theme-toggle{display:none!important}

/* Responsive toolbar: active below the JS toolbarMedia breakpoint.
   Do not change map loading thresholds, coordinates or Leaflet sizing. */
@media (max-width:1120px), (pointer:coarse){
  html.id-map-page #app .topbar{
    display:flex!important;flex-wrap:nowrap!important;
    align-items:center!important;gap:clamp(5px,1vw,12px)!important;
    padding-inline:max(8px,env(safe-area-inset-left)) max(8px,env(safe-area-inset-right))!important;
    min-width:0;
  }
  html.id-map-page #app .topbar .brand-block{
    flex:0 1 auto!important;min-width:0!important;max-width:40vw!important;
    display:flex!important;align-items:center!important;
  }
  html.id-map-page #app .topbar .brand-block .id-wordmark{
    display:inline-block!important;font-size:clamp(20px,3vw,28px)!important;
    white-space:nowrap!important;min-width:0!important;
  }
  html.id-map-page #app .topbar .brand-block>span:not(.id-wordmark){display:none!important}
  html.id-map-page #app .topbar .top-actions{
    margin-left:auto!important;min-width:0!important;gap:6px!important;
    display:flex!important;align-items:center!important;
  }
  html.id-map-page #app .topbar .mobile-tools-toggle{
    display:inline-flex!important;align-items:center!important;justify-content:center!important;
    width:auto!important;min-width:62px!important;height:44px!important;
    padding:0 10px!important;font-size:13px!important;flex:none!important;
  }
  html.id-map-page #app .topbar :is(#menuBtn,#locateBtn){
    width:44px!important;height:44px!important;min-width:44px!important;
    display:grid!important;place-items:center!important;flex:none!important;
  }
  html.id-map-page #app .topbar .account{max-width:clamp(66px,18vw,134px)!important;min-width:0!important;flex:0 1 auto!important}
  html.id-map-page #app .mobile-map-tools:not([hidden]){
    display:flex!important;flex-wrap:wrap!important;gap:8px!important;
    position:fixed!important;top:calc(var(--irridex-topbar-height,64px) + 8px)!important;
    right:max(8px,env(safe-area-inset-right))!important;
    z-index:2200!important;max-width:calc(100vw - 16px)!important;
    padding:12px!important;background:var(--id-paper)!important;
    border:1px solid var(--id-line)!important;
    border-radius:4px!important;box-shadow:0 12px 30px rgba(0,0,0,.28)!important;
  }
  html.id-map-page #app .mobile-map-tools .icon-btn{width:48px!important;height:48px!important;min-width:48px!important;display:grid!important;place-items:center!important}
}
@media (max-width:540px){
  html.id-map-page #app .topbar .brand-block .id-wordmark{font-size:clamp(18px,4.8vw,23px)!important}
  html.id-map-page #app .topbar .account{max-width:46px!important;width:46px!important;padding:5px!important;overflow:hidden!important}
  html.id-map-page #app .topbar .mobile-tools-toggle{min-width:56px!important;padding-inline:6px!important}
  html.id-map-page #app .topbar :is(#menuBtn,#locateBtn){width:42px!important;min-width:42px!important;height:44px!important}
  html.id-map-page #app .topbar .top-actions{gap:4px!important}
}
@media (max-width:365px){
  html.id-map-page #app .topbar{gap:4px!important}
  html.id-map-page #app .topbar .brand-block .id-wordmark{font-size:18px!important}
  html.id-map-page #app .topbar :is(#menuBtn,#locateBtn){min-width:38px!important;width:38px!important}
  html.id-map-page #app .topbar .mobile-tools-toggle{min-width:50px!important}
}

/* The logging chooser must always be above the map toolbar and fully scrollable.
   The other capture dialogs receive the same correct stacking order. */
html.id-map-page body .capture-menu-backdrop{
  z-index:2147483646!important;
  place-items:center!important;
  padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))!important;
  overflow-y:auto!important;overscroll-behavior:contain;
}
html.id-map-page body #captureMenu .capture-menu{
  box-sizing:border-box!important;
  width:min(780px,calc(100vw - 20px))!important;
  max-width:100%!important;
  max-height:calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important;
  min-height:0!important;
  padding:0!important;
  overflow:hidden!important;
  display:flex!important;flex-direction:column!important;gap:0!important;
  background:var(--id-paper)!important;color:var(--id-ink)!important;
  border:1px solid var(--id-line)!important;border-radius:5px!important;
  box-shadow:0 24px 55px rgba(0,0,0,.40)!important;
}
html.id-map-page body #captureMenu .id-log-dialog-head{
  padding:16px 18px 12px!important;flex:0 0 auto;
  background:var(--id-panel-soft)!important;border-bottom:1px solid var(--id-line)!important;
}
html.id-map-page body #captureMenu #chooseLogModeTitle{
  display:block;font-size:clamp(18px,2vw,23px)!important;line-height:1.25!important;
  font-weight:600!important;color:var(--id-ink)!important;margin:0 0 4px!important;
}
html.id-map-page body #captureMenu .id-log-dialog-head p{
  margin:0!important;font-size:clamp(12px,1.3vw,14px)!important;
  line-height:1.5!important;color:var(--id-muted)!important;
}
html.id-map-page body #captureMenu .id-log-choice-grid{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  align-content:start!important;gap:9px!important;
  overflow-y:auto!important;overscroll-behavior:contain;
  padding:14px 16px!important;min-height:0!important;
}
html.id-map-page body #captureMenu .capture-choice.log-mode-choice{
  display:flex!important;flex-direction:row!important;align-items:center!important;
  min-width:0!important;min-height:76px!important;height:auto!important;
  padding:11px 12px!important;gap:11px!important;
  background:var(--id-paper)!important;color:var(--id-ink)!important;
  border:1px solid var(--id-line)!important;border-radius:4px!important;
  text-align:left!important;white-space:normal!important;
}
html.id-map-page body #captureMenu .capture-choice.log-mode-choice:hover,
html.id-map-page body #captureMenu .capture-choice.log-mode-choice:focus-visible{
  background:var(--id-hover)!important;border-color:#0078ce!important;
  color:var(--id-ink)!important;
}
html.id-map-page body #captureMenu .log-mode-icon,
html.id-map-page body #captureMenu .layout-tools-glyph{
  display:block!important;flex:0 0 45px!important;width:45px!important;height:45px!important;
  max-width:45px!important;max-height:45px!important;object-fit:contain!important;
}
html.id-map-page body #captureMenu .layout-tools-glyph{display:grid!important;place-items:center!important;font-size:25px!important;color:var(--id-blue)!important}
html.id-map-page body #captureMenu .capture-choice>span:last-child{min-width:0!important;overflow-wrap:anywhere!important}
html.id-map-page body #captureMenu .capture-choice b{
  display:block!important;font-size:14px!important;line-height:1.4!important;
  font-weight:600!important;color:var(--id-ink)!important;
}
html.id-map-page body #captureMenu .capture-choice small{
  display:block!important;font-size:11px!important;line-height:1.42!important;
  margin-top:3px!important;color:var(--id-muted)!important;
  overflow-wrap:anywhere!important;
}
html.id-map-page body #captureMenu .id-log-dialog-footer{
  display:flex!important;align-items:center!important;justify-content:space-between!important;
  gap:12px!important;flex:0 0 auto!important;
  padding:10px 16px!important;background:var(--id-panel-soft)!important;
  border-top:1px solid var(--id-line)!important;
}
html.id-map-page body #captureMenu #captureCancel{
  position:static!important;min-height:44px!important;padding:8px 20px!important;
  flex:0 0 auto!important;font-size:13px!important;
}
html.id-map-page body #captureMenu .irridex-build-marker{font-size:10px!important;color:var(--id-muted)!important;text-align:right!important}
@media (max-width:660px){
  html.id-map-page body #captureMenu .capture-menu{width:min(480px,calc(100vw - 20px))!important}
  html.id-map-page body #captureMenu .id-log-choice-grid{grid-template-columns:minmax(0,1fr)!important;gap:7px!important;padding:10px!important}
  html.id-map-page body #captureMenu .capture-choice.log-mode-choice{min-height:64px!important;padding:9px 10px!important}
  html.id-map-page body #captureMenu .id-log-dialog-head{padding:12px 14px 10px!important}
  html.id-map-page body #captureMenu .id-log-dialog-footer{padding:8px 12px!important}
}
@media (max-height:550px){
  html.id-map-page body #captureMenu .id-log-dialog-head{padding-block:9px!important}
  html.id-map-page body #captureMenu .capture-choice.log-mode-choice{min-height:60px!important;padding-block:7px!important}
  html.id-map-page body #captureMenu .id-log-choice-grid{padding-block:8px!important}
}
/* For other capture menus, bound their height without breaking their forms. */
html.id-map-page body .capture-menu-backdrop:not(#captureMenu) .capture-menu{
  max-height:calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important;
  overflow-y:auto!important;overscroll-behavior:contain;
}
