/* ConservaNode stylesheet. Built from src/conservanode/site/static/assets/css; edit the partials. */

/* ---- tokens.css ---- */
/* ConservaNode design tokens: "modern field notebook" (docs/design/modern-review.md).
   Every component reads these; nothing else defines raw colours, type sizes, spacing or radii. */

:root {
  color-scheme: light dark;

  /* Type: system fonts only (no downloads) */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --fs-xs: .8125rem;
  --fs-sm: .875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: clamp(1.6rem, 1.2rem + 1.5vw, 2rem);
  --fs-3xl: clamp(2rem, 1.4rem + 2.6vw, 3.1rem);
  --fs-h1: clamp(1.75rem, 1.35rem + 1.6vw, 2.4rem);

  /* Spacing: 4 px base */
  --sp-1: .25rem;
  --sp-2: .5rem;
  --sp-3: .75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;

  /* Shape and depth */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(23, 32, 28, .06), 0 1px 3px rgba(23, 32, 28, .04);
  --shadow-2: 0 6px 20px rgba(23, 32, 28, .12);

  /* Layout */
  --container: 72rem;
  --measure: 68ch;
  --tap: 44px;
  --header-h: 3.75rem;

  /* Colour: light */
  --c-bg: #fbfaf7;
  --c-surface: #ffffff;
  --c-surface-2: #f2efe8;
  --c-border: #e2ddd3;
  --c-border-strong: #c9c1b4;
  --c-text: #17201c;
  --c-text-muted: #4f5b55;
  --c-brand: #1d5f3a;
  --c-brand-strong: #13442a;
  --c-brand-soft: #e5f1e9;
  --c-on-brand: #ffffff;
  --c-focus: #1d5f3a;
  --c-caution: #5c4100;
  --c-caution-bg: #fdf3d8;
  --c-caution-border: #e9cf86;
  --c-stated: #1d5f3a;
  --c-stated-bg: #e5f1e9;
  --c-stated-border: #a9d3b5;
  --c-inferred: #6d4c41;
  --c-inferred-bg: #fbf5ee;
  --c-inferred-border: #d7ccc8;
  --c-backdrop: rgba(15, 23, 20, .45);

  /* The About diagrams are drawn for a light panel, so their panel and caption stay light in both schemes. */
  --c-figure-bg: #ffffff;
  --c-figure-text: #4f5b55;
}

@media (prefers-color-scheme: dark) {
  :root {
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-2: 0 8px 24px rgba(0, 0, 0, .5);

    --c-bg: #101413;
    --c-surface: #171c1a;
    --c-surface-2: #1f2522;
    --c-border: #2c3430;
    --c-border-strong: #44504a;
    --c-text: #e7ece9;
    --c-text-muted: #a3aea8;
    --c-brand: #7fcf9f;
    --c-brand-strong: #a8e2bf;
    --c-brand-soft: #15291f;
    --c-on-brand: #0b1a12;
    --c-focus: #7fcf9f;
    --c-caution: #ffe3a3;
    --c-caution-bg: #2a2312;
    --c-caution-border: #5a4a1e;
    --c-stated: #a8e2bf;
    --c-stated-bg: #15291f;
    --c-stated-border: #2f6b47;
    --c-inferred: #d7ccc8;
    --c-inferred-bg: #29201b;
    --c-inferred-border: #5d4037;
    --c-backdrop: rgba(0, 0, 0, .6);
  }
}

/* ---- base.css ---- */
/* Reset, base typography and accessibility helpers */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--c-bg);
  color: var(--c-text);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--sp-4));
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  color: var(--c-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  top: -9999px;
  left: var(--sp-4);
  background: var(--c-brand);
  color: var(--c-on-brand);
  padding: var(--sp-2) var(--sp-4);
  z-index: 1000;
  border-radius: var(--r-sm);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: var(--sp-4);
}

:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.site-main p {
  max-width: var(--measure);
}


/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--c-text);
  line-height: 1.25;
  margin-top: var(--sp-5);
  margin-bottom: var(--sp-3);
  font-weight: 700;
}

h1 {
  font-size: var(--fs-h1);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--fs-2xl);
  border-bottom: 1px solid var(--c-border);
  padding-bottom: var(--sp-2);
  margin-top: var(--sp-6);
}

h3 {
  font-size: var(--fs-xl);
}

p, ul, ol, dl {
  margin-top: 0;
  margin-bottom: var(--sp-5);
}

a {
  color: var(--c-brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--c-brand-strong);
  text-decoration-thickness: 2px;
}

.lead {
  font-size: var(--fs-lg);
  line-height: 1.6;
}

.text-muted {
  color: var(--c-text-muted);
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
}

pre code {
  background: none;
  border: 0;
  padding: 0;
}

/* Long URLs shown as link text wrap instead of widening the page */
.official-link-p a,
.source-link {
  overflow-wrap: anywhere;
}

code {
  background: var(--c-surface-2);
  padding: 0.15em 0.35em;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border);
}


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

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

/* ---- layout.css ---- */
/* Container */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

/* Main Content */
.site-main {
  flex: 1;
  padding: var(--sp-6) 0 var(--sp-8);
}


