/* ==========================================================================
   nopCommerce documentation – site styles
   ========================================================================== */

:root {
    --accent: #0a8fc7;
    --accent-strong: #06739f;
    --accent-soft: #e6f5fb;
    --bg: #ffffff;
    --bg-soft: #f6f8fa;
    --bg-elev: #ffffff;
    --border: #e3e8ee;
    --text: #1c2430;
    --text-soft: #4a5565;
    --muted: #6b7785;
    --code-bg: #f3f5f8;
    --code-text: #24292f;
    --mark: #fff1a8;
    --shadow: 0 10px 30px rgba(17, 24, 39, .12), 0 2px 6px rgba(17, 24, 39, .06);
    --topbar-h: 60px;
    --sidebar-w: 290px;
    --toc-w: 230px;
    --content-max: 840px;
    --radius: 10px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;

    --note: #0969da;  --note-bg: #eef6ff;
    --tip: #1a7f37;   --tip-bg: #edf9f0;
    --important: #8250df; --important-bg: #f5f0ff;
    --warning: #9a6700; --warning-bg: #fff8e5;
    --caution: #cf222e; --caution-bg: #fff0f0;

    --hl-keyword: #cf222e; --hl-string: #0a3069; --hl-comment: #6e7781; --hl-number: #0550ae;
    --hl-title: #8250df; --hl-attr: #0550ae; --hl-type: #953800; --hl-meta: #116329;

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --accent: #3bb6ea; --accent-strong: #6ccaf2; --accent-soft: #0f2a38;
        --bg: #0f1419; --bg-soft: #151b22; --bg-elev: #1a2129; --border: #2a333d;
        --text: #e6edf3; --text-soft: #c2cbd5; --muted: #8b96a3;
        --code-bg: #161d25; --code-text: #e6edf3; --mark: #6b5a00;
        --shadow: 0 10px 30px rgba(0, 0, 0, .5);
        --note: #4493f8; --note-bg: #0d1d33; --tip: #3fb950; --tip-bg: #0d2316;
        --important: #a371f7; --important-bg: #1e1533; --warning: #d29922; --warning-bg: #2a2008;
        --caution: #f85149; --caution-bg: #2d1214;
        --hl-keyword: #ff7b72; --hl-string: #a5d6ff; --hl-comment: #8b949e; --hl-number: #79c0ff;
        --hl-title: #d2a8ff; --hl-attr: #79c0ff; --hl-type: #ffa657; --hl-meta: #7ee787;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --accent: #3bb6ea; --accent-strong: #6ccaf2; --accent-soft: #0f2a38;
    --bg: #0f1419; --bg-soft: #151b22; --bg-elev: #1a2129; --border: #2a333d;
    --text: #e6edf3; --text-soft: #c2cbd5; --muted: #8b96a3;
    --code-bg: #161d25; --code-text: #e6edf3; --mark: #6b5a00;
    --shadow: 0 10px 30px rgba(0, 0, 0, .5);
    --note: #4493f8; --note-bg: #0d1d33; --tip: #3fb950; --tip-bg: #0d2316;
    --important: #a371f7; --important-bg: #1e1533; --warning: #d29922; --warning-bg: #2a2008;
    --caution: #f85149; --caution-bg: #2d1214;
    --hl-keyword: #ff7b72; --hl-string: #a5d6ff; --hl-comment: #8b949e; --hl-number: #79c0ff;
    --hl-title: #d2a8ff; --hl-attr: #79c0ff; --hl-type: #ffa657; --hl-meta: #7ee787;
    color-scheme: dark;
}

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

