:root {
  --navy: #0b2545;
  --navy-700: #123a6b;
  --link: #0a5c8a;
  --cyan: #22b8e6;
  --cyan-100: #e6f6fc;
  --text: #172536;
  --text-muted: #4a5568;
  --border: #d5dde6;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --footer-link: #7fd8f5;
  --shell: 1360px;
  --header-height: 180px;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  min-width: 320px;
  background: var(--surface);
  scroll-padding-top: calc(var(--header-height) + 16px);
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background: var(--surface);
  overflow-x: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

button, input { font: inherit; }
img { display: block; max-width: 100%; height: auto; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
.shell { width: min(calc(100% - 48px), var(--shell)); margin-inline: auto; }

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-row {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 18px;
}

.brand { display: inline-flex; flex: 0 0 auto; align-items: center; text-decoration: none; }
.brand-logo { width: auto; height: 32px; }
.site-title {
  margin: 0;
  color: var(--navy);
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.25;
}

.language-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}
.language-nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 8px 10px;
  color: var(--link);
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.language-nav a[aria-current="true"] {
  color: var(--navy);
  border-bottom: 3px solid var(--navy);
  text-decoration: none;
}

.search-row { padding-bottom: 13px; }
#search-form > label {
  display: block;
  margin-bottom: 4px;
  color: var(--navy);
  font-size: .875rem;
  font-weight: 650;
}
.search-control { position: relative; display: flex; align-items: center; }
.search-icon {
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  color: var(--navy);
  pointer-events: none;
}
#q {
  width: 100%;
  min-height: 48px;
  padding: 10px 48px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--text-muted);
  border-radius: 3px;
  font-size: 1rem;
}
#q::placeholder { color: var(--text-muted); opacity: 1; }
#q::-webkit-search-cancel-button { -webkit-appearance: none; }
.clear-search {
  position: absolute;
  right: 3px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--navy);
  background: transparent;
  border: 0;
  border-radius: 3px;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}
.clear-search:hover { background: var(--cyan-100); }
.search-help { margin: 4px 0 0; color: var(--text-muted); font-size: .8125rem; line-height: 1.35; }

