/* ConservaNode Site Stylesheet — Calm, Editorial, Accessible (WCAG AA) */

:root {
  --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;

  --bg-canvas: #fcfbf9;
  --bg-surface: #ffffff;
  --bg-subtle: #f4f1ec;
  --border-subtle: #e4dfd7;
  --border-strong: #c8c0b4;

  --text-main: #1a1e21;
  --text-muted: #535d66;
  --text-dim: #737f8a;

  --color-primary: #1b5e20;
  --color-primary-hover: #0e3813;
  --color-primary-bg: #e8f5e9;

  --color-stated: #1b5e20;
  --color-stated-bg: #e8f5e9;
  --color-stated-border: #a5d6a7;

  --color-inferred: #6d4c41;
  --color-inferred-bg: #fbf5ee;
  --color-inferred-border: #d7ccc8;

  --banner-bg: #fdf6e2;
  --banner-border: #ecd99f;
  --banner-text: #4d3800;

  --focus-ring: #1b5e20;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-canvas: #131618;
    --bg-surface: #1a1e22;
    --bg-subtle: #23282e;
    --border-subtle: #2d343b;
    --border-strong: #404953;

    --text-main: #e8eaed;
    --text-muted: #9aa4ae;
    --text-dim: #717d88;

    --color-primary: #81c784;
    --color-primary-hover: #a5d6a7;
    --color-primary-bg: #142a18;

    --color-stated: #a5d6a7;
    --color-stated-bg: #162a1a;
    --color-stated-border: #2e7d32;

    --color-inferred: #d7ccc8;
    --color-inferred-bg: #29201b;
    --color-inferred-border: #5d4037;

    --banner-bg: #2b2518;
    --banner-border: #524422;
    --banner-text: #ffecb3;

    --focus-ring: #81c784;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--bg-canvas);
  color: var(--text-main);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  top: -9999px;
  left: 1rem;
  background: var(--color-primary);
  color: #ffffff;
  padding: 0.5rem 1rem;
  z-index: 1000;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Container */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--text-main);
  line-height: 1.25;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

h1 {
  font-size: 2.25rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.6rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.4rem;
  margin-top: 2rem;
}

h3 {
  font-size: 1.25rem;
}

p, ul, ol, dl {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

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

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

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

code {
  background: var(--bg-subtle);
  padding: 0.15em 0.35em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

/* Header */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 0;
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.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: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
  line-height: 1.2;
}

.site-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-search {
  position: relative;
  flex: 1 1 240px;
  max-width: 380px;
}

.header-search input[type="search"] {
  width: 100%;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-main);
}

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

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  max-height: 380px;
  overflow-y: auto;
  z-index: 50;
}

.search-result-item {
  display: block;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  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(--color-primary-bg);
  outline: none;
}

.search-result-title {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.95rem;
}

.search-result-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Nav */
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius-sm);
}

.site-nav a:hover {
  color: var(--color-primary);
  background: var(--bg-subtle);
}

/* Prototype Banner */
.prototype-banner {
  background: var(--banner-bg);
  border-bottom: 1px solid var(--banner-border);
  color: var(--banner-text);
  padding: 0.45rem 0;
  font-size: 0.86rem;
}

.prototype-banner a {
  color: inherit;
  font-weight: 600;
}

/* Main Content */
.site-main {
  flex: 1;
  padding: 2rem 0 3.5rem;
}

/* Coverage Banner */
.coverage-banner {
  background: var(--banner-bg);
  border: 1px solid var(--banner-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  color: var(--banner-text);
}

.coverage-banner .banner-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  background: var(--banner-border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.coverage-banner p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.5;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  line-height: 1.3;
}

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

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

.badge-expl {
  font-size: 0.78rem;
  font-weight: normal;
  opacity: 0.85;
}

/* Cards & Grid */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 1.5rem 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); }
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.card-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1.25rem 0 2rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}

th {
  background: var(--bg-subtle);
  padding: 0.65rem 0.9rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-main);
  font-family: var(--font-serif);
}

td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

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

tbody tr:hover {
  background: var(--bg-canvas);
}

/* Facts List on Notice Page */
.facts-group {
  margin-bottom: 2rem;
}

.fact-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.fact-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.fact-body {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.fact-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.source-link {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

/* Related Species Box */
.related-species-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.75rem 0;
}

.related-species-item {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  color: #ffffff;
  text-decoration: none;
}

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

.btn-secondary:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  text-decoration: none;
}

/* Spotlight Card */
.spotlight-section {
  margin: 2rem 0;
}

.spotlight-card {
  background: var(--bg-surface);
  border: 2px solid var(--color-primary-border, #a5d6a7);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  position: relative;
}

.spotlight-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.spotlight-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.55rem;
  background: var(--color-primary-bg);
  color: var(--color-primary);
  border-radius: var(--radius-sm);
}

.spotlight-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.spotlight-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  margin-top: 0;
  margin-bottom: 0.6rem;
}

