/*
 * sf-index.css — pagina-hartă (index.php) a „Hărții social-filantropice” (BOR).
 * Se încarcă după /css/sf-theme.css. Sursa: design-system/…/MASTER.md + pages/index.md.
 * Layout: desktop = panou de filtre (aside, 380px / 320px pe tabletă) + hartă edge-to-edge;
 *         mobil (< 768px) = hartă pe tot ecranul + buton „Filtre” care deschide panoul ca bottom sheet.
 */

/* ============================== Layout de bază (pagină fără scroll, hartă pe toată înălțimea) ============================== */
html, body.sf-map-page { height: 100%; }
body.sf-map-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
}
.sf-map-page .sf-topbar, .sf-map-page .sf-header { flex: 0 0 auto; }
.sf-app {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--sf-sidebar-w) minmax(0, 1fr);
}
@media (min-width: 768px) and (max-width: 991px) {
  .sf-app { grid-template-columns: 320px minmax(0, 1fr); }
}

/* Header: contorul de centre */
.sf-idx-count { white-space: nowrap; }
.sf-idx-count .sf-icon { color: var(--sf-gold-2); }
/* ecrane înguste: doar pin + număr (textul rămâne pentru cititoarele de ecran) */
@media (max-width: 479px) {
  .sf-idx-count { gap: 4px; padding-left: 10px; padding-right: 10px; }
  .sf-idx-count__w {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
}

/* ============================== Panoul de filtre ============================== */
.sf-panel {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--sf-surface);
  border-right: 1px solid var(--sf-line);
  box-shadow: 4px 0 16px rgba(34, 53, 128, .08);
}
.sf-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sf-space-3);
  padding: var(--sf-space-5) var(--sf-space-5) var(--sf-space-3);
}
.sf-panel__title {
  font-size: 26px;
  margin: 0 0 6px;
}
.sf-panel__sub {
  margin: 0;
  font-family: var(--sf-font-ui);
  font-size: 14px;
  line-height: 1.45;
  color: var(--sf-muted);
}
.sf-panel__close { display: none; margin: -6px -10px 0 0; }

.sf-panel__form {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
}
.sf-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  overflow-anchor: none;
  padding: var(--sf-space-2) var(--sf-space-5) var(--sf-space-4);
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 53, 128, .25) transparent;
}
/* #rezultate_form2 (pastila de sus, moștenită) dubla mesajul din subsolul fix (#rezultate_form, mereu vizibil): ascunsă.
   Elementul rămâne în pagină (contract: pages/index.md); specificitatea bate #rezultate_form2.alert din sf-theme.css. */
.sf-panel__body > #rezultate_form2,
.sf-panel__body > #rezultate_form2.alert { display: none; }

.sf-group {
  margin: var(--sf-space-5) 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.sf-group__title {
  display: flex;
  align-items: center;
  gap: var(--sf-space-3);
  width: 100%;
  margin: 0 0 var(--sf-space-3);
  padding: 0;
  border: 0;
  font-family: var(--sf-font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  color: var(--sf-gold-text);
}
.sf-group__title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--sf-line);
}
.sf-panel .sf-field { margin-bottom: var(--sf-space-4); }
.sf-panel .sf-field:last-child { margin-bottom: 0; }
.sf-panel input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

/* până la inițializarea multiselect-ului, select-urile native nu „clipesc” (doar cu JS activ) */
.sf-js .sf-panel select[multiple] { display: none; }

.sf-panel__foot {
  position: relative;
  z-index: 995; /* peste .dropdown-backdrop (BS3, ecrane tactile): „Afișează pe hartă” rămâne apăsabil */
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sf-space-3);
  padding: var(--sf-space-4) var(--sf-space-5);
  border-top: 1px solid var(--sf-line);
  background: var(--sf-cream-2);
}
.sf-panel__foot #rezultate_form { align-self: flex-start; }
.sf-panel__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sf-space-2) var(--sf-space-3);
}
.sf-panel__actions #submit { flex: 1 1 auto; }
.sf-panel__reset { padding-left: 14px; padding-right: 14px; }
.sf-panel__footer {
  flex: 0 0 auto;
  padding: var(--sf-space-2) var(--sf-space-5) var(--sf-space-3);
  background: var(--sf-cream-2);
  font-family: var(--sf-font-ui);
  font-size: 12px;
  color: var(--sf-muted);
}
.sf-panel__footer p { margin: 0; }

/* pill-urile de rezultate: icon + text, starea de calcul */
#rezultate_form .sf-icon, #rezultate_form2 .sf-icon { width: 16px; height: 16px; }
#rezultate_form.alert-info, #rezultate_form2.alert-info { color: var(--sf-navy); background: var(--sf-navy-50); }
.sf-spin { animation: sf-spin 900ms linear infinite; }
@keyframes sf-spin { to { transform: rotate(360deg); } }

/* ============================== bootstrap-multiselect restilizat ca input ============================== */
.sf-panel .btn-group {
  display: block;
  width: 100%;
  position: relative;
}
.sf-panel .multiselect.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: var(--sf-input-h);
  padding: 0 12px 0 14px;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius-md);
  background: var(--sf-surface);
  background-image: none;
  box-shadow: none;
  text-shadow: none;
  color: var(--sf-text-body);
  font-family: var(--sf-font-ui);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.3;
  text-align: left;
  white-space: nowrap;
  transition: border-color var(--sf-dur) var(--sf-ease), box-shadow var(--sf-dur) var(--sf-ease);
}
.sf-panel .multiselect.dropdown-toggle:hover { border-color: rgba(34, 53, 128, .45); background: var(--sf-surface); }
.sf-panel .multiselect.dropdown-toggle:focus,
.sf-panel .multiselect.dropdown-toggle:focus-visible,
.sf-panel .open > .multiselect.dropdown-toggle {
  outline: none;
  border-color: var(--sf-navy);
  box-shadow: var(--sf-focus-ring);
  background: var(--sf-surface);
}
.sf-panel .multiselect-selected-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sf-panel .multiselect.is-active { border-color: rgba(34, 53, 128, .55); }
.sf-panel .multiselect.is-active .multiselect-selected-text { color: var(--sf-navy); font-weight: 700; }
.sf-panel .multiselect .caret {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin: -4px 2px 0 0;
  border: 0;
  border-right: 1.75px solid var(--sf-navy);
  border-bottom: 1.75px solid var(--sf-navy);
  transform: rotate(45deg);
  transition: transform var(--sf-dur) var(--sf-ease);
}
.sf-panel .open > .multiselect .caret { transform: rotate(-135deg); margin-top: 4px; }

/* dropdown-ul: în fluxul panoului (nu e tăiat de scroll-ul panoului), lățimea butonului.
   position:relative + z-index peste .dropdown-backdrop (z 990) pe care BS3 îl adaugă pe ecrane tactile. */
