/* Clean mobile-first global styles */
:root {
  --bg: #f7fafc;
  --text: #0f1724;
  --muted: #6b7280;
  --accent: #c0392b;
  --card: #ffffff;
  --gap: 1rem;
  --header-h: 62px;
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::after {
  content: '';
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  width: 42vmin;
  height: 42vmin;
  background: url('/logo.png') no-repeat center / contain;
  opacity: 0.055;
  pointer-events: none;
  z-index: -1
}

/* Header */
.site-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--card);
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid rgba(15, 23, 36, 0.06);
}

.site-header-top {
  display: flex;
  align-items: center;
  gap: 0.6rem
}

.site-title {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  border-left: 1px solid rgba(15, 23, 36, 0.15);
  padding-left: 0.7rem;
  font-family: "soleto", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.site-title-name {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2
}

.site-title-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.2
}

.site-logo {
  height: 32px;
  width: auto;
  display: block;
  flex-shrink: 0
}

/* Nav toggle (hamburger) */
.site-nav-toggle {
  background: transparent;
  border: 0;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  color: inherit
}

h1,
h2,
h3,
h4,
h5,
h6,
.site-nav a,
.toc-title {
  font-family: "soleto", sans-serif;
}

/* ── Skip link (WCAG 2.4.1) ───────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0.5rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-radius: 0 0 4px 4px;
  text-decoration: none;
  font-size: 0.9rem;
}

.skip-link:focus {
  top: 0;
}

/* Screen-reader-only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Focus indicators (WCAG 2.4.7) ────────────────── */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* #app receives programmatic focus for SPA screen-reader management only */
#app:focus-visible {
  outline: none;
}

/* Slightly tighter on nav links which have their own border-radius */
.site-nav a:focus-visible,
.site-nav-toggle:focus-visible {
  outline-offset: 1px;
}

/* Constitution TOC links get a visible ring too */
.constitution-body .toc a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}



/* Site nav (mobile: hidden until opened) */
.site-nav {
  display: none
}

body.nav-open .site-nav {
  display: block;
  position: fixed;
  left: 0;
  right: 0;
  top: 56px;
  background: var(--card);
  padding: 0.75rem 1rem;
  box-shadow: 0 6px 18px rgba(15, 23, 36, 0.08);
  z-index: 40;
}

.nav-icon {
  width: 14px;
  height: 14px;
  vertical-align: -0.15em;
  margin-right: 0.3em;
  flex-shrink: 0;
}

.card-icon {
  width: 30px;
  height: 30px;
  color: var(--accent);
  display: block;
  margin-bottom: 0.6rem;
}

.site-nav a[data-link],
.site-nav .nav-external {
  display: block;
  padding: 0.5rem 0;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600
}

.site-nav a[data-link]:hover,
.site-nav .nav-external:hover {
  background: rgba(192, 57, 43, 0.06);
  color: var(--accent)
}

.nav-external {
  color: var(--muted)
}

/* Main app area */
main#app {
  max-width: 1400px;
  margin: 1rem auto;
  padding: 0 1rem 1rem 1rem
}

/* Document layout: content + TOC */
.doc-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem
}

/* Breadcrumbs */
.breadcrumbs {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.8rem;
  padding: 0.45rem 0.6rem;
  background: rgba(15, 23, 36, 0.02);
  border-radius: 6px
}

.breadcrumb-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.breadcrumb-list li + li::before {
  content: '/';
  margin-right: 0.25rem;
  color: var(--muted);
}

.breadcrumbs a[data-link] {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600
}

.breadcrumbs a[data-link]:hover {
  text-decoration: underline
}

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

/* TOC styling — card on both mobile and desktop */
.doc-toc .toc {
  background: var(--card);
  border: 1px solid rgba(15, 23, 36, 0.07);
  border-radius: 8px;
  padding: 0.75rem 1rem
}

.doc-toc .toc .toc-title {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem
}

.doc-toc .toc ol {
  padding-left: 0;
  margin: 0;
  list-style: none
}

.doc-toc .toc a {
  display: block;
  padding: 0.25rem 0;
  color: var(--text);
  text-decoration: none
}

.doc-toc .toc a:hover {
  color: var(--accent)
}

.doc-toc .toc a.toc-active {
  color: var(--accent);
  font-weight: 600
}

/* Collapsible TOC (mobile) */
.toc-title--toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none
}

.toc-chevron {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  flex-shrink: 0;
  margin-bottom: 0.1rem
}

