* { box-sizing: border-box; }

:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-soft: #eef2f7;
  --text: #152033;
  --muted: #5d697c;
  --border: #d8e0eb;
  --line: #bcc7d7;
  --link: #214ecf;
  --focus: #172554;
  --mdr: #0a669e;
  --mdr-soft: #eaf6fc;
  --ivdr: #087668;
  --ivdr-soft: #e9f8f4;
  --proposal: #9a5700;
  --proposal-soft: #fff4df;
  --operation: #6555a7;
  --operation-soft: #f2efff;
  --shadow: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0d121a;
    --surface: #141c27;
    --surface-soft: #1a2533;
    --text: #f3f6fb;
    --muted: #aeb9c9;
    --border: #2d394a;
    --line: #46556a;
    --link: #9db2ff;
    --focus: #ffffff;
    --mdr: #68bdf0;
    --mdr-soft: #102c3c;
    --ivdr: #66d3bf;
    --ivdr-soft: #102f2a;
    --proposal: #ffc46f;
    --proposal-soft: #3b2b14;
    --operation: #c0b2ff;
    --operation-soft: #282340;
    --shadow: none;
  }
}

html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--link); text-underline-offset: .16em; }
a:hover { text-decoration-thickness: .14em; }
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: .2rem solid var(--focus);
  outline-offset: .2rem;
  border-radius: .25rem;
}
button, summary { font: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: .75rem;
  left: .75rem;
  transform: translateY(-180%);
  padding: .65rem .85rem;
  border: 2px solid var(--text);
  border-radius: .5rem;
  background: var(--surface);
  color: var(--text);
  font-weight: 750;
}
.skip-link:focus { transform: none; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
  padding: .9rem 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.brand {
  color: var(--text);
  font-weight: 850;
  letter-spacing: -.025em;
  text-decoration: none;
}
.brand span { color: var(--muted); font-weight: 650; }

.view-switch {
  display: none;
  gap: .2rem;
  padding: .2rem;
  border: 1px solid var(--border);
  border-radius: .15rem;
  background: var(--surface);
}
[data-detail] .view-switch { display: inline-flex; }
.view-switch button {
  min-height: 2.25rem;
  padding: .35rem .75rem;
  border: 0;
  border-radius: .1rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}
.view-switch button[aria-pressed="true"] {
  background: var(--text);
  color: var(--surface);
}

[data-detail="public"] .expert-only { display: none !important; }
.anchor-alias { display: block; scroll-margin-top: 5rem; }

main {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
  padding: 1rem 0 6rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(14rem, .65fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: end;
  margin-top: 1rem;
  padding: clamp(2.25rem, 5vw, 4rem) 0 clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: transparent;
  box-shadow: none;
}
.eyebrow, .section-kicker {
  margin: 0 0 .5rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}
h1, h2, h3 { line-height: 1.08; text-wrap: balance; }
h1 {
  max-width: 16ch;
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.75rem);
  letter-spacing: -.04em;
}
h2 {
  margin: .1rem 0 .75rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
  letter-spacing: -.04em;
}
h3 { margin: .4rem 0 .6rem; font-size: 1.35rem; }
p { margin: .4rem 0 1rem; }
.dek {
  max-width: 62ch;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
}
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1rem;
  margin-top: 1.6rem;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
}
.trust-strip span:not(:last-child)::after {
  content: "·";
  margin-left: 1rem;
  color: var(--line);
}

.quick-nav {
  display: grid;
  gap: .5rem;
  align-self: stretch;
  align-content: end;
}
.quick-nav a {
  display: flex;
  min-height: 2.9rem;
  align-items: center;
  justify-content: space-between;
  padding: .65rem .8rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 750;
  text-decoration: none;
}
.quick-nav a::after { content: "↓"; color: var(--muted); }

.section {
  margin-top: clamp(4.5rem, 9vw, 7.5rem);
  scroll-margin-top: 5rem;
}
.section-heading {
  max-width: 72ch;
  margin-bottom: 1.75rem;
}
.section-heading > p:last-child {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.branch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.branch-card {
  position: relative;
  min-width: 0;
  padding: clamp(1.4rem, 4vw, 2.15rem);
  border: 1px solid var(--border);
  border-radius: .3rem;
  background: var(--surface);
  box-shadow: none;
}
.branch-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: .35rem;
  border-radius: 0;
  background: currentColor;
}
.branch-card.mdr { color: var(--mdr); }
.branch-card.ivdr { color: var(--ivdr); }
.branch-card h3,
.branch-card > p,
.branch-card .branch-citation,
.branch-card .branch-actions { color: var(--text); }
.branch-topline {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .8rem;
  align-items: center;
}
.branch-code {
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .08em;
}
.branch-citation { color: var(--muted) !important; font-size: .82rem; }
.qualification {
  margin: 1rem 0;
  padding: .8rem .9rem;
  border-left: .22rem solid currentColor;
  background: var(--surface-soft);
  color: var(--text) !important;
  font-size: .9rem;
}
.branch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  margin-top: 1.15rem;
  font-size: .88rem;
  font-weight: 700;
}

