:root,
[data-appearance="day"] {
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-2: #f4f6f8;
  --border: #d5dde5;
  --text: #1f2933;
  --text-muted: #52606d;
  --accent: #245b4a;
  --accent-glow: rgba(36, 91, 74, 0.2);
  --map-canvas: #f7f5f0;
  --map-stroke: #3d4f5f;
  --water-stroke: rgba(255, 255, 255, 0.9);
  --shadow: 0 6px 18px rgba(31, 41, 51, 0.07);
  --glass-blur: 10px;
  --sidebar-w: 340px;
  --radius: 10px;
  --transition: 0.25s ease;
}

[data-appearance="night"] {
  --bg: #12181f;
  --surface: #1a222c;
  --surface-solid: #1e2732;
  --surface-2: #151c24;
  --border: #2f3b48;
  --text: #e8eef4;
  --text-muted: #9aa8b5;
  --accent: #3d9b7a;
  --accent-glow: rgba(61, 155, 122, 0.2);
  --map-canvas: #101820;
  --map-stroke: #c5d0db;
  --water-stroke: rgba(186, 230, 253, 0.45);
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: "Vazirmatn", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  display: block;
}

/* SVG ویژگی hidden را همیشه respekt نمی‌کند */
.icon[hidden],
svg.icon[hidden],
.btn .icon[hidden] {
  display: none !important;
}

.icon--brand {
  width: 1.45rem;
  height: 1.45rem;
  color: var(--accent);
  margin-top: 0.1rem;
}

.app {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* —— Sidebar —— */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform var(--transition), margin var(--transition);
  z-index: 20;
}

.sidebar__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.sidebar.is-collapsed {
  transform: translateX(100%);
  margin-left: calc(-1 * var(--sidebar-w));
}

.sidebar__head {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.1rem 1rem 0.65rem;
}

.brand {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.sidebar__head h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.sidebar__sub {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.sidebar__toggle {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-solid);
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.sidebar__toggle:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 16px var(--accent-glow);
}

.save-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 1rem 0.5rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 999px;
  border: 1px solid var(--border);
}

.save-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  transition: background 0.3s, box-shadow 0.3s;
}

.save-status.is-saved .save-status__dot {
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.sidebar__tools {
  padding: 0 1rem 0.5rem;
}

.search-wrap {
  position: relative;
  display: block;
}

.icon--search {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  padding: 0.65rem 2.2rem 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 1rem 0.65rem;
  font-size: 0.82rem;
}

.breadcrumb__pill {
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--accent);
  font-weight: 600;
}

.breadcrumb__pill:hover {
  border-color: var(--accent);
}

.breadcrumb__sep {
  color: var(--text-muted);
}

.breadcrumb__current {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  font-weight: 700;
}

.panel {
  padding: 0 1rem 0.85rem;
}

.panel--list {
  padding-bottom: 0.25rem;
}

.panel__title {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.chip-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  scrollbar-width: thin;
}

.chip-row--mono {
  margin-bottom: 0.65rem;
}

.chip-row--mono .chip {
  font-size: 0.7rem;
  padding: 0.34rem 0.58rem;
}

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.38rem 0.65rem;
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-solid);
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chip--ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-style: dashed;
  color: var(--accent);
}

.icon--chip {
  width: 0.9rem;
  height: 0.9rem;
}

.btn {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn--soft {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.btn--soft:hover {
  transform: translateY(-1px);
}

.btn--block {
  width: 100%;
}

.btn--outline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon--theme {
  width: 1rem;
  height: 1rem;
}

.water-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
  width: 100%;
}

.water-tile {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.water-tile__swatch {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
}

.water-tile__swatch input[type="color"] {
  position: absolute;
  inset: -6px;
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  border: none;
  cursor: pointer;
}

.water-tile__label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.25;
}

.color-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0.75rem;
}

.color-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.25rem 0.55rem;
  align-items: center;
  padding: 0.55rem 0.5rem;
  margin-bottom: 0.25rem;
  border-radius: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.color-item:hover {
  background: rgba(255, 255, 255, 0.75);
  border-color: var(--border);
  transform: translateX(-2px);
}

.color-item.is-active {
  background: var(--surface-2);
  border-color: var(--accent);
}

.color-item__swatch {
  grid-row: 1 / span 2;
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  cursor: pointer;
}

.color-item__swatch input[type="color"] {
  position: absolute;
  inset: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  border: none;
  cursor: pointer;
}

.color-item__name {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
}