html { scroll-padding-top: calc(var(--topbar-h) + 16px); -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
.muted { color: var(--muted); }
kbd {
    font-family: var(--font-mono); font-size: .75em; padding: .1em .45em;
    border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px;
    background: var(--bg-soft); color: var(--text-soft); white-space: nowrap;
}
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--bg); padding: 8px 12px; border-radius: 6px; }
.skip-link:focus { left: 8px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.filled { fill: currentColor; stroke: none; }

/* ---------- top bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 40;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 16px;
    padding: 0 20px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand img { height: 28px; width: auto; display: block; }
:root[data-theme="dark"] .brand img { filter: brightness(1.6) saturate(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand img { filter: brightness(1.6) saturate(.9); } }
.brand-sub {
    font-weight: 600; font-size: 15px; color: var(--muted);
    padding-left: 10px; border-left: 1px solid var(--border);
}
.search-trigger {
    flex: 1; max-width: 460px; margin: 0 auto;
    display: flex; align-items: center; gap: 10px;
    height: 38px; padding: 0 10px 0 12px;
    font: inherit; font-size: 14px; color: var(--muted);
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: 9px;
    cursor: pointer; text-align: left;
}
.search-trigger:hover { border-color: var(--accent); }
.search-trigger span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 8px;
    color: var(--text-soft); background: transparent; border: 0; cursor: pointer;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.menu-btn { display: none; }
.lang-switch select {
    height: 36px; padding: 0 28px 0 10px; font: inherit; font-size: 14px;
    color: var(--text); background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px;
    appearance: none; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: right 13px center, right 8px center; background-size: 5px 5px; background-repeat: no-repeat;
}
.icon-btn .moon { display: none; }
:root[data-theme="dark"] .icon-btn .sun { display: none; }
:root[data-theme="dark"] .icon-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .icon-btn .sun { display: none; }
    :root:not([data-theme="light"]) .icon-btn .moon { display: block; }
}

/* ---------- layout ---------- */
.shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
    min-height: calc(100vh - var(--topbar-h));
    max-width: 1560px; margin: 0 auto;
}
.shell:not(:has(.toc)) { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }

/* ---------- sidebar ---------- */
.sidebar { border-right: 1px solid var(--border); }
.sidebar-inner {
    position: sticky; top: var(--topbar-h);
    max-height: calc(100vh - var(--topbar-h)); overflow-y: auto;
    padding: 18px 14px 40px 16px;
    scrollbar-width: thin;
}
.nav-filter {
    width: 100%; height: 34px; margin-bottom: 12px; padding: 0 10px;
    font: inherit; font-size: 14px; color: var(--text);
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px;
}
.nav-filter:focus, .search-page-form input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.nav-tree, .nav-tree ul { list-style: none; margin: 0; padding: 0; }
.nav-tree ul { margin-left: 10px; padding-left: 8px; border-left: 1px solid var(--border); }
.nav-tree li { margin: 1px 0; }
.nav-tree a, .nav-tree .nav-label {
    display: block; padding: 5px 8px; border-radius: 6px;
    font-size: 14px; line-height: 1.4; color: var(--text-soft);
}
.nav-tree > li > a, .nav-tree > li > details > summary > a { font-weight: 600; color: var(--text); }
.nav-tree a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.nav-tree a.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.nav-tree summary {
    list-style: none; display: flex; align-items: center; cursor: pointer; border-radius: 6px;
}
.nav-tree summary::-webkit-details-marker { display: none; }
.nav-tree summary > a, .nav-tree summary > .nav-label { flex: 1; }
.nav-tree summary::after {
    content: ""; flex-shrink: 0; width: 7px; height: 7px; margin: 0 8px 0 4px;
    border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
    transform: rotate(-45deg); transition: transform .15s;
}
.nav-tree details[open] > summary::after { transform: rotate(45deg); }
.ext-icon { font-size: 11px; margin-left: 4px; color: var(--muted); }
.nav-tree li.filtered-out { display: none; }
.nav-tree mark { background: var(--mark); color: inherit; border-radius: 2px; }
.sidebar-backdrop { display: none; }

/* ---------- content ---------- */
.content { min-width: 0; padding: 28px 48px 64px; }
.content > * { max-width: var(--content-max); }
.content.home > * { max-width: 1040px; }

.breadcrumbs ol { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: 14px; color: var(--muted); }
.breadcrumbs li:not(:last-child)::after { content: "›"; margin-left: 6px; color: var(--border); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs [aria-current] { color: var(--text-soft); }

.doc { overflow-wrap: break-word; }
.doc h1, .doc h2, .doc h3, .doc h4 { line-height: 1.3; color: var(--text); scroll-margin-top: calc(var(--topbar-h) + 16px); position: relative; }
.doc h1 { font-size: 2.1rem; margin: 0 0 .6em; letter-spacing: -.02em; }
.doc h2 { font-size: 1.5rem; margin: 2.2em 0 .7em; padding-top: .3em; border-top: 1px solid var(--border); letter-spacing: -.01em; }
.doc h1 + h2 { border-top: 0; margin-top: 1em; }
.doc h3 { font-size: 1.2rem; margin: 1.8em 0 .5em; }
.doc h4 { font-size: 1.05rem; margin: 1.5em 0 .4em; }
.doc .anchor-link {
    position: absolute; left: -1.1em; padding-right: .3em; color: var(--muted);
    opacity: 0; text-decoration: none; font-weight: 400;
}
.doc h2:hover .anchor-link, .doc h3:hover .anchor-link, .doc h4:hover .anchor-link, .doc .anchor-link:focus { opacity: 1; }
.doc p, .doc ul, .doc ol, .doc dl { margin: 0 0 1em; }
.doc ul, .doc ol { padding-left: 1.5em; }
.doc li { margin: .25em 0; }
.doc li > p { margin-bottom: .4em; }
.doc strong { font-weight: 650; }
.doc hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.doc img { max-width: 100%; height: auto; }
.doc img.doc-img {
    display: block; margin: 1em 0; border: 1px solid var(--border); border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06); cursor: zoom-in; background: #fff;
}
.doc p > img.doc-img:only-child { margin: 1.2em 0; }
.doc li img.doc-img { margin: .6em 0; }
.doc a.ext::after { content: "↗"; font-size: .75em; margin-left: 2px; vertical-align: super; line-height: 0; }
.doc iframe, .doc video { max-width: 100%; border: 0; border-radius: 8px; }