.visual-section {
  padding: clamp(1.4rem, 4vw, 2.6rem);
  border: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.timeline-shell { min-width: 0; }
.timeline-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .65rem;
  margin: 2.5rem 0 1.5rem;
  padding: 0;
  list-style: none;
}
.timeline-track::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 2.9rem;
  left: 5%;
  right: 5%;
  height: 2px;
  background: var(--line);
}
.timeline-item {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding-top: 4.25rem;
}
.timeline-item::before {
  content: "";
  position: absolute;
  top: 2.38rem;
  left: .1rem;
  width: 1rem;
  height: 1rem;
  border: .28rem solid var(--surface);
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 2px var(--line);
}
.timeline-item.law::before { background: var(--link); }
.timeline-item.proposal::before { background: var(--proposal); }
.timeline-item.operation::before { background: var(--operation); }
.timeline-item time {
  display: block;
  margin-bottom: .15rem;
  font-size: .82rem;
  font-weight: 850;
}
.timeline-type {
  display: inline-block;
  margin-bottom: .6rem;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.timeline-item strong {
  display: block;
  font-size: .94rem;
  line-height: 1.28;
}
.timeline-item > .expert-only {
  display: block;
  margin-top: .45rem;
  color: var(--muted);
  font-size: .78rem;
}
.timeline-note { color: var(--operation) !important; }
.supporting-detail {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.supporting-detail summary {
  cursor: pointer;
  font-weight: 750;
}
.supporting-detail p { max-width: 78ch; color: var(--muted); }
.source-links { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.timeline-sources { margin-top: 1rem; font-size: .88rem; }

.law-map {
  position: relative;
  margin-top: 2rem;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  border-radius: .2rem;
  background: var(--surface-soft);
  overflow: hidden;
}
.law-map-root {
  position: relative;
  z-index: 2;
  width: min(24rem, 100%);
  margin: 0 auto;
  padding: .8rem 1rem;
  border: 1px solid var(--text);
  border-radius: .8rem;
  background: var(--surface);
  font-weight: 850;
  text-align: center;
}
.law-map-root::after {
  content: "";
  position: absolute;
  top: 100%;
  left: calc(50% - 1px);
  width: 2px;
  height: 2rem;
  background: var(--line);
}
.law-map-root small {
  display: block;
  margin-top: .15rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
}
.law-map-branches {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 6vw, 5rem);
  margin-top: 2rem;
}
.law-map-branches::before {
  content: "";
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 2px;
  background: var(--line);
}
.law-branch {
  position: relative;
  display: grid;
  gap: .7rem;
  min-width: 0;
  padding-top: 1.5rem;
}
.law-branch::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(50% - 1px);
  width: 2px;
  height: 1.5rem;
  background: var(--line);
}
.predecessor-stack {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: center;
}
.predecessor-stack span {
  padding: .25rem .45rem;
  border: 1px solid var(--border);
  border-radius: .12rem;
  background: var(--surface);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
}
.core-node {
  display: grid;
  gap: .2rem;
  justify-items: center;
  min-height: 7rem;
  align-content: center;
  padding: 1rem;
  border: 2px solid currentColor;
  border-radius: .2rem;
  background: var(--surface);
  text-align: center;
}
.law-branch.mdr { color: var(--mdr); }
.law-branch.ivdr { color: var(--ivdr); }
.core-node strong,
.core-node small { color: var(--text); }
.core-node small { color: var(--muted); }
.child-node {
  padding: .65rem .8rem;
  border: 1px dashed currentColor;
  border-radius: .15rem;
  color: var(--text);
  font-size: .82rem;
  font-weight: 700;
  text-align: center;
}
.cross-cutting,
.proposal-node {
  display: grid;
  gap: .15rem;
  width: min(42rem, 100%);
  margin: 1.2rem auto 0;
  padding: .85rem 1rem;
  border-radius: .15rem;
  text-align: center;
}
.cross-cutting {
  border: 1px solid color-mix(in srgb, var(--operation) 55%, var(--border));
  background: var(--operation-soft);
}
.proposal-node {
  border: 1px dashed var(--proposal);
  background: var(--proposal-soft);
}
.map-label {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.cross-cutting span:last-child,
.proposal-node span:last-child {
  color: var(--muted);
  font-size: .78rem;
}
.map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem 1rem;
  align-items: center;
  margin-top: 1rem;
}
.map-caption {
  max-width: 78ch;
  margin: 1rem 0;
  color: var(--muted);
  font-size: .88rem;
}
.later-measures ul { margin: .8rem 0; padding-left: 1.3rem; }
.later-measures li + li { margin-top: .35rem; }
.primary-action {
  display: inline-flex;
  min-height: 2.8rem;
  align-items: center;
  padding: .55rem .8rem;
  border-radius: .15rem;
  background: var(--text);
  color: var(--surface);
  font-weight: 800;
  text-decoration: none;
}

.roles-section { max-width: 920px; margin-inline: auto; }
.role-table {
  border-top: 1px solid var(--border);
  scroll-margin-top: 5rem;
}
.role-table details { border-bottom: 1px solid var(--border); }
.role-table summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
  padding: 1.05rem .15rem;
  cursor: pointer;
  list-style: none;
}
.role-table summary::-webkit-details-marker { display: none; }
.role-table summary::after {
  content: "+";
  color: var(--link);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}
