/* ============================================================
   Cascadia.me — Field Maps
   Public, list-first official-source discovery and offline guide.
   ============================================================ */

.field-maps-page {
  --fm-paper: #f7f0e2;
  --fm-ink: #123f51;
  --fm-water: #237e89;
  --fm-spruce: #315f48;
  --fm-sun: #e2b449;
  --fm-coral: #bd4d3c;
  --fm-line: rgba(6, 59, 92, 0.2);
  --fm-soft-line: rgba(6, 59, 92, 0.11);
}

.field-maps-page main {
  overflow: clip;
}

.field-maps-page .site-header {
  background: rgba(251, 247, 238, 0.96);
}

.fm-container {
  width: min(100% - clamp(2rem, 6vw, 6rem), 90rem);
  margin-inline: auto;
}

.fm-reading {
  width: min(100%, 46rem);
}

.fm-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 2rem;
  color: var(--lw-muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.fm-breadcrumb a {
  color: inherit;
}

.fm-breadcrumb span[aria-hidden="true"] {
  color: rgba(83, 101, 107, 0.58);
}

.fm-hero {
  position: relative;
  padding: calc(var(--nav-height) + clamp(4.5rem, 9vw, 8rem)) 0 clamp(4rem, 8vw, 7rem);
  border-bottom: 1px solid var(--lw-line);
  background:
    radial-gradient(ellipse at 86% 28%, transparent 0 12%, rgba(47, 170, 179, 0.14) 12.15% 12.55%, transparent 12.7% 18%, rgba(47, 170, 179, 0.1) 18.15% 18.45%, transparent 18.6% 25%, rgba(47, 170, 179, 0.08) 25.1% 25.35%, transparent 25.5%),
    radial-gradient(ellipse at 84% 36%, rgba(226, 180, 73, 0.13), transparent 38%),
    linear-gradient(122deg, var(--lw-cream-50) 0 58%, var(--fm-paper) 58% 100%);
}

.fm-hero::after {
  content: "";
  position: absolute;
  right: clamp(1rem, 5vw, 5rem);
  bottom: clamp(1rem, 4vw, 3.5rem);
  width: clamp(7rem, 17vw, 15rem);
  height: 1px;
  background: var(--fm-coral);
  box-shadow: 0 -0.5rem 0 -0.42rem var(--fm-coral), 0 0.5rem 0 -0.42rem var(--fm-coral);
  opacity: 0.76;
}

.fm-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.4fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: end;
}

.fm-hero h1 {
  max-width: 63rem;
  margin: 0;
  color: var(--lw-ocean-900);
  font-size: clamp(4rem, 7.6vw, 7.8rem);
  font-weight: 500;
  letter-spacing: -0.058em;
  line-height: 0.87;
}

.fm-hero-lede {
  margin: 0;
  color: var(--lw-muted);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.8vw, 1.55rem);
  line-height: 1.5;
}

.fm-trust-strip {
  border-bottom: 1px solid var(--lw-line);
  background: var(--lw-ocean-900);
  color: var(--lw-cream-50);
}

.fm-trust-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.fm-trust-list li {
  min-height: 6.5rem;
  padding: 1.3rem clamp(1rem, 2vw, 2rem);
  border-right: 1px solid rgba(251, 247, 238, 0.18);
}

.fm-trust-list li:last-child {
  border-right: 0;
}

.fm-trust-list strong,
.fm-trust-list span {
  display: block;
}

