/* BD Bonus Decode — clause / legal-plain decoder
   Unlike app-guard (navy+lime, circles) and pay-rails (forest+gold, rails).
   Here: parchment, plum ink, copper accent, definition tables, “statute” cards. */

a.skip-link {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 1000;
  padding: 0.5rem 0.85rem;
  background: #3b1f4a;
  color: #fff8f0;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}

a.skip-link:focus,
a.skip-link:focus-visible {
  clip: auto;
  clip-path: none;
  width: auto;
  height: auto;
  overflow: visible;
  outline: 2px solid #c45c26;
  outline-offset: 2px;
}

:root {
  --pico-font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --pico-primary: #3b1f4a;
  --pico-primary-background: #3b1f4a;
  --pico-primary-hover: #5a326e;
  --pico-primary-underline: rgba(59, 31, 74, 0.4);
  --pico-background-color: #f6f1e7;
  --pico-card-background-color: #fffcf6;
  --pico-border-radius: 0;
  --ink: #2a1833;
  --plum: #3b1f4a;
  --plum-deep: #24122e;
  --copper: #c45c26;
  --copper-soft: #f3d5c0;
  --parchment: #f6f1e7;
  --paper: #fffcf6;
  --rule: #d4c8b4;
  --muted: #5a4d62;
}

body {
  color: var(--ink);
  background:
    radial-gradient(ellipse at top, rgba(196, 92, 38, 0.06), transparent 45%),
    var(--parchment);
}

/* Document title bar (not dark masthead, not light+green stripe) */
.doc-bar {
  background: var(--paper);
  border-bottom: 3px double var(--plum);
  padding: 0.85rem 0 0;
}

.doc-bar .brand-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.65rem;
}

a.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}

a.brand-lockup:hover {
  text-decoration: none;
  opacity: 0.92;
}

.site-tag {
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  border: 1px solid var(--rule);
  box-shadow: 2px 2px 0 rgba(59, 31, 74, 0.12);
}

.doc-bar .brand-line strong {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--plum);
  letter-spacing: 0.02em;
}

.doc-bar .brand-line .edition {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--copper);
  font-weight: 700;
}

.doc-bar nav {
  border-top: 1px solid var(--rule);
  padding-top: 0.35rem;
}

.doc-bar nav ul li a {
  position: relative;
  display: inline-block;
  color: var(--plum);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.3rem 0.4rem 0.4rem;
  transition: color 0.15s ease;
}

/* Double-rule underline expands on hover (document feel) */
.doc-bar nav ul li a::after {
  content: "";
  position: absolute;
  left: 0.4rem;
  right: 0.4rem;
  bottom: 0.1rem;
  height: 3px;
  background:
    linear-gradient(var(--copper), var(--copper)) top / 100% 1px no-repeat,
    linear-gradient(var(--copper), var(--copper)) bottom / 100% 1px no-repeat;
  opacity: 0;
  transform: scaleX(0.4);
  transition: opacity 0.15s ease, transform 0.18s ease;
}

.doc-bar nav ul li a:hover {
  color: var(--copper);
}

.doc-bar nav ul li a:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

.doc-bar nav ul li a:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

.doc-bar nav ul li a[aria-current="page"] {
  color: var(--copper);
  font-weight: 700;
}

.doc-bar nav ul li a[aria-current="page"]::after {
  opacity: 1;
  transform: scaleX(1);
}

/* Stamp ribbon */
.stamp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  margin: 1.25rem 0 1.5rem;
}

.stamp {
  display: inline-block;
  border: 2px solid var(--copper);
  color: var(--copper);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  transform: rotate(-1.5deg);
}

.stamp.solid {
  background: var(--plum);
  border-color: var(--plum);
  color: #fff8f0;
  transform: none;
}

