/* Geinium documentation.
   Self-contained: no web fonts, no CDN, no script. The folder can be copied
   onto a web server or opened straight from disk.
   Responsive from a 320 px phone to a wide desktop. */

:root {
    --ink: #15202a;
    --ink-soft: #1f2d3a;
    --brand: #1f5fc8;
    --brand-dark: #174a9e;
    --accent: #5aa2ff;
    --page: #ffffff;
    --page-alt: #f2f5fa;
    --border: #d7dfea;
    --text: #1d2a33;
    --text-muted: #576a75;
    --note: #ebf2fc;
    --warn: #fff5e3;
    --warn-border: #e8c27a;
    --sidebar-w: 304px;
    --topbar-h: 54px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.68;
    color: var(--text);
    background: var(--page);
    overflow-wrap: break-word;
}

/* ---- Mobile top bar. The checkbox drives the sidebar, so no script. ----- */

#navtoggle { position: absolute; opacity: 0; pointer-events: none; }

.topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    background: var(--ink);
    color: #ffffff;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    z-index: 60;
}
.topbar .title { font-size: 16px; font-weight: 600; letter-spacing: 0.01em; }
.topbar .title span { color: var(--accent); }

.burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 38px;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.22);
}
.burger span { display: block; height: 2px; background: #ffffff; border-radius: 2px; }

.scrim { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 70; }

/* ---- Sidebar ----------------------------------------------------------- */

.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--ink);
    color: #c3d2d9;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 40px;
    z-index: 80;
}

.sidebar .brand {
    display: block;
    padding: 22px 24px 18px;
    background: var(--ink-soft);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.sidebar .brand .name { font-size: 21px; font-weight: 600; color: #ffffff; }
.sidebar .brand .name span { color: var(--accent); }
.sidebar .brand .ver {
    font-size: 12px;
    color: #8aa0ab;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar nav { padding: 14px 0; }
.sidebar h3 {
    margin: 18px 24px 6px;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #7a9099;
    font-weight: 600;
}
.sidebar nav a {
    display: block;
    padding: 7px 24px;
    color: #c3d2d9;
    text-decoration: none;
    font-size: 14.5px;
    border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, 0.05); color: #ffffff; }
.sidebar nav a.current {
    background: rgba(90, 162, 255, 0.14);
    border-left-color: var(--accent);
    color: #ffffff;
    font-weight: 600;
}

/* ---- Main column ------------------------------------------------------- */

main {
    margin-left: var(--sidebar-w);
    padding: 40px 48px 96px;
    max-width: 1060px;
}

.crumbs { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.crumbs a { color: var(--brand); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

h1 {
    font-size: 32px;
    line-height: 1.25;
    margin: 0 0 12px;
    color: var(--ink);
    font-weight: 600;
}
h2 {
    font-size: 23px;
    margin: 40px 0 12px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--border);
    color: var(--ink);
    font-weight: 600;
}
h3 { font-size: 18px; margin: 28px 0 8px; color: var(--ink-soft); font-weight: 600; }

p.lead { font-size: 18px; color: var(--text-muted); margin: 0 0 26px; }

a { color: var(--brand); }

code {
    font-family: "Cascadia Mono", Consolas, "Liberation Mono", monospace;
    font-size: 0.92em;
    background: var(--page-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
}
pre {
    background: var(--ink);
    color: #e6eef2;
    padding: 14px 18px;
    border-radius: 7px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.55;
}
pre code { background: none; border: 0; color: inherit; padding: 0; font-size: inherit; }

/* ---- Figures ----------------------------------------------------------- */

figure {
    margin: 26px 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--page-alt);
}
figure img { display: block; width: 100%; height: auto; background: #ffffff; }
figcaption {
    font-size: 13.5px;
    color: var(--text-muted);
    padding: 11px 16px;
    border-top: 1px solid var(--border);
    background: var(--page-alt);
}

/* A dialog or a single panel is shown at its own size, not stretched. */
figure.narrow { width: fit-content; max-width: 100%; }
figure.narrow img { width: auto; max-width: 100%; margin: 0 auto; }

.figrow { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.figrow figure { margin: 26px 0 0; }

/* ---- Tables ------------------------------------------------------------ */

.table-wrap { overflow-x: auto; margin: 20px 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 460px; }
th, td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; vertical-align: top; }
th { background: var(--page-alt); font-weight: 600; color: var(--ink); }
tbody tr:nth-child(even) { background: #fafbfd; }

/* ---- Notes ------------------------------------------------------------- */

.note, .warn {
    border-left: 4px solid var(--brand);
    background: var(--note);
    padding: 13px 18px;
    border-radius: 0 7px 7px 0;
    margin: 22px 0;
    font-size: 15px;
}
.warn { border-left-color: var(--warn-border); background: var(--warn); }
.note p:first-child, .warn p:first-child { margin-top: 0; }
.note p:last-child, .warn p:last-child { margin-bottom: 0; }

.chip {
    display: inline-block;
    font-size: 12px;
    padding: 1px 8px;
    border-radius: 11px;
    background: var(--page-alt);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

kbd {
    font-family: inherit;
    font-size: 12.5px;
    padding: 1px 7px;
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: #ffffff;
    color: var(--ink);
    white-space: nowrap;
}

/* ---- Page footer and next links ---------------------------------------- */

.pagenav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 52px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 15px;
}
.pagenav a { text-decoration: none; }
.pagenav a:hover { text-decoration: underline; }

footer.docfoot {
    margin-top: 34px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

/* ---- Home page cards --------------------------------------------------- */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 26px 0; }
.card {
    display: block;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
    background: var(--page);
}
.card:hover { border-color: var(--accent); background: var(--page-alt); }
.card .t { font-weight: 600; color: var(--brand); margin-bottom: 4px; }
.card .d { font-size: 14px; color: var(--text-muted); }

/* ---- Responsive -------------------------------------------------------- */

@media (max-width: 1000px) {
    .topbar { display: flex; }
    main { margin-left: 0; padding: calc(var(--topbar-h) + 26px) 20px 72px; max-width: none; }
    .sidebar { transform: translateX(-100%); transition: transform 0.22s ease; width: min(86vw, var(--sidebar-w)); }
    #navtoggle:checked ~ .sidebar { transform: translateX(0); }
    #navtoggle:checked ~ .scrim { display: block; }
    .figrow { grid-template-columns: 1fr; }
    h1 { font-size: 27px; }
    h2 { font-size: 21px; }
}

@media (max-width: 560px) {
    body { font-size: 15.5px; }
    main { padding: calc(var(--topbar-h) + 20px) 14px 64px; }
    p.lead { font-size: 16.5px; }
    .pagenav { flex-direction: column; gap: 8px; }

    /* A phone is narrower than any sensible minimum table width, so the table
       reflows instead of forcing the page to scroll sideways. Long commands
       wrap for the same reason. */
    table { min-width: 0; font-size: 14px; }
    th, td { padding: 7px 8px; }
    pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
    code { overflow-wrap: anywhere; }
}

/* ---- Print: the web pages are not the manual, but they should print ---- */

@media print {
    .topbar, .sidebar, .scrim, .pagenav { display: none; }
    main { margin: 0; padding: 0; max-width: none; }
    figure { break-inside: avoid; }
    a { color: inherit; text-decoration: none; }
}