.fm-trust-list strong {
  color: var(--lw-glacial-on-ocean);
  font-size: 0.7rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.fm-trust-list span {
  margin-top: 0.45rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.35;
}

.fm-section {
  padding: clamp(4.75rem, 8vw, 8rem) 0;
  scroll-margin-top: calc(var(--nav-height) + 1rem);
}

.fm-section + .fm-section {
  border-top: 1px solid var(--lw-line);
}

.fm-section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(18rem, 0.38fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
  margin-bottom: clamp(2.75rem, 5vw, 4.5rem);
}

.fm-section-heading h2 {
  max-width: 58rem;
  margin: 0;
  color: var(--lw-ocean-900);
  font-size: clamp(3rem, 5.6vw, 5.8rem);
  font-weight: 500;
  letter-spacing: -0.048em;
  line-height: 0.94;
}

.fm-section-heading > p:last-child {
  margin: 0;
  color: var(--lw-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.fm-job-index {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-block: 1px solid var(--lw-line);
  list-style: none;
}

.fm-job-index li {
  border-right: 1px solid var(--lw-line);
}

.fm-job-index li:last-child {
  border-right: 0;
}

.fm-job-index a {
  display: flex;
  min-height: 9rem;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.35rem clamp(1rem, 2vw, 1.75rem);
  color: var(--lw-ocean-900);
  text-decoration: none;
  transition: background 180ms ease-out, color 180ms ease-out;
}

.fm-job-index a:hover {
  color: var(--lw-cream-50);
  background: var(--lw-ocean-900);
}

.fm-job-number {
  color: var(--fm-coral);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.fm-job-index a:hover .fm-job-number {
  color: var(--lw-glacial-on-ocean);
}

.fm-job-index strong {
  max-width: 10rem;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.8vw, 1.55rem);
  font-weight: 500;
  line-height: 1.1;
}

.fm-region-proof {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(20rem, 0.38fr);
  border: 1px solid var(--lw-line);
  background: var(--fm-paper);
}

.fm-region-copy,
.fm-region-notes {
  padding: clamp(2rem, 5vw, 4.5rem);
}

.fm-region-copy {
  border-right: 1px solid var(--lw-line);
}

.fm-region-copy h2,
.fm-region-copy h3 {
  margin: 0;
  color: var(--lw-ocean-900);
  font-size: clamp(2.7rem, 5vw, 5.2rem);
  font-weight: 500;
  letter-spacing: -0.048em;
  line-height: 0.94;
}

.fm-region-copy > p:not(.surface-eyebrow) {
  max-width: 45rem;
  margin-top: 1.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 1.5vw, 1.28rem);
  line-height: 1.65;
}

.fm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.fm-action {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1rem;
  border: 1px solid var(--lw-ocean-900);
  border-radius: 2px;
  color: var(--lw-ocean-900);
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 720;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
}

.fm-action:hover,
.fm-action-primary {
  color: var(--lw-cream-50);
  background: var(--lw-ocean-900);
}

.fm-action-primary:hover {
  background: var(--lw-ocean-700);
}

.fm-region-notes {
  display: grid;
  align-content: start;
  gap: 1.5rem;
  margin: 0;
}

.fm-region-notes div {
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--lw-line);
}

.fm-region-notes div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.fm-region-notes dt,
.fm-meta-grid dt {
  color: var(--lw-muted);
  font-size: 0.69rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.fm-region-notes dd,
.fm-meta-grid dd {
  margin: 0.35rem 0 0;
  color: var(--lw-text);
  line-height: 1.5;
}

.fm-definition {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(20rem, 0.38fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: start;
}

.fm-definition-copy p {
  font-family: var(--font-display);
  font-size: clamp(1.12rem, 1.45vw, 1.3rem);
  line-height: 1.72;
}

.fm-definition-note {
  padding: 1.75rem;
  border-top: 4px solid var(--fm-sun);
  background: var(--fm-paper);
}

.fm-definition-note h3 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
}

.fm-definition-note ul,
.fm-check-list {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding-left: 1.15rem;
}

.fm-source-list {
  border-top: 1px solid var(--lw-line);
}

.fm-source-record {
  display: grid;
  grid-template-columns: minmax(15rem, 0.32fr) minmax(0, 0.68fr);
  gap: clamp(2rem, 6vw, 6rem);
  padding: clamp(2.75rem, 5vw, 4.5rem) 0;
  border-bottom: 1px solid var(--lw-line);
  scroll-margin-top: calc(var(--nav-height) + 1.5rem);
}

.fm-source-heading h2,
.fm-source-heading h3 {
  margin: 0;
  color: var(--lw-ocean-900);
  font-size: clamp(2.35rem, 4vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.042em;
  line-height: 0.98;
}

.fm-publisher {
  margin: 0 0 0.75rem;
  color: var(--fm-spruce);
  font-size: 0.73rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fm-status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.2rem;
  color: var(--lw-text);
  font-size: 0.78rem;
  font-weight: 700;
}

.fm-status::before {
  content: "";
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: var(--fm-spruce);
  box-shadow: 0 0 0 4px rgba(49, 95, 72, 0.12);
}

.fm-status-blocked::before {
  background: var(--fm-sun);
  box-shadow: 0 0 0 4px rgba(226, 180, 73, 0.16);
}

.fm-source-body > p:first-child {
  max-width: 48rem;
  color: var(--lw-text);
  font-family: var(--font-display);
  font-size: clamp(1.12rem, 1.5vw, 1.28rem);
  line-height: 1.68;
}

.fm-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 2rem 0 0;
  border-top: 1px solid var(--fm-soft-line);
}

.fm-meta-grid div {
  padding: 1rem 1rem 1rem 0;
  border-bottom: 1px solid var(--fm-soft-line);
}

.fm-meta-grid div:nth-child(odd) {
  border-right: 1px solid var(--fm-soft-line);
}

.fm-meta-grid div:nth-child(even) {
  padding-left: 1rem;
}

.fm-limit {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--fm-coral);
  background: rgba(189, 77, 60, 0.055);
  color: var(--lw-text);
  font-size: 0.9rem;
  line-height: 1.6;
}

.fm-limit strong {
  color: var(--fm-coral);
}

.fm-sheet-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1.75rem 0 0;
  padding: 0;
  border-block: 1px solid var(--fm-soft-line);
  list-style: none;
}