.stamp-row .fine {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Title block */
.clause-title {
  font-family: "Libre Baskerville", Georgia, serif;
  color: var(--plum-deep);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  max-width: 40rem;
}

.abstract {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 42rem;
  border-left: 3px solid var(--copper);
  padding-left: 1rem;
  margin: 0 0 1.5rem;
}

.dated {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 1.75rem;
}

/* Decode matrix: legal term | plain English (unique IA module) */
.decode-grid {
  display: grid;
  gap: 0;
  border: 1px solid var(--rule);
  background: var(--paper);
  margin: 1.5rem 0 2rem;
}

.decode-grid .row {
  display: grid;
  gap: 0;
  border-bottom: 1px solid var(--rule);
}

.decode-grid .row:last-child {
  border-bottom: none;
}

@media (min-width: 720px) {
  .decode-grid .row {
    grid-template-columns: 0.9fr 1.1fr;
  }
}

.decode-grid .term {
  background: #efe6f5;
  padding: 0.9rem 1rem;
  font-weight: 700;
  color: var(--plum);
  font-size: 0.95rem;
}

.decode-grid .plain {
  padding: 0.9rem 1rem;
  color: var(--ink);
  font-size: 0.95rem;
}

.decode-grid .term small,
.decode-grid .plain small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  margin-top: 0.25rem;
  font-size: 0.82rem;
}

/* Article cards as “schedules” */
.schedules {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

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

.schedule {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--plum);
  padding: 1.1rem 1.15rem 1.2rem;
}

.schedule.alt {
  border-top-color: var(--copper);
}

.schedule h3 {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  color: var(--plum-deep);
}

.schedule h3 a {
  color: inherit;
  text-decoration: none;
}

.schedule h3 a:hover {
  color: var(--copper);
  text-decoration: underline;
}

.schedule p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.schedule .meta {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--copper);
  font-weight: 700;
}

/* Section headings — underlined double rule */
main h2 {
  font-family: "Libre Baskerville", Georgia, serif;
  color: var(--plum-deep);
  font-size: 1.35rem;
  border-bottom: 3px double var(--rule);
  padding-bottom: 0.35rem;
  margin-top: 2.25rem;
}

/* Numbered clauses (not circles, not diamond rails) */
.clauses {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
  counter-reset: clause;
}

.clauses > li {
  counter-increment: clause;
  position: relative;
  padding: 0.85rem 0 0.85rem 3.25rem;
  border-bottom: 1px dashed var(--rule);
}

.clauses > li::before {
  content: "§" counter(clause);
  position: absolute;
  left: 0;
  top: 0.85rem;
  font-family: "Libre Baskerville", Georgia, serif;
  font-weight: 700;
  color: var(--copper);
  font-size: 0.95rem;
  width: 2.75rem;
}

/* Callouts */
.margin-note {
  background: #fff8f2;
  border: 1px solid var(--copper-soft);
  border-left: 6px solid var(--copper);
  padding: 0.9rem 1.05rem;
  margin: 1.35rem 0;
}

.margin-note.ink {
  background: #f3eaf8;
  border-color: #d4c0e0;
  border-left-color: var(--plum);
}

.margin-note.warn {
  background: #fff5f0;
  border-left-color: #a33b1a;
}

.margin-note strong {
  display: block;
  color: var(--plum-deep);
  margin-bottom: 0.3rem;
  font-family: "Libre Baskerville", Georgia, serif;
}

/* Statute tables */
.statute {
  overflow-x: auto;
  margin: 1.25rem 0;
  border: 1px solid var(--rule);
  background: var(--paper);
}

.statute table {
  margin: 0;
}

.statute th {
  background: var(--plum);
  color: #fff8f0;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}

.statute td {
  font-variant-numeric: tabular-nums;
  vertical-align: top;
  font-size: 0.92rem;
}

.statute tr:nth-child(even) td {
  background: #f3ebe0;
}

/* Figures */
.exhibit {
  margin: 1.5rem auto;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--rule);
  background: #ebe4d6;
  box-shadow: 4px 4px 0 rgba(59, 31, 74, 0.08);
}

.exhibit img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}

.exhibit--wide {
  width: 100%;
}

.exhibit--wide img {
  width: 100%;
  height: auto;
}

.exhibit--panel {
  max-width: min(100%, 20rem);
}

.exhibit figcaption {
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0.55rem 0.85rem;
  background: var(--paper);
  border-top: 1px solid var(--rule);
}

/* TOC as “contents” */
nav.contents {
  display: block;
  max-width: 34rem;
  margin: 1.5rem 0 2rem;
  padding: 1rem 1.15rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-bottom: 3px solid var(--plum);
}

nav.contents h2 {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper);
  border: none;
  margin: 0 0 0.65rem;
  padding: 0;
}

nav.contents ol {
  display: block;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}

nav.contents li {
  display: block;
  border-top: 1px dotted var(--rule);
  counter-increment: toc;
}

