:root {
  color-scheme: light;
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
  color: #192f2a;
  background: #f5f6f1;
}

* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 1200px; margin-inline: auto; padding: clamp(16px, 4vw, 34px); }
h1, h2, p { margin-block-start: 0; }
h1 { margin: 0; font-size: clamp(1.35rem, 4vw, 1.85rem); }
h2 { margin-block-end: 8px; font-size: 1.15rem; }
a { color: #175b49; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .58; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid #bd650d;
  outline-offset: 2px;
}

.offline-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 14px;
}

.offline-subtitle { margin: 4px 0 0; color: #40584f; font-size: .95rem; line-height: 1.6; }

#offline-save {
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: #174a3d;
  color: #fff;
}

#offline-storage { flex: 1 0 100%; margin: 0; line-height: 1.6; font-size: .95rem; }
.offline-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-block-end: 12px; }
.offline-tools label { font-weight: 700; }
.offline-tools input {
  flex: 1 1 210px;
  min-width: 0;
  max-width: 400px;
  color: inherit;
  background: #fff;
  padding: 10px 12px;
  border: 1px solid #a7bcb5;
  border-radius: 10px;
}
#offline-3d-toggle {
  padding: 9px 14px;
  border: 1px solid #356657;
  border-radius: 10px;
  color: #174a3d;
  background: #fff;
  font-weight: 700;
}
#offline-3d-toggle[aria-pressed="true"] { color: #fff; background: #174a3d; }
#offline-3d-status { flex: 1 0 100%; margin: 0; color: #40584f; font-size: .9rem; line-height: 1.65; }

.offline-layout { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(245px, 1fr); gap: 12px; }
.offline-map-frame {
  position: relative;
  min-height: 480px;
  height: min(70vh, 650px);
  border: 1px solid #b8c8be;
  border-radius: 12px;
  background: #ebece2;
  isolation: isolate;
  overflow: hidden;
}
#offline-canvas, #offline-canvas-3d { position: absolute; inset: 0; }
#offline-canvas { z-index: 1; }
#offline-canvas-3d[hidden] { display: none; }
.offline-map-frame[data-mode="3d"] #offline-canvas { visibility: hidden; }
.offline-3d-pin {
  display: block;
  padding: 3px 7px;
  border: 1px solid #1d6551;
  border-radius: 7px;
  background: #fff;
  color: #173a31;
  font: 700 .78rem Tahoma, Arial, sans-serif;
  white-space: nowrap;
}

.offline-sidebar {
  min-height: 160px;
  max-height: min(70vh, 650px);
  overflow: auto;
  padding: 14px;
  border: 1px solid #c2cec7;
  border-radius: 12px;
  background: #fff;
}

#offline-result-count { margin-block-end: 8px; line-height: 1.6; font-size: .92rem; }
#offline-results { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
#offline-results button {
  width: 100%;
  text-align: start;
  padding: 8px 10px;
  border: 1px solid #d6e2da;
  border-radius: 8px;
  color: #183b33;
  background: #f6faf7;
}

#offline-detail { margin-block-end: 12px; padding-block-end: 10px; border-block-end: 1px solid #d6e2da; }
#offline-detail p { margin-block-end: 8px; line-height: 1.6; }
#offline-detail a { display: block; margin-block-end: 4px; line-height: 1.7; }
.offline-map-label { font: 700 .83rem Tahoma, Arial, sans-serif; color: #173a31; }
footer { margin-block-start: 12px; color: #40584f; font-size: .86rem; line-height: 1.8; }

@media (max-width: 670px) {
  .offline-layout { grid-template-columns: minmax(0, 1fr); }
  .offline-map-frame { min-height: 290px; height: 50vh; }
  .offline-sidebar { max-height: 410px; }
}
