:root {
  --navy: #1d3041;
  --navy-dark: #142432;
  --red: #a21f25;
  --cream: #f4f1e8;
  --white: #ffffff;
  --text: #1f2933;
  --muted: #687782;
  --border: #d9dee3;
  --background: #f5f6f7;
  --soft-blue: #eaf0f4;
  --soft-red: #f8e9ea;
  --soft-green: #edf5f0;
  --soft-yellow: #fff6dc;
  --success: #2f6c4f;
  --shadow: 0 8px 24px rgba(20, 36, 50, 0.08);
  --header-height: 78px;
  --sidebar-width: 292px;
  --rail-width: 250px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--white);
  color: var(--text);
  line-height: 1.62;
}

button,
input {
  font: inherit;
}

a {
  color: var(--red);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #7f171c;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(162, 31, 37, 0.28);
  outline-offset: 2px;
}

.siteBar {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-height);
  background: var(--navy);
  border-bottom: 5px solid var(--red);
}

.siteBarInner {
  width: 100%;
  min-height: calc(var(--header-height) - 5px);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  color: var(--white);
  text-decoration: none;
}

.brand:hover {
  color: var(--white);
}

.brandMark {
  width: 45px;
  height: 45px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: var(--white);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brandWords strong,
.brandWords small {
  display: block;
}

.brandWords strong {
  font-size: 20px;
  line-height: 1.15;
}

.brandWords small {
  margin-top: 3px;
  color: #d7e0e6;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.headerActions {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(620px, 48vw);
}

.searchWrap {
  position: relative;
  flex: 1;
}

.searchWrap input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 13px;
  background: var(--white);
  color: var(--text);
}

.searchWrap input::placeholder {
  color: #74818a;
}