/* Cards & Grid */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
  margin: var(--sp-5) 0;
}

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.section-header-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.section-header-inline h2 {
  margin: 0;
}

/* Breadcrumb trail on detail pages: "Section > Item" */
.breadcrumbs {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li + li::before {
  content: "\203A";
  margin-right: var(--sp-2);
}

.breadcrumbs [aria-current="page"] {
  color: var(--c-text);
  overflow-wrap: anywhere;
}

.page-subtitle {
  margin: calc(var(--sp-2) * -1) 0 var(--sp-3);
  color: var(--c-text-muted);
  font-size: var(--fs-md);
}

.show-in-network,
.unresolved-note {
  margin: var(--sp-3) 0;
}

.unresolved-note {
  max-width: 62ch;
  font-size: var(--fs-sm);
}

/* ---- header.css ---- */
/* Site header: one slim sticky row on wide screens (brand, nav, search).
   Below 1200px the nav folds into the no-JS <details class="nav-menu"> disclosure. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}

.header-container {
  max-width: calc(var(--container) + 8rem);
  margin: 0 auto;
  padding: var(--sp-2) var(--sp-5);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-4);
  min-height: var(--header-h);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--tap);
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;
  margin-right: auto;
}

.site-brand:hover {
  text-decoration: none;
}

.site-logo {
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.site-title {
  font-family: var(--font-serif);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--c-text);
  line-height: 1.15;
}

.site-tagline {
  display: none;
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  line-height: 1.3;
}

/* The tagline only fits beside the Menu button on mid-size screens. */
@media (min-width: 640px) and (max-width: 1199px) {
  .site-tagline {
    display: block;
  }
}

/* Menu disclosure (small screens) */
.nav-menu {
  flex: 0 0 auto;
}

.nav-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--tap);
  padding: 0 var(--sp-4);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.nav-menu-toggle::-webkit-details-marker {
  display: none;
}

/* Three-bar icon drawn in CSS. */
.nav-menu-toggle::before {
  content: "";
  width: 1rem;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}

.nav-menu[open] > .nav-menu-toggle {
  background: var(--c-surface-2);
}

.site-nav {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-2);
  padding: var(--sp-2) var(--sp-5) var(--sp-4);
}

.site-nav ul {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: var(--container);
}

.site-nav a {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--c-text);
  text-decoration: none;
  padding: 0 var(--sp-3);
  border-radius: var(--r-sm);
}

.site-nav a:hover {
  color: var(--c-brand);
  background: var(--c-surface-2);
}

.site-nav a.is-active-nav {
  color: var(--c-brand);
  background: var(--c-brand-soft);
}

/* Wide screens: the list is always shown inline and the Menu button is hidden.
   Browsers that cannot style the details content keep the working Menu button instead. */
@media (min-width: 1200px) {
  @supports selector(::details-content) {
    .nav-menu {
      flex: 0 0 auto;
    }

    .nav-menu > .nav-menu-toggle {
      display: none;
    }

    .nav-menu::details-content {
      content-visibility: visible;
      display: contents;
    }

    .site-nav {
      position: static;
      background: none;
      border: 0;
      box-shadow: none;
      padding: 0;
    }

    .site-nav ul {
      flex-direction: row;
      flex-wrap: nowrap;
      gap: var(--sp-1);
      margin: 0;
    }

    .site-nav a {
      min-height: 2.25rem;
      font-size: var(--fs-sm);
      padding: 0 var(--sp-2);
      white-space: nowrap;
    }

    .site-nav a.is-active-nav {
      box-shadow: inset 0 -2px 0 var(--c-brand);
      border-radius: var(--r-sm) var(--r-sm) 0 0;
    }
  }

}

/* Search */
.header-search {
  position: relative;
  flex: 1 1 100%;
  order: 3;
}

@media (min-width: 640px) {
  .header-search {
    flex: 0 1 15rem;
    order: 0;
  }
}

.header-search input[type="search"] {
  width: 100%;
  min-height: var(--tap);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-md);
  font-family: var(--font-sans);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm);
  color: var(--c-text);
}

@media (min-width: 1200px) {
  .header-search input[type="search"] {
    min-height: 2.25rem;
    font-size: var(--fs-sm);
  }
}

.header-search input[type="search"]::placeholder {
  color: var(--c-text-muted);
  opacity: 1;
}

.header-search input[type="search"]:focus {
  background: var(--c-surface);
}

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: var(--sp-1);
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-2);
  max-height: 380px;
  overflow-y: auto;
  z-index: 50;
}

@media (min-width: 640px) {
  .search-dropdown {
    left: auto;
    width: min(26rem, 90vw);
  }
}

.search-result-item {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--c-border);
  text-decoration: none;
  color: inherit;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover,
.search-result-item:focus,
.search-result-item.highlighted {
  background: var(--c-brand-soft);
  outline: none;
}

.search-result-title {
  font-weight: 600;
  color: var(--c-text);
  font-size: var(--fs-md);
}

.search-result-sub {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-top: var(--sp-1);
}

/* ---- banners.css ---- */
/* Notices around the content. Amber (caution) is reserved for the required Preliminary banner;
   the coverage notice is quiet and neutral. The early-prototype note lives in the footer (footer.css). */