.sf-panel .multiselect-container.dropdown-menu {
  position: relative;
  top: auto;
  left: auto;
  z-index: 1000;
  float: none;
  width: 100%;
  min-width: 0;
  max-height: 320px;
  margin: 6px 0 0;
  padding: 6px 0;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius-md);
  background: var(--sf-surface);
  box-shadow: var(--sf-shadow-2);
  font-family: var(--sf-font-ui);
  font-size: 15px;
  overscroll-behavior: contain;
}
.sf-panel .multiselect-container > li > a {
  display: block;
  padding: 0;
  color: var(--sf-text-body);
  white-space: normal;
  cursor: pointer;
}
.sf-panel .multiselect-container > li > a > label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 40px;
  margin: 0;
  padding: 9px 14px;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.35;
  color: inherit;
  cursor: pointer;
}
.sf-panel .multiselect-container > li > a > label > input[type="checkbox"] {
  flex: 0 0 auto;
  position: static;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--sf-navy);
  cursor: pointer;
}
.sf-panel .multiselect-container > li > a:hover,
.sf-panel .multiselect-container > li > a:focus {
  background: var(--sf-navy-50);
  color: var(--sf-navy);
  outline: none;
}
.sf-panel .multiselect-container > li > a:focus-visible { box-shadow: inset 0 0 0 2px var(--sf-navy); }
.sf-panel .multiselect-container > li.active > a,
.sf-panel .multiselect-container > li.active > a:hover,
.sf-panel .multiselect-container > li.active > a:focus {
  background: var(--sf-navy-50);
  color: var(--sf-navy);
}
.sf-panel .multiselect-container > li.active > a > label { font-weight: 700; }
/* opțiuni dezactivate (ar da 0 rezultate) */
.sf-panel .multiselect-container > li.disabled > a,
.sf-panel .multiselect-container > li.disabled > a:hover,
.sf-panel .multiselect-container > li.disabled > a:focus { background: transparent; cursor: not-allowed; }
.sf-panel .multiselect-container > li.disabled > a > label,
.sf-panel .multiselect-container > li.disabled > a > label > input { opacity: .45; cursor: not-allowed; }
/* optgroup */
.sf-panel .multiselect-container > li.multiselect-group > label {
  display: block;
  margin: 0;
  padding: 12px 14px 4px;
  font-family: var(--sf-font-ui);
  font-weight: 700;
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--sf-muted);
}
.sf-panel .multiselect-container > li.multiselect-group-clickable > label { cursor: pointer; }
.sf-panel .multiselect-container > li.multiselect-group-clickable > label:hover { color: var(--sf-navy); }
/* câmpul de filtrare din dropdown */
.sf-panel .multiselect-container > li.filter {
  position: sticky;
  top: -6px;
  z-index: 1;
  margin-top: -6px;
  padding: 10px 10px 8px;
  background: var(--sf-surface);
  border-bottom: 1px solid var(--sf-border);
}
.sf-panel .sf-ms-filter { position: relative; display: flex; align-items: center; width: 100%; border-collapse: separate; }
.sf-ms-filter > .sf-icon {
  position: absolute;
  z-index: 3;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--sf-muted);
  pointer-events: none;
}
.sf-panel .sf-ms-filter .form-control.multiselect-search {
  float: none;
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 40px 0 36px;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius-md);
  background: var(--sf-cream-2);
  box-shadow: none;
  color: var(--sf-text-body);
  font-family: var(--sf-font-ui);
  font-weight: 500;
  font-size: 15px;
}
.sf-panel .sf-ms-filter .multiselect-search::placeholder { color: var(--sf-muted); opacity: 1; }
.sf-panel .sf-ms-filter .form-control.multiselect-search:focus { outline: none; border-color: var(--sf-navy); box-shadow: var(--sf-focus-ring); background: var(--sf-surface); }
.sf-panel .sf-ms-filter .input-group-btn.sf-ms-filter__btn {
  position: absolute;
  z-index: 3;
  right: 2px;
  top: 50%;
  display: block;
  width: auto;
  margin-top: -18px;
  font-size: inherit;
}
.sf-ms-filter__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--sf-radius-pill);
  background: transparent;
  color: var(--sf-muted);
  cursor: pointer;
}
.sf-ms-filter__clear:hover { color: var(--sf-navy); background: var(--sf-navy-50); }
.sf-ms-filter__clear .sf-icon { width: 16px; height: 16px; }

/* ============================== Harta ============================== */
.sf-mapwrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #E8E6E1;
}
#map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* starea de încărcare */
.sf-map-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 240, 234, .55);
  transition: opacity 250ms var(--sf-ease), visibility 0s linear 250ms;
}
.sf-map-loading.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.sf-map-loading__card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--sf-radius-pill);
  background: var(--sf-surface);
  box-shadow: var(--sf-shadow-2);
  font-family: var(--sf-font-ui);
  font-weight: 700;
  font-size: 14px;
  color: var(--sf-navy);
}
.sf-map-loading__card .sf-icon { width: 18px; height: 18px; }
.sf-map-loading.is-error .sf-map-loading__card { color: var(--sf-danger); }
.sf-map-loading.is-error .sf-spin { display: none; }

/* starea goală (0 rezultate) */
.sf-map-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sf-space-5);
  pointer-events: none;
}
.sf-map-empty__card {
  max-width: 420px;
  text-align: center;
  pointer-events: auto;
  box-shadow: var(--sf-shadow-2);
}
.sf-map-empty__icon { width: 32px; height: 32px; color: var(--sf-gold-2); margin-bottom: var(--sf-space-2); }
.sf-map-empty__text { font-size: 18px; color: var(--sf-muted); }