.spotlight-meta {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* Explore Tiles */
.explore-tiles-section {
  margin: 2.5rem 0;
}

.explore-grid {
  margin-top: 1rem;
}

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

.tile-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-primary-bg);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.tile-icon {
  display: block;
}

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

/* Recent Notices List */
.recent-notices-section {
  margin: 2.5rem 0;
}

.recent-notices-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0;
}

.recent-notice-card {
  padding: 1.25rem 1.5rem;
}

.recent-notice-card .card-title {
  font-size: 1.25rem;
  margin: 0.4rem 0 0.3rem;
}

.official-title-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.notice-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.6rem;
  margin-top: 0.6rem;
  font-size: 0.88rem;
}

/* Groups */
.group-card-header, .group-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.group-header {
  margin-bottom: 1rem;
}

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

.group-count {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* Timeline */
.chart-card {
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.chart-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-top: 1rem;
}

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

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0;
}

.timeline-notice-card {
  padding: 1.25rem 1.5rem;
}

.timeline-notice-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.timeline-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.6rem;
  margin-top: 0.6rem;
  font-size: 0.88rem;
}

/* World Map */
.map-container-card {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.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(--text-main) !important;
  stroke-width: 1.8;
  outline: none;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.85rem;
}

.map-quick-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.chips-label {
  font-size: 0.85rem;
  margin-right: 0.25rem;
}

.map-country-chip {
  font-size: 0.82rem;
  padding: 0.3rem 0.65rem;
}

.map-country-chip.active-chip {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

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

.map-inspector-card {
  margin-bottom: 1.5rem;
  background: var(--bg-surface);
  border: 2px solid var(--color-stated-border);
}

.inspector-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.inspector-title {
  margin: 0;
  font-size: 1.4rem;
}

.inspector-summary {
  margin-bottom: 1rem;
}

.inspector-block {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.inspector-block h4 {
  margin-top: 0;
  margin-bottom: 0.6rem;
  font-size: 1rem;
}

.inspector-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.inspector-pill {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  background: var(--color-primary-bg);
  border: 1px solid var(--color-stated-border);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  text-decoration: none;
  color: var(--text-main);
}

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

.inspector-pill-place {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.inspector-notices-list {
  margin: 0;
  padding-left: 1.25rem;
}

.inspector-notices-list li {
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
}

.btn-sm {
  font-size: 0.84rem;
  padding: 0.35rem 0.75rem;
}

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

.spotlight-sci-sub {
  font-size: 1.15rem;
  font-weight: normal;
  color: var(--text-muted);
  margin-left: 0.4rem;
}

.spotlight-notice-line {
  font-size: 0.92rem;
  margin-bottom: 1.15rem;
}

.notice-species-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}

.mini-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--color-primary-bg);
  color: var(--color-primary);
  border: 1px solid var(--color-stated-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

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

.headline-rule-note {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.entity-header-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.entity-group-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  background: var(--color-primary-bg);
  border: 1px solid var(--color-stated-border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.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; }

/* Interactive Wildlife & Groups Network Explorer */
.network-explorer-section {
  margin: 2.25rem 0 2.75rem;
}

.network-section-header {
  margin-bottom: 1rem;
}

.network-section-header h2 {
  margin-bottom: 0.35rem;
}

.network-card {
  padding: 1.25rem;
}

.network-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.network-group-filters,
.network-layer-toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.toolbar-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.net-group-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.net-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.86rem;
  padding: 0.25rem 0.6rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.network-zoom-btns {
  margin-left: auto;
  display: inline-flex;
  gap: 0.35rem;
}

.network-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  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(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  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(--color-primary);
  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: 10.5px;
  font-weight: 600;
  fill: var(--text-main);
  paint-order: stroke;
  stroke: var(--bg-surface);
  stroke-width: 3px;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

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

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

.network-legend-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  padding: 0.55rem 0.85rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.net-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.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: 0.78rem;
  color: var(--text-dim);
}

.network-inspector {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  max-height: 545px;
  overflow-y: auto;
}

.network-inspector h3 {
  margin: 0.25rem 0 0.2rem;
  font-size: 1.25rem;
}

.net-insp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.65rem 0 0.9rem;
}

.net-insp-section {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.net-insp-heading {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.net-insp-headline-link {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.38;
  color: var(--color-primary);
}

.net-insp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

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

.about-figure {
  margin: 1.5rem 0 2rem;
  padding: 1.25rem;
  background: #ffffff;
}

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

.about-figcaption {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.86rem;
  color: var(--text-muted);
  text-align: center;
}

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

/* Locality Explorer & Citizen Action ("What is happening in my locality? How can I help?") */
.locality-explorer-section {
  margin: 2.25rem 0 2.75rem;
}

.locality-header {
  margin-bottom: 1rem;
}

.locality-header h2 {
  margin: 0.35rem 0;
}

.locality-card {
  padding: 1.35rem;
}

.locality-quick-bar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-bottom: 1rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
}

.locality-pick-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.locality-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  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(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding-top: 0.5rem;
}

.locality-inspector {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  max-height: 480px;
  overflow-y: auto;
}

.locality-inspector h3 {
  margin: 0.25rem 0 0.2rem;
  font-size: 1.3rem;
}

.loc-notice-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.65rem;
}

.loc-help-tip {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0.4rem 0;
  line-height: 1.4;
}

.how-to-help-strip {
  margin-top: 1.35rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--border-subtle);
}

.help-strip-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.help-strip-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.help-mini-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.help-mini-card h4 {
  margin: 0.4rem 0 0.35rem;
  font-size: 0.98rem;
}

.help-mini-card p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--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(--color-primary);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
}

