:root {
  color-scheme: dark;
  --canvas: #111113;
  --surface: #1b1b1e;
  --surface-raised: #222225;
  --surface-control: #252528;
  --surface-sidebar: #171719;
  --text-primary: #f4f4f5;
  --text-secondary: #c4c4c9;
  --text-muted: #a1a1aa;
  --text-subtle: #909096;
  --border: #343438;
  --border-soft: #27272a;
  --focus: #c7c7cc;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); color: var(--text-primary); scroll-behavior: smooth; scrollbar-color: #45454a var(--surface-sidebar); }
body { min-width: 320px; margin: 0; background: var(--canvas); color: var(--text-primary); font-size: 14px; line-height: 1.6; }
::selection { color: var(--canvas); background: #d4d4d8; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
button, input { font: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.skip-link { position: fixed; z-index: 50; top: 8px; left: 8px; padding: 10px 14px; transform: translateY(-150%); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-raised); color: var(--text-primary); }
.skip-link:focus { transform: translateY(0); }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; height: 64px; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 4vw, 56px); border-bottom: 1px solid var(--border-soft); background: #111113; }
.brand { display: inline-flex; min-width: 0; align-items: center; gap: 10px; color: var(--text-primary); font-size: 16px; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
.brand img { display: block; width: 28px; height: 28px; object-fit: contain; filter: grayscale(1) brightness(1.5); }
.brand-divider { width: 1px; height: 18px; margin: 0 2px; background: var(--border); }
.brand-section { color: var(--text-muted); font-size: 13px; font-weight: 500; letter-spacing: 0; }
.topbar-link { min-height: 40px; display: inline-flex; align-items: center; color: var(--text-secondary); font-size: 12px; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.topbar-link:hover { color: var(--text-primary); }
.shell { width: min(100% - 48px, 1120px); margin: 0 auto; }

.index-shell { padding: 62px 0 82px; }
.index-intro { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.intro-copy { max-width: 720px; }
h1 { max-width: 720px; margin: 0 0 10px; font-size: clamp(30px, 4vw, 42px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.15; }
.intro-lede, .detail-intro p { max-width: 66ch; margin: 0; color: var(--text-secondary); font-size: 16px; line-height: 1.65; }
.support-link { flex: 0 0 auto; padding-bottom: 4px; color: var(--text-secondary); font-size: 12px; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.support-link:hover { color: var(--text-primary); }
.draft-note { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 36px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.draft-indicator { width: 8px; height: 8px; flex: 0 0 8px; margin-top: 6px; border: 1px solid #d4d4d8; border-radius: 50%; background: #a1a1aa; }
.draft-note h2 { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.5; }
.draft-note p { max-width: 92ch; margin: 4px 0 0; color: var(--text-secondary); font-size: 13px; line-height: 1.6; }
.document-directory { max-width: 840px; margin: 0 auto; }
.directory-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.directory-heading h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.35; }
.directory-heading p { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
#result-count { padding-bottom: 2px; color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.search-field { min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-control); }
.search-field:focus-within { border-color: #626269; outline: 2px solid var(--focus); outline-offset: 2px; }
.search-field svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: var(--text-muted); stroke-linecap: round; stroke-width: 1.7; }
.search-field input { width: 100%; min-width: 0; height: 46px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font-size: 14px; }
.search-field input::placeholder { color: var(--text-muted); opacity: 1; }
.search-field kbd { min-width: 22px; padding: 2px 5px; border: 1px solid var(--border); border-radius: 4px; color: var(--text-muted); font-family: inherit; font-size: 11px; text-align: center; }
.doc-list { padding: 0; margin: 18px 0 0; border-top: 1px solid var(--border-soft); list-style: none; }
.doc-row { border-bottom: 1px solid var(--border-soft); }
.doc-row a { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 12px; border-radius: var(--radius-md); text-decoration: none; transition: background-color 140ms ease; }
.doc-row a:hover { background: var(--surface); }
.doc-row-copy { display: grid; gap: 4px; }
.doc-row-copy strong { color: var(--text-primary); font-size: 14px; font-weight: 600; }
.doc-row-copy span { color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.doc-row-action { flex: 0 0 auto; color: var(--text-muted); font-size: 11px; }
.doc-row a:hover .doc-row-action { color: var(--text-primary); }
.empty-state { padding: 26px 12px; color: var(--text-secondary); font-size: 13px; }
.empty-state a { color: var(--text-primary); text-underline-offset: 3px; }

.detail-shell { padding: 28px 0 64px; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 26px; color: var(--text-muted); font-size: 12px; }
.breadcrumbs a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.breadcrumbs a:hover { color: var(--text-primary); }
.breadcrumbs [aria-current="page"] { color: var(--text-secondary); }
.detail-intro { margin-bottom: 24px; }
.detail-intro h1 { margin-bottom: 8px; font-size: clamp(28px, 3vw, 34px); }
.detail-intro p { font-size: 14px; }
.detail-shell > .draft-note { margin-bottom: 24px; }
.reading-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); align-items: start; gap: 22px; }
.document-nav { position: sticky; top: 82px; display: flex; flex-direction: column; gap: 3px; padding: 14px 10px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface-sidebar); }
.nav-heading, .meta-label { margin: 0; padding: 6px 10px 8px; color: var(--text-muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; line-height: 1.4; text-transform: uppercase; }
.index-link { min-height: 40px; display: flex; align-items: center; padding: 0 10px; border: 1px solid transparent; border-radius: var(--radius-md); color: var(--text-secondary); font-size: 12px; font-weight: 500; line-height: 1.35; text-decoration: none; transition: background-color 140ms ease, color 140ms ease; }
.index-link:hover { background: var(--surface); color: var(--text-primary); }
.index-link.active { border-color: var(--border-soft); background: var(--surface-raised); color: var(--text-primary); }
.nav-contact { display: grid; gap: 5px; margin: 14px 8px 2px; padding: 14px 2px 0; border-top: 1px solid var(--border-soft); font-size: 12px; }
.nav-contact .meta-label { padding: 0; }
.nav-contact a { color: var(--text-secondary); text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.nav-contact a:hover { color: var(--text-primary); }
.documents { min-width: 0; }
.document { min-width: 0; margin: 0; padding: clamp(22px, 3.2vw, 38px); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); }
.document-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border-soft); }
.document h2 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.3; }
.print-link { min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-control); color: var(--text-primary); font-size: 12px; font-weight: 500; cursor: pointer; transition: background-color 140ms ease, border-color 140ms ease; }
.print-link:hover { border-color: #52525a; background: #2a2a2e; }
.document-meta { margin: 15px 0 17px; color: var(--text-muted); font-size: 12px; }
.document > p:not(.document-meta), .document > ul { max-width: 72ch; color: var(--text-secondary); font-size: 14px; line-height: 1.75; }
.document > p { margin: 12px 0; }
.document > ul { margin: 10px 0 18px; padding-left: 21px; }
.document li { padding-left: 3px; margin: 7px 0; }
.document li::marker { color: var(--text-subtle); }
.document strong { color: var(--text-primary); font-weight: 600; }
.document h3 { max-width: 72ch; margin: 25px 0 7px; color: var(--text-primary); font-size: 14px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.5; }
.document a:not(.print-link) { color: var(--text-primary); text-decoration-color: #71717a; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.document a:not(.print-link):hover { text-decoration-color: var(--text-primary); }
.contact-line { margin-top: 22px !important; padding-top: 14px; border-top: 1px solid var(--border-soft); color: var(--text-muted) !important; font-size: 13px !important; }
.document-pagination { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
.page-step { min-width: 0; display: grid; gap: 3px; padding: 11px 14px; border: 1px solid var(--border-soft); border-radius: var(--radius-md); background: var(--surface-sidebar); text-decoration: none; }
.page-step.next { margin-left: auto; text-align: right; }
.page-step span { color: var(--text-muted); font-size: 10px; }
.page-step strong { overflow: hidden; color: var(--text-primary); font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.contact-document h2 { margin: 0 0 16px; }
.not-found { min-height: calc(100vh - 130px); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding-top: 40px; padding-bottom: 72px; }
.error-code { margin: 0 0 12px; color: var(--text-muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.not-found h1 { margin-bottom: 10px; }
.not-found > p:not(.error-code) { max-width: 54ch; margin: 0 0 24px; color: var(--text-secondary); font-size: 15px; line-height: 1.7; }
.button-primary { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid var(--text-primary); border-radius: var(--radius-md); background: var(--text-primary); color: var(--canvas); font-size: 13px; font-weight: 600; text-decoration: none; }
.button-primary:hover { background: #dedee2; }
.site-footer { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px clamp(20px, 4vw, 56px); border-top: 1px solid var(--border-soft); color: var(--text-muted); font-size: 11px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.site-footer a { color: var(--text-secondary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.site-footer a:hover { color: var(--text-primary); }

@media (max-width: 820px) {
  .shell { width: min(100% - 32px, 760px); }
  .index-shell { padding-top: 42px; }
  .reading-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .document-nav { position: sticky; top: 64px; z-index: 10; display: block; overflow-x: auto; padding: 8px; border-radius: var(--radius-md); white-space: nowrap; scrollbar-width: thin; }
  .nav-heading, .nav-contact { display: none; }
  .index-link { display: inline-flex; min-height: 40px; margin-right: 2px; padding: 0 10px; }
}
@media (max-width: 560px) {
  body { font-size: 14px; }
  .topbar { height: 56px; padding: 0 16px; }
  .topbar-link { font-size: 11px; }
  .shell { width: min(100% - 28px, 480px); }
  .index-shell { padding: 30px 0 50px; }
  .index-intro { display: block; margin-bottom: 22px; }
  h1 { font-size: 30px; }
  .intro-lede { font-size: 14px; }
  .support-link { display: inline-flex; margin-top: 12px; }
  .draft-note { gap: 10px; margin-bottom: 26px; padding: 13px; }
  .draft-note h2 { font-size: 12px; }
  .draft-note p { font-size: 12px; }
  .directory-heading h2 { font-size: 16px; }
  .search-field { min-height: 46px; gap: 9px; padding: 0 11px; }
  .search-field input { height: 44px; font-size: 13px; }
  .doc-row a { min-height: 76px; gap: 12px; padding: 12px 8px; }
  .doc-row-copy strong { font-size: 13px; }
  .doc-row-copy span { font-size: 11px; }
  .doc-row-action { font-size: 10px; }
  .detail-shell { padding-top: 20px; }
  .breadcrumbs { margin-bottom: 20px; }
  .detail-intro h1 { font-size: 28px; }
  .detail-intro p { font-size: 13px; }
  .document-nav { top: 56px; margin: 0 -2px; }
  .document { padding: 20px 17px; border-radius: var(--radius-md); }
  .document-header { align-items: flex-start; }
  .document h2 { font-size: 19px; }
  .document-meta { font-size: 11px; }
  .document > p:not(.document-meta), .document > ul { font-size: 13px; line-height: 1.75; }
  .document h3 { margin-top: 22px; }
  .document-pagination { flex-direction: column; }
  .page-step.next { margin-left: 0; text-align: left; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 8px; padding: 14px 16px; }
  .site-footer nav { gap: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
@media print {
  :root, html, body { color-scheme: light; background: #fff; color: #111; }
  .topbar, .breadcrumbs, .detail-intro, .draft-note, .document-nav, .print-link, .document-pagination, .site-footer, .skip-link { display: none !important; }
  .shell { width: 100%; margin: 0; padding: 0; }
  .reading-layout, .documents { display: block; padding: 0; }
  .document { display: block !important; border: 0; background: #fff; color: #111; padding: 0; }
  .document > p:not(.document-meta), .document > ul, .document h2, .document h3, .document strong, .document a { color: #111 !important; }
  .document a { text-decoration: underline; }
  .document-header { border-color: #bbb; }
}
@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: var(--surface-sidebar); }
  ::-webkit-scrollbar-thumb { border-radius: 3px; background: #343438; }
  ::-webkit-scrollbar-thumb:hover { background: #52525a; }
}