.role-table details[open] summary::after { content: "−"; }
.role-table summary span { font-weight: 850; }
.role-table summary strong {
  color: var(--muted);
  font-size: .88rem;
  font-weight: 650;
  text-align: right;
}
.role-detail {
  max-width: 70ch;
  padding: 0 1.5rem 1.15rem;
  color: var(--muted);
}
.role-detail p:last-child { font-size: .85rem; }
.role-footnote {
  margin-top: 1rem;
  color: var(--muted);
  font-size: .85rem;
}

.sources-section { max-width: 980px; margin-inline: auto; }
.source-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .7rem;
}
.source-grid a {
  display: grid;
  gap: .2rem;
  min-height: 5.5rem;
  align-content: center;
  padding: .85rem;
  border: 1px solid var(--border);
  border-radius: .15rem;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.source-grid a:hover { border-color: var(--link); }
.source-grid span { color: var(--muted); font-size: .78rem; }
.expert-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  margin-top: 1rem;
}
.expert-meta div {
  display: grid;
  gap: .15rem;
  padding: .7rem 0;
  border-top: 1px solid var(--border);
}
.expert-meta span { color: var(--muted); font-size: .74rem; }
.final-boundary {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  border-left: .24rem solid var(--text);
  background: var(--surface-soft);
}

@media (max-width: 52rem) {
  .hero { grid-template-columns: 1fr; }
  .quick-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .branch-grid { grid-template-columns: 1fr; }
  .timeline-track {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding-left: 1.8rem;
  }
  .timeline-track::before {
    top: .4rem;
    bottom: .4rem;
    left: .42rem;
    width: 2px;
    height: auto;
  }
  .timeline-item {
    padding: .2rem 0 1.5rem 1rem;
  }
  .timeline-item::before {
    top: .35rem;
    left: -1.8rem;
  }
  .law-map-branches { gap: 1rem; }
  .source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 38rem) {
  .topbar { width: min(1180px, calc(100% - 1rem)); flex-direction: column; align-items: stretch; gap: .5rem; }
  .view-switch { align-self: flex-start; }
  .view-switch button { padding-inline: .55rem; white-space: nowrap; }
  .anchor-alias, .role-table { scroll-margin-top: 11rem; }
  main { width: min(100% - 1rem, 1180px); }
  .hero { padding: 1.75rem 0 1.5rem; }
  .trust-strip { display: grid; gap: .25rem; }
  .trust-strip span::after { display: none; }
  .quick-nav { grid-template-columns: 1fr; }
  .visual-section { padding: 1.25rem 0; }
  .law-map { padding: 1rem; }
  .law-map-root::after,
  .law-map-branches::before,
  .law-branch::before { display: none; }
  .law-map-branches { grid-template-columns: 1fr; margin-top: 1rem; }
  .law-branch {
    padding: 0 0 1rem 1rem;
    border-left: 2px solid var(--line);
  }
  .predecessor-stack { justify-content: flex-start; }
  .core-node { justify-items: start; min-height: auto; text-align: left; }
  .child-node { text-align: left; }
  .role-table summary { grid-template-columns: minmax(0, 1fr) auto; gap: .2rem; }
  .role-table summary::after { grid-column: 2; grid-row: 1 / span 2; }
  .role-table summary strong { grid-column: 1; }
  .role-table summary strong { text-align: left; }
  .source-grid, .expert-meta { grid-template-columns: 1fr; }
}


.glance-panel {
  margin: 1.5rem 0 0;
  padding: 1.4rem;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}
.glance-heading {
  max-width: 46rem;
}
.glance-heading h2 {
  margin: .2rem 0 .4rem;
}
.glance-heading p:last-child {
  margin-bottom: 1rem;
  color: var(--muted);
}
.glance-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .75rem;
}
.glance-grid article {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
}
.glance-grid h3 {
  margin: 0 0 .45rem;
  font-size: 1rem;
}
.glance-grid p {
  margin: 0 0 .7rem;
  color: var(--text);
}
.glance-grid a {
  font-weight: 750;
}
@media (max-width: 64rem) {
  .glance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 38rem) {
  .glance-panel {
    padding: 1rem;
  }
  .glance-grid {
    grid-template-columns: 1fr;
  }
}
