:root {
  --hd-bg: #f3f6f4;
  --hd-surface: #ffffff;
  --hd-surface-subtle: #eef4f0;
  --hd-border: #d3dfd7;
  --hd-border-strong: #9ab2a3;
  --hd-heading: #112117;
  --hd-body: #283d30;
  --hd-muted: #516859;
  --hd-brand: #2A633A;
  --hd-brand-hover: #204e2d;
  --hd-brand-soft: #e3f0e7;
  --hd-brand-ink: #1c4a29;
  --hd-accent: #2A633A;
  --hd-danger-bg: #fef2f2;
  --hd-danger-border: #fecaca;
  --hd-danger-ink: #991b1b;
  --hd-danger-btn: #b91c1c;
  --hd-warn-bg: #fffbeb;
  --hd-warn-border: #fde68a;
  --hd-warn-ink: #92400e;
  --hd-shadow: 0 1px 3px rgba(15, 29, 20, 0.06), 0 1px 2px rgba(15, 29, 20, 0.04);
}

html.dark {
  --hd-bg: #0f1a13;
  --hd-surface: #17271d;
  --hd-surface-subtle: #1f3427;
  --hd-border: #314c3b;
  --hd-border-strong: #4e735c;
  --hd-heading: #eef7f0;
  --hd-body: #d4e6da;
  --hd-muted: #a1bca9;
  --hd-brand: #2A633A;
  --hd-brand-hover: #357a49;
  --hd-brand-soft: #223c2c;
  --hd-brand-ink: #86d59a;
  --hd-accent: #86d59a;
  --hd-danger-bg: #2b1416;
  --hd-danger-border: #69262c;
  --hd-danger-ink: #fecaca;
  --hd-danger-btn: #dc2626;
  --hd-warn-bg: #2c2210;
  --hd-warn-border: #6c511b;
  --hd-warn-ink: #fde68a;
  --hd-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

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

html {
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--hd-bg);
  color: var(--hd-body);
  font: 1rem/1.55 system-ui, -apple-system, "Noto Sans Bengali", sans-serif;
  overflow-x: clip;
}

img {
  display: block;
  object-fit: contain;
  max-width: 100%;
}

a {
  color: var(--hd-accent);
  text-underline-offset: 0.2em;
}

.site-header {
  background: var(--hd-surface);
  border-bottom: 1px solid var(--hd-border);
}

.header-inner,
.emergency-inner,
main {
  max-width: 56rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding-block: 0.65rem;
}

.brand-group,
.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding-inline: 0.25rem;
  border-radius: 0.5rem;
}

.home-back,
.util-pill,
.lang-toggle,
.crosslink-chip,
.reset-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.45rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid var(--hd-border);
  background: var(--hd-surface-subtle);
  color: var(--hd-heading);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.util-pill.is-active {
  background: var(--hd-brand);
  border-color: var(--hd-brand);
  color: #ffffff;
}

html.dark .util-pill.is-active {
  background: var(--hd-brand-soft);
  border-color: var(--hd-accent);
  color: var(--hd-accent);
}

.utility-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.emergency-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--hd-danger-bg);
  border-bottom: 1px solid var(--hd-danger-border);
  color: var(--hd-danger-ink);
}

.emergency-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  padding-block: 0.55rem;
}

.emergency-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  flex: 1 1 14rem;
  min-width: 0;
  font-size: 0.9rem;
}

.emergency-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 0.4rem;
  background: var(--hd-danger-btn);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
}

.emergency-note {
  font-size: 0.84rem;
  opacity: 0.92;
}

.emergency-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 1rem;
  border-radius: 0.65rem;
  background: var(--hd-danger-btn);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
}

main {
  padding-top: 1rem;
  padding-bottom: 4rem;
}

.top-crosslink,
.bottom-crosslink {
  margin: 0.25rem 0 0.75rem;
}

h1 {
  color: var(--hd-heading);
  font-size: clamp(1.55rem, 4.5vw, 2.25rem);
  line-height: 1.25;
  margin: 0.5rem 0 0.35rem;
}

h2 {
  color: var(--hd-heading);
  font-size: 1.18rem;
  margin: 1.5rem 0 0.65rem;
}

h2 span:last-child,
.intro,
.meta {
  color: var(--hd-muted);
}

.intro {
  margin: 0 0 1rem;
}

form,
article,
.health-card,
.empty {
  background: var(--hd-surface);
  border: 1px solid var(--hd-border);
  border-radius: 0.9rem;
  padding: 1.05rem;
  box-shadow: var(--hd-shadow);
}

.directory-form {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.75rem;
}

label {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  color: var(--hd-heading);
  font-size: 0.92rem;
  font-weight: 600;
}

input,
select,
button {
  font: inherit;
  font-size: 16px;
  min-height: 44px;
  border: 1px solid var(--hd-border-strong);
  border-radius: 0.6rem;
  padding: 0.5rem 0.75rem;
  width: 100%;
  background: var(--hd-surface);
  color: var(--hd-heading);
}