.civic-action-card {
  background: var(--color-primary-bg);
  border-left: 4px solid var(--color-primary);
  margin: 1.25rem 0 1.75rem;
}

/* Footer */
.site-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0 2rem;
  margin-top: auto;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.footer-tagline {
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.footer-licence {
  font-size: 0.82rem;
  line-height: 1.45;
}

.site-footer h3 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.disclaimer {
  font-size: 0.82rem;
  line-height: 1.45;
}

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

.footer-links li {
  margin-bottom: 0.45rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

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

.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;
}

/* ==========================================================================
   Modern Interactive Workspace, Live Filter Bar & Bento Card Grid
   ========================================================================== */

/* Compact Hero with Interactive Pill Bar */
.compact-hero {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.compact-hero-top {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 960px) {
  .compact-hero-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .compact-hero-copy {
    flex: 1 1 58%;
    max-width: 680px;
  }
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--badge-stated-bg);
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.compact-hero h1 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.95rem;
  line-height: 1.2;
}

.compact-hero .lead {
  margin-bottom: 0;
  font-size: 1.02rem;
}

.hero-pill-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  flex: 0 0 auto;
}

@media (min-width: 540px) {
  .hero-pill-bar {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 960px) {
  .hero-pill-bar {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

.hero-stat-pill {
  display: flex;
  flex-direction: column;
  padding: 0.65rem 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.hero-stat-pill:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.hero-stat-num {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-primary);
}

.hero-stat-lbl {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Segmented Workspace Shell & Mode Switcher */
.workspace-shell {
  margin-bottom: 2.5rem;
}

.workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.45rem;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 1.25rem;
  align-items: stretch;
}

.ui-tab-btn {
  flex: 1 1 210px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 0.65rem 0.95rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-main);
  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(--bg-surface);
}

.ui-tab-btn.is-active {
  background: var(--bg-surface);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.ui-tab-btn .tab-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-main);
}

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

.ui-tab-btn .tab-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.ui-tab-expand {
  flex: 0 0 auto;
  align-self: center;
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
}

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

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

.section-header-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

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

/* Live Filter Bar for Bento Explorers */
.ui-filter-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.35rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ui-filter-search-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ui-filter-input {
  flex: 1 1 320px;
  padding: 0.55rem 0.85rem;
  font-size: 0.92rem;
  font-family: var(--font-sans);
  color: var(--text-main);
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

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

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

.ui-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ui-filter-empty {
  padding: 1.5rem;
  text-align: center;
  background: var(--bg-surface-alt);
  border-radius: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Bento Card Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

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

.bento-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.1rem 1.2rem;
  border-radius: 12px;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.bento-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

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

.bento-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
}

.bento-group-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}

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

.bento-card-title {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.3;
  margin: 0 0 0.25rem 0;
}

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

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

.bento-sci {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 0.55rem;
}

.bento-detail-line {
  font-size: 0.84rem;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.bento-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
  font-size: 0.83rem;
}

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

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

.bento-ext-link {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Profile Fact Pills Row on Entity Pages */
.profile-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.profile-pill {
  display: inline-flex;
  flex-direction: column;
  padding: 0.45rem 0.8rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

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

.profile-pill-val {
  font-size: 0.88rem;
  color: var(--text-main);
}

/* Live Audit Ledger Verification Pill & Slide-Over Inspector Drawer */
.prototype-banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ledger-verify-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ledger-verify-pill:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

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

.ledger-dot.is-verified {
  background: var(--color-primary);
}

.cn-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  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(--bg-surface);
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  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: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface-alt);
}

.cn-drawer-close {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
}

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

.cn-drawer-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

.drawer-title {
  margin-top: 0;
  margin-bottom: 0.25rem;
  font-size: 1.45rem;
}

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

.drawer-lead {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.drawer-section-card {
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
}

.drawer-hash-code {
  display: block;
  word-break: break-all;
  padding: 0.5rem;
  background: var(--bg-surface-alt);
  border-radius: 6px;
  margin: 0.5rem 0;
  font-size: 0.78rem;
}

.drawer-conn-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.drawer-conn-item {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.86rem;
}

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

.drawer-conn-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.drawer-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* 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;
  }
}

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

  .site-header, .prototype-banner, .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;
  }
}

