/* Offline Map module — self-contained styles (preview).
   The overlay is a full-screen sheet above the host site: dark header,
   the MapLibre map, and a frosted info card at the bottom with the
   download state. Nothing here restyles the host page except the
   toolbar button label span. */
#offline-map-btn { white-space: nowrap; }
body.om-open { overflow: hidden; }

.om-overlay {
  position: fixed; inset: 0; z-index: 3000;
  display: flex; flex-direction: column;
  background: #f2efe9;
  font-family: inherit;
}
.om-overlay.hidden { display: none; }

.om-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px;
  background: rgba(11, 18, 32, 0.97); color: #fff;
}
.om-title { font-weight: 700; font-size: 16px; letter-spacing: 0.01em; }
.om-close {
  appearance: none; border: 1px solid rgba(255,255,255,0.35); cursor: pointer;
  background: rgba(255,255,255,0.08); color: #fff;
  border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 600;
  min-height: 40px;
}

.om-mapwrap { position: relative; flex: 1 1 auto; min-height: 0; }
.om-map { position: absolute; inset: 0; }
.om-map .maplibregl-ctrl-attrib { font-size: 10px; }

.om-card {
  flex: 0 0 auto;
  background: rgba(255,255,255,0.96);
  border-top: 1px solid rgba(11,18,32,0.14);
  box-shadow: 0 -6px 24px rgba(11,18,32,0.12);
  padding: 12px 16px 14px;
  color: #1c1a16;
}
.om-status { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.om-progress {
  height: 10px; border-radius: 999px; overflow: hidden;
  background: rgba(11,18,32,0.12); margin: 4px 0 10px;
}
.om-progress.hidden { display: none; }
.om-progress > div {
  height: 100%; width: 0%;
  background: #0ea5e9; border-radius: 999px;
  transition: width 0.2s ease;
}
.om-action {
  appearance: none; border: 0; cursor: pointer; width: 100%;
  background: #0284c7; color: #fff;
  border-radius: 12px; padding: 13px 16px;
  font-size: 16px; font-weight: 700; min-height: 50px;
}
.om-action.secondary { background: rgba(11,18,32,0.08); color: #7c2d12; }
.om-action:disabled { opacity: 0.55; cursor: default; }
.om-note { margin: 10px 0 0; font-size: 13.5px; line-height: 1.45; }
.om-scope { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: #57534a; }
.om-storage { margin: 6px 0 0; font-size: 12.5px; color: #57534a; }
.om-storage:empty { display: none; }
.om-attrib { margin: 6px 0 0; font-size: 11.5px; color: #8a8578; }

.om-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  z-index: 3200; max-width: min(92vw, 480px);
  background: rgba(11,18,32,0.95); color: #fff;
  padding: 11px 16px; border-radius: 12px;
  font-size: 14.5px; font-weight: 600; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease;
}
.om-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 900px) {
  .om-card { padding: 14px 22px 16px; }
  .om-action { width: auto; min-width: 340px; }
}
