:root {
  color-scheme: light;
  --ink: #18383c;
  --muted: #526d70;
  --teal: #007d88;
  --teal-hover: #006570;
  --mint: #e3f2f2;
  --paper: #edf5f5;
  --line: #d3e4e5;
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.top { background: var(--teal); border-bottom: 1px solid #ffffff33; }
.top-inner, .brand, .city, .footer-inner { display: flex; align-items: center; }
.top-inner { padding-block: 16px; min-height: 112px; justify-content: space-between; gap: 16px; }
.brand img { display: block; width: 240px; height: auto; }
.city, .footer-inner span { font-size: .81rem; }
.city { gap: 9px; color: #fff; }
.footer-inner span { color: var(--muted); }
.pin {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 2px;
  border: 1.6px solid currentColor;
  border-radius: 55% 55% 55% 0;
  transform: rotate(-45deg);
  vertical-align: 1px;
  position: relative;
}
.pin::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: currentColor;
}
.hero { background: var(--teal); color: #fff; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: center; gap: 40px; padding: 46px 0 76px; }
.cells-avatar { display: block; width: 100%; height: auto; filter: brightness(0) invert(1); }
.eyebrow { margin: 0 0 15px; color: #fff; text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; font-weight: 750; }
h1, h2 { font-family: Georgia, serif; font-weight: 500; }
h1 { margin: 0; font-size: clamp(3.6rem, 9vw, 6.1rem); letter-spacing: -.06em; line-height: .91; }
h1 span { color: var(--mint); }
.intro { max-width: 33ch; margin: 22px 0 0; line-height: 1.55; }
.directory { position: relative; padding-bottom: 52px; }
.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 22px #18383c0d;
  padding: 17px 19px;
  margin-top: -39px;
}
.filters label { display: grid; gap: 6px; font-size: .79rem; font-weight: 750; min-width: 0; }
select, button { font: inherit; color: inherit; }
select {
  width: 100%;
  min-height: 44px;
  padding: 0 8px;
  border: 1px solid #91b1b5;
  border-radius: 8px;
  background: #f8fbfb;
  font-weight: 550;
}
.clear { min-height: 44px; padding: 0 9px; border: 0; background: transparent; text-decoration: underline; cursor: pointer; font-size: .83rem; }
:focus-visible { outline: 3px solid #a95431; outline-offset: 4px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-top: 33px; gap: 12px; }
h2 { margin: 0; font-size: clamp(1.65rem, 4.3vw, 2.5rem); letter-spacing: -.035em; }
#count { margin: 0; flex-shrink: 0; font-size: .84rem; color: var(--muted); }
.cards { margin-top: 15px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; align-items: stretch; }
.card { display: flex; flex-direction: column; border-radius: 13px; background: #fff; border: 1px solid var(--line); padding: 15px; min-width: 0; }
.card-heading { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: center; }
.card-heading.no-portrait { grid-template-columns: 1fr; }
.card-heading.has-emblem { grid-template-columns: 76px minmax(0, 1fr) 68px; }
.card-heading.no-portrait.has-emblem { grid-template-columns: minmax(0, 1fr) 68px; }
.portrait { display: block; width: 76px; height: 76px; border-radius: 9px; object-fit: cover; object-position: center; background: #e7efec; }
.emblem { display: block; width: 100%; height: 76px; object-fit: contain; }
.card[id] { scroll-margin-top: 16px; }
.zone { margin: 0 0 3px; color: var(--teal-hover); font-size: .69rem; line-height: 1.3; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.name { margin: 0 0 4px; font-size: 1.15rem; line-height: 1.2; }
.leaders-line { margin: 0; color: var(--muted); font-size: .77rem; line-height: 1.4; }
.leaders-line strong { color: var(--ink); margin-right: 2px; }
.details { display: grid; gap: 7px; margin: 13px 0 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .84rem; }
.details div { display: grid; grid-template-columns: 5.55rem minmax(0, 1fr); align-items: baseline; gap: 6px; }
dt { font-weight: 700; color: var(--muted); }
dd { margin: 0; }
.directions { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 45px; margin-top: auto; padding: 0 12px; border-radius: 7px; background: var(--teal); color: #fff; font-weight: 650; font-size: .86rem; text-decoration: none; }
.map-pending { margin: auto 0 0; padding: 10px 0 2px; color: var(--muted); font-size: .82rem; }
 .contacts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.contact-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; border: 1px solid var(--teal); border-radius: 7px; background: #fff; color: var(--teal-hover); font: inherit; font-size: .86rem; font-weight: 650; cursor: pointer; }
.whatsapp-button { background: #e8f7ee; border-color: #257c49; color: #176437; }
.contact-button img { flex: 0 0 22px; }
#contact-dialog { width: min(420px, calc(100% - 32px)); max-height: calc(100% - 40px); border: 1px solid var(--line); border-radius: 14px; padding: 22px; color: var(--ink); }
#contact-dialog::backdrop { background: #18383c88; }
#contact-title { font-family: inherit; font-size: 1.2rem; font-weight: 700; margin-bottom: 18px; }
#contact-options { display: grid; gap: 10px; }
.contact-option { display: flex; align-items: center; justify-content: center; min-height: 48px; background: var(--teal); color: white; padding: 10px; border-radius: 8px; text-decoration: none; font-weight: 650; }
#contact-dialog p { font-size: .85rem; line-height: 1.5; color: var(--muted); }
#close-contact { min-height: 44px; padding: 8px 18px; border: 1px solid var(--line); border-radius: 7px; background: white; cursor: pointer; }
.directions:hover { background: var(--teal-hover); }
.directions .pin { margin-right: 9px; }
.empty { grid-column: 1 / -1; margin: 0; padding: 24px; border: 1px dashed #91b1b5; border-radius: 10px; color: var(--muted); }
footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 67px; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; padding-block: 12px; font-size: .88rem; }
.footer-credit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0 18px;
  color: var(--muted);
  font-size: .74rem;
}
.footer-credit img { display: block; width: 137px; height: auto; }
@media (max-width: 850px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 570px) {
  .wrap { width: calc(100% - 32px); }
  .cards { grid-template-columns: 1fr; }
  .top-inner { min-height: 104px; flex-wrap: wrap; gap: 8px 16px; }
  .brand img { width: 200px; }
  .city { font-size: .67rem; }
  .city { gap: 5px; }
  .city .pin { display: none; }
  .hero-inner { grid-template-columns: 1fr; gap: 22px; padding: 26px 0 66px; }
  .cells-avatar { grid-row: 1; width: 120px; justify-self: center; }
  .intro { font-size: .9rem; width: min(100%, 32ch); }
  .filters { grid-template-columns: 1fr; gap: 10px; padding: 12px; }
  .clear { grid-column: 1 / -1; justify-self: start; }
  .section-head { margin-top: 24px; }
  .directory { padding-bottom: 32px; }
}

.location-note { margin: 0 0 16px; color: var(--muted, #526b68); font-size: .875rem; line-height: 1.5; }

/* Shared content slots keep every card and action aligned at each screen width. */
.card { display: grid; grid-template-rows: var(--card-heading-height, auto) auto var(--card-note-height, auto) 46px var(--card-map-height, auto); row-gap: 12px; align-content: start; }
.card-heading { height: var(--card-heading-height, auto); min-height: 76px; align-items: start; }
.card-heading > div { min-width: 0; }
.name, .leaders-line, .zone, .details dd { overflow-wrap: anywhere; }
.details { margin: 0; padding-top: 12px; line-height: 1.5; gap: 7px; }
.details .meeting-row { min-height: 21px; height: var(--card-meeting-height, auto); }
.details .address-row { height: var(--card-address-height, auto); }
.details .hosts-row { min-height: 21px; height: var(--card-hosts-height, auto); }
.details .hosts-row[hidden] { display: grid !important; visibility: hidden; }
.location-note { margin: 0; height: var(--card-note-height, auto); }
.location-note[hidden] { display: block !important; visibility: hidden; }
.contacts { margin: 0; }
.map-area { min-height: 45px; height: var(--card-map-height, auto); }
.directions { margin-top: 0; height: 100%; }
.map-pending { margin: 0; min-height: 45px; padding: 10px 12px; line-height: 1.5; }

.address { white-space: pre-line; }

.contact-button { text-decoration: none; touch-action: manipulation; }