nav.contents li:first-child {
  border-top: none;
}

nav.contents a {
  display: flex;
  gap: 0.65rem;
  padding: 0.5rem 0;
  text-decoration: none;
  color: var(--plum);
  font-weight: 500;
}

nav.contents a::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--copper);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.85rem;
  flex: 0 0 auto;
}

nav.contents a:hover {
  color: var(--copper);
}

/* BN block — plum paper, high contrast */
.bn-block {
  background: var(--plum-deep);
  color: #fff8f0;
  padding: 1.05rem 1.2rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

.bn-block a {
  color: #ffc9a0;
}

/* Cross refs */
.cross {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

@media (min-width: 640px) {
  .cross {
    grid-template-columns: 1fr 1fr;
  }
}

.cross a {
  display: block;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--plum);
  color: var(--plum);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--paper);
}

.cross a:hover {
  background: var(--plum);
  color: #fff8f0;
}

/* Lists: one marker only (native disc) — no extra icon + bullet */
.tick {
  list-style: disc;
  padding-left: 1.25rem;
  margin-left: 0.25rem;
}

.tick li {
  margin-bottom: 0.4rem;
  padding-left: 0.15rem;
}

.tick li::before {
  content: none;
  display: none;
}

/* Footer colophon */
.colophon {
  margin-top: 3rem;
  padding: 1.5rem 0 2.25rem;
  background: var(--plum-deep);
  color: #fff8f0;
  border-top: 4px solid var(--copper);
}

.colophon a {
  color: #ffc9a0;
}

.colophon .rg {
  font-size: 0.9rem;
  color: #fff8f0;
  margin-bottom: 0.65rem;
  line-height: 1.5;
}

.colophon .meta {
  font-size: 0.85rem;
  color: #f0e6f5;
}

.badge-18 {
  display: inline-block;
  background: var(--copper);
  color: #fff;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  margin-right: 0.35rem;
}

/* —— Responsive site nav (shared pattern; site-tinted) —— */
.site-header .header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  min-height: 3.25rem;
}

.site-header a.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.site-header .site-tag {
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.4rem 0.65rem;
  border: 1px solid #d4c8b4;
  border-radius: 0.35rem;
  background: #fffcf6;
  color: #3b1f4a;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  width: auto;
  height: auto;
}

.nav-toggle:hover,
.nav-toggle:focus {
  background: #fff8f2;
  border-color: #c45c26;
}

.nav-toggle-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  width: 1.1rem;
}

