/*
 * PikoGuide — public site stylesheet.
 * Plain CSS, no build step. Logical properties everywhere so the same file
 * serves RTL (pikoguide.ir) and LTR (pikoguide.com).
 * Never use letter-spacing on Persian text: it breaks letter joining.
 */

@font-face {
    font-family: "Vazirmatn";
    src: url("/fonts/vazirmatn-variable.woff2") format("woff2-variations"),
         url("/fonts/vazirmatn-variable.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
    --font-sans: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
    --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
    --container: 1320px;
    --header-h: 64px;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --ease: cubic-bezier(.2, .7, .2, 1);
    --slide-from: -100%;

    color-scheme: light;
    --bg: #ffffff;
    --bg-soft: #f6f8fb;
    --bg-sunken: #eef2f7;
    --surface: #ffffff;
    --border: #e3e8ef;
    --border-strong: #cdd6e2;
    --text: #0e1726;
    --text-2: #354357;
    --muted: #637086;
    --accent: #0d8f86;
    --accent-2: #2563eb;
    --accent-hover: #0a756e;
    --accent-soft: #e4f4f2;
    --accent-line: rgb(13 143 134 / .35);
    --accent-contrast: #ffffff;
    --link: #0a7a72;
    --link-line: rgb(10 122 114 / .35);
    --focus: #2563eb;
    --grid-line: rgb(15 23 42 / .055);
    --header-bg: rgb(255 255 255 / .82);
    --shadow: 0 1px 2px rgb(15 23 42 / .04), 0 10px 30px -12px rgb(15 23 42 / .16);
    --shadow-lg: 0 1px 2px rgb(15 23 42 / .05), 0 24px 48px -20px rgb(15 23 42 / .22);

    --code-bg: #0d1420;
    --code-bar: #111a28;
    --code-border: #1c2738;
    --code-text: #d7deea;
    --inline-code-bg: #eef2f7;
    --inline-code-text: #0f3f5c;

    --note: #2563eb;    --note-bg: #eff5ff;   --note-border: #cfe0ff;
    --info: #0284c7;    --info-bg: #ecf8fe;   --info-border: #c7e9fb;
    --tip: #0d8f86;     --tip-bg: #e9f7f5;    --tip-border: #c3ebe6;
    --warning: #b45309; --warning-bg: #fff7ea; --warning-border: #fbdcae;
    --danger: #dc2626;  --danger-bg: #fef1f1;  --danger-border: #f9cccc;

    --preview-bg: #fff4d6;
    --preview-text: #7a4b00;
}

:root[dir="rtl"] { --slide-from: 100%; }

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0a0f18;
    --bg-soft: #0e1522;
    --bg-sunken: #131c2b;
    --surface: #0f1726;
    --border: #1d2939;
    --border-strong: #2a3a51;
    --text: #e8eef7;
    --text-2: #bac5d5;
    --muted: #8391a7;
    --accent: #2dd4bf;
    --accent-2: #60a5fa;
    --accent-hover: #5eead4;
    --accent-soft: rgb(45 212 191 / .11);
    --accent-line: rgb(45 212 191 / .35);
    --accent-contrast: #032320;
    --link: #5eead4;
    --link-line: rgb(94 234 212 / .35);
    --focus: #60a5fa;
    --grid-line: rgb(148 163 184 / .07);
    --header-bg: rgb(10 15 24 / .78);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px -12px rgb(0 0 0 / .55);
    --shadow-lg: 0 1px 2px rgb(0 0 0 / .3), 0 24px 48px -20px rgb(0 0 0 / .7);
    --code-bg: #070c14;
    --code-bar: #0b121d;
    --code-border: #1a2434;
    --inline-code-bg: #16202f;
    --inline-code-text: #9fe7dc;
    --note-bg: rgb(96 165 250 / .09);   --note-border: rgb(96 165 250 / .25);   --note: #7ab5ff;
    --info-bg: rgb(56 189 248 / .09);   --info-border: rgb(56 189 248 / .25);   --info: #56c7f7;
    --tip-bg: rgb(45 212 191 / .09);    --tip-border: rgb(45 212 191 / .25);    --tip: #2dd4bf;
    --warning-bg: rgb(245 158 11 / .09); --warning-border: rgb(245 158 11 / .28); --warning: #fbbf24;
    --danger-bg: rgb(248 113 113 / .09); --danger-border: rgb(248 113 113 / .28); --danger: #f87171;
    --preview-bg: rgb(245 158 11 / .14);
    --preview-text: #fcd34d;
}

/* No-JS fallback: follow the system theme. */
@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] {
        color-scheme: dark;
        --bg: #0a0f18; --bg-soft: #0e1522; --bg-sunken: #131c2b; --surface: #0f1726;
        --border: #1d2939; --border-strong: #2a3a51;
        --text: #e8eef7; --text-2: #bac5d5; --muted: #8391a7;
        --accent: #2dd4bf; --accent-2: #60a5fa; --accent-hover: #5eead4; --accent-soft: rgb(45 212 191 / .11);
        --accent-line: rgb(45 212 191 / .35); --accent-contrast: #032320; --link: #5eead4; --link-line: rgb(94 234 212 / .35);
        --focus: #60a5fa; --grid-line: rgb(148 163 184 / .07); --header-bg: rgb(10 15 24 / .78);
        --code-bg: #070c14; --code-bar: #0b121d; --code-border: #1a2434; --inline-code-bg: #16202f; --inline-code-text: #9fe7dc;
        --preview-bg: rgb(245 158 11 / .14); --preview-text: #fcd34d;
    }
}

/* ---------- Base ---------- */

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

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

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

html.no-scroll { overflow: hidden; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.85;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.site-main { flex: 1 0 auto; }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.45; font-weight: 800; }

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    border-radius: 6px;
}

::selection { background: var(--accent-soft); color: var(--text); }

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 18px;
}

@media (min-width: 768px) {
    .container { padding-inline: 28px; }
}

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

.muted { color: var(--muted); }

.skip-link {
    position: absolute;
    top: -100px;
    inset-inline-start: 12px;
    z-index: 200;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--accent-contrast);
    font-weight: 700;
}
.skip-link:focus { top: 12px; }