.fm-sheet-list li {
  padding: 1rem;
  border-right: 1px solid var(--fm-soft-line);
}

.fm-sheet-list li:last-child {
  border-right: 0;
}

.fm-sheet-list a,
.fm-sheet-list small {
  display: block;
}

.fm-sheet-list a {
  font-weight: 700;
}

.fm-sheet-list small {
  margin-top: 0.35rem;
  color: var(--lw-muted);
  line-height: 1.45;
}

.fm-live-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--lw-line);
}

.fm-live-group {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-right: 1px solid var(--lw-line);
}

.fm-live-group:last-child {
  border-right: 0;
}

.fm-live-group h3 {
  margin: 0 0 1rem;
  color: var(--lw-ocean-900);
  font-size: 1.55rem;
}

.fm-live-group ul {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding-left: 1.1rem;
}

.fm-live-group p {
  color: var(--lw-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.fm-callout {
  padding: clamp(2rem, 5vw, 4rem);
  color: var(--lw-cream-50);
  background: var(--lw-ocean-900);
}

.fm-callout .surface-eyebrow {
  color: var(--lw-glacial-on-ocean);
}

.fm-callout h2 {
  max-width: 60rem;
  margin: 0;
  color: var(--lw-cream-50);
  font-size: clamp(2.75rem, 5vw, 5.2rem);
  font-weight: 500;
  letter-spacing: -0.048em;
  line-height: 0.95;
}

.fm-callout p {
  max-width: 46rem;
  margin-top: 1.5rem;
  color: rgba(251, 247, 238, 0.86);
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 1.5vw, 1.28rem);
  line-height: 1.65;
}

.fm-callout .fm-action {
  color: var(--lw-cream-50);
  border-color: rgba(251, 247, 238, 0.72);
}

.fm-callout .fm-action:hover {
  color: var(--lw-ocean-900);
  background: var(--lw-cream-50);
}

/* Offline guide */

.fm-guide-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.68fr) minmax(18rem, 0.32fr);
  gap: clamp(2rem, 6vw, 6rem);
}

.fm-guide-intro > p {
  font-family: var(--font-display);
  font-size: clamp(1.18rem, 1.7vw, 1.45rem);
  line-height: 1.7;
}

