/* ==========================================================================
   Open POS Printer Emulator — product site + user manual
   Self-contained styles. No CDN, no build step.
   ========================================================================== */

:root {
    --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
        "Liberation Mono", monospace;

    /* Warm OPPE palette: terracotta signal, warm ink, warm paper. */
    --bg: #f7f4ef;
    --bg-elevated: #fffdfb;
    --bg-subtle: #efe8dd;
    --border: #d8d1c7;
    --border-strong: #c7beb1;
    --text: #2a2724;
    --text-muted: #6e685f;
    --text-faint: #857e74;
    --accent: #c2552f;
    --accent-soft: rgba(217, 101, 59, 0.12);
    --accent-border: rgba(194, 85, 47, 0.35);
    --code-bg: #efe8dd;
    --shadow: 0 1px 2px rgba(42, 39, 36, 0.05), 0 8px 24px -12px rgba(42, 39, 36, 0.14);

    --header-h: 64px;
    --sidebar-w: 268px;
    --toc-w: 220px;
    --radius: 10px;
}

[data-theme="dark"] {
    --bg: #201e1b;
    --bg-elevated: #292623;
    --bg-subtle: #332f2b;
    --border: #433d37;
    --border-strong: #544c44;
    --text: #f3efe8;
    --text-muted: #c2b9ad;
    --text-faint: #a8a196;
    --accent: #e07a55;
    --accent-soft: rgba(217, 101, 59, 0.16);
    --accent-border: rgba(224, 122, 85, 0.4);
    --code-bg: #292623;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 16px 40px -20px rgba(0, 0, 0, 0.7);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.has-lightbox {
    overflow: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

img {
    max-width: 100%;
    height: auto;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-h);
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
    white-space: nowrap;
}

.brand:hover {
    text-decoration: none;
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
}

/* The ESC/POS logo is a coloured mark; keep it unchanged in both
   themes. */
.brand__mark img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
}

.brand__sub {
    padding-left: 10px;
    margin-left: 2px;
    border-left: 1px solid var(--border-strong);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.site-nav a {
    padding: 7px 12px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
    background: var(--bg-subtle);
    color: var(--text);
    text-decoration: none;
}

.site-nav a[aria-current="page"] {
    background: var(--accent-soft);
    color: var(--accent);
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    cursor: pointer;
}

.icon-button:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

.icon-button svg {
    width: 17px;
    height: 17px;
}

[data-theme="dark"] .icon-sun,
[data-theme="light"] .icon-moon {
    display: none;
}

.sidebar-toggle {
    display: none;
}

/* --------------------------------------------------------------------------
   Manual shell
   -------------------------------------------------------------------------- */

.manual {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    gap: 48px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}

.manual--with-toc .manual__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--toc-w);
    gap: 48px;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    align-self: start;
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
    padding-right: 8px;
}

.sidebar__section + .sidebar__section {
    margin-top: 26px;
}

.sidebar__title {
    margin: 0 0 8px 12px;
    color: var(--text-faint);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.sidebar__list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-left: 1px solid var(--border);
}

.sidebar__link {
    display: block;
    margin-left: -1px;
    padding: 7px 12px;
    border-left: 2px solid transparent;
    color: var(--text-muted);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.12s ease, border-color 0.12s ease;
}

.sidebar__link:hover {
    color: var(--text);
    text-decoration: none;
}

.sidebar__link[aria-current="page"] {
    border-left-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.sidebar__cta {
    margin-top: 28px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
}

.sidebar__cta p {
    margin: 0 0 10px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.sidebar__cta a {
    font-size: 13px;
    font-weight: 600;
}

.content {
    min-width: 0;
}

/* --------------------------------------------------------------------------
   Breadcrumbs + page header
   -------------------------------------------------------------------------- */

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--text-faint);
    font-size: 13px;
}

.breadcrumbs a {
    color: var(--text-muted);
}

.breadcrumbs span[aria-hidden] {
    opacity: 0.5;
}