/* ============================== Info-window (markup din samelocation(), neschimbat) ============================== */
.gm-style .gm-style-iw-c { border-radius: var(--sf-radius-md); box-shadow: var(--sf-shadow-2); padding: 14px 16px 2px !important; }
.gm-style .gm-style-iw-d { overflow: auto !important; }
.gm-style .gm-style-iw-chr { margin-bottom: -40px; }
.gm-style .gm-style-iw-chr > .gm-style-iw-ch { padding-top: 0; }
.sf-iw {
  max-width: 300px;
  font-family: var(--sf-font-serif);
  font-size: 16px;
  line-height: 1.45;
  color: var(--sf-text-body);
}
.sf-iw .sf-iw__content { padding-right: 44px; }
.sf-iw .sf-iw__content + .sf-iw__content { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--sf-line); padding-right: 0; }
.sf-iw .firstHeading,
.sf-iw .sf-iw__firstHeading {
  display: block;
  margin: 0 0 8px;
  font-family: var(--sf-font-display);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--sf-navy);
}
.sf-iw .sf-iw__bodyContent img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2px 0 10px;
  border-radius: var(--sf-radius-md);
}
.sf-iw p { margin: 0 0 6px; }
.sf-iw b { font-family: var(--sf-font-ui); font-weight: 700; font-size: 13px; color: var(--sf-navy); }
.sf-iw a {
  color: var(--sf-navy);
  font-family: var(--sf-font-ui);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sf-iw a:hover, .sf-iw a:focus { color: var(--sf-navy-700); text-decoration-thickness: 2px; }
.sf-iw .sf-iw__bodyContent > a { text-decoration: none; }
.sf-iw .sf-iw__gps {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  margin: 2px 0 8px;
}

/* cardul de cookies: pe desktop peste hartă, nu peste butoanele panoului */
@media (min-width: 768px) {
  .sf-map-page .cookie-bar { left: calc(var(--sf-sidebar-w) + var(--sf-space-5)); }
}
@media (min-width: 768px) and (max-width: 991px) {
  .sf-map-page .cookie-bar { left: calc(320px + var(--sf-space-4)); right: var(--sf-space-4); }
}

/* ============================== Butonul flotant „Filtre” + drawer (mobil) ============================== */
.sf-fab { display: none; }
.sf-drawer-overlay { display: none; }

@media (max-width: 767px) {
  .sf-app { display: block; }
  .sf-mapwrap { position: absolute; inset: 0; }

  .sf-fab {
    position: absolute;
    z-index: 6;
    left: 50%;
    bottom: calc(28px + var(--sf-fab-lift, 0px) + env(safe-area-inset-bottom, 0px));
    display: inline-flex;
    min-height: 48px;
    padding: 12px 22px;
    font-size: 13px;
    transform: translateX(-50%);
    box-shadow: var(--sf-shadow-2);
    transition: bottom var(--sf-dur) var(--sf-ease);
  }
  .sf-fab:active { transform: translateX(-50%) translateY(1px); }
  .sf-fab .sf-icon { width: 18px; height: 18px; }
  .sf-fab__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    margin-left: 2px;
    border-radius: var(--sf-radius-pill);
    background: var(--sf-gold);
    color: var(--sf-navy-700);
    font-size: 12px;
    letter-spacing: 0;
  }
  .sf-fab__badge[hidden] { display: none; }

  .sf-panel {
    position: fixed;
    z-index: 1100;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64vh;
    height: 64dvh;
    border-right: 0;
    border-radius: var(--sf-radius-lg) var(--sf-radius-lg) 0 0;
    box-shadow: 0 -12px 32px rgba(34, 53, 128, .2);
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 250ms var(--sf-ease), visibility 0s linear 250ms;
  }
  .sf-panel.is-open {
    transform: none;
    visibility: visible;
    transition: transform 250ms var(--sf-ease), visibility 0s;
  }
  .sf-panel::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 40px;
    height: 4px;
    margin-left: -20px;
    border-radius: 2px;
    background: var(--sf-border);
  }
  .sf-panel__head { padding: var(--sf-space-5) var(--sf-space-4) var(--sf-space-2); }
  .sf-panel__title { font-size: 24px; }
  .sf-panel__close { display: inline-flex; }
  .sf-panel__body { padding-left: var(--sf-space-4); padding-right: var(--sf-space-4); }
  .sf-panel__foot { padding: var(--sf-space-3) var(--sf-space-4) calc(var(--sf-space-3) + env(safe-area-inset-bottom, 0px)); }
  .sf-panel__footer { display: none; }

  .sf-drawer-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(26, 41, 102, .45);
    opacity: 0;
    transition: opacity 250ms var(--sf-ease);
  }
  .sf-drawer-overlay[hidden] { display: none; }
  .sf-drawer-overlay.is-visible { opacity: 1; }
  html.sf-drawer-open, html.sf-drawer-open body { overflow: hidden; overscroll-behavior: none; }

  .sf-iw { max-width: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  .sf-spin { animation: none; }
  .sf-panel, .sf-panel.is-open { transition: none; }
}

/* ============================== Ajustări finale (review) ============================== */
/* butonul „Închide filtrele”: 44×44 (rândul flex al antetului nu-l mai micșorează) */
.sf-panel__close { flex: 0 0 44px; }

/* ținte tactile ≥ 44px în listele multiselect */
.sf-panel .multiselect-container > li > a > label { min-height: 44px; padding-top: 11px; padding-bottom: 11px; }
.sf-panel .sf-ms-filter .form-control.multiselect-search { height: 44px; }
.sf-panel .sf-ms-filter .input-group-btn.sf-ms-filter__btn { right: 0; margin-top: -22px; }
.sf-ms-filter__clear { width: 44px; height: 44px; }


/* umbră deasupra zonei de acțiuni cât timp lista de filtre mai poate fi derulată */
.sf-panel__foot { box-shadow: 0 -10px 16px -12px rgba(34, 53, 128, .28); }
.sf-panel__foot.is-at-end { box-shadow: none; }

/* butonul „Filtre” (mobil): ridicat cu transform (nu „bottom”), fără layout shift */
@media (max-width: 767px) {
  .sf-fab {
    bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    transform: translate(-50%, calc(-1 * var(--sf-fab-lift, 0px)));
    transition: transform var(--sf-dur) var(--sf-ease);
  }
  .sf-fab:active { transform: translate(-50%, calc(1px - var(--sf-fab-lift, 0px))); }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .sf-fab:active { transform: translate(-50%, calc(-1 * var(--sf-fab-lift, 0px))); }
}

/* rezervă înălțimea câmpurilor multiselect (etichetă + buton 44px) până la inițializarea JS: fără layout shift */
.sf-js .sf-panel .sf-field:has(> select[multiple]) { min-height: 66px; }

/* ============================== Panoul cu tab-uri: „Caută” / „Eparhii” ============================== */
.sf-tabs {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  gap: 4px;
  min-height: 56px;
  padding: 0 var(--sf-space-5);
  border-bottom: 1px solid var(--sf-line);
  background: var(--sf-cream-2);
}
.sf-tabs__list { display: flex; align-items: stretch; gap: 4px; min-width: 0; }
.sf-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 -1px;
  padding: 0 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--sf-muted);
  font-family: var(--sf-font-ui);
  font-weight: 700;
  font-size: 12.5px;
  line-height: 1;
  letter-spacing: .09em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--sf-dur) var(--sf-ease), border-color var(--sf-dur) var(--sf-ease);
}
.sf-tab .sf-icon { width: 18px; height: 18px; }
.sf-tab:hover { color: var(--sf-navy); }
.sf-tab[aria-selected="true"] { color: var(--sf-navy); border-bottom-color: var(--sf-gold); }
.sf-tab:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--sf-navy); border-radius: var(--sf-radius-sm) var(--sf-radius-sm) 0 0; }
.sf-tab__badge {
  padding: 3px 7px;
  border-radius: var(--sf-radius-pill);
  background: var(--sf-navy-50);
  color: var(--sf-navy);
  font-size: 11px;
  letter-spacing: 0;
}
.sf-tabs .sf-panel__close { margin: 6px -10px 0 auto; align-self: center; }

.sf-tabpanel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.sf-tabpanel[hidden] { display: none; }
/* până la inițializarea JS: tab-ul salvat e afișat fără „clipire” */
.sf-js.sf-tab-eparhii .sf-tabpanel--cauta { display: none; }
.sf-js.sf-tab-eparhii .sf-tabpanel--eparhii[hidden] { display: flex; }
.sf-js.sf-tab-eparhii .sf-tab[data-tab="eparhii"] { color: var(--sf-navy); border-bottom-color: var(--sf-gold); }
.sf-js.sf-tab-eparhii .sf-tab[data-tab="cauta"] { color: var(--sf-muted); border-bottom-color: transparent; }
.sf-tabpanel--cauta .sf-panel__head { padding-top: var(--sf-space-4); }
.sf-tabpanel--cauta .sf-panel__title { margin: 0; }

