:root {
  --navy: #0c2e8a;
  --navy-dark: #081f5e;
  --mint: #50d8af;
  --ink: #1d2433;
  --ink-2: #4a5468;
  --muted: #6b7489;
  --line: #e2e6ee;
  --bg: #ffffff;
  --bg-soft: #f5f7fb;
  /* status colours */
  --yes: #1a9e77;
  --yes-bg: #e3f4ee;
  --no: #d9534f;
  --no-bg: #fbe9e8;
  --na: #b8bec9;
  --na-bg: #eff1f4;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--navy); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 2000; background: #fff; padding: 6px 10px; }
[hidden] { display: none !important; }

/* ---------------- header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: #fff; border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); font-weight: 700; font-size: 1.05rem; }
.brand img { height: 34px; width: auto; }
.brand-tld { color: var(--mint); }
.nav { display: flex; gap: 4px; }
.nav a {
  text-decoration: none; color: var(--ink-2); font-weight: 500;
  padding: 8px 12px; border-radius: 8px;
}
.nav a:hover { background: var(--bg-soft); color: var(--navy); }
.nav a.active { color: var(--navy); background: #e8eefb; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; margin: 4px 0; background: var(--navy); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
  }
  .nav.open { display: flex; }
}

/* ---------------- hero / home ---------------- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #173f9e 60%, #1f5aa8 100%);
  color: #fff; padding: 56px 0 64px;
}
.hero h1 { max-width: 900px; font-size: clamp(1.45rem, 3vw, 2.3rem); }
.hero .lede { max-width: 760px; font-size: 1.05rem; opacity: .9; margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 600; color: var(--mint); margin: 0 0 8px; }
.page-head { padding-top: 28px; padding-bottom: 8px; }
.page-head .eyebrow { color: #138a68; }
.lede-sm { color: var(--ink-2); max-width: 860px; margin: 0; }

.entry-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px;
}
.hero + .wrap .entry-grid { margin-top: -32px; }
.entry {
  display: flex; flex-direction: column; gap: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; text-decoration: none; color: var(--ink);
  transition: border-color .15s, transform .15s;
}
.entry:hover { border-color: var(--navy); transform: translateY(-2px); }
.entry h2 { font-size: 1.1rem; margin: 0; color: var(--navy); }
.entry p { margin: 0; color: var(--ink-2); font-size: .93rem; }
.entry-tag { font-size: .78rem; font-weight: 600; color: #138a68; }
.entry-go { margin-top: auto; padding-top: 8px; font-weight: 600; color: var(--navy); font-size: .92rem; }
.entry-muted { background: var(--bg-soft); }

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 32px 0;
}
.stat { border-left: 3px solid var(--mint); padding: 4px 0 4px 14px; }
.stat b { display: block; font-size: 1.7rem; color: var(--navy); line-height: 1.2; }
.stat span { color: var(--ink-2); font-size: .9rem; }

.home-docs {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--bg-soft); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 40px;
}
.home-docs h2 { margin: 0 0 4px; }
.home-docs p { margin: 0; color: var(--ink-2); }
.btn {
  display: inline-block; background: var(--navy); color: #fff; text-decoration: none;
  padding: 10px 18px; border-radius: 8px; font-weight: 600; border: 0; cursor: pointer; font: inherit;
}
.btn:hover { background: var(--navy-dark); }
.btn-ghost { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn-ghost:hover { background: #e8eefb; }

/* ---------------- map pages ---------------- */
.map-layout {
  display: grid; grid-template-columns: 250px minmax(0, 1fr) 320px; gap: 16px; margin: 16px 0 24px;
}
.map { height: 640px; border: 1px solid var(--line); border-radius: var(--radius); background: #eef3f7; }
.controls, .detail {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: #fff;
  max-height: 700px; overflow: auto;
}
@media (max-width: 1100px) {
  .map-layout { grid-template-columns: 1fr; }
  .map { height: 70vh; min-height: 420px; }
  .controls, .detail { max-height: none; }
  .map-col { order: 2; }
  .controls { order: 1; }
  .detail { order: 3; }
}

.ind-group { margin-bottom: 14px; }
.ind-group h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 6px; }
.ind {
  display: flex; align-items: flex-start; gap: 8px; width: 100%;
  text-align: left; padding: 8px 10px; margin: 0 0 4px; border-radius: 8px; border: 1px solid transparent;
  background: none; cursor: pointer; font: inherit; font-size: .9rem; color: var(--ink);
}
.ind:hover { background: var(--bg-soft); }
.ind[aria-pressed="true"] { background: #e8eefb; border-color: #c6d4f3; color: var(--navy); font-weight: 600; }
.ind .count { margin-left: auto; font-size: .8rem; color: var(--muted); white-space: nowrap; font-weight: 500; }
.ind-select { display: none; width: 100%; padding: 8px; font: inherit; border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 1100px) {
  .ind-group { display: none; }
  .ind-select { display: block; }
}

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 2px 0; font-size: .85rem; color: var(--ink-2); }
.legend .title { width: 100%; font-weight: 600; color: var(--ink); }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; border: 1px solid rgba(0,0,0,.12); }

