.overlay-toggle {
  position: absolute;
  top: 70px;
  right: 22px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 9px;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.overlay-toggle input { accent-color: var(--forest); }
.wind-toggle { top: 110px; }

.wind-key { color: #146c94; font-style: normal; font-size: 12px; }
.water-key,.food-key,.low-key { width: 8px; height: 8px; border-radius: 50%; background: #2589bd; }
.food-key { background: #4f8a52; }
.low-key { background: #7b8185; }
.weather-panel { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.weather-panel h3 { margin: 0 0 12px; font: 20px 'DM Serif Display'; }
.weather-current { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; align-items: center; }
.weather-current strong { grid-row: 1 / 3; font-size: 34px; color: var(--forest); }
.weather-current span,.weather-current small { color: var(--muted); font-size: 11px; }
.weather-hours { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; margin-top: 14px; }
.weather-hour { padding: 8px 4px; border-radius: 6px; background: #f1f2eb; text-align: center; font-size: 10px; }
.weather-hour b,.weather-hour span { display: block; margin-top: 3px; }
.weather-alert { margin-top: 10px; padding: 9px; border-radius: 6px; background: #f4e4dd; color: #8a3e28; font-size: 11px; font-weight: 700; }

@media (max-width: 800px) {
  .overlay-toggle { top: 126px; }
  .wind-toggle { top: 166px; }
}

.mobile-library-toggle,
.sidebar-backdrop { display: none; }

@media (max-width: 800px) {
  :root { --mobile-header-height: 68px; }
  .shell { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 0 auto 0;
    width: 100%;
    height: var(--mobile-header-height);
    z-index: 30;
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 5px 20px #18302220;
    transform: none;
    transition: height .25s ease;
  }
  .sidebar.hidden { transform: none; }
  .sidebar.mobile-open { height: min(82vh,680px); }
  .brand { flex: 0 0 var(--mobile-header-height); height: var(--mobile-header-height); padding: 12px 16px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-copy { min-width: 0; }

  .mobile-library-toggle {
    margin-left: auto;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f4f3ed;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--forest);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
  }
  .mobile-library-toggle i,
  .mobile-library-toggle i::before,
  .mobile-library-toggle i::after { width: 16px; height: 2px; border-radius: 2px; background: currentColor; display: block; transition: .2s; }
  .mobile-library-toggle i { position: relative; }
  .mobile-library-toggle i::before,
  .mobile-library-toggle i::after { content: ''; position: absolute; left: 0; }
  .mobile-library-toggle i::before { top: -5px; }
  .mobile-library-toggle i::after { top: 5px; }
  .mobile-open .mobile-library-toggle i { background: transparent; }
  .mobile-open .mobile-library-toggle i::before { top: 0; transform: rotate(45deg); }
  .mobile-open .mobile-library-toggle i::after { top: 0; transform: rotate(-45deg); }

  .sidebar .search { flex: 0 0 auto; margin: 14px 16px 10px; }
  .sidebar nav { flex: 0 0 auto; padding: 0 10px 12px; }
  .sidebar .collection { flex: 1 1 auto; overflow-y: auto; }
  .sidebar footer { flex: 0 0 auto; }
  .sidebar-backdrop { position: fixed; inset: var(--mobile-header-height) 0 0; z-index: 25; border: 0; background: #15271f66; backdrop-filter: blur(1px); }
  .sidebar.mobile-open + .sidebar-backdrop { display: block; }

  main { position: fixed; inset: var(--mobile-header-height) 0 0; }
  .map-toolbar { top: 10px; left: 10px; right: 10px; gap: 7px; }
  .map-toolbar #menu { display: none; }
  .map-title { min-width: 0; flex: 1; }
  .layer-switcher { top: 66px; right: 10px; }
  .overlay-toggle { top: 110px; right: 10px; }
  .wind-toggle { top: 150px; }
  .map-bottom { left: 10px; right: 10px; bottom: 10px; }

  .inspector {
    position: fixed;
    z-index: 22;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    height: auto;
    max-height: min(72vh,620px);
    padding: 28px 20px calc(22px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -14px 45px #13291f38;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .inspector.open::before { content: ''; position: absolute; top: 8px; left: 50%; width: 42px; height: 4px; margin-left: -21px; border-radius: 4px; background: #c8cbc5; }
  dialog { max-height: 92vh; max-width: calc(100vw - 20px); overflow-y: auto; }
  dialog form { padding: 20px 16px; }
  .row { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .brand-copy small,
  .mobile-library-toggle span { display: none; }
  .layer-switcher button { padding-inline: 8px; }
}
