:root {
  --bg: #f3f5f2;
  --surface: #fff;
  --surface-soft: #f8faf7;
  --ink: #15201b;
  --muted: #65716b;
  --line: #dfe5df;
  --brand: #133b2d;
  --brand-strong: #0d2c21;
  --accent: #d7f45b;
  --accent-soft: #eff9c4;
  --mint: #bfe9d2;
  --amber: #f3d898;
  --lilac: #d9ccf5;
  --blue: #b9dcf4;
  --shadow: 0 18px 50px rgb(25 50 38 / 9%);
}

html[data-theme="dark"] {
  --bg: #101713;
  --surface: #19221d;
  --surface-soft: #1e2923;
  --ink: #edf4ef;
  --muted: #a0aea6;
  --line: #304038;
  --shadow: 0 18px 50px rgb(0 0 0 / 25%);
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background: radial-gradient(circle at 92% 8%, rgb(215 244 91 / 10%), transparent 22rem), var(--bg);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  transition: background-color 180ms ease, color 180ms ease;
}
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button, a { touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgb(114 159 81 / 40%);
  outline-offset: 3px;
}
.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;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgb(223 229 223 / 78%);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}
html[data-theme="dark"] .site-header { border-color: rgb(48 64 56 / 80%); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px 13px 13px 4px;
  color: var(--brand-strong);
  background: var(--accent);
  font-weight: 900;
  letter-spacing: -.06em;
  box-shadow: 0 6px 18px rgb(177 207 67 / 22%);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-copy strong { font-size: .9rem; letter-spacing: .08em; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: .72rem; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.data-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #48b676;
  box-shadow: 0 0 0 4px rgb(72 182 118 / 15%);
}
.icon-button, .view-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface);
}
.icon-button { font-size: 1.15rem; }

.hero {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  padding: 64px clamp(20px, 9vw, 140px) 58px;
  color: #f6fbf7;
  background: linear-gradient(110deg, rgb(12 47 35 / 96%), rgb(20 70 51 / 95%)), var(--brand);
  isolation: isolate;
}
.hero::after {
  position: absolute;
  z-index: -1;
  right: clamp(20px, 9vw, 140px);
  bottom: -140px;
  width: 420px;
  height: 420px;
  border: 1px solid rgb(215 244 91 / 20%);
  border-radius: 50%;
  box-shadow: 0 0 0 58px rgb(215 244 91 / 4%), 0 0 0 116px rgb(215 244 91 / 3%);
  content: "";
}
.hero-decoration {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  background: var(--accent);
  opacity: .8;
}
.hero-decoration-one { top: 52px; right: 12%; width: 9px; height: 9px; }
.hero-decoration-two { right: 34%; bottom: 58px; width: 5px; height: 5px; }
.eyebrow, .section-kicker {
  color: var(--accent);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.hero h1 {
  max-width: 790px;
  margin: 0;
  font-size: clamp(2.75rem, 6.8vw, 5.8rem);
  font-weight: 760;
  letter-spacing: -.065em;
  line-height: .94;
}
.hero > p {
  max-width: 600px;
  margin: 22px 0 28px;
  color: rgb(238 248 241 / 72%);
  font-size: clamp(.96rem, 2vw, 1.08rem);
}
.hero-search {
  display: flex;
  width: min(100%, 650px);
  min-height: 60px;
  align-items: center;
  gap: 14px;
  padding: 0 16px 0 21px;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 17px;
  background: rgb(255 255 255 / 10%);
  box-shadow: 0 16px 30px rgb(0 0 0 / 12%);
  backdrop-filter: blur(12px);
}
.hero-search:focus-within { border-color: rgb(215 244 91 / 70%); box-shadow: 0 0 0 4px rgb(215 244 91 / 11%); }
.search-icon {
  position: relative;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 50%;
  opacity: .65;
}
.search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  content: "";
  transform: rotate(45deg);
}
.hero-search input, .filter-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: inherit;
  background: transparent;
}
.hero-search input { color: white; }
.hero-search input::placeholder { color: rgb(255 255 255 / 58%); }
kbd {
  padding: 4px 7px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 7px;
  color: rgb(255 255 255 / 65%);
  background: rgb(0 0 0 / 12%);
  font-family: inherit;
  font-size: .68rem;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 25px;
  color: rgb(238 248 241 / 65%);
  font-size: .78rem;
}
.hero-meta strong { color: white; }
.avatar-stack { display: flex; margin-right: 3px; }
.mini-avatar {
  display: grid;
  width: 27px;
  height: 27px;
  margin-left: -7px;
  place-items: center;
  border: 2px solid var(--brand);
  border-radius: 50%;
  color: var(--brand-strong);
  font-size: .54rem;
  font-weight: 850;
}
.mini-avatar:first-child { margin-left: 0; }
.meta-separator { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }

.summary-strip {
  position: relative;
  z-index: 2;
  display: grid;
  max-width: 1180px;
  margin: -26px auto 0;
  padding: 0 24px;
  grid-template-columns: repeat(4, 1fr);
}
.summary-strip article {
  display: flex;
  min-height: 106px;
  align-items: center;
  gap: 16px;
  padding: 21px 24px;
  border: 1px solid var(--line);
  border-right: 0;
  background: var(--surface);
  box-shadow: 0 16px 28px rgb(24 48 37 / 5%);
}
.summary-strip article:first-child { border-radius: 20px 0 0 20px; }
.summary-strip article:last-child { border-right: 1px solid var(--line); border-radius: 0 20px 20px 0; }
.summary-icon {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  color: #23352e;
  font-size: .85rem;
}
.summary-icon.mint { background: var(--mint); }
.summary-icon.amber { background: var(--amber); }
.summary-icon.lilac { background: var(--lilac); }
.summary-icon.blue { background: var(--blue); }
.summary-strip article div { display: flex; flex-direction: column; }
.summary-strip strong { font-size: 1.42rem; line-height: 1.1; }
.summary-strip article div span { margin-top: 5px; color: var(--muted); font-size: .74rem; }

.dashboard-shell {
  display: grid;
  max-width: 1180px;
  margin: 72px auto 90px;
  padding: 0 24px;
  gap: 58px;
  grid-template-columns: 245px minmax(0, 1fr);
}
.panel-heading, .directory-heading { display: flex; align-items: flex-end; justify-content: space-between; }
.section-kicker { color: #7f9630; }
.panel-heading h2, .directory-heading h2 { margin: 7px 0 0; font-size: 1.65rem; letter-spacing: -.04em; }
.text-button { padding: 4px; border: 0; color: var(--muted); background: transparent; font-size: .76rem; font-weight: 700; }
.text-button:hover { color: var(--ink); }
.domicile-list { display: flex; flex-direction: column; gap: 5px; margin-top: 24px; }
.domicile-button {
  display: grid;
  min-height: 54px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease;
  grid-template-columns: 35px 1fr auto;
  gap: 10px;
}
.domicile-button:hover { color: var(--ink); background: var(--surface); transform: translateX(3px); }
.domicile-button.active { color: white; background: var(--brand); box-shadow: 0 10px 24px rgb(19 59 45 / 15%); }
.domicile-dot {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 11px;
  color: #34443d;
  background: var(--dot-color, var(--mint));
  font-size: .68rem;
  font-weight: 900;
}
.domicile-button > span:nth-child(2) { font-size: .83rem; font-weight: 720; }
.domicile-button .count {
  display: grid;
  min-width: 28px;
  height: 25px;
  place-items: center;
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface);
  font-size: .68rem;
  font-weight: 800;
}
.domicile-button.active .count { color: white; background: rgb(255 255 255 / 12%); }
.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 28px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: var(--surface-soft);
}
.privacy-note > span {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--muted);
  border-radius: 50%;
  font-size: .65rem;
  font-weight: 800;
}
.privacy-note p { margin: 0; font-size: .67rem; line-height: 1.55; }