@media (prefers-reduced-motion: no-preference) {
  .toc-chevron { transition: transform 0.2s; }
  .policy-featured,
  .policy-solo,
  .doc-toc .toc a,
  .site-nav a { transition: color 0.15s, background 0.15s, border-color 0.15s; }
}

.toc--collapsed .toc-chevron {
  transform: rotate(-45deg);
  margin-bottom: -0.1rem
}

.toc--collapsed ol {
  display: none
}

/* Policy nav column (desktop left column, hidden on mobile) */
.doc-policy-nav {
  display: none
}

.doc-policy-nav .toc-title {
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.5rem 0
}

.doc-policy-nav__list {
  list-style: none;
  padding: 0;
  margin: 0
}

.doc-policy-nav__list li a {
  display: block;
  padding: 0.3rem 0.5rem;
  border-radius: 5px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.3
}

.doc-policy-nav__list li a:hover {
  background: rgba(192, 57, 43, 0.06);
  color: var(--accent)
}

.doc-policy-nav__list li.is-active a {
  background: rgba(192, 57, 43, 0.1);
  color: var(--accent);
  font-weight: 600
}

/* Mobile policy chooser (shown at bottom of content, hidden on desktop) */
.policy-mobile-chooser {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid rgba(15, 23, 36, 0.07);
  border-radius: 8px
}

.policy-mobile-chooser label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.4rem
}

.policy-mobile-chooser select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(15, 23, 36, 0.12);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  box-sizing: border-box
}

/* Policy list (index) */
#policy-list {
  list-style: none;
  padding-left: 0
}

#policy-list li {
  margin-bottom: 0.5rem
}

#policy-list li a {
  color: var(--accent);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 6px;
  display: inline-block
}

#policy-list li a:hover {
  background: rgba(192, 57, 43, 0.06)
}

/* Policy fragment header: stack metadata (always) */
.doc-content>section>header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start
}

.doc-content>section>header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem
}

/* Content typography — policies and constitution via .doc-content, home/faq via main#app > section */
.doc-content,
main#app>section {
  line-height: 1.6;
}

.doc-content h2,
main#app>section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--text);
  line-height: 1.3;
}

/* Policy header h2 relies on flex gap, not margin */
.doc-content>section>header>h2 {
  margin-bottom: 0;
}

.doc-content h3,
main#app>section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(15, 23, 36, 0.09);
}

.doc-content h4,
main#app>section h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 1rem 0 0.3rem;
  color: var(--text);
}

.doc-content p,
main#app>section p {
  margin: 0 0 0.75rem;
}

.doc-content ul,
.doc-content ol,
main#app>section ul,
main#app>section ol {
  margin: 0 0 0.75rem;
  padding-left: 1.5rem;
}

.doc-content li,
main#app>section li {
  margin-bottom: 0.35rem;
}

.doc-content article,
main#app>section article {
  margin-bottom: 1.5rem;
}

/* Policy/trustee "See:" reference lines */
.doc-ref {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.5rem;
}

.doc-ref a[data-link] {
  color: var(--accent);
  font-style: normal;
  text-decoration: none;
}

.doc-ref a[data-link]:hover {
  text-decoration: underline;
}

/* Summary/conclusion box at end of document */
.doc-summary {
  background: var(--card);
  border: 1px solid rgba(15, 23, 36, 0.07);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}

.doc-summary h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: none;
  padding-bottom: 0;
}

.doc-summary ul {
  margin: 0;
  padding-left: 1.25rem;
}

