/* Antril site: plain CSS.
   Themes: light and dark follow the system (prefers-color-scheme) unless the visitor chose one: the theme script sets
   [data-theme="light"|"dark"] on <html> before the first paint. Sections that add their own colors should define them
   the same way (a dark block under :root:not([data-theme="light"]) inside the media query, and :root[data-theme="dark"]),
   or better, use the tokens below. */

/* ── Tokens ── */
:root {
    --bg: #ffffff;
    --bg-alt: #f6f6f7;
    --surface: #ffffff;
    --surface-2: #f2f2f4;
    --text: #111113;
    --muted: #5b5b65;
    --border: #e4e4e7;
    --border-strong: #d0d0d6;
    --accent: #dc143c;         /* the Antril ant */
    --accent-strong: #b0102f;
    --accent-soft: #fde8ec;
    --on-accent: #ffffff;
    --button-bg: #dc143c;      /* filled buttons: white text keeps 4.5:1 in both themes */
    --button-bg-hover: #b0102f;
    --green: #1e6b33;          /* Larva */
    --green-bright: #2e9e44;
    --green-soft: #e3f4e7;
    --forest: #0f2a1c;         /* the brand's dark */
    --code-bg: #f5f5f7;
    --header-bg: rgba(255, 255, 255, .82);
    --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 4px 16px rgba(16, 24, 20, .06);
    --shadow-lg: 0 2px 6px rgba(16, 24, 20, .06), 0 24px 48px -12px rgba(16, 24, 20, .18);
    --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent);
    --radius: 12px;
    --radius-lg: 18px;
    --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --header-h: 64px;
    --brand-gradient: linear-gradient(135deg, #dc143c 0%, #b0102f 38%, #1e6b33 100%);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #09090b;
        --bg-alt: #0f0f12;
        --surface: #141417;
        --surface-2: #1b1b1f;
        --text: #ececef;
        --muted: #a1a1aa;
        --border: #26262c;
        --border-strong: #37373f;
        --accent: #ff4d6d;
        --accent-strong: #ff6f88;
        --accent-soft: #3a1820;
        --on-accent: #ffffff;
        --button-bg: #dc143c;
        --button-bg-hover: #c8102f;
        --green: #6fd08a;
        --green-bright: #4cc068;
        --green-soft: #15291c;
        --code-bg: #0d0d10;
        --header-bg: rgba(9, 9, 11, .78);
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
        --shadow-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 24px 48px -12px rgba(0, 0, 0, .6);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #09090b;
    --bg-alt: #0f0f12;
    --surface: #141417;
    --surface-2: #1b1b1f;
    --text: #ececef;
    --muted: #a1a1aa;
    --border: #26262c;
    --border-strong: #37373f;
    --accent: #ff4d6d;
    --accent-strong: #ff6f88;
    --accent-soft: #3a1820;
    --on-accent: #ffffff;
    --button-bg: #dc143c;
    --button-bg-hover: #c8102f;
    --green: #6fd08a;
    --green-bright: #4cc068;
    --green-soft: #15291c;
    --code-bg: #0d0d10;
    --header-bg: rgba(9, 9, 11, .78);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 24px 48px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }

main { flex: 1; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

code, pre { font-family: var(--mono); font-size: .92em; font-variant-ligatures: none; font-feature-settings: "calt" 0, "liga" 0; }
:not(pre) > code { background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px; padding: .05em .35em; }
kbd {
    font-family: var(--mono); font-size: .75em; padding: 1px 6px; border-radius: 5px;
    border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--surface); color: var(--muted);
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); letter-spacing: -.02em; }
h2 { font-size: 1.6rem; letter-spacing: -.01em; }
h3 { font-size: 1.1rem; }

img, svg { max-width: 100%; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 820px; }
.container.wide { max-width: 1320px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; }
.skip:focus { left: 16px; background: var(--surface); color: var(--text); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-lg); }

/* ── Header ── */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--header-bg);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 8px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; color: var(--text); margin-right: 12px; }
.brand:hover { text-decoration: none; }
.brand img { display: block; }

.nav-menu { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-menu > li { position: relative; }
.nav-menu > li > a, .nav-trigger {
    display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 12px; border-radius: 8px;
    color: var(--text); font: inherit; font-weight: 550; font-size: .95rem; background: none; border: 0; cursor: pointer; white-space: nowrap;
}
.nav-menu > li > a:hover, .nav-trigger:hover, .nav-item.open > .nav-trigger { background: var(--surface-2); text-decoration: none; }
.nav-menu > li > a[aria-current="page"] { color: var(--accent); }
.nav-trigger svg { transition: transform .15s ease; opacity: .7; }
.nav-item.open > .nav-trigger svg { transform: rotate(180deg); }

.mega {
    position: absolute; top: calc(100% + 8px); left: -12px; min-width: 520px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    visibility: hidden; opacity: 0; transform: translateY(-4px); transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.mega::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.nav-item:hover > .mega, .nav-item:focus-within > .mega, .nav-item.open > .mega { visibility: visible; opacity: 1; transform: none; }
.nav-item.closed > .mega { visibility: hidden; opacity: 0; }
.mega a { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; color: var(--text); }
.mega a:hover, .mega a:focus-visible { background: var(--surface-2); text-decoration: none; }
.mega strong { display: block; font-size: .95rem; }
.mega span { display: block; color: var(--muted); font-size: .85rem; line-height: 1.4; }
.mega-icon {
    flex: none; width: 34px; height: 34px; border-radius: 9px; display: inline-flex !important; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent) !important;
}
.mega-icon.green { background: var(--green-soft); color: var(--green) !important; }
.mega-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px 4px; margin-top: 4px; border-top: 1px solid var(--border); font-size: .85rem; }

.nav-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.search-trigger {
    display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px 0 12px; min-width: 200px;
    border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--muted); font: inherit; font-size: .9rem; cursor: pointer;
}
.search-trigger:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; }
.search-trigger kbd { margin-left: auto; }
.icon-button {
    display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none;
    border: 1px solid transparent; border-radius: 10px; background: none; color: var(--text); cursor: pointer; padding: 0;
}
.icon-button:hover { background: var(--surface-2); border-color: var(--border); text-decoration: none; }
.theme-toggle .icon-sun, .theme-toggle .icon-moon, .theme-toggle .icon-system { display: none; }
.theme-toggle[data-mode="light"] .icon-sun, .theme-toggle[data-mode="dark"] .icon-moon, .theme-toggle[data-mode="system"] .icon-system,
.theme-toggle:not([data-mode]) .icon-system { display: block; }

.account { position: relative; }
.account-trigger { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.account-trigger:hover { border-color: var(--border-strong); }
.account-avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-gradient); color: #fff; font-weight: 700; font-size: .85rem; }
.account .mega { left: auto; right: 0; min-width: 220px; grid-template-columns: 1fr; }
.account .mega a, .account .mega button.menu-item { padding: 8px 12px; }
button.menu-item { width: 100%; text-align: left; background: none; border: 0; font: inherit; color: var(--text); cursor: pointer; border-radius: 10px; }
button.menu-item:hover { background: var(--surface-2); }
.menu-sep { height: 1px; background: var(--border); margin: 4px 0; }
.nav-login { color: var(--text); font-weight: 600; font-size: .95rem; padding: 0 10px; white-space: nowrap; }
.nav-login:hover { color: var(--accent); text-decoration: none; }
.nav-download { height: 38px; white-space: nowrap; }

.hamburger { display: none; }
.hamburger .icon-close { display: none; }
.hamburger[aria-expanded="true"] .icon-open { display: none; }
.hamburger[aria-expanded="true"] .icon-close { display: block; }

.mobile-panel {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 49; overflow-y: auto; padding: 16px 16px 40px;
    background: var(--bg); border-top: 1px solid var(--border);
}
.mobile-panel[hidden] { display: none; }
.mobile-panel h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 20px 0 6px; }
.mobile-panel ul { list-style: none; margin: 0; padding: 0; }
.mobile-panel li a { display: block; padding: 10px 4px; color: var(--text); font-weight: 550; font-size: 1.05rem; border-bottom: 1px solid var(--border); }
.mobile-panel .mobile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }

@media (max-width: 1080px) {
    .search-trigger { min-width: 0; }
    .search-trigger .label, .search-trigger kbd { display: none; }
    .search-trigger { width: 38px; padding: 0; justify-content: center; }
}
@media (max-width: 900px) {
    .nav-menu, .account, .nav-login, .nav-tools .theme-toggle { display: none; }
    .hamburger { display: inline-flex; }
}
@media (max-width: 420px) {
    .nav-download { display: none; }
}

/* ── Buttons ── */
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--button-bg); color: var(--on-accent); border: 1px solid var(--button-bg);
    border-radius: 10px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; line-height: 1.3;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.button:hover { background: var(--button-bg-hover); border-color: var(--button-bg-hover); text-decoration: none; color: var(--on-accent); }
