/* InvAmp Help — one stylesheet, no external resources. */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-side: #f3f4f7;
  --fg: #1c1f24;
  --fg-soft: #5a616d;
  --line: #dfe3e8;
  --accent: #e8590c;        /* the callout colour in every screenshot */
  --accent-soft: #fff1e8;
  --link: #0b61b8;
  --note: #0b61b8;
  --note-bg: #eef5fd;
  --tip: #1d7a46;
  --tip-bg: #edf8f1;
  --todo: #9a5b00;
  --todo-bg: #fff6df;
  --mark: #ffe08a;
  --shot-border: #d0d7de;
  --side-w: 292px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: Consolas, "Cascadia Mono", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171b; --bg-soft: #1c1f24; --bg-side: #1a1d22; --fg: #e6e8eb; --fg-soft: #a1a8b3;
    --line: #2c3139; --accent: #ff7a33; --accent-soft: #3a2416; --link: #6fb3ff;
    --note: #6fb3ff; --note-bg: #16263a; --tip: #5fd08f; --tip-bg: #15291e;
    --todo: #f0b44a; --todo-bg: #33270f; --mark: #6b5310; --shot-border: #3a4049;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15171b; --bg-soft: #1c1f24; --bg-side: #1a1d22; --fg: #e6e8eb; --fg-soft: #a1a8b3;
  --line: #2c3139; --accent: #ff7a33; --accent-soft: #3a2416; --link: #6fb3ff;
  --note: #6fb3ff; --note-bg: #16263a; --tip: #5fd08f; --tip-bg: #15291e;
  --todo: #f0b44a; --todo-bg: #33270f; --mark: #6b5310; --shot-border: #3a4049;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.6 var(--font);
}
a { color: var(--link); }
code { font-family: var(--mono); font-size: .9em; background: var(--bg-soft); padding: .1em .35em; border-radius: 4px; border: 1px solid var(--line); }
mark { background: var(--mark); color: inherit; border-radius: 2px; }

