:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --paper: #ffffff;
  --ink: #202124;
  --muted: #666b70;
  --line: #d8d9d6;
  --soft: #ecebe7;
  --accent: #165c5f;
  --accent-soft: #e4eeee;
  --warn: #7a4b00;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--accent);
}

code {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.08rem 0.28rem;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.92em;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 2rem;
  padding: 2rem clamp(1rem, 4vw, 3rem);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.document-label {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  line-height: 1.22;
  letter-spacing: 0;
}

h1 {
  max-width: 980px;
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.65rem);
}

.subtitle {
  max-width: 860px;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.meta {
  align-self: start;
  margin: 0;
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.meta div {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 0.7rem;
}

.meta dt {
  color: var(--muted);
  font-size: 0.84rem;
}

.meta dd {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: calc(100vh - 260px);
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 1.25rem;
  background: #efefec;
  border-right: 1px solid var(--line);
}

.brand {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.nav-toggle {
  display: none;
}

.nav-list {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-section {
  margin: 1rem 0 0.25rem;
  padding: 0.55rem 0.65rem 0.35rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
}

.nav-section:first-child {
  margin-top: 0;
}

.nav-section span {
  display: block;
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
  text-transform: none;
}

.nav-list a {
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
}

.nav-list a:hover,
.nav-list a:focus,
.nav-list a.is-active {
  background: var(--accent-soft);
  color: #0d4e51;
  outline: none;
}

.sidebar-note {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.content {
  width: min(100%, 1100px);
  margin: 0 auto;
  padding: 2rem clamp(1rem, 4vw, 3rem) 3rem;
}

.intro,
.document {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(1.25rem, 3vw, 2.2rem);
  box-shadow: var(--shadow);
}

.document h1:first-child {
  margin-top: 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--line);
  font-size: clamp(1.55rem, 2.4vw, 2.2rem);
}

.document h2,
.intro h2 {
  margin-top: 2rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
  font-size: 1.35rem;
}

.document h3,
.intro h3 {
  margin-top: 1.4rem;
  font-size: 1.08rem;
}

.document ul,
.document ol {
  padding-left: 1.45rem;
}

.document li,
.intro li {
  margin: 0.22rem 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1.2rem;
}

.summary-grid article {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.95rem;
  background: #fbfbfa;
}

.summary-grid h3 {
  margin: 0 0 0.35rem;
}

.summary-grid p {
  margin: 0;
  color: var(--muted);
}

.search-panel {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfbfa;
}

.search-panel h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.search-form label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 700;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
}

.search-row input {
  min-width: 0;
  padding: 0.72rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.search-row input:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent-soft);
}

.search-row button {
  padding: 0.72rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
}

.search-status,
.muted {
  color: var(--muted);
}

.search-status {
  margin: 0.75rem 0 0;
  font-size: 0.92rem;
}

.search-results {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.search-result {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.search-result h3 {
  margin: 0 0 0.3rem;
}

.search-result p {
  margin: 0.3rem 0 0;
}

.search-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.doc-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.doc-toolbar a {
  font-weight: 700;
  text-decoration: none;
}

.error {
  color: var(--warn);
  font-weight: 700;
}

.raw-document {
  width: 100%;
  min-height: 62vh;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--paper);
  font-size: 0.9rem;
}

@media (max-width: 860px) {
  .site-header {
    grid-template-columns: 1fr;
  }

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

  .sidebar {
    position: static;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-toggle {
    display: inline-flex;
    width: 100%;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
    color: var(--ink);
    font: inherit;
    font-weight: 700;
  }

  .nav-list {
    display: none;
  }

  .nav-list.is-open {
    display: grid;
  }

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

  .search-row {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media print {
  :root {
    --bg: #ffffff;
    --paper: #ffffff;
    --ink: #000000;
    --muted: #333333;
    --line: #999999;
    --shadow: none;
  }

  body {
    font-size: 11pt;
  }

  .site-header,
  .layout,
  .content,
  .intro,
  .document {
    display: block;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .sidebar,
  .nav-toggle,
  .site-footer {
    display: none;
  }

  .site-header {
    margin-bottom: 1.2rem;
  }

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

  h1,
  h2,
  h3 {
    break-after: avoid;
  }
}