.doc-summary li {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

/* Base link colour — specific components override as needed */
a {
  color: var(--accent)
}

/* Utilities */
.muted {
  color: var(--muted)
}

/* Larger screens: horizontal header, nav visible, two-column doc layout */
@media (min-width:800px) {
  .site-header {
    padding: 0.85rem 1.25rem
  }

  .site-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between
  }

  .site-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center
  }

  .site-nav-toggle {
    display: none
  }

  .nav-external {
    margin-left: 0.5rem;
    padding-left: 0.75rem !important;
    border-left: 1px solid rgba(15, 23, 36, 0.15)
  }

  body.nav-open .site-nav {
    position: static;
    box-shadow: none
  }

  .doc-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.25rem
  }

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
  }

  body {
    padding-top: var(--header-h);
  }

  .doc-toc {
    flex: 0 0 200px;
    position: sticky;
    top: calc(var(--header-h) + 1rem);
    max-height: calc(100vh - var(--header-h) - 2rem);
    overflow-y: auto;
    align-self: flex-start;
    margin-left: 0
  }

  .doc-toc .toc {
    background: var(--card);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 36, 0.04)
  }

  .doc-toc .toc .toc-title {
    margin: 0 0 0.5rem 0
  }

  .toc--collapsed ol {
    display: block
  }

  .toc-title--toggle {
    cursor: default;
    pointer-events: none
  }

  .toc-chevron {
    display: none
  }

  .doc-content {
    flex: 1;
    background: var(--card);
    border: 1px solid rgba(15, 23, 36, 0.04);
    border-radius: 8px;
    padding: 1.5rem
  }

  /* Three-column layout when policy nav is present */
  .doc-layout:has(.doc-policy-nav) {
    gap: 1rem
  }

  .doc-layout:has(.doc-policy-nav) .doc-toc {
    margin-left: 0
  }

  .doc-policy-nav {
    display: flex;
    flex-direction: column;
    flex: 0 0 200px;
    position: sticky;
    top: calc(var(--header-h) + 1rem);
    max-height: calc(100vh - var(--header-h) - 2rem);
    overflow-y: auto;
    background: var(--card);
    border: 1px solid rgba(15, 23, 36, 0.04);
    border-radius: 8px;
    padding: 1rem;
    align-self: flex-start
  }

  .policy-mobile-chooser {
    display: none
  }

  main#app {
    padding: 0 1rem 1rem 1rem;
  }

  .site-footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ── Footer ────────────────────────────────────────── */
.site-footer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
  border-top: 1px solid rgba(15, 23, 36, 0.07);
  font-size: 0.82rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
  .site-footer {
    border-top-color: rgba(255,255,255,0.07);
  }
}

/* Policy schedule card layout */
.schedule-groups {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.schedule-group {
  background: var(--card);
  border: 1px solid rgba(15, 23, 36, 0.07);
  border-radius: 8px;
  overflow: hidden;
}

.schedule-group-header {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(192, 57, 43, 0.04);
  border-bottom: 1px solid rgba(192, 57, 43, 0.1);
  padding: 0.6rem 1.25rem;
}

.schedule-item {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 36, 0.05);
}

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

.schedule-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.3rem;
}

.schedule-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
}

.schedule-item-name:hover {
  color: var(--accent);
}

.schedule-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.schedule-item-purpose {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 0.4rem;
  line-height: 1.45;
}