.fm-guide-intro aside {
  padding: 1.5rem;
  border-top: 4px solid var(--fm-sun);
  background: var(--fm-paper);
}

.fm-guide-intro aside strong {
  display: block;
  margin-bottom: 0.65rem;
  color: var(--lw-ocean-900);
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.fm-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--lw-line);
  list-style: none;
  counter-reset: fm-step;
}

.fm-step {
  position: relative;
  min-height: 14rem;
  padding: clamp(2rem, 4vw, 3.25rem);
  border-right: 1px solid var(--lw-line);
  border-bottom: 1px solid var(--lw-line);
  counter-increment: fm-step;
}

.fm-step:nth-child(even) {
  border-right: 0;
}

.fm-step::before {
  content: counter(fm-step, decimal-leading-zero);
  display: block;
  margin-bottom: 1rem;
  color: var(--fm-coral);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.fm-step h3 {
  margin: 0;
  color: var(--lw-ocean-900);
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.fm-step p {
  max-width: 34rem;
  margin-top: 0.9rem;
  line-height: 1.65;
}

.fm-worksheet {
  padding: clamp(2rem, 5vw, 4rem);
  border: 1px solid var(--lw-ocean-900);
  background: var(--lw-cream-50);
}

.fm-worksheet-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: start;
  padding-bottom: 1.75rem;
  border-bottom: 2px solid var(--lw-ocean-900);
}

.fm-worksheet-head h2 {
  margin: 0;
  color: var(--lw-ocean-900);
  font-size: clamp(2.5rem, 4vw, 4.2rem);
  font-weight: 500;
  letter-spacing: -0.045em;
}

.fm-worksheet-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 2rem;
  margin-top: 2rem;
}

.fm-field {
  min-height: 4.4rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--lw-ocean-900);
}

.fm-field-wide {
  grid-column: 1 / -1;
}

.fm-field strong {
  display: block;
  color: var(--lw-muted);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fm-field span {
  display: block;
  min-height: 2rem;
  margin-top: 0.45rem;
}

.fm-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 2rem;
  margin-top: 2rem;
}

.fm-checks label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  line-height: 1.45;
}

.fm-checks input {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.2rem;
  accent-color: var(--fm-water);
}