/* Preliminary data banner: the one caution element, shown on every data page */
.preliminary-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  background: var(--c-caution-bg);
  border: 1px solid var(--c-caution-border);
  border-left: 4px solid var(--c-caution);
  border-radius: var(--r-sm);
  color: var(--c-caution);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-5);
  font-size: var(--fs-md);
  font-weight: 500;
  line-height: 1.5;
}

/* Caution icon drawn in CSS; the alt text after "/" keeps it silent for screen readers. */
.preliminary-banner::before {
  content: "!";
  content: "!" / "";
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--c-caution);
  color: var(--c-caution-bg);
  font-weight: 800;
  font-size: var(--fs-sm);
  line-height: 1;
}

.preliminary-banner strong {
  font-weight: 700;
}

.preliminary-banner a {
  color: inherit;
  font-weight: 700;
}

/* Coverage notice on notice pages: a neutral note, not a second caution banner */
.coverage-banner {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-text-muted);
  border-radius: var(--r-sm);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-6);
  color: var(--c-text);
}

.coverage-banner .banner-badge {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: var(--sp-1) var(--sp-2);
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm);
  margin-bottom: var(--sp-2);
}

.coverage-banner p {
  margin: 0;
  font-size: var(--fs-md);
  line-height: 1.5;
}

/* ---- components/buttons.css ---- */
/* Buttons: primary (brand fill), secondary (outlined), ghost (text-weight outline); sm and lg sizes.
   Every button is a 44px tap target on touch-sized screens. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 2.5rem;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.25;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-sm);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--c-brand);
  color: var(--c-on-brand);
}

.btn-primary:hover {
  background: var(--c-brand-strong);
  color: var(--c-on-brand);
}

.btn-secondary {
  background: var(--c-surface);
  color: var(--c-text);
  border-color: var(--c-border-strong);
}

.btn-secondary:hover {
  background: var(--c-surface-2);
  color: var(--c-text);
}

.btn-ghost {
  background: transparent;
  color: var(--c-brand);
  border-color: var(--c-border-strong);
}

.btn-ghost:hover {
  background: var(--c-brand-soft);
  border-color: var(--c-brand);
  color: var(--c-brand);
}

.btn-sm {
  min-height: 2rem;
  font-size: var(--fs-sm);
  padding: var(--sp-1) var(--sp-3);
}

.btn-lg {
  min-height: 3rem;
  font-size: var(--fs-lg);
  padding: var(--sp-3) var(--sp-5);
}

@media (max-width: 899px) {
  .btn,
  .btn-sm {
    min-height: var(--tap);
  }
}

/* ---- components/pills.css ---- */
/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-sm);
  line-height: 1.3;
}

.badge-stated {
  background: var(--c-stated-bg);
  color: var(--c-stated);
  border: 1px solid var(--c-stated-border);
}

.badge-inferred {
  background: var(--c-inferred-bg);
  color: var(--c-inferred);
  border: 1px dashed var(--c-inferred-border);
}

.badge-expl {
  font-size: var(--fs-xs);
  font-weight: normal;
  opacity: 0.85;
}


.notice-species-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: var(--sp-2) 0;
}

.mini-pill {
  display: inline-block;
  padding: var(--sp-1) var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--c-brand-soft);
  color: var(--c-brand);
  border: 1px solid var(--c-stated-border);
  border-radius: var(--r-sm);
  text-decoration: none;
}

.mini-pill:hover {
  text-decoration: underline;
}


.entity-group-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-2);
  background: var(--c-brand-soft);
  border: 1px solid var(--c-stated-border);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
}

.inspector-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.inspector-pill {
  display: inline-block;
  padding: var(--sp-1) var(--sp-3);
  background: var(--c-brand-soft);
  border: 1px solid var(--c-stated-border);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  text-decoration: none;
  color: var(--c-text);
}

.inspector-pill:hover {
  border-color: var(--c-brand);
  text-decoration: none;
}

.inspector-pill-place {
  background: var(--c-surface-2);
  border-color: var(--c-border-strong);
}

/* Profile Fact Pills Row on Entity Pages */
.profile-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  margin-bottom: var(--sp-2);
}

.profile-pill {
  display: inline-flex;
  flex-direction: column;
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}

.profile-pill-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-text-muted);
}

.profile-pill-val {
  font-size: var(--fs-sm);
  color: var(--c-text);
}


/* Status pills on the pillars and contribute pages */
.status-pill {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-sm);
  border: 1px solid var(--c-caution-border);
  background: var(--c-caution-bg);
  color: var(--c-caution);
}

.status-pill.is-live {
  border-color: var(--c-stated-border);
  background: var(--c-stated-bg);
  color: var(--c-stated);
}

/* Filter chips (directory filters, network/locality pickers, map quick-select) */
.chip-btn,
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  min-height: 2rem;
  padding: var(--sp-1) var(--sp-3);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.25;
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-pill);
  text-decoration: none;
  cursor: pointer;
}

.chip-btn:hover,
.chip:hover {
  border-color: var(--c-brand);
  color: var(--c-brand);
  text-decoration: none;
}