/* filtrul de eparhie activ (același „chip” în ambele tab-uri); ✕ = resetarea filtrelor */
.sf-chip-row { flex: 0 0 auto; margin: 0 var(--sf-space-5) var(--sf-space-2); }
.sf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  max-width: 100%;
  padding: 4px 8px 4px 12px;
  border: 1px solid rgba(34, 53, 128, .3);
  border-radius: var(--sf-radius-pill);
  background: var(--sf-navy-50);
  color: var(--sf-navy);
  font-family: var(--sf-font-ui);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none;
}
.sf-chip__t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-chip .sf-icon { flex: 0 0 auto; width: 15px; height: 15px; }
.sf-chip:hover { background: #DCE1F1; color: var(--sf-navy-700); text-decoration: none; }
.sf-chip:focus-visible { outline: none; box-shadow: var(--sf-focus-ring); }

/* mânerul de restrângere (marginea dreaptă a panoului; rămâne vizibil și cu panoul restrâns) */
.sf-collapse {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 56px;
  margin-top: -28px;
  padding: 0;
  border: 1px solid var(--sf-line);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  background: #fff;
  color: var(--sf-navy);
  box-shadow: 4px 0 10px rgba(34, 53, 128, .1);
  cursor: pointer;
}
.sf-collapse .sf-icon { width: 16px; height: 16px; transition: transform var(--sf-dur) var(--sf-ease); }
.sf-collapse:hover { background: var(--sf-navy-50); }
.sf-collapse:focus-visible { outline: none; box-shadow: var(--sf-focus-ring); }
.sf-panel-collapsed .sf-collapse .sf-icon { transform: rotate(180deg); }
@media (min-width: 768px) {
  html.sf-panel-collapsed .sf-app { grid-template-columns: 0 minmax(0, 1fr); }
  html.sf-panel-collapsed .sf-panel { visibility: hidden; overflow: hidden; border-right: 0; box-shadow: none; }
  html.sf-panel-collapsed body.sf-map-page .cookie-bar { left: var(--sf-space-5); }
}

/* ============================== Tab-ul „Eparhii”: arborele mitropolii → eparhii ============================== */
.sf-terr {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: var(--sf-space-3);
  font-family: var(--sf-font-ui);
}
.sf-terr__head {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sf-space-3);
  padding: var(--sf-space-2) var(--sf-space-5) var(--sf-space-2);
}
.sf-terr__title {
  margin: 0;
  font-family: var(--sf-font-ui);
  font-weight: 700;
  font-size: 11.5px;
  line-height: 1.3;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sf-muted);
}
.sf-terr__total {
  font-family: var(--sf-font-serif);
  font-style: italic;
  font-size: 16px;
  white-space: nowrap;
  color: var(--sf-gold-text);
}
.sf-terr__tree {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 0 var(--sf-space-4) var(--sf-space-4);
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 53, 128, .25) transparent;
}
.sf-terr__list, .sf-terr__eps { margin: 0; padding: 0; list-style: none; }
.sf-terr__mrow {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  margin-top: 2px;
  padding-left: 4px;
  border-radius: 10px;
}
.sf-terr__exp {
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--sf-radius-sm);
  background: transparent;
  color: var(--sf-muted);
  cursor: pointer;
}
.sf-terr__exp .sf-icon { width: 16px; height: 16px; transition: transform var(--sf-dur) var(--sf-ease); }
.sf-terr__exp[aria-expanded="true"] .sf-icon { transform: rotate(90deg); }
.sf-terr__exp:hover { color: var(--sf-navy); }
.sf-terr__mrow > .sf-terr__row { flex: 1 1 auto; min-width: 0; }
.sf-terr__row { display: flex; align-items: center; gap: 2px; min-width: 0; border-radius: 10px; }
.sf-terr__eps .sf-terr__row { min-height: 44px; margin-top: 2px; padding-left: 34px; }
.sf-terr__mrow:has(:focus-visible),
.sf-terr__eps .sf-terr__row:has(:focus-visible) { background: var(--sf-navy-50); }
@media (hover: hover) {
  .sf-terr__mrow:hover, .sf-terr__eps .sf-terr__row:hover, .sf-terr__row--fara:hover { background: var(--sf-navy-50); }
  .sf-terr__mrow:hover .sf-terr__n, .sf-terr__eps .sf-terr__row:hover .sf-terr__n { background: #fff; }
}
.sf-terr__go {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 8px 6px 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--sf-text-body);
  text-align: left;
  cursor: pointer;
}
.sf-terr__name { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 500; line-height: 1.25; color: #2A3460; }
.sf-terr__mrow .sf-terr__name { font-weight: 800; color: var(--sf-navy); }
.sf-terr__n {
  flex: 0 0 auto;
  min-width: 30px;
  padding: 3px 9px;
  border-radius: var(--sf-radius-pill);
  background: var(--sf-navy-50);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--sf-navy);
}
.sf-terr__mrow:has(:focus-visible) .sf-terr__n, .sf-terr__eps .sf-terr__row:has(:focus-visible) .sf-terr__n { background: #fff; }
.sf-terr__n.is-zero { background: transparent; color: var(--sf-muted); font-weight: 600; }
.sf-terr__sw {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--sw);
  background: color-mix(in srgb, var(--sw) 70%, #F4F0EA);
  border: 2px solid var(--sw-b);
}
.sf-terr__sw--ep { border-width: 1px; }
.sf-terr__flt {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-right: 4px;
  padding: 0;
  border: 0;
  border-radius: var(--sf-radius-pill);
  background: transparent;
  color: var(--sf-navy);
  cursor: pointer;
}
.sf-terr__flt .sf-icon { width: 18px; height: 18px; }
.sf-terr__flt:hover { background: #fff; }
.sf-terr__go:focus-visible, .sf-terr__flt:focus-visible, .sf-terr__exp:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--sf-navy); }
.sf-terr__eps[hidden] { display: none; }
.sf-terr__row.is-selected .sf-terr__go,
.sf-terr__row--fara.is-selected { background: var(--sf-navy-50); box-shadow: inset 3px 0 0 var(--sf-gold); }
.sf-terr__row.is-selected .sf-terr__name { font-weight: 700; color: var(--sf-navy); }
/* „Vezi în listă”: rândul e evidențiat scurt */
.sf-terr__row.is-flash, .sf-terr__mrow > .sf-terr__row.is-flash { animation: sf-row-flash 2.4s var(--sf-ease) both; }
@keyframes sf-row-flash {
  0%, 35% { background: rgba(193, 157, 111, .38); box-shadow: inset 3px 0 0 var(--sf-gold); }
  100% { background: transparent; box-shadow: inset 3px 0 0 transparent; }
}
.sf-terr__subtitle {
  margin: 0;
  font-family: var(--sf-font-ui);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sf-muted);
}
.sf-terr__row--fara { gap: 6px; min-height: 44px; padding: 4px 0 4px 12px; }
.sf-terr__row--fara:has(:focus-visible) { background: var(--sf-navy-50); }
.sf-terr__info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.sf-terr__parent { font-size: 12px; line-height: 1.3; color: var(--sf-muted); }
.sf-terr__note { margin: 14px 8px 4px; font-size: 12px; line-height: 1.45; color: var(--sf-muted); }
.sf-terr__note .sf-icon { width: 13px; height: 13px; vertical-align: -2px; color: var(--sf-navy); }

