:root {
  --portal-header-height: 68px;
  --portal-footer-height: 44px;
  --map-toolbar-height: 42px;
  --green-950: #062f29;
  --green-900: #073f36;
  --green-800: #0c594c;
  --green-700: #16705f;
  --green-100: #dcebe5;
  --green-050: #edf5f1;
  --paper: #f5f7f5;
  --cream: #fbfaf5;
  --white: #ffffff;
  --ink: #17312c;
  --muted: #63736f;
  --line: #d8e2de;
  --accent: #8cc7ae;
  --gold: #caa662;
  --shadow: 0 18px 54px rgba(4, 40, 34, .11);
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100%; margin: 0; min-width: 320px; background: var(--paper); }
body.portal-page {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
}
a { color: inherit; }
button { font: inherit; }
img { display: block; max-width: 100%; }
.content-shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }
.portal-header .content-shell,
.portal-footer .content-shell { width: min(1380px, calc(100% - 32px)); }

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

.skip-link { position: fixed; z-index: 100; top: -60px; left: 14px; padding: 10px 14px; border-radius: 8px; color: var(--white); background: var(--green-950); }
.skip-link:focus { top: 10px; }

.portal-header { position: sticky; z-index: 20; top: 0; flex: 0 0 auto; color: var(--white); background: var(--green-950); box-shadow: 0 3px 16px rgba(0, 0, 0, .18); }
.portal-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--portal-header-height); gap: 18px; }
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 12px; color: var(--white); text-decoration: none; }
.brand-mark { flex: 0 0 auto; width: 28px; height: 28px; border: 7px solid var(--accent); border-top-color: transparent; border-radius: 50% 50% 46% 54%; transform: rotate(28deg); }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-size: 1.02rem; letter-spacing: -.02em; }
.brand-copy small { color: rgba(255, 255, 255, .66); font-size: .71rem; }
.uat-chip { flex: 0 0 auto; padding: 7px 11px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; color: rgba(255, 255, 255, .8); font-size: .76rem; font-weight: 650; }
.uat-nav { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.uat-nav a { padding: 9px 12px; border: 1px solid transparent; border-radius: 8px; color: rgba(255, 255, 255, .8); font-size: .79rem; font-weight: 740; text-decoration: none; }
.uat-nav a:hover,
.uat-nav a:focus-visible { color: var(--white); background: rgba(255, 255, 255, .1); }
.uat-nav a.is-active { border-color: rgba(140, 199, 174, .45); color: var(--green-950); background: var(--accent); box-shadow: 0 3px 10px rgba(0, 0, 0, .16); }

.brand:focus-visible,
.uat-nav a:focus-visible,
.map-external:focus-visible,
.text-link:focus-visible,
.plan-preview:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.portal-main { flex: 1 1 auto; width: 100%; min-width: 0; min-height: 0; }
.portal-main--map { display: flex; flex: 1 1 auto; width: 100%; min-height: 0; flex-direction: column; background: #d3ded9; }
.map-workspace { display: flex; flex: 1 1 auto; width: 100%; max-width: none; min-width: 0; min-height: 0; flex-direction: column; }
.map-toolbar { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; min-height: var(--map-toolbar-height); gap: 18px; padding: 6px max(16px, calc((100vw - 1380px) / 2)); border-bottom: 1px solid #c9d6d1; background: var(--cream); }
.map-toolbar > span { color: var(--muted); font-size: .71rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.map-external { padding: 5px 8px; border-radius: 6px; color: var(--green-800); font-size: .74rem; font-weight: 760; text-decoration: none; }
.map-external:hover { background: var(--green-050); }
.map-frame-shell {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  min-width: 0;
  height: calc(100vh - var(--portal-header-height) - var(--map-toolbar-height) - var(--portal-footer-height));
  height: calc(100dvh - var(--portal-header-height) - var(--map-toolbar-height) - var(--portal-footer-height));
  min-height: 70vh;
  min-height: 70dvh;
  overflow: hidden;
  background: #d3ded9;
}
.webgis-frame { position: absolute; inset: 0; display: block; width: 100%; max-width: none; height: 100%; border: 0; background: #d3ded9; }

.portal-main--content { background: var(--paper); }
.content-shell--document { max-width: 1160px; }
.pug-page,
.resource-page,
.consultation-page { padding: clamp(48px, 6vw, 82px) 0 84px; }
.eyebrow,
.card-kicker { margin: 0 0 10px; color: var(--green-700); font-size: .71rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.section-heading h1,
.section-heading h2 { margin: 0; color: var(--green-950); font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.035em; }
.section-heading h1 { font-size: clamp(2.35rem, 4.6vw, 4rem); }
.section-heading > div > p:not(.eyebrow) { max-width: 720px; margin: 14px 0 0; color: var(--muted); line-height: 1.65; }
.section-heading--small { align-items: baseline; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.section-heading--small h2 { font-size: clamp(1.55rem, 2.4vw, 2rem); }
.section-heading--small span { color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.metadata-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.metadata-item { min-height: 104px; padding: 21px; background: var(--white); }
.metadata-item dt { color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.metadata-item dd { margin: 10px 0 0; color: var(--green-950); font-size: .96rem; font-weight: 680; line-height: 1.42; }
.source-panel { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-top: 18px; padding: 16px 18px; border-left: 3px solid var(--gold); color: var(--muted); background: var(--cream); }
.source-link { flex: 0 0 auto; color: var(--green-800); font-size: .88rem; font-weight: 760; text-underline-offset: 4px; }
.verification-note { margin: 0; font-size: .82rem; line-height: 1.55; }
.content-group { margin-top: 58px; }
.document-list,
.resource-list { display: grid; gap: 12px; }
.document-card { display: flex; align-items: center; justify-content: space-between; gap: 26px; padding: 24px 26px; border: 1px solid var(--line); border-radius: 13px; background: var(--white); }
.document-card h3,
.plan-card h3 { margin: 0; color: var(--green-950); font-size: 1.05rem; line-height: 1.3; }
.document-facts { display: flex; flex-wrap: wrap; gap: 9px 16px; margin: 10px 0 0; color: var(--muted); font-size: .78rem; }
.document-facts span + span::before { content: "·"; margin-right: 16px; color: #a6b2ae; }
.card-actions { display: flex; align-items: center; gap: 18px; }
.text-link { color: var(--muted); font-size: .87rem; font-weight: 720; text-underline-offset: 4px; }
.text-link--primary { color: var(--green-800); }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.plan-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.plan-preview { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #dbe3df; }
.plan-preview img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.plan-preview:hover img { transform: scale(1.018); }
.plan-card__body { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 7px 18px; padding: 20px; }
.plan-card__body .card-kicker { grid-column: 1 / -1; margin-bottom: 0; }
.resource-list a { display: grid; gap: 7px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); text-decoration: none; }
.resource-list a:hover { border-color: var(--green-700); }
.resource-list span { color: var(--muted); }

.consultation-hero { max-width: 900px; margin-bottom: 28px; }
.consultation-hero h1 { margin: 0; color: var(--green-950); font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.35rem, 4.6vw, 4rem); font-weight: 500; line-height: 1.02; letter-spacing: -.035em; }
.consultation-status { display: inline-flex; margin: 0 0 18px; padding: 7px 11px; border: 1px solid rgba(22, 112, 95, .2); border-radius: 999px; color: var(--green-800); background: var(--green-050); font-size: .72rem; font-weight: 820; letter-spacing: .08em; }
.consultation-location { margin: 16px 0 0; color: var(--muted); font-size: 1rem; font-weight: 680; }
.consultation-section { margin-top: 54px; }
.consultation-intro { max-width: 800px; margin: 0; color: var(--muted); font-size: 1.04rem; line-height: 1.72; }
.consultation-observations { padding: 28px; border-left: 4px solid var(--gold); border-radius: 0 14px 14px 0; background: var(--cream); }
.consultation-observations .section-heading { margin-bottom: 16px; }
.consultation-observations > p { max-width: 820px; margin: 0; color: var(--ink); line-height: 1.65; }
.observation-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 0 0; padding: 0; list-style: none; }
.observation-list li { display: grid; gap: 5px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.observation-list strong { color: var(--muted); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.observation-list span,
.observation-list a { color: var(--green-900); font-size: .9rem; line-height: 1.45; }
.consultation-map-action { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.consultation-map-action h2 { margin: 0; color: var(--green-950); font-family: Georgia, "Times New Roman", serif; font-size: 1.55rem; font-weight: 500; }
.consultation-map-action .map-external { flex: 0 0 auto; padding: 10px 13px; border: 1px solid var(--green-100); }

.portal-footer { flex: 0 0 auto; color: rgba(255, 255, 255, .72); background: var(--green-950); }
.portal-footer__inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--portal-footer-height); gap: 20px; }
.portal-footer__inner > div { display: flex; align-items: center; gap: 10px; }
.portal-footer strong { color: var(--white); font-size: .78rem; }
.portal-footer span,
.portal-footer p { font-size: .72rem; }
.portal-footer span::before { content: "·"; margin-right: 10px; color: rgba(255, 255, 255, .3); }
.portal-footer p { margin: 0; }

@media (max-width: 860px) {
  .metadata-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-heading { align-items: start; flex-direction: column; }
  .source-panel { align-items: start; flex-direction: column; }
}

@media (max-width: 760px) {
  .portal-header__inner { gap: 9px; }
  .uat-nav { max-width: min(48vw, 320px); overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; }
  .uat-nav::-webkit-scrollbar { display: none; }
  .uat-nav a { flex: 0 0 auto; padding: 8px 9px; font-size: .74rem; }
}

@media (max-width: 620px) {
  :root {
    --portal-header-height: 60px;
    --map-toolbar-height: 40px;
  }
  .content-shell { width: min(100% - 28px, 1160px); }
  .portal-header .content-shell,
  .portal-footer .content-shell { width: min(100% - 24px, 1380px); }
  .portal-header__inner { min-height: var(--portal-header-height); }
  .brand-copy small,
  .uat-chip { display: none; }
  .map-toolbar { min-height: var(--map-toolbar-height); padding: 5px 12px; }
  .map-toolbar > span { font-size: .65rem; }
  .map-external { font-size: .7rem; }
  .map-frame-shell {
    height: calc(100vh - var(--portal-header-height) - var(--map-toolbar-height) - var(--portal-footer-height));
    height: calc(100dvh - var(--portal-header-height) - var(--map-toolbar-height) - var(--portal-footer-height));
    min-height: 70vh;
    min-height: 70dvh;
  }
  .pug-page,
  .resource-page,
  .consultation-page { padding: 42px 0 62px; }
  .metadata-grid { grid-template-columns: 1fr; }
  .metadata-item { min-height: auto; }
  .document-card { align-items: stretch; flex-direction: column; padding: 21px; }
  .card-actions { justify-content: space-between; }
  .document-facts span + span::before { display: none; }
  .plan-grid { grid-template-columns: 1fr; }
  .observation-list { grid-template-columns: 1fr; }
  .consultation-observations { padding: 22px 20px; }
  .consultation-map-action { align-items: flex-start; flex-direction: column; }
  .portal-footer__inner { min-height: var(--portal-footer-height); }
  .portal-footer p { display: none; }
}

@media (max-width: 390px) {
  .brand-mark { width: 25px; height: 25px; border-width: 6px; }
  .brand-copy strong { font-size: .94rem; }
  .uat-nav { max-width: 50vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