.icon { flex: none; }
[dir="ltr"] .icon.flip { transform: scaleX(-1); }

/* ---------- Buttons, chips ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding-inline: 20px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: .95rem;
    white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s;
}

.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost { border-color: var(--border-strong); background: var(--surface); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.icon-btn {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-2);
    transition: background-color .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--text); border-color: var(--border-strong); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font-size: .88rem;
    font-weight: 600;
    transition: border-color .15s, color .15s, background-color .15s;
}
.chip:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
    background: var(--header-bg);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    backdrop-filter: saturate(1.6) blur(14px);
}

.header-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--header-h);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: none;
    color: var(--text);
    font-weight: 900;
    font-size: 1.15rem;
}

.logo .logo-bg { fill: var(--accent); }
.logo .logo-mark { stroke: var(--accent-contrast); }
.logo .logo-dot { fill: var(--accent-contrast); }

.header-nav {
    display: none;
    align-items: center;
    gap: 2px;
    margin-inline-start: 12px;
    min-width: 0;
    overflow: hidden;
}

.header-nav a {
    padding: 6px 11px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: .92rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color .15s, color .15s;
}
.header-nav a:hover { background: var(--bg-soft); color: var(--text); }
.header-nav a.is-active { background: var(--accent-soft); color: var(--accent); }

.header-search {
    position: relative;
    display: none;
    align-items: center;
    width: min(300px, 28vw);
    margin-inline-start: auto;
}

.header-search input {
    width: 100%;
    height: 40px;
    padding-inline: 38px 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-soft);
    font-size: .9rem;
    outline: none;
    transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.header-search input::placeholder { color: var(--muted); }
.header-search input:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.header-search-icon {
    position: absolute;
    inset-inline-start: 12px;
    color: var(--muted);
    pointer-events: none;
}

.header-search-kbd {
    position: absolute;
    inset-inline-end: 10px;
    display: grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: .75rem;
    line-height: 1;
    pointer-events: none;
}

.theme-toggle { margin-inline-start: auto; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

@media (min-width: 640px) {
    .header-search { display: flex; }
    .theme-toggle { margin-inline-start: 0; }
}

@media (min-width: 1100px) {
    .header-nav { display: flex; }
    .nav-toggle { display: none; }
}

/* ---------- Drawer ---------- */

.drawer { position: fixed; inset: 0; z-index: 100; }
.drawer[hidden] { display: none; }

.drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgb(2 6 23 / .52);
    animation: fade-in .2s ease-out;
}

.drawer-panel {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: min(340px, 88vw);
    padding: 16px;
    overflow-y: auto;
    border-inline-end: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: slide-in .26s var(--ease);
}

.drawer-head { display: flex; align-items: center; justify-content: space-between; }

.drawer-search { position: relative; display: flex; align-items: center; }
.drawer-search .icon { position: absolute; inset-inline-start: 12px; color: var(--muted); }
.drawer-search input {
    width: 100%;
    height: 44px;
    padding-inline: 38px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-soft);
    outline: none;
}
.drawer-search input:focus { border-color: var(--accent); }

.drawer-group + .drawer-group { margin-top: 6px; }

.drawer-root {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    font-weight: 800;
}
.drawer-root .icon { color: var(--accent); }
.drawer-root:hover { background: var(--bg-soft); }

.drawer-nav ul { list-style: none; margin: 0 0 4px; padding: 0 0 0; padding-inline-start: 38px; }
.drawer-nav li a { display: block; padding: 5px 0; color: var(--text-2); font-size: .92rem; }
.drawer-nav li a:hover { color: var(--accent); }

@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(var(--slide-from)); } }

/* ---------- Hero ---------- */

.hero {
    position: relative;
    overflow: hidden;
    padding-block: 64px 52px;
    border-bottom: 1px solid var(--border);
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 60% at 50% -5%, var(--accent-soft), transparent 70%),
        linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 44px 44px,
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse 80% 75% at 50% 0%, #000 45%, transparent 100%);
    mask-image: radial-gradient(ellipse 80% 75% at 50% 0%, #000 45%, transparent 100%);
}

.hero-inner {
    position: relative;
    max-width: 900px;
    text-align: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font-size: .85rem;
    font-weight: 600;
    box-shadow: var(--shadow);
}

.eyebrow-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero-title {
    margin-top: 22px;
    font-size: clamp(1.9rem, 1.1rem + 3.4vw, 3.5rem);
    line-height: 1.35;
    font-weight: 900;
}

.hero-title .text-gradient { display: block; }

.text-gradient {
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-lead {
    max-width: 700px;
    margin: 20px auto 32px;
    color: var(--text-2);
    font-size: clamp(1rem, .95rem + .3vw, 1.15rem);
    line-height: 2;
}

.hero-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 660px;
    margin-inline: auto;
    padding: 7px;
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    transition: border-color .15s, box-shadow .15s;
}
.hero-search:focus-within { border-color: var(--accent); box-shadow: var(--shadow-lg), 0 0 0 5px var(--accent-soft); }

.hero-search-icon { position: absolute; inset-inline-start: 20px; color: var(--muted); pointer-events: none; }

.hero-search input {
    flex: 1;
    min-width: 0;
    height: 48px;
    padding-inline: 46px 8px;
    border: 0;
    background: transparent;
    font-size: 1.02rem;
    outline: none;
}
.hero-search input::placeholder { color: var(--muted); }
.hero-search .btn { height: 48px; border-radius: 13px; }

.hero-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
}
.hero-chips-label { color: var(--muted); font-size: .88rem; }

@media (min-width: 768px) {
    .hero { padding-block: 96px 76px; }
}

/* ---------- Blocks & grids ---------- */

.block { padding-block: 52px 8px; }
.block:last-child { padding-bottom: 72px; }

.block-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.block-head h2 { font-size: clamp(1.35rem, 1.15rem + .7vw, 1.7rem); font-weight: 900; }
.block-head p { margin-top: 2px; color: var(--muted); }

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
    gap: 14px;
}

.section-card {
    display: flex;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    transition: border-color .2s, box-shadow .2s, transform .2s var(--ease);
}
.section-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-2px); }

