:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --ink: #102033;
  --muted: #64748b;
  --line: #d9e2ee;
  --accent: #0f6f8f;
  --accent-2: #1aa6a6;
  --accent-soft: #e4f7f7;
  --danger: #b42318;
  --shadow: 0 20px 60px rgba(16, 32, 51, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  letter-spacing: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: #0b526a;
}

img {
  max-width: 100%;
  display: block;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(240px, 680px) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  min-width: 0;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #10243f;
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.header-search,
.hero-search {
  position: relative;
}

.search-input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 111, 143, 0.13);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: none;
  max-height: 420px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 60;
}

.search-results.open {
  display: block;
}

.search-result {
  display: block;
  padding: 12px;
  border-radius: 6px;
  color: var(--ink);
}

.search-result:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.search-result span {
  display: block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-result strong {
  display: block;
  margin-top: 2px;
}

.search-result p,
.empty-search {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.header-links {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 32px;
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.sidebar {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.sidebar a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: #334155;
  font-size: 14px;
  font-weight: 650;
}

.sidebar a:hover,
.sidebar a.active {
  color: var(--ink);
  background: var(--accent-soft);
}

.sidebar-home {
  margin-bottom: 10px;
}

.nav-group {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.nav-group-title {
  padding: 0 10px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.content {
  min-width: 0;
}

.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.hero,
.doc-intro,
section {
  margin-bottom: 42px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 34px;
  align-items: center;
  padding: 34px;
  background: linear-gradient(135deg, #ffffff 0%, #eff7f8 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.18;
  letter-spacing: 0;
}

h1 {
  max-width: 900px;
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 850;
}

.doc-page h1 {
  font-size: clamp(32px, 4vw, 52px);
}

h2 {
  margin-top: 42px;
  margin-bottom: 16px;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
}

h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 800;
}

.lead {
  max-width: 820px;
  margin: 16px 0 0;
  color: #42526a;
  font-size: 19px;
  line-height: 1.55;
}

.updated {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.hero-search {
  margin-top: 28px;
}

.hero-search-input {
  height: 54px;
  font-size: 16px;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.quick-links a {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 750;
}

.quick-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-media,
.doc-figure {
  margin: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.hero-media img,
.doc-figure img {
  width: 100%;
}

figcaption {
  padding: 10px 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
}

.doc-figure {
  margin: 24px 0;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2 {
  margin-top: 0;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.chapter-card,
.howto-card,
.reference-card {
  display: block;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.chapter-card:hover,
.howto-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 111, 143, 0.45);
  box-shadow: 0 14px 32px rgba(16, 32, 51, 0.08);
  color: var(--ink);
}

.chapter-card span,
.howto-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chapter-card strong,
.howto-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

.chapter-card p,
.howto-card p,
.reference-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.howto-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 28px;
}

.reference-card h3 {
  font-size: 16px;
}

.steps {
  counter-reset: step;
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 18px 0 28px;
  list-style: none;
}

.steps li {
  position: relative;
  padding: 14px 16px 14px 48px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 14px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.checklist {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 18px 0 28px;
  list-style: none;
}

.checklist li {
  padding: 12px 14px;
  background: var(--surface);
  border-left: 4px solid var(--accent-2);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

table {
  width: 100%;
  margin: 18px 0 30px;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #eef5f8;
  color: #23364d;
  font-size: 13px;
  font-weight: 850;
}

td {
  color: #334155;
  font-size: 14px;
}

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

.doc-intro {
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.content > p,
.content section > p {
  max-width: 900px;
  color: #334155;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto 28px;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  margin: 6px 0 0;
  max-width: 620px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: flex-end;
  font-weight: 700;
}

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

  .header-links {
    justify-content: flex-start;
  }

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

  .sidebar {
    position: static;
    max-height: none;
    display: flex;
    gap: 12px;
    overflow-x: auto;
  }

  .sidebar-home,
  .nav-group {
    min-width: 210px;
  }

  .nav-group {
    border-top: 0;
    border-left: 1px solid var(--line);
    padding: 0 0 0 12px;
  }

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

  .chapter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-header {
    padding: 12px 16px;
  }

  .shell,
  .site-footer {
    width: min(100% - 24px, 1480px);
  }

  .shell {
    padding-top: 18px;
    gap: 18px;
  }

  .hero,
  .doc-intro {
    padding: 20px;
  }

  h1,
  .doc-page h1 {
    font-size: 34px;
  }

  .lead {
    font-size: 17px;
  }

  .chapter-grid,
  .howto-grid,
  .reference-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .site-footer {
    display: block;
  }

  .footer-links {
    justify-content: flex-start;
    margin-top: 14px;
  }
}