.chip-btn.is-active,
.chip-btn.active-chip,
.btn.active-chip {
  background: var(--c-brand);
  border-color: var(--c-brand);
  color: var(--c-on-brand);
}

@media (max-width: 899px) {
  .chip-btn {
    min-height: var(--tap);
  }
}

/* ---- components/cards.css ---- */
/* One card system for every list and directory: .card is the surface; .card-link (a whole-card link),
   .bento-card and .recent-notice-card add the shared hover/focus state. Same radius, border and padding everywhere. */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  box-shadow: var(--shadow-1);
}

@media (min-width: 640px) {
  .card {
    padding: var(--sp-5);
  }
}

.card-title {
  margin-top: 0;
  margin-bottom: var(--sp-2);
  font-size: var(--fs-lg);
  line-height: 1.3;
}

.card-title a {
  color: var(--c-text);
  text-decoration: none;
}

.card-title a:hover {
  color: var(--c-brand);
  text-decoration: underline;
}

.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.card-link:hover {
  color: inherit;
  text-decoration: none;
}

.card-link,
.bento-card,
.recent-notice-card {
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.card-link:hover,
.bento-card:hover,
.recent-notice-card:hover,
.bento-card:focus-within,
.recent-notice-card:focus-within {
  border-color: var(--c-brand);
  box-shadow: var(--shadow-2);
}

.card-link:hover,
.bento-card:hover,
.recent-notice-card:hover {
  transform: translateY(-2px);
}

a.card-link:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 3px;
  border-radius: var(--r-md);
}

/* Small eyebrow label above a card or panel title */
.inspector-badge,
.notice-meta-tag {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-brand);
  margin-bottom: var(--sp-2);
}

/* Date / agency / document line on cards and record headers */
.notice-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--sp-1);
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-2);
}

.notice-meta-line strong {
  color: var(--c-text);
}

/* Neutral explanatory card */
.note-card {
  background: var(--c-surface-2);
  border-left: 4px solid var(--c-border-strong);
  box-shadow: none;
}

/* Card lists (recent notices, cases) */
.recent-notices-section {
  margin: var(--sp-7) 0;
}

.recent-notices-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin: var(--sp-4) 0;
}

.recent-notice-card .card-title {
  font-size: var(--fs-xl);
  margin: var(--sp-1) 0 var(--sp-2);
}

.official-title-sub {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-2);
}

.notice-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  border-top: 1px solid var(--c-border);
  padding-top: var(--sp-3);
  margin-top: var(--sp-3);
  font-size: var(--fs-sm);
}

.notice-card-footer a {
  font-weight: 600;
}

.headline-rule-note {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

/* Bento Card Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.bento-grid-2 {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
}

.bento-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bento-card[hidden] {
  display: none !important;
}

.bento-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
  flex-wrap: wrap;
}

.bento-group-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-text-muted);
  text-decoration: none;
}

a.bento-group-tag:hover {
  color: var(--c-brand);
  text-decoration: underline;
}

.bento-card-title {
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  line-height: 1.3;
  margin: 0 0 var(--sp-1) 0;
}

.bento-card-title a {
  color: var(--c-text);
  text-decoration: none;
}

.bento-card-title a:hover {
  color: var(--c-brand);
  text-decoration: underline;
}

.bento-sci {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-2);
}

.bento-detail-line {
  font-size: var(--fs-sm);
  color: var(--c-text);
  margin-bottom: var(--sp-3);
  line-height: 1.4;
}

.bento-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border);
  margin-top: auto;
  font-size: var(--fs-sm);
}

.bento-primary-link {
  font-weight: 600;
  color: var(--c-brand);
  text-decoration: none;
}

.bento-primary-link:hover {
  text-decoration: underline;
}

.bento-ext-link {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

/* ---- components/tables.css ---- */
/* Tables: always inside .table-wrap, which scrolls sideways on small screens instead of overflowing the page */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: var(--sp-5) 0 var(--sp-6);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  box-shadow: var(--shadow-1);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  text-align: left;
}

th {
  background: var(--c-surface-2);
  padding: var(--sp-3) var(--sp-4);
  font-weight: 700;
  border-bottom: 1px solid var(--c-border-strong);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: bottom;
}

td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-border);
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--c-surface-2);
}

/* ---- components/filters.css ---- */
/* Live Filter Bar for Bento Explorers */
.ui-filter-bar {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-4);
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.ui-filter-search-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.ui-filter-input {
  flex: 1 1 320px;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-md);
  font-family: var(--font-sans);
  color: var(--c-text);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}

.ui-filter-input:focus {
  outline: 2px solid var(--c-focus);
  border-color: var(--c-brand);
}

.ui-filter-count {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text-muted);
  white-space: nowrap;
}

.ui-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.ui-filter-empty {
  padding: var(--sp-5);
  text-align: center;
  background: var(--c-surface-2);
  border-radius: var(--r-md);
  color: var(--c-text-muted);
  font-weight: 500;
}

/* ---- home.css ---- */
/* Home page: hero (eyebrow, display title, taglines, calls to action, stat row), spotlight, explore tiles */

.hero {
  display: grid;
  gap: var(--sp-6);
  padding: var(--sp-4) 0 var(--sp-6);
  margin-bottom: var(--sp-6);
  border-bottom: 1px solid var(--c-border);
}