.fm-print-note {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--fm-soft-line);
  color: var(--lw-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.fm-quiet-coda {
  display: grid;
  grid-template-columns: minmax(0, 0.55fr) minmax(18rem, 0.45fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.fm-quiet-coda h2 {
  margin: 0;
  color: var(--lw-ocean-900);
  font-size: clamp(2.8rem, 5vw, 5.2rem);
  font-weight: 500;
  letter-spacing: -0.048em;
  line-height: 0.95;
}

.fm-quiet-coda-copy p {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.7;
}

@media (prefers-reduced-motion: no-preference) {
  .js .fm-hero-layout {
    animation: cascadia-copy-arrive 720ms var(--ease-out) 90ms both;
  }
}

@media (max-width: 980px) {
  .fm-trust-list,
  .fm-job-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fm-trust-list li,
  .fm-job-index li {
    border-bottom: 1px solid rgba(251, 247, 238, 0.18);
  }

  .fm-job-index li {
    border-bottom-color: var(--lw-line);
  }

  .fm-trust-list li:nth-child(even),
  .fm-job-index li:nth-child(even) {
    border-right: 0;
  }

  .fm-job-index li:last-child {
    grid-column: 1 / -1;
  }

  .fm-job-index li:last-child a {
    min-height: 6rem;
  }

  .fm-live-grid {
    grid-template-columns: 1fr;
  }

  .fm-live-group {
    border-right: 0;
    border-bottom: 1px solid var(--lw-line);
  }

  .fm-live-group:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 760px) {
  .fm-hero {
    padding-top: calc(var(--nav-height) + 3.5rem);
    background:
      radial-gradient(ellipse at 100% 15%, transparent 0 12%, rgba(47, 170, 179, 0.12) 12.2% 12.55%, transparent 12.7% 22%, rgba(47, 170, 179, 0.08) 22.2% 22.5%, transparent 22.7%),
      var(--fm-paper);
  }

  .fm-hero-layout,
  .fm-section-heading,
  .fm-region-proof,
  .fm-definition,
  .fm-source-record,
  .fm-guide-intro,
  .fm-quiet-coda {
    grid-template-columns: 1fr;
  }

  .fm-hero h1 {
    font-size: clamp(3.5rem, 17vw, 5.4rem);
  }

  .fm-hero::after {
    display: none;
  }

  .fm-region-copy {
    border-right: 0;
    border-bottom: 1px solid var(--lw-line);
  }

  .fm-meta-grid,
  .fm-sheet-list,
  .fm-steps,
  .fm-worksheet-fields,
  .fm-checks {
    grid-template-columns: 1fr;
  }

  .fm-meta-grid div:nth-child(odd) {
    border-right: 0;
  }

  .fm-meta-grid div:nth-child(even) {
    padding-left: 0;
  }

  .fm-sheet-list li {
    border-right: 0;
    border-bottom: 1px solid var(--fm-soft-line);
  }

  .fm-sheet-list li:last-child {
    border-bottom: 0;
  }

  .fm-step {
    min-height: 0;
    border-right: 0;
  }

  .fm-worksheet-head {
    grid-template-columns: 1fr;
  }

  .fm-field-wide {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .fm-container {
    width: min(100% - 2rem, 90rem);
  }

  .fm-trust-list,
  .fm-job-index {
    grid-template-columns: 1fr;
  }

  .fm-trust-list li,
  .fm-job-index li,
  .fm-trust-list li:nth-child(even),
  .fm-job-index li:nth-child(even) {
    border-right: 0;
  }

  .fm-job-index li:last-child {
    grid-column: auto;
  }

  .fm-job-index a,
  .fm-job-index li:last-child a {
    min-height: 6rem;
  }
}

/* Phase 6 — optional synchronized map and source results. */
.fm-explorer-section {
  background:
    linear-gradient(rgba(18, 63, 81, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 63, 81, 0.035) 1px, transparent 1px),
    var(--lw-cream-50);
  background-size: 2rem 2rem;
}

.fm-explorer-heading {
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}

.fm-explorer-toolbar {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(15rem, 0.42fr) minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 1rem;
}

.fm-explorer-search {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 3.35rem;
  border: 1px solid rgba(18, 63, 81, 0.25);
  border-radius: 999px;
  background: #fffdf8;
  box-shadow: 0 0.65rem 1.75rem rgba(18, 63, 81, 0.08);
}

.fm-search-icon {
  position: relative;
  width: 1rem;
  height: 1rem;
  margin-left: 1.15rem;
  border: 2px solid var(--fm-ink);
  border-radius: 50%;
  opacity: 0.72;
}

.fm-search-icon::after {
  content: "";
  position: absolute;
  top: 0.72rem;
  left: 0.78rem;
  width: 0.48rem;
  height: 2px;
  transform: rotate(45deg);
  transform-origin: left center;
  background: var(--fm-ink);
}

.fm-explorer-search input {
  width: 100%;
  min-width: 0;
  padding: 0.9rem 1.15rem 0.9rem 0.85rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fm-ink);
  font: inherit;
  font-weight: 650;
}

.fm-explorer-search:focus-within {
  border-color: var(--fm-water);
  box-shadow: 0 0 0 3px rgba(35, 126, 137, 0.18), 0 0.65rem 1.75rem rgba(18, 63, 81, 0.08);
}

.fm-filter-chips {
  display: flex;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.2rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.fm-filter-chip {
  flex: 0 0 auto;
  min-height: 3.05rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(18, 63, 81, 0.22);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.94);
  color: var(--fm-ink);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 750;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.fm-filter-chip:hover {
  transform: translateY(-1px);
  border-color: var(--fm-water);
}

.fm-filter-chip.is-active {
  border-color: var(--fm-ink);
  background: var(--fm-ink);
  color: var(--lw-cream-50);
}

.fm-filter-chip:focus-visible,
.fm-result-select:focus-visible,
.fm-sheet-handle:focus-visible,
.fm-map-utility:focus-visible,
.fm-map-retry:focus-visible,
.fm-map-layers summary:focus-visible {
  outline: 3px solid var(--fm-sun);
  outline-offset: 3px;
}

.fm-explorer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(21rem, 0.38fr);
  min-height: 44rem;
  overflow: hidden;
  border: 1px solid rgba(18, 63, 81, 0.25);
  border-radius: 1.35rem;
  background: #fffdf8;
  box-shadow: 0 1.5rem 4rem rgba(18, 63, 81, 0.14);
}

.fm-map-panel {
  position: relative;
  display: grid;
  grid-template-rows: minmax(40rem, 1fr) auto;
  min-width: 0;
  overflow: hidden;
  background: #d9e5dc;
}

.fm-map-canvas {
  position: relative;
  min-width: 0;
  min-height: 40rem;
  background:
    radial-gradient(circle at 35% 42%, rgba(226, 180, 73, 0.3), transparent 28%),
    linear-gradient(145deg, #dbe9e5, #a9c9ca);
}

.fm-map-canvas .maplibregl-canvas:focus-visible {
  outline: 4px solid var(--fm-sun);
  outline-offset: -4px;
}

.fm-map-canvas .maplibregl-ctrl-group,
.fm-map-canvas .maplibregl-ctrl-attrib {
  border: 1px solid rgba(18, 63, 81, 0.2);
  border-radius: 0.8rem;
  background: rgba(255, 253, 248, 0.95);
  box-shadow: 0 0.55rem 1.6rem rgba(18, 63, 81, 0.18);
}

.fm-map-canvas .maplibregl-ctrl button {
  width: 2.75rem;
  height: 2.75rem;
}

.fm-map-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 0.6rem;
  padding: 2rem;
  text-align: center;
  color: var(--fm-ink);
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 253, 248, 0.98), rgba(247, 240, 226, 0.84) 32%, rgba(35, 126, 137, 0.25) 70%),
    repeating-radial-gradient(ellipse at 50% 50%, transparent 0 1.7rem, rgba(18, 63, 81, 0.15) 1.75rem 1.82rem);
}

.fm-map-placeholder[hidden] {
  display: none;
}

.fm-map-placeholder strong {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2.3rem);
  font-weight: 600;
}