.page-header {
    padding-bottom: 24px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.page-header__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 4px 10px;
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.page-header h1 {
    margin: 0 0 12px;
    font-size: clamp(1.9rem, 3vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.page-header__lede {
    max-width: 68ch;
    margin: 0;
    color: var(--text-muted);
    font-size: 17px;
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Prose
   -------------------------------------------------------------------------- */

.prose {
    max-width: 76ch;
}

.prose > :first-child {
    margin-top: 0;
}

.prose h2 {
    margin: 48px 0 16px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 1.55rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    line-height: 1.25;
    scroll-margin-top: calc(var(--header-h) + 20px);
}

.prose h3 {
    margin: 32px 0 12px;
    font-size: 1.16rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    scroll-margin-top: calc(var(--header-h) + 20px);
}

.prose h4 {
    margin: 24px 0 8px;
    font-size: 1rem;
    font-weight: 700;
}

.prose p {
    margin: 0 0 16px;
}

.prose ul,
.prose ol {
    margin: 0 0 18px;
    padding-left: 24px;
}

.prose li {
    margin: 6px 0;
}

.prose li > ul,
.prose li > ol {
    margin: 6px 0;
}

.prose strong {
    font-weight: 650;
}

.prose hr {
    margin: 40px 0;
    border: 0;
    border-top: 1px solid var(--border);
}

.prose blockquote {
    margin: 20px 0;
    padding: 2px 18px;
    border-left: 3px solid var(--accent);
    color: var(--text-muted);
}

.prose blockquote p:last-child {
    margin-bottom: 0;
}

/* Inline code + code blocks */

.prose code {
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--code-bg);
    font-family: var(--font-mono);
    font-size: 0.86em;
}

.code-block {
    position: relative;
    margin: 0 0 26px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: color-mix(in srgb, var(--bg-elevated) 92%, #000 8%);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.code-block__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-subtle) 72%, var(--bg-elevated));
}

.code-block__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.code-block__dots {
    display: inline-flex;
    gap: 6px;
    flex: 0 0 auto;
}

.code-block__dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-strong);
}

.code-block__dots span:nth-child(1) { background: #ef6a5e; }
.code-block__dots span:nth-child(2) { background: #f4bd50; }
.code-block__dots span:nth-child(3) { background: #61c454; }

.code-block__lang {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.code-block__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-block__btn {
    padding: 5px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 7px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 650;
    line-height: 1;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.code-block__btn:hover,
.code-block__btn:focus-visible {
    color: var(--text);
    border-color: var(--accent-border);
    background: var(--bg);
}

.code-block__btn.is-active {
    color: var(--accent);
    border-color: var(--accent-border);
    background: var(--accent-soft);
}

.prose .code-block pre,
.prose pre {
    position: relative;
    margin: 0 0 22px;
    padding: 18px 20px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    box-shadow: var(--shadow);
    line-height: 1.6;
}

.prose .code-block pre {
    margin: 0;
    padding: 18px 20px 20px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.prose pre code,
.prose .code-block pre code {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    font-size: 13.5px;
    line-height: 1.7;
}

.prose .code-block pre code {
    display: block;
    min-width: 100%;
}

.code-block pre.is-wrapped code {
    white-space: pre-wrap;
    word-break: break-word;
}

.copy-button { display: none; }

/* Tables */

.prose table {
    width: 100%;
    margin: 0 0 24px;
    border-collapse: collapse;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}

.prose th {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
}

.prose td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.prose tr:last-child td {
    border-bottom: 0;
}

.prose td code {
    white-space: nowrap;
}

.table-scroll {
    margin: 0 0 24px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.table-scroll table {
    margin: 0;
    border: 0;
    border-radius: 0;
}

/* Support callout */
.support-callout {
    margin: 32px 0 8px;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent-soft) 45%, var(--bg-elevated));
    color: var(--text-muted);
    font-size: 14px;
}
.support-callout p { margin: 0; }
.support-callout a { font-weight: 600; }

/* Mermaid diagrams */
.mermaid {
    margin: 24px 0 28px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    box-shadow: var(--shadow);
    overflow-x: auto;
    text-align: center;
}
.mermaid svg { max-width: 100%; height: auto; }
.diagram-caption {
    margin: -14px 0 24px;
    color: var(--text-faint);
    font-size: 13px;
    text-align: center;
}

/* Screenshots */

.screenshot,
.prose figure:not(.lightbox__dialog) {
    margin: 32px 0 36px;
}

.prose p > img,
.prose li > img,
.prose figure:not(.lightbox__dialog) img,
.screenshot img {
    display: block;
    width: min(100%, 1080px);
    margin: 0 auto;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    box-shadow: 0 12px 40px -20px rgba(0,0,0,.35);
    background: var(--bg-elevated);
    cursor: zoom-in;
}

.screenshot figcaption,
.prose figure:not(.lightbox__dialog) figcaption,
.img-caption {
    margin-top: 10px;
    color: var(--text-faint);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

.image-zoom-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: var(--text-faint);
    font-size: 12px;
}

/* Lightbox / fullscreen image preview */
.lightbox[hidden] { display: none !important; }
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
}
.lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 8, 7, 0.78);
    backdrop-filter: blur(6px);
}
[data-theme="light"] .lightbox__backdrop { background: rgba(247, 244, 239, 0.82); }
.lightbox__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(96vw, 1600px);
    height: min(92vh, 1000px);
    margin: 4vh auto;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: var(--bg-elevated);
    box-shadow: 0 30px 80px -20px rgba(0,0,0,.55);
    overflow: hidden;
}
.lightbox__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
}
.lightbox__caption {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lightbox__actions { display: flex; gap: 8px; flex: 0 0 auto; }
.lightbox__button {
    padding: 6px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 7px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font: 600 12px/1 var(--font-sans);
    cursor: pointer;
}
.lightbox__button:hover { color: var(--text); border-color: var(--accent-border); }
.lightbox__body {
    flex: 1;
    overflow: auto;
    display: grid;
    place-items: center;
    padding: 20px;
    background: color-mix(in srgb, var(--bg) 85%, #000 15%);
}
[data-theme="light"] .lightbox__body { background: color-mix(in srgb, var(--bg) 92%, #fff 8%); }
.lightbox__image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,.25);
    cursor: zoom-in;
    transition: transform .15s ease;
}
.lightbox.is-zoomed .lightbox__body { display: block; }
.lightbox.is-zoomed .lightbox__image {
    max-width: none;
    max-height: none;
    width: min(1600px, 140%);
    cursor: zoom-out;
}
@media (max-width: 720px) {
    .lightbox__dialog { width: 100vw; height: 100vh; margin: 0; border-radius: 0; border: 0; }
    .lightbox__caption { white-space: normal; }
}

/* Callouts */

.callout {
    margin: 24px 0;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--bg-elevated);
}

.callout__title {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.callout p:last-child {
    margin-bottom: 0;
}

.callout--note {
    border-left-color: var(--accent);
}

.callout--note .callout__title {
    color: var(--accent);
}

.callout--warn {
    border-left-color: #d97706;
}

.callout--warn .callout__title {
    color: #d97706;
}

[data-theme="dark"] .callout--warn {
    border-left-color: #fbbf24;
}

[data-theme="dark"] .callout--warn .callout__title {
    color: #fbbf24;
}

.callout--danger {
    border-left-color: #dc2626;
}

.callout--danger .callout__title {
    color: #dc2626;
}

/* Role cards */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin: 26px 0 30px;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
    border-color: var(--accent-border);
    text-decoration: none;
    transform: translateY(-1px);
}

.card__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.card__title::after {
    content: "→";
    color: var(--accent);
    font-weight: 400;
}

.card__desc {
    color: var(--text-muted);
    font-size: 13.5px;
    line-height: 1.55;
}

/* Role badge */

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: middle;
}

.role-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* Checklist / boundary lists */

.boundaries {
    margin: 20px 0;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
}

.boundaries h3 {
    margin: 0 0 10px;
    font-size: 14px;
}

.boundaries ul {
    margin: 0;
    padding-left: 18px;
    color: var(--text-muted);
    font-size: 14px;
}

.boundaries li {
    margin: 5px 0;
}

/* TOC */

.toc {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    align-self: start;
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
    font-size: 13px;
}

.toc__title {
    margin: 0 0 10px;
    color: var(--text-faint);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.toc ul {
    margin: 0;
    padding: 0;
    list-style: none;
    border-left: 1px solid var(--border);
}

.toc li a {
    display: block;
    margin-left: -1px;
    padding: 5px 12px;
    border-left: 2px solid transparent;
    color: var(--text-muted);
    text-decoration: none;
    line-height: 1.4;
}

.toc li a:hover {
    color: var(--text);
}

.toc li a.is-active {
    border-left-color: var(--accent);
    color: var(--accent);
}

.toc .toc-h3 a {
    padding-left: 24px;
    font-size: 12.5px;
}

/* Prev / next */

.pager {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.pager__link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    color: var(--text);
    text-decoration: none;
}

.pager__link:hover {
    border-color: var(--accent-border);
    text-decoration: none;
}

.pager__link--next {
    text-align: right;
}

.pager__label {
    color: var(--text-faint);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.pager__title {
    font-size: 14px;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    color: var(--text-faint);
    font-size: 13px;
}

.site-footer__inner a {
    color: var(--text-muted);
}

.site-footer__links {
    display: flex;
    gap: 18px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
    .manual--with-toc .manual__body {
        grid-template-columns: minmax(0, 1fr);
    }

    .toc {
        display: none;
    }
}

@media (max-width: 900px) {
    .manual {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding-top: 20px;
    }

    .sidebar-toggle {
        display: inline-grid;
    }

    .sidebar {
        position: static;
        max-height: none;
        margin-bottom: 24px;
        padding: 16px;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--bg-elevated);
        display: none;
    }

    .sidebar.is-open {
        display: block;
    }

    .brand__sub {
        display: none;
    }

    .site-nav a {
        padding: 7px 9px;
        font-size: 13px;
    }

    .pager {
        grid-template-columns: minmax(0, 1fr);
    }

    .pager__link--next {
        text-align: left;
    }
}

@media (max-width: 620px) {
    .site-header__inner {
        padding: 0 16px;
        gap: 10px;
    }

    .manual {
        padding: 16px 16px 56px;
    }

    .site-nav a.site-nav__landing,
    .site-nav a[href*="github.com"] {
        display: none;
    }

    .prose table {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
    }
}

/* Rouge syntax highlighting (dark-friendly, theme-aware) */

.highlight .c,
.highlight .c1,
.highlight .cm {
    color: #71717a;
}

.highlight .k,
.highlight .kd,
.highlight .kn {
    color: #c084fc;
}

.highlight .s,
.highlight .s1,
.highlight .s2 {
    color: #34d399;
}

.highlight .mi,
.highlight .mf {
    color: #fbbf24;
}

.highlight .na,
.highlight .nv {
    color: #fdba74;
}

[data-theme="light"] .highlight .k,
[data-theme="light"] .highlight .kd,
[data-theme="light"] .highlight .kn {
    color: #7c3aed;
}

[data-theme="light"] .highlight .s,
[data-theme="light"] .highlight .s1,
[data-theme="light"] .highlight .s2 {
    color: #047857;
}

[data-theme="light"] .highlight .mi,
[data-theme="light"] .highlight .mf {
    color: #b45309;
}

[data-theme="light"] .highlight .na,
[data-theme="light"] .highlight .nv {
    color: #1d4ed8;
}