.detail h2 { font-size: 1.15rem; color: var(--navy); margin-bottom: 2px; }
.detail .sub-name { color: var(--muted); font-size: .85rem; margin: 0 0 12px; }
.detail h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 16px 0 8px; }
.item { padding: 8px 0; border-top: 1px solid var(--line); }
.item:first-of-type { border-top: 0; }
.item-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; font-size: .9rem; }
.item ul { margin: 6px 0 0; padding: 0; list-style: none; }
.item li { margin: 2px 0; font-size: .83rem; overflow-wrap: anywhere; }
.item li a { text-decoration: none; }
.item li a:hover { text-decoration: underline; }
.detail .btn { margin-top: 14px; width: 100%; text-align: center; }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.badge.yes { color: #0f6e52; background: var(--yes-bg); }
.badge.no { color: #a8322e; background: var(--no-bg); }
.badge.na { color: #5d6575; background: var(--na-bg); }

.mini-stats { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-size: .88rem; color: var(--ink-2); }
.mini-stats b { color: var(--navy); }
.bar { height: 8px; background: var(--na-bg); border-radius: 4px; overflow: hidden; margin: 4px 0 10px; }
.bar span { display: block; height: 100%; background: var(--yes); }

/* leaflet bits */
.leaflet-container { font-family: inherit; }
.island-label {
  background: none; border: 0; box-shadow: none; color: #3b4a6b;
  font-size: 11px; font-weight: 600; text-align: center; line-height: 1.2; white-space: nowrap;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}
.leaflet-tooltip.unit-tip { font-family: inherit; font-size: 13px; padding: 4px 8px; }

/* ---------------- tables ---------------- */
.table-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0; }
.table-head h2 { margin: 0; }
input[type="search"], select {
  font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
input[type="search"] { min-width: 240px; }
.wide-search { width: 100%; max-width: 420px; margin: 8px 0 16px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.results { border-collapse: collapse; width: 100%; font-size: .88rem; }
.results th, .results td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.results th { background: var(--bg-soft); font-weight: 600; font-size: .8rem; color: var(--ink-2); position: sticky; top: 0; cursor: pointer; user-select: none; }
.results th[aria-sort="ascending"]::after { content: " ▲"; font-size: .7em; }
.results th[aria-sort="descending"]::after { content: " ▼"; font-size: .7em; }
.results tbody tr { cursor: pointer; }
.results tbody tr:hover { background: #f8faff; }
.results tbody tr.sel { background: #eaf0fd; }
.results td.c { text-align: center; }
.results th.c { text-align: center; }
.results .group-row th { cursor: default; text-align: center; background: #eef2f9; }
.note { color: var(--muted); font-size: .82rem; margin: 8px 0 40px; }

/* ---------------- province grid ---------------- */
.prov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 40px; }
.prov-card {
  display: block; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: #fff;
}
.prov-card:hover { border-color: var(--navy); box-shadow: var(--shadow); }
.prov-card b { color: var(--navy); font-size: 1rem; }
.prov-card small { display: block; color: var(--muted); font-size: .8rem; margin: 2px 0 8px; }
.prov-card .bar { margin: 6px 0 4px; }
.prov-card .pct { font-size: .82rem; color: var(--ink-2); }
.prov-switch { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; font-size: .9rem; }

/* ---------------- archive & docs ---------------- */
.sub { margin-top: 24px; }
.link-list { list-style: none; padding: 0; margin: 0 0 40px; display: grid; gap: 8px; }
.link-list a {
  display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink);
}
.link-list a:hover { border-color: var(--navy); }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; margin: 16px 0 48px; }
.doc {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff;
}
a.doc:hover { border-color: var(--navy); box-shadow: var(--shadow); }
.doc .cover {
  aspect-ratio: 1 / 1.414; background: var(--bg-soft); display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--line); overflow: hidden;
}
.doc .cover img { width: 100%; height: 100%; object-fit: cover; }
.doc .cover .ph { color: var(--muted); font-size: .9rem; padding: 16px; text-align: center; }
.doc .cover .ph b { display: block; font-size: 2.2rem; color: var(--navy); opacity: .25; }
.doc .meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.doc .kind { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #138a68; }
.doc .t { font-size: .9rem; font-weight: 500; }
.doc .act { margin-top: auto; font-size: .85rem; font-weight: 600; color: var(--navy); }
.doc.pending .act { color: var(--muted); }

.prose { max-width: 860px; padding-bottom: 40px; }
.prose p, .prose li { color: var(--ink-2); }
.prose h2 { margin-top: 28px; }

/* ---------------- partners & footer ---------------- */
.partners { border-top: 1px solid var(--line); padding: 28px 0 32px; background: #fff; }
.partners h2 { text-align: center; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 20px; }
.partner-row {
  display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 24px;
}
.partner-row img { height: 52px; width: auto; max-width: 16%; object-fit: contain; }
.partner-row img.tall { height: 84px; }
@media (max-width: 700px) {
  .partner-row { flex-wrap: wrap; justify-content: center; gap: 18px 24px; }
  .partner-row img { max-width: 40%; height: 40px; }
  .partner-row img.tall { height: 52px; }
}
.site-footer { background: var(--navy); color: #dfe6f7; text-align: center; padding: 18px 0; font-size: .88rem; }
.site-footer strong { color: #fff; }

.loading { padding: 40px; text-align: center; color: var(--muted); }