.nav-toggle-box span {
  display: block;
  height: 2px;
  width: 100%;
  background: #3b1f4a;
  border-radius: 1px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-box span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-box span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-box span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* Kill Pico nav stacking hacks */
nav.site-nav {
  display: block;
  justify-content: initial;
  align-items: initial;
  overflow: visible;
  border-top: 1px solid #d4c8b4;
  width: 100%;
  margin: 0;
  padding: 0;
}

nav.site-nav ul {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.1rem;
  list-style: none;
  margin: 0 !important;
  padding: 0.35rem 0 0.55rem !important;
  width: 100%;
  float: none;
}

nav.site-nav li {
  display: block !important;
  float: none !important;
  position: relative;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 auto;
  width: auto;
}

nav.site-nav li::before {
  content: none !important;
  display: none !important;
  float: none !important;
}

nav.site-nav li a {
  position: relative;
  display: inline-block !important;
  margin: 0 !important;
  padding: 0.35rem 0.5rem !important;
  color: #3b1f4a;
  text-decoration: none;
  border-radius: 0.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  float: none !important;
  width: auto;
  box-sizing: border-box;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

nav.site-nav li a:hover {
  color: #c45c26;
  background: rgba(196,92,38,0.1);
  text-decoration: none;
}

nav.site-nav li a[aria-current="page"] {
  font-weight: 700;
  color: #c45c26;
  background: rgba(196,92,38,0.12);
}

@media (max-width: 899px) {
  .nav-toggle {
    display: inline-flex;
  }

  nav.site-nav {
    display: none;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid #d4c8b4;
    background: #efe6f5;
  }

  nav.site-nav.is-open {
    display: block !important;
    padding: 1rem 0 1.15rem;
  }

  nav.site-nav.is-open.container {
    width: 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
  }

  nav.site-nav.is-open ul {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    width: min(100% - 2rem, 22rem) !important;
    max-width: 22rem;
    margin: 0 auto !important;
    padding: 0.35rem 0 !important;
    height: auto !important;
    min-height: 0 !important;
    background: transparent;
    list-style: none !important;
  }

  nav.site-nav.is-open li {
    display: block !important;
    float: none !important;
    width: 100% !important;
    flex: none !important;
    height: auto !important;
    clear: both !important;
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: 1px solid #d4c0e0;
  }

  nav.site-nav.is-open li:last-child {
    border-bottom: none;
  }

  nav.site-nav.is-open li::before {
    content: none !important;
    display: none !important;
    float: none !important;
  }

  nav.site-nav.is-open li a {
    display: block !important;
    width: 100% !important;
    max-width: 100%;
    margin: 0 !important;
    padding: 1rem 1.15rem !important;
    font-size: 1.05rem !important;
    line-height: 1.45 !important;
    text-align: center !important;
    border-radius: 0 !important;
    white-space: normal !important;
    border: none !important;
    background: transparent !important;
    color: #2a1833 !important;
    float: none !important;
    height: auto !important;
    box-sizing: border-box;
  }

  nav.site-nav.is-open li a::after {
    display: none !important;
    content: none !important;
  }

  nav.site-nav.is-open li a:hover,
  nav.site-nav.is-open li a:focus-visible {
    background: rgba(196,92,38,0.12) !important;
    text-decoration: none;
  }

  nav.site-nav.is-open li a[aria-current="page"] {
    background: rgba(196,92,38,0.2) !important;
    font-weight: 700;
    color: #2a1833 !important;
  }
}

@media (min-width: 900px) {
  .nav-toggle {
    display: none !important;
  }

  nav.site-nav {
    display: block !important;
  }

  nav.site-nav li a {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.86rem !important;
  }
}

@media (min-width: 1100px) {
  nav.site-nav li a {
    padding: 0.4rem 0.6rem !important;
    font-size: 0.9rem !important;
  }
}
/* header-bar site tweaks */

.site-header.doc-bar .header-bar {
  flex-wrap: wrap;
  align-items: center;
}
.site-header.doc-bar .brand-line {
  margin-bottom: 0;
  flex: 1 1 auto;
  min-width: 0;
}

/* Desktop: brand left, menu right (same row). Mobile: hamburger + full-width panel */
.site-header .header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  min-height: 3.25rem;
}

.site-header .header-bar > .brand-lockup,
.site-header .header-bar > .brand-line {
  flex: 0 1 auto;
  min-width: 0;
  order: 1;
}

.site-header .header-bar > .nav-toggle {
  order: 2;
  margin-left: auto;
}

.site-header .header-bar > nav.site-nav {
  order: 3;
}

/* Desktop single row: brand | flexible spacer nav right-aligned | (toggle hidden) */
@media (min-width: 900px) {
  .site-header .header-bar {
    flex-wrap: nowrap;
  }

  .site-header .header-bar > nav.site-nav {
    order: 2;
    flex: 1 1 auto;
    display: block !important;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    border-top: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .site-header .header-bar > .nav-toggle {
    display: none !important;
    order: 3;
  }

  nav.site-nav ul {
    justify-content: flex-end !important;
    flex-wrap: wrap !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
    gap: 0.15rem 0.25rem !important;
  }
}

@media (max-width: 899px) {
  .site-header .header-bar > nav.site-nav {
    order: 3;
    flex: 1 0 100%;
    width: 100%;
  }

  /* full-bleed panel relative to header when open */
  nav.site-nav.is-open {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* Partner CTA */
.partner-cta-box {
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  background: #fffcf6;
  border: 1px solid #d4c8b4;
  border-left: 6px solid #c45c26;
}
.partner-cta-box p { margin: 0 0 0.75rem; }
.partner-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
a.partner-cta {
  display: inline-block;
  padding: 0.55rem 1rem;
  background: #3b1f4a;
  color: #fff8f0 !important;
  font-weight: 700;
  text-decoration: none !important;
}
a.partner-cta.outline {
  background: transparent;
  border: 2px solid #3b1f4a;
  color: #3b1f4a !important;
}
.partner-cta-box .fine-print { margin: 0.65rem 0 0; font-size: 0.8rem; color: #5a4d62; }