.doc code {
    font-family: var(--font-mono); font-size: .875em;
    background: var(--code-bg); color: var(--code-text);
    padding: .15em .4em; border-radius: 5px; border: 1px solid var(--border);
}
.doc pre {
    position: relative; margin: 1.2em 0; padding: 16px 18px; overflow-x: auto;
    background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 14px; line-height: 1.55;
}
.doc pre code { background: none; border: 0; padding: 0; font-size: inherit; color: var(--code-text); }
.copy-btn {
    position: absolute; top: 8px; right: 8px;
    font: inherit; font-size: 12px; padding: 3px 9px; border-radius: 6px; cursor: pointer;
    color: var(--text-soft); background: var(--bg-elev); border: 1px solid var(--border);
    opacity: 0; transition: opacity .15s;
}
.doc pre:hover .copy-btn, .copy-btn:focus { opacity: 1; }

.table-wrap { overflow-x: auto; margin: 1.2em 0; border: 1px solid var(--border); border-radius: var(--radius); }
.doc table { border-collapse: collapse; width: 100%; font-size: 15px; }
.doc th, .doc td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.doc th { background: var(--bg-soft); font-weight: 650; }
.doc tr:last-child td { border-bottom: 0; }

.doc blockquote { margin: 1.2em 0; padding: .2em 1em; border-left: 4px solid var(--border); color: var(--text-soft); }