.color-item__hex {
  grid-column: 2;
  width: 100%;
  max-width: 7.5rem;
  padding: 0.2rem 0.45rem;
  font-family: ui-monospace, monospace;
  font-size: 0.68rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: default;
}

.color-item__hex:disabled {
  opacity: 1;
}

.color-item--compact {
  grid-template-columns: auto 1fr;
  grid-template-rows: auto;
}

.color-item__badge {
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--surface-solid);
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.sidebar__foot {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.5;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar__foot-ctas {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  align-items: stretch;
}

.sidebar__foot-ctas > .btn {
  flex: 1;
  min-width: 0;
}

.sidebar__foot a {
  color: inherit;
  text-decoration: none;
}

.btn--viewer-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #2f6f5b, #245b4a);
  color: #fff !important;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(36, 91, 74, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.btn--viewer-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(36, 91, 74, 0.4);
}

.btn--viewer-cta--alt {
  background: linear-gradient(135deg, #0369a1, #0c4a6e);
  box-shadow: 0 8px 22px rgba(3, 105, 161, 0.35);
}

.btn--viewer-cta--alt:hover {
  box-shadow: 0 10px 26px rgba(3, 105, 161, 0.45);
}

.btn--icon {
  width: 2.35rem;
  min-width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn--icon .icon {
  width: 1.15rem;
  height: 1.15rem;
}

.btn--block {
  width: 100%;
}

/* —— Map —— */
.map-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
}

.map-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "left actions"
    "address address";
  gap: 0.55rem 0.75rem;
  align-items: center;
  padding: 0.55rem 0.85rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.map-toolbar__left {
  grid-area: left;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.map-toolbar__actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  align-items: center;
}

.map-toolbar .address-bar {
  grid-area: address;
  max-width: none;
  width: 100%;
}

@media (min-width: 960px) {
  .map-toolbar {
    grid-template-columns: auto minmax(220px, 1fr) auto;
    grid-template-areas: "left address actions";
    padding: 0.65rem 1.1rem;
  }

  .map-toolbar .address-bar {
    max-width: 520px;
    justify-self: center;
  }
}

.map-toolbar__hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.map-toolbar__actions .btn {
  font-size: 0.75rem;
  padding: 0.35rem 0.55rem;
}

.map-toolbar__actions .btn .icon {
  width: 1rem;
  height: 1rem;
}

@media (max-width: 720px) {
  .map-toolbar__actions .btn span {
    display: none;
  }

  .map-toolbar__actions .btn {
    min-width: 2.25rem;
    justify-content: center;
  }

  .address-bar__input {
    font-size: 0.8rem;
  }
}

.live-pill {
  display: inline-flex;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  color: var(--accent);
}

.map-viewport {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: var(--map-canvas);
  transition: background 0.35s ease;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

#mapSvg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  touch-action: none;
}

.water {
  stroke: var(--water-stroke);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  pointer-events: visiblePainted;
  opacity: 1;
}

.lake {
  stroke: rgba(14, 165, 233, 0.65);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
  opacity: 1;
}

.water--caspian {
  animation: water-shimmer 8s ease-in-out infinite;
}

.water--persian_gulf,
.water--gulf_oman {
  animation: water-shimmer 10s ease-in-out infinite reverse;
}

@keyframes water-shimmer {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.08);
  }
}

.region {
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 0.75;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: filter 0.2s, stroke-width 0.2s, opacity 0.3s;
}

.region.is-province {
  stroke-width: 1;
}

.region.is-district {
  stroke-width: 0.65;
}

.region.is-county.is-city-entry {
  stroke: var(--accent);
  stroke-width: 1.2;
}

.region:hover {
  filter: brightness(1.06) saturate(1.08);
  stroke: #fff;
  stroke-width: 1.35;
}

.region.is-dimmed {
  opacity: 0.28;
  pointer-events: none;
}

.region.is-highlight {
  filter: brightness(1.1) saturate(1.15);
  stroke: #245b4a;
  stroke-width: 1.6;
}

[data-appearance="night"] .province-label {
  fill: #e2e8f0;
  stroke: rgba(15, 23, 42, 0.85);
}

.province-label {
  fill: #0f172a;
  font-size: 8px;
  font-weight: 700;
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: central;
  writing-mode: horizontal-tb;
  opacity: 0;
  paint-order: stroke fill;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 2px;
  transition: opacity 0.35s;
}

.province-label.is-visible {
  opacity: 0.75;
}