/* secțiunea „Fără teritoriu pe hartă” (pliabilă) */
.sf-terr__fara { margin: 12px 8px 0; border-top: 1px solid var(--sf-line); }
.sf-terr__fara > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: 0;
  padding: 4px 6px 4px 0;
  list-style: none;
  cursor: pointer;
  border-radius: var(--sf-radius-sm);
}
.sf-terr__fara > summary::-webkit-details-marker { display: none; }
.sf-terr__fara > summary > span:nth-child(2) { flex: 1 1 auto; }
.sf-terr__fara > summary .sf-icon { width: 16px; height: 16px; color: var(--sf-muted); transition: transform var(--sf-dur) var(--sf-ease); }
.sf-terr__fara[open] > summary .sf-icon { transform: rotate(90deg); }
.sf-terr__fara > summary:hover { color: var(--sf-navy); }
.sf-terr__fara > summary:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--sf-navy); }
.sf-terr__fara > summary .sf-terr__n { letter-spacing: 0; }
.sf-terr__fara .sf-terr__list--fara { margin: 0 -8px; }

/* butonul „filtrează” al fiecărui rând: pe desktop apare la hover / focus / rândul selectat */
/* (fără loc rezervat: numărul ajunge la marginea dreaptă, ca în macheta aprobată) */
@media (hover: hover) and (pointer: fine) {
  .sf-terr__flt { width: 0; margin-right: 0; overflow: hidden; opacity: 0; transition: opacity var(--sf-dur) var(--sf-ease); }
  .sf-terr__row:hover .sf-terr__flt,
  .sf-terr__row:focus-within .sf-terr__flt,
  .sf-terr__row.is-selected .sf-terr__flt,
  .sf-terr__flt:focus-visible { width: 36px; margin-right: 4px; opacity: 1; }
  .sf-terr__row:focus-within .sf-terr__flt { transition: none; }
}

/* ============================== Harta: butonul „Straturi”, indicația unică, starea teritoriilor ============================== */
.sf-layers {
  position: absolute;
  z-index: 4;
  left: 16px;
  bottom: calc(44px + var(--sf-layers-lift, 0px)); /* deasupra logo-ului Google (obligatoriu) și a cardului de cookies */
  font-family: var(--sf-font-ui);
  transition: bottom var(--sf-dur) var(--sf-ease);
}
.sf-layers__btn {
  position: relative;
  display: block;
  width: 76px;
  height: 76px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 14px;
  overflow: hidden;
  background: #E8E6E1;
  box-shadow: 0 4px 16px rgba(34, 53, 128, .28);
  cursor: pointer;
  transition: transform var(--sf-dur) var(--sf-ease), box-shadow var(--sf-dur) var(--sf-ease);
}
.sf-layers__btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(34, 53, 128, .34); }
.sf-layers__btn:focus-visible { outline: 3px solid var(--sf-navy); outline-offset: 2px; }
.sf-layers__img {
  position: absolute;
  inset: 0;
  background: url("../data/teritorii/thumbs/ierarhic.jpg") center / cover no-repeat;
}
html[data-sf-mode="mitropolii"] .sf-layers__img { background-image: url("../data/teritorii/thumbs/mitropolii.jpg"); }
html[data-sf-mode="fara"] .sf-layers__img { background-image: url("../data/teritorii/thumbs/fara.jpg"); }
.sf-layers__lbl {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 0 6px;
  background: linear-gradient(rgba(26, 41, 102, 0), rgba(26, 41, 102, .88));
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  line-height: 1;
  letter-spacing: .04em;
}
.sf-layers__lbl .sf-icon { width: 13px; height: 13px; }
.sf-layers__pop {
  position: absolute;
  left: calc(100% + 12px);
  bottom: 0;
  padding: 14px 14px 12px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(34, 53, 128, .22);
}
.sf-layers__pop[hidden] { display: none; }
.sf-layers__pop:focus { outline: none; }
.sf-layers__hd {
  position: absolute;
  top: -36px;
  left: 0;
  margin: 0;
  padding: 7px 12px;
  border-radius: var(--sf-radius-pill);
  background: #fff;
  box-shadow: 0 4px 12px rgba(34, 53, 128, .15);
  color: var(--sf-navy);
  font-weight: 700;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.sf-layers__opts { display: flex; gap: 12px; }
.sf-layers__opt {
  position: relative;
  display: block;
  width: 96px;
  margin: 0;
  text-align: center;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--sf-muted);
  cursor: pointer;
}
.sf-layers__opt input {
  position: absolute;
  top: 0;
  left: 0;
  width: 96px;
  height: 70px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.sf-layers__th {
  display: block;
  width: 96px;
  height: 70px;
  margin: 0 0 6px;
  border: 2px solid #E5E1D8;
  border-radius: 10px;
  object-fit: cover;
  transition: border-color var(--sf-dur) var(--sf-ease), box-shadow var(--sf-dur) var(--sf-ease);
}
.sf-layers__name { display: block; line-height: 1.25; }
.sf-layers__opt:hover .sf-layers__th { border-color: rgba(34, 53, 128, .45); }
.sf-layers__opt:hover { color: var(--sf-navy); }
.sf-layers__opt input:checked + .sf-layers__th { border: 3px solid var(--sf-navy); box-shadow: 0 0 0 3px rgba(34, 53, 128, .15); }
.sf-layers__opt input:checked ~ .sf-layers__name { color: var(--sf-navy); font-weight: 700; }
.sf-layers__opt input:focus-visible + .sf-layers__th { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--sf-navy); }

/* indicația unică „Apăsați pe o eparhie pentru detalii” */
.sf-hint {
  position: absolute;
  z-index: 4;
  top: 16px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 6px 6px 6px 16px;
  border-radius: var(--sf-radius-pill);
  background: var(--sf-navy);
  color: var(--sf-cream-2);
  box-shadow: 0 8px 20px rgba(34, 53, 128, .25);
  font-family: var(--sf-font-ui);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity 200ms var(--sf-ease), transform 200ms var(--sf-ease);
}
.sf-hint[hidden] { display: none; }
.sf-hint.is-visible { opacity: 1; transform: translate(-50%, 0); }
.sf-hint b { font-weight: 800; }
.sf-hint > .sf-icon { flex: 0 0 auto; width: 18px; height: 18px; }
.sf-hint__x {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--sf-radius-pill);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.sf-hint__x { position: relative; }
.sf-hint__x::after { content: ""; position: absolute; inset: -6px; } /* zonă de atingere 44×44 */
.sf-hint__x .sf-icon { width: 16px; height: 16px; }
.sf-hint__x:hover { background: rgba(255, 255, 255, .16); }
.sf-hint__x:focus-visible { outline: 2px solid var(--sf-cream-2); outline-offset: 0; }