/* alerts (> [!NOTE] ...) */
.markdown-alert {
    margin: 1.3em 0; padding: 12px 16px 2px;
    border-left: 4px solid var(--alert); border-radius: 8px;
    background: var(--alert-bg);
}
.markdown-alert > :last-child { margin-bottom: 10px; }
.markdown-alert-title {
    display: flex; align-items: center; gap: 8px; margin: 0 0 6px !important;
    font-weight: 650; color: var(--alert);
}
.markdown-alert-title::before {
    content: ""; width: 18px; height: 18px; flex-shrink: 0;
    background: currentColor;
    -webkit-mask: var(--alert-icon) center / contain no-repeat; mask: var(--alert-icon) center / contain no-repeat;
}
.markdown-alert-note { --alert: var(--note); --alert-bg: var(--note-bg); --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6M12 7.5v.5'/%3E%3C/svg%3E"); }
.markdown-alert-tip { --alert: var(--tip); --alert-bg: var(--tip-bg); --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 21h4M12 3a6 6 0 0 0-4 10.5c.7.7 1 1.5 1 2.5h6c0-1 .3-1.8 1-2.5A6 6 0 0 0 12 3z'/%3E%3C/svg%3E"); }
.markdown-alert-important { --alert: var(--important); --alert-bg: var(--important-bg); --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3Cpath d='M12 7v4M12 14v.5'/%3E%3C/svg%3E"); }
.markdown-alert-warning { --alert: var(--warning); --alert-bg: var(--warning-bg); --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4M12 17v.5'/%3E%3C/svg%3E"); }
.markdown-alert-caution { --alert: var(--caution); --alert-bg: var(--caution-bg); --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7.9 2h8.2L22 7.9v8.2L16.1 22H7.9L2 16.1V7.9z'/%3E%3Cpath d='M12 8v4M12 16v.5'/%3E%3C/svg%3E"); }

/* doc meta + pager */
.doc-meta {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
    margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 14px;
}
.contributors { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.contributors img { width: 24px; height: 24px; border-radius: 50%; display: block; border: 1px solid var(--border); background: var(--bg-soft); }
.edit-link { display: inline-flex; align-items: center; gap: 6px; }
.edit-link svg { width: 16px; height: 16px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.pager a {
    display: flex; flex-direction: column; gap: 2px; padding: 14px 16px;
    border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
}
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager a strong { color: var(--accent); font-weight: 600; }
.pager .pager-next { text-align: right; grid-column: 2; }
.pager span.muted { font-size: 13px; }

/* ---------- on this page ---------- */
.toc-inner {
    position: sticky; top: var(--topbar-h);
    max-height: calc(100vh - var(--topbar-h)); overflow-y: auto;
    padding: 30px 18px 40px 8px; font-size: 13.5px; scrollbar-width: thin;
}
.toc h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.toc ul { list-style: none; margin: 0 0 16px; padding: 0; border-left: 1px solid var(--border); }
.toc li a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; color: var(--text-soft); border-left: 2px solid transparent; line-height: 1.4; }
.toc li.lvl-3 a { padding-left: 24px; font-size: 13px; }
.toc li a:hover { color: var(--accent); text-decoration: none; }
.toc li a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.back-to-top { font-size: 13px; }

/* ---------- home page (quick links from index.md) ---------- */
.home .doc > h1 { font-size: 2.4rem; }
.home .doc > p:first-of-type { font-size: 1.1rem; color: var(--text-soft); }
.home .click-links-title { border-top: 0; margin: 1.6em 0 .6em; font-size: 1.35rem; }
.home .quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 14px; }
.home .quick-item {
    position: relative; padding: 16px 16px 14px 84px; min-height: 96px;
    background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.home .quick-item:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.home .quick-item::before {
    content: ""; position: absolute; left: 14px; top: 16px; width: 56px; height: 56px;
    border-radius: 14px; background: var(--accent-soft) var(--icon) center / 46px auto no-repeat;
}
.home .quick-item h3 { margin: 0 0 4px; font-size: 1.02rem; border: 0; }
.home .quick-item > a { color: var(--text); }
.home .quick-item > a::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.home .quick-item p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.home .quick-item p a { position: relative; z-index: 1; }
.home .quick-item.pre-installed { --icon: url(/img/quick/installation-upgrade.png); }
.home .quick-item.cloud-hosting { --icon: url(/img/quick/cloud-hosting.png); }
.home .quick-item.manually { --icon: url(/img/quick/customization-services.png); }
.home .quick-item.admin-panel { --icon: url(/img/quick/administration.png); }
.home .quick-item.design { --icon: url(/img/quick/web-design-services.png); }
.home .quick-item.catalog { --icon: url(/img/quick/live-shops.png); }
.home .quick-item.payments { --icon: url(/img/quick/payments.png); }
.home .quick-item.shipping { --icon: url(/img/quick/shipping-category.png); }
.home .quick-item.more { --icon: url(/img/quick/allfeatures.png); }
.home .quick-item.orders { --icon: url(/img/quick/fast.png); }
.home .quick-item.customers { --icon: url(/img/quick/members.png); }
.home .quick-item.content { --icon: url(/img/quick/showcase.png); }
.home .quick-item.promotional { --icon: url(/img/quick/marketing.png); }
.home .quick-item.search-engines { --icon: url(/img/quick/usability.png); }
.home .quick-item.analytics { --icon: url(/img/quick/certification-directory.png); }
.home .quick-item.premium { --icon: url(/img/quick/premium-services.png); }
.home .quick-item.forums { --icon: url(/img/quick/community-forums.png); }
.home .quick-item.plugins { --icon: url(/img/quick/integrations.png); }
.home .quick-item.course { --icon: url(/img/quick/course.png); }

/* ---------- search dialog ---------- */
.search-dialog {
    width: min(680px, calc(100vw - 24px)); max-height: min(640px, calc(100vh - 80px));
    margin: 64px auto auto; padding: 0;
    color: var(--text); background: var(--bg-elev);
    border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
    display: none; flex-direction: column; overflow: hidden;
}
.search-dialog[open] { display: flex; }
.search-dialog::backdrop { background: rgba(10, 15, 20, .45); backdrop-filter: blur(2px); }
.search-box { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.search-box svg { color: var(--muted); }
.search-box input {
    flex: 1; height: 56px; font: inherit; font-size: 17px; color: var(--text);
    background: transparent; border: 0; outline: 0;
}
.search-box input::-webkit-search-cancel-button { display: none; }
.search-results { overflow-y: auto; padding: 6px; }
.search-results:empty { display: none; }
.search-hit {
    display: block; padding: 10px 12px; border-radius: 8px; color: var(--text);
}
.search-hit:hover, .search-hit.selected { background: var(--accent-soft); text-decoration: none; }
.search-hit .hit-path { font-size: 12px; color: var(--muted); margin-bottom: 1px; }
.search-hit .hit-title { font-weight: 600; color: var(--accent-strong); }
.search-hit .hit-snippet { font-size: 13.5px; color: var(--text-soft); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-hit.all { text-align: center; font-size: 14px; color: var(--accent); }
mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
.search-footer { display: flex; justify-content: space-between; gap: 12px; padding: 9px 16px; border-top: 1px solid var(--border); font-size: 12.5px; }
.search-footer kbd { margin-right: 2px; }

/* search page */
.search-page-form { display: flex; gap: 8px; margin: 0 0 24px; }
.search-page-form input {
    flex: 1; height: 44px; padding: 0 14px; font: inherit; color: var(--text);
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: 9px;
}
.search-page-form button {
    height: 44px; padding: 0 20px; font: inherit; font-weight: 600; color: #fff;
    background: var(--accent); border: 0; border-radius: 9px; cursor: pointer;
}
.search-page-form button:hover { background: var(--accent-strong); }
.search-page-results { list-style: none; padding: 0; }
.search-page-results li { padding: 14px 0; border-bottom: 1px solid var(--border); }
.search-page-results .hit-path { font-size: 13px; }
.search-page-results .hit-title { font-size: 1.1rem; font-weight: 600; }
.search-page-results .hit-snippet { margin: 4px 0 0; color: var(--text-soft); font-size: 15px; }

.not-found .big-code { font-size: 5rem; font-weight: 800; color: var(--accent); margin: 0; line-height: 1; letter-spacing: -.04em; }

/* lightbox */
.lightbox { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
.lightbox::backdrop { background: rgba(0, 0, 0, .8); }
.lightbox img { display: block; max-width: 96vw; max-height: 94vh; border-radius: 8px; background: #fff; cursor: zoom-out; }

/* footer */
.site-footer {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
    padding: 20px 24px; border-top: 1px solid var(--border); font-size: 13.5px; background: var(--bg-soft);
}

/* highlight.js tokens */
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-built_in.hljs-keyword { color: var(--hl-keyword); }
.hljs-string, .hljs-regexp, .hljs-template-variable { color: var(--hl-string); }
.hljs-comment, .hljs-quote { color: var(--hl-comment); font-style: italic; }
.hljs-number, .hljs-symbol, .hljs-bullet, .hljs-variable { color: var(--hl-number); }
.hljs-title, .hljs-title.class_, .hljs-title.function_, .hljs-section { color: var(--hl-title); }
.hljs-attr, .hljs-attribute, .hljs-property, .hljs-name, .hljs-tag { color: var(--hl-attr); }
.hljs-type, .hljs-built_in, .hljs-params { color: var(--hl-type); }
.hljs-meta, .hljs-selector-class, .hljs-selector-id, .hljs-addition { color: var(--hl-meta); }
.hljs-deletion { color: var(--caution); }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
    .shell, .shell:not(:has(.toc)) { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
    .toc { display: none; }
}

@media (max-width: 900px) {
    :root { --topbar-h: 56px; }
    .topbar { gap: 8px; padding: 0 10px; }
    .menu-btn { display: inline-flex; }
    .brand-sub { display: none; }
    .brand img { height: 24px; }
    .search-trigger { max-width: none; }
    .search-trigger kbd, .search-trigger span { display: none; }
    .search-trigger { flex: 0 0 38px; width: 38px; padding: 0; justify-content: center; margin: 0 0 0 auto; }
    .shell, .shell:not(:has(.toc)) { grid-template-columns: minmax(0, 1fr); }
    .sidebar {
        position: fixed; z-index: 50; top: var(--topbar-h); bottom: 0; left: 0;
        width: min(86vw, 340px); background: var(--bg);
        transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow);
    }
    .sidebar-inner { position: static; max-height: 100%; height: 100%; }
    body.menu-open .sidebar { transform: none; }
    body.menu-open .sidebar-backdrop { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 45; background: rgba(0, 0, 0, .35); }
    body.menu-open { overflow: hidden; }
    .content { padding: 20px 16px 48px; }
    .doc h1 { font-size: 1.7rem; }
    .doc h2 { font-size: 1.3rem; }
    .doc .anchor-link { display: none; }
    .pager { grid-template-columns: 1fr; }
    .pager .pager-next { grid-column: 1; }
    .search-dialog { margin-top: 12px; max-height: calc(100vh - 24px); }
}

@media (max-width: 420px) {
    .lang-switch select { padding: 0 22px 0 8px; font-size: 13px; }
    .topbar-actions .icon-btn[aria-label="GitHub"] { display: none; }
}

@media print {
    .topbar, .sidebar, .toc, .pager, .doc-meta, .site-footer, .copy-btn { display: none !important; }
    .shell { display: block; }
    .content { padding: 0; }
}
