/* Web manual: left index + search (manual-nav.js). Screen only; the PDF is printed from Docs/Manual/Manual.html. */
@media screen {
  :root { --nav-w: 300px; --nav-bg: #0b0b0e; --nav-line: #24242a; --nav-ink: #e9e6de; --nav-muted: #8f8c84; --nav-y: #ffc600; }
  .gnav { position: fixed; top: 0; left: 0; bottom: 0; width: var(--nav-w); background: var(--nav-bg); color: var(--nav-ink);
          border-right: 1px solid var(--nav-line); display: flex; flex-direction: column; z-index: 20;
          font: 13px/1.45 Inter, Montserrat, system-ui, sans-serif; }
  .gnav-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--nav-line); }
  .gnav-head a.home { display: block; color: var(--nav-muted); text-decoration: none; font-size: 12px; margin-bottom: 10px; }
  .gnav-head a.home:hover { color: #fff; }
  .gnav-title { font: 700 15px/1 Oswald, Inter, sans-serif; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px; }
  .gnav-search { position: relative; }
  .gnav-search input { width: 100%; box-sizing: border-box; background: #16161b; border: 1px solid #2e2e36; border-radius: 8px;
                       color: #fff; font: 14px Inter, system-ui, sans-serif; padding: 9px 30px 9px 32px; outline: none; }
  .gnav-search input:focus { border-color: var(--nav-y); }
  .gnav-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; stroke: var(--nav-muted); }
  .gnav-search .clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0;
                        color: var(--nav-muted); font-size: 18px; cursor: pointer; display: none; padding: 2px 6px; }
  .gnav-search.has .clear { display: block; }
  .gnav-hint { color: var(--nav-muted); font-size: 11px; margin-top: 6px; }
  .gnav-body { flex: 1; overflow-y: auto; padding: 8px 6px 40px; scrollbar-width: thin; scrollbar-color: #333 transparent; }
  .gnav-part { margin: 12px 0 2px; padding: 0 8px; font: 600 11px/1.3 Oswald, Inter, sans-serif; letter-spacing: .14em;
               text-transform: uppercase; color: var(--nav-y); }
  .gnav-item > a, .gnav-sub a { display: flex; gap: 8px; align-items: baseline; color: var(--nav-ink); text-decoration: none;
                                padding: 5px 8px; border-radius: 6px; }
  .gnav-item > a:hover, .gnav-sub a:hover { background: #1a1a20; }
  .gnav-item > a .n { color: var(--nav-muted); min-width: 18px; text-align: right; font-variant-numeric: tabular-nums; font-size: 11px; }
  .gnav-item > a .tw { display: none; margin-left: auto; color: var(--nav-muted); font-size: 10px; transition: transform .15s; }
  .gnav-item.has-sub > a .tw { display: inline; }
  .gnav-item.open > a .tw { transform: rotate(90deg); }
  .gnav-item.active > a { background: #1d1b12; color: #fff; box-shadow: inset 2px 0 0 var(--nav-y); }
  .gnav-sub { display: none; margin: 0 0 4px 26px; border-left: 1px solid var(--nav-line); }
  .gnav-item.open .gnav-sub { display: block; }
  .gnav-sub a { font-size: 12px; color: #bdbab2; padding: 3px 8px; }
  .gnav-sub a.active { color: var(--nav-y); }
  .gnav-results { display: none; }
  .gnav.searching .gnav-tree { display: none; }
  .gnav.searching .gnav-results { display: block; }
  .gnav-count { color: var(--nav-muted); font-size: 11px; padding: 6px 8px; }
  .gnav-res { display: block; text-decoration: none; color: var(--nav-ink); padding: 8px; border-radius: 6px; border-bottom: 1px solid #17171c; }
  .gnav-res:hover, .gnav-res.sel { background: #1a1a20; }
  .gnav-res .rt { font-weight: 600; color: #fff; }
  .gnav-res .rp { color: var(--nav-muted); font-size: 11px; }
  .gnav-res .rs { display: block; color: #a9a69d; font-size: 12px; margin-top: 3px; }
  .gnav-res mark, mark.gsr { background: #ffc600; color: #000; border-radius: 2px; padding: 0 1px; }
  mark.gsr.cur { outline: 2px solid #ff7a00; }
  .gnav-empty { color: var(--nav-muted); padding: 12px 8px; }
  .gnav-toggle { display: none; }
  .gnav-scrim { display: none; }

  /* wide screens: the index sits on the left, the manual page beside it, the printed Contents page goes */
  @media (min-width: 1180px) {
    body { margin-left: max(calc(var(--nav-w) + 24px), calc((100vw - 8.5in) / 2)) !important; margin-right: auto !important; }
    .gnav-on .part.toc-part, .gnav-on #toc { display: none; }
  }
  /* narrower: a button opens the index as a drawer */
  @media (max-width: 1179px) {
    .gnav { transform: translateX(-102%); transition: transform .2s ease; width: min(86vw, 340px); box-shadow: 0 0 40px rgba(0,0,0,.6); }
    .gnav.open { transform: none; }
    .gnav-toggle { display: flex; align-items: center; gap: 8px; position: fixed; right: 16px; bottom: 16px; z-index: 21;
                   background: #000; color: var(--nav-y); border: 1px solid #333; border-radius: 999px; padding: 11px 16px;
                   font: 600 14px Inter, sans-serif; cursor: pointer; box-shadow: 0 6px 24px rgba(0,0,0,.45); }
    .gnav-scrim.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 19; }
  }
  section[id], .part, h3[id] { scroll-margin-top: 64px; }
}
@media print { .gnav, .gnav-toggle, .gnav-scrim { display: none !important; } }

/* images carry width/height (no jump while they load); keep their shape */
:where(img[width][height]) { height: auto; max-width: 100%; }