/* The primary tagline, as a small line above the headline */
.hero-eyebrow {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--c-brand);
}

.hero-title {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-2xl);
  line-height: 1.18;
  letter-spacing: -0.015em;
  max-width: 36ch;
  text-wrap: balance;
}

.hero-secondary {
  margin: 0 0 var(--sp-4);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-xl);
  color: var(--c-text-muted);
}

.hero .lead {
  margin-bottom: var(--sp-5);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.stat-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}

@media (min-width: 720px) {
  .stat-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--sp-4);
}

.stat-num {
  font-family: var(--font-serif);
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: 1.1;
  color: var(--c-brand);
}

.stat-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text-muted);
  margin-top: var(--sp-1);
}

/* Spotlight Card */
.spotlight-section {
  margin: var(--sp-6) 0;
}

.spotlight-card {
  background: var(--c-surface);
  border: 2px solid var(--c-stated-border);
  border-radius: var(--r-md);
  padding: var(--sp-6);
  box-shadow: var(--shadow-1);
  position: relative;
}

.spotlight-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.spotlight-badge {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: var(--sp-1) var(--sp-2);
  background: var(--c-brand-soft);
  color: var(--c-brand);
  border-radius: var(--r-sm);
}

.spotlight-sub {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
}

.spotlight-title {
  font-family: var(--font-serif);
  font-size: var(--fs-2xl);
  margin-top: 0;
  margin-bottom: var(--sp-2);
}

.spotlight-meta {
  font-size: var(--fs-md);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-5);
  line-height: 1.6;
}

.spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}


.spotlight-icon {
  flex-shrink: 0;
  color: var(--c-brand);
}

.spotlight-sci-sub {
  font-size: var(--fs-lg);
  font-weight: normal;
  color: var(--c-text-muted);
  margin-left: var(--sp-2);
}

.spotlight-notice-line {
  font-size: var(--fs-md);
  margin-bottom: var(--sp-4);
}

/* Explore Tiles */
.explore-tiles-section {
  margin: var(--sp-7) 0;
}

.explore-grid {
  margin-top: var(--sp-4);
}

.explore-tile {
  display: flex;
  flex-direction: column;
}

.tile-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--c-brand-soft);
  color: var(--c-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-3);
}

.tile-icon {
  display: block;
}

.explore-tile p:last-child {
  margin-top: auto;
  font-weight: 600;
}

/* ---- workspace.css ---- */
/* Segmented Workspace Shell & Mode Switcher */
.workspace-shell {
  margin-bottom: var(--sp-7);
}

.workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: var(--sp-2);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-5);
  align-items: stretch;
}

.ui-tab-btn {
  flex: 1 1 210px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--c-text);
  font-family: var(--font-sans);
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.ui-tab-btn:hover {
  background: var(--c-surface);
}

.ui-tab-btn.is-active {
  background: var(--c-surface);
  border-color: var(--c-brand);
  box-shadow: var(--shadow-1);
}

.ui-tab-btn .tab-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--c-text);
}

.ui-tab-btn.is-active .tab-title {
  color: var(--c-brand);
}

.ui-tab-btn .tab-sub {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-top: var(--sp-1);
}

.ui-tab-expand {
  flex: 0 0 auto;
  align-self: center;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--c-surface);
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  cursor: pointer;
}

.ui-tab-expand:hover,
.ui-tab-expand.is-active {
  color: var(--c-brand);
  border-color: var(--c-brand);
}

.ui-tab-panel[hidden] {
  display: none !important;
}

/* ---- cases.css ---- */
/* Case pages: the reported route as a numbered stepper (origin -> transit -> destination ...) */
.route-steps {
  list-style: none;
  counter-reset: route;
  margin: var(--sp-5) 0;
  padding: 0;
}

.route-step {
  position: relative;
  counter-increment: route;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: 0 0 var(--sp-5) calc(2rem + var(--sp-4));
}

/* Step number */
.route-step::before {
  content: counter(route);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--c-brand);
  color: var(--c-on-brand);
  font-weight: 700;
  font-size: var(--fs-sm);
}

/* Connector line between steps */
.route-step::after {
  content: "";
  position: absolute;
  left: calc(1rem - 1px);
  top: 2.25rem;
  bottom: var(--sp-1);
  width: 2px;
  background: var(--c-border-strong);
}

.route-step:last-child::after {
  display: none;
}

.route-step:last-child {
  padding-bottom: 0;
}

.route-role {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  line-height: 2rem;
}

.route-place {
  font-family: var(--font-serif);
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1.25;
}

.route-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
}

.source-note {
  display: block;
  margin-top: var(--sp-1);
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
}

/* ---- notice.css ---- */
/* Facts List on Notice Page */
.facts-group {
  margin-bottom: var(--sp-6);
}

.fact-item {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-3);
  box-shadow: var(--shadow-1);
}

.fact-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.fact-body {
  font-size: var(--fs-md);
  margin-bottom: var(--sp-2);
}

.fact-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  border-top: 1px solid var(--c-border);
  padding-top: var(--sp-2);
  margin-top: var(--sp-2);
}

.source-link {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}