.section-card-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: var(--accent-soft);
    color: var(--accent);
}

.section-card-body { display: flex; flex-direction: column; min-width: 0; }
.section-card-title { font-weight: 800; font-size: 1.06rem; }

.section-card-desc {
    display: -webkit-box;
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.75;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.section-card-meta { margin-top: 10px; color: var(--accent); font-size: .8rem; font-weight: 700; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 14px;
}
.card-grid-compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

.article-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    transition: border-color .2s, box-shadow .2s, transform .2s var(--ease);
}
.article-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-2px); }

.article-card-link { display: flex; flex-direction: column; height: 100%; padding: 20px; }
.article-card-section { color: var(--accent); font-size: .8rem; font-weight: 700; }
.article-card-title { margin: 6px 0 8px; font-size: 1.08rem; line-height: 1.65; font-weight: 800; }

.article-card-summary {
    display: -webkit-box;
    flex: 1;
    overflow: hidden;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.85;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.article-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; color: var(--muted); font-size: .8rem; }

.empty-state {
    padding: 44px 24px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    color: var(--muted);
    text-align: center;
}
.empty-state p + p { margin-top: 6px; }

/* ---------- Pages ---------- */

.page { padding-block: 26px 72px; }
.page-narrow { max-width: 860px; }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin: 18px 0 26px; }
.page-head h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); font-weight: 900; }
.page-head-plain { margin-top: 8px; }

.page-head-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: var(--accent-soft);
    color: var(--accent);
}

.page-lead { max-width: 760px; margin-top: 6px; color: var(--text-2); font-size: 1.05rem; line-height: 1.95; }

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: .84rem;
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; }
/* Taller tap target (~44px) without changing the visual layout. */
.breadcrumbs a { padding-block: 11px; margin-block: -11px; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .icon { opacity: .6; }
.breadcrumbs [aria-current] { color: var(--text-2); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 36px; }

.page-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding-inline: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: .9rem;
    font-weight: 700;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.is-disabled { opacity: .4; pointer-events: none; }
.page-status { color: var(--muted); font-size: .9rem; }

/* ---------- Search ---------- */

.search-form {
    position: relative;
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
    padding: 6px;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    background: var(--surface);
}
.search-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-form-icon { position: absolute; inset-inline-start: 18px; top: 50%; translate: 0 -50%; color: var(--muted); }
.search-form input { flex: 1; min-width: 0; height: 44px; padding-inline: 42px 8px; border: 0; background: transparent; outline: none; }

.search-count { margin-bottom: 8px; }

.result-list { margin: 0; padding: 0; list-style: none; }
.result + .result { border-top: 1px solid var(--border); }
.result-link { display: flex; flex-direction: column; gap: 3px; padding: 16px 4px; }
.result-link:hover .result-title { color: var(--accent); }
.result-section { color: var(--accent); font-size: .8rem; font-weight: 700; }
.result-title { font-size: 1.1rem; font-weight: 800; transition: color .15s; }
.result-summary { color: var(--muted); font-size: .92rem; }

.error-page { max-width: 640px; padding-block: 72px 96px; text-align: center; }
.error-page .page-lead { margin: 12px auto 28px; }
.error-page .search-form { margin-bottom: 18px; text-align: start; }
.error-page h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); font-weight: 900; }

.error-code {
    font-size: clamp(4rem, 3rem + 5vw, 7rem);
    font-weight: 900;
    line-height: 1.1;
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Documentation layout ---------- */

.preview-banner {
    padding: 10px 18px;
    background: var(--preview-bg);
    color: var(--preview-text);
    font-size: .9rem;
    font-weight: 700;
    text-align: center;
}
.preview-status { margin-inline-start: 10px; font-weight: 500; opacity: .85; }

.doc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
    padding-block: 24px 72px;
}

.doc { min-width: 0; max-width: 800px; }

.doc-nav, .doc-toc { display: none; }

@media (min-width: 1024px) {
    .doc-layout { grid-template-columns: 248px minmax(0, 1fr); }

    .doc-nav {
        display: block;
        position: sticky;
        top: calc(var(--header-h) + 22px);
        align-self: start;
        max-height: calc(100vh - var(--header-h) - 44px);
        overflow-y: auto;
        padding-inline-end: 6px;
        scrollbar-width: thin;
    }
}

@media (min-width: 1280px) {
    .doc-layout { grid-template-columns: 248px minmax(0, 1fr) 220px; }

    .doc-toc {
        display: block;
        position: sticky;
        top: calc(var(--header-h) + 22px);
        align-self: start;
        max-height: calc(100vh - var(--header-h) - 44px);
        overflow-y: auto;
        scrollbar-width: thin;
    }

    .toc-inline { display: none; }
}

.doc-nav-inner { font-size: .9rem; }

.doc-nav-root {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 6px;
    border-radius: var(--radius-sm);
    font-weight: 900;
}
.doc-nav-root:hover { background: var(--bg-soft); }

.doc-nav-root-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent);
}

.doc-nav-group {
    display: block;
    margin: 18px 0 6px;
    padding-inline-start: 8px;
    color: var(--text);
    font-size: .82rem;
    font-weight: 800;
}
.doc-nav-group:hover { color: var(--accent); }

.doc-nav-list {
    margin: 0 0 6px;
    padding: 0;
    list-style: none;
    border-inline-start: 1px solid var(--border);
    margin-inline-start: 8px;
}

.doc-nav-list a {
    display: block;
    margin-inline-start: -1px;
    padding: 5px 14px;
    border-inline-start: 2px solid transparent;
    color: var(--text-2);
    line-height: 1.65;
    transition: color .15s, border-color .15s;
}
.doc-nav-list a:hover { color: var(--text); border-color: var(--border-strong); }
.doc-nav-list a[aria-current="page"] { color: var(--accent); border-color: var(--accent); font-weight: 700; }