/* starea de încărcare / eroare a teritoriilor */
.sf-terr__status {
  position: absolute;
  z-index: 4;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 14px;
  border-radius: var(--sf-radius-pill);
  background: var(--sf-surface);
  box-shadow: var(--sf-shadow-2);
  font-family: var(--sf-font-ui);
  font-weight: 700;
  font-size: 13px;
  color: var(--sf-navy);
}
.sf-terr__status[hidden] { display: none; }
.sf-terr__status .sf-icon { width: 16px; height: 16px; }
.sf-terr__status.is-error { color: var(--sf-danger, #A12A2A); }
.sf-terr__status.is-error .sf-spin { display: none; }

/* tooltip la hover (desktop) */
.sf-terr-tip {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  max-width: 280px;
  padding: 5px 10px;
  border-radius: var(--sf-radius-sm);
  background: var(--sf-navy-700);
  color: var(--sf-cream-2);
  font-family: var(--sf-font-ui);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--sf-shadow-1);
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms linear;
}
.sf-terr-tip.is-visible { opacity: 1; }

/* info-window al unui teritoriu */
.sf-iw--terr { max-width: 300px; }
.sf-iw__eyebrow {
  margin: 0 40px 4px 0 !important;
  font-family: var(--sf-font-ui);
  font-weight: 700;
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sf-gold-text);
}
.sf-iw__terr-title {
  margin: 0 0 8px;
  padding-right: 32px;
  font-family: var(--sf-font-display);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.25;
  color: var(--sf-navy);
}
.sf-iw__terr-desc { margin: 0 0 8px; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
/* adresele web din descriere: text normal (nu stilul majuscul al legăturilor-acțiune), rupte doar la nevoie */
.sf-iw .sf-iw__terr-desc a {
  font-family: var(--sf-font-ui);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}
.sf-iw .sf-iw__terr-desc a:focus-visible { outline: none; box-shadow: none; border-radius: 2px; background: var(--sf-navy-50); text-decoration-thickness: 2px; }
.sf-iw__terr-count { margin: 0 0 10px !important; font-family: var(--sf-font-ui); font-size: 13px; color: var(--sf-text-body); }
.sf-iw__terr-count strong { color: var(--sf-navy); }
.sf-iw .sf-iw__cta { display: flex; width: calc(100% - 8px); margin: 6px 4px 12px; white-space: normal; } /* loc pentru inelul de focus (fereastra taie ce iese în afară) */
.sf-iw__terr-sub { margin: 4px 0 2px !important; font-family: var(--sf-font-ui); font-weight: 700; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--sf-muted); }
.sf-iw__terr-list { margin: 0 0 8px; padding: 0; list-style: none; }
.sf-iw__terr-ep {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 4px 6px;
  border: 0;
  border-radius: var(--sf-radius-sm);
  background: transparent;
  font-family: var(--sf-font-ui);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--sf-navy);
  text-align: left;
  cursor: pointer;
}
.sf-iw__terr-ep:hover, .sf-iw__terr-ep:focus-visible { background: var(--sf-navy-50); outline: none; }
.sf-iw__terr-ep:focus-visible { box-shadow: inset 0 0 0 2px var(--sf-navy); }
.sf-iw__terr-ep-name { flex: 1 1 auto; min-width: 0; }
.sf-iw__terr-ep-n { font-size: 12px; font-weight: 700; color: var(--sf-muted); font-variant-numeric: tabular-nums; }

/* „Vezi în listă” (legătură secundară în fereastra unui teritoriu) */
.sf-iw .sf-iw__list {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin: -4px 4px 10px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--sf-navy);
  font-family: var(--sf-font-ui);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.sf-iw .sf-iw__list:hover { color: var(--sf-navy-700); text-decoration-thickness: 2px; }
.sf-iw .sf-iw__list:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--sf-navy); border-radius: 2px; }

/* hartă îngustă (panou deschis): indicația coboară sub controalele Google din dreapta-sus */
@media (min-width: 768px) and (max-width: 1199px) {
  html:not(.sf-panel-collapsed) .sf-hint { top: 64px; }
}

/* tabletă: panoul e mai îngust; selectorul „Straturi” se deschide în sus (altfel acoperă controalele Google din dreapta) */
@media (min-width: 768px) and (max-width: 991px) {
  html:not(.sf-panel-collapsed) .sf-layers__pop { left: 0; bottom: calc(100% + 12px); }
  .sf-tabs { padding: 0 var(--sf-space-3); }
  .sf-tab { padding: 0 10px; }
}

