:root {
  --navy: #173b57;
  --navy-dark: #102a3d;
  --blue: #25638f;
  --blue-light: #eaf3f8;
  --ink: #17212b;
  --muted: #5e6a75;
  --line: #dce3e8;
  --surface: #ffffff;
  --surface-soft: #f6f8fa;
  --max-content: 760px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; line-height: 1.65; }
a {
  color: var(--blue);
  &:hover {
    color: var(--navy-dark);
  }
}

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .65rem 1rem; background: #fff; border: 2px solid var(--navy); }
.skip-link:focus { top: 1rem; }
.site-header { height: 68px; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 1.25rem; background: var(--navy-dark); color: #fff; border-bottom: 1px solid rgba(255,255,255,.14); }
.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  &:hover {
    color: #fff;
    .brand-name {
      text-decoration: underline
    }
  }
}
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.5); border-radius: 8px; font-size: .72rem; letter-spacing: .08em; }

.header-actions { display: flex; gap: .5rem; }
.header-actions button { border: 1px solid rgba(255,255,255,.4); border-radius: 6px; background: transparent; color: #fff; padding: .45rem .75rem; cursor: pointer; }
.menu-button { display: none; }
.sidebar-toggle { display: inline-block; }
.site-shell { display: grid; grid-template-columns: minmax(230px, 285px) minmax(0, 1fr) minmax(190px, 245px); min-height: calc(100vh - 68px); }
.left-sidebar, .right-sidebar { position: sticky; top: 68px; height: calc(100vh - 68px); overflow-y: auto; background: var(--surface-soft); }
.left-sidebar { border-right: 1px solid var(--line); padding: 1.5rem 1rem 3rem; transition: width .2s ease, padding .2s ease, opacity .15s ease; }
.sidebar-collapsed .site-shell { grid-template-columns: 0 minmax(0, 1fr) minmax(190px, 245px); }
.sidebar-collapsed .left-sidebar { width: 0; padding-inline: 0; overflow: hidden; opacity: 0; border-right: 0; }
.right-sidebar { border-left: 1px solid var(--line); padding: 2rem 1.25rem; }
.nav-section + .nav-section { margin-top: 1.5rem; }
.nav-heading, .toc-wrap h2 { margin: 0 0 .45rem; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sidebar-nav ul, [data-toc] ul { list-style: none; padding: 0; margin: 0; }
.sidebar-nav a { display: block; padding: .42rem .65rem; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: .94rem; }
.sidebar-nav a:hover { background: var(--blue-light); }
.sidebar-nav a[aria-current="page"] { background: #dbeaf3; color: var(--navy-dark); font-weight: 700; }
.content { min-width: 0; padding: 1.6rem clamp(1.25rem, 5vw, 4.5rem) 3rem; }
.breadcrumbs { max-width: var(--max-content); margin: 0 auto 1.8rem; display: flex; gap: .5rem; font-size: .85rem; color: var(--muted); }
.breadcrumbs a { color: inherit; }
.document, .content-footer { max-width: var(--max-content); margin-inline: auto; }
.document-header { padding-bottom: 1.4rem; border-bottom: 1px solid var(--line); margin-bottom: 2rem; }
h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.08; letter-spacing: -.025em; color: var(--navy-dark); }
.lede { margin: 1rem 0 0; font-size: 1.15rem; color: var(--muted); }
.updated { margin: .8rem 0 0; font-size: .82rem; color: var(--muted); }
.prose h2 { margin-top: 2.7rem; padding-top: .5rem; font-size: 1.55rem; line-height: 1.25; color: var(--navy-dark); }
.prose h3 { margin-top: 2rem; font-size: 1.17rem; color: var(--navy-dark); }
.prose p, .prose li { max-width: 72ch; }
.prose blockquote { margin: 1.5rem 0; padding: .8rem 1.1rem; border-left: 4px solid var(--blue); background: var(--blue-light); }
.prose table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: .65rem .75rem; text-align: left; }
.callout { padding: 1rem 1.1rem; background: var(--blue-light); border: 1px solid #bfd6e5; border-radius: 8px; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; margin: 1.5rem 0; }
.card { display: block; padding: 1.1rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: inherit; }
.card:hover { border-color: var(--blue); box-shadow: 0 5px 18px rgba(16,42,61,.08); }
.card strong { display: block; color: var(--navy-dark); }
.card span { display: block; margin-top: .35rem; color: var(--muted); font-size: .9rem; }
.content-footer { margin-top: 4rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
[data-toc] a { display: block; padding: .3rem 0; color: var(--muted); text-decoration: none; font-size: .85rem; line-height: 1.35; }
[data-toc] a:hover { color: var(--blue); }
.toc-subitem { padding-left: .75rem; }
.search-dialog { width: min(620px, calc(100% - 2rem)); border: 0; border-radius: 10px; padding: 0; box-shadow: 0 22px 70px rgba(0,0,0,.25); }
.search-dialog::backdrop { background: rgba(9,25,36,.62); }
.search-panel { padding: 1rem; }
.search-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; font-weight: 700; }
.search-header button { border: 0; background: none; font-size: 1.5rem; cursor: pointer; }
.search-panel input { width: 100%; padding: .8rem; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.search-results { display: grid; gap: .35rem; margin-top: .8rem; }
.search-results a { padding: .65rem; border-radius: 6px; text-decoration: none; color: inherit; }
.search-results a:hover { background: var(--surface-soft); }
.search-results span { display: block; color: var(--muted); font-size: .78rem; }
@media (max-width: 1050px) {
  .site-shell { grid-template-columns: 250px minmax(0, 1fr); }
  .sidebar-collapsed .site-shell { grid-template-columns: 0 minmax(0, 1fr); }
  .right-sidebar { display: none; }
}
@media (max-width: 760px) {
  .sidebar-toggle { display: none; }
  .brand-name { font-size: .9rem; }
  .menu-button { display: inline-block; }
  .site-shell, .sidebar-collapsed .site-shell { display: block; }
  .left-sidebar, .sidebar-collapsed .left-sidebar { position: fixed; width: min(310px, 88vw); padding: 1.5rem 1rem 3rem; opacity: 1; border-right: 1px solid var(--line); z-index: 25; top: 68px; left: 0; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 8px 0 30px rgba(0,0,0,.15); }
  .menu-open .left-sidebar { transform: translateX(0); }
  .content { padding-inline: 1.15rem; }
  .card-grid { grid-template-columns: 1fr; }
}
