:root {
  color-scheme: light;
  --paper: #f6f4ee;
  --white: #fff;
  --ink: #162b3f;
  --muted: #4d6171;
  --line: #dce3e7;
  --navy: #0e263d;
  --orange: #f4a54a;
  --green: #186a5f;
  --rail: 268px;
  --header: 66px;
  font-family: "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
[hidden] { display: none !important; }
button, input { font: inherit; }
a { color: #174e83; }
a:hover { color: #873e05; }
:focus-visible { outline: 3px solid #208982; outline-offset: 4px; }
img { display: block; max-width: 100%; height: auto; }
.wrap { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.skip { position: fixed; z-index: 10; left: 12px; top: -60px; padding: 10px 14px; background: var(--white); }
.skip:focus { top: 10px; }

.site-head {
  position: sticky; top: 0; z-index: 5; background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line);
}
.head-row { display: flex; align-items: center; justify-content: space-between; min-height: var(--header); gap: 16px; }
.brand, .head-row nav a { text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 1.09rem; font-weight: 730; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 9px; background: #138c97; color: white; font-size: .8rem; letter-spacing: .02em; }
.brand strong { color: #ab4b05; }
.head-row nav { display: flex; gap: 21px; font-size: .91rem; }
.head-row nav a { color: var(--ink); }
.head-row nav a:hover { text-decoration: underline; text-underline-offset: 5px; }

.hero { padding: 49px 0 45px; color: var(--white); background: radial-gradient(ellipse at 83% 30%, #26485b, transparent 50%), var(--navy); }
.hero-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: center; gap: clamp(28px, 6vw, 78px); }
.product { margin: 0 0 11px; color: #92dbd2; font-size: .86rem; font-weight: 700; letter-spacing: .04em; }
h1 { margin: 0; font-size: clamp(2.6rem, 6.3vw, 5rem); line-height: .99; font-weight: 750; letter-spacing: -.065em; }
.hero-lead { margin: 20px 0 24px; max-width: 35ch; color: #d6e3ed; font-size: 1.03rem; line-height: 1.6; }
.hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 15px; font-size: .83rem; color: #c1d2e0; }
.hero-meta a { display: inline-flex; min-height: 41px; align-items: center; padding: 8px 13px; border-radius: 7px; background: var(--orange); color: #382207; font-weight: 720; text-decoration: none; }
.hero-meta a:hover { background: #ffbc69; }
.hero-view { margin: 0; padding: 7px; border: 1px solid #5c7889; border-radius: 12px; background: #dce8ef; box-shadow: 0 15px 37px #07172470; }
.hero-view img { width: 100%; border-radius: 6px; aspect-ratio: 1360 / 767; object-fit: cover; }

.doc-layout { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); gap: 28px; align-items: start; padding-block: 28px 56px; }
.sidebar { position: sticky; top: calc(var(--header) + 20px); min-width: 0; max-height: calc(100dvh - var(--header) - 39px); overflow: auto; scrollbar-width: thin; }
.toc { padding: 9px 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.toc > summary { padding: 7px 8px 10px; font-size: 1rem; font-weight: 730; cursor: pointer; }
.toc nav { padding: 2px; }
.toc-label { margin: 13px 7px 4px; color: var(--green); font-size: .76rem; font-weight: 750; }
.toc ul { margin: 0; padding: 0; list-style: none; }
.toc a { display: block; padding: 6px 8px; border-left: 2px solid transparent; border-radius: 4px; color: var(--ink); text-decoration: none; font-size: .88rem; line-height: 1.3; }
.toc a:hover, .toc a[aria-current] { background: #eef7f4; color: #14584c; border-left-color: #239889; }
.reader { min-width: 0; }
.search { padding: 15px 19px; margin-bottom: 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.search label { display: block; margin: 0 0 8px; font-size: .96rem; font-weight: 720; }
.search-row { display: flex; align-items: center; gap: 8px; }
.search input { min-width: 0; width: 100%; min-height: 45px; padding: 9px 12px; border: 1px solid #a9bac6; border-radius: 7px; color: var(--ink); background: #fbfcfd; }
.clear-search { min-height: 44px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--white); cursor: pointer; }
.search-result-list { margin: 7px 0 0; padding: 0; list-style: none; }
.search-result-list a { display: block; padding: 9px 4px; border-bottom: 1px solid var(--line); text-decoration: none; }
.search-result-list a:hover strong { text-decoration: underline; }
.search-result-list span { display: block; margin-top: 3px; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.search-status { margin: 10px 0 0; color: var(--muted); font-size: .88rem; }

.chapter { padding: clamp(19px, 4vw, 37px); margin-bottom: 17px; scroll-margin-top: calc(var(--header) + 15px); border: 1px solid var(--line); border-radius: 13px; background: var(--white); }
.chapter:last-child { margin-bottom: 0; }
.chapter:target { border-color: #69a69d; }
.chapter-category { margin: 0 0 5px; color: var(--green); font-size: .81rem; font-weight: 730; }
.chapter h2 { margin: 0; font-size: clamp(1.62rem, 3.4vw, 2.32rem); line-height: 1.1; letter-spacing: -.039em; }
.chapter h3 { margin: 25px 0 7px; font-size: 1.2rem; line-height: 1.28; }
.chapter .chapter-intro { margin: 10px 0 19px; color: var(--muted); font-size: 1rem; }
.chapter p, .chapter li, .chapter dd { line-height: 1.62; }
.chapter ol, .chapter ul { margin: 7px 0 15px; padding-left: 1.45em; }
.chapter li { padding-left: .2em; margin-bottom: 5px; }
.chapter li::marker { color: var(--green); font-weight: 700; }
.chapter strong { font-weight: 720; }
.chapter p { margin: 9px 0; }
.table-wrap { margin: 17px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .92rem; line-height: 1.47; }
th, td { padding: 10px 12px; vertical-align: top; overflow-wrap: anywhere; }
thead { background: #edf2f6; color: var(--navy); }
tbody th { width: 32%; color: var(--ink); font-weight: 700; }
tbody tr { border-top: 1px solid var(--line); }
tbody tr:nth-child(even) { background: #f8fafb; }
.callout { margin: 19px 0 4px; padding: 12px 15px; border-left: 4px solid #2a9a83; border-radius: 0 7px 7px 0; background: #eff8f5; }
.callout strong { color: #155a4f; }
.callout p { margin: 4px 0 0; }
.chapter .flow { display: flex; flex-wrap: wrap; gap: 5px; margin: 17px 0; padding: 0; list-style: none; }
.chapter .flow li { flex: 1 0 auto; margin: 0; padding: 8px; border-radius: 4px; text-align: center; color: #215a53; background: #edf7f5; font-size: .85rem; font-weight: 720; }
.chapter figure { margin: 16px 0 20px; }
.chapter figure img { width: 100%; border: 1px solid var(--line); border-radius: 7px; }
.chapter figcaption { margin: 7px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.chapter figcaption a { white-space: nowrap; }
.footer { padding: 19px 0 24px; border-top: 1px solid var(--line); background: #fffcf6; color: var(--muted); font-size: .88rem; }
.footer .wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 11px 22px; justify-content: space-between; }

.image-dialog { width: min(1300px, 95vw); max-height: 94dvh; padding: 0; border: 0; border-radius: 12px; background: var(--white); color: var(--ink); overflow: auto; }
.image-dialog::backdrop { background: #081725cc; }
.image-dialog .dialog-heading { margin: 0; padding: 13px 15px; }
.image-dialog img { width: 100%; height: auto; }
.image-dialog form { display: flex; justify-content: flex-end; padding: 8px 12px; }
.image-dialog button { min-height: 40px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--line); background: #edf2f6; color: var(--ink); cursor: pointer; }

@media (max-width: 820px) {
  :root { --header: 61px; }
  .wrap { width: min(100% - 30px, 680px); }
  .hero-layout, .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-block: 33px 27px; }
  .hero-layout { gap: 23px; }
  .hero-lead { max-width: 54ch; margin: 14px 0 17px; }
  .hero-view { width: min(100%, 510px); }
  .doc-layout { gap: 15px; padding-top: 16px; }
  .sidebar { position: static; max-height: none; }
  .toc nav { max-height: 58dvh; overflow: auto; }
}
@media (max-width: 393px) {
  .head-row nav { gap: 11px; }
  .head-row .head-home { display: none; }
  .search { padding: 13px; }
  th, td { padding: 8px; }
}
@media print {
  .site-head, .hero-view, .sidebar, .search, .footer, .skip { display: none; }
  body, .hero, .chapter { background: white; color: black; }
  .doc-layout, .hero-layout { display: block; }
  .wrap { width: 100%; }
  .hero, .chapter { padding: 12px 0; }
  .hero-lead, .hero-meta, .product { color: black; }
  .chapter { border: 0; }
  h2, h3 { break-after: avoid; }
  tr, figure, .callout { break-inside: avoid; }
}