.directory-heading { min-height: 61px; }
.directory-heading h2 { font-size: 2rem; }
.directory-heading p { margin: 6px 0 0; color: var(--muted); font-size: .8rem; }
.view-controls { display: flex; gap: 7px; }
.view-button { width: 38px; height: 38px; border-radius: 11px; }
.view-button.active { color: white; border-color: var(--brand); background: var(--brand); }
.grid-symbol {
  width: 14px;
  height: 14px;
  background: linear-gradient(currentColor 0 0) 0 0 / 6px 6px, linear-gradient(currentColor 0 0) 100% 0 / 6px 6px, linear-gradient(currentColor 0 0) 0 100% / 6px 6px, linear-gradient(currentColor 0 0) 100% 100% / 6px 6px;
  background-repeat: no-repeat;
}
.list-symbol {
  width: 15px;
  height: 13px;
  background: linear-gradient(currentColor 0 0) 0 0 / 100% 2px, linear-gradient(currentColor 0 0) 0 50% / 100% 2px, linear-gradient(currentColor 0 0) 0 100% / 100% 2px;
  background-repeat: no-repeat;
}
.filter-bar {
  display: grid;
  margin: 26px 0 16px;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) 165px 145px;
}
.filter-search, .select-control {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: var(--surface);
}
.filter-search:focus-within, .select-control:focus-within { border-color: #92aa49; box-shadow: 0 0 0 3px rgb(146 170 73 / 12%); }
.select-control { padding-right: 7px; }
.select-control select { width: 100%; border: 0; outline: 0; color: var(--ink); background: var(--surface); font-size: .75rem; }
.filter-search input { color: var(--ink); font-size: .8rem; }
.filter-search input::placeholder { color: var(--muted); }
.active-filter-row { display: flex; align-items: center; gap: 9px; margin-bottom: 17px; color: var(--muted); font-size: .72rem; }
#activeFilters { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
  font-size: .69rem;
  font-weight: 700;
}
.filter-chip button { padding: 0; border: 0; color: var(--muted); background: transparent; font-size: .9rem; line-height: 1; }