/* ── layout ─────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 16px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; color: var(--fg); text-decoration: none; white-space: nowrap; }
.brand small { font-weight: 400; color: var(--fg-soft); margin-left: 6px; }
.search { flex: 1; max-width: 420px; margin-left: auto; position: relative; }
.search input {
  width: 100%; height: 36px; padding: 0 12px; font: inherit; font-size: 15px;
  color: var(--fg); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.results {
  position: absolute; left: 0; right: 0; top: 42px; max-height: 70vh; overflow: auto; display: none;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.18);
}
.results.open { display: block; }
.results a { display: block; padding: 10px 12px; color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--line); }
.results a:last-child { border-bottom: 0; }
.results a:hover, .results a.active { background: var(--accent-soft); }
.results .r-title { font-weight: 600; }
.results .r-sec { color: var(--fg-soft); font-size: 13px; }
.results .r-snip { color: var(--fg-soft); font-size: 14px; }
.results .none { padding: 12px; color: var(--fg-soft); }
.icon-btn {
  height: 36px; min-width: 36px; padding: 0 10px; font: inherit; font-size: 14px; color: var(--fg);
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.menu-btn { display: none; }

.shell { display: flex; }
.side {
  position: sticky; top: 56px; height: calc(100vh - 56px); width: var(--side-w); flex: 0 0 var(--side-w);
  overflow: auto; padding: 16px 12px 32px; background: var(--bg-side); border-right: 1px solid var(--line);
}
.side details { margin-bottom: 6px; }
.side summary {
  cursor: pointer; list-style: none; padding: 6px 8px; border-radius: 6px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-soft);
}
.side summary::-webkit-details-marker { display: none; }
.side summary::before { content: "\25B8"; display: inline-block; width: 1em; transition: transform .15s; }
.side details[open] > summary::before { transform: rotate(90deg); }
.side ul { list-style: none; margin: 2px 0 8px; padding: 0; }
.side li a {
  display: block; padding: 6px 10px 6px 24px; border-radius: 6px; color: var(--fg); text-decoration: none; font-size: 15px; line-height: 1.35;
}
.side li a:hover { background: var(--bg-soft); }
.side li a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }

main { flex: 1; min-width: 0; padding: 24px 40px 64px; }
.page { max-width: 820px; }
.crumbs { font-size: 14px; color: var(--fg-soft); margin-bottom: 8px; }
.crumbs a { color: var(--fg-soft); }
.crumbs span[aria-hidden] { margin: 0 6px; }
h1 { font-size: 32px; line-height: 1.2; margin: 0 0 16px; }
h2 { font-size: 22px; margin: 36px 0 12px; padding-top: 4px; border-top: 1px solid var(--line); }
h1 + p { font-size: 17px; }
.page ol, .page ul { padding-left: 1.5em; }
.page li { margin: 4px 0; }
table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 15px; display: block; overflow-x: auto; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { background: var(--bg-soft); font-weight: 600; }

figure.shot { margin: 20px 0; }
figure.shot img {
  display: block; max-width: 100%; height: auto; border-radius: 8px;
  border: 1px solid var(--shot-border); background: #fff;
}
.ref {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: 1px;
  min-width: 1.4em; height: 1.4em; padding: 0 .3em; margin: 0 .1em;
  font-size: .78em; font-weight: 700; line-height: 1; color: #fff; background: var(--accent); border-radius: 999px;
}

.admonition { margin: 16px 0; padding: 12px 14px; border-radius: 8px; border-left: 4px solid; }
.admonition p { margin: 0; }
.admonition .label { font-weight: 700; margin-right: 4px; }
.admonition.note { background: var(--note-bg); border-color: var(--note); }
.admonition.note .label { color: var(--note); }
.admonition.tip { background: var(--tip-bg); border-color: var(--tip); }
.admonition.tip .label { color: var(--tip); }
.admonition.todo { background: var(--todo-bg); border-color: var(--todo); }
.admonition.todo .label { color: var(--todo); }

.pager { display: flex; gap: 12px; margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); }
.pager a {
  flex: 1; display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--fg);
}
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; color: var(--fg-soft); font-size: 13px; }
.pager .next { text-align: right; }
.footer { margin-top: 32px; font-size: 13px; color: var(--fg-soft); }

.contents h2 { border-top: 0; margin-top: 24px; }
.contents ul { columns: 2; column-gap: 32px; }

/* ── narrow screens: the contents become a drawer ───────── */
@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  .side {
    position: fixed; z-index: 30; top: 56px; left: 0; bottom: 0; height: auto;
    transform: translateX(-100%); transition: transform .2s;
  }
  body.side-open .side { transform: none; box-shadow: 4px 0 24px rgba(0,0,0,.2); }
  main { padding: 16px 16px 48px; }
  h1 { font-size: 26px; }
  .brand small { display: none; }
  .print-btn { display: none; }          /* printing is a desktop job; the box needs the room */
  .topbar { gap: 8px; padding: 0 12px; }
  .search { min-width: 0; }
  .contents ul { columns: 1; }
  .pager { flex-direction: column; }
}

/* ── print: the single-page print view and any page ─────── */
@media print {
  .topbar, .side, .pager, .no-print { display: none !important; }
  main { padding: 0; }
  .page { max-width: none; }
  body { font-size: 11pt; background: #fff; color: #000; }
  a { color: #000; text-decoration: none; }
  h2 { break-after: avoid; }
  figure.shot { break-inside: avoid; }
  figure.shot img { max-width: 15cm; }
  .print-topic { break-before: page; }
  .print-topic:first-of-type { break-before: auto; }
  .admonition { break-inside: avoid; }
}

/* invamp.net only: the logo leads back to the site (web/build.py). */
.site-home { display: inline-flex; align-items: center; margin-right: 4px; }
.site-home img { height: 40px; width: auto; }
.site-home .dm { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-home .lm { display: none; }
  :root:not([data-theme="light"]) .site-home .dm { display: inline; }
}
:root[data-theme="dark"] .site-home .lm { display: none; }
:root[data-theme="dark"] .site-home .dm { display: inline; }
