/* Documentation-specific reading, search, image viewer and print styles.
   Shared tokens, header and navigation live in ../shared.css. */
.search-trigger { display: flex; align-items: center; gap: 10px; width: 298px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); color: var(--muted); font-size: 13px; text-align: left; }
.search-trigger:hover { border-color: #b4c3bc; }
.search-short { display: none; }
.search-trigger kbd { margin-left: auto; white-space: nowrap; }
kbd { font-family: inherit; font-size: 11px; line-height: 1.7; padding: 0 5px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); }
#printButton[aria-busy="true"] { opacity: .6; cursor: progress; }
.print-status { position: fixed; z-index: 60; top: calc(var(--head) + 12px); right: 20px; max-width: min(420px, calc(100vw - 40px)); padding: 14px 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); box-shadow: 0 6px 24px #182d2318; font-size: 13px; }
.print-status:empty { display: none; }
#navToggle { display: none; }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--brand); }


main { min-width: 0; padding-top: 46px; }
main > section > p, main > section > ul, main > section > ol, main > section > .note, .lead p { max-width: var(--measure); }
.breadcrumbs { display: flex; gap: 10px; align-items: center; margin-bottom: 30px; color: var(--muted); font-size: 12px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs .icon { width: 12px; height: 12px; color: #919a94; }
.lead { margin-bottom: 58px; padding-bottom: 36px; border-bottom: 1px solid var(--line); }
.eyebrow { margin-bottom: 14px; color: var(--accent); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .11em; }
.lead h1 { max-width: 820px; font-size: clamp(40px, 4vw, 60px); line-height: 1.08; font-weight: 550; letter-spacing: -.055em; margin-bottom: 22px; text-wrap: balance; }
.lead p { max-width: 66ch; font-size: 16px; line-height: 1.75; color: var(--muted); }
.lead .meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 22px; font-size: 11px; color: var(--muted); }
.lead .meta span { display: inline-flex; align-items: center; gap: 7px; }
.lead .meta .version { color: var(--accent); }
.status-dot { width: 5px; height: 5px; background: var(--brand); border-radius: 50%; }
.quick-links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 28px; }
.quick-links a { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 550; }
.quick-links .icon { width: 14px; height: 14px; }
section { margin-bottom: 72px; }
section > h2 { font-size: 30px; line-height: 1.3; font-weight: 550; letter-spacing: -.035em; margin: 0 0 10px; }
section + section { border-top: 1px solid var(--line); padding-top: 40px; }
h3 { font-size: 21px; line-height: 1.4; font-weight: 550; letter-spacing: -.025em; margin: 34px 0 14px; }
h4 { font-size: 15px; font-weight: 600; margin: 20px 0 8px; }
p { margin: 0 0 16px; }
ul, ol { margin: 0 0 20px 22px; }
li { margin-bottom: 8px; padding-left: 2px; }
li::marker { color: #76867c; }
b, strong { font-weight: 600; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 26px; }
figure.shot { margin: 26px 0 32px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--soft); }
figure.shot a { display: block; cursor: zoom-in; }
figure.shot a:focus-visible { outline-offset: -3px; }
figure.shot img { display: block; width: 100%; height: auto; }
figure.shot figcaption { padding: 11px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.shot-missing { color: var(--warn); font-size: 13px; }
table { width: 100%; border-collapse: collapse; margin: 20px 0 24px; font-size: 13.5px; line-height: 1.6; }
th { text-align: left; background: var(--soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 14px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
td { border-bottom: 1px solid var(--line); padding: 12px 14px; vertical-align: top; }
tbody tr:hover { background: #fafbfa; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.note { border-left: 2px solid var(--brand); background: #f2f8f5; padding: 18px 22px; border-radius: 0 6px 6px 0; margin: 22px 0; font-size: 14px; line-height: 1.8; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 20px; }
.tag { font-size: 11px; border: 1px solid var(--line); border-radius: 4px; padding: 4px 9px; color: var(--muted); background: var(--soft); }
.tag.box { color: var(--accent); border-color: #cee3db; }
td.tag { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 12px 14px; background: transparent; font-size: inherit; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin: 16px 0 24px; }
.card { padding: 20px 0; border-top: 1px solid var(--line); }
.card h4 { margin: 0 0 8px; }
.card p { margin: 0; font-size: 13.5px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 30px 0 36px; }
.stat { padding: 20px 12px 20px 0; }
.stat + .stat { border-left: 1px solid var(--line); padding-left: 20px; }
.stat b { display: block; margin-bottom: 5px; font-size: 32px; line-height: 1.15; font-weight: 500; letter-spacing: -.035em; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 10px; line-height: 1.6; text-transform: uppercase; letter-spacing: .04em; }
footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 30px 40px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
footer p { margin: 0; }
footer a { color: var(--muted); }
.footer-brand { display: flex; gap: 12px; align-items: center; }
.footer-brand .brand-mark { width: 23px; height: 23px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.totop { position: fixed; right: 22px; bottom: 22px; z-index: 45; width: 42px; height: 42px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); display: none; align-items: center; justify-content: center; box-shadow: 0 3px 12px #1632280b; }
.totop.show { display: flex; }
.totop:hover { color: var(--accent); border-color: var(--brand); }

/* Native dialogs provide focus containment, Escape, and background inertness. */
html.search-open { overflow: hidden; }
.search-dialog { width: min(680px, calc(100vw - 32px)); max-height: min(720px, calc(100dvh - 100px)); margin: 10vh auto auto; padding: 0; border: 1px solid #d7dfd9; border-radius: 10px; background: var(--bg); color: var(--ink); box-shadow: 0 24px 100px #12231a33; overflow: hidden; }
.search-dialog::backdrop { background: #101d1780; backdrop-filter: blur(3px); }
.search-top { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.search-top > .icon { color: var(--accent); }
.search-top input { width: 100%; min-width: 0; height: 32px; color: var(--ink); font-size: 16px; background: transparent; border: 0; outline: none; }
.search-top input::-webkit-search-cancel-button { appearance: none; }
.search-top:focus-within { box-shadow: inset 0 -2px var(--brand); }
.search-close { flex: 0 0 32px; height: 32px; border: 1px solid var(--line); border-radius: 5px; background: var(--soft); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.search-status { padding: 14px 20px 8px; margin: 0; color: var(--muted); font-size: 11px; }
.search-results { list-style: none; margin: 0; padding: 0 10px 12px; max-height: min(490px, calc(100dvh - 280px)); overflow-y: auto; overscroll-behavior: contain; }
.search-results li { margin: 0; padding: 0; }
.search-results a { display: block; padding: 12px; border-radius: 5px; color: var(--ink); text-decoration: none; }
.search-results a:hover, .search-results a.selected { background: var(--brand-soft); }
.search-results .result-section { display: block; margin-bottom: 2px; color: var(--muted); font-size: 10px; }
.search-results strong { display: block; font-size: 14px; font-weight: 600; }
.search-results .result-excerpt { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.search-hints { padding: 10px 20px; border-top: 1px solid var(--line); display: flex; gap: 20px; font-size: 10px; color: var(--muted); background: var(--soft); }

@media (max-width: 1200px) {
  .lead h1 { font-size: 46px; }
}
@media (max-width: 900px) {
  .search-trigger { width: 44px; height: 44px; padding: 12px; background: white; border: 0; }
  .search-trigger span, .search-trigger kbd { display: none; }
  #navToggle { display: inline-flex; min-height: 44px; }
  #printButton { padding: 12px; width: 44px; height: 44px; border: 0; }
  #printButton span { display: none; }
  main { padding-top: 30px; }
  .lead h1 { font-size: 48px; }
  .lead { margin-bottom: 42px; }
  footer { padding: 26px 32px; align-items: flex-start; }
}

@media (max-width: 560px) {
  .search-trigger { width: auto; height: 36px; min-height: 36px; flex: 1; padding: 6px 0; font-size: 11px; }
  .search-trigger .search-short { display: inline; }
  .search-trigger .icon { width: 16px; height: 16px; }
  #navToggle { padding: 6px 9px; min-height: 36px; font-size: 11px; }
  #navToggle .icon { width: 15px; height: 15px; }
  #printButton { width: 36px; height: 36px; padding: 8px; }
  main { padding-top: 24px; }
  .breadcrumbs { margin-bottom: 28px; font-size: 11px; }
  .lead { padding-bottom: 28px; }
  .lead h1 { font-size: 40px; line-height: 1.08; }
  .lead p { font-size: 14px; }
  .lead .meta { gap: 6px 12px; font-size: 10px; }
  .quick-links { flex-direction: column; align-items: flex-start; gap: 13px; margin-top: 24px; }
  section { margin-bottom: 48px; }
  section > h2 { font-size: 27px; }
  section + section { padding-top: 30px; }
  .sub { font-size: 13px; margin-bottom: 20px; }
  h3 { font-size: 20px; }
  .note { font-size: 13px; padding: 16px; }
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .stat:nth-child(4) { border-top: 1px solid var(--line); }
  .stat b { font-size: 30px; }
  table { font-size: 12px; }
  th, td, td.tag { padding: 10px; }
  figure.shot { border-radius: 5px; }
  figure.shot figcaption { font-size: 10px; padding: 9px 11px; }
  .search-dialog { margin-top: 16px; max-height: calc(100dvh - 32px); }
  .search-top { padding: 14px; gap: 10px; }
  .search-results { max-height: calc(100dvh - 212px); }
  .search-hints { display: none; }
  footer { flex-direction: column; padding: 26px 22px; gap: 18px; }
  .footer-links { gap: 14px; }
}

/* The document remains a complete A4 publication when exported. */
.cover, .print-footer { display: none; }
@media print {
  @page { size: A4 portrait; margin: 18mm 14mm 20mm; }
  html { scroll-padding-top: 0; overflow: visible !important; }
  body { padding-bottom: 9mm; font-size: 10.5pt; line-height: 1.5; color: #000; background: #fff; }
  .topbar, nav.toc, footer, .lightbox, .search-dialog, .totop, .progress, .skip-link, .breadcrumbs, .quick-links, .eyebrow, .lead .meta, .print-status { display: none !important; }
  body.nav-open::after { display: none; }
  .cover { display: block; text-align: center; padding-top: 46mm; break-after: page; }
  .cover h1 { font-size: 26pt; margin-bottom: 6mm; border: none; }
  .cover .cover-sub { font-size: 12pt; color: #333; margin-bottom: 22mm; }
  .cover dl { display: inline-block; text-align: left; font-size: 10pt; color: #333; }
  .cover dt { float: left; clear: left; width: 52mm; color: #666; }
  .cover dd { margin: 0 0 2mm 54mm; }
  .cover .cover-note { margin: 20mm auto 0; font-size: 9pt; color: #666; max-width: 120mm; }
  .print-footer { display: block; position: fixed; bottom: 0; left: 0; right: 0; font-size: 8pt; color: #666; border-top: .3pt solid #ccc; padding-top: 2mm; background: #fff; }
  .print-footer span { float: right; }
  .shell { display: block; max-width: none; padding: 0; }
  main { padding: 0; }
  .lead { border: none; background: none; padding: 0; margin-bottom: 18pt; }
  .lead h1 { font-size: 22pt; }
  .lead p { font-size: 10.5pt; color: #333; }
  section { margin-bottom: 20pt; break-inside: auto; }
  section + section { border: none; padding-top: 0; }
  section > h2 { font-size: 14pt; break-after: avoid; border-bottom: 1.5pt solid #087f73; padding-bottom: 6pt; }
  h3, h4 { break-after: avoid; }
  h3 { font-size: 12pt; }
  figure.shot { break-inside: avoid; border-color: #ccc; margin: 12pt 0; }
  figure.shot img { max-height: 120mm; object-fit: contain; }
  figure.shot figcaption { font-size: 8pt; }
  table { break-inside: auto; font-size: 9pt; }
  tr { break-inside: avoid; }
  .note { background: #f5f5f5; border-left-color: #087f73; font-size: 10pt; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-top: 0; border-left: 1px solid var(--line); padding-left: 20px; }
  .stat:nth-child(4) { border-top: 0; }
  .stat b { font-size: 20pt; }
  .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  a { color: #000; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #666; }
}