.schedule-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Policy index grouped layout */
.policy-groups {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.policy-featured {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: var(--card);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: var(--text);
}

@media (prefers-reduced-motion: no-preference) {
  .policy-featured { transition: background 0.15s; }
}

.policy-featured:hover {
  background: rgba(192, 57, 43, 0.04);
}

.policy-featured-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.policy-featured-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.policy-featured-desc {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.policy-solo {
  display: block;
  background: var(--card);
  border: 1px solid rgba(15, 23, 36, 0.07);
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
}

@media (prefers-reduced-motion: no-preference) {
  .policy-solo { transition: border-color 0.15s, background 0.15s, color 0.15s; }
}

.policy-solo:hover {
  border-color: rgba(192, 57, 43, 0.3);
  background: rgba(192, 57, 43, 0.03);
  color: var(--accent);
}

.policy-group {
  background: var(--card);
  border: 1px solid rgba(15, 23, 36, 0.07);
  border-radius: 8px;
  overflow: hidden;
}

.policy-group-header {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(192, 57, 43, 0.04);
  border-bottom: 1px solid rgba(192, 57, 43, 0.1);
  padding: 0.6rem 1.25rem;
}

.policy-group-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.policy-group-list li {
  border-bottom: 1px solid rgba(15, 23, 36, 0.05);
  margin: 0;
}

.policy-group-list li:last-child {
  border-bottom: none;
}

.policy-group-list a {
  display: block;
  padding: 0.65rem 1.25rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

@media (prefers-reduced-motion: no-preference) {
  .doc-policy-nav__list li a { transition: background 0.12s, color 0.12s; }
}

.policy-group-list a:hover {
  background: rgba(192, 57, 43, 0.04);
  color: var(--accent);
}

/* Home / FAQ card-based page layout */
.page-section {
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

/* ── Home page ─────────────────────────────────────── */
.home-section {
  max-width: 1100px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

/* Intro */
.home-intro {
  margin-bottom: 2rem;
}

.home-intro-logo {
  display: block;
  width: 56px;
  height: auto;
  margin-bottom: 1.25rem;
  filter: brightness(0) opacity(0.8);
}

@media (prefers-color-scheme: dark) {
  .home-intro-logo {
    filter: brightness(0) invert(1) opacity(0.75);
  }
}

.home-intro h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  line-height: 1.15;
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}

.home-intro-subtitle {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-intro-lead {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 0.75rem;
}

.home-intro-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
  padding-top: 1.5rem;
}

/* Structure flow */
.home-structure {
  margin-bottom: 2rem;
}

.home-structure-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.home-structure-flow {
  counter-reset: structure-step;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Mobile: compact icon + text rows */
.home-structure-step {
  counter-increment: structure-step;
}

.home-structure-step-card {
  background: var(--card);
  border: 1px solid rgba(15, 23, 36, 0.07);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.85rem;
}

.home-structure-step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  background: rgba(192, 57, 43, 0.07);
  border-radius: 6px;
  margin-top: 0.1rem;
}

.home-structure-step-icon svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.home-structure-step-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.home-structure-step strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.home-structure-step p {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
  line-height: 1.5;
}

.home-structure-step a[data-link] {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.home-structure-step a[data-link]:hover {
  text-decoration: underline;
}

.home-structure-step-links {
  display: flex;
  gap: 0.75rem;
}


@media (min-width: 800px) {
  /* Intro: two columns — heading left, body right */
  .home-intro {
    display: grid;
    grid-template-columns: calc(50% - 4rem) 1fr;
    gap: 4rem;
    align-items: end;
    margin-bottom: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(15, 23, 36, 0.07);
  }

  .home-intro-logo {
    width: 80px;
    margin-bottom: 1.5rem;
  }

  .home-intro h1 {
    font-size: 2.4rem;
    margin: 0;
    position: sticky;
    top: calc(var(--header-h) + 2rem);
  }

  .home-intro-subtitle {
    font-size: 0.85rem;
  }

  .home-intro-note {
    margin-top: 1rem;
  }

  /* Structure flow: staggered vertical timeline */
  .home-structure {
    margin-bottom: 3.5rem;
  }

  .home-structure-flow {
    flex-direction: column;
    gap: 0;
    position: relative;
  }

  /* Spine */
  .home-structure-flow::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    transform: translateX(-50%);
    background: linear-gradient(to bottom,
      transparent,
      rgba(192, 57, 43, 0.25) 8%,
      rgba(192, 57, 43, 0.25) 92%,
      transparent);
  }

  /* li is a zero-padding positioning context so %-based dot offsets are exact */
  .home-structure-step {
    width: 41%;
    position: relative;
    margin-bottom: -6rem;
    z-index: 1;
  }

  .home-structure-step:nth-child(1) { z-index: 4; }
  .home-structure-step:nth-child(2) { z-index: 3; }
  .home-structure-step:nth-child(3) { z-index: 2; }
  .home-structure-step:nth-child(4) { z-index: 1; margin-bottom: 6rem; }

  /* Large CSS counter number above the card */
  .home-structure-step::before {
    content: counter(structure-step, decimal-leading-zero);
    display: block;
    font-family: 'soleto', sans-serif;
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
    opacity: 0.18;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
  }

  /* Card visual box lives here — no padding on the li avoids the %-offset bug */
  .home-structure-step-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 1.75rem 2rem;
    border-radius: 14px;
  }

  /* Arm: 1px line from card edge to spine.
     22% of li width = 9% of flow = gap between card edge (41%) and spine (50%). */
  .home-structure-step::after {
    content: '';
    position: absolute;
    /* counter ≈ 2.75rem tall + 0.75rem margin = 3.5rem; arm at card top + half padding */
    top: calc(3.5rem + 0.875rem - 0.5px);
    height: 1px;
    background: rgba(192, 57, 43, 0.3);
    width: 22%;
  }

  /* Dot: li has no padding so left/right % = % of pure 41%-wide content box */
  .home-structure-node {
    position: absolute;
    top: calc(3.5rem + 0.875rem - 4.5px);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.5;
    z-index: 10;
  }

  /* Odd steps: left column */
  .home-structure-step:nth-child(odd) {
    margin-right: auto;
    margin-left: 0;
  }

  .home-structure-step:nth-child(odd)::after { left: 100%; }

  /* left: 100% = card right edge; + 22% = gap to spine; - 4.5px = centre 10px dot */
  .home-structure-step:nth-child(odd) .home-structure-node { left: calc(122% - 4.5px); }

  /* Even steps: right column */
  .home-structure-step:nth-child(even) {
    margin-left: auto;
    margin-right: 0;
  }

  .home-structure-step:nth-child(even)::after { right: 100%; }

  .home-structure-step:nth-child(even) .home-structure-node { right: calc(122% - 4.5px); }

  /* Hide icon — number takes its place */
  .home-structure-step-icon {
    display: none;
  }

  .home-structure-step strong {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: block;
  }

  .home-structure-step p {
    font-size: 0.95rem;
    margin-bottom: 0.85rem;
    line-height: 1.6;
  }

  .home-structure-step a[data-link] {
    font-size: 0.875rem;
  }

  .home-structure-step-links {
    gap: 1rem;
  }
}
/* ── End home page ──────────────────────────────────── */

.policy-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 36, 0.07);
}

.policy-header__title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
}