.member-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.member-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 250px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 8px 25px rgb(35 58 47 / 3%);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  grid-template-rows: auto auto 1fr auto;
}
.member-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--card-accent, var(--mint));
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}
.member-card:hover { border-color: color-mix(in srgb, var(--card-accent) 72%, var(--line)); box-shadow: var(--shadow); transform: translateY(-4px); }
.member-card:hover::before { transform: scaleX(1); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.card-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 15px 15px 15px 5px;
  color: #26352f;
  background: var(--card-accent, var(--mint));
  font-size: .78rem;
  font-weight: 850;
}
.role-badge {
  max-width: 130px;
  overflow: hidden;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: .65rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member-card h3 { margin: 18px 0 4px; font-size: 1.08rem; letter-spacing: -.025em; line-height: 1.25; }
.division-label { margin: 0; color: #72872f; font-size: .73rem; font-weight: 750; }
.location-block { display: grid; align-content: start; margin-top: 18px; gap: 6px; }
.location-line, .address-line { display: flex; min-width: 0; align-items: flex-start; gap: 8px; }
.location-line { color: var(--ink); font-size: .78rem; font-weight: 690; }
.address-line { color: var(--muted); font-size: .72rem; }
.location-marker {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  margin-top: 2px;
  border: 2px solid currentColor;
  border-radius: 50% 50% 50% 0;
  color: #7f9630;
  transform: rotate(-45deg);
}
.address-marker { width: 13px; flex: 0 0 auto; color: var(--muted); font-weight: 900; text-align: center; }
.address-line span:last-child { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.domicile-tag { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .66rem; font-weight: 750; }
.domicile-tag::before { width: 7px; height: 7px; border-radius: 50%; background: var(--card-accent); content: ""; }
.detail-button { padding: 6px 0; border: 0; color: var(--ink); background: transparent; font-size: .72rem; font-weight: 800; }
.detail-button::after { margin-left: 6px; content: "→"; transition: margin-left 160ms ease; }
.detail-button:hover::after { margin-left: 10px; }

.member-grid.list-mode { grid-template-columns: 1fr; }
.member-grid.list-mode .member-card {
  min-height: 0;
  padding: 18px 20px;
  grid-template-columns: 52px minmax(150px, 1fr) minmax(190px, 1.35fr) auto;
  grid-template-rows: auto;
  align-items: center;
  gap: 15px;
}
.member-grid.list-mode .card-top { display: contents; }
.member-grid.list-mode .card-avatar { width: 44px; height: 44px; }
.member-grid.list-mode .role-badge { display: none; }
.member-grid.list-mode .card-identity { grid-column: 2; grid-row: 1; }
.member-grid.list-mode .card-identity h3 { margin-top: 0; }
.member-grid.list-mode .location-block { grid-column: 3; grid-row: 1; margin-top: 0; }
.member-grid.list-mode .card-footer {
  grid-column: 4;
  grid-row: 1;
  align-self: stretch;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.load-more {
  display: flex;
  min-width: 220px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 24px auto 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: var(--surface);
  font-size: .76rem;
  font-weight: 780;
}
.load-more:hover { border-color: #96aa56; background: var(--surface-soft); }
.empty-state { padding: 62px 20px; border: 1px dashed var(--line); border-radius: 20px; background: var(--surface-soft); text-align: center; }
.empty-symbol {
  display: grid;
  width: 50px;
  height: 50px;
  margin: 0 auto;
  place-items: center;
  border-radius: 15px;
  color: var(--brand);
  background: var(--accent-soft);
  font-size: 1.4rem;
}
.empty-state h3 { margin: 16px 0 5px; }
.empty-state p { margin: 0 0 20px; color: var(--muted); font-size: .8rem; }
.primary-button, .secondary-button { min-height: 40px; padding: 0 16px; border-radius: 11px; font-size: .75rem; font-weight: 800; }
.primary-button { border: 1px solid var(--brand); color: white; background: var(--brand); }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .7rem;
}
footer span:first-child { color: var(--ink); font-weight: 850; letter-spacing: .08em; }

.detail-dialog {
  width: min(94vw, 640px);
  max-height: 90vh;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 30px 100px rgb(0 0 0 / 38%);
}
.detail-dialog::backdrop { background: rgb(6 23 17 / 65%); backdrop-filter: blur(6px); }
.dialog-shell { position: relative; max-height: 90vh; overflow-y: auto; }
.dialog-close {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 50%;
  color: white;
  background: rgb(255 255 255 / 10%);
  font-size: 1.35rem;
  line-height: 1;
}
.dialog-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 42px 42px 34px;
  color: white;
  background: radial-gradient(circle at 90% 10%, rgb(215 244 91 / 22%), transparent 13rem), var(--brand);
}
.dialog-avatar {
  display: grid;
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 22px 22px 22px 7px;
  color: var(--brand-strong);
  background: var(--accent);
  font-size: 1rem;
  font-weight: 900;
}
.detail-location { color: var(--accent); font-size: .68rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.dialog-banner h2 { margin: 7px 0 2px; font-size: clamp(1.35rem, 4vw, 1.8rem); letter-spacing: -.04em; line-height: 1.15; }
.dialog-banner p { margin: 0; color: rgb(255 255 255 / 65%); font-size: .76rem; }
.dialog-content { display: grid; padding: 30px 42px 34px; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-block {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 12px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}
.detail-block-wide { grid-column: 1 / -1; }
.detail-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: var(--brand);
  background: var(--accent-soft);
  font-size: .78rem;
  font-weight: 900;
}
.detail-block div { min-width: 0; }
.detail-block small { display: block; margin-bottom: 3px; color: var(--muted); font-size: .64rem; font-weight: 700; text-transform: uppercase; }
.detail-block strong { display: block; font-size: .86rem; }
.detail-block p { margin: 5px 0 0; color: var(--muted); font-size: .72rem; overflow-wrap: anywhere; }
.dialog-footer { display: flex; align-items: center; justify-content: space-between; grid-column: 1 / -1; gap: 14px; margin-top: 4px; }
.dialog-footer > span { color: var(--muted); font-size: .66rem; }
.toast {
  position: fixed;
  z-index: 60;
  right: 24px;
  bottom: 24px;
  padding: 12px 16px;
  border-radius: 12px;
  color: white;
  background: var(--brand);
  box-shadow: var(--shadow);
  font-size: .75rem;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 960px) {
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .summary-strip article:nth-child(1) { border-radius: 20px 0 0 0; }
  .summary-strip article:nth-child(2) { border-right: 1px solid var(--line); border-radius: 0 20px 0 0; }
  .summary-strip article:nth-child(3) { border-radius: 0 0 0 20px; }
  .summary-strip article:nth-child(4) { border-radius: 0 0 20px 0; }
  .dashboard-shell { gap: 38px; grid-template-columns: minmax(0, 1fr); }
  .domicile-panel { min-width: 0; }
  .domicile-list {
    flex-direction: row;
    margin-inline: -24px;
    padding: 0 24px 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 24px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .domicile-list::-webkit-scrollbar { display: none; }
  .domicile-button { min-width: 160px; scroll-snap-align: start; }
  .privacy-note { display: none; }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .site-header {
    min-height: 64px;
    padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  }
  .brand { gap: 10px; }
  .brand-mark { width: 40px; height: 40px; border-radius: 12px 12px 12px 4px; }
  .brand-copy strong { font-size: .82rem; }
  .icon-button { width: 44px; height: 44px; }
  .data-status, .brand-copy small { display: none; }
  .hero {
    min-height: 0;
    padding: 42px max(18px, env(safe-area-inset-right)) 46px max(18px, env(safe-area-inset-left));
  }
  .hero::after { right: -190px; }
  .eyebrow { margin-bottom: 14px; font-size: .7rem; }
  .hero h1 { font-size: clamp(2.35rem, 12vw, 3.4rem); line-height: .98; }
  .hero > p { max-width: 100%; margin: 16px 0 22px; font-size: .95rem; line-height: 1.55; }
  .hero-search {
    min-height: 54px;
    padding-inline: 18px;
    border-radius: 15px;
  }
  .hero-search input, .filter-search input, .select-control select { font-size: 1rem; }
  .hero-search kbd, .hero-meta .meta-separator, .hero-meta span:last-child { display: none; }
  .hero-meta { flex-wrap: wrap; margin-top: 20px; font-size: .8rem; }
  .summary-strip { margin-top: -18px; padding: 0 12px; }
  .summary-strip article { min-height: 88px; padding: 14px 12px; gap: 10px; }
  .summary-icon { width: 34px; height: 34px; border-radius: 10px; }
  .summary-strip strong { font-size: 1.2rem; }
  .summary-strip article div span { margin-top: 3px; font-size: .72rem; line-height: 1.25; }
  .dashboard-shell {
    margin: 44px auto 58px;
    padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
    gap: 40px;
  }
  .panel-heading { align-items: center; }
  .panel-heading h2 { font-size: 1.5rem; }
  .text-button { min-height: 44px; padding: 8px; font-size: .82rem; }
  .domicile-list {
    margin: 16px -16px 0;
    padding: 0 16px 8px;
    gap: 8px;
    scroll-snap-type: inline proximity;
    scroll-padding-inline: 16px;
  }
  .domicile-button {
    min-width: max-content;
    min-height: 48px;
    padding: 7px 10px 7px 8px;
    border-color: var(--line);
    border-radius: 999px;
    background: var(--surface);
    grid-template-columns: 32px auto auto;
    gap: 8px;
  }
  .domicile-button:hover { transform: none; }
  .domicile-dot { width: 32px; height: 32px; border-radius: 50%; }
  .domicile-button > span:nth-child(2) { font-size: .84rem; }
  .domicile-button .count { min-width: 26px; height: 26px; border-radius: 50%; font-size: .72rem; }
  .directory-heading { min-height: 0; align-items: center; }
  .directory-heading h2 { font-size: 1.65rem; }
  .directory-heading p { font-size: .85rem; }
  .view-controls { display: none; }
  .filter-bar { margin-top: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-search { grid-column: 1 / -1; }
  .filter-search, .select-control { min-height: 50px; min-width: 0; border-radius: 14px; }
  .select-control { padding-inline: 12px 6px; }
  .select-control select { min-width: 0; }
  .active-filter-row { align-items: flex-start; font-size: .8rem; }
  .filter-chip { min-height: 36px; padding: 7px 10px; font-size: .78rem; }
  .filter-chip button { display: grid; width: 24px; height: 24px; place-items: center; }
  .member-grid { grid-template-columns: 1fr; }
  .member-card,
  .member-grid.list-mode .member-card {
    min-height: 0;
    padding: 18px;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    align-items: stretch;
    gap: 0;
  }
  .member-grid.list-mode .card-top { display: flex; }
  .member-grid.list-mode .card-avatar { width: 48px; height: 48px; }
  .member-grid.list-mode .role-badge { display: inline-block; grid-column: auto; }
  .member-grid.list-mode .card-identity,
  .member-grid.list-mode .location-block,
  .member-grid.list-mode .card-footer {
    grid-column: auto;
    grid-row: auto;
  }
  .member-grid.list-mode .card-identity h3 { margin-top: 18px; }
  .member-grid.list-mode .location-block { margin-top: 16px; }
  .member-grid.list-mode .card-footer {
    align-self: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }
  .member-card:hover { transform: none; }
  .member-card h3 { font-size: 1.18rem; }
  .division-label, .location-line, .address-line { font-size: .84rem; }
  .location-block { margin-top: 16px; gap: 8px; }
  .address-line span:last-child { -webkit-line-clamp: 3; overflow-wrap: anywhere; }
  .role-badge, .domicile-tag { font-size: .74rem; }
  .card-footer { align-items: stretch; flex-direction: column; }
  .detail-button {
    min-height: 44px;
    padding: 0 14px;
    border-radius: 11px;
    color: white;
    background: var(--brand);
    font-size: .82rem;
  }
  .load-more { width: 100%; min-width: 0; min-height: 50px; font-size: .84rem; }
  .primary-button, .secondary-button { min-height: 46px; font-size: .84rem; }
  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 24px max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
    font-size: .76rem;
  }
  .detail-dialog {
    width: 100%;
    max-width: none;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: 24px 24px 0 0;
  }
  .detail-dialog::backdrop { background: rgb(6 23 17 / 72%); }
  .dialog-shell { max-height: 92dvh; overscroll-behavior: contain; }
  .dialog-close { top: 12px; right: 14px; width: 44px; height: 44px; }
  .dialog-banner { min-height: 142px; padding: 42px 20px 24px; gap: 14px; }
  .dialog-avatar { width: 58px; height: 58px; border-radius: 17px 17px 17px 6px; }
  .dialog-banner h2 { padding-right: 24px; font-size: 1.35rem; overflow-wrap: anywhere; }
  .dialog-banner p { font-size: .82rem; overflow-wrap: anywhere; }
  .dialog-content {
    padding: 18px max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    grid-template-columns: 1fr;
  }
  .detail-block, .detail-block-wide, .dialog-footer { grid-column: 1; }
  .detail-block { padding: 15px; }
  .detail-block small { font-size: .7rem; }
  .detail-block strong { font-size: .92rem; }
  .detail-block p { font-size: .82rem; }
  .dialog-footer { align-items: stretch; flex-direction: column; }
  .dialog-footer > span { font-size: .72rem; }
  .secondary-button { width: 100%; }
  .toast {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 16px;
    text-align: center;
    font-size: .82rem;
  }
}

@media (max-width: 420px) {
  .hero { padding-top: 34px; }
  .hero h1 { font-size: clamp(2.15rem, 11.5vw, 2.9rem); }
  .summary-strip article { min-height: 82px; padding: 12px 10px; }
  .summary-icon { display: none; }
  .summary-strip article div span { font-size: .68rem; }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-search { grid-column: auto; }
  .active-filter-row { flex-direction: column; gap: 7px; }
}

@media (max-width: 700px) and (orientation: landscape) and (max-height: 520px) {
  .hero { padding-block: 28px 34px; }
  .hero h1 { font-size: 2.55rem; }
  .hero > p { margin-block: 12px 16px; }
  .hero-meta { display: none; }
  .detail-dialog, .dialog-shell { max-height: 96dvh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
