:root {
  --bg: #ffffff; --fg: #000000; --border: #d0d0d0; --muted: #555555; --max: 1100px;
  --surface: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --accent: #1a5e9a; --accent-hover: #134a7a; --accent-fg: #ffffff;
  --step-1: 1.333rem; --step-2: 1.777rem; --step-3: 2.369rem;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--fg); line-height: 1.6; font-size: 18px; }
a { color: var(--accent); text-decoration-color: transparent; transition: text-decoration-color 0.15s; }
a:hover { text-decoration-color: var(--accent); }
a:focus, button:focus, input:focus { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip-link { position: absolute; left: 0.5rem; top: 0.5rem; background: var(--accent); color: var(--accent-fg); border: 2px solid var(--accent); padding: 0.75rem 1rem; transform: translateY(-200%); z-index: 1000; }
.skip-link:focus { transform: translateY(0); }
.site-header { border-bottom: 1px solid var(--border); padding: 2.5rem 1rem 2rem; text-align: center; }
.site-header .wrap { position: relative; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1rem; }
h1, h2, h3 { line-height: 1.25; }
h1 { margin: 0.3rem 0 0.75rem; font-size: var(--step-3); letter-spacing: -0.02em; }
h2 { margin: 0; font-size: var(--step-2); }
h3 { margin: 0 0 0.5rem; font-size: var(--step-1); }
.eyebrow { margin: 0 0 0.75rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted); }
.lede { max-width: 44rem; margin: 0.75rem auto 0; font-size: 1.05rem; color: var(--muted); line-height: 1.7; }
.layout { display: grid; grid-template-columns: 18rem minmax(0, 1fr); gap: 1rem; padding: 1rem 0 2rem; }
.panel, article { border: 1px solid var(--border); border-radius: 0.75rem; background: var(--surface); box-shadow: var(--shadow); }
.panel { padding: 1rem; }
aside.panel { position: sticky; top: 1rem; align-self: start; max-height: calc(100vh - 2rem); overflow-y: auto; }
nav ol { padding-left: 1.25rem; margin: 0.75rem 0 0; }
nav li { margin: 0.5rem 0; }
.tools { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: end; }
label { display: block; font-weight: 700; margin-bottom: 0.4rem; }
input[type="search"] { width: 100%; border: 1px solid var(--border); border-radius: 0.8rem; padding: 0.9rem 1rem; font-size: 1rem; background: var(--surface); color: var(--fg); }
input[type="search"]:focus { border-color: var(--accent); }
.button-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
button { border: 1px solid var(--border); border-radius: 0.8rem; background: var(--surface); color: var(--fg); padding: 0.9rem 1rem; font-size: 1rem; cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; }
button:hover { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
button:active { background: var(--accent-hover); border-color: var(--accent-hover); }
.status { margin-top: 0.75rem; min-height: 1.5rem; color: var(--muted); font-size: 0.95rem; }
.articles { display: grid; gap: 1.5rem; margin-top: 1.5rem; }
article header { padding: 1rem; }
.article-top { display: flex; justify-content: space-between; align-items: start; gap: 1rem; flex-wrap: wrap; }
.meta { margin-top: 0.4rem; font-size: 0.95rem; color: var(--muted); }
.article-body { border-top: 1px solid var(--border); padding: 1rem; }
.article-body p { margin-top: 0; margin-bottom: 1rem; }
.article-body p:last-child { margin-bottom: 0; }
.section-block + .section-block { margin-top: 2rem; }
ul { margin-top: 0.5rem; }
.hidden { display: none !important; }
.empty { padding: 1rem; }
.theme-toggle { position: absolute; right: 0; top: 0; border: 1px solid var(--border); border-radius: 0.5rem; background: var(--surface); color: var(--fg); padding: 0.5rem 0.75rem; font-size: 0.85rem; cursor: pointer; }
.theme-toggle:hover { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
html.dark {
  --bg: #1a1a1a; --fg: #e0e0e0; --border: #3a3a3a; --muted: #a0a0a0;
  --surface: #242424;
  --accent: #5ba3d9; --accent-hover: #7ab8e6; --accent-fg: #1a1a1a;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  color-scheme: dark;
}
.nav-fab { display: none; }
.nav-overlay { display: none; }
.nav-backdrop { display: none; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .tools { grid-template-columns: 1fr; }
  aside.panel { display: none; }
  .nav-fab {
    display: block;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 900;
    border: 1px solid var(--border);
    border-radius: 2rem;
    background: var(--accent);
    color: var(--accent-fg);
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: background 0.15s, transform 0.15s;
  }
  .nav-fab:hover { background: var(--accent-hover); }
  .nav-fab:active { transform: scale(0.95); }
  .nav-fab.hidden { display: none !important; }
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 910;
    background: rgba(0,0,0,0.4);
  }
  .nav-backdrop.hidden { display: none !important; }
  .nav-overlay {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 920;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: 1rem 1rem 0 0;
    padding: 1rem 1.5rem 1.5rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    transform: translateY(0);
    transition: transform 0.25s ease;
    visibility: visible;
    pointer-events: auto;
  }
  .nav-overlay.hidden {
    transform: translateY(100%);
    pointer-events: none;
    visibility: hidden;
  }
  .nav-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
  }
  .nav-overlay-close {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--fg);
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    cursor: pointer;
  }
  .nav-overlay-close:hover { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
  .nav-overlay nav ol { padding-left: 1.25rem; margin: 0.5rem 0 0; }
  .nav-overlay nav li { margin: 0.6rem 0; }
}
/* Page intro block (examples and other secondary pages) */
.page-intro { margin-bottom: 1.5rem; }
.page-lede { max-width: 44rem; margin: 0.75rem 0 0; font-size: 1.05rem; color: var(--muted); line-height: 1.7; }