.button.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.button.secondary:hover { border-color: var(--accent); color: var(--accent); }
.button.ghost { background: transparent; color: var(--text); border-color: transparent; }
.button.ghost:hover { background: var(--surface-2); color: var(--text); }
.button.green { background: var(--green); border-color: var(--green); color: #fff; }
.button.green:hover { background: var(--forest); border-color: var(--forest); }
.button.small { padding: 6px 12px; font-size: .9rem; }
.button.large { padding: 14px 26px; font-size: 1.05rem; border-radius: 12px; }
.nav-account .button, .nav-account .button:hover { color: #fff; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; }
button.link:hover { color: var(--accent); }
button.link.danger { color: var(--accent); }

/* ── Shared page parts (older pages) ── */
.hero { padding: 72px 0 56px; background: radial-gradient(1200px 400px at 85% 0%, var(--accent-soft), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--accent); margin: 0 0 12px; }
.accent { color: var(--accent); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 12px; }
.version { font-weight: 600; color: var(--green); }
.hero-art { display: flex; justify-content: center; }
.hero-ant { width: min(320px, 70vw); height: auto; filter: drop-shadow(0 12px 30px rgba(220, 20, 60, .25)); }

.section { padding: 64px 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { margin-bottom: 24px; }

.code-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: start; }
.code { margin: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--code-bg); overflow: hidden; box-shadow: var(--shadow); }
.code figcaption { font-size: .8rem; color: var(--muted); padding: 8px 14px; border-bottom: 1px solid var(--border); font-family: var(--mono); }
.code pre { margin: 0; padding: 16px; overflow-x: auto; line-height: 1.55; tab-size: 4; }
.prompt { color: var(--green); user-select: none; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card p { margin: 0; color: var(--muted); }

.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tool { display: flex; gap: 16px; align-items: flex-start; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.tool:hover { border-color: var(--accent); text-decoration: none; }
.tool img { flex: none; }
.tool p { margin: 0; color: var(--muted); }

.cta { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.cta .actions { margin: 0; }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 56px 0 28px; margin-top: 0; }
.footer-top { display: grid; grid-template-columns: 1.4fr repeat(5, 1fr); gap: 32px; }
.footer-about p { margin: 12px 0 16px; max-width: 34ch; }
.footer-col h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text); margin: 6px 0 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 7px 0; }
.footer-col a { color: var(--muted); font-size: .93rem; }
.footer-col a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); }
.footer-bottom .footer-legal { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.version-badge {
    display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--green) 40%, transparent); background: var(--green-soft); color: var(--green);
}
.version-badge:hover { text-decoration: none; border-color: var(--green); }
.version-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green-bright); }
.theme-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.theme-switch button {
    display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font: inherit; font-size: .8rem;
    padding: 4px 10px; border-radius: 999px; cursor: pointer;
}
.theme-switch button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
/* The language switcher (EN / ES): the header, the mobile menu and the footer. */
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); flex: none; }
.lang-switch a { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; color: var(--muted); font-size: .78rem; font-weight: 650; letter-spacing: .04em; line-height: 1.4; }
.lang-switch a:hover { color: var(--text); text-decoration: none; }
.lang-switch a[aria-current="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.mobile-panel .lang-switch a { font-size: .9rem; padding: 6px 14px; }
@media (max-width: 900px) { .nav-tools .nav-lang { display: none; } }
/* Kept for pages that still use them. */
.footer-grid { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }

@media (max-width: 960px) {
    .footer-top { grid-template-columns: repeat(3, 1fr); }
    .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    .footer-top { grid-template-columns: 1fr 1fr; gap: 24px; }
}

/* ── Command palette ── */
.palette {
    width: min(680px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 120px)); margin: 10vh auto auto; padding: 0;
    border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text);
    box-shadow: var(--shadow-lg); overflow: hidden;
}
.palette[open] { display: flex; flex-direction: column; }
.palette::backdrop { background: rgba(5, 12, 8, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.palette-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.palette-head input {
    flex: 1; border: 0; background: transparent; padding: 6px 0; font-size: 1.05rem; color: var(--text); outline: none; box-shadow: none;
}
.palette-head input:focus { outline: none; border: 0; }
.palette-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
.palette-group { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 10px 10px 4px; font-weight: 700; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: var(--text); }
.palette-item[aria-selected="true"] { background: var(--accent-soft); }
.palette-item[aria-selected="true"] .palette-title { color: var(--accent); }
.palette-kind {
    flex: none; width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: .7rem; font-weight: 700; font-family: var(--mono);
}
.palette-text { min-width: 0; flex: 1; }
.palette-title { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-detail { display: block; font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.palette-foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--border); font-size: .78rem; color: var(--muted); background: var(--bg-alt); flex-wrap: wrap; }

/* ── Reveal on scroll (only with JavaScript, and only when motion is welcome) ── */
@media (prefers-reduced-motion: no-preference) {
    .js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
    .js .reveal.in { opacity: 1; transform: none; }
}

/* ── Forms and account pages ── */
.auth { max-width: 440px; }
.form { display: flex; flex-direction: column; gap: 6px; margin: 16px 0; }
.form label { font-weight: 600; margin-top: 10px; }
.form label.check { font-weight: 400; display: flex; gap: 8px; align-items: center; }
.form .button { margin-top: 16px; align-self: flex-start; }
input:not([type=checkbox]):not([type=radio]), select {
    font: inherit; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; width: 100%;
}
input:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.inline-form { flex-direction: row; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.inline-form .field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 180px; }
.inline-form .button { margin-top: 0; }
.error, .errors { color: var(--accent); font-size: .9rem; }
.errors ul { margin: 0; padding-left: 18px; }
.notice { background: var(--green-soft); color: var(--green); border-radius: 8px; padding: 10px 14px; }

.panel { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin: 20px 0; background: var(--surface); }
.panel h2 { font-size: 1.2rem; }
.panel.secret { border-color: var(--green); background: var(--green-soft); }
.panel.secret pre { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: .95rem; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: .85rem; }

.badge { display: inline-block; font-size: .8rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.muted { background: var(--bg-alt); color: var(--muted); }

@media (max-width: 860px) {
    .hero-grid, .code-grid { grid-template-columns: 1fr; }
    .hero-art { display: none; }
    .cards, .tools { grid-template-columns: 1fr; }
    .table { display: block; overflow-x: auto; }
}
@media (max-width: 560px) {
    .container { padding: 0 16px; }
}

/* ── Highlighted code (CodeHighlighter: Antril's own lexer) ── */
:root {
    --tk-keyword: #b0102f;     /* the ant's red, a step darker for text */
    --tk-type: #1e6b33;        /* Larva's green */
    --tk-string: #8a4b08;
    --tk-number: #6f42c1;
    --tk-comment: #6a737d;
    --tk-function: #0b5cad;
    --tk-literal: #6f42c1;
    --tk-key: #0b5cad;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --tk-keyword: #ff6f88;
        --tk-type: #6fd08a;
        --tk-string: #e3b36b;
        --tk-number: #c4a7ff;
        --tk-comment: #8a9a90;
        --tk-function: #7cc4ff;
        --tk-literal: #c4a7ff;
        --tk-key: #7cc4ff;
    }
}
:root[data-theme="dark"] {
    --tk-keyword: #ff6f88;
    --tk-type: #6fd08a;
    --tk-string: #e3b36b;
    --tk-number: #c4a7ff;
    --tk-comment: #8a9a90;
    --tk-function: #7cc4ff;
    --tk-literal: #c4a7ff;
    --tk-key: #7cc4ff;
}
.tk-k { color: var(--tk-keyword); font-weight: 600; }
.tk-t { color: var(--tk-type); }
.tk-s { color: var(--tk-string); }
.tk-n, .tk-l { color: var(--tk-number); }
.tk-c { color: var(--tk-comment); font-style: italic; }
.tk-d { color: var(--tk-comment); }
.tk-f { color: var(--tk-function); }
.tk-y { color: var(--tk-key); }
.tk-p { color: var(--green); user-select: none; }
.tk-o { color: var(--muted); }

.code figcaption { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.code .copy {
    font: inherit; font-size: .75rem; color: var(--muted); background: transparent; cursor: pointer;
    border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px;
}
.code .copy:hover { color: var(--accent); border-color: var(--accent); }

/* ── Documentation ── */
.docs { display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; gap: 40px; padding-top: 32px; padding-bottom: 64px; }
.docs-nav { position: sticky; top: 80px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; font-size: .93rem; }
.docs-menu summary { display: none; }
.docs-nav h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 20px 0 6px; }
.docs-nav h2:first-child { margin-top: 0; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav a { display: block; padding: 4px 10px; border-radius: 6px; color: var(--text); border-left: 2px solid transparent; }
.docs-nav a:hover { background: var(--bg-alt); text-decoration: none; }
.docs-nav a.current { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.docs-body { min-width: 0; }
.docs-body h1 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); }
.docs-toc { position: sticky; top: 80px; align-self: start; font-size: .85rem; }
.docs-toc h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 8px; }
.docs-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.docs-toc li a { display: block; padding: 3px 0 3px 12px; color: var(--muted); }
.docs-toc li.level-3 a { padding-left: 24px; }
.docs-toc a:hover { color: var(--accent); text-decoration: none; }

.prose { max-width: 75ch; }
.prose h2 { margin-top: 2em; padding-top: .4em; border-top: 1px solid var(--border); scroll-margin-top: var(--docs-offset, 80px); }
.prose h3 { margin-top: 1.6em; scroll-margin-top: var(--docs-offset, 80px); }
.prose .code { margin: 1.2em 0; box-shadow: none; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.prose blockquote { margin: 1.2em 0; padding: 10px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; }
.prose blockquote p { margin: .3em 0; }
.prose img { max-width: 100%; }
.prose li { margin: .25em 0; }

.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.pager { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-weight: 600; }
.pager:hover { border-color: var(--accent); text-decoration: none; }
.pager.next { text-align: right; grid-column: 2; }

/* ── Download ── */
.download-hero { background: radial-gradient(900px 300px at 80% 0%, var(--green-soft), transparent 70%); }
.download-head { display: flex; gap: 24px; align-items: center; }
.download-head h1 { margin-bottom: .2em; }
.download-primary { margin-top: 28px; }
.button.large { padding: 14px 26px; font-size: 1.1rem; }
.notice h2 { font-size: 1.2rem; color: inherit; }
.notice p { color: var(--text); }
.table-wrap { overflow-x: auto; }
table.files { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.files th, table.files td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.files th { color: var(--muted); font-weight: 600; font-size: .85rem; }
table.files tr.primary td { background: var(--green-soft); }
.sha code { font-size: .78em; word-break: break-all; }
.nowrap { white-space: nowrap; }
.install-steps h3 { margin-top: 1.6em; }
.install-steps .code { margin: .8em 0; box-shadow: none; }

@media (max-width: 1100px) {
    .docs { grid-template-columns: 220px minmax(0, 1fr); }
    .docs-toc { display: none; }
}
@media (max-width: 860px) {
    .docs { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 16px; }
    .docs-nav { position: static; max-height: none; }
    .docs-menu summary { display: block; cursor: pointer; font-weight: 600; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
    .docs-menu[open] summary { margin-bottom: 12px; }
    .download-head { flex-direction: column; align-items: flex-start; }
}

/* ── Documentation books ── */
.books { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 28px; }
.book { display: flex; gap: 16px; align-items: flex-start; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.book:hover { border-color: var(--accent); text-decoration: none; }
.book h2 { font-size: 1.3rem; margin-bottom: .3em; }
.book p { color: var(--muted); margin: 0 0 .6em; }
.book ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: .9rem; }
.book-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; padding: 4px; border: 1px solid var(--border); border-radius: 10px; }
.book-tabs a { flex: 1; text-align: center; padding: 5px 8px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: .85rem; border: 0; }
.book-tabs a.current { background: var(--accent-soft); color: var(--accent); }

/* ── Search ── */
.site-search { flex: 0 1 260px; }
.site-search input { padding: 6px 12px; font-size: .9rem; border-radius: 999px; background: var(--bg-alt); }

@media (max-width: 860px) {
    .books { grid-template-columns: 1fr; }
    .site-search { order: 4; flex: 1 1 100%; }
}

/* ── Languages registry: /languages, /languages/{id}, /admin/languages ── */
.languages-hero { background: radial-gradient(1000px 320px at 85% 0%, var(--green-soft), transparent 70%); }
.languages-builtin { display: flex; gap: 14px; align-items: center; padding: 14px 18px; margin: 24px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.languages-builtin img { flex: none; }
.languages-builtin span { display: block; }
.languages-search { display: flex; gap: 12px; margin: 24px 0; flex-wrap: wrap; }
.languages-search input { flex: 1; min-width: 200px; }
.language-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin: 24px 0; }
.language-card { display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.language-card:hover { border-color: var(--accent); text-decoration: none; }
.language-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 1.1rem; }
.language-card-text { color: var(--muted); }
.language-extensions { display: flex; gap: 6px; flex-wrap: wrap; }
.language-command, .language-manifest { background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow-x: auto; }
.language-facts th { width: 180px; }
.fingerprint { word-break: break-all; font-size: .82em; }
.language-warning { background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 10px 14px; }
.language-checks { list-style: none; padding: 0; margin: 0 0 16px; }
.language-checks li { padding: 4px 0; }
.language-checks li.failed { color: var(--accent); }
.language-diff td { vertical-align: top; }
.language-decision textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.language-platform details summary { cursor: pointer; font-weight: 600; margin-top: 8px; }
@media (max-width: 640px) { .language-facts th { width: auto; } }

/* ── Profiles and GitHub ── */
.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--bg-alt); border: 1px solid var(--border); }
.avatar.small { width: 40px; height: 40px; }
.avatar.placeholder { width: 96px; height: 96px; display: inline-flex; align-items: center; justify-content: center; font-size: 2.6rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); }
.profile-head { display: flex; gap: 24px; align-items: center; margin-bottom: 24px; }
.profile-head h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: .1em; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; }
.profile-actions form { margin: 0; }
.profile-section { margin-top: 36px; }
.profile-section h2 { font-size: 1.3rem; display: flex; align-items: center; gap: 8px; }
.profile-section .count, .tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--border); color: var(--muted); }
.profile-list { list-style: none; margin: 0; padding: 0; }
.profile-list > li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.profile-list > li p { margin: .2em 0 0; }
.profile-item-name { font-weight: 600; margin-right: 8px; }
.profile-facts { display: inline-flex; flex-wrap: wrap; gap: 12px; }
.profile-sublist { margin: 6px 0 0; padding-left: 18px; }
.github-identity { display: flex; gap: 12px; align-items: center; }
.github-login { display: flex; gap: 10px; align-items: center; margin: 8px 0 16px; }
@media (max-width: 600px) {
    .profile-head { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ── Forum ── */
.forum h1 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); }
.forum .lead { margin-top: 0; }
.crumbs { margin: 0 0 12px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.forum-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 16px; }
.forum-head-actions { padding-bottom: 1em; }
.forum-search { display: flex; gap: 8px; align-items: center; flex: 0 1 360px; margin: 0 0 1em; }
.forum-search input { border-radius: 999px; padding: 7px 14px; }
.forum-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.forum-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 240px; gap: 16px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--border); }
.forum-row:first-child { border-top: 0; }
.forum-row.pinned { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.forum-row-main p { margin: 2px 0 0; }
.forum-row-title { font-size: 1.05rem; font-weight: 600; margin: 0 6px 0 0; color: var(--text); overflow-wrap: anywhere; }
h2.forum-row-title { display: block; }
.forum-row-title a { color: var(--text); }
.forum-row-title:hover, .forum-row-title a:hover { color: var(--accent); }
.forum-stats { display: flex; flex-direction: column; color: var(--muted); }
.forum-stats strong { color: var(--text); }
.forum-latest { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.forum-title { overflow-wrap: anywhere; margin-bottom: .2em; }
.forum-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 16px; }
.forum-error { background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 10px 14px; }
.forum-posts { list-style: none; margin: 16px 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.post { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 14px 20px; scroll-margin-top: 80px; }
.post:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.post.deleted { background: var(--bg-alt); }
.post-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.post-author { font-weight: 700; color: var(--text); }
.post-link { margin-left: auto; }
.post-edited { font-style: italic; }
.post-body { max-width: none; overflow-wrap: anywhere; }
.post-body h1, .post-body h2, .post-body h3 { font-size: 1.15rem; margin: 1em 0 .4em; padding: 0; border: 0; }
.post-body .code { margin: .8em 0; box-shadow: none; }
.post-body pre { overflow-x: auto; }
.post-actions { display: flex; gap: 16px; align-items: center; justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 8px; }
.forum-pager { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 16px 0; }
.forum-pager a, .forum-pager .current { padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: .9rem; }
.forum-pager a:hover { border-color: var(--accent); text-decoration: none; }
.forum-pager .current { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.forum-form textarea {
    font: inherit; font-family: var(--mono); font-size: .92rem; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; width: 100%; resize: vertical; min-height: 140px;
}
.forum-form textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.forum-hint { margin: 2px 0 0; }
.forum-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.forum-form .forum-buttons .button { margin-top: 8px; }
.forum-preview { border: 1px dashed var(--accent); border-radius: var(--radius); padding: 12px 18px; margin: 8px 0 12px; background: var(--surface); }
.forum-preview .eyebrow { margin-bottom: 4px; }
.forum-reply { margin-top: 32px; }
.forum-reply h2 { font-size: 1.3rem; }
.forum-mod summary { cursor: pointer; font-weight: 600; }
.forum-mod-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.forum-move { display: flex; gap: 8px; align-items: center; }
.forum-move select { width: auto; padding: 5px 8px; }
.button.danger { background: transparent; color: var(--accent); border-color: var(--accent); }
.button.danger:hover { background: var(--accent); color: #fff; }
.forum-results { list-style: none; margin: 16px 0; padding: 0; }
.forum-result { padding: 14px 0; border-bottom: 1px solid var(--border); }
.forum-snippet { margin: 4px 0 0; color: var(--text); overflow-wrap: anywhere; }
.forum-snippet mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 2px; }

@media (max-width: 860px) {
    .forum-row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 14px 16px; }
    .forum-stats { flex-direction: row; gap: 14px; }
    .forum-search { flex: 1 1 100%; }
    .post { padding: 12px 14px; }
}

/* ── Type browser (/larva/stdlib, package types), Hive packages and search ── */
.nav-types { margin: 2px 0 6px 12px !important; border-left: 1px solid var(--border); }
.nav-types a { font-size: .88rem; padding: 2px 10px; }
.type-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.crumbs { color: var(--muted); }
.view-tabs { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; }
.view-tabs > span { padding: 0 6px; }
.view-tabs a { padding: 4px 10px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: .85rem; }
.view-tabs a:hover { text-decoration: none; color: var(--accent); }
.view-tabs a.current { background: var(--accent-soft); color: var(--accent); }
.type-body h1 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); word-break: break-word; }
.type-body h2 { margin-top: 1.8em; scroll-margin-top: 80px; }
.type-header, pre.sig { margin: 0; padding: 12px 14px; background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; overflow-x: auto; line-height: 1.5; }
.type-header { margin: 8px 0 16px; }
.type-body pre a, .type-body code a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 2px; }
.type-body pre a:hover, .type-body code a:hover { text-decoration-color: var(--accent); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 12px 0; }
.facts dt { color: var(--muted); font-size: .9rem; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts dd .type-link { margin-right: 8px; }
.chain { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.type-list td { vertical-align: top; }
.type-list .kind, .type-list td:nth-child(2) { width: 1%; }
.type-list .summary { color: var(--muted); }
.type-list .summary code, .member-doc code { font-size: .88em; }
.type-ns h2 { font-size: 1.25rem; }
.members { display: flex; flex-direction: column; gap: 14px; }
.member { scroll-margin-top: 80px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.member:last-child { border-bottom: 0; }
.member:target pre.sig { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.member-head { display: flex; gap: 8px; align-items: flex-start; }
.member-head pre.sig { flex: 1; min-width: 0; }
.member-head .anchor { color: var(--muted); padding-top: 10px; opacity: .5; }
.member-head .anchor:hover { opacity: 1; text-decoration: none; }
.member-tags { margin: 6px 0 0; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.member-doc { margin-top: 6px; }
.member-doc p { margin: .3em 0; }
.member-group > summary { cursor: pointer; list-style: revert; }
.member-group > summary h2 { display: inline; }
.inherited { columns: 2 220px; padding-left: 18px; }
.sig-head { margin-top: 1.4em; font-weight: 400; }
.sig-head code { font-size: .95rem; }
.constraint { font-family: var(--mono); font-size: .9em; color: var(--tk-keyword, var(--accent)); }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { margin: 4px 0; }
.hive-search { display: flex; gap: 10px; margin: 20px 0 28px; }
.hive-search input { flex: 1; }
.small-title { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 24px 0 10px; }
.author-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 18px; }
.package-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.package-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; background: var(--surface); }
.package-card p { margin: 6px 0 0; }
.package-name { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 1.05rem; }
.package-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
.package-main h2 { margin-top: 1.4em; }
.package-main .code { box-shadow: none; }
.package-facts { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; background: var(--surface); }
.package-facts .facts { grid-template-columns: 1fr; gap: 2px; }
.package-facts .facts dd { margin-bottom: 8px; }
.fingerprint, .sha code { font-size: .78em; word-break: break-all; }
.result-group h2 { margin-top: 1.6em; }
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.result-title { font-weight: 600; margin-right: 6px; }
.snippet { margin: 4px 0 0; color: var(--muted); font-size: .93rem; overflow-wrap: anywhere; }
.snippet mark { background: var(--accent-soft); color: var(--text); border-radius: 3px; padding: 0 2px; }
.search-help li { margin: 8px 0; }
@media (max-width: 860px) {
    .package-grid { grid-template-columns: minmax(0, 1fr); }
    .hive-search { flex-direction: column; }
}


/* ── Code windows (home and global pages) ── */
.window { border-radius: var(--radius-lg); background: var(--code-bg); border: 1px solid var(--border); box-shadow: var(--shadow-lg); overflow: hidden; margin: 0; min-width: 0; }
.window .window-bar, .code .window-bar {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface-2) 70%, var(--code-bg)); font-family: var(--mono); font-size: .8rem; color: var(--muted);
}
.window-dots { display: inline-flex; gap: 6px; }
.window-dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); display: block; }
.window-dots i:nth-child(1) { background: #ec6a5e; }
.window-dots i:nth-child(2) { background: #f4bf4f; }
.window-dots i:nth-child(3) { background: #61c554; }
.window-file { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.window pre { margin: 0; padding: 16px 18px; overflow-x: auto; line-height: 1.6; font-size: .86rem; tab-size: 4; }
.window.terminal { background: #0d0d10; border-color: #26262c; }
.window.terminal .window-bar { background: #151518; border-color: #26262c; color: #9a9aa3; }
.window.terminal pre { color: #d8e4dc; }
.window.terminal .tk-o { color: #9fb3a6; }
.window.terminal .tk-p { color: #4cc068; }
.window.terminal .tk-m { color: #f2f6f3; }

/* ── Home page ── */
.home-hero { position: relative; overflow: hidden; padding: 72px 0 64px; isolation: isolate; }
.home-hero::before {
    content: ""; position: absolute; inset: 0; z-index: -2;
    background:
        radial-gradient(900px 480px at 88% -10%, color-mix(in srgb, #dc143c 20%, transparent), transparent 70%),
        radial-gradient(800px 520px at 100% 90%, color-mix(in srgb, #2e9e44 18%, transparent), transparent 70%),
        radial-gradient(700px 400px at -10% 0%, color-mix(in srgb, #2e9e44 10%, transparent), transparent 70%);
}
.home-hero::after {
    content: ""; position: absolute; inset: 0; z-index: -2; opacity: .5;
    background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%);
}
.home-hero-bg { position: absolute; z-index: -1; right: -60px; top: 20px; width: 600px; opacity: .9; pointer-events: none; }
.home-hex { width: 100%; height: auto; display: block; }
@media (prefers-reduced-motion: no-preference) {
    .home-hex g { animation: hex-drift 14s ease-in-out infinite alternate; transform-origin: center; }
    @keyframes hex-drift { from { transform: translateY(0); } to { transform: translateY(-14px); } }
}
.home-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.home-pill {
    display: inline-flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 999px; font-size: .88rem; font-weight: 550;
    background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow); margin-bottom: 22px;
}
.home-pill:hover { text-decoration: none; border-color: var(--accent); }
.home-pill-tag { background: var(--button-bg); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: .75rem; font-weight: 700; letter-spacing: .02em; }
.home-title { font-size: clamp(2.5rem, 6vw, 4.6rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 800; margin-bottom: 20px; }
.home-gradient-text {
    background: linear-gradient(100deg, #dc143c 10%, #e0476a 40%, #2e9e44 90%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.home-lead { font-size: clamp(1.08rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 56ch; margin: 0 0 28px; }
.home-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 12px; }
.home-platforms { margin: 4px 0 0; }
.home-hero-visual { display: grid; gap: 16px; min-width: 0; }
.home-hero-visual .terminal { margin-left: 18%; margin-top: -40px; position: relative; }

.install { max-width: 560px; }
.install-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px 10px 0 0; background: var(--surface-2); border: 1px solid var(--border); border-bottom: 0; }
.install-tabs [role=tab] {
    border: 0; background: none; font: inherit; font-size: .82rem; font-weight: 600; color: var(--muted); padding: 5px 12px; border-radius: 7px; cursor: pointer;
}
.install-tabs [role=tab][aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.install-line {
    display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 0 12px 12px 12px;
    background: #0d0d10; border: 1px solid #26262c; color: #ececef; box-shadow: var(--shadow-lg);
}
.install-line[hidden] { display: none; }
.install-line code { flex: 1; min-width: 0; background: none !important; border: 0 !important; padding: 0 !important; color: inherit; font-size: .9rem; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.install-prompt { color: #4cc068; font-family: var(--mono); font-size: .9rem; user-select: none; }
.install-copy {
    flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #2c4636; background: #142a1d; color: #cfe0d4;
    border-radius: 8px; padding: 5px 10px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer;
}
.install-copy:hover { border-color: #4cc068; color: #fff; }
.install-dark .install-line { border-radius: 12px; }

.home-stats { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; }
.stat { padding: 26px 20px; border-left: 1px solid var(--border); display: flex; flex-direction: column-reverse; gap: 2px; }
.stat:first-child { border-left: 0; }
.stat dt { color: var(--muted); font-size: .85rem; }
.stat dd { margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat dd a { color: var(--text); }
.stat dd a:hover { color: var(--accent); text-decoration: none; }
.stat:first-child dd a { color: var(--green); }

.home-section { padding: 104px 0; }
.home-band { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.home-head { max-width: 760px; margin-bottom: 44px; }
.home-head h2, .home-section h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); letter-spacing: -.03em; line-height: 1.1; font-weight: 800; }
.home-head .lead { margin: 0; }
.home-head-row { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px 48px; flex-wrap: wrap; }
.home-head-row > div:first-child { max-width: 720px; }
.home-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow.green { color: var(--green); }

.tour { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 28px; align-items: start; }
.tour-tabs { display: flex; flex-direction: column; gap: 6px; }
.tour-tabs [role=tab] {
    text-align: left; border: 1px solid transparent; background: none; border-radius: var(--radius); padding: 14px 16px; cursor: pointer;
    font: inherit; color: var(--text); display: flex; flex-direction: column; gap: 4px; position: relative;
}
.tour-tabs [role=tab] strong { font-size: 1rem; }
.tour-tabs [role=tab] span { color: var(--muted); font-size: .88rem; line-height: 1.45; display: none; }
.tour-tabs [role=tab]:hover { background: var(--surface-2); }
.tour-tabs [role=tab][aria-selected="true"] { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow); }
.tour-tabs [role=tab][aria-selected="true"] span { display: block; }
.tour-tabs [role=tab][aria-selected="true"]::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--brand-gradient); }
.tour-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.tour-panel[hidden] { display: none; }
.tour-panel:focus-visible { outline-offset: 6px; }
.tour-side { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: end; }
.tour-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; margin-top: 4px; }
.tour-side .tour-more { margin-bottom: 8px; }
.window.terminal .copy { color: #9fb3a6; border-color: #2c4636; background: transparent; }
.window.terminal .copy:hover { color: #fff; border-color: #4cc068; }

.gc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 36px; }
.gc-card { padding: 22px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.gc-card::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--brand-gradient); opacity: .85; }
.gc-card h3 { margin: 12px 0 6px; font-size: 1.15rem; }
.gc-card p { margin: 0; color: var(--muted); font-size: .94rem; }
.gc-key { font-family: var(--mono); font-size: .78rem; padding: 3px 8px; border-radius: 6px; background: var(--green-soft); color: var(--green); font-weight: 600; }

.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.split-reverse { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; }
.split-side { display: grid; gap: 16px; }
.split h2 { margin-bottom: .4em; }
.checks { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 10px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks svg { flex: none; margin-top: 4px; color: var(--green); }

.targets { display: grid; gap: 28px; }
.pipeline { width: 100%; height: auto; display: block; padding: 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.pipe-box rect { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.2; }
.pipe-box rect.pipe-red { fill: var(--accent-soft); stroke: color-mix(in srgb, var(--accent) 55%, transparent); }
.pipe-box rect.pipe-green { fill: var(--green-soft); stroke: color-mix(in srgb, var(--green) 50%, transparent); }
.pipe-box rect.pipe-core { fill: var(--forest); stroke: #2e9e44; stroke-width: 1.5; }
.pipe-box text { fill: var(--text); font-family: var(--sans); font-size: 15px; font-weight: 600; text-anchor: middle; }
.pipe-box text.pipe-strong { fill: #ffffff; font-size: 17px; font-weight: 800; }
.pipe-box text.pipe-small { fill: #9fd3ac; font-size: 12px; font-weight: 500; }
@media (prefers-reduced-motion: no-preference) {
    .pipe-lines path { stroke-dasharray: 6 6; animation: pipe-flow 1.6s linear infinite; }
    @keyframes pipe-flow { to { stroke-dashoffset: -24; } }
}
.target-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.target { padding: 20px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.target h3 { margin: 14px 0 6px; }
.target p { margin: 0; color: var(--muted); font-size: .93rem; }

.eco-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.eco-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 12px; }
.eco-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.eco-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: border-color .15s ease, transform .15s ease; }
.eco-item:hover { text-decoration: none; border-color: var(--accent); }
.eco-icon { flex: none; width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.eco-icon.green { background: var(--green-soft); color: var(--green); }
.eco-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.eco-text strong, .eco-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-card { padding: 28px; border-radius: var(--radius-lg); border: 1px dashed var(--border-strong); background: var(--surface); color: var(--muted); }
.empty-card p { margin: 0 0 14px; }

.editor { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid #26262c; background: #0e0e11; box-shadow: var(--shadow-lg); color: #d8e4dc; font-size: .85rem; }
.editor-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #151518; color: #9a9aa3; font-family: var(--mono); font-size: .78rem; border-bottom: 1px solid #26262c; }
.editor-body { display: grid; grid-template-columns: 150px minmax(0, 1fr); min-height: 250px; }
.editor-tree { display: flex; flex-direction: column; gap: 2px; padding: 12px 8px; border-right: 1px solid #26262c; background: #0d0d10; font-family: var(--mono); font-size: .78rem; color: #9fb3a6; }
.editor-tree span { padding: 3px 8px; border-radius: 5px; }
.editor-tree .tree-head { font-weight: 700; color: #6f8577; font-size: .7rem; letter-spacing: .08em; }
.editor-tree .tree-on { background: #1a3325; color: #fff; }
.editor-tree .tree-dim { color: #5f7466; }
.editor-code { position: relative; padding: 14px 0; }
.editor-code pre { margin: 0; padding: 0 16px; line-height: 1.8; font-size: .85rem; overflow-x: auto; }
.editor-code .ln { display: inline-block; width: 2.4em; color: #4f6457; user-select: none; }
.editor .tk-t { color: #6fd08a; } .editor .tk-k { color: #ff6f88; } .editor .tk-n { color: #c4a7ff; }
.squiggle { text-decoration: underline wavy #ff4d6d; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.editor-hover {
    position: absolute; left: 70px; top: 118px; right: 16px; max-width: 420px; padding: 10px 12px; border-radius: 8px;
    background: #15271d; border: 1px solid #2c4636; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); font-size: .8rem; display: grid; gap: 4px;
}
.editor-hover strong { color: #ff8aa0; font-family: var(--mono); font-size: .78rem; }
.editor-hover code { background: #0d0d10 !important; border-color: #2c4636 !important; color: #ececef; }
.editor-status { display: flex; gap: 18px; padding: 5px 14px; background: #1e6b33; color: #e8f6ec; font-size: .72rem; font-family: var(--mono); }
.editor-status span:last-child { margin-left: auto; }

.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.lang-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.lang-card:hover { text-decoration: none; border-color: var(--accent); }
.lang-card > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.lang-mark { flex: none; width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; background: var(--green-soft); color: var(--green); font-size: 1.1rem; }
.lang-antril { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: linear-gradient(135deg, var(--accent-soft), var(--surface) 60%); }
.lang-new { border-style: dashed; }
.lang-new .lang-mark { background: var(--surface-2); color: var(--muted); }

.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.quote { margin: 0; padding: 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 18px; position: relative; }
.quote.placeholder { border-style: dashed; border-color: var(--border-strong); background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 12px, var(--surface-2) 12px, var(--surface-2) 13px); }
.quote blockquote { margin: 18px 0 0; font-size: 1.02rem; color: var(--muted); font-style: italic; }
.quote figcaption { display: flex; align-items: center; gap: 12px; }
.quote figcaption > span:last-child { display: flex; flex-direction: column; }
.quote-avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); border: 1px dashed var(--border-strong); color: var(--muted); font-weight: 700; }
.placeholder-tag { position: absolute; top: 14px; right: 14px; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 999px; padding: 2px 8px; background: var(--surface); }

.home-cta { padding: 104px 0; }
.home-cta-inner {
    display: flex; justify-content: space-between; align-items: center; gap: 32px 48px; flex-wrap: wrap;
    padding: 56px clamp(24px, 5vw, 64px); border-radius: 28px; color: #fff; position: relative; overflow: hidden;
    background: radial-gradient(600px 300px at 100% 0%, rgba(220, 20, 60, .55), transparent 70%), radial-gradient(500px 300px at 0% 100%, rgba(46, 158, 68, .5), transparent 70%), #0b0b0e;
    box-shadow: var(--shadow-lg);
}
.home-cta-inner h2 { color: #fff; font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
.home-cta-inner p { color: #d4d4d8; margin: 0 0 18px; font-size: 1.1rem; }
.home-cta-inner .button.secondary { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .25); }
.home-cta-inner .button.secondary:hover { border-color: #fff; color: #fff; }
.home-cta-inner .button.ghost { color: #fff; }
.home-cta-inner .button.ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.home-cta-inner .home-actions { margin: 0; }

@media (max-width: 1100px) {
    .tour { grid-template-columns: 1fr; }
    .tour-tabs { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
    .tour-tabs [role=tab] { flex: none; }
    .tour-tabs [role=tab] span { display: none !important; }
    .tour-tabs [role=tab][aria-selected="true"]::before { left: 14px; right: 14px; top: auto; bottom: -1px; width: auto; height: 3px; }
    .gc-grid, .target-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
    .home-hero-grid, .split, .split-reverse, .tour-panel, .eco-grid { grid-template-columns: minmax(0, 1fr); }
    .home-hero-visual .terminal { margin-left: 0; margin-top: 0; }
    .home-hero-bg { opacity: .45; }
    .stats { grid-template-columns: repeat(3, 1fr); }
    .stat:nth-child(4) { border-left: 0; }
    .stat { border-top: 1px solid var(--border); }
    .quotes { grid-template-columns: 1fr; }
    .home-section { padding: 72px 0; }
}
@media (max-width: 560px) {
    .home-hero { padding: 40px 0 48px; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stat { padding: 18px 14px; }
    .stat:nth-child(4) { border-left: 1px solid var(--border); }
    .stat:nth-child(odd) { border-left: 0; }
    .gc-grid, .target-cards { grid-template-columns: 1fr; }
    .editor-body { grid-template-columns: minmax(0, 1fr); }
    .editor-tree { display: none; }
    .editor-hover { left: 16px; }
    .install-line code { font-size: .8rem; }
    .home-actions .button.large { flex: 1 1 100%; }
}

/* ── Global pages: /community, /showcase, /about, /brand, 404 and errors ── */
.page-hero { position: relative; overflow: hidden; padding: 72px 0 48px; border-bottom: 1px solid var(--border); isolation: isolate; }
.page-hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: radial-gradient(800px 360px at 90% -20%, color-mix(in srgb, #dc143c 16%, transparent), transparent 70%),
                radial-gradient(700px 360px at 0% 120%, color-mix(in srgb, #2e9e44 14%, transparent), transparent 70%);
}
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -.03em; font-weight: 800; }
.page-hero .lead { margin: 0; }
.page-hero .home-actions { margin-top: 24px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.tile { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
a.tile:hover { text-decoration: none; border-color: var(--accent); }
.tile h3 { margin: 6px 0 0; }
.tile p { margin: 0; color: var(--muted); }
.tile .tile-foot { margin-top: auto; padding-top: 8px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.tile.placeholder { border-style: dashed; box-shadow: none; position: relative; }
.prose-page { max-width: 760px; }
.prose-page h2 { margin-top: 1.8em; font-size: 1.5rem; }
.prose-page li { margin: .35em 0; }
.people { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0; }
.people a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: .9rem; }
.people a:hover { text-decoration: none; border-color: var(--accent); }
.people .account-avatar { width: 26px; height: 26px; font-size: .75rem; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.swatch { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.swatch-color { height: 96px; }
.swatch-info { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.swatch-info code { font-size: .82rem; }
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.logo-card { border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; }
.logo-stage { height: 170px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); }
.logo-stage.dark { background: #0f2a1c; }
.logo-stage img { max-height: 110px; width: auto; }
.logo-info { padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.not-found { text-align: center; padding: 96px 0 112px; }
.not-found .code-num { font-size: clamp(5rem, 16vw, 9rem); font-weight: 900; letter-spacing: -.05em; line-height: 1; margin: 0; }
.not-found .lead { margin: 12px auto 28px; }
.not-found form { display: flex; gap: 10px; max-width: 520px; margin: 0 auto 28px; }
.not-found .home-actions { justify-content: center; }
.dos-donts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 700px) {
    .dos-donts { grid-template-columns: 1fr; }
    .not-found form { flex-direction: column; }
}
@media (max-width: 560px) { .tour-side { grid-template-columns: minmax(0, 1fr); } }
.button svg, .nav-trigger svg, .search-trigger svg { flex: none; }
.not-found form .button { flex: none; }
#palette-input { border: 0; background: transparent; padding: 6px 0; box-shadow: none; outline: none; }
/* The header's backdrop filter makes it the panel's containing block: place the panel under it, viewport-tall. */
.mobile-panel { position: absolute; inset: auto 0 auto 0; top: 100%; height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h)); }

/* ── Playground (/play) ── */
.play { padding-top: 28px; padding-bottom: 56px; max-width: 1400px; }
.play-head h1 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin-bottom: .2em; }
.play-head p { margin: 0 0 16px; max-width: 75ch; }
.play-banner { background: var(--accent-soft); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; }
.play-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.play-toolbar .button:disabled { opacity: .5; cursor: not-allowed; }
.play-select select {
    font: inherit; font-size: .9rem; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; max-width: 280px;
}
.play-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.play-status { margin-left: auto; }
.play-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.play-share[hidden] { display: none; }
.play-share input {
    flex: 1; min-width: 200px; font-family: var(--mono); font-size: .85rem; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
}
.play-panes { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }

.play-editor {
    --play-font: 14px; --play-line: 21px; --play-pad: 12px;
    display: grid; grid-template-columns: auto minmax(0, 1fr);
    height: clamp(340px, 68vh, 760px); overflow: hidden;
    background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius);
}
.play-editor:focus-within { border-color: var(--accent); }
.play-gutter, .play-highlight, .play-editor textarea {
    margin: 0; font-family: var(--mono); font-size: var(--play-font); line-height: var(--play-line);
    tab-size: 4; -moz-tab-size: 4; font-variant-ligatures: none; letter-spacing: 0;
}
.play-gutter {
    padding: var(--play-pad) 10px var(--play-pad) 14px; text-align: right; color: var(--muted); opacity: .7;
    border-right: 1px solid var(--border); user-select: none; min-width: 3.2em; will-change: transform;
}
.play-gutter .error { color: var(--accent); font-weight: 700; opacity: 1; }
.play-gutter .warning { color: var(--tk-string, #8a4b08); font-weight: 700; }
.play-code { position: relative; overflow: hidden; }
.play-layer { position: absolute; top: 0; left: 0; will-change: transform; pointer-events: none; }
.play-highlight { padding: var(--play-pad); white-space: pre; color: var(--text); background: none; }
.play-highlight code { font: inherit; background: none; border: 0; padding: 0; }
.play-editor textarea {
    position: absolute; inset: 0; width: 100%; height: 100%; padding: var(--play-pad); border: 0; outline: none; resize: none;
    background: transparent; color: transparent; caret-color: var(--text); white-space: pre; overflow: auto;
}
.play-editor textarea::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); color: transparent; }
.play-marks { position: absolute; top: 0; left: 0; }
.play-squiggle {
    position: absolute; height: 4px;
    background: linear-gradient(135deg, transparent 35%, var(--accent) 35%, var(--accent) 60%, transparent 60%) 0 0 / 6px 4px repeat-x;
}
.play-squiggle.warning { background-image: linear-gradient(135deg, transparent 35%, var(--tk-string, #8a4b08) 35%, var(--tk-string, #8a4b08) 60%, transparent 60%); }
.play-note {
    position: absolute; white-space: pre; font-family: var(--sans); font-size: 12px; line-height: var(--play-line);
    color: var(--accent); opacity: .9;
}
.play-note.warning { color: var(--tk-string, #8a4b08); }

.play-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.play-output-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.play-output-panel h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.play-output {
    margin: 0; padding: 12px 14px; height: clamp(220px, 52vh, 600px); overflow: auto;
    white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.5;
}
.play-output .play-error { color: var(--accent); }
.play-output .play-warning { color: var(--tk-string, #8a4b08); }
.play-output .play-info { color: var(--muted); }
.play-diagnostic {
    display: inline; font: inherit; text-align: left; background: none; border: 0; padding: 0; cursor: pointer;
    color: var(--accent); white-space: pre-wrap;
}
.play-diagnostic.warning { color: var(--tk-string, #8a4b08); }
.play-diagnostic:hover, .play-diagnostic:focus-visible { text-decoration: underline; }
.play-input summary { cursor: pointer; font-weight: 600; }
.play-input p { margin: 6px 0; }
.play-input textarea {
    width: 100%; font-family: var(--mono); font-size: 13px; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; resize: vertical;
}
.play-side > p { margin: 0; }

/* The Run link of a program in the documentation. */
.code .run {
    font-size: .75rem; font-weight: 600; color: var(--accent);
    border: 1px solid var(--accent); border-radius: 6px; padding: 1px 8px;
}
.code .run:hover { background: var(--accent); color: #fff; text-decoration: none; }
.code figcaption:has(> .run) { justify-content: flex-start; }
.code figcaption:has(> .run) > .code-label, .code figcaption:has(> .run) > .code-title { margin-right: 0; }
.code figcaption:has(> .run) > .copy, .code figcaption:has(> .run) > .code-tools { margin-left: auto; }
@media print { .code .run { display: none; } }

@media (max-width: 960px) {
    .play-panes { grid-template-columns: minmax(0, 1fr); }
    .play-editor { height: clamp(300px, 60vh, 600px); }
    .play-output { height: clamp(180px, 40vh, 420px); }
    .play-status { margin-left: 0; flex-basis: 100%; }
}
/* ── Documentation: reading comforts (docs pages and the type browser; code.js) ── */
/* --docs-offset is the sticky header's height plus a margin, set by code.js. */
.docs [id] { scroll-margin-top: var(--docs-offset, 80px); }
.docs-nav, .docs-toc { top: var(--docs-offset, 80px); max-height: calc(100vh - var(--docs-offset, 80px) - 16px); overflow-y: auto; overscroll-behavior: contain; }
.docs kbd, .docs-kbd {
    font-family: var(--mono); font-size: .72rem; line-height: 1.4; padding: 0 5px; color: var(--muted);
    background: var(--bg-alt); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px;
}

/* The book switcher */
.book-switch { display: flex; gap: 4px; padding: 4px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-alt); }
.book-switch a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px; border: 0; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: .85rem; }
.book-switch a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.book-switch a.current { color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.book-switch img { flex: none; }

/* The sidebar's filter and sections */
.docs-filter { position: relative; margin-bottom: 12px; }
.docs-filter input { padding: 6px 32px 6px 10px; font-size: .88rem; border-radius: 8px; }
.docs-filter kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.docs-filter input:focus + kbd, .docs-filter input:not(:placeholder-shown) + kbd { display: none; }
.docs-group { margin: 0 0 4px; }
.docs-group > summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 10px 4px; border-radius: 6px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
}
.docs-group > summary::-webkit-details-marker { display: none; }
.docs-group > summary::after {
    content: ""; flex: none; width: 6px; height: 6px; margin-right: 4px;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .15s;
}
.docs-group:not([open]) > summary::after { transform: rotate(-45deg); }
.docs-group > summary:hover { color: var(--text); }
.docs-group > ul { margin-bottom: 8px; }
.docs-nav li > a.current { box-shadow: inset 2px 0 0 var(--accent); }
.docs-nav.filtering .docs-group > summary { pointer-events: none; }
.docs-nav.filtering .docs-group > summary::after { visibility: hidden; }

/* Breadcrumbs and the page's facts */
.docs-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; margin: 0 0 10px; padding: 0; font-size: .85rem; color: var(--muted); }
.docs-crumbs li + li::before { content: "\203A"; margin: 0 8px; color: var(--muted); opacity: .7; }
.docs-crumbs a { color: var(--muted); }
.docs-crumbs a:hover { color: var(--accent); }
.docs-crumbs [aria-current] { color: var(--text); }
.docs-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: -6px 0 24px; color: var(--muted); }
.docs-meta-actions { margin-left: auto; display: flex; gap: 16px; }
.docs-meta-actions a, .docs-meta-actions button.link { color: var(--muted); font-size: inherit; }
.docs-meta-actions a:hover, .docs-meta-actions button.link:hover { color: var(--accent); }

/* "#" beside headings (and members): shown on hover, copies the address */
.heading-anchor { position: relative; margin-left: .35em; color: var(--muted); font-weight: 400; opacity: 0; transition: opacity .15s; }
.heading-anchor::before { content: "#"; }
:is(h2, h3, h4):hover > .heading-anchor, summary:hover .heading-anchor, .heading-anchor:focus-visible { opacity: .7; }
.heading-anchor:hover { color: var(--accent); opacity: 1; text-decoration: none; }
@media (hover: none) { .heading-anchor { opacity: .35; } }
.member-head .anchor { position: relative; }
.heading-anchor.tip::after, .member-head .anchor.tip::after {
    content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%);
    padding: 2px 8px; border-radius: 6px; background: var(--text); color: var(--bg); white-space: nowrap;
    font: 600 .72rem/1.5 var(--sans); letter-spacing: 0; text-transform: none; pointer-events: none;
}

/* "On this page" */
.docs-toc li a { margin-left: -1px; border-left: 2px solid transparent; transition: color .15s, border-color .15s; }
.docs-toc li a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.back-to-top { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; color: var(--muted); }
.back-to-top:hover { color: var(--accent); text-decoration: none; }
.docs-toc-mobile { display: none; }
@media (max-width: 1100px) {
    .docs-toc-mobile { display: block; margin: 0 0 24px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-alt); font-size: .92rem; }
    .docs-toc-mobile summary { padding: 10px 14px; cursor: pointer; font-weight: 600; }
    .docs-toc-mobile ul { list-style: none; margin: 0; padding: 0 14px 12px; }
    .docs-toc-mobile li.level-3 { padding-left: 14px; }
    .docs-toc-mobile a { display: block; padding: 3px 0; color: var(--muted); }
    .docs-toc-mobile a.active { color: var(--accent); font-weight: 600; }
}

/* Callouts: > [!NOTE], [!TIP], [!IMPORTANT], [!WARNING], [!CAUTION] */
.callout {
    --callout: var(--tk-function, #0b5cad);
    margin: 1.2em 0; padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--callout) 30%, var(--border));
    border-left: 4px solid var(--callout); border-radius: 8px; background: color-mix(in srgb, var(--callout) 7%, var(--surface));
}
.callout > p { margin: .4em 0; }
.callout > :last-child { margin-bottom: 0; }
.callout .code { margin: .8em 0; }
.callout-title { display: flex; align-items: center; gap: 8px; margin: 0 0 .2em !important; color: var(--callout); font-weight: 700; font-size: .92rem; }
.callout-icon { flex: none; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--callout-icon) center / contain no-repeat; mask: var(--callout-icon) center / contain no-repeat; }
.callout-note { --callout: var(--tk-function, #0b5cad); --callout-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.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E"); }
.callout-tip { --callout: var(--green); --callout-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.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 22h4M12 2a7 7 0 0 0-4 12.7c.6.5 1 1.3 1 2.3h6c0-1 .4-1.8 1-2.3A7 7 0 0 0 12 2z'/%3E%3C/svg%3E"); }
.callout-important { --callout: var(--tk-number, #6f42c1); --callout-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.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 14h.01'/%3E%3C/svg%3E"); }
.callout-warning { --callout: var(--tk-string, #8a4b08); --callout-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.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 17h.01'/%3E%3C/svg%3E"); }
.callout-caution { --callout: var(--accent); --callout-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.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 16h.01'/%3E%3C/svg%3E"); }

/* Code blocks: titles, lines, highlighted lines, numbers, wrapping, folding, terminal tabs */
.code figcaption { min-height: 38px; padding-top: 6px; padding-bottom: 6px; }
.code-title { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.code figcaption > :first-child { margin-right: auto; }
.code figcaption > .code-title:has(+ .code-label) { margin-right: 0; }
.code-title + .code-label { margin-left: -4px; margin-right: auto; opacity: .8; }
.code-title + .code-label::before { content: "\00B7"; margin-right: 8px; }
.code[data-os="windows"] .code-label::after { content: " \00B7  Windows"; }
.code[data-os="macos"] .code-label::after { content: " \00B7  macOS"; }
.code[data-os="linux"] .code-label::after { content: " \00B7  Linux"; }
.os-tabs .code .code-label::after { content: none; }
.code-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.code-tool {
    display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 24px; padding: 0;
    color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 6px; cursor: pointer;
}
.code-tool:hover { color: var(--text); border-color: var(--border); }
.code-tool[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.code .copy { min-width: 4.4em; }
.code .copy.done { color: var(--green); border-color: var(--green); }
.code .line { display: block; }
.code pre:has(.line) > code { display: inline-block; min-width: 100%; }
.code .line.hl { margin: 0 -16px; padding: 0 16px; background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.code.numbers pre > code { counter-reset: line; }
.code.numbers .line { position: relative; padding-left: 3em; counter-increment: line; }
.code.numbers .line.hl { padding-left: calc(16px + 3em); }
.code.numbers .line::before { content: counter(line); position: absolute; left: 0; width: 2em; text-align: right; color: var(--muted); opacity: .55; user-select: none; }
.code.numbers .line.hl::before { left: 16px; opacity: .9; }
.code.wrap pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.code.wrap pre > code { display: block; min-width: 0; }
.code.collapsible { position: relative; }
.code.collapsed pre { max-height: 24em; overflow: hidden; }
.code.collapsed::after { content: ""; position: absolute; left: 0; right: 0; bottom: 37px; height: 72px; background: linear-gradient(transparent, var(--code-bg)); pointer-events: none; }
.code-expand {
    display: block; width: 100%; padding: 8px; font: inherit; font-size: .82rem; font-weight: 600; color: var(--muted); cursor: pointer;
    background: var(--code-bg); border: 0; border-top: 1px solid var(--border);
}
.code-expand:hover { color: var(--accent); }
.os-tabs { margin: 1.2em 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--code-bg); overflow: hidden; }
.os-tabs > .code { margin: 0 !important; border: 0; border-radius: 0; box-shadow: none; }
.os-tablist { display: flex; gap: 2px; padding: 4px 8px 0; border-bottom: 1px solid var(--border); }
.os-tablist [role="tab"] {
    margin-bottom: -1px; padding: 6px 10px; font: inherit; font-size: .82rem; font-weight: 600; color: var(--muted); cursor: pointer;
    background: none; border: 0; border-bottom: 2px solid transparent;
}
.os-tablist [role="tab"]:hover { color: var(--text); }
.os-tablist [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

/* Members' signatures in the type browser */
.copy-sig {
    flex: none; align-self: flex-start; margin-top: 8px; padding: 2px 8px; font: inherit; font-size: .72rem; color: var(--muted); cursor: pointer;
    background: var(--surface); border: 1px solid var(--border); border-radius: 6px; opacity: 0; transition: opacity .15s;
}
.member:hover .copy-sig, .copy-sig:focus-visible, .copy-sig.done { opacity: 1; }
.copy-sig:hover { color: var(--accent); border-color: var(--accent); }
.copy-sig.done { color: var(--green); border-color: var(--green); }
@media (hover: none) { .copy-sig { opacity: 1; } }
.member-group > summary h2 .heading-anchor { font-size: .8em; }

/* "Was this page helpful?", "Edit this page" and the pager */
.docs-feedback { margin-top: 48px; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-alt); }
.docs-feedback-question { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.docs-feedback-title { margin: 0; font-weight: 600; }
.docs-feedback-buttons { display: flex; gap: 8px; }
.docs-feedback-buttons .button { gap: 6px; }
.docs-feedback-buttons .button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.docs-feedback-more { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.docs-feedback-more label { font-weight: 600; font-size: .92rem; }
.docs-feedback-more textarea {
    width: 100%; padding: 9px 12px; font: inherit; font-size: .95rem; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px; resize: vertical;
}
.docs-feedback-more textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.docs-feedback-form.js:not(.answered) .docs-feedback-more { display: none; }
.docs-feedback-send { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.docs-feedback-thanks { margin: 0; font-weight: 600; color: var(--green); }
.docs-feedback-status { margin: 8px 0 0; color: var(--accent); }
.docs-feedback-status:empty { display: none; }
.docs-page-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 14px 0 0; }
.docs-page-links a { color: var(--muted); }
.docs-page-links a:hover { color: var(--accent); }
.docs-pager kbd { margin-left: 4px; }
@media (hover: none) { .docs-pager kbd, .docs-filter kbd { display: none; } }

/* /admin/feedback */
.feedback-totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 20px 0; }
.feedback-totals .panel { display: flex; flex-direction: column; margin: 0; }
.feedback-totals strong { font-size: 1.6rem; }
.feedback-meter { display: inline-block; width: 64px; height: 6px; margin-right: 6px; vertical-align: middle; border-radius: 3px; background: var(--accent-soft); overflow: hidden; }
.feedback-meter > span { display: block; height: 100%; background: var(--green); }
.feedback-comments { list-style: none; margin: 0; padding: 0; }
.feedback-comments li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.feedback-comments li p { margin: 0; }
.feedback-comment { margin-top: 4px !important; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 640px) { .feedback-totals { grid-template-columns: repeat(2, 1fr); } }

@media (prefers-reduced-motion: reduce) {
    .heading-anchor, .docs-group > summary::after, .docs-toc li a, .copy-sig { transition: none; }
}

/* Printing a page (and "Download as PDF", which is printing to a PDF) */
@media print {
    :root, :root[data-theme], :root:not([data-theme="light"]) {
        --bg: #fff; --bg-alt: #f6f7f9; --surface: #fff; --text: #111; --muted: #555; --border: #d0d4da;
        --accent: #b0102f; --accent-soft: #fde8ec; --green: #1e6b33; --green-soft: #e3f4e7; --code-bg: #f6f7f9; --shadow: none;
        --tk-keyword: #b0102f; --tk-type: #1e6b33; --tk-string: #8a4b08; --tk-number: #6f42c1; --tk-comment: #6a737d; --tk-function: #0b5cad; --tk-literal: #6f42c1; --tk-key: #0b5cad;
        color-scheme: light;
    }
    body:has(.docs) .site-header, body:has(.docs) .site-footer, body:has(.docs) .skip,
    .docs-nav, .docs-toc, .docs-toc-mobile, .docs-feedback, .docs-pager, .docs-page-links, .docs-meta-actions,
    .heading-anchor, .code-tools, .code .copy, .code-expand, .os-tablist, .copy-sig, .member-head .anchor, .type-top .view-tabs { display: none !important; }
    body { font-size: 11pt; background: #fff; }
    .docs { display: block; max-width: none; padding: 0; }
    .prose { max-width: none; }
    .code, .os-tabs { box-shadow: none; }
    .code pre { white-space: pre-wrap; overflow: visible; max-height: none !important; }
    .code.collapsed::after { display: none; }
    .code .line { break-inside: avoid; }
    .os-tabs > .code[hidden] { display: block !important; border-top: 1px solid var(--border); }
    .os-tabs .code[data-os="windows"] .code-label::after { content: " \00B7  Windows"; }
    .os-tabs .code[data-os="macos"] .code-label::after { content: " \00B7  macOS"; }
    .os-tabs .code[data-os="linux"] .code-label::after { content: " \00B7  Linux"; }
    .code figcaption, .prose :is(h2, h3, h4), .callout-title { break-after: avoid; }
    .callout, .docs-meta, tr { break-inside: avoid; }
    .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; color: var(--muted); overflow-wrap: anywhere; }
    @page { margin: 16mm 14mm; }
}
/* ── Hive registry: package pages, the /hive front page, keywords, badges, the dashboard ── */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.package-header h1 { margin-bottom: 6px; }
.package-header .lead { margin: 4px 0 10px; }
.package-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.keyword-list { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.keyword-list.compact { margin: 6px 0 0; }
.keyword-list.large { gap: 10px; }
.keyword { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-alt); color: var(--text); }
.keyword:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.keyword .count, .package-tabs .count { font-size: .75rem; color: var(--muted); }
.package-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--border); margin: 24px 0 20px; }
.package-tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.package-tabs a:hover { color: var(--text); text-decoration: none; }
.package-tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.package-main > h2:first-child { margin-top: 0; }
.readme { overflow-wrap: anywhere; }
.readme img { max-width: 100%; }
.readme > :first-child { margin-top: 0; }
.readme-empty { border: 1px dashed var(--border); border-radius: var(--radius); padding: 18px 20px; }
.dependency-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.dependency-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.dependency-list li > div { flex-basis: 100%; }
.namespace-list { list-style: none; padding: 0; columns: 2 220px; }
.namespace-list li { margin: 4px 0; break-inside: avoid; }
.version-table tr.yanked td { color: var(--muted); }
.version-table tr.yanked a { text-decoration: line-through; }
.package-facts .code { margin: 8px 0 12px; box-shadow: none; }
.package-facts .code pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.package-facts .small-title:first-child { margin-top: 0; }
.download-summary { display: flex; gap: 22px; margin: 6px 0; }
.download-summary div { display: flex; flex-direction: column; }
.download-summary strong { font-size: 1.3rem; }
.owner-list { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.sparkline { display: block; max-width: 100%; height: auto; }
.sparkline .line { stroke: var(--green); stroke-width: 1.5; stroke-linejoin: round; }
.sparkline .area { fill: var(--green-soft); stroke: none; }
.download-chart-wrap { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; background: var(--surface); }
.download-chart { width: 100%; height: auto; display: block; }
.download-chart .bar { fill: var(--green); }
.download-chart .bar:hover { fill: var(--accent); }
.download-chart .axis { stroke: var(--border); }
.download-chart .label { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.package-settings { max-width: 560px; }
.package-settings input, .package-settings textarea { width: 100%; }
.hive-search select { min-width: 0; }
.hive-stats { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.hive-stats li { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); display: flex; flex-direction: column; }
.hive-stats strong { font-size: 1.5rem; }
.hive-stats span { color: var(--muted); font-size: .9rem; }
.hive-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }
.hive-columns .small-title a, #keywords .small-title a { text-transform: none; letter-spacing: 0; margin-left: 8px; font-weight: 400; }
.hive-columns .package-card p { font-size: .93rem; }
.package-downloads { margin-left: auto; }
.results-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; }
.sort-links { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); }
.hive-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hive-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 24px 0; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.dashboard-grid .panel:first-child { margin-top: 0; }
.dashboard-packages td { vertical-align: middle; }
.author-row { padding: 10px 0; border-top: 1px solid var(--border); }
.author-row:first-of-type { border-top: 0; }
.author-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.member-list { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.thread-list li { padding: 6px 0; }
.token-list li { padding: 4px 0; }
.quick-start .steps { padding-left: 20px; }
.quick-start .steps li { margin: 10px 0; }
.quick-start .code { margin: 8px 0; box-shadow: none; }
@media (max-width: 1000px) {
    .hive-columns { grid-template-columns: minmax(0, 1fr); }
    .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .hive-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .package-tabs a { padding: 8px 10px; }
}.hive-search select { flex: 0 0 auto; width: auto; }
.package-compact { list-style: none; padding: 0; margin: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.package-compact li { padding: 10px 14px; border-top: 1px solid var(--border); }
.package-compact li:first-child { border-top: 0; }
.package-compact p { margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.package-compact-head { display: flex; gap: 8px; align-items: center; min-width: 0; }
.package-compact-head > a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.package-compact-metric { margin-left: auto; white-space: nowrap; }
.readme table { border-collapse: collapse; margin: 12px 0; display: block; overflow-x: auto; }
.readme th, .readme td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.readme th { background: var(--bg-alt); }
.readme pre { overflow-x: auto; }.package-settings textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; resize: vertical; }
.dashboard-packages th { white-space: nowrap; }

/* Blog and releases (/blog, /releases) */
.blog-hero { padding: 48px 0 32px; background: radial-gradient(900px 300px at 80% 0%, var(--accent-soft), transparent 70%); border-bottom: 1px solid var(--border); }
.blog-hero h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.blog-hero .eyebrow a { color: inherit; }
.blog-feeds { color: var(--muted); }
.post-meta { margin: 0 0 .4em; }
.post-featured { border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; margin-bottom: 40px; background: var(--surface); box-shadow: var(--shadow); }
.post-featured h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.post-featured h2 a, .post-card h3 a { color: var(--text); }
.post-featured h2 a:hover, .post-card h3 a:hover { color: var(--accent); text-decoration: none; }
.post-list { display: grid; gap: 0; }
.post-card { padding: 22px 0; border-bottom: 1px solid var(--border); }
.post-card h3 { font-size: 1.3rem; margin-bottom: .3em; }
.post-card p { margin: .3em 0; }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: .6em 0 0; }
.tag { font-size: .82rem; padding: 2px 10px; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--border); color: var(--muted); }
.tag:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.blog-tags-title { font-size: 1rem; margin-top: 40px; }
.blog-post .post-body { margin: 32px 0; max-width: none; }
.post-cover { width: 100%; border-radius: var(--radius); margin-top: 24px; }
.post-share { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: .9rem; }
.release { padding: 24px 0; border-bottom: 1px solid var(--border); }
.release-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.release-head h2 { margin: 0; font-size: 1.4rem; }
.release-head h2 a { color: var(--text); }
.release-files summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.release-notes { max-width: none; }
@media (max-width: 640px) {
    .post-featured { padding: 20px; }
    .docs-pager { grid-template-columns: 1fr; }
    .pager.next { grid-column: 1; }
}

/* ── Email (feature/mail): the unconfirmed-address banner, the package Follow button, /admin/mail ── */
.mail-banner { background: var(--accent-soft); color: var(--text); border-bottom: 1px solid var(--accent); font-size: .92rem; padding: 8px 0; }
.mail-banner a { font-weight: 600; margin-left: 6px; }
.follow-package { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 16px 0; }
.follow-package .follow-form { margin: 0; }
.mail-totals .panel { color: inherit; text-decoration: none; }
.mail-totals .panel:hover { border-color: var(--accent); }
.mail-preview .mail-meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 16px; }
.mail-preview .mail-meta dt { color: var(--muted); }
.mail-preview .mail-meta dd { margin: 0; overflow-wrap: anywhere; }
.mail-frame { width: 100%; height: 560px; border: 1px solid var(--border); border-radius: 8px; background: #0a0a0a; }
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }
.mail-files { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.mail-table td { overflow-wrap: anywhere; }
@media (max-width: 640px) {
    .mail-frame { height: 440px; }
    .mail-preview .mail-meta { grid-template-columns: 1fr; }
}

/* ── Header with longer labels (Spanish): the logo never shrinks, the menu tightens on medium screens ── */
.brand { flex: none; }
@media (max-width: 1360px) {
    .nav-menu > li > a, .nav-trigger { padding-left: 8px; padding-right: 8px; font-size: .92rem; }
}
