/* SAJ Stage167 / Task119 — complete, mobile-first geographic navigation UI. */
.saj-geonav-panel,
.saj-geonav-panel *,
.saj-geonav-toolbar-button,
.saj-geonav-toolbar-fallback {
  box-sizing: border-box;
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
}

/* The panels are appended to body; they must overlay the map, not flow below it. */
.saj-geonav-panel {
  position: fixed !important;
  inset-block-start: max(12px, env(safe-area-inset-top, 0px)) !important;
  inset-inline-end: max(12px, env(safe-area-inset-right, 0px)) !important;
  z-index: 100120 !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(440px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - max(24px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px;
  border: 1px solid #cbd9e3;
  border-radius: 16px;
  background: #fff;
  color: #163449;
  direction: rtl;
  text-align: right;
  box-shadow: 0 16px 48px rgba(4, 23, 42, .30);
  pointer-events: auto !important;
  -webkit-overflow-scrolling: touch;
}
.saj-geonav-panel[hidden] { display: none !important; }
.saj-geonav-panel button,
.saj-geonav-panel input,
.saj-geonav-panel select { font: inherit; }
.saj-geonav-head {
  position: sticky;
  inset-block-start: -14px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -14px -14px 0;
  padding: 12px 14px;
  background: #f1f7fa;
  border-bottom: 1px solid #dbe7ed;
}
.saj-geonav-head-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.saj-geonav-head-copy strong { color: #0b3b56; font-size: 15px; font-weight: 800; }
.saj-geonav-head-copy small { color: #647b89; font-size: 10px; line-height: 1.7; }
.saj-geonav-close {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid #c7d5de;
  border-radius: 9px;
  background: #fff;
  color: #334e60;
  font-size: 22px !important;
  line-height: 1;
  cursor: pointer;
}
.saj-geonav-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.saj-geonav-help { margin: 0; color: #526b7a; font-size: 11px; line-height: 1.9; }
.saj-geonav-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.saj-geonav-field > span { color: #173f58; font-size: 12px; font-weight: 800; }
.saj-geonav-field input,
.saj-geonav-field select,
.saj-geonav-grid input,
.saj-geonav-grid select {
  width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px;
  border: 1px solid #c5d5df; border-radius: 9px; background: #fff; color: #18394d;
  font-size: 12px; outline: none;
}
.saj-geonav-field input:focus,
.saj-geonav-field select:focus,
.saj-geonav-grid input:focus { border-color: #12869a; box-shadow: 0 0 0 3px rgba(18, 134, 154, .13); }
.saj-geonav-field input:disabled { background: #f1f5f7; color: #8ba0aa; cursor: not-allowed; }
.saj-geonav-picker { position: relative; width: 100%; }
.saj-geonav-picker > input { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #c5d5df; border-radius: 9px; font-size: 12px; }
.saj-geonav-picker-list {
  position: absolute; inset-block-start: calc(100% + 4px); inset-inline: 0; z-index: 5;
  max-height: 230px; overflow: auto; overscroll-behavior: contain;
  border: 1px solid #cbdde5; border-radius: 10px; background: #fff;
  box-shadow: 0 8px 24px rgba(15, 45, 65, .16);
}
.saj-geonav-picker-list[hidden] { display: none !important; }
.saj-geonav-option {
  display: block; width: 100%; min-height: 36px; padding: 7px 10px; border: 0;
  border-bottom: 1px solid #edf2f5; background: #fff; color: #23465b;
  text-align: right; font-size: 12px; font-weight: 600; line-height: 1.7; cursor: pointer;
}
.saj-geonav-option.active,
.saj-geonav-option:hover { background: #e4f5f8; color: #075b6b; }
.saj-geonav-suggestions { display: flex; flex-direction: column; gap: 7px; max-height: 290px; overflow: auto; overscroll-behavior: contain; }
.saj-geonav-suggestion {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; min-height: 48px;
  padding: 8px 10px; border: 1px solid #cbdde5; border-radius: 10px; background: #fff;
  color: #163f56; text-align: right; cursor: pointer;
}
.saj-geonav-suggestion:hover,
.saj-geonav-suggestion:focus-visible { background: #edf8fa; border-color: #15899b; outline: 2px solid #a8dfe5; outline-offset: 1px; }
.saj-geonav-suggestion strong { font-size: 12px; line-height: 1.7; color: #163f56; }
.saj-geonav-suggestion small,
.saj-geonav-suggestion em { font-size: 10px; line-height: 1.6; color: #667d8a; font-style: normal; }
.saj-geonav-suggestion.approximate,
.saj-geonav-suggestion.approximate em { color: #9a5b08; }
.saj-geonav-loading,
.saj-geonav-empty { padding: 8px 10px; color: #617887; font-size: 11px; line-height: 1.8; }
.saj-geonav-status { min-height: 18px; color: #236078; font-size: 11px; line-height: 1.8; }
.saj-geonav-status.error { color: #b42318; }
.saj-geonav-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.saj-geonav-primary,
.saj-geonav-secondary,
.saj-geonav-mini {
  min-height: 38px; padding: 8px 11px; border: 1px solid #0d7488; border-radius: 9px;
  background: #087e91; color: #fff; font-size: 11px; font-weight: 700; cursor: pointer;
}
.saj-geonav-secondary { border-color: #c6d5de; background: #f5f8fa; color: #38566a; }
.saj-geonav-mini { min-height: 30px; padding: 5px 8px; font-size: 10px; }
.saj-geonav-mini.danger { border-color: #efc3c3; background: #fff3f3; color: #a61b1b; }
.saj-geonav-panel button:disabled { opacity: .45; cursor: not-allowed; }
.saj-geonav-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.saj-geonav-tab { min-height: 36px; padding: 6px 5px; border: 1px solid #cbd9e1; border-radius: 8px; background: #f7fafb; color: #405d70; font-size: 10px; font-weight: 700; cursor: pointer; }
.saj-geonav-tab.active { border-color: #087e91; background: #e7f6f8; color: #075b6b; }
.saj-geonav-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.saj-geonav-grid[hidden] { display: none !important; }
.saj-geonav-grid .saj-geonav-field { min-width: 0; }
.saj-geonav-grid .saj-geonav-field input { min-width: 0; }
.saj-geonav-dms-axis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; min-width: 0; padding: 9px; border: 1px solid #d8e3e9; border-radius: 10px; }
.saj-geonav-dms-axis legend { padding: 0 5px; color: #31586d; font-size: 11px; font-weight: 800; }
.saj-geonav-coordinate-preview { padding: 9px 10px; border: 1px dashed #9fc4ce; border-radius: 9px; background: #f4fbfc; color: #15566a; direction: rtl; font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
.saj-geonav-checkbox { display: flex; align-items: flex-start; gap: 8px; color: #38566a; font-size: 11px; line-height: 1.8; cursor: pointer; }
.saj-geonav-checkbox input { flex: 0 0 auto; width: 16px; height: 16px; margin: 3px 0 0; accent-color: #087e91; }
.saj-geonav-markers { display: flex; flex-direction: column; gap: 7px; padding-top: 9px; border-top: 1px solid #e4ebef; }
.saj-geonav-markers > strong { color: #234e63; font-size: 12px; }
.saj-geonav-marker-list { display: flex; flex-direction: column; gap: 6px; }
.saj-geonav-marker-row { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; padding: 7px; border: 1px solid #e0e9ee; border-radius: 8px; font-size: 10px; }
.saj-geonav-marker-row > span { flex: 1 1 100px; min-width: 0; overflow-wrap: anywhere; }

/* Toolbar controls beside the map's current-location button. */
.saj-geonav-toolbar-button {
  display: inline-flex !important; flex: 0 0 50px !important; align-items: center; justify-content: center;
  width: 50px !important; min-width: 50px !important; height: 50px !important; min-height: 50px !important;
  margin: 0 !important; padding: 0 !important; border: 2px solid #cbd5e1 !important; border-radius: 16px !important;
  background: #fff !important; color: #1e3a8a !important; font-size: 28px !important; font-weight: 700;
  line-height: 1; box-shadow: 0 6px 20px rgba(0,0,0,.18) !important;
  pointer-events: auto !important; touch-action: manipulation; position: relative; z-index: 100055; cursor: pointer !important;
}
.saj-geonav-toolbar-button:hover { background: #eff8fb !important; border-color: #14869a !important; }
.saj-geonav-toolbar-button > span { pointer-events: none; }
.saj-geonav-toolbar-fallback {
  position: absolute; inset-block-start: 12px; inset-inline-end: 12px; z-index: 100055;
  display: flex; flex-direction: column; gap: 7px; pointer-events: auto;
}
.saj-geonav-panel { pointer-events: auto !important; }

@media (max-width: 600px) {
  .saj-geonav-panel {
    inset-block-start: max(8px, env(safe-area-inset-top, 0px)) !important;
    inset-inline: 8px !important; width: auto; max-width: none;
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)));
    padding: 11px; border-radius: 13px;
  }
  .saj-geonav-head { margin: -11px -11px 0; padding: 10px 11px; inset-block-start: -11px; }
  .saj-geonav-grid { gap: 6px; }
  .saj-geonav-dms-axis { padding: 7px; gap: 5px; }
}

/* Stage168 / Task120: visible licensing/source note for the no-key geocoder. */
.saj-geonav-attribution{display:block;margin:2px 0;padding:7px 9px;border:1px solid #d5e3e8;border-radius:8px;background:#f6fafb;color:#526977;font-size:10px;line-height:1.8;text-align:center}
.saj-geonav-attribution a{color:#176b86;text-decoration:underline;text-underline-offset:2px}




/* Stage172 / Task124: live in-panel OSM/Photon search status and results. */
.saj-geonav-suggestions[aria-busy="true"]{opacity:.82}
.saj-geonav-suggestion small{direction:rtl;unicode-bidi:plaintext}
.saj-geonav-attribution{font-size:10px;line-height:1.9}