.doc-head { margin: 14px 0 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.doc-kicker { color: var(--accent); font-size: .86rem; font-weight: 700; }
.doc-kicker:hover { text-decoration: underline; text-underline-offset: 4px; }
.doc-title { margin: 6px 0 12px; font-size: clamp(1.65rem, 1.15rem + 1.9vw, 2.55rem); line-height: 1.45; font-weight: 900; }
.doc-summary { color: var(--text-2); font-size: 1.1rem; line-height: 1.95; }

.doc-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 18px; color: var(--muted); font-size: .84rem; }
.doc-meta > span { display: inline-flex; align-items: center; gap: 6px; }

.doc-toc-title { margin-bottom: 10px; color: var(--text); font-size: .82rem; font-weight: 800; }

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

.toc-list a {
    display: block;
    margin-inline-start: -1px;
    padding: 4px 12px;
    border-inline-start: 2px solid transparent;
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.65;
    transition: color .15s, border-color .15s;
}
.toc-list a:hover { color: var(--text); }
.toc-list a.is-active { color: var(--accent); border-color: var(--accent); }
.toc-list .toc-l3 a { padding-inline-start: 24px; }

.toc-inline {
    margin-bottom: 28px;
    padding: 4px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-soft);
}
.toc-inline summary { padding: 8px 0; cursor: pointer; font-weight: 800; font-size: .92rem; }
.toc-inline .toc-list { margin-bottom: 12px; }

/* ---------- Article content ---------- */

.prose {
    color: var(--text);
    font-size: 1.05rem;
    line-height: 2.05;
    overflow-wrap: break-word;
}

.prose > * { margin-block: 0; }
.prose > * + * { margin-top: 1.05em; }

.prose h2, .prose h3, .prose h4 { position: relative; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h2 { margin-top: 2.1em; font-size: 1.5rem; font-weight: 900; }
.prose h3 { margin-top: 1.8em; font-size: 1.22rem; }
.prose h4 { margin-top: 1.6em; font-size: 1.06rem; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .55em; }

.prose .anchor {
    margin-inline-start: .35em;
    color: var(--muted);
    font-weight: 400;
    text-decoration: none;
    opacity: 0;
    transition: opacity .15s;
}
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor, .prose .anchor:focus { opacity: 1; }

.prose a:not(.anchor) {
    color: var(--link);
    text-decoration: underline;
    text-decoration-color: var(--link-line);
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
    transition: text-decoration-color .15s;
}
.prose a:not(.anchor):hover { text-decoration-color: currentColor; }
.prose a.external::after { content: "↗"; display: inline-block; margin-inline-start: 2px; font-size: .72em; }

.prose strong { font-weight: 800; }

.prose ul, .prose ol { padding-inline-start: 1.5em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--accent); }
.prose li > ul, .prose li > ol { margin-top: .35em; }

.prose blockquote {
    margin-inline: 0;
    padding: .5em 1.1em;
    border-inline-start: 3px solid var(--accent);
    border-start-end-radius: var(--radius);
    border-end-end-radius: var(--radius);
    background: var(--bg-soft);
    color: var(--text-2);
}
.prose blockquote > * { margin: 0; }
.prose blockquote > * + * { margin-top: .6em; }

.prose hr { height: 0; margin-block: 2.4em; border: 0; border-top: 1px solid var(--border); }

.prose img { height: auto; border: 1px solid var(--border); border-radius: var(--radius); }

.prose :not(pre) > code {
    padding: .12em .42em;
    border-radius: 6px;
    background: var(--inline-code-bg);
    color: var(--inline-code-text);
    font-family: var(--font-mono);
    font-size: .86em;
    direction: ltr;
    unicode-bidi: isolate;
}

.prose kbd {
    padding: .05em .45em;
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: var(--surface);
    font-family: var(--font-mono);
    font-size: .85em;
}

.prose mark { padding: 0 .2em; border-radius: 4px; background: rgb(250 204 21 / .35); color: inherit; }

/* Tables */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    scrollbar-width: thin;
}
.prose > .table-wrap { margin-top: 1.4em; }

.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; line-height: 1.75; font-variant-numeric: tabular-nums; }
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; }
.prose th[align="center"], .prose td[align="center"] { text-align: center; }
.prose thead th { background: var(--bg-soft); font-weight: 800; white-space: nowrap; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover { background: var(--bg-soft); }
.prose td:first-child { font-weight: 600; }

/* Code blocks: always dark, always LTR */

.code-block {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--code-border);
    border-radius: 14px;
    background: var(--code-bg);
    direction: ltr;
    text-align: left;
}
.prose > .code-block { margin-top: 1.4em; }

.code-block::before {
    content: attr(data-lang);
    display: block;
    min-height: 38px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--code-border);
    background: var(--code-bar);
    color: #8795ab;
    font-family: var(--font-mono);
    font-size: .76rem;
    line-height: 22px;
}

.code-block pre {
    margin: 0;
    padding: 16px 18px;
    overflow-x: auto;
    color: var(--code-text);
    font-family: var(--font-mono);
    font-size: .86rem;
    line-height: 1.75;
    tab-size: 4;
    scrollbar-width: thin;
}
.code-block code { font-family: inherit; }