/* Related Species Box */
.related-species-box {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-brand);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  margin: var(--sp-6) 0;
}

.related-species-item {
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--c-border);
}

.related-species-item:last-child {
  border-bottom: none;
}


.entity-header-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

/* Record header on notice and case pages */
.notice-header h1 {
  margin-top: 0;
}

.official-link-p {
  margin-bottom: var(--sp-4);
}

/* ---- directories.css ---- */
/* Groups */
.group-card-header, .group-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.group-header {
  margin-bottom: var(--sp-4);
}

.group-icon, .group-header-icon {
  flex-shrink: 0;
  color: var(--c-brand);
}

.group-count {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-2);
}

/* ---- timeline.css ---- */
/* Timeline */
.chart-card {
  padding: var(--sp-5);
  margin-bottom: var(--sp-6);
}

.chart-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-top: var(--sp-4);
}

.timeline-svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin: var(--sp-4) 0;
}

.timeline-notice-card {
  padding: var(--sp-5) var(--sp-5);
}

.timeline-notice-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-2);
}

.timeline-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-2);
  border-top: 1px solid var(--c-border);
  padding-top: var(--sp-2);
  margin-top: var(--sp-2);
  font-size: var(--fs-sm);
}

/* ---- map.css ---- */
/* World Map */
.map-container-card {
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
}

.map-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg);
}

.world-map-svg {
  display: block;
}

@media (prefers-color-scheme: dark) {
  .map-ocean-rect {
    fill: #151b21 !important;
  }
  .country-poly.scale-0 {
    fill: #262e36 !important;
  }
  .country-poly {
    stroke: #151b21 !important;
  }
}

.country-poly {
  cursor: pointer;
  transition: fill 0.15s ease, stroke-width 0.15s ease;
}

.country-poly:hover, .country-poly:focus, .active-country {
  stroke: var(--c-text) !important;
  stroke-width: 1.8;
  outline: none;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
  font-size: var(--fs-sm);
}

.map-quick-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--c-border);
}

.chips-label {
  font-size: var(--fs-sm);
  margin-right: var(--sp-1);
}

.map-country-chip {
  font-size: var(--fs-sm);
  padding: var(--sp-1) var(--sp-3);
}

.map-country-chip.active-chip {
  background: var(--c-brand);
  color: var(--c-on-brand);
  border-color: var(--c-brand);
}

.chip-count {
  font-weight: normal;
  opacity: 0.85;
}

.map-inspector-card {
  margin-bottom: var(--sp-5);
  background: var(--c-surface);
  border: 2px solid var(--c-stated-border);
}

.inspector-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.inspector-title {
  margin: 0;
  font-size: var(--fs-xl);
}

.inspector-summary {
  margin-bottom: var(--sp-4);
}

.inspector-block {
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border);
}

.inspector-block h4 {
  margin-top: 0;
  margin-bottom: var(--sp-2);
  font-size: var(--fs-md);
}



.inspector-notices-list {
  margin: 0;
  padding-left: var(--sp-5);
}

.inspector-notices-list li {
  margin-bottom: var(--sp-2);
  font-size: var(--fs-md);
}


.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.scale-0 { background: #e8ecef; }
.scale-1 { background: #c7e9c0; }
.scale-2 { background: #74c476; }
.scale-3 { background: #31a354; }
.scale-4 { background: #006d2c; }

/* ---- network.css ---- */
/* Interactive Wildlife & Groups Network Explorer */
.network-explorer-section {
  margin: var(--sp-6) 0 var(--sp-7);
}

.network-section-header {
  margin-bottom: var(--sp-4);
}

.network-section-header h2 {
  margin-bottom: var(--sp-1);
}

.network-card {
  padding: var(--sp-5);
}

.network-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--c-border);
}

.network-group-filters,
.network-layer-toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

.toolbar-label {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  margin-right: var(--sp-1);
}

.net-group-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  cursor: pointer;
}

.net-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-sm);
  padding: var(--sp-1) var(--sp-2);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  cursor: pointer;
}

.network-zoom-btns {
  margin-left: auto;
  display: inline-flex;
  gap: var(--sp-1);
}

.network-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
  align-items: stretch;
}

@media (min-width: 920px) {
  .network-workspace {
    grid-template-columns: 2.1fr 1fr;
  }
}