.policy-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.policy-header__meta a {
  color: var(--accent);
  text-decoration: none;
}

.policy-header__meta a:hover {
  text-decoration: underline;
}

.page-intro {
  background: var(--card);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
}

.page-intro h2 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  border-bottom: none;
}

.page-intro>p {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.page-intro>p:last-child {
  margin-bottom: 0;
}

.page-section>article {
  background: var(--card);
  border: 1px solid rgba(15, 23, 36, 0.07);
  border-radius: 8px;
  margin-bottom: 0.9rem !important;
  overflow: hidden;
}

main#app .page-section>article>h2 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  padding: 0.75rem 1.25rem;
  background: rgba(192, 57, 43, 0.04);
  border-bottom: 1px solid rgba(192, 57, 43, 0.1);
}

main#app .page-section>article>p,
main#app .page-section>article>ul {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  margin-top: 0;
  margin-bottom: 0.65rem;
}

main#app .page-section>article>ul {
  padding-left: 2.5rem;
}

main#app .page-section>article>p:first-of-type,
main#app .page-section>article>ul:first-of-type {
  margin-top: 0.75rem;
}

main#app .page-section>article>p:last-child,
main#app .page-section>article>ul:last-child {
  padding-bottom: 1rem;
  margin-bottom: 0;
}

/* Nested mini-card grid (e.g. "Three key things" on home page) */
.page-section>article>section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem 1.25rem 1.25rem;
}

.page-section>article>section>article {
  background: rgba(15, 23, 36, 0.02);
  border: 1px solid rgba(15, 23, 36, 0.06);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  margin-bottom: 0 !important;
}

.page-section>article>section>article>h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.page-section>article>section>article>p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0.4rem;
  padding: 0;
}

.page-section>article>section>article>p:last-child {
  margin-bottom: 0;
}

.page-section>article>section>article a[data-link] {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.page-section>article>section>article a[data-link]:hover {
  text-decoration: underline;
}

@media (min-width: 620px) {
  .page-section>article>section {
    flex-direction: row;
  }

  .page-section>article>section>article {
    flex: 1;
  }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111827;
    --text: #e2e8f0;
    --card: #1e2636;
    --muted: #8899aa;
    --accent: #e05248
  }

  body::after {
    opacity: 0.035
  }

  .site-header {
    border-bottom-color: rgba(255, 255, 255, 0.08)
  }

  .site-title {
    border-left-color: rgba(255, 255, 255, 0.15)
  }

  body.nav-open .site-nav {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4)
  }

  .breadcrumbs {
    background: rgba(255, 255, 255, 0.04)
  }

  .policy-mobile-chooser {
    border-color: rgba(255, 255, 255, 0.1)
  }

  .policy-mobile-chooser select {
    border-color: rgba(255, 255, 255, 0.15)
  }

  .doc-content h3,
  main#app>section h3 {
    border-bottom-color: rgba(255, 255, 255, 0.1)
  }

  .doc-summary {
    border-color: rgba(255, 255, 255, 0.08)
  }

  .doc-toc .toc {
    border-color: rgba(255, 255, 255, 0.06)
  }

  .doc-policy-nav {
    border-color: rgba(255, 255, 255, 0.06)
  }

  .doc-content {
    border-color: rgba(255, 255, 255, 0.06)
  }

  .schedule-group {
    border-color: rgba(255, 255, 255, 0.08)
  }

  .schedule-item {
    border-bottom-color: rgba(255, 255, 255, 0.07)
  }

  .schedule-badge {
    color: #d97706;
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.25)
  }

  .policy-solo {
    border-color: rgba(255, 255, 255, 0.08)
  }

  .policy-group {
    border-color: rgba(255, 255, 255, 0.08)
  }

  .policy-group-list li {
    border-bottom-color: rgba(255, 255, 255, 0.07)
  }

  .page-section>article {
    border-color: rgba(255, 255, 255, 0.08)
  }

  .page-section>article>section>article {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.07)
  }
}