.fm-map-placeholder span {
  max-width: 27rem;
  color: var(--lw-muted);
}

.fm-map-retry,
.fm-map-utility {
  min-height: 2.8rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(18, 63, 81, 0.24);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.96);
  color: var(--fm-ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
}

.fm-map-retry {
  justify-self: center;
  margin-top: 0.5rem;
}

.fm-map-utilities {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 5;
  display: flex;
  gap: 0.55rem;
}

.fm-map-layers {
  position: relative;
}

.fm-map-layers summary {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  min-height: 2.8rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(18, 63, 81, 0.24);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.96);
  color: var(--fm-ink);
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
  box-shadow: 0 0.55rem 1.6rem rgba(18, 63, 81, 0.12);
}

.fm-map-layers summary::-webkit-details-marker {
  display: none;
}

.fm-map-layers summary span {
  color: var(--lw-muted);
  font-size: 0.7rem;
}

.fm-map-layer-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  width: max-content;
  min-width: 15.5rem;
  padding: 0.65rem;
  border: 1px solid rgba(18, 63, 81, 0.2);
  border-radius: 1rem;
  background: #fffdf8;
  box-shadow: 0 1rem 2.5rem rgba(18, 63, 81, 0.18);
}

.fm-map-layer-panel label {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  min-height: 2.8rem;
  padding: 0.5rem 0.55rem;
  color: var(--fm-ink);
  font-size: 0.8rem;
  font-weight: 650;
}

.fm-map-layer-panel input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--fm-water);
}