.code-copy {
    position: absolute;
    top: 6px;
    right: 8px;
    padding: 2px 10px;
    border: 1px solid rgb(255 255 255 / .12);
    border-radius: 7px;
    background: transparent;
    color: #a9b6c8;
    font-family: var(--font-sans);
    font-size: .74rem;
    line-height: 22px;
    transition: background-color .15s, color .15s;
}
.code-copy:hover { background: rgb(255 255 255 / .07); color: #fff; }
.code-copy.is-done { color: #5eead4; border-color: rgb(94 234 212 / .4); }

.hljs-comment, .hljs-quote { color: #7d8ba1; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-type, .hljs-doctag { color: #ff7b72; }
.hljs-string, .hljs-regexp { color: #a5d6ff; }
.hljs-number, .hljs-symbol, .hljs-bullet, .hljs-link { color: #79c0ff; }
.hljs-title, .hljs-section, .hljs-title.function_, .hljs-title.class_ { color: #d2a8ff; }
.hljs-built_in, .hljs-variable, .hljs-template-variable, .hljs-selector-id, .hljs-selector-class { color: #ffa657; }
.hljs-attr, .hljs-attribute, .hljs-property, .hljs-name, .hljs-tag { color: #7ee787; }
.hljs-meta, .hljs-meta .hljs-keyword { color: #8b949e; }
.hljs-params, .hljs-subst { color: #c9d1d9; }
.hljs-addition { color: #aff5b4; background: rgb(46 160 67 / .15); }
.hljs-deletion { color: #ffdcd7; background: rgb(248 81 73 / .15); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* Callouts and details */

.callout {
    --c: var(--note);
    --c-bg: var(--note-bg);
    --c-border: var(--note-border);
    padding: 14px 18px;
    border: 1px solid var(--c-border);
    border-inline-start: 4px solid var(--c);
    border-radius: var(--radius);
    background: var(--c-bg);
}
.prose > .callout { margin-top: 1.4em; }
.callout-info { --c: var(--info); --c-bg: var(--info-bg); --c-border: var(--info-border); }
.callout-tip { --c: var(--tip); --c-bg: var(--tip-bg); --c-border: var(--tip-border); }
.callout-warning { --c: var(--warning); --c-bg: var(--warning-bg); --c-border: var(--warning-border); }
.callout-danger { --c: var(--danger); --c-bg: var(--danger-bg); --c-border: var(--danger-border); }

.callout-title { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; color: var(--c); font-size: .95rem; font-weight: 800; }
.callout-title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.callout-body > * { margin: 0; }
.callout-body > * + * { margin-top: .7em; }
.callout-body { font-size: .98rem; line-height: 1.95; }

.prose details.details {
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.prose details.details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}
.prose details.details summary::-webkit-details-marker { display: none; }
.prose details.details summary::after { content: "+"; color: var(--muted); font-size: 1.2rem; line-height: 1; }
.prose details.details[open] summary::after { content: "−"; }
.details-body { padding-bottom: 14px; }
.details-body > * { margin: 0; }
.details-body > * + * { margin-top: .8em; }

.directive-unknown { padding: 12px 16px; border: 1px dashed var(--danger); border-radius: var(--radius); }
.directive-unknown-label { color: var(--danger); font-weight: 700; font-size: .85rem; }

/* Author pages */

.author-meta { margin-top: 10px; color: var(--muted); font-size: .9rem; }
.author-meta a { color: var(--link); unicode-bidi: isolate; }

/* Fixed site pages */

.contact-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 24px;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.contact-box a { color: var(--accent); font-weight: 600; }

/* After the body */

.doc-verified {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 36px;
    color: var(--accent);
    font-size: .88rem;
    font-weight: 600;
}

.doc-sources {
    margin-top: 28px;
    padding: 18px 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-soft);
}
.doc-sources h2 { margin-bottom: 8px; font-size: 1rem; font-weight: 900; }
.doc-sources ol { margin: 0; padding-inline-start: 1.3em; font-size: .92rem; line-height: 2; }
.doc-sources a { padding-block: 8px; color: var(--link); } /* inline padding: bigger tap target, same line layout */
.doc-sources a:hover { text-decoration: underline; text-underline-offset: 4px; }
.source-host { margin-inline-start: 6px; color: var(--muted); font-size: .78rem; unicode-bidi: isolate; }

.doc-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }

.tag {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--bg-sunken);
    color: var(--text-2);
    font-size: .84rem;
    font-weight: 600;
}
.tag:hover { background: var(--accent-soft); color: var(--accent); }

.doc-related { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--border); }
.doc-related h2 { margin-bottom: 16px; font-size: 1.2rem; font-weight: 900; }

/* ---------- Forms ---------- */

select,
.finder input {
    height: 42px;
    padding-inline: 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: .9rem;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
select:focus, .finder input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Specs ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--bg-sunken);
    color: var(--text-2);
    font-size: .74rem;
    font-weight: 700;
    white-space: nowrap;
}
.badge-pending { border-color: var(--warning-border); background: var(--warning-bg); color: var(--warning); }
.badge-current { border-color: var(--tip-border); background: var(--tip-bg); color: var(--tip); }
.badge-eol { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger); }
.badge-announced { border-color: var(--info-border); background: var(--info-bg); color: var(--info); }

.product-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    transition: border-color .2s, box-shadow .2s, transform .2s var(--ease);
}
.product-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-2px); }
.product-card-link { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 18px 20px; }
.product-card-vendor { color: var(--accent); font-size: .8rem; font-weight: 700; }
.product-card-title { font-size: 1.08rem; line-height: 1.5; font-weight: 900; }
.product-card-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 10px 0 0; }
.product-card-specs div { min-width: 0; }
.product-card-specs dt { color: var(--muted); font-size: .74rem; line-height: 1.6; }
.product-card-specs dd { margin: 0; font-size: .92rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.product-card .badge { align-self: flex-start; margin-top: 10px; }

.spec-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; }

.spec-tile {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.spec-tile-label { color: var(--muted); font-size: .78rem; }
.spec-tile-value { font-size: 1.05rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.spec-tiles-lg { margin: 4px 0 28px; }
.spec-tiles-lg .spec-tile { padding: 16px 18px; }
.spec-tiles-lg .spec-tile-value { font-size: clamp(1.1rem, 1rem + .6vw, 1.45rem); }

.spec-head { margin: 14px 0 22px; }
.spec-summary { max-width: 860px; margin-top: 12px; }

.spec-unverified {
    max-width: 860px;
    margin-top: 14px;
    padding: 10px 14px;
    border: 1px solid var(--warning-border);
    border-radius: var(--radius);
    background: var(--warning-bg);
    color: var(--warning);
    font-size: .88rem;
}

.spec-note {
    margin-bottom: 18px;
    padding: 10px 14px;
    border-inline-start: 3px solid var(--info);
    border-start-end-radius: var(--radius);
    border-end-end-radius: var(--radius);
    background: var(--info-bg);
    color: var(--text-2);
    font-size: .88rem;
}

.spec-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.spec-aside { display: flex; flex-direction: column; gap: 16px; }

@media (min-width: 1024px) {
    .spec-layout { grid-template-columns: minmax(0, 1fr) 300px; }
    .spec-aside { position: sticky; top: calc(var(--header-h) + 22px); align-self: start; }
}

.spec-group + .spec-group { margin-top: 24px; }
.spec-group h2 { margin-bottom: 10px; font-size: 1.08rem; font-weight: 900; }

.spec-table,
.spec-list,
.compare-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .93rem;
    font-variant-numeric: tabular-nums;
}

.spec-table { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.spec-table th, .spec-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; }
.spec-table tr:last-child > * { border-bottom: 0; }
.spec-table th { width: 48%; color: var(--text-2); font-weight: 600; }
.spec-table td { font-weight: 700; }
.spec-help { display: block; color: var(--muted); font-size: .76rem; font-weight: 400; }

.spec-card { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-soft); }
.spec-card h2 { margin-bottom: 12px; font-size: .95rem; font-weight: 900; }

.compare-inline { display: flex; flex-direction: column; gap: 8px; }
.compare-inline select { width: 100%; }
.compare-inline .btn { height: 42px; }

.compare-links { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; font-size: .9rem; }
.compare-links a { color: var(--link); }
.compare-links a:hover { text-decoration: underline; text-underline-offset: 4px; }

.finder {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
    align-items: end;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-soft);
}
.finder-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.finder-field label { font-size: .82rem; font-weight: 700; }
.finder-field select, .finder-field input { width: 100%; }
.finder-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.finder-actions .btn { height: 42px; }

.spec-list th, .spec-list td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: start; white-space: nowrap; }
.spec-list thead th { background: var(--bg-soft); color: var(--text-2); font-size: .82rem; font-weight: 800; }
.spec-list thead th.is-sorted { color: var(--accent); }
.spec-list tbody th { font-weight: 800; }
.spec-list tbody th a:hover { color: var(--accent); }
.spec-list tbody tr:hover > * { background: var(--bg-soft); }
.spec-list tbody tr:last-child > * { border-bottom: 0; }
.spec-list-vendor { display: block; color: var(--muted); font-size: .76rem; font-weight: 500; }