.skip-link {
  position: fixed;
  z-index: 20;
  top: 8px;
  left: 16px;
  padding: 8px 12px;
  color: var(--navy);
  background: var(--cyan);
  font-weight: 650;
  text-decoration: none;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.library-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 240px;
  gap: 32px;
  align-items: start;
  flex: 1;
}
.document-nav, .content-column, .toc-panel { min-width: 0; }
.document-nav {
  position: sticky;
  top: var(--header-height);
  max-height: calc(100dvh - var(--header-height));
  overflow: auto;
  padding-block: 28px 48px;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
}
.documents-toggle { display: none; }
.mobile-language { display: none; }
.catalogue-group + .catalogue-group { margin-top: 30px; }
.catalogue-heading {
  margin: 0 20px 10px 16px;
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.35;
}
.catalogue-note {
  margin: -4px 16px 14px;
  color: var(--text-muted);
  font-size: .8125rem;
  line-height: 1.4;
}
.catalogue-section + .catalogue-section { margin-top: 20px; }
.catalogue-section h3 {
  margin: 0 16px 5px;
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.35;
}
.catalogue-list { margin: 0; padding: 0; list-style: none; }
.catalogue-family { margin: 0; padding: 0 12px 8px 16px; }
.family-name {
  display: block;
  margin-bottom: 2px;
  color: var(--navy);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.family-audience { display: block; margin-bottom: 2px; color: var(--text-muted); font-size: .8125rem; line-height: 1.35; }
.locale-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.locale-list a, .locale-status {
  display: block;
  min-height: 44px;
  padding: 9px 10px;
  color: var(--link);
  font-size: .8125rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.locale-list a { text-decoration: none; border-left: 3px solid transparent; }
.locale-list a:hover { background: var(--surface); }
.locale-list a[aria-current="page"] {
  color: var(--navy);
  background: var(--surface);
  border-left-color: var(--navy);
  font-weight: 650;
}
.locale-status { color: var(--text-muted); border-left: 3px solid transparent; }
.locale-code { display: inline-block; min-width: 2.3rem; color: var(--navy); font-weight: 750; }
.status-short { color: inherit; }

.reading-pane, .search-results { min-width: 0; padding-block: 40px 80px; }
.reading-pane:focus { outline: 0; }
.document-pane { max-width: 72ch; }
.document-eyebrow {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: .8125rem;
  font-weight: 650;
  line-height: 1.4;
}
.document-pane h1 {
  margin: 0 0 18px;
  color: var(--navy);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.status-banner {
  margin: 0 0 24px;
  padding: 13px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
}
.status-banner strong { display: block; color: var(--navy); font-size: .9375rem; line-height: 1.4; }
.status-banner p { margin: 4px 0 0; font-size: .9375rem; line-height: 1.5; }
.mapping-notice {
  margin: -8px 0 24px;
  padding: 10px 14px;
  color: var(--navy);
  background: var(--cyan-100);
  border-left: 4px solid var(--cyan);
  font-size: .9375rem;
  line-height: 1.5;
}

.document-meta {
  display: grid;
  grid-template-columns: minmax(100px, .7fr) minmax(0, 2fr);
  gap: 7px 14px;
  margin: 0 0 34px;
  padding: 16px;
  color: var(--text-muted);
  background: var(--surface-2);
  border-block: 1px solid var(--border);
  font-size: .875rem;
  line-height: 1.45;
}
.document-meta dt { font-weight: 700; }
.document-meta dd { margin: 0; overflow-wrap: anywhere; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover, a:active { color: var(--navy); }

.legal-body { max-width: 72ch; }
.legal-section {
  position: relative;
  scroll-margin-top: calc(var(--header-height) + 16px);
  overflow-wrap: anywhere;
}
.legal-section + .legal-section { margin-top: 2.4rem; }
.legal-section h2 {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 0 0 .55rem;
  color: var(--navy-700);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
}
.section-permalink {
  flex: 0 0 auto;
  color: var(--link);
  font-size: .9375rem;
  font-weight: 650;
  text-decoration: none;
}
.section-permalink:hover { text-decoration: underline; }
.legal-section p { margin: 0 0 1rem; }
.legal-section ul { margin: 0 0 1rem; padding-left: 1.35rem; }
.legal-section li + li { margin-top: .5rem; }
.legal-section.is-target { background: var(--cyan-100); outline: 2px solid var(--cyan); outline-offset: 6px; }

.toc-panel {
  position: sticky;
  top: var(--header-height);
  max-height: calc(100dvh - var(--header-height));
  overflow: auto;
  padding-block: 40px 48px;
  padding-left: 20px;
  border-left: 1px solid var(--border);
}
.toc-panel h2 { margin: 0 0 12px; color: var(--navy); font-size: 1rem; line-height: 1.35; }
.toc-panel ol, .mobile-toc ol { margin: 0; padding: 0; list-style: none; border-left: 2px solid var(--border); }
.toc-panel a, .mobile-toc a {
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 6px 10px;
  color: var(--text-muted);
  font-size: .875rem;
  line-height: 1.4;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.toc-panel a:hover, .mobile-toc a:hover { color: var(--navy); }
.toc-panel a.is-active, .mobile-toc a.is-active {
  margin-left: -2px;
  color: var(--navy);
  border-left: 3px solid var(--navy);
  font-weight: 700;
}
.mobile-toc { display: none; }

.results-heading {
  margin: 0 0 24px;
  color: var(--navy);
  font-size: 1.5rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.results-count { display: block; margin-top: 4px; color: var(--text-muted); font-size: .9375rem; font-weight: 500; }
.results-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.results-list li { border-bottom: 1px solid var(--border); }
.error-page {
  flex: 1;
  padding-block: 64px 96px;
}
.error-page h1 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: 1.75rem;
  line-height: 1.25;
}
.error-page p { max-width: 60ch; }

.result-link { display: block; width: 100%; padding: 14px 16px; color: inherit; text-decoration: none; }
.result-link:hover { background: var(--surface-2); }
.result-identity, .result-heading, .result-excerpt { display: block; width: 100%; overflow-wrap: anywhere; }
.result-identity { color: var(--text-muted); font-size: .8125rem; line-height: 1.35; }
.result-heading { margin-top: 3px; color: var(--navy); font-size: 1rem; font-weight: 700; line-height: 1.4; }
.result-excerpt { margin-top: 5px; font-size: .9375rem; line-height: 1.5; }
mark { padding: 0 1px; color: var(--navy); background: var(--cyan-100); }
.search-hint { color: var(--text-muted); }
.inline-clear { min-height: 44px; padding: 8px 14px; color: var(--navy); background: var(--surface); border: 1px solid var(--navy); border-radius: 3px; font-weight: 650; cursor: pointer; }
.inline-clear:hover { color: var(--surface); background: var(--navy); }

.site-footer { padding-block: 28px; color: var(--surface); background: var(--navy); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.footer-logo { width: auto; height: 32px; }
.footer-copy { max-width: 78ch; color: var(--surface); font-size: .8125rem; line-height: 1.5; text-align: right; overflow-wrap: anywhere; }
.footer-copy p { margin: 0; }
.footer-copy p + p { margin-top: 5px; }
.footer-copy .preview-note { color: var(--surface); font-weight: 700; }
.site-footer a { color: var(--footer-link); }

.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }

:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.site-footer :focus-visible, .skip-link:focus-visible { outline-color: var(--cyan); }

@media (max-width: 1199px) {
  .library-shell { grid-template-columns: 260px minmax(0, 1fr); gap: 28px; }
  .toc-panel { display: none; }
  .mobile-toc { display: block; margin-bottom: 30px; }
  .mobile-toc details { border-block: 1px solid var(--border); }
  .mobile-toc summary { min-height: 44px; padding: 9px 0; color: var(--navy); font-weight: 700; cursor: pointer; }
  .mobile-toc ol { padding-block: 5px 12px; }
}

@media (max-width: 767px) {
  :root { --header-height: 0px; }
  html { scroll-behavior: auto; }
  .shell { width: min(calc(100% - 32px), var(--shell)); }
  .site-header { position: static; }
  .header-row { min-height: 68px; gap: 12px; flex-wrap: wrap; }
  .brand-logo { height: 30px; }
  .site-title { font-size: 1.0625rem; }
  .header-row > .language-nav { display: flex; width: 100%; justify-content: flex-end; }
  .search-row { padding-bottom: 12px; }
  .search-help { font-size: .75rem; }
  .library-shell { display: block; width: 100%; }
  .document-nav { position: static; max-height: none; padding: 0; overflow: visible; background: var(--surface); border-right: 0; border-bottom: 1px solid var(--border); }
  .documents-toggle {
    display: flex;
    width: 100%;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    color: var(--navy);
    background: var(--surface-2);
    border: 0;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
  }
  .toggle-state { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border: 1px solid var(--border); font-size: 1.25rem; line-height: 1; }
.toggle-state svg { width: 18px; height: 18px; }
  .document-nav-content { display: none; padding: 16px; background: var(--surface-2); }
  .document-nav.is-open .document-nav-content { display: block; }
  .document-nav.is-open .toggle-state { transform: rotate(180deg); }
  .mobile-language { display: none; }
  .mobile-language a { min-height: 44px; }
  .catalogue-group + .catalogue-group { margin-top: 24px; }
  .catalogue-heading { margin-inline: 0; }
  .catalogue-note { margin-inline: 0; }
  .catalogue-section + .catalogue-section { margin-top: 18px; }
  .catalogue-section h3 { margin-inline: 0; }
  .catalogue-family { padding-inline: 0; }
  .locale-list a, .locale-status { min-height: 48px; padding-inline: 10px; }
  .content-column { width: 100%; }
  .reading-pane, .search-results { width: 100%; padding: 28px 16px 56px; }
  .document-pane, .legal-body { width: 100%; max-width: 72ch; }
  .document-pane h1 { font-size: 1.625rem; }
  .document-meta { grid-template-columns: 1fr; gap: 2px; padding: 14px; }
  .document-meta dd { margin-bottom: 8px; }
  .document-meta dd:last-child { margin-bottom: 0; }
  .legal-section h2 { font-size: 1.25rem; }
  .results-heading { font-size: 1.35rem; }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 14px; }
  .footer-copy { width: 100%; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}
.mobile-documents { display: none; }
.entry-content { max-width: 72ch; }
.page-intro { margin-bottom: 36px; }
.page-intro h1, .entry-content > h1, .search-fallback > h1 {
  margin: 0 0 14px;
  color: var(--navy);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.page-intro p { max-width: 60ch; margin: 0; }
.entry-group { margin-top: 30px; }
.entry-group h2 {
  margin: 0 0 10px;
  color: var(--navy-700);
  font-size: 1.3rem;
  line-height: 1.3;
}
.entry-group ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.entry-group li { border-bottom: 1px solid var(--border); }
.entry-group a {
  display: block;
  min-height: 48px;
  padding: 11px 14px;
  color: var(--link);
  font-weight: 650;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.entry-group a:hover { color: var(--navy); background: var(--surface-2); }
.search-fallback > p { margin-bottom: 28px; }
.minimal-page {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
  background: var(--surface-2);
}
.chooser {
  width: min(100%, 620px);
  padding: clamp(28px, 6vw, 64px);
  text-align: center;
  background: var(--surface);
  border-top: 5px solid var(--cyan);
  box-shadow: 0 12px 35px rgba(11, 37, 69, .12);
}
.chooser img { width: auto; height: 48px; margin: 0 auto 30px; }
.chooser h1 { margin: 0 0 12px; color: var(--navy); font-size: clamp(1.8rem, 5vw, 2.8rem); line-height: 1.2; }
.chooser p { margin-bottom: 28px; }
.chooser-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.chooser-links a {
  display: inline-flex;
  min-width: 150px;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  color: var(--surface);
  background: var(--navy);
  font-weight: 700;
  text-decoration: none;
}
.chooser-links a:hover { background: var(--navy-700); }
.error-page { padding-block: clamp(28px, 6vw, 56px); }

@media (max-width: 767px) {
  .document-nav { padding: 0; }
  .desktop-documents { display: none; }
  .mobile-documents { display: block; }
  .mobile-documents summary {
    min-height: 52px;
    padding: 12px 16px;
    color: var(--navy);
    background: var(--surface-2);
    font-weight: 700;
    cursor: pointer;
  }
  .mobile-documents-content { padding: 16px; background: var(--surface-2); }
  .mobile-documents-content .catalogue-group + .catalogue-group { margin-top: 24px; }
  .mobile-documents-content .catalogue-heading { margin-inline: 0; }
  .mobile-documents-content .catalogue-family { padding-inline: 0; }
}

@media print {
  .site-header,
  .document-nav,
  .toc-panel,
  .mobile-toc,
  .site-footer,
  .skip-link,
  .search-results {
    display: none !important;
  }
  .library-shell {
    display: block;
    width: 100%;
  }
  .reading-pane {
    padding: 0;
  }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: .8em;
    overflow-wrap: anywhere;
  }
}