[data-appearance="night"] .county-label {
  fill: #f1f5f9;
  stroke: rgba(15, 23, 42, 0.9);
}

.county-label {
  fill: #0f172a;
  font-size: 9px;
  font-weight: 600;
  pointer-events: none;
  text-anchor: middle;
  paint-order: stroke fill;
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 2.5px;
  opacity: 0;
  transition: opacity 0.4s;
}

.county-label.is-visible {
  opacity: 1;
}

.map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(240, 249, 255, 0.9);
  z-index: 10;
  transition: opacity 0.4s, visibility 0.4s;
}

.map-loading.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid #cbd5e1;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.tooltip {
  position: fixed;
  z-index: 100;
  padding: 0.45rem 0.75rem;
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 500;
  pointer-events: none;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.25);
  transform: translate(-50%, -120%);
  white-space: pre-line;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 200;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.25);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.is-show {
  transform: translateX(-50%) translateY(0);
}

.floating-open-sidebar {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  z-index: 30;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  display: none;
  align-items: center;
  justify-content: center;
}

.sidebar.is-collapsed + .map-stage .floating-open-sidebar {
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-mode {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

.viewer-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--map-canvas);
  display: flex;
  flex-direction: column;
}

.viewer-mode .map-viewport--viewer {
  flex: 1;
  min-height: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

.viewer-mode .address-panel {
  top: auto;
  bottom: 1rem;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(340px, calc(100% - 2rem));
  max-width: 340px;
  z-index: 30;
  padding: 0.4rem;
  gap: 0.35rem;
}

.viewer-mode .address-panel__input {
  font-size: 0.82rem;
  padding: 0.4rem 0.55rem;
}

.viewer-mode .address-panel__btn {
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

.viewer-mode .address-result--viewer {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(340px, calc(100% - 2rem));
  bottom: 4.25rem;
}

.viewer-mode .sales-legend {
  display: none !important;
}

.street-map {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  background: #e2e8f0;
}

.street-map.is-active {
  display: block;
}

.map-viewport.is-street-mode #mapSvg {
  display: none;
}

.map-viewport.is-street-mode .tooltip {
  display: none !important;
}

.map-viewport--viewer {
  width: 100%;
  height: 100%;
  padding: 3vh 2vw;
  box-sizing: border-box;
}

.map-stage .map-viewport {
  padding: 2vh 1.25vw;
  box-sizing: border-box;
}

.viewer-nav {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 41;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  max-width: min(96vw, 640px);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
}

.viewer-nav .breadcrumb__current {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  padding: 0.15rem 0.35rem;
}

.region.is-micro {
  stroke-width: 0.55;
}

.region.is-district.is-sub-entry {
  stroke: #245b4a;
  stroke-width: 1.15;
}

.map-marker__dot {
  fill: #dc2626;
  stroke: #fff;
  stroke-width: 2px;
}

.map-marker__pulse {
  fill: rgba(220, 38, 38, 0.25);
  stroke: none;
}

.address-bar {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 0.5rem;
  align-items: center;
  max-width: 520px;
}

.address-bar.is-disabled,
.address-panel.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.address-bar__input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  font-family: inherit;
  font-size: 0.85rem;
  background: var(--surface-solid);
  color: var(--text);
}

.address-panel {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 35;
  display: flex;
  gap: 0.5rem;
  padding: 0.55rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
}

.address-panel__input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  font-family: inherit;
  font-size: 0.9rem;
}

.address-panel__btn {
  border: none;
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}

.address-result {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 4.5rem;
  z-index: 34;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
}

.address-result--viewer {
  bottom: 4.75rem;
}

.address-result__text {
  margin: 0 0 0.35rem;
  font-weight: 600;
  line-height: 1.45;
}

.address-result__coords {
  margin: 0;
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  opacity: 0.85;
  direction: ltr;
  text-align: left;
}

.viewer-back {
  position: fixed;
  top: 3.65rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.water-label {
  fill: #0369a1;
  font-size: 12px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  writing-mode: horizontal-tb;
  pointer-events: none;
  paint-order: stroke fill;
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 3px;
  stroke-linejoin: round;
}

[data-appearance="night"] .water-label {
  fill: #7dd3fc;
  stroke: rgba(15, 23, 42, 0.9);
}

@media (max-width: 768px) {
  :root {
    --sidebar-w: min(100vw, 320px);
  }

  .sidebar {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
  }

  .sidebar.is-collapsed {
    transform: translateX(100%);
    margin-left: 0;
  }
}