.fm-map-legend {
  position: absolute;
  left: 1rem;
  bottom: 4.25rem;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  max-width: calc(100% - 8rem);
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(18, 63, 81, 0.18);
  border-radius: 0.8rem;
  background: rgba(255, 253, 248, 0.94);
  color: var(--fm-ink);
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: 0 0.55rem 1.6rem rgba(18, 63, 81, 0.12);
}

.fm-map-legend span {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
}

.fm-map-legend i {
  display: inline-block;
  flex: 0 0 auto;
}

.fm-legend-source {
  width: 0.78rem;
  height: 0.78rem;
  border: 2px solid #fffdf8;
  border-radius: 50%;
  background: var(--fm-coral);
  box-shadow: 0 0 0 1px var(--fm-ink);
}

.fm-legend-sheet {
  width: 0.9rem;
  height: 0.7rem;
  border: 2px dashed #9a561b;
  background: rgba(226, 180, 73, 0.28);
}

.fm-map-note {
  position: relative;
  z-index: 3;
  margin: 0;
  padding: 0.65rem 0.9rem;
  border-top: 1px solid rgba(18, 63, 81, 0.18);
  background: #fffdf8;
  color: var(--lw-muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.fm-map-note a {
  color: var(--fm-water);
  font-weight: 750;
}

.fm-results-sheet {
  position: relative;
  z-index: 3;
  display: flex;
  min-width: 0;
  max-height: 44rem;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid rgba(18, 63, 81, 0.2);
  background: rgba(255, 253, 248, 0.98);
}

.fm-sheet-handle {
  display: none;
}

.fm-results-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--fm-soft-line);
}

.fm-results-heading .surface-eyebrow {
  margin-bottom: 0.25rem;
}

.fm-results-heading h3,
.fm-results-heading p {
  margin: 0;
}

.fm-results-heading h3 {
  color: var(--fm-ink);
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
}