.network-canvas-wrap {
  display: flex;
  flex-direction: column;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.network-canvas-full svg {
  height: 500px;
  cursor: grab;
  display: block;
}

.network-canvas-compact svg {
  height: 400px;
  cursor: grab;
  display: block;
}

.network-canvas-wrap svg:active {
  cursor: grabbing;
}

.net-edge {
  stroke: #9aa5b1;
  stroke-width: 1.35px;
  stroke-opacity: 0.55;
  transition: stroke-opacity 0.15s, stroke-width 0.15s;
}

.net-edge-group_member {
  stroke: #7b8794;
  stroke-opacity: 0.42;
}

.net-edge-habitat {
  stroke: #8d6e63;
  stroke-opacity: 0.65;
}

.net-edge-related_species {
  stroke: #2e7d32;
  stroke-width: 1.8px;
  stroke-opacity: 0.72;
}

.net-edge-law {
  stroke: #546e7a;
  stroke-dasharray: 4 3;
  stroke-opacity: 0.55;
}

.net-edge-inferred {
  stroke-dasharray: 4 3;
}

.net-edge.is-highlighted {
  stroke: var(--c-brand);
  stroke-width: 2.5px;
  stroke-opacity: 0.95;
}

.net-edge.is-dimmed {
  stroke-opacity: 0.12;
}

.net-node {
  cursor: pointer;
  transition: opacity 0.15s;
}

.net-node.is-dimmed {
  opacity: 0.22;
}

.net-node.is-selected .net-node-shape {
  stroke: #111827;
  stroke-width: 3px;
}

.net-node-label {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  fill: var(--c-text);
  paint-order: stroke;
  stroke: var(--c-surface);
  stroke-width: 3px;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.net-node-label-prominent {
  font-size: 14px;
  font-weight: 700;
}

.net-node-label-compact {
  font-size: 10.5px;
  font-weight: 500;
}

.net-node-label-full {
  font-weight: 700;
}

@media (max-width: 600px) {
  /* The 920px-wide drawing is scaled down to the screen, so labels need a bigger base size. */
  .net-node-label { font-size: 17px; }
  .net-node-label-prominent { font-size: 19px; }
  .net-node-label-compact { font-size: 14px; }
}

.network-legend-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

.net-legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}

.net-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
}

.net-dot-group {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #2e7d32;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #2e7d32;
}

.net-dot-species {
  border-radius: 50%;
  background: #1976d2;
}

.net-dot-place {
  background: #5d4037;
  transform: rotate(45deg);
  width: 9px;
  height: 9px;
}

.net-dot-law {
  background: #37474f;
  border-radius: 2px;
}

.net-legend-hint {
  margin-left: auto;
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

.network-inspector {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  max-height: 545px;
  overflow-y: auto;
}

.network-inspector h3 {
  margin: var(--sp-1) 0 var(--sp-1);
  font-size: var(--fs-xl);
}

.net-insp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: var(--sp-3) 0 var(--sp-4);
}

.net-insp-section {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border);
}

.net-insp-heading {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-text-muted);
  margin-bottom: var(--sp-2);
}

.net-insp-headline-link {
  display: block;
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.38;
  color: var(--c-brand);
}

.net-insp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}

.net-insp-node-chip {
  cursor: pointer;
  font-family: var(--font-sans);
  text-align: left;
}

/* ---- locality.css ---- */
/* Locality Explorer & Citizen Action ("What is happening in my locality? How can I help?") */
.locality-explorer-section {
  margin: var(--sp-6) 0 var(--sp-7);
}

.locality-header {
  margin-bottom: var(--sp-4);
}

.locality-header h2 {
  margin: var(--sp-1) 0;
}

.locality-card {
  padding: var(--sp-5);
}

.locality-quick-bar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--c-border);
}

.locality-pick-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

.locality-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
  align-items: stretch;
}

@media (min-width: 920px) {
  .locality-workspace {
    grid-template-columns: 1.85fr 1fr;
  }
}

.locality-map-pane {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  overflow: hidden;
  padding-top: var(--sp-2);
}

.locality-inspector {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  max-height: 480px;
  overflow-y: auto;
}

.locality-inspector h3 {
  margin: var(--sp-1) 0 var(--sp-1);
  font-size: var(--fs-xl);
}

.loc-notice-box {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.loc-help-tip {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  margin: var(--sp-2) 0;
  line-height: 1.4;
}

.how-to-help-strip {
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 2px solid var(--c-border);
}

.help-strip-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.help-strip-header h3 {
  margin: 0;
  font-size: var(--fs-lg);
}

.help-mini-card {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: var(--sp-4);
}

.help-mini-card h4 {
  margin: var(--sp-2) 0 var(--sp-1);
  font-size: var(--fs-md);
}

.help-mini-card p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  line-height: 1.45;
}

.help-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--c-brand);
  color: var(--c-on-brand);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.civic-action-card {
  background: var(--c-brand-soft);
  border-left: 4px solid var(--c-brand);
  margin: var(--sp-5) 0 var(--sp-6);
}

/* ---- about.css ---- */
.about-figure {
  margin: var(--sp-5) 0 var(--sp-6);
  padding: var(--sp-5);
  background: var(--c-figure-bg);
}

.about-figure svg {
  display: block;
  width: 100%;
  height: auto;
}

.about-figcaption {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border);
  font-size: var(--fs-sm);
  color: var(--c-figure-text);
  text-align: center;
}

.about-figcaption code {
  background: transparent;
}

.svg-italic {
  font-style: italic;
}

/* ---- drawer.css ---- */
.cn-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: var(--c-backdrop);
  z-index: 900;
}

.cn-drawer-backdrop[hidden] {
  display: none !important;
}

.cn-live-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(520px, 92vw);
  background: var(--c-surface);
  border-left: 1px solid var(--c-border);
  box-shadow: var(--shadow-2);
  z-index: 950;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cn-live-drawer[hidden] {
  display: none !important;
}

.cn-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface-2);
}

.cn-drawer-close {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text);
  cursor: pointer;
}