/* Print tweaks */
@media print {
  body.nav-open {
    overflow: visible
  }

  .site-nav {
    display: none
  }

  .doc-toc {
    position: static
  }
}
/* ── Version history ───────────────────────────────── */
.version-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }

.version-entry {
  background: var(--card, #fff);
  border: 1px solid rgba(15,23,36,0.07);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

.version-entry-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.version-badge {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(192,57,43,0.1);
  color: var(--accent, #c0392b);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
}

.version-date { font-size: 0.85rem; color: var(--muted, #6b7280); }

.version-change-notes { font-size: 0.9rem; margin: 0.3rem 0 0.6rem; }

.version-meta {
  font-size: 0.8rem;
  color: var(--muted, #6b7280);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.version-links { display: flex; gap: 0.75rem; margin-top: 0.6rem; flex-wrap: wrap; }

.version-links a {
  font-size: 0.85rem;
  color: var(--accent, #c0392b);
  text-decoration: none;
  font-weight: 600;
}

.version-links a:hover { text-decoration: underline; }

/* ── Diff view ─────────────────────────────────────── */
.diff-view {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  background: var(--card, #fff);
  border: 1px solid rgba(15,23,36,0.07);
  border-radius: 8px;
  padding: 1.25rem;
  white-space: pre-wrap;
  overflow-x: auto;
}

.diff-added { background: rgba(34,197,94,0.15); color: #166534; display: block; }
.diff-removed { background: rgba(239,68,68,0.12); color: #991b1b; text-decoration: line-through; display: block; }

/* ── FAQ ───────────────────────────────────────────── */
.faq-entry {
  background: var(--card, #fff);
  border: 1px solid rgba(15,23,36,0.07);
  border-radius: 8px;
  margin-bottom: 0.9rem;
  overflow: hidden;
  padding: 1rem 1.25rem;
}

.faq-entry h3 {
  font-size: 0.98rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--accent, #c0392b);
}

.page-intro {
  background: var(--card, #fff);
  border-left: 4px solid var(--accent, #c0392b);
  border-radius: 0 8px 8px 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.page-intro h1 { font-size: 1.25rem; font-weight: 700; margin: 0 0 0.5rem; }
.page-intro p { margin: 0; color: var(--muted, #6b7280); font-size: 0.95rem; }

@media (prefers-color-scheme: dark) {
  .version-entry { border-color: rgba(255,255,255,0.08); }
  .diff-added { background: rgba(34,197,94,0.1); color: #86efac; }
  .diff-removed { background: rgba(239,68,68,0.1); color: #fca5a5; }
  .faq-entry { border-color: rgba(255,255,255,0.08); }
  .page-intro { border-color: rgba(255,255,255,0.15); }
}

/* ── General page wrapper ──────────────────────────── */
.page {
  max-width: 860px;
  margin: 0 auto;
  padding: 0.75rem 1rem 3rem;
}

/* ── Policy / home index list ──────────────────────── */
.policy-index {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.policy-index a {
  display: block;
  background: var(--card, #fff);
  border: 1px solid rgba(15,23,36,0.07);
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text, #0f1724);
  text-decoration: none;
}

@media (prefers-reduced-motion: no-preference) {
  .policy-index a { transition: border-color 0.15s, color 0.15s; }
}

.policy-index a:hover {
  border-color: rgba(192,57,43,0.3);
  color: var(--accent, #c0392b);
}

@media (prefers-color-scheme: dark) {
  .policy-index a { border-color: rgba(255,255,255,0.08); }
}

/* ── Trustees current callout ──────────────────────── */
.trustees-current {
  background: var(--card);
  border: 1px solid rgba(15,23,36,0.07);
  border-left: 4px solid var(--gold, #c9a84c);
  border-radius: 0 8px 8px 0;
  padding: 1.1rem 1.4rem;
  margin-bottom: 2rem;
}

.trustees-current-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.trustees-current-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.trustees-current-list li {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.trustee-name {
  font-weight: 600;
  color: var(--text);
}

.trustee-role {
  font-size: 0.82rem;
  color: var(--muted);
}

@media (prefers-color-scheme: dark) {
  .trustees-current { border-color: rgba(255,255,255,0.08); border-left-color: var(--gold, #c9a84c); }
}