button,
.book {
  background: var(--hd-brand);
  border: 1px solid transparent;
  color: #ffffff;
  font-weight: 650;
  border-radius: 0.6rem;
}

button:hover,
.book:hover {
  background: var(--hd-brand-hover);
}

button {
  width: auto;
  min-width: 44px;
  padding-inline: 1.15rem;
  cursor: pointer;
}

.book {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 1rem;
  text-decoration: none;
}

.filter-strip {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.6rem;
}

.pill-row,
.division-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-pill,
.division-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--hd-border);
  background: var(--hd-surface);
  color: var(--hd-body);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.filter-pill.is-active,
.division-chip.is-active {
  background: var(--hd-brand);
  border-color: var(--hd-brand);
  color: #ffffff;
}

html.dark .filter-pill.is-active,
html.dark .division-chip.is-active {
  background: var(--hd-brand-soft);
  border-color: var(--hd-accent);
  color: var(--hd-accent);
}

.reset-pill {
  border-style: dashed;
}

.copy-toast {
  margin-top: 0.75rem;
  padding: 0.6rem 0.9rem;
  border-radius: 0.65rem;
  border: 1px solid var(--hd-brand);
  background: var(--hd-brand-soft);
  color: var(--hd-brand-ink);
  font-size: 0.9rem;
  font-weight: 600;
}

article {
  margin: 0.8rem 0;
}

.card-top,
.chamber-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.75rem;
}

.place {
  color: var(--hd-brand-ink);
  font-size: 0.88rem;
  font-weight: 650;
  margin: 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.verified-badge,
.open-today-badge {
  background: var(--hd-brand-soft);
  color: var(--hd-brand-ink);
  border: 1px solid var(--hd-border);
}

.pending-badge {
  background: var(--hd-warn-bg);
  color: var(--hd-warn-ink);
  border: 1px solid var(--hd-warn-border);
}

h3 {
  color: var(--hd-heading);
  font-size: 1.25rem;
  margin: 0.35rem 0;
  overflow-wrap: anywhere;
}

article p {
  margin: 0.35rem 0 0.75rem;
  overflow-wrap: anywhere;
}

dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 1rem;
  margin: 0.9rem 0 0.5rem;
}

dl div {
  border-top: 1px solid var(--hd-border);
  padding: 0.55rem 0 0.2rem;
  min-width: 0;
}

dt,
.meta,
details {
  font-size: 0.88rem;
}

dt {
  color: var(--hd-muted);
  margin-bottom: 0.25rem;
}

dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-weight: 650;
}

dd a,
.call-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.35rem 0.65rem;
  border-radius: 0.55rem;
  background: var(--hd-brand-soft);
  color: var(--hd-brand-ink);
  text-decoration: none;
  font-weight: 700;
}

.copy-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.35rem 0.7rem;
  border-radius: 0.55rem;
  border: 1px solid var(--hd-border);
  background: var(--hd-surface-subtle);
  color: var(--hd-heading);
  font-size: 0.84rem;
  font-weight: 600;
}

.copy-num:hover {
  background: var(--hd-brand-soft);
  color: var(--hd-brand-ink);
}

.unverified-phone {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--hd-muted);
  font-weight: 500;
}

summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  padding: 0.35rem 0;
  color: var(--hd-heading);
  font-weight: 600;
}

.source {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  overflow-wrap: anywhere;
  padding: 0.35rem 0;
  margin-right: 0.75rem;
}

.pending {
  background: var(--hd-warn-bg);
  border: 1px solid var(--hd-warn-border);
  color: var(--hd-warn-ink);
  border-radius: 0.65rem;
  padding: 0.7rem 0.85rem;
}

.hospital-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.8rem;
  margin-top: 1.25rem;
}

.hospital-pages a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.45rem 0.85rem;
  border-radius: 0.6rem;
  border: 1px solid var(--hd-border);
  background: var(--hd-surface);
  text-decoration: none;
  font-weight: 600;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--hd-accent);
  outline-offset: 2px;
}

html.amra-lite * {
  transition: none !important;
  animation: none !important;
}

@media (max-width: 40rem) {
  .directory-form {
    grid-template-columns: 1fr;
  }
  .directory-form button {
    width: 100%;
  }
  .header-inner,
  .emergency-inner,
  main {
    padding-inline: 0.75rem;
  }
}

@media (max-width: 26.25rem) {
  dl {
    grid-template-columns: 1fr;
  }
  form,
  article,
  .health-card,
  .empty {
    padding: 0.85rem;
  }
  /* On a phone the bar sticks above a long list, so it stays ONE row: the name and the call button. */
  .emergency-inner {
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding-block: 0.4rem;
  }
  .emergency-copy {
    flex: 1 1 auto;
  }
  .emergency-badge,
  .emergency-note {
    display: none;
  }
}