/* Homepage precedents block */
.precedents { margin-top: 2rem; padding: 1.5rem; border: 1px solid var(--border); border-radius: 0.75rem; background: var(--surface); box-shadow: var(--shadow); }
.precedents h2 { margin: 0 0 0.5rem; }
.precedents-intro { margin: 0 0 1.25rem; color: var(--muted); font-size: 0.95rem; }
.precedents-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.precedent-card { border: 1px solid var(--border); border-radius: 0.5rem; padding: 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.precedent-card h3 { margin: 0; font-size: 1rem; }
.precedent-card p { margin: 0; font-size: 0.9rem; color: var(--muted); line-height: 1.5; }
.precedent-place { font-weight: 700; color: var(--fg) !important; }
.precedent-link { margin-top: auto; padding-top: 0.5rem; font-size: 0.9rem; }
.precedents-all { margin: 1.25rem 0 0; text-align: right; font-size: 0.9rem; }
@media (max-width: 900px) {
  .precedents-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .precedents-grid { grid-template-columns: 1fr; }
}

/* Card theme label (used on both homepage and examples page) */
.card-theme { margin: 0; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }

/* Evidence label badge */
.evidence-label { display: inline-block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; border: 1px solid var(--border); border-radius: 0.3rem; padding: 0.15rem 0.5rem; color: var(--muted); margin-bottom: 0.5rem; }

/* Examples page sections and cards */
.example-section { margin-top: 2.5rem; }
.example-section h2 { margin: 0 0 1rem; font-size: var(--step-2); }
.example-card { padding: 1.5rem; margin-bottom: 1.5rem; }
.example-card-header { margin-bottom: 1.25rem; }
.example-card-header h3 { margin: 0.25rem 0 0; font-size: var(--step-1); }
.example-fields { margin: 0; }
.example-field { margin-bottom: 1.25rem; }
.example-field:last-child { margin-bottom: 0; }
.example-field dt { font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.3rem; }
.example-field dd { margin: 0; font-size: 0.975rem; line-height: 1.65; }
.example-field--limits dt { color: var(--muted); }
.example-sources { margin: 0.25rem 0 0; padding-left: 1.25rem; }
.example-sources li { margin: 0.4rem 0; font-size: 0.9rem; }

/* Site nav bar */
.site-nav { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-nav .wrap { display: flex; flex-wrap: wrap; }
.site-nav a { display: inline-block; padding: 0.65rem 1rem; font-size: 0.9rem; color: var(--fg); text-decoration: none; }
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }

/* Site footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 2rem; padding: 1.5rem 1rem; }
.site-footer p { margin: 0; color: var(--muted); font-size: 0.9rem; text-align: center; }

/* Mobile nav overlay section headings and site links */
.nav-overlay-section-title { margin: 1rem 0 0.25rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.nav-overlay-site-links { list-style: none; padding-left: 0; margin: 0.25rem 0 0.5rem; }
.nav-overlay-site-links li { margin: 0.5rem 0; }

/* Guide and method sections */
.guide-section { margin-top: 1.5rem; padding: 1.5rem; }
.guide-section h2 { margin: 0 0 1rem; }
.guide-section p { margin-top: 0; margin-bottom: 1rem; }
.guide-section p:last-child { margin-bottom: 0; }
.guide-section ul { margin-top: 0; margin-bottom: 1rem; padding-left: 1.5rem; }
.guide-section ul:last-child { margin-bottom: 0; }
.guide-section li { margin: 0.5rem 0; line-height: 1.6; }

/* Method definition list */
.method-list { margin: 0.5rem 0 1rem; }
.method-list > div { margin-bottom: 1.25rem; }
.method-list > div:last-child { margin-bottom: 0; }
.method-list dt { font-weight: 700; margin-bottom: 0.25rem; }
.method-list dd { margin: 0; color: var(--muted); font-size: 0.975rem; line-height: 1.65; }

/* Sources page */
.source-group { margin-top: 2rem; }
.source-group h2 { margin: 0 0 0.5rem; font-size: var(--step-2); }
.source-group-intro { margin: 0 0 1.25rem; color: var(--muted); font-size: 0.95rem; }
.source-entry { border: 1px solid var(--border); border-radius: 0.5rem; padding: 1rem 1.25rem; margin-bottom: 1rem; background: var(--surface); }
.source-entry:last-child { margin-bottom: 0; }
.source-citation { margin: 0 0 0.5rem; font-size: 0.95rem; line-height: 1.5; }
.source-annotation { margin: 0; font-size: 0.9rem; color: var(--muted); line-height: 1.65; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