/* ============================== Mobil: o singură foaie de jos cu aceleași două tab-uri ============================== */
@media (max-width: 767px) {
  .sf-tabs { min-height: 64px; padding: 14px 12px 0; background: #fff; }
  .sf-tabs__list { flex: 1 1 auto; }
  .sf-tab { flex: 1 1 0; justify-content: center; padding: 0 8px; }
  .sf-tabs .sf-panel__close { flex: 0 0 44px; margin: 4px -6px 0 0; }
  .sf-tabpanel--cauta .sf-panel__head { padding-top: var(--sf-space-3); }
  .sf-panel__title { font-size: 22px; }
  .sf-chip-row { margin-left: var(--sf-space-4); margin-right: var(--sf-space-4); }
  .sf-chip { min-height: 44px; }
  .sf-terr__head { padding-left: var(--sf-space-4); padding-right: var(--sf-space-4); }
  .sf-terr__tree { padding-left: var(--sf-space-3); padding-right: var(--sf-space-3); padding-bottom: calc(var(--sf-space-4) + env(safe-area-inset-bottom, 0px)); }
  .sf-terr__exp { flex-basis: 40px; width: 40px; height: 44px; }
  .sf-terr__eps .sf-terr__row { padding-left: 46px; }
  .sf-terr__flt { width: 44px; height: 44px; margin-right: 0; }
  .sf-collapse { display: none; }

  .sf-fab { min-height: 52px; padding: 14px 28px; font-size: 14px; font-weight: 800; letter-spacing: .1em; box-shadow: 0 8px 20px rgba(34, 53, 128, .35); }

  /* „Straturi”: miniatură 52×52 în dreapta-sus, sub antet */
  .sf-layers { top: 12px; right: 12px; left: auto; bottom: auto; }
  .sf-layers__btn { width: 52px; height: 52px; border-radius: 12px; }
  .sf-layers__lbl { padding: 8px 0 3px; }
  /* eticheta „Straturi” ascunsă doar vizual (display:none o scotea și din numele accesibil al butonului) */
  .sf-layers__lbl > span { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .sf-layers__pop { left: auto; right: 0; bottom: auto; top: calc(100% + 48px); padding: 12px; }
  .sf-layers__opts { gap: 10px; }
  .sf-layers__opt { width: 92px; }
  .sf-layers__th, .sf-layers__opt input { width: 92px; height: 67px; }
  .sf-layers__opt { padding-bottom: 2px; }
  .sf-layers__hd { top: -38px; left: auto; right: 0; }

  .sf-hint { left: 12px; right: 76px; width: auto; max-width: none; justify-content: center; transform: translateY(-8px); font-size: 13.5px; }
  .sf-hint.is-visible { transform: none; }
  .sf-terr__status { top: 12px; left: 12px; }

  .sf-iw--terr { max-width: 240px; }
  .sf-iw__terr-list { max-height: 176px; overflow-y: auto; overscroll-behavior: contain; margin-right: -4px; padding-right: 4px; }
  .sf-iw__terr-desc { font-size: 14px; }
  .sf-iw__terr-ep, .sf-iw .sf-iw__list { min-height: 44px; }
  /* fereastra unui teritoriu: butonul „Caută” se ascunde cât timp e deschisă (altfel o acoperă) */
  html.sf-terr-iw-open .sf-fab { visibility: hidden; pointer-events: none; }
}

/* ecrane tactile (inclusiv tablete): ținte de 44px */
@media (pointer: coarse) {
  .sf-terr__exp { flex-basis: 44px; width: 44px; height: 44px; }
  .sf-terr__go { min-height: 44px; }
  .sf-terr__flt { width: 44px; height: 44px; }
  .sf-iw__terr-ep, .sf-iw .sf-iw__list { min-height: 44px; }
  .sf-chip { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .sf-tab, .sf-collapse .sf-icon, .sf-layers, .sf-layers__btn, .sf-layers__th, .sf-hint, .sf-hint.is-visible, .sf-terr-tip,
  .sf-terr__exp .sf-icon, .sf-terr__fara > summary .sf-icon, .sf-terr__flt { transition: none; }
  .sf-layers__btn:hover { transform: none; }
  .sf-hint, .sf-hint.is-visible { transform: translateX(-50%); }
  .sf-terr__row.is-flash, .sf-terr__mrow > .sf-terr__row.is-flash { animation: none; background: rgba(193, 157, 111, .32); box-shadow: inset 3px 0 0 var(--sf-gold); }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .sf-hint, .sf-hint.is-visible { transform: none; }
}

/* etichetele teritoriilor (sub markere; nu captează evenimente) */
.sf-terr-lbls { position: absolute; top: 0; left: 0; pointer-events: none; }
.sf-terr-lbl {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  white-space: nowrap;
  font-family: var(--sf-font-ui);
  font-weight: 700;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .01em;
  color: var(--sf-navy-700);
  text-shadow: 0 0 2px #FBF8F2, 0 0 3px #FBF8F2, 0 0 4px #FBF8F2, 1px 1px 0 #FBF8F2, -1px -1px 0 #FBF8F2, 1px -1px 0 #FBF8F2, -1px 1px 0 #FBF8F2;
  pointer-events: none;
  user-select: none;
}
.sf-terr-lbl--mit { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }

/* Mobil: tab-ul "CAUTĂ" numește deja panoul -> titlul "Caută un centru" rămâne doar pentru cititoarele de ecran
   (îl folosește aria-labelledby), ca formularul să aibă mai mult loc în panoul de jos. */
@media (max-width: 767.98px) {
  .sf-tabpanel--cauta .sf-panel__head {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
}

/* ============================== SEO: titlul paginii (h1 vizibil), „Despre hartă”, legăturile din arbore ============================== */
/* h1: desktop = antetul coloanei panoului (deasupra tab-urilor); mobil = card discret peste colțul hărții. */
.sf-intro__title {
  margin: 0;
  font-family: var(--sf-font-display);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--sf-navy);
}
.sf-intro__sub {
  display: block;
  margin-top: 2px;
  font-family: var(--sf-font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--sf-gold-text);
}
@media (min-width: 768px) {
  .sf-app { grid-template-rows: auto minmax(0, 1fr); }
  .sf-intro {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    z-index: 6; /* acoperă umbra panoului de dedesubt */
    min-width: 0;
    padding: var(--sf-space-4) var(--sf-space-5) 6px;
    background: var(--sf-cream-2);
    border-right: 1px solid var(--sf-line);
    box-shadow: 4px 0 16px rgba(34, 53, 128, .08);
    clip-path: inset(0 -24px 0 0); /* umbra doar spre hartă (ca a panoului) */
  }
  .sf-panel { grid-column: 1; grid-row: 2; }
  .sf-mapwrap { grid-column: 2; grid-row: 1 / span 2; }
  /* panoul restrâns: titlul rămâne doar pentru cititoarele de ecran (starea e aleasă de utilizator) */
  html.sf-panel-collapsed .sf-intro {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; box-shadow: none;
  }
  /* „Caută un centru”: tab-ul și h1-ul numesc deja panoul -> doar pentru cititoarele de ecran (ca pe mobil) */
  .sf-tabpanel--cauta .sf-panel__head {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .sf-tabpanel--cauta .sf-panel__body { padding-top: var(--sf-space-4); }
  .sf-tabpanel--cauta .sf-chip-row { margin-top: var(--sf-space-4); margin-bottom: 0; }
}
@media (min-width: 768px) and (max-width: 991px) {
  .sf-intro { padding-left: var(--sf-space-3); padding-right: var(--sf-space-3); }
  .sf-intro__title { font-size: 18px; }
  .sf-intro__sub { font-size: 15.5px; }
}
@media (max-width: 767px) {
  .sf-intro {
    position: absolute;
    z-index: 4;
    top: 12px;
    left: 12px;
    right: 76px; /* butonul „Straturi” (52px) din dreapta-sus */
    padding: 8px 14px 9px;
    border: 1px solid rgba(34, 53, 128, .14);
    border-radius: 14px;
    background: rgba(249, 247, 243, .94);
    box-shadow: 0 4px 14px rgba(34, 53, 128, .14);
    pointer-events: none; /* nu blochează gesturile pe hartă */
    transition: opacity var(--sf-dur) var(--sf-ease), visibility 0s linear var(--sf-dur);
  }
  .sf-intro__title { font-size: 15.5px; line-height: 1.25; }
  .sf-intro__sub { margin-top: 1px; font-size: 14px; }
  /* o fereastră de informații deschisă are prioritate (altfel cardul i-ar acoperi partea de sus) */
  html.sf-iw-open .sf-intro, html.sf-terr-iw-open .sf-intro { opacity: 0; visibility: hidden; }
  /* indicația unică și starea teritoriilor coboară sub card */
  .sf-hint { top: 76px; }
  .sf-terr__status { top: 76px; }
  html.sf-iw-open .sf-hint, html.sf-terr-iw-open .sf-hint,
  html.sf-iw-open .sf-terr__status, html.sf-terr-iw-open .sf-terr__status { top: 12px; }
}
/* telefoane înguste (< 360px): titlul se rupe pe două rânduri -> indicația și starea coboară mai mult */
@media (max-width: 359px) {
  .sf-intro { padding: 7px 12px 8px; }
  .sf-intro__title { font-size: 14px; }
  .sf-intro__sub { font-size: 13px; }
  .sf-hint, .sf-terr__status { top: 96px; }
  /* selectorul „Straturi” deschis: eticheta lui ar ajunge sub cardul mai înalt */
  html:has(.sf-layers.is-open) .sf-intro { opacity: 0; visibility: hidden; }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .sf-intro { transition: none; }
}

/* „Despre hartă”: la finalul zonei derulabile a tab-ului „Caută” */
.sf-about { margin: var(--sf-space-6) 0 var(--sf-space-1); }
.sf-about__t { letter-spacing: 0; text-transform: none; }
.sf-about__p {
  margin: 0 0 var(--sf-space-4);
  font-family: var(--sf-font-ui);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--sf-muted);
}
.sf-about__p strong { font-weight: 700; color: var(--sf-navy); }
.sf-about__links { display: grid; gap: var(--sf-space-2); margin: 0; padding: 0; list-style: none; }
.sf-about__a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px 8px 14px;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-md);
  background: var(--sf-cream-2);
  color: var(--sf-navy);
  font-family: var(--sf-font-ui);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
  text-decoration: none;
  transition: background var(--sf-dur) var(--sf-ease), border-color var(--sf-dur) var(--sf-ease);
}
.sf-about__a > span { flex: 1 1 auto; min-width: 0; }
.sf-about__a .sf-icon { flex: 0 0 auto; width: 18px; height: 18px; color: var(--sf-gold-2); }
.sf-about__a .sf-about__go { width: 16px; height: 16px; color: var(--sf-navy); transition: transform var(--sf-dur) var(--sf-ease); }
.sf-about__a:hover, .sf-about__a:focus { background: var(--sf-navy-50); border-color: rgba(34, 53, 128, .45); color: var(--sf-navy-700); text-decoration: none; }
.sf-about__a:hover .sf-about__go { transform: translateX(2px); }
.sf-about__a:focus-visible { outline: none; box-shadow: var(--sf-focus-ring); }

/* arbore: legătura către pagina mitropoliei / eparhiei (mereu vizibilă, discretă; rândul își păstrează clicul „zoom”) */
.sf-terr__pg {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 36px;
  margin-right: 2px;
  border-radius: var(--sf-radius-pill);
  color: var(--sf-muted);
  text-decoration: none;
}
.sf-terr__pg .sf-icon { width: 16px; height: 16px; transition: transform var(--sf-dur) var(--sf-ease); }
.sf-terr__pg:hover, .sf-terr__pg:focus { color: var(--sf-navy); background: #fff; text-decoration: none; }
.sf-terr__pg:hover .sf-icon { transform: translateX(2px); }
.sf-terr__pg:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--sf-navy); }
@media (pointer: coarse) {
  .sf-terr__pg { width: 40px; height: 44px; margin-right: 0; }
}
/* mobil: trei ținte pe rând (arată pe hartă, filtrează, pagina) -> spațiere mai strânsă, ca numele să rămână pe un rând */
@media (max-width: 767px) {
  .sf-terr__pg { width: 32px; height: 44px; margin-right: 0; }
  .sf-terr__flt { width: 40px; }
  .sf-terr__eps .sf-terr__row { padding-left: 44px; }
  .sf-terr__go { gap: 8px; padding-right: 4px; }
  .sf-terr__n { min-width: 28px; padding-left: 7px; padding-right: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .sf-about__a, .sf-about__a .sf-about__go, .sf-terr__pg .sf-icon { transition: none; }
  .sf-about__a:hover .sf-about__go, .sf-terr__pg:hover .sf-icon { transform: none; }
}

/* ============================== Căutarea rapidă „Nume centru” (js/sf-cautare.js): sugestii + starea de sub câmp ============================== */
/* butonul ✕ propriu (cel nativ al câmpului type=search e ascuns, ca să nu fie două) */
.sf-ls__wrap > .sf-input { padding-right: 46px; }
.sf-js .sf-ls input[type="search"]::-webkit-search-cancel-button,
.sf-js .sf-ls input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.sf-ls__clear {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--sf-radius-md);
  background: transparent;
  color: var(--sf-muted);
  cursor: pointer;
}
.sf-ls__clear[hidden] { display: none; }
.sf-ls__clear .sf-icon { width: 18px; height: 18px; }
.sf-ls__clear:hover { color: var(--sf-navy); background: var(--sf-navy-50); }
.sf-ls__clear:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--sf-navy); }