.cn-drawer-close:hover {
  border-color: var(--c-brand);
  color: var(--c-brand);
}

.cn-drawer-body {
  padding: var(--sp-5);
  overflow-y: auto;
  flex: 1 1 auto;
}

.cn-live-drawer:focus {
  outline: none;
}

/* Loading and error states (assets/drawer.js shows one of loading, error or content) */
.cn-drawer-state[hidden],
.cn-drawer-content[hidden] {
  display: none;
}

.cn-drawer-loading {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) 0;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--c-text);
}

.cn-spinner {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  border: 3px solid var(--c-border-strong);
  border-top-color: var(--c-brand);
  border-radius: 50%;
  animation: cn-spin 0.9s linear infinite;
}

@keyframes cn-spin {
  to {
    transform: rotate(360deg);
  }
}

/* No spinning for reduced motion: the ring stays still and the text says what is happening. */
@media (prefers-reduced-motion: reduce) {
  .cn-spinner {
    animation: none;
  }
}

.cn-drawer-error {
  padding: var(--sp-4);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-text-muted);
  border-radius: var(--r-sm);
}

.cn-drawer-error .drawer-title {
  font-size: var(--fs-lg);
}

.drawer-title {
  margin-top: 0;
  margin-bottom: var(--sp-1);
  font-size: var(--fs-xl);
}

.drawer-sci {
  font-style: italic;
  color: var(--c-text-muted);
  margin-top: 0;
  margin-bottom: var(--sp-3);
}

.drawer-lead {
  font-size: var(--fs-md);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-4);
}

.drawer-section-card {
  margin-top: var(--sp-4);
  margin-bottom: var(--sp-4);
  padding: var(--sp-4);
}

.drawer-hash-code {
  display: block;
  word-break: break-all;
  padding: var(--sp-2);
  background: var(--c-surface-2);
  border-radius: var(--r-sm);
  margin: var(--sp-2) 0;
  font-size: var(--fs-xs);
}

.drawer-conn-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.drawer-conn-item {
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--c-border);
  font-size: var(--fs-sm);
}

.drawer-conn-item:last-child {
  border-bottom: none;
}

.drawer-conn-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.drawer-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

/* ---- footer.css ---- */
/* Footer: brand + three link columns, the disclaimer as a callout, then the legal row. */
.site-footer {
  background: var(--c-surface-2);
  border-top: 1px solid var(--c-border);
  padding: var(--sp-7) 0 var(--sp-6);
  margin-top: auto;
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
}

.site-footer a {
  color: var(--c-text);
}

.site-footer a:hover {
  color: var(--c-brand);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-6);
}

@media (min-width: 560px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .footer-grid {
    grid-template-columns: 1.5fr repeat(3, 1fr);
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--c-text);
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  margin-bottom: var(--sp-2);
}

.footer-tagline {
  font-weight: 500;
  color: var(--c-text);
  margin-bottom: var(--sp-2);
}

.footer-about p {
  max-width: 34ch;
}

/* Early-prototype note and the audit ledger check that opens the inspector */
.footer-prototype {
  font-size: var(--fs-xs);
  line-height: 1.5;
  margin-bottom: var(--sp-3);
}

.footer-prototype strong {
  color: var(--c-text);
}

.ledger-verify-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--tap);
  padding: var(--sp-1) var(--sp-4);
  font-size: var(--fs-xs);
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ledger-verify-pill:hover {
  border-color: var(--c-brand);
  box-shadow: var(--shadow-1);
}

.ledger-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-text-muted);
  display: inline-block;
}

.ledger-dot.is-verified {
  background: var(--c-brand);
}

.footer-heading {
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 0;
  padding: 0;
  margin: 0 0 var(--sp-3);
  color: var(--c-text);
}

.footer-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  color: var(--c-text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--c-brand);
  text-decoration: underline;
}

@media (max-width: 899px) {
  .footer-links a {
    min-height: var(--tap);
  }
}

@media (max-width: 559px) {
  .footer-links ul {
    column-count: 2;
    column-gap: var(--sp-4);
  }
}

/* Disclaimer callout */
.site-footer .disclaimer {
  margin: var(--sp-6) 0 var(--sp-5);
  max-width: none;
  padding: var(--sp-4) var(--sp-5);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-brand);
  border-radius: var(--r-sm);
  color: var(--c-text);
  line-height: 1.55;
}

/* Legal row: one list so further legal pages can be added as items */
.footer-legal {
  list-style: none;
  margin: 0;
  padding: var(--sp-4) 0 0;
  border-top: 1px solid var(--c-border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-5);
  font-size: var(--fs-xs);
}

.footer-licence {
  flex: 1 1 100%;
  line-height: 1.5;
}

/* ---- print.css ---- */
/* Print Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
  }

  .site-header, .site-footer, .header-search, .skip-link, .cn-live-drawer, .cn-drawer-backdrop {
    display: none !important;
  }

  a {
    color: #000000 !important;
    text-decoration: underline !important;
  }

  .container {
    max-width: 100% !important;
    padding: 0 !important;
  }

  table {
    border: 1px solid #000000 !important;
  }

  th, td {
    border-bottom: 1px solid #999999 !important;
  }
}