.fm-results-heading > p {
  color: var(--lw-muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.fm-result-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.fm-result-card {
  position: relative;
  padding: 0.85rem;
  border-bottom: 1px solid var(--fm-soft-line);
  background: transparent;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.fm-result-card.is-selected {
  background: rgba(226, 180, 73, 0.13);
  box-shadow: inset 4px 0 0 var(--fm-coral);
}

.fm-result-card[hidden] {
  display: none;
}

.fm-result-select {
  display: grid;
  width: 100%;
  grid-template-columns: 2.3rem minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.45rem;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.fm-result-index {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 1px solid rgba(18, 63, 81, 0.2);
  border-radius: 50%;
  color: var(--fm-water);
  font-size: 0.72rem;
  font-weight: 800;
}

.fm-result-card.is-selected .fm-result-index {
  border-color: var(--fm-coral);
  background: var(--fm-coral);
  color: #fff;
}

.fm-result-copy {
  display: grid;
  gap: 0.2rem;
}

.fm-result-copy small {
  color: var(--fm-water);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fm-result-copy strong {
  color: var(--fm-ink);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.2;
}

.fm-result-copy span {
  color: var(--lw-muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.fm-result-card > a {
  display: inline-flex;
  margin: 0.35rem 0 0 3.35rem;
  color: var(--fm-coral);
  font-size: 0.72rem;
  font-weight: 800;
}

.fm-result-empty {
  margin: 0;
  padding: 1.5rem;
  color: var(--lw-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .fm-explorer-section {
    padding-inline: 0;
  }

  .fm-explorer-section > .fm-container {
    width: min(100% - 1rem, 90rem);
  }

  .fm-explorer-toolbar {
    grid-template-columns: 1fr;
    margin-bottom: 0.65rem;
  }

  .fm-filter-chips {
    margin-inline: -0.15rem;
    padding: 0.2rem 0.15rem 0.45rem;
  }

  .fm-filter-chip {
    min-height: 2.85rem;
  }

  .fm-explorer-layout {
    position: relative;
    display: block;
    height: min(78svh, 47rem);
    min-height: 38rem;
    border-radius: 1.15rem;
  }

  .fm-map-panel {
    grid-template-rows: minmax(0, 1fr) auto;
    height: 100%;
  }

  .fm-map-canvas {
    min-height: 0;
  }

  .fm-map-utilities {
    top: 0.7rem;
    left: 0.7rem;
  }

  .fm-map-legend {
    left: 0.7rem;
    bottom: 13.75rem;
    max-width: calc(100% - 1.4rem);
  }

  .fm-map-note {
    padding: 0.52rem 0.7rem;
    font-size: 0.61rem;
  }

  .fm-results-sheet {
    position: absolute;
    z-index: 6;
    inset: auto 0 0;
    height: min(58svh, 31rem);
    max-height: none;
    border-top: 1px solid rgba(18, 63, 81, 0.22);
    border-left: 0;
    border-radius: 1.15rem 1.15rem 0 0;
    box-shadow: 0 -1rem 2.8rem rgba(18, 63, 81, 0.2);
    transform: translateY(calc(100% - 12.9rem));
    transition: transform 220ms ease;
  }

  .fm-results-sheet[data-sheet-state="expanded"] {
    transform: translateY(0);
  }

  .fm-sheet-handle {
    display: grid;
    min-height: 2rem;
    place-items: center;
    border: 0;
    background: transparent;
    cursor: ns-resize;
    touch-action: none;
  }

  .fm-sheet-handle > span[aria-hidden="true"] {
    width: 2.8rem;
    height: 0.28rem;
    border-radius: 999px;
    background: rgba(18, 63, 81, 0.3);
  }

  .fm-results-heading {
    padding: 0.35rem 1rem 0.75rem;
  }

  .fm-results-sheet[data-sheet-state="compact"] .fm-result-card:not(.is-selected) {
    display: none;
  }

  .fm-results-sheet[data-sheet-state="compact"] .fm-result-list {
    overflow: hidden;
  }

  .fm-result-card {
    padding: 0.65rem 0.75rem;
  }

  .fm-map-canvas .maplibregl-ctrl-bottom-right {
    bottom: 12.2rem;
  }

  .fm-map-canvas .maplibregl-ctrl-bottom-left {
    bottom: 12.25rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  .fm-results-sheet,
  .fm-filter-chip {
    transition: none;
  }
}

@media print {
  @page {
    margin: 0.55in;
  }

  .field-maps-page {
    color: #111;
    background: #fff;
    font-size: 10.5pt;
  }

  .field-maps-page .site-header,
  .field-maps-page .site-footer,
  .field-maps-page .surface-skip-link,
  .field-maps-page .feedback-widget,
  .field-maps-page .fm-trust-strip,
  .field-maps-page .fm-explorer-section,
  .field-maps-page .fm-actions,
  .field-maps-page [data-print-page] {
    display: none !important;
  }

  .fm-hero,
  .fm-section,
  .fm-source-record {
    padding: 0.25in 0;
    background: #fff;
  }

  .fm-hero-layout,
  .fm-section-heading,
  .fm-region-proof,
  .fm-definition,
  .fm-source-record,
  .fm-guide-intro,
  .fm-quiet-coda {
    grid-template-columns: 1fr;
    gap: 0.18in;
  }

  .fm-hero h1,
  .fm-section-heading h2,
  .fm-source-heading h2,
  .fm-source-heading h3,
  .fm-worksheet-head h2 {
    color: #111;
    font-size: 26pt;
  }

  .fm-hero::after {
    display: none;
  }

  .fm-source-record,
  .fm-worksheet,
  .fm-step,
  .fm-live-group {
    break-inside: avoid;
  }

  .fm-worksheet {
    padding: 0.2in;
    border-color: #111;
  }

  .fm-steps,
  .fm-worksheet-fields,
  .fm-checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fm-step {
    min-height: 0;
    padding: 0.2in;
  }

  .field-maps-page a[href^="http"]::after {
    content: " (" attr(href) ")";
    overflow-wrap: anywhere;
    font-family: var(--font-body);
    font-size: 8pt;
    font-weight: 400;
  }
}