.compare-picker { margin-top: 36px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.compare-picker h2 { margin-bottom: 12px; font-size: 1.05rem; font-weight: 900; }
.compare-picker-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.compare-picker-form select { flex: 1 1 220px; min-width: 0; }
.compare-picker-vs { color: var(--muted); font-weight: 700; }

.compare-heads { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }

.compare-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    transition: border-color .2s;
}
.compare-head:hover { border-color: var(--accent-line); }
.compare-head-name { font-size: 1.1rem; font-weight: 900; }
.compare-head .badge { align-self: flex-start; margin-top: 6px; }

.compare-highlights {
    margin-bottom: 22px;
    padding: 18px 22px;
    border: 1px solid var(--tip-border);
    border-radius: var(--radius-lg);
    background: var(--tip-bg);
}
.compare-highlights h2 { margin-bottom: 6px; font-size: 1rem; font-weight: 900; }
.compare-highlights ul { margin: 0; padding-inline-start: 1.2em; line-height: 2.05; }

.compare-verdict { margin-bottom: 24px; }
.compare-verdict h2 { margin-bottom: 8px; font-size: 1.1rem; font-weight: 900; }

.compare-table th, .compare-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; }
.compare-table thead th { background: var(--bg-soft); font-weight: 900; }
.compare-table tbody th { width: 34%; color: var(--text-2); font-weight: 600; }
.compare-table td { width: 33%; font-weight: 700; }
.compare-table .compare-group th { background: var(--bg-sunken); color: var(--text); font-size: .85rem; font-weight: 900; }

.compare-table td.is-better,
.compare-embed td.is-better { background: var(--tip-bg); color: var(--tip); }
.compare-table td.is-better::after,
.compare-embed td.is-better::after { content: "✓"; margin-inline-start: 6px; }

.compare-legend { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .82rem; }
.compare-legend-swatch { width: 14px; height: 14px; border: 1px solid var(--tip-border); border-radius: 4px; background: var(--tip-bg); }

.prose .product-embed {
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-soft);
}
.prose > .product-embed, .prose > .compare-embed { margin-top: 1.4em; }
.product-embed-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 12px; }
.prose a.product-embed-name { color: var(--text); font-size: 1.1rem; font-weight: 900; text-decoration: none; }
.prose a.product-embed-name:hover { color: var(--accent); }
.product-embed-meta { color: var(--muted); font-size: .8rem; }
.prose .product-embed .spec-tile { padding: 10px 12px; }
.prose .product-embed .spec-tile-value { font-size: 1rem; }
.prose a.product-embed-link { display: inline-block; margin-top: 12px; font-size: .88rem; font-weight: 700; }

.search-products { margin-bottom: 28px; }
.search-group-title { margin: 6px 0 12px; font-size: 1rem; font-weight: 900; }

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

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

.footer-grid { display: grid; gap: 32px; padding-block: 48px 36px; }

@media (min-width: 768px) {
    .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

.footer-about { max-width: 480px; margin-top: 12px; color: var(--muted); font-size: .9rem; line-height: 2; }
.footer-title { margin-bottom: 12px; font-size: .86rem; font-weight: 900; }
.site-footer ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; font-size: .9rem; }
.site-footer ul a { display: inline-block; padding-block: 8px; color: var(--muted); transition: color .15s; }
.site-footer ul a:hover { color: var(--accent); }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    padding-block: 18px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: .8rem;
}
.footer-latin { font-weight: 700; }

/* ---------- LOM builder ---------- */

.lom-group { margin-top: 30px; }
.lom-group-title { margin-bottom: 14px; font-size: 1.15rem; font-weight: 900; }

.lom-trust {
    max-width: 860px;
    margin-top: 40px;
    padding: 20px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-soft);
}
.lom-trust h2 { margin-bottom: 8px; font-size: 1rem; font-weight: 900; }
.lom-trust ul { margin: 0; padding-inline-start: 1.2em; color: var(--text-2); font-size: .93rem; line-height: 2; }

.lom-kicker { color: var(--accent); font-size: .85rem; font-weight: 800; }
.lom-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; color: var(--muted); font-size: .85rem; }
.lom-meta > * { display: inline-flex; align-items: center; gap: 6px; }
.lom-meta a { color: var(--link); }
.lom-noscript { padding: 12px 16px; border-radius: var(--radius); background: var(--warning-bg); color: var(--warning); }

.lom-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 8px; }