.searchResults {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(520px, 70vh);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.searchResultLink {
  display: block;
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.searchResultLink:last-child {
  border-bottom: 0;
}

.searchResultLink:hover,
.searchResultLink:focus-visible {
  background: var(--soft-blue);
  color: var(--text);
}

.searchResultLink strong,
.searchResultLink span {
  display: block;
}

.searchResultLink span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.searchEmpty {
  padding: 14px;
  color: var(--muted);
}

.menuButton {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  padding: 9px 13px;
  background: transparent;
  color: var(--white);
  cursor: pointer;
}

.wikiLayout {
  width: 100%;
  min-height: calc(100vh - var(--header-height));
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--rail-width);
  align-items: stretch;
}

.wikiSidebar {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: #f7f8f9;
}

.sidebarHeading {
  padding: 18px 18px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.treeNavigation {
  padding: 0 10px 18px;
}

.navHome {
  display: block;
  margin: 0 0 6px;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
}

.navHome:hover,
.navHome.active {
  background: var(--navy);
  color: var(--white);
}

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

.treeChildren > .treeList {
  margin-left: 16px;
  padding-left: 8px;
  border-left: 1px solid #cfd7dc;
}

.treeRow {
  min-height: 34px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
}

.treeToggle {
  width: 24px;
  height: 32px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.treeToggle span {
  display: inline-block;
  font-size: 22px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 120ms ease;
}

.treeToggle[aria-expanded="true"] span {
  transform: rotate(90deg);
}

.treeSpacer {
  width: 24px;
}

.treeLink {
  display: block;
  margin: 1px 0;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
}

.treeLink:hover {
  background: var(--soft-blue);
  color: var(--navy);
}

.treeLink.active {
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
}

.treeItem.activeBranch > .treeRow > .treeLink:not(.active) {
  color: var(--navy);
  font-weight: 700;
}

.sidebarFooter {
  margin-top: 10px;
  padding: 15px 18px 22px;
  border-top: 1px solid var(--border);
  background: var(--cream);
}

.sidebarFooter a,
.sidebarFooter span {
  display: block;
}

.sidebarFooter a {
  font-weight: 700;
}

.sidebarFooter span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.mainContent {
  min-width: 0;
  padding: 22px clamp(24px, 3vw, 54px) 64px;
  background: var(--white);
}

.breadcrumbs {
  min-height: 27px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumbs a {
  color: var(--muted);
}

.breadcrumbSeparator {
  margin: 0 8px;
  color: #9ba6ad;
}

.wikiArticle {
  width: 100%;
  min-height: 560px;
}

.articleHeader {
  padding: 4px 0 24px;
  border-bottom: 1px solid var(--border);
}

.articleKicker {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.articleHeader h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.articleSummary {
  max-width: 1000px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.5;
}

.articleMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 13px;
}

.homeHeader {
  position: relative;
  overflow: hidden;
  margin: -22px clamp(-54px, -3vw, -24px) 0;
  padding: clamp(42px, 6vw, 84px) clamp(24px, 4vw, 64px);
  border-bottom: 0;
  background: var(--navy);
  color: var(--white);
}

.homeHeader::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -170px;
  width: 410px;
  height: 410px;
  border: 74px solid rgba(255, 255, 255, 0.045);
  border-radius: 50%;
}

.homeHeader .articleKicker {
  color: #efc7c9;
}

.homeHeader h1 {
  position: relative;
  z-index: 1;
  color: var(--white);
  font-size: clamp(42px, 6vw, 76px);
}

.homeHeader .articleSummary {
  position: relative;
  z-index: 1;
  max-width: 900px;
  color: #dce6eb;
  font-size: clamp(19px, 2vw, 23px);
}

.homeHeader .articleMeta {
  position: relative;
  z-index: 1;
  color: #d0dce3;
}

.homeHeader .articleMeta a {
  color: #f2d5d6;
}

.articleBody {
  margin-top: 30px;
  font-size: 16px;
}

.articleBody > p,
.articleBody > ul,
.articleBody > ol,
.articleBody > blockquote,
.articleBody > pre {
  max-width: 1040px;
}

.articleBody > p:first-child {
  color: #344957;
  font-size: 19px;
}

.articleBody h2,
.articleBody h3,
.articleBody h4 {
  position: relative;
  color: var(--navy);
  scroll-margin-top: calc(var(--header-height) + 18px);
}

.articleBody h2 {
  margin: 42px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--soft-blue);
  font-size: 28px;
  line-height: 1.2;
}

.articleBody h3 {
  margin: 30px 0 9px;
  font-size: 21px;
  line-height: 1.25;
}

.articleBody h4 {
  margin: 24px 0 8px;
  font-size: 17px;
}

.headingAnchor {
  margin-left: 8px;
  color: #9aa7af;
  font-size: 0.72em;
  font-weight: 400;
  opacity: 0;
  text-decoration: none;
}

.articleBody h2:hover .headingAnchor,
.articleBody h3:hover .headingAnchor,
.articleBody h4:hover .headingAnchor,
.headingAnchor:focus-visible {
  opacity: 1;
}

.articleBody li + li {
  margin-top: 5px;
}

.articleBody hr {
  margin: 38px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.articleBody code {
  border-radius: 4px;
  padding: 2px 5px;
  background: #eef1f3;
  color: #7f171c;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
}

.articleBody pre {
  overflow-x: auto;
  padding: 16px 18px;
  border-radius: 8px;
  background: var(--navy-dark);
  color: #edf3f6;
}

.articleBody pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.articleBody blockquote {
  margin: 22px 0;
  padding: 14px 18px;
  border-left: 5px solid #9aa7af;
  background: #f5f6f7;
}

.articleBody blockquote p:first-child {
  margin-top: 0;
}

.articleBody blockquote p:last-child {
  margin-bottom: 0;
}

.callout {
  border-radius: 0 8px 8px 0;
}

.calloutLabel {
  display: block;
  margin-bottom: 4px;
  color: var(--navy);
}

.callout-note {
  border-left-color: var(--navy) !important;
  background: var(--soft-blue) !important;
}

.callout-tip {
  border-left-color: var(--success) !important;
  background: var(--soft-green) !important;
}

.callout-warning {
  border-left-color: var(--red) !important;
  background: var(--soft-red) !important;
}

.callout-source {
  border-left-color: #8a6d1e !important;
  background: var(--soft-yellow) !important;
}

.tableWrap {
  width: 100%;
  overflow-x: auto;
  margin: 22px 0 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.articleBody table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: var(--white);
}

.articleBody th,
.articleBody td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.articleBody th {
  background: var(--navy);
  color: var(--white);
  font-size: 13px;
  letter-spacing: 0.025em;
}

.articleBody tbody tr:nth-child(even) {
  background: #fafbfc;
}

.articleBody tr:last-child td {
  border-bottom: 0;
}

.childPages {
  margin-top: 42px;
}

.childPageGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.childPageCard {
  display: flex;
  min-height: 170px;
  flex-direction: column;
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--white);
  color: var(--text);
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.childPageCard:hover {
  transform: translateY(-2px);
  border-color: #b9c4cb;
  box-shadow: var(--shadow);
  color: var(--text);
}

.childPageTitle {
  color: var(--navy);
  font-size: 19px;
  font-weight: 700;
}

.childPageSummary {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
}

.childPageAction {
  margin-top: auto;
  padding-top: 14px;
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
}

.pageNavigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 52px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.pageNavigation a {
  display: block;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f7f8f9;
  color: var(--navy);
  text-decoration: none;
}

.pageNavigation a:hover {
  background: var(--soft-blue);
}

.pageNavigation small,
.pageNavigation strong {
  display: block;
}

.pageNavigation small {
  color: var(--muted);
}

.nextPage {
  text-align: right;
}

.pageRail {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 24px 18px;
  border-left: 1px solid var(--border);
  background: #fafbfc;
}

.pageToc > strong,
.pageSource > strong {
  display: block;
  margin-bottom: 9px;
  color: var(--navy);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pageToc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pageToc li + li {
  margin-top: 2px;
}

.pageToc a {
  display: block;
  padding: 5px 8px;
  border-left: 3px solid transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-decoration: none;
}

.pageToc a:hover,
.pageToc a.active {
  border-left-color: var(--red);
  color: var(--navy);
  background: var(--soft-blue);
}

.tocLevel3 a {
  padding-left: 19px;
  font-size: 12px;
}

.pageSource {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.pageSource a,
.pageSource span {
  display: block;
}

.pageSource a {
  font-size: 14px;
  font-weight: 700;
}

.pageSource span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.pageRail.tocHidden .pageSource {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.buttonLink {
  display: inline-block;
  border-radius: 7px;
  padding: 10px 14px;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
}

.buttonLink:hover {
  background: #86191e;
  color: var(--white);
}

.loadingState,
.errorState {
  display: grid;
  min-height: 480px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.errorCode {
  margin: 0;
  color: var(--red);
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
}

.siteFooter {
  position: relative;
  z-index: 5;
  border-top: 5px solid var(--red);
  background: var(--navy-dark);
  color: #d9e2e8;
}

.siteFooterInner {
  width: 100%;
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 13px;
}

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

@media (max-width: 1180px) {
  .wikiLayout {
    grid-template-columns: 270px minmax(0, 1fr);
  }

  .pageRail {
    display: none;
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 126px;
  }

  .siteBarInner {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .headerActions {
    width: 100%;
  }

  .menuButton {
    display: block;
  }

  .wikiLayout {
    display: block;
  }

  .wikiSidebar {
    position: fixed;
    z-index: 90;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: min(340px, 88vw);
    height: auto;
    display: none;
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .wikiSidebar.open {
    display: block;
  }

  .mainContent {
    padding: 20px 22px 52px;
  }

  .homeHeader {
    margin: -20px -22px 0;
  }
}

@media (max-width: 620px) {
  :root {
    --header-height: 119px;
  }

  .siteBarInner {
    padding: 10px 14px;
    gap: 10px;
  }

  .brandWords strong {
    font-size: 18px;
  }

  .brandMark {
    width: 40px;
    height: 40px;
  }

  .mainContent {
    padding: 17px 15px 46px;
  }

  .homeHeader {
    margin: -17px -15px 0;
    padding: 38px 20px 46px;
  }

  .articleHeader h1 {
    font-size: 36px;
  }

  .articleSummary,
  .articleBody > p:first-child {
    font-size: 17px;
  }

  .pageNavigation {
    grid-template-columns: 1fr;
  }

  .nextPage {
    text-align: left;
  }

  .siteFooterInner {
    flex-direction: column;
    padding: 20px 16px;
  }
}

/* Full-width wiki refinements */
.sidebarFooter strong,
.sidebarFooter span {
  display: block;
}

.sidebarFooter strong {
  color: var(--navy);
  font-size: 13px;
}

.articleSummary,
.articleBody > p,
.articleBody > ul,
.articleBody > ol,
.articleBody > blockquote,
.articleBody > pre {
  max-width: none;
}

.articleBody img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 24px auto 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.relatedPages {
  margin-top: 42px;
}

.relatedPageGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.relatedPageCard {
  display: block;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafbfc;
  color: var(--navy);
  text-decoration: none;
}

.relatedPageCard:hover {
  border-color: #b9c4cb;
  background: var(--soft-blue);
  color: var(--navy);
}

.relatedPageCard strong,
.relatedPageCard span {
  display: block;
}

.relatedPageCard span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.pageDetails {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.pageDetails > strong {
  display: block;
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pageDetails > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.pageTags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.pageTags span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--white);
  color: var(--muted);
  font-size: 11px;
}

.printPageButton {
  width: 100%;
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 12px;
  background: var(--white);
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
}

.printPageButton:hover {
  background: var(--soft-blue);
}

@media print {
  .siteBar,
  .wikiSidebar,
  .pageRail,
  .breadcrumbs,
  .siteFooter,
  .childPages,
  .relatedPages,
  .pageNavigation,
  .headingAnchor {
    display: none !important;
  }

  .wikiLayout {
    display: block;
  }

  .mainContent {
    padding: 0;
  }

  .articleHeader,
  .homeHeader {
    margin: 0;
    padding: 0 0 18px;
    background: none;
    color: #000;
  }

  .articleHeader h1,
  .homeHeader h1,
  .articleKicker,
  .articleSummary,
  .homeHeader .articleSummary,
  .articleMeta,
  .homeHeader .articleMeta {
    color: #000;
  }

  .articleBody {
    margin-top: 18px;
    font-size: 11pt;
  }

  .tableWrap {
    overflow: visible;
    border-color: #777;
  }

  .articleBody table {
    min-width: 0;
    font-size: 9pt;
  }

  a {
    color: #000;
    text-decoration: none;
  }
}