/* lista de sugestii: card alb sub câmp, poziționat „fixed” din JS (nu e tăiat de zona derulabilă a panoului);
   se derulează lista (role=listbox) – „… încă N” rămâne fix la baza cardului */
.sf-ls__pop {
  position: fixed;
  z-index: 1001; /* peste zona de acțiuni a panoului (.sf-panel__foot, z 995) */
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  max-height: 480px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--sf-border);
  border-radius: 12px;
  background: var(--sf-surface);
  box-shadow: var(--sf-shadow-2);
  font-family: var(--sf-font-ui);
  color: var(--sf-navy);
  animation: sf-ls-in 140ms var(--sf-ease) both;
}
.sf-ls__pop[hidden] { display: none; }
.sf-ls__list {
  flex: 1 1 auto;
  min-height: 0;
  padding: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 53, 128, .25) transparent;
}
@keyframes sf-ls-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.sf-ls__opt {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 56px;
  padding: 7px 0 7px 12px;
  border-radius: 8px;
  color: var(--sf-navy);
  cursor: pointer;
}
.sf-ls__opt + .sf-ls__opt { margin-top: 2px; }
.sf-ls__txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sf-ls__name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.3;
  color: var(--sf-navy);
  overflow-wrap: anywhere;
}
.sf-ls__meta {
  overflow: hidden;
  font-weight: 500;
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--sf-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}
/* textul potrivit: îngroșat, subliniat cu auriu */
.sf-ls__hl {
  padding: 0;
  background: transparent;
  color: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: var(--sf-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
@media (hover: hover) {
  .sf-ls__opt:hover { background: var(--sf-cream-2); }
}
/* opțiunea activă (tastatură, aria-activedescendant): fundal navy-50 + contur vizibil */
.sf-ls__opt.is-active,
.sf-ls__opt.is-active:hover { background: var(--sf-navy-50); box-shadow: inset 0 0 0 2px var(--sf-navy); }
/* „↗”: doar pentru mouse/atingere (pagina centrului, filă nouă); fereastra hărții are deja legătura */
.sf-ls__go {
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--sf-radius-pill);
  color: var(--sf-muted);
}
.sf-ls__go .sf-icon { width: 17px; height: 17px; transition: transform var(--sf-dur) var(--sf-ease); }
.sf-ls__go:hover { color: var(--sf-navy); background: #fff; box-shadow: 0 0 0 1px var(--sf-border); }
.sf-ls__go:hover .sf-icon { transform: translate(1px, -1px); }
/* grupuri (doar când există centre în afara filtrelor) */
.sf-ls__ghead {
  margin: 0;
  padding: 8px 8px 4px 12px;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sf-muted);
}
.sf-ls__group--out { margin-top: 6px; padding-top: 2px; border-top: 1px solid var(--sf-line); }
.sf-ls__group--out .sf-ls__ghead { color: var(--sf-gold-text); }
.sf-ls__opt.is-out .sf-ls__name { font-weight: 500; color: #2A3460; }
.sf-ls__opt.is-out .sf-ls__go { color: var(--sf-gold-text); }
/* „… încă N” */
.sf-ls__more {
  flex: 0 0 auto;
  margin: 0;
  padding: 9px 18px 10px;
  border-top: 1px solid var(--sf-line);
  background: var(--sf-cream-2);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.35;
  color: var(--sf-muted);
}
.sf-ls__more[hidden] { display: none; }
.sf-ls__hint { font-weight: 500; }
@media (hover: none), (pointer: coarse) {
  .sf-ls__hint { display: none; }
}

/* starea de sub câmp: „✓ N rezultate pe hartă” (separată de #rezultate_form, care e numărul filtrelor) */
.sf-ls__status {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 8px 0 0;
  font-family: var(--sf-font-ui);
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--sf-success);
}
.sf-ls__status[hidden] { display: none; }
.sf-ls__status .sf-icon { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; }
.sf-ls__status--none, .sf-ls__status--err { color: var(--sf-danger); }
.sf-ls__status--info { color: var(--sf-navy); }
.sf-ls__status--load { color: var(--sf-muted); font-weight: 600; }

@media (max-width: 767px) {
  .sf-ls__name { font-size: 15px; }
  .sf-ls__meta { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .sf-ls__pop { animation: none; }
  .sf-ls__go .sf-icon { transition: none; }
  .sf-ls__go:hover .sf-icon { transform: none; }
}