.lom-slots { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.lom-slot {
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    scroll-margin-top: calc(var(--header-h) + 16px);
    transition: border-color .15s;
}
.lom-slot.is-filled { border-color: var(--accent-line); }
.lom-slot.has-warning { border-color: var(--warning-border); }
.lom-slot.has-error { border-color: var(--danger-border); }

.lom-slot-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.lom-slot-head h2 { font-size: 1.05rem; font-weight: 900; }
.lom-slot-count { color: var(--muted); font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.lom-slot.is-filled .lom-slot-count { color: var(--accent); }
.lom-slot-help { margin-top: 6px; color: var(--muted); font-size: .88rem; line-height: 1.9; }
.lom-slot-issue { margin-top: 8px; color: var(--danger); font-size: .86rem; font-weight: 600; }
.lom-slot.has-warning:not(.has-error) .lom-slot-issue { color: var(--warning); }

.lom-picked { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.lom-picked:empty { display: none; }
.lom-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 8px 12px;
    border-radius: var(--radius);
    background: var(--accent-soft);
}
.lom-line-text { display: flex; flex-direction: column; flex: 1; min-width: 0; text-align: start; }
.lom-line-pn { font-family: var(--font-mono); font-size: .8rem; font-weight: 700; color: var(--accent); }
.lom-line-name { overflow: hidden; font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.lom-qty { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.lom-qty-btn { width: 32px; height: 32px; border: 0; background: none; color: var(--text-2); font-size: 1.1rem; line-height: 1; }
.lom-qty-btn:hover { color: var(--accent); }
.lom-qty-value { min-width: 2ch; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.lom-remove { width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.lom-remove:hover { background: var(--danger-bg); color: var(--danger); }

.lom-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-inline: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-soft);
    color: var(--muted);
}
.lom-filter input { flex: 1; height: 40px; border: 0; outline: 0; background: none; color: var(--text); }

.lom-parts-wrap { margin-top: 12px; max-height: 360px; overflow: auto; }
.lom-parts { width: 100%; border-collapse: collapse; font-size: .88rem; }
.lom-parts th { position: sticky; top: 0; z-index: 1; padding: 8px 10px; background: var(--bg-soft); color: var(--muted); font-size: .78rem; font-weight: 700; text-align: start; }
.lom-parts td { padding: 9px 10px; border-top: 1px solid var(--border); vertical-align: middle; }
.lom-parts tr.is-picked td { background: var(--accent-soft); }
.lom-pn { font-family: var(--font-mono); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.lom-part-name { display: block; line-height: 1.6; text-align: start; }
.lom-part-summary { display: block; margin-top: 2px; color: var(--muted); font-size: .8rem; }
.lom-part-note { display: block; margin-top: 2px; color: var(--warning); font-size: .8rem; }
.lom-part-eol { display: block; margin-top: 2px; color: var(--danger); font-size: .8rem; }
.lom-lifecycle { margin-block: 0 20px; padding: 14px 16px; border: 1px solid var(--warning-border); border-radius: var(--radius); background: var(--warning-bg); }
.lom-lifecycle h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 1rem; color: var(--warning); }
.lom-lifecycle dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; margin: 0; }
.lom-lifecycle dt { color: var(--muted); font-size: .8rem; }
.lom-lifecycle dd { margin: 2px 0 0; font-weight: 600; }
.lom-lifecycle .is-past dd { color: var(--danger); }
.lom-lifecycle p { margin: 10px 0 0; font-size: .85rem; }
.lom-lifecycle a { display: inline-flex; align-items: center; gap: 4px; }
.lom-lc-search { max-width: 460px; margin-block: 8px 6px; }
.lom-lc-count { color: var(--muted); font-size: .85rem; margin: 0 0 16px; }
.lom-lc-empty { padding: 10px 14px; border-radius: var(--radius); background: var(--warning-bg); color: var(--warning); }
.lom-lc-family { margin-block: 0 24px; }
.lom-lc-family h2 { font-size: 1.1rem; margin: 0 0 10px; }
.lom-lc-bulletin { margin-block: 0 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.lom-lc-bulletin > summary { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; padding: 10px 14px; cursor: pointer; }
.lom-lc-title { font-weight: 600; font-size: .9rem; }
.lom-lc-dates { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: .8rem; }
.lom-lc-dates .is-past { color: var(--danger); }
.lom-lc-bulletin > :not(summary) { margin-inline: 14px; }
.lom-lc-milestones { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; margin-block: 4px 10px; }
.lom-lc-milestones dt { color: var(--muted); font-size: .8rem; }
.lom-lc-milestones dd { margin: 2px 0 0; font-weight: 600; }
.lom-lc-milestones .is-past dd { color: var(--danger); }
.lom-lc-skus { width: 100%; margin-block: 0 12px; font-size: .85rem; }
.lom-lc-skus td, .lom-lc-skus th { padding: 4px 8px; text-align: start; }
.lom-licensing { margin-block: 0 20px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.lom-licensing summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.lom-licensing dl { margin: 12px 0 0; display: grid; gap: 12px; }
.lom-licensing dt { font-weight: 600; }
.lom-licensing dd { margin: 4px 0 0; color: var(--text-2); font-size: .9rem; line-height: 1.8; }
.lom-licensing dd a { display: inline-flex; align-items: center; gap: 3px; margin-inline-start: 6px; font-size: .8rem; }
.lom-add-cell { width: 48px; text-align: end; }
.lom-add { width: 36px; height: 36px; color: var(--accent); }
.lom-add:disabled { opacity: .35; cursor: not-allowed; }
.lom-empty { color: var(--muted); text-align: center; }

.lom-summary-inner {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.lom-status { padding: 10px 14px; border-radius: var(--radius); background: var(--bg-soft); color: var(--text-2); font-weight: 800; font-size: .92rem; }
.lom-status[data-state="ok"] { background: var(--tip-bg); color: var(--tip); }
.lom-status[data-state="warning"] { background: var(--warning-bg); color: var(--warning); }
.lom-status[data-state="error"] { background: var(--danger-bg); color: var(--danger); }
.lom-status[data-state="checking"] { color: var(--muted); }

.lom-issues { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: .86rem; line-height: 1.85; }
.lom-issues:empty { display: none; }
.lom-issue { padding-inline-start: 12px; border-inline-start: 3px solid var(--border-strong); }
.lom-issue-error { border-color: var(--danger); }
.lom-issue-warning { border-color: var(--warning); }
.lom-issue-notice { border-color: var(--info); }
.lom-issue-link { color: var(--text); font-weight: 800; }

.lom-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.lom-totals:empty { display: none; }
.lom-totals div { padding: 10px 12px; border-radius: var(--radius); background: var(--bg-soft); }
.lom-totals dt { color: var(--muted); font-size: .75rem; }
.lom-totals dd { margin: 0; font-size: 1rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.lom-totals-static { margin: 20px 0; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.lom-actions { display: flex; flex-direction: column; gap: 10px; }
.lom-actions .btn { width: 100%; }
.lom-actions-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0; }
.lom-actions-row .btn { height: 40px; padding-inline: 10px; font-size: .86rem; }
.lom-actions [aria-disabled="true"], .lom-actions .btn:disabled { opacity: .45; pointer-events: none; }
.lom-reset { align-self: center; padding: 4px 8px; border: 0; background: none; color: var(--muted); font-size: .82rem; text-decoration: underline; text-underline-offset: 4px; }
.lom-reset:hover { color: var(--danger); }
.lom-disclaimer { color: var(--muted); font-size: .78rem; line-height: 1.9; }

.lom-print { display: none; }

.lom-shared-notes { padding: 14px 18px; border-radius: var(--radius); background: var(--bg-soft); white-space: pre-line; }
.lom-sheet { width: 100%; border-collapse: collapse; font-size: .9rem; }
.lom-sheet th, .lom-sheet td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: start; }
.lom-sheet th { color: var(--muted); font-size: .78rem; }
.lom-shared .lom-actions-row { display: flex; margin-top: 22px; }

/* LOM project page */
.btn-sm { height: 34px; padding-inline: 12px; font-size: .84rem; }
.lom-project-bar { padding: 10px 14px; border-radius: var(--radius); background: var(--info-bg); color: var(--info); font-size: .86rem; line-height: 1.9; }
.lom-project-bar a { color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 4px; }
.lom-project-title { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: .92rem; }
.lom-project-title input, .lom-project-label, .lom-project-add select, .lom-link-form select, .lom-link-form input {
    height: 42px;
    padding-inline: 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    min-width: 0;
}
.lom-project-items, .lom-project-links, .lom-templates { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.lom-project-items:empty, .lom-project-links:empty { display: none; }
.lom-project-item, .lom-project-link { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); }
.lom-project-link.has-error { border-color: var(--danger-border); }
.lom-project-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.lom-project-label { flex: 1 1 180px; height: 38px; font-weight: 800; }
.lom-project-platform { color: var(--muted); font-size: .84rem; }
.lom-project-state { padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.lom-project-state[data-state="ok"] { background: var(--tip-bg); color: var(--tip); }
.lom-project-state[data-state="error"] { background: var(--danger-bg); color: var(--danger); }
.lom-project-errors { margin: 8px 0 0; padding-inline-start: 1.2em; color: var(--danger); font-size: .84rem; line-height: 1.9; }
.lom-project-item-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.lom-remove-item { color: var(--muted); }
.lom-remove-item:hover { border-color: var(--danger); color: var(--danger); }
.lom-project-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.lom-project-add select { flex: 1 1 240px; }
.lom-link-form { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
.lom-link-form label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: .8rem; font-weight: 700; }
.lom-link-title { font-size: .9rem; line-height: 1.8; }
.lom-link-meta { margin-top: 2px; color: var(--muted); font-size: .84rem; }
.lom-link-parts, .lom-link-specs { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; font-size: .84rem; }
.lom-link-parts li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.lom-link-qty { font-weight: 800; font-variant-numeric: tabular-nums; }
.lom-link-specs li { padding-inline-start: 12px; border-inline-start: 3px solid var(--border-strong); color: var(--text-2); line-height: 1.8; }
.lom-project-link .lom-issues { margin-top: 8px; }
.lom-project-link .lom-remove-item { margin-top: 10px; }
.lom-templates a { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); color: var(--text); }
.lom-templates a:hover { border-color: var(--accent); }
.lom-templates span { color: var(--text-2); font-size: .86rem; line-height: 1.8; }
.lom-templates .lom-template-meta { color: var(--muted); font-size: .78rem; }

@media (min-width: 720px) {
    .lom-link-form { grid-template-columns: 1fr 1fr; }
    .lom-link-form .lom-link-num { max-width: 180px; }
}

@media (min-width: 1024px) {
    .lom-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
    .lom-summary { position: sticky; top: calc(var(--header-h) + 20px); }
}

@media print {
    .lom .breadcrumbs, .lom-head, .lom-layout, .lom-noscript { display: none !important; }
    .lom-print { display: block; }
    .lom-print h2 { margin-bottom: 12px; font-size: 16pt; }
    .lom-print table { width: 100%; border-collapse: collapse; font-size: 10pt; }
    .lom-print th, .lom-print td { padding: 5px 6px; border: 1px solid #999; text-align: start; }
    .lom-print ul { margin-top: 10px; font-size: 9pt; }
    .lom-shared .lom-actions-row, .lom-shared .lom-disclaimer { display: none; }
}

/* ---------- Scrollbars, motion, print ---------- */

.doc-nav::-webkit-scrollbar, .doc-toc::-webkit-scrollbar, .table-wrap::-webkit-scrollbar, .code-block pre::-webkit-scrollbar { width: 8px; height: 8px; }
.doc-nav::-webkit-scrollbar-thumb, .doc-toc::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
.code-block pre::-webkit-scrollbar-thumb { background: #2a3a51; border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
    .site-header, .site-footer, .drawer, .doc-nav, .doc-toc, .toc-inline, .code-copy, .skip-link, .doc-related { display: none !important; }
    .doc-layout { display: block; padding: 0; }
    .doc { max-width: none; }
    body { background: #fff; color: #000; }
    .prose a { color: #000; }
    .code-block { border-color: #ccc; }
}
