:root {
  --bg: #f3f0ea;
  --paper: #fffdf9;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: #ffffff;
  --ink: #201c18;
  --muted: #645d54;
  --line: #d6cdc2;
  --line-strong: #c5b8a7;
  --brand: #183f5a;
  --brand-soft: #dfeaf2;
  --danger: #9a4d12;
  --danger-soft: #f4e1d2;
  --good: #266534;
  --good-soft: #dceddf;
  --warning: #6e561f;
  --warning-soft: #efe5c8;
  --focus: #6f9bc0;
  --shadow: 0 18px 44px rgba(35, 32, 28, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
#title-block-header { display: none; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(24, 63, 90, 0.08), transparent 32%),
    radial-gradient(circle at left center, rgba(154, 77, 18, 0.07), transparent 28%),
    var(--bg);
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button,
input,
select,
textarea,
label {
  max-width: 100%;
}

button { cursor: pointer; }
a { color: inherit; }

.site-nav {
  position: relative;
  z-index: 1100;
  width: auto;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  border-bottom: 0;
}

.site-header {
  position: relative;
  z-index: 1100;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 720;
  text-decoration: none;
  white-space: nowrap;
}

.site-brand:hover,
.site-brand:focus-visible {
  color: var(--brand);
  outline: none;
}

.site-brand-wordmark {
  color: var(--good);
  font-size: 1.3rem;
  font-weight: 760;
  line-height: 1;
}

h1,
h2,
h3 { margin: 0; }

h1 {
  font-family: 'IBM Plex Serif', serif;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  letter-spacing: -0.02em;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 34px;
}

.page-header {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.page-header.compact {
  gap: 0.35rem;
  padding: 8px 0 14px;
  border-bottom: 1px solid var(--line);
}

.page-header h1,
.page-header h2 {
  max-width: 48rem;
  font-family: 'IBM Plex Serif', serif;
  font-size: clamp(2rem, 3.6vw, 3rem);
  letter-spacing: -0.02em;
}

.kicker,
.eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lede,
.hero-text,
.muted {
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tab {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 0;
  padding: 6px 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 0.93rem;
  line-height: 1.1;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.tab:hover,
.tab:focus-visible {
  background: #e7edf7;
  outline: none;
}

.tab.active,
.tab.current-page-link {
  background: #e7edf7;
  color: var(--ink);
  font-weight: 760;
}

.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 18px auto 0;
  padding: 18px 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.94rem;
}

.footer-links .tab {
  color: var(--ink);
}

.footer-links .tab.current-page-link {
  font-weight: 760;
}

.site-copyright {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.app-shell,
.layout {
  display: block;
}

.card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.inset-card {
  padding: 0.6rem;
}

.subcard {
  padding: 0.9rem;
  border: 1px solid rgba(197, 184, 167, 0.85);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
}

.hero-card,
.split-card {
  display: grid;
  gap: 1rem;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(176px, auto);
  gap: clamp(24px, 7vw, 72px);
  align-items: start;
  padding: 18px 0 22px;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  display: grid;
  gap: 0.5rem;
}

.hero-tagline {
  margin: -0.05rem 0 0.1rem;
  color: var(--brand);
  font-family: 'IBM Plex Serif', serif;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-style: italic;
  line-height: 1.25;
}

.hero-copy .lede {
  max-width: 42rem;
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.hero-actions,
.footer-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-scoreboard {
  display: grid;
  grid-template-columns: repeat(2, 84px);
  grid-template-rows: repeat(2, auto);
  justify-content: end;
  justify-self: end;
  align-self: start;
  gap: 6px 8px;
}

.section-heading.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.stat-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.section-block {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.method-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 940px;
}

.method-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-height: 116px;
  padding: 17px;
  border: 1px solid #d5dde8;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 252, 0.78)),
    rgba(255,255,255,0.84);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.82) inset, 0 8px 22px rgba(35, 48, 65, 0.06);
}

.method-list article > span {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid #cbd7e4;
  border-radius: 999px;
  background: #eef4f8;
  color: #7a1424;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 800;
}

.method-list h3 {
  margin-bottom: 7px;
  font-size: 1.08rem;
  line-height: 1.18;
}

.method-list p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.42;
}

.callout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.callout-row > div {
  max-width: 46rem;
}

.stat-card {
  display: grid;
  gap: 0.25rem;
  min-height: 94px;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.stat-card-good { background: linear-gradient(180deg, #f7fbf8 0%, var(--good-soft) 100%); }
.stat-card-danger { background: linear-gradient(180deg, #fff8f4 0%, var(--danger-soft) 100%); }
.stat-card-warning { background: linear-gradient(180deg, #fffdf5 0%, var(--warning-soft) 100%); }

.stat-label {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.15;
}

.controls-card {
  padding-block: 0.85rem;
}

.directory-tools {
  display: grid;
  gap: 0.7rem;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.directory-tools label { color: var(--muted); font-weight: 700; }

.directory-primary-tools {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px 12px;
}

.directory-industry-tools {
  display: inline-flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px 12px;
  width: fit-content;
  max-width: 100%;
}

.filter-field {
  display: grid;
  width: fit-content;
  gap: 0.3rem;
}

.filter-field-search {
  flex: 1 1 26rem;
  min-width: min(100%, 18rem);
}

.filter-search-shell {
  position: relative;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.filter-search-shell:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(24, 63, 90, 0.13);
}

.filter-search-shell input[type="search"] {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 0.55rem 2.55rem 0.55rem 0.95rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  outline: 0;
  -webkit-appearance: none;
  appearance: none;
}

.filter-search-shell input[type="search"]::-webkit-search-cancel-button,
.filter-search-shell input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.filter-clear-button {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0 0 2px;
  border: 0;
  border-radius: 999px;
  background: #e6edf4;
  color: var(--brand);
  font-size: 1.25rem;
  line-height: 1;
  transform: translateY(-50%);
}

.filter-clear-button:hover,
.filter-clear-button:focus-visible {
  background: var(--brand);
  color: #fff;
  outline: none;
}

input,
select,
textarea {
  width: min(100%, 28rem);
  min-height: 38px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
}

select {
  width: fit-content;
}

input[type="checkbox"] {
  width: 1rem;
  min-height: 1rem;
  height: 1rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.checkbox-control {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  min-height: 38px;
}

.directory-detail-control {
  margin-right: 4px;
}

.directory-customize-columns-link {
  align-self: center;
  width: fit-content;
  min-height: 30px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 760;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.directory-column-popover {
  position: fixed;
  z-index: 60;
  width: min(92vw, 420px);
  max-height: min(70vh, 620px);
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 42px rgba(23, 26, 32, 0.18);
}

.directory-column-popover[hidden] {
  display: none;
}

.directory-column-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.directory-column-popover-close {
  width: 30px;
  height: 30px;
  min-height: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
}

.directory-column-popover-close:hover,
.directory-column-popover-close:focus-visible {
  border-color: var(--line);
  background: rgba(23, 26, 32, 0.06);
  color: var(--ink);
  outline: none;
}

.directory-column-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 4px 8px;
}

.directory-column-choice {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  gap: 7px;
  padding: 4px 5px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 680;
}

.directory-column-choice:hover,
.directory-column-choice:focus-within {
  background: rgba(24, 63, 90, 0.08);
}

.directory-column-choice input {
  width: 16px;
  height: 16px;
  min-height: 16px;
}

.directory-more-filters {
  display: grid;
  gap: 10px;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--line);
}

.directory-more-filters summary {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 34px;
  padding: 0 1px;
  color: var(--brand);
  font-weight: 760;
  cursor: pointer;
  list-style: none;
}

.directory-more-filters summary::-webkit-details-marker {
  display: none;
}

.directory-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, max-content));
  gap: 10px 12px;
}

.directory-browse-layout {
  display: grid;
  gap: 12px;
  align-items: start;
  margin-top: 12px;
  position: relative;
}

.directory-browse-layout[data-browse-active="true"] {
  position: fixed;
  inset: 0;
  z-index: 1000;
  grid-template-rows: minmax(18rem, 42vh) minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 12px;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line);
  transform: none;
  overflow: hidden;
  align-items: stretch;
}

.directory-browse-layout:not([data-browse-active="true"]) .directory-browse-panel,
.directory-browse-panel[hidden] {
  display: none;
}

.directory-browse-panel {
  min-width: 0;
  min-height: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
}

.directory-browse-layout[data-browse-active="true"] .directory-browse-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
}

.directory-browse-close {
  position: absolute;
  z-index: 30;
  top: 10px;
  right: 10px;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
}

.directory-browse-head,
.browse-listbox-heading,
.directory-table-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.directory-browse-head {
  padding: 1px 2px 9px;
  border-bottom: 1px solid var(--line);
}

.directory-browse-head h2,
.browse-listbox-heading h2 {
  margin: 0;
  font-size: 0.94rem;
}

.directory-browse-head button,
.browse-listbox-heading button,
.link-button,
.table-link {
  width: fit-content;
  min-height: 0;
  padding: 3px 6px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 720;
}

.directory-browse-stack,
.stack-grid {
  display: grid;
  gap: 7px;
}

.directory-browse-stack {
  min-height: 0;
  padding-top: 8px;
}

.browse-listbox-panel {
  min-width: 0;
  min-height: 0;
}

.browse-listbox-heading {
  margin-bottom: 5px;
}

.browse-listbox {
  display: grid;
  align-content: start;
  gap: 2px;
  height: 5.4rem;
  min-height: 0;
  max-height: none;
  padding: 3px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.directory-browse-layout[data-browse-active="true"] .directory-browse-stack {
  height: 100%;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.directory-browse-layout[data-browse-active="true"] .browse-listbox-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.directory-browse-layout[data-browse-active="true"] .browse-listbox {
  height: auto;
}

.browse-listbox button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  align-items: start;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  padding: 4px 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.browse-listbox button:hover,
.browse-listbox button:focus-visible {
  background: #eef4f8;
  outline: none;
}

.browse-listbox button[aria-selected="true"] {
  background: #dfe9f6;
  color: var(--brand);
  font-weight: 760;
}

.browse-listbox span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}

.browse-listbox small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.directory-table-region {
  display: flex;
  flex-direction: column;
  width: calc(100vw - 32px);
  max-width: calc(100vw - 32px);
  min-width: 0;
  margin-left: calc(50% - 50vw + 16px);
  margin-right: 0;
  overflow: visible;
}

.directory-browse-layout[data-browse-active="true"] .directory-table-region {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: auto;
  max-width: none;
  margin-left: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.directory-table-topline {
  display: grid;
  grid-template-columns: minmax(2.75rem, 1fr) auto minmax(2.75rem, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin-bottom: 8px;
}

.directory-table-status {
  grid-column: 2;
  width: fit-content;
  max-width: min(100%, 34rem);
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 760;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-card,
.featured-entity {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
}

.entity-card {
  padding: 12px;
}

.entity-card-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.entity-card h3 {
  margin-bottom: 2px;
  font-size: 1.08rem;
}

.entity-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.entity-card p,
.directory-description {
  color: var(--muted);
}

.entity-card .entity-type {
  margin-bottom: 7px;
  font-size: 0.92rem;
}

.entity-type,
.directory-meta,
.entity-card-footer,
.entity-facts {
  color: #736b61;
  font-size: 0.86rem;
}

.entity-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.badge-wrap {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
}

.rating-badge {
  position: relative;
  isolation: isolate;
  flex: 0 0 auto;
  display: inline-grid;
  box-sizing: border-box;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 6px;
  color: #ffffff;
  text-decoration: none;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.46) inset,
    0 -1px 0 rgba(0, 0, 0, 0.28) inset,
    1px 0 0 rgba(255, 255, 255, 0.16) inset,
    -1px 0 0 rgba(0, 0, 0, 0.18) inset,
    0 7px 16px rgba(23, 26, 32, 0.14);
}

.rating-badge::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 82% 13%, rgba(255, 255, 255, 0.42) 0 6%, rgba(255, 255, 255, 0.18) 15%, rgba(255, 255, 255, 0) 31%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.08) 15%, rgba(255, 255, 255, 0) 32%);
}

.rating-badge-compact {
  display: inline-grid;
  grid-template-rows: 1fr auto auto;
  width: 84px;
  height: 72px;
  padding: 4px 6px 5px;
  gap: 2px;
  border-radius: 5px;
}

.rating-badge-featured {
  display: inline-grid;
  grid-template-columns: minmax(86px, 1fr) 50px;
  grid-template-rows: 1fr auto;
  grid-template-areas:
    "grade score"
    "label score";
  width: 154px;
  height: 86px;
  padding: 6px 8px 7px;
  gap: 3px 6px;
}

.badge-grade {
  display: block;
  place-self: center;
  color: #ffffff;
  font-weight: 850;
  line-height: 0.86;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.24);
}

.rating-badge-compact .badge-grade {
  font-size: 2.1rem;
}

.rating-badge-featured .badge-grade {
  grid-area: grade;
  font-size: 3rem;
}

.badge-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 1px 1px rgba(0,0,0,0.24);
}

.rating-badge-compact .badge-label {
  align-self: end;
  padding-top: 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.42);
  font-size: 0.47rem;
  line-height: 1;
}

.rating-badge-featured .badge-label {
  grid-area: label;
  align-self: end;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.42);
  font-size: 0.58rem;
  line-height: 1;
}

.badge-score-compact,
.score-featured {
  color: #ffffff;
  text-align: center;
  text-shadow: 0 1px 1px rgba(0,0,0,0.22);
}

.badge-score-compact {
  font-size: 0.74rem;
  font-weight: 800;
}

.score-featured {
  display: flex;
  grid-area: score;
  align-self: stretch;
  justify-self: stretch;
  align-items: center;
  justify-content: center;
  padding-left: 6px;
  border-left: 1px solid rgba(255,255,255,0.42);
  font-size: 1.14rem;
  font-weight: 850;
}

.badge-hidden { background: linear-gradient(180deg, #c46c18, #8e4712); }
.badge-authoritarian { background: linear-gradient(180deg, #ab5416, #6e2d0b); }
.badge-contested { background: linear-gradient(180deg, #60748c, #39495d); }
.badge-democratic { background: linear-gradient(180deg, #23834a, #15522d); }

.badge-danger,
.label-border-danger { border-color: rgba(154, 77, 18, 0.35); }
.badge-warning,
.label-border-warning { border-color: rgba(110, 86, 31, 0.35); }
.badge-good,
.label-border-good { border-color: rgba(38, 101, 52, 0.35); }

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 680;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.button.secondary {
  color: var(--brand);
  background: rgba(255, 255, 255, 0.78);
}

.icon-button,
.directory-fullscreen-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand);
}

.directory-fullscreen-toggle:hover,
.directory-fullscreen-toggle:focus-visible,
.directory-fullscreen-toggle[aria-pressed="true"] {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  outline: none;
}

.directory-table-actions {
  grid-column: 3;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  min-height: 34px;
}

.directory-browse-layout[data-browse-active="true"] .directory-table-actions {
  visibility: hidden;
}

.directory-browse-layout[data-browse-active="true"] .directory-table-topline {
  grid-row: 2;
  margin-top: 8px;
  margin-bottom: 0;
}

.fullscreen-icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
}

.fullscreen-icon::before,
.fullscreen-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid currentColor;
}

.fullscreen-icon::before {
  clip-path: polygon(0 0, 42% 0, 42% 18%, 18% 18%, 18% 42%, 0 42%);
}

.fullscreen-icon::after {
  clip-path: polygon(58% 82%, 82% 82%, 82% 58%, 100% 58%, 100% 100%, 58% 100%);
}

.map-page {
  width: 100%;
  padding-top: 0;
  overflow: hidden;
}

.map-app {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.map-topbar {
  position: relative;
  z-index: 700;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 10px 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 240, 234, 0.97);
  box-shadow: 0 4px 18px rgba(23, 26, 32, 0.08);
}

.map-search-form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 7px 8px;
  min-width: 0;
  max-width: 100%;
}

.map-search-shell {
  flex: 1 1 24rem;
  width: clamp(20rem, 34vw, 28rem);
  min-width: min(100%, 18rem);
}

.map-search-shell input[type="search"] {
  min-height: 32px;
  padding: 5px 34px 5px 12px;
  font-size: 0.93rem;
  line-height: 1.15;
}

.map-search-shell .filter-clear-button {
  right: 5px;
  width: 22px;
  height: 22px;
  font-size: 18px;
  line-height: 20px;
}

.map-search-form > .button.primary {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 0.94rem;
}

.map-filter-strip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
}

.map-filter-check {
  min-height: 34px;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 0.92rem;
}

.map-filter-check:hover,
.map-filter-check:focus-within {
  background: rgba(255, 255, 255, 0.78);
}

.map-layout {
  position: relative;
  display: block;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.map-results-panel {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 850;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  align-content: start;
  gap: 10px;
  width: min(24rem, calc(100% - 28px));
  max-height: calc(100% - 28px);
  min-width: 0;
  min-height: 0;
  padding: 12px;
  border: 0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 46px rgba(23, 26, 32, 0.18);
  backdrop-filter: blur(9px);
  overflow: hidden;
}

.map-results-heading {
  display: grid;
  gap: 4px;
}

.map-results-heading h1 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.18;
}

.map-results-heading p,
.map-selected p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.map-selected {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.82);
}

.map-selected h2 {
  margin: 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.map-selected-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.map-selected-actions .button,
.map-directions-form .button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.9rem;
}

.map-directions-form {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 7px 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
}

.map-directions-form label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 760;
}

.map-directions-form input {
  width: min(100%, 18rem);
  min-height: 34px;
  padding: 6px 8px;
}

.map-directions-form button {
  grid-column: 2;
}

.map-results-scroll {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.map-result-list {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 0;
}

.map-result-list h2 {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.map-result-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  text-align: left;
}

.map-result-item:hover,
.map-result-item:focus-visible {
  border-color: var(--line-strong);
  background: #eef4fb;
  outline: none;
}

.map-result-main {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.map-result-main strong,
.map-result-main small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-result-main small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 680;
}

.map-result-main .map-result-tags {
  color: #4c5d61;
  font-size: 0.72rem;
  font-weight: 620;
}

.map-result-distance {
  justify-self: end;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.map-result-badge-stack,
.gcd-map-marker-stack {
  display: inline-grid;
  justify-items: center;
  gap: 2px;
  width: 38px;
}

.map-result-badge,
.gcd-map-score-badge,
.map-legend-score {
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(23, 26, 32, 0.2);
}

.map-result-badge,
.gcd-map-score-badge {
  width: 36px;
  height: 32px;
  border: 3px solid #ffffff;
  border-radius: 6px;
  font-size: 1.04rem;
}

.map-legend-score {
  width: 22px;
  height: 20px;
  border-radius: 4px;
  font-size: 0.76rem;
}

.map-result-badge.badge-hidden,
.gcd-map-score-badge.badge-hidden,
.map-legend-score.badge-hidden { background: linear-gradient(180deg, #c46c18, #8e4712); }
.map-result-badge.badge-authoritarian,
.gcd-map-score-badge.badge-authoritarian,
.map-legend-score.badge-authoritarian { background: linear-gradient(180deg, #ab5416, #6e2d0b); }
.map-result-badge.badge-contested,
.gcd-map-score-badge.badge-contested,
.map-legend-score.badge-contested { background: linear-gradient(180deg, #60748c, #39495d); }
.map-result-badge.badge-democratic,
.gcd-map-score-badge.badge-democratic,
.map-legend-score.badge-democratic { background: linear-gradient(180deg, #23834a, #15522d); }

.map-result-mini-row,
.gcd-map-mini-row {
  display: flex;
  justify-content: center;
  gap: 2px;
  min-height: 14px;
}

.map-result-mini-badge,
.gcd-map-mini-badge {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(23, 26, 32, 0.2);
  font-size: 0.42rem;
  font-style: normal;
  font-weight: 920;
  line-height: 1;
}

.map-result-mini-badge-small,
.gcd-map-mini-badge-small { background: #394150; }
.map-result-mini-badge-policy,
.gcd-map-mini-badge-policy { background: #8b1c32; }

.map-result-badge-feature {
  background: #255f85;
  font-size: 0.62rem;
}

.map-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.map-canvas-shell {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: #dce7ea;
}

.map-canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.map-gps-control {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 650;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(95, 116, 139, 0.66);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand);
  box-shadow: 0 8px 22px rgba(23, 26, 32, 0.14);
}

.map-gps-control:hover,
.map-gps-control:focus-visible {
  border-color: var(--brand);
  background: #e5edf7;
  outline: none;
}

.map-gps-icon {
  display: inline-block;
  width: 19px;
  height: 19px;
  background: currentColor;
  -webkit-mask: url("/static/stock/location-crosshair.svg") center / 19px 19px no-repeat;
  mask: url("/static/stock/location-crosshair.svg") center / 19px 19px no-repeat;
}

.map-user-location-marker {
  filter: drop-shadow(0 3px 7px rgba(23, 26, 32, 0.26));
}

.map-canvas .leaflet-container,
.leaflet-container {
  font: inherit;
}

.map-canvas .leaflet-top.leaflet-left {
  top: auto;
  right: 12px;
  bottom: 82px;
  left: auto;
}

.map-canvas .leaflet-left .leaflet-control { margin-left: 0; }
.map-canvas .leaflet-top .leaflet-control { margin-top: 0; }

.gcd-map-marker {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
}

.leaflet-tooltip.gcd-map-tooltip {
  padding: 4px 7px;
  border: 1px solid rgba(24, 28, 36, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(23, 26, 32, 0.16);
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.15;
  white-space: nowrap;
}

.map-popup {
  display: grid;
  gap: 4px;
  min-width: 13rem;
}

.map-popup strong { font-size: 0.96rem; }
.map-popup span { color: var(--muted); }

.map-popup-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}

.map-popup-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eaf0f6;
  color: var(--ink) !important;
  font-size: 0.78rem;
  font-weight: 760;
}

.map-legend,
.map-service-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.map-legend {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 500;
  max-width: calc(100% - 24px);
  padding: 7px 9px;
  border: 1px solid rgba(179, 189, 202, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 22px rgba(23, 26, 32, 0.14);
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.map-service-links {
  position: absolute;
  right: 12px;
  top: 88px;
  z-index: 840;
  justify-content: flex-end;
  padding: 6px 9px;
  border: 1px solid rgba(179, 189, 202, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 22px rgba(23, 26, 32, 0.12);
  color: var(--muted);
  font-size: 0.78rem;
}

body:has(.map-page) {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  min-height: 100dvh;
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
}

body:has(.map-page) .site-header { flex: 0 0 auto; }
body:has(.map-page) .site-footer { display: none; }
body:has(.map-page) .app-shell {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

body:has(.map-page) .app-shell > main.map-page {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.directory-table-wrap {
  width: max-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-top: 0;
  overflow: auto;
  overflow-x: auto;
  padding: 0 0 10px;
  scrollbar-gutter: stable;
  touch-action: pan-x pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  transform: none;
  transition: max-width 220ms ease, transform 220ms ease;
}

.directory-table-wrap.is-panning {
  cursor: grabbing;
  user-select: none;
}

.directory-table-wrap.is-panning * {
  cursor: grabbing !important;
}

.directory-browse-layout:not([data-browse-active="true"]) .directory-table-wrap {
  transform: none;
}

.directory-browse-layout[data-browse-active="true"] .directory-table-wrap {
  grid-row: 1;
  order: 0;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  height: auto;
  margin-left: 0;
  margin-top: 0;
  transform: translateX(0) !important;
  overflow: auto;
}

.directory-table-wrap[data-directory-expanded="true"] {
  width: max-content;
  max-width: 100%;
}

.directory-table {
  width: max-content;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  border-top: 1px solid var(--line);
}

.directory-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.7rem 0.65rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 760;
}

.directory-table thead th:first-child {
  border-left: 1px solid var(--line);
}

.directory-table tbody td {
  padding: 0.7rem 0.65rem;
  border-bottom: 1px solid rgba(214, 205, 194, 0.75);
  vertical-align: top;
  background: var(--bg);
}

.directory-table tr:last-child td {
  border-bottom: 0;
}

.directory-row {
  transition: background-color 160ms ease;
}

.directory-table .directory-row:hover td,
.directory-table .directory-row:focus-visible td {
  background: rgba(24, 63, 90, 0.06);
}

.directory-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 760;
}

.directory-sort[aria-sort] {
  color: var(--brand);
}

.directory-sort::after {
  content: "↕";
  color: rgba(24, 63, 90, 0.5);
  font-size: 0.75rem;
}

.directory-sort[aria-sort="asc"]::after {
  content: "↑";
}

.directory-sort[aria-sort="desc"]::after {
  content: "↓";
}

.numeric-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.directory-select-heading,
.directory-select {
  width: 2.8rem;
  min-width: 2.8rem;
  text-align: center;
}

.directory-badge-heading,
.directory-badge-cell {
  width: 128px;
  min-width: 128px;
  text-align: center;
}

.directory-rating-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.directory-table .directory-rating-cell .rating-badge-compact {
  grid-template-columns: minmax(66px, 1fr) 38px;
  grid-template-rows: 1fr auto;
  grid-template-areas:
    "grade score"
    "label score";
  width: 118px;
  height: 64px;
  padding: 4px 6px 5px;
  gap: 2px 4px;
  cursor: pointer;
}

.directory-table .directory-rating-cell .badge-score-compact {
  display: flex;
  align-self: stretch;
  justify-self: stretch;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding-left: 4px;
  border-left: 1px solid rgba(255, 255, 255, 0.42);
  font-size: 0.95rem;
  line-height: 1;
  text-align: center;
}

.directory-table .directory-rating-cell .badge-label {
  font-size: 0.49rem;
}

.directory-select label {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-height: 36px;
}

.directory-select input {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

.directory-entity-heading,
.directory-name {
  min-width: var(--directory-role-width, 260px);
  max-width: var(--directory-role-width, 260px);
}

.directory-type-cell {
  min-width: var(--directory-institution-width, 220px);
  max-width: var(--directory-institution-width, 220px);
}

.directory-parent-cell {
  min-width: var(--directory-region-width, 170px);
  max-width: var(--directory-region-width, 170px);
}

.directory-table th[data-directory-resizable-column] {
  position: relative;
}

.directory-column-resizer {
  position: absolute;
  top: 0;
  right: -8px;
  bottom: 0;
  width: 16px;
  cursor: col-resize;
}

.directory-column-resizer::before {
  content: "";
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 7px;
  width: 2px;
  border-radius: 999px;
  background: transparent;
}

.directory-table th[data-directory-resizable-column]:hover .directory-column-resizer::before,
.directory-table th[data-directory-resizable-column].is-resizing .directory-column-resizer::before {
  background: rgba(24, 63, 90, 0.28);
}

.directory-role-cell small,
.rank-list small,
.rank-list span,
.compact-meta,
.response-list {
  color: var(--muted);
}

.directory-name small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
}

.directory-name a,
.table-link,
.link-button {
  font-weight: 760;
  text-decoration: underline;
  text-decoration-color: rgba(24, 63, 90, 0.35);
  text-underline-offset: 0.2em;
}

.table-link:hover,
.link-button:hover,
.table-link:focus-visible,
.link-button:focus-visible,
.directory-name a:hover,
.directory-name a:focus-visible {
  color: var(--brand);
  outline: none;
}

.directory-empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.directory-load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 0.35rem 0 0;
}

.directory-load-more-wrap[data-directory-autoload-only="true"] {
  min-height: 1px;
  padding: 0;
}

.button {
  width: fit-content;
  min-height: 38px;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
}

.button:hover,
.button:focus-visible {
  border-color: var(--brand);
  color: var(--brand);
  outline: none;
}

.insight-grid,
.detail-grid,
.score-grid {
  display: grid;
  gap: 0.85rem;
}

.insight-grid,
.detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.detail-grid.two-up {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.rank-list,
.response-list,
.version-list {
  margin: 0;
  padding-left: 1rem;
}

.rank-list.plain,
.response-list,
.version-list {
  padding-left: 1.1rem;
}

.rank-list li,
.version-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.28rem 0;
}

.version-list li {
  display: grid;
  justify-content: start;
}

.version-list p {
  margin: 0.18rem 0 0;
  color: var(--muted);
}

.role-card,
.person-card {
  display: grid;
  gap: 0.6rem;
}

.chip-row,
.score-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pill,
.score-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 29px;
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem;
  font-weight: 700;
}

.tone-danger {
  border-color: rgba(154, 77, 18, 0.35);
  background: var(--danger-soft);
  color: var(--danger);
}

.tone-good {
  border-color: rgba(38, 101, 52, 0.28);
  background: var(--good-soft);
  color: var(--good);
}

.tone-warning {
  border-color: rgba(110, 86, 31, 0.3);
  background: var(--warning-soft);
  color: var(--warning);
}

.graph {
  width: 100%;
  height: auto;
  border: 1px solid rgba(24, 63, 90, 0.08);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(229, 240, 244, 0.82));
}

@media (min-width: 1040px) {
  .hero-card,
  .split-card {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.9fr);
    align-items: start;
  }

  .directory-browse-layout[data-browse-active="true"] {
    grid-template-columns: minmax(16rem, 19rem) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  .directory-browse-panel {
    position: sticky;
    top: 12px;
    max-height: none;
    overflow: visible;
  }

  .directory-browse-layout[data-browse-active="true"] .directory-browse-panel {
    position: static;
  }
}

@media (max-width: 1039px) {
  .directory-browse-layout[data-browse-active="true"] {
    grid-template-rows: minmax(18rem, 42vh) minmax(0, 1fr);
  }

  .hero-panel,
  .callout-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .featured-grid,
  .method-list {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 700px) and (max-width: 1039px) {
  .directory-browse-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .directory-browse-layout[data-browse-active="true"] .directory-browse-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .site-header {
    width: calc(100% - 22px);
    padding: 8px 0 10px;
  }

  .site-header,
  .site-nav,
  .nav-links {
    gap: 8px;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .map-results-panel {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: min(19rem, 42%);
    border-width: 0;
    border-radius: 0;
  }

  .map-service-links {
    display: none;
  }

  .map-gps-control {
    bottom: calc(min(19rem, 42%) + 12px);
  }

  .map-canvas .leaflet-top.leaflet-left {
    right: 12px;
    bottom: calc(min(19rem, 42%) + 12px);
  }

  .page-shell {
    width: calc(100% - 22px);
  }

  .hero-panel {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hero-scoreboard {
    justify-self: start;
    grid-template-columns: repeat(2, 84px);
  }

  .directory-table-region {
    width: calc(100vw - 22px);
    max-width: calc(100vw - 22px);
    margin-left: calc(50% - 50vw + 11px);
  }

  .directory-browse-layout[data-browse-active="true"] .directory-table-region {
    width: auto;
    max-width: none;
    margin-left: 0;
  }

  .directory-table {
    min-width: 980px;
  }
}

@media (max-width: 700px) {
  body:has(.map-page) {
    overflow: hidden;
    background: var(--bg);
  }

  body:has(.map-page) .site-header {
    width: 100%;
    min-height: 50px;
    padding: 4px 8px;
    gap: 6px;
    background: rgba(255, 255, 255, 0.96);
  }

  body:has(.map-page) .site-brand-wordmark {
    font-size: 1rem;
  }

  body:has(.map-page) .nav-links {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 0;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 2px;
    overflow: hidden;
  }

  body:has(.map-page) .nav-links .tab {
    min-height: 32px;
    padding: 5px 7px;
    font-size: 0.84rem;
    white-space: nowrap;
  }

  body:has(.map-page) .nav-links .tab:nth-child(n+4) {
    display: none;
  }

  body:has(.map-page) main.map-page {
    width: 100%;
    height: calc(100svh - 51px);
    height: calc(100dvh - 51px);
  }

  .map-topbar {
    gap: 8px;
    padding: 8px 10px;
  }

  .map-search-form {
    gap: 6px;
  }

  .map-search-shell {
    flex-basis: 100%;
    width: 100%;
  }

  .map-filter-strip {
    gap: 3px;
  }

  .map-filter-check {
    min-height: 30px;
    padding: 4px 7px;
    font-size: 0.84rem;
  }
}
