/* Tokens */
:root {
    --site-bg: #ffffff;
    --site-surface: #f6f8fa;
    --site-raised: #ffffff;
    --site-fg: #0a1929;
    --site-muted: #566779;
    --site-faint: #8796a6;
    --site-border: #e2e7ed;
    --site-border-strong: #cfd7e0;
    --site-accent: #0b8fa0;
    --site-accent-strong: #08707e;
    --site-accent-soft: rgba(11, 143, 160, 0.09);
    --site-spark: #e8672a;
    --site-code-bg: #0e2238;
    --site-code-fg: #dfe8f2;
    --site-ring: rgba(11, 143, 160, 0.35);
    --site-shadow: 0 1px 2px rgba(10, 25, 41, 0.05), 0 8px 24px -12px rgba(10, 25, 41, 0.12);
    --site-radius: 10px;
    --site-radius-sm: 6px;
    --site-nav-h: 60px;
    --site-font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --site-display: 'Montserrat', 'DM Sans', system-ui, sans-serif;
    --site-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

    /* Bootstrap bridge */
    --bs-body-bg: var(--site-bg);
    --bs-body-color: var(--site-fg);
    --bs-border-color: var(--site-border);
    --bs-link-color-rgb: 11, 143, 160;
    --bs-link-hover-color-rgb: 8, 112, 126;
    --bs-body-font-family: var(--site-font);
    --bs-font-monospace: var(--site-mono);
    --bs-emphasis-color: var(--site-fg);
    --bs-secondary-color: var(--site-muted);
    --bs-tertiary-bg: var(--site-surface);

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-bs-theme="light"]) {
        --site-bg: #0a1929;
        --site-surface: #0d1f33;
        --site-raised: #0e2238;
        --site-fg: #e6edf5;
        --site-muted: #93a6ba;
        --site-faint: #637a91;
        --site-border: #1a3249;
        --site-border-strong: #26425e;
        --site-accent: #2ab8c8;
        --site-accent-strong: #5fd3df;
        --site-accent-soft: rgba(42, 184, 200, 0.12);
        --site-code-bg: #071423;
        --site-ring: rgba(42, 184, 200, 0.4);
        --site-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.6);
        --bs-link-color-rgb: 42, 184, 200;
        --bs-link-hover-color-rgb: 95, 211, 223;
        color-scheme: dark;
    }
}

html.dark,
:root[data-bs-theme="dark"] {
    --site-bg: #0a1929;
    --site-surface: #0d1f33;
    --site-raised: #0e2238;
    --site-fg: #e6edf5;
    --site-muted: #93a6ba;
    --site-faint: #637a91;
    --site-border: #1a3249;
    --site-border-strong: #26425e;
    --site-accent: #2ab8c8;
    --site-accent-strong: #5fd3df;
    --site-accent-soft: rgba(42, 184, 200, 0.12);
    --site-code-bg: #071423;
    --site-ring: rgba(42, 184, 200, 0.4);
    --site-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.6);
    --bs-body-bg: var(--site-bg);
    --bs-body-color: var(--site-fg);
    --bs-border-color: var(--site-border);
    --bs-emphasis-color: var(--site-fg);
    --bs-secondary-color: var(--site-muted);
    --bs-tertiary-bg: var(--site-surface);
    --bs-link-color-rgb: 42, 184, 200;
    --bs-link-hover-color-rgb: 95, 211, 223;
    color-scheme: dark;
}

/* Base */
html {
    scroll-padding-top: calc(var(--site-nav-h) + 16px);
}

body {
    background: var(--site-bg);
    color: var(--site-fg);
    font-family: var(--site-font);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--site-fg);
    font-family: var(--site-display);
    letter-spacing: -0.01em;
}

a {
    color: var(--site-accent);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--site-accent-strong);
}

::selection {
    background: rgba(42, 184, 200, 0.28);
}

:focus-visible {
    outline: 2px solid var(--site-accent);
    outline-offset: 2px;
}

code, kbd, pre, samp {
    font-family: var(--site-mono);
}

kbd {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 6px;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--site-muted);
    background: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: 4px;
    box-shadow: none;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 2000;
    padding: 8px 14px;
    background: var(--site-fg);
    color: var(--site-bg);
    border-radius: var(--site-radius-sm);
}

.skip-link:focus {
    top: 12px;
    color: var(--site-bg);
}

.container-site {
    width: 100%;
    max-width: 1320px;
    margin-inline: auto;
    padding-inline: 16px;
}

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

/* Buttons */
.btn-site {
    --btn-bg: var(--site-fg);
    --btn-fg: var(--site-bg);
    --btn-border: var(--site-fg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    font-size: 0.925rem;
    font-weight: 600;
    color: var(--btn-fg);
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: var(--site-radius-sm);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-site:hover {
    color: var(--btn-fg);
    background: color-mix(in srgb, var(--btn-bg) 86%, var(--site-bg));
}

.btn-site--accent {
    --btn-bg: var(--site-accent);
    --btn-border: var(--site-accent);
    --btn-fg: #ffffff;
}

html.dark .btn-site--accent,
:root[data-bs-theme="dark"] .btn-site--accent {
    --btn-fg: #06202a;
}

.btn-site--ghost {
    --btn-bg: transparent;
    --btn-fg: var(--site-fg);
    --btn-border: var(--site-border-strong);
}

.btn-site--ghost:hover {
    background: var(--site-surface);
}

.btn-site--sm {
    height: 32px;
    padding: 0 12px;
    font-size: 0.85rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--site-muted);
    background: transparent;
    border: 0;
    border-radius: var(--site-radius-sm);
    text-decoration: none;
    cursor: pointer;
}

.btn-icon:hover {
    color: var(--site-fg);
    background: var(--site-surface);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

.btn-icon .bi {
    font-size: 1.05rem;
}

/* Top navigation */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--site-nav-h);
    background: color-mix(in srgb, var(--site-bg) 82%, transparent);
    border-bottom: 1px solid var(--site-border);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    backdrop-filter: saturate(160%) blur(10px);
}

.site-nav__inner {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
}

@media (min-width: 768px) {
    .site-nav__inner {
        gap: 24px;
    }
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--site-fg);
    font-family: var(--site-display);
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
}

.brand:hover {
    color: var(--site-fg);
}

.brand__mark {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
}

.site-nav__links {
    display: none;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav__links a {
    display: block;
    padding: 6px 10px;
    font-size: 0.9rem;
    color: var(--site-muted);
    text-decoration: none;
    border-radius: var(--site-radius-sm);
}

.site-nav__links a:hover,
.site-nav__links a[aria-current="page"] {
    color: var(--site-fg);
}

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

.search-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 36px;
    padding: 0 8px 0 12px;
    font-size: 0.875rem;
    color: var(--site-muted);
    background: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius-sm);
    cursor: pointer;
}

.search-trigger:hover {
    border-color: var(--site-border-strong);
    color: var(--site-fg);
}

.search-trigger__label {
    display: none;
    min-width: 150px;
    text-align: left;
}

.search-trigger kbd {
    display: none;
}

.gh-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 10px;
    font-size: 0.85rem;
    color: var(--site-muted);
    text-decoration: none;
    border-radius: var(--site-radius-sm);
}

.gh-link:hover {
    color: var(--site-fg);
    background: var(--site-surface);
}

.gh-link .bi {
    font-size: 1.05rem;
}

.gh-link__stars:empty {
    display: none;
}

.nav-menu-btn {
    display: inline-flex;
}

@media (min-width: 768px) {
    .site-nav__links {
        display: flex;
    }

    .search-trigger__label,
    .search-trigger kbd {
        display: inline-flex;
    }

    .nav-menu-btn--landing {
        display: none;
    }
}

@media (min-width: 992px) {
    .nav-menu-btn--docs {
        display: none;
    }
}

/* Dark mode toggle injected by PluginDarkMode */
[data-plugin-darkmode] svg {
    width: 18px;
    height: 18px;
}

/* Landing: hero */
.hero {
    position: relative;
    padding: 56px 0 36px;
    text-align: center;
    overflow: hidden;
    isolation: isolate;
}

/* Bootstrap-style color wash, kept faint and behind a dotted grid */
.hero::before {
    content: '';
    position: absolute;
    inset: -20% -10% auto;
    height: 640px;
    z-index: -2;
    background:
        radial-gradient(40% 50% at 30% 30%, rgba(42, 184, 200, 0.16), transparent 70%),
        radial-gradient(30% 40% at 72% 20%, rgba(232, 103, 42, 0.11), transparent 70%);
    filter: blur(8px);
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(var(--site-border) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(60% 55% at 50% 30%, #000 30%, transparent 75%);
    mask-image: radial-gradient(60% 55% at 50% 30%, #000 30%, transparent 75%);
}

.announce {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 5px;
    margin-bottom: 24px;
    font-size: 0.85rem;
    color: var(--site-fg);
    background: var(--site-raised);
    border: 1px solid var(--site-border);
    border-radius: 999px;
    text-decoration: none;
    box-shadow: var(--site-shadow);
}

.announce:hover {
    color: var(--site-fg);
    border-color: var(--site-border-strong);
}

.announce__tag {
    padding: 1px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--site-spark);
    border-radius: 999px;
}

.hero__title {
    max-width: 18ch;
    margin: 0 auto 20px;
    font-size: clamp(2.2rem, 5.2vw, 3.75rem);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -0.03em;
}

.hero__lead {
    max-width: 60ch;
    margin: 0 auto 28px;
    font-size: clamp(1.05rem, 1.6vw, 1.2rem);
    color: var(--site-muted);
}

.hero__lead code {
    padding: 1px 6px;
    font-size: 0.9em;
    color: var(--site-fg);
    background: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: 4px;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.install {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    gap: 4px;
    padding: 4px 4px 4px 14px;
    font-family: var(--site-mono);
    font-size: 0.85rem;
    color: var(--site-muted);
    background: var(--site-raised);
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius-sm);
}

.install__cmd {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.install__cmd::before {
    content: '$ ';
    color: var(--site-faint);
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    padding: 0;
    color: var(--site-muted);
    background: transparent;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.copy-btn:hover {
    color: var(--site-fg);
    background: var(--site-surface);
}

/* Landing: attribute lab */
.lab {
    padding: 8px 0 88px;
}

.lab__frame {
    display: grid;
    grid-template-columns: 1fr;
    background: var(--site-raised);
    border: 1px solid var(--site-border);
    border-radius: 14px;
    box-shadow: var(--site-shadow);
    overflow: hidden;
}

@media (min-width: 992px) {
    .lab__frame {
        grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    }
}

.lab__code {
    min-width: 0;
    padding: 14px;
    background: var(--site-surface);
    border-bottom: 1px solid var(--site-border);
}

@media (min-width: 992px) {
    .lab__code {
        border-bottom: 0;
        border-right: 1px solid var(--site-border);
    }
}

.lab__code .ts-code-window {
    --ts-cw-radius: 10px;
    --ts-cw-bg: var(--site-code-bg);
    --ts-cw-chrome-bg: #0a1a2c;
    --ts-cw-border: rgba(255, 255, 255, 0.07);
    --ts-cw-accent: #2ab8c8;
    --ts-cw-tab-fg: rgba(223, 232, 242, 0.5);
    --ts-cw-tab-fg-active: #ffffff;
    margin: 0;
}

.lab__code pre {
    max-height: 420px;
    margin: 0;
    font-size: 0.8rem;
}

.lab__stage {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 420px;
    min-width: 0;
}

.lab__stage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    font-size: 0.8rem;
    color: var(--site-muted);
    border-bottom: 1px solid var(--site-border);
}

.lab__live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lab__live::before {
    content: '';
    width: 7px;
    height: 7px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.lab__stage-body {
    display: grid;
    flex: 1 1 auto;
    place-items: center;
    padding: 32px 20px 40px;
    background-image: radial-gradient(var(--site-border) 1px, transparent 1px);
    background-size: 16px 16px;
}

.lab__panel {
    width: 100%;
    max-width: 380px;
}

.lab__panel[hidden] {
    display: none;
}

.lab__caption {
    margin: 16px 0 0;
    font-size: 0.85rem;
    color: var(--site-muted);
    text-align: center;
}

/* Small form vocabulary used inside the lab demos */
.field {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
    text-align: left;
}

.field > label,
.field__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--site-fg);
}

.field__hint {
    font-size: 0.8rem;
    color: var(--site-muted);
}

.demo-card {
    padding: 20px;
    background: var(--site-raised);
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius);
    box-shadow: var(--site-shadow);
    text-align: left;
}

.demo-card h3 {
    margin: 0 0 4px;
    font-family: var(--site-font);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
}

.demo-card p {
    margin: 0 0 16px;
    font-size: 0.875rem;
    color: var(--site-muted);
}

.demo-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Landing: sections */
.section {
    padding: 88px 0;
    border-top: 1px solid var(--site-border);
}

.section__head {
    max-width: 640px;
    margin-bottom: 44px;
}

.section__title {
    margin: 0 0 12px;
    font-size: clamp(1.75rem, 3.4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.025em;
}

.section__lead {
    margin: 0;
    font-size: 1.05rem;
    color: var(--site-muted);
}

/* Steps: an actual sequence, so numbered */
.steps {
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

@media (min-width: 992px) {
    .steps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.step {
    display: flex;
    flex-direction: column;
    min-width: 0;
    counter-increment: step;
}

.step__title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 8px;
    font-family: var(--site-font);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0;
}

.step__title::before {
    content: counter(step);
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    font-family: var(--site-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--site-accent);
    background: var(--site-accent-soft);
    border-radius: 50%;
    transform: translateY(-2px);
}

.step__text {
    margin: 0 0 14px 36px;
    font-size: 0.925rem;
    color: var(--site-muted);
}

.step pre {
    flex: 1 1 auto;
    margin: 0;
}

/* Static code blocks outside the docs (highlighted by PluginHighlight) */
.snip {
    position: relative;
    margin: 0;
    font-size: 0.8rem;
    border-radius: var(--site-radius);
    overflow: hidden;
}

.snip pre,
pre.snip {
    margin: 0;
}

/* Loading strategies */
.loadout {
    display: grid;
    gap: 0;
    margin: 0;
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius);
    overflow: hidden;
}

.loadout__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px 24px;
    padding: 18px 20px;
    background: var(--site-raised);
}

.loadout__row + .loadout__row {
    border-top: 1px solid var(--site-border);
}

@media (min-width: 768px) {
    .loadout__row {
        grid-template-columns: minmax(220px, 0.9fr) minmax(0, 2fr) auto;
        align-items: center;
    }
}

.loadout__file {
    margin: 0;
    font-family: var(--site-mono);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--site-fg);
}

.loadout__desc {
    margin: 0;
    font-size: 0.925rem;
    color: var(--site-muted);
}

.loadout__tag {
    justify-self: start;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--site-muted);
    border: 1px solid var(--site-border);
    border-radius: 999px;
}

.loadout__tag--req {
    color: var(--site-spark);
    border-color: color-mix(in srgb, var(--site-spark) 40%, transparent);
}

/* Component directory */
.directory {
    columns: 1;
    column-gap: 32px;
}

@media (min-width: 576px) {
    .directory {
        columns: 2;
    }
}

@media (min-width: 992px) {
    .directory {
        columns: 3;
    }
}

@media (min-width: 1200px) {
    .directory {
        columns: 4;
    }
}

.directory__group {
    break-inside: avoid;
    margin-bottom: 32px;
}

.directory__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-family: var(--site-font);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0;
}

.directory__title .bi {
    color: var(--site-accent);
}

.directory__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.directory__list a {
    display: block;
    padding: 3px 0;
    font-size: 0.925rem;
    color: var(--site-muted);
    text-decoration: none;
}

.directory__list a:hover {
    color: var(--site-fg);
    text-decoration: underline;
}

/* Showcase */
.showcase {
    display: grid;
    gap: 1px;
    background: var(--site-border);
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius);
    overflow: hidden;
}

@media (min-width: 768px) {
    .showcase {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.showcase__item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px 22px 20px;
    color: inherit;
    background: var(--site-raised);
    text-decoration: none;
}

.showcase__item:hover {
    color: inherit;
    background: var(--site-surface);
}

.showcase__kind {
    font-size: 0.8rem;
    color: var(--site-faint);
}

.showcase__name {
    margin: 0;
    font-family: var(--site-display);
    font-size: 1.2rem;
    font-weight: 700;
}

.showcase__desc {
    margin: 0;
    font-size: 0.925rem;
    color: var(--site-muted);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.chip {
    padding: 1px 8px;
    font-size: 0.75rem;
    color: var(--site-muted);
    background: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: 999px;
}

/* Closing call to action */
.cta {
    display: grid;
    gap: 24px;
    align-items: center;
    padding: 40px;
    color: #e6edf5;
    background:
        radial-gradient(50% 120% at 100% 0%, rgba(42, 184, 200, 0.25), transparent 60%),
        radial-gradient(40% 90% at 0% 100%, rgba(232, 103, 42, 0.16), transparent 60%),
        #0e2238;
    border-radius: 16px;
}

@media (min-width: 992px) {
    .cta {
        grid-template-columns: 1fr auto;
        padding: 56px;
    }
}

.cta h2 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    letter-spacing: -0.02em;
}

.cta p {
    margin: 0;
    color: #b6c5d5;
}

.cta .btn-site {
    --btn-bg: #ffffff;
    --btn-fg: #0a1929;
    --btn-border: #ffffff;
}

.cta .btn-site--ghost {
    --btn-bg: transparent;
    --btn-fg: #ffffff;
    --btn-border: rgba(255, 255, 255, 0.3);
}

.cta .btn-site--ghost:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Footer */
.site-footer {
    padding: 32px 0 40px;
    font-size: 0.875rem;
    color: var(--site-muted);
    border-top: 1px solid var(--site-border);
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-footer a {
    color: var(--site-fg);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--site-accent);
}

.site-footer ul {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Docs layout */
.docs {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
}

@media (min-width: 992px) {
    .docs {
        grid-template-columns: 240px minmax(0, 1fr);
    }
}

@media (min-width: 1280px) {
    .docs {
        grid-template-columns: 240px minmax(0, 1fr) 220px;
        gap: 48px;
    }
}

.docs-sidebar {
    display: none;
}

@media (min-width: 992px) {
    .docs-sidebar {
        display: block;
        position: sticky;
        top: var(--site-nav-h);
        height: calc(100vh - var(--site-nav-h));
        margin-left: -8px;
    }
}

.docs-sidebar__scroll {
    height: 100%;
    padding: 24px 8px 40px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--site-border-strong) transparent;
}

.side-filter {
    position: relative;
    margin-bottom: 18px;
}

.side-filter .bi {
    position: absolute;
    left: 10px;
    top: 50%;
    font-size: 0.85rem;
    color: var(--site-faint);
    transform: translateY(-50%);
    pointer-events: none;
}

.side-filter input {
    width: 100%;
    height: 34px;
    padding: 0 10px 0 30px;
    font-size: 0.85rem;
    color: var(--site-fg);
    background: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius-sm);
}

.side-filter input::placeholder {
    color: var(--site-faint);
}

.side-filter input:focus {
    outline: none;
    border-color: var(--site-accent);
    box-shadow: 0 0 0 3px var(--site-ring);
}

.side-group {
    margin-bottom: 22px;
}

.side-group[hidden] {
    display: none;
}

.side-group__title {
    margin: 0 0 6px;
    padding: 0 8px;
    font-family: var(--site-font);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--site-fg);
}

.side-group ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.side-link {
    display: block;
    padding: 4px 8px;
    font-size: 0.875rem;
    color: var(--site-muted);
    text-decoration: none;
    border-radius: var(--site-radius-sm);
}

.side-link:hover {
    color: var(--site-fg);
    background: var(--site-surface);
}

.side-link[aria-current="page"] {
    color: var(--site-fg);
    font-weight: 600;
    background: var(--site-surface);
    box-shadow: inset 2px 0 0 var(--site-accent);
}

.side-empty {
    padding: 0 8px;
    font-size: 0.85rem;
    color: var(--site-muted);
}

.docs-main {
    min-width: 0;
    padding: 28px 0 64px;
}

.doc-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 14px;
    padding: 0;
    font-size: 0.85rem;
    color: var(--site-muted);
    list-style: none;
}

.doc-crumbs li + li::before {
    content: '/';
    margin-right: 6px;
    color: var(--site-faint);
}

.doc-crumbs a {
    color: var(--site-muted);
    text-decoration: none;
}

.doc-crumbs a:hover {
    color: var(--site-fg);
}

.doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 28px;
}

.doc-meta a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 10px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--site-muted);
    background: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius-sm);
    text-decoration: none;
}

.doc-meta a:hover {
    color: var(--site-fg);
    border-color: var(--site-border-strong);
}

.doc-meta a[hidden] {
    display: none;
}

/* Docs prose. The article carries .ts-markdown from PluginMarkdown;
   pairing it with .doc-prose outranks the plugin's injected sheet. */
.doc-prose.ts-markdown {
    --ts-md-font: var(--site-font);
    --ts-md-code-font: var(--site-mono);
    --ts-md-code-bg: var(--site-surface);
    --ts-md-border: var(--site-border);
    --ts-md-link: var(--site-accent);
    --ts-md-link-hover: var(--site-accent-strong);
    --ts-md-hr: var(--site-border);
    --ts-md-heading-mt: 2.25em;
    max-width: 780px;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--site-fg);
}

.doc-prose.ts-markdown h1,
.doc-prose.ts-markdown h2,
.doc-prose.ts-markdown h3,
.doc-prose.ts-markdown h4 {
    position: relative;
    font-family: var(--site-display);
    color: var(--site-fg);
    scroll-margin-top: calc(var(--site-nav-h) + 20px);
}

.doc-prose.ts-markdown h1 {
    margin: 0 0 12px;
    padding: 0;
    font-size: clamp(2rem, 4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    border: 0;
}

.doc-prose.ts-markdown h2 {
    margin-top: 2.6em;
    padding-bottom: 10px;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    border-bottom: 1px solid var(--site-border);
}

.doc-prose.ts-markdown h3 {
    margin-top: 2em;
    font-size: 1.2rem;
    font-weight: 700;
}

.doc-prose.ts-markdown h4,
.doc-prose.ts-markdown h5,
.doc-prose.ts-markdown h6 {
    margin-top: 1.8em;
    font-family: var(--site-font);
    font-size: 1rem;
    font-weight: 700;
    color: var(--site-fg);
}

.doc-prose.ts-markdown h1 strong,
.doc-prose.ts-markdown h2 strong,
.doc-prose.ts-markdown h3 strong {
    font-weight: inherit;
}

.doc-prose.ts-markdown .lead {
    margin-bottom: 1.6em;
    font-size: 1.15rem;
    line-height: 1.65;
    color: var(--site-muted);
}

.doc-prose.ts-markdown a {
    color: var(--site-accent);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--site-accent) 35%, transparent);
}

.doc-prose.ts-markdown a:hover {
    color: var(--site-accent-strong);
    text-decoration-color: currentColor;
}

.heading-anchor {
    position: absolute;
    left: -1.1em;
    padding-right: 0.3em;
    color: var(--site-faint) !important;
    font-weight: 400 !important;
    text-decoration: none !important;
    opacity: 0;
    transition: opacity 0.15s ease;
}

h2:hover > .heading-anchor,
h3:hover > .heading-anchor,
h4:hover > .heading-anchor,
.heading-anchor:focus {
    opacity: 1;
}

.doc-prose.ts-markdown :not(pre) > code {
    padding: 0.15em 0.4em;
    font-size: 0.85em;
    color: var(--site-fg);
    background: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: 4px;
    word-break: break-word;
}

.doc-prose.ts-markdown pre {
    margin: 0 0 1.4em;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--site-code-fg);
    background: var(--site-code-bg);
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius);
}

.doc-prose.ts-markdown pre code {
    color: inherit;
    background: none;
    border: 0;
}

/* PluginHighlight theme, scoped to site code surfaces */
.doc-prose,
.lab,
.section,
.hero {
    --ts-highlight-bg: var(--site-code-bg);
    --ts-highlight-color: #dfe8f2;
    --ts-highlight-header-bg: #0a1a2c;
    --ts-highlight-border-radius: var(--site-radius);
    --ts-highlight-selection-bg: rgba(42, 184, 200, 0.3);
    --ts-highlight-selection-color: #ffffff;
    --ts-highlight-ln-border-color: rgba(255, 255, 255, 0.06);
    --ts-highlight-token-comment: #5f7790;
    --ts-highlight-token-tag: #7fb4e0;
    --ts-highlight-token-operator: #c3d2e1;
    --ts-highlight-token-variable: #f0a37a;
    --ts-highlight-token-number: #f0a37a;
    --ts-highlight-token-title: #6fd3dd;
    --ts-highlight-token-string: #a8d58a;
    --ts-highlight-token-builtin: #6fd3dd;
    --ts-highlight-token-function: #8cc7ff;
    --ts-highlight-token-keyword: #c79bf2;
    --ts-highlight-token-meta: #e8a46f;
    --ts-highlight-copy-opacity: 0.4;
}

.doc-prose.ts-markdown blockquote {
    margin: 0 0 1.4em;
    padding: 12px 16px;
    color: var(--site-muted);
    background: transparent;
    border-left: 3px solid var(--site-border-strong);
    border-radius: 0;
}

.doc-prose.ts-markdown ul,
.doc-prose.ts-markdown ol {
    padding-left: 1.4em;
}

.doc-prose.ts-markdown li::marker {
    color: var(--site-faint);
}

.doc-prose.ts-markdown hr {
    margin: 2.4em 0;
    border-top: 1px solid var(--site-border);
}

.doc-prose.ts-markdown img {
    border-radius: var(--site-radius-sm);
}

/* Tables are wrapped by docs.js so wide ones scroll on their own */
.table-scroll {
    margin: 0 0 1.4em;
    overflow-x: auto;
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius);
}

.doc-prose.ts-markdown .table-scroll table {
    margin: 0;
    font-size: 0.875rem;
    border-style: hidden;
}

.doc-prose.ts-markdown th,
.doc-prose.ts-markdown td {
    padding: 10px 14px;
    vertical-align: top;
    border: 1px solid var(--site-border);
}

.doc-prose.ts-markdown th {
    font-weight: 600;
    color: var(--site-fg);
    white-space: nowrap;
    background: var(--site-surface);
}

.doc-prose.ts-markdown tbody tr:nth-child(even) td {
    background: transparent;
}

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

/* GitHub-style alerts, converted from > [!NOTE] blockquotes */
.doc-prose.ts-markdown .callout {
    --callout: var(--site-accent);
    margin: 0 0 1.4em;
    padding: 14px 16px 14px 18px;
    color: var(--site-fg);
    background: color-mix(in srgb, var(--callout) 7%, transparent);
    border: 1px solid color-mix(in srgb, var(--callout) 28%, transparent);
    border-left: 3px solid var(--callout);
    border-radius: var(--site-radius-sm);
}

.callout__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--callout);
}

.doc-prose.ts-markdown .callout p {
    margin-bottom: 0.6em;
}

.doc-prose.ts-markdown .callout > :last-child {
    margin-bottom: 0;
}

.callout--tip {
    --callout: #16a34a !important;
}

.callout--important {
    --callout: #8b5cf6 !important;
}

.callout--warning {
    --callout: #d97706 !important;
}

.callout--caution {
    --callout: #dc2626 !important;
}

/* Loading and error states for the article */
.doc-prose.ts-markdown-loading {
    font-style: normal;
    opacity: 1;
}

.doc-prose.ts-markdown-loading:empty {
    min-height: 60vh;
    background:
        linear-gradient(var(--site-surface), var(--site-surface)) 0 0 / 55% 40px,
        linear-gradient(var(--site-surface), var(--site-surface)) 0 64px / 85% 18px,
        linear-gradient(var(--site-surface), var(--site-surface)) 0 94px / 70% 18px,
        linear-gradient(var(--site-surface), var(--site-surface)) 0 160px / 35% 28px,
        linear-gradient(var(--site-surface), var(--site-surface)) 0 210px / 100% 160px;
    background-repeat: no-repeat;
    animation: skeleton 1.4s ease-in-out infinite;
}

@keyframes skeleton {
    50% {
        opacity: 0.55;
    }
}

.doc-error {
    padding: 24px;
    background: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius);
}

.doc-error h2 {
    margin: 0 0 8px !important;
    padding: 0 !important;
    border: 0 !important;
    font-size: 1.2rem !important;
}

.doc-error p {
    color: var(--site-muted);
}

/* Prev / next */
.doc-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 780px;
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid var(--site-border);
}

.doc-pager a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
    color: var(--site-fg);
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius);
    text-decoration: none;
}

.doc-pager a:hover {
    border-color: var(--site-border-strong);
    background: var(--site-surface);
}

.doc-pager a[hidden] {
    display: none;
}

.doc-pager__dir {
    font-size: 0.8rem;
    color: var(--site-muted);
}

.doc-pager__title {
    font-weight: 600;
}

.doc-pager__next {
    grid-column: 2;
    text-align: right;
}

/* On this page */
.docs-toc {
    display: none;
}

@media (min-width: 1280px) {
    .docs-toc {
        display: block;
        position: sticky;
        top: var(--site-nav-h);
        max-height: calc(100vh - var(--site-nav-h));
        padding: 28px 0 40px;
        overflow-y: auto;
        scrollbar-width: none;
    }
}

.docs-toc__title {
    margin: 0 0 10px;
    font-family: var(--site-font);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0;
}

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

.docs-toc a {
    display: block;
    margin-left: -1px;
    padding: 4px 0 4px 12px;
    font-size: 0.825rem;
    line-height: 1.4;
    color: var(--site-muted);
    text-decoration: none;
    border-left: 1px solid transparent;
}

.docs-toc a.is-sub {
    padding-left: 24px;
}

.docs-toc a:hover {
    color: var(--site-fg);
}

.docs-toc a.is-active {
    color: var(--site-fg);
    font-weight: 500;
    border-left-color: var(--site-accent);
}

.docs-toc__foot {
    margin-top: 20px;
    padding-top: 16px;
    font-size: 0.8rem;
    border-top: 1px solid var(--site-border);
}

.docs-toc__foot a {
    display: inline-flex;
    gap: 6px;
    color: var(--site-muted);
    text-decoration: none;
}

.docs-toc__foot a:hover {
    color: var(--site-fg);
}

/* PluginDrawer: mobile docs navigation */
.drawer-root {
    --ts-drw-bg: var(--site-raised);
    --ts-drw-side-w: min(320px, 86vw);
    --ts-drw-pad: 0;
}

.drawer-root [data-drawer-panel] {
    display: flex;
    flex-direction: column;
    color: var(--site-fg);
}

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--site-border);
}

.drawer-body {
    flex: 1 1 auto;
    padding: 16px 12px 32px;
    overflow-y: auto;
}

.drawer-body .site-nav__links--stack {
    display: grid;
    gap: 2px;
    margin: 0 0 20px;
    padding: 0 0 16px;
    list-style: none;
    border-bottom: 1px solid var(--site-border);
}

.drawer-body .site-nav__links--stack a {
    display: block;
    padding: 6px 8px;
    color: var(--site-fg);
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--site-radius-sm);
}

.drawer-body .site-nav__links--stack a:hover {
    background: var(--site-surface);
}

/* PluginCommandMenu theme. Its sheet sets tokens on :root and html.dark .command-menu,
   so these selectors carry extra weight on purpose. */
html body .command-menu {
    --command-bg: var(--site-raised);
    --command-fg: var(--site-fg);
    --command-muted: var(--site-muted);
    --command-border: var(--site-border);
    --command-border-strong: var(--site-border-strong);
    --command-hover: var(--site-surface);
    --command-active-bg: var(--site-accent-soft);
    --command-active-fg: var(--site-fg);
    --command-accent: var(--site-accent);
    --command-backdrop: rgba(10, 25, 41, 0.45);
    --command-radius: 12px;
    --command-radius-item: 6px;
    --command-font: var(--site-font);
}

html.dark body .command-menu {
    --command-bg: var(--site-raised);
    --command-fg: var(--site-fg);
    --command-muted: var(--site-muted);
    --command-border: var(--site-border);
    --command-border-strong: var(--site-border-strong);
    --command-hover: rgba(255, 255, 255, 0.04);
    --command-active-bg: var(--site-accent-soft);
    --command-active-fg: #ffffff;
    --command-backdrop: rgba(3, 10, 18, 0.65);
}

.command-menu [data-command-item] [data-command-description] {
    color: var(--site-muted);
}

.command-menu [data-command-footer] kbd {
    margin-inline: 2px;
}

/* Closed state for the menu before the plugin initializes */
[data-plugin-command-menu]:not(.command-menu) {
    display: none;
}

/* Drawer markup must not flash before PluginDrawer hides it */
[data-plugin-drawer]:not(.drawer-root) {
    display: none;
}

/* PluginTooltip */
body .ts-tooltip-el {
    --ts-tt-bg: #0a1929;
    --ts-tt-color: #eef3f8;
    font-family: var(--site-font);
}

html.dark body .ts-tooltip-el {
    --ts-tt-bg: #e6edf5;
    --ts-tt-color: #0a1929;
}

/* PluginSelect */
.lab .ts-select {
    --ts-select-h: 40px;
    --ts-select-trigger-bg: var(--site-raised);
    --ts-select-trigger-border: var(--site-border-strong);
    --ts-select-trigger-color: var(--site-fg);
    --ts-select-trigger-muted: var(--site-muted);
    --ts-select-trigger-radius: var(--site-radius-sm);
    --ts-select-focus-border: var(--site-accent);
    --ts-select-focus-ring: var(--site-ring);
    --ts-select-content-bg: var(--site-raised);
    --ts-select-content-border: var(--site-border);
    --ts-select-content-radius: 8px;
    --ts-select-item-color: var(--site-fg);
    --ts-select-item-hover-bg: var(--site-surface);
    --ts-select-separator-bg: var(--site-border);
}

/* PluginCalendar reads generic tokens; scope them to the lab */
.lab [data-plugin-calendar] {
    --font-ui: var(--site-font);
    --bg-raised: var(--site-raised);
    --bg-hover: var(--site-surface);
    --text-normal: var(--site-fg);
    --text-bright: var(--site-fg);
    --text-muted: var(--site-muted);
    --text-dim: var(--site-faint);
    --border-soft: var(--site-border);
    --border-mid: var(--site-border-strong);
    --border-dim: var(--site-border);
    --accent-cyan: var(--site-accent);
    display: flex;
    justify-content: center;
}

/* PluginOtp */
.lab .ts-otp,
.lab [data-plugin-otp] {
    --ts-otp-bg: var(--site-raised);
    --ts-otp-bg-focus: var(--site-accent-soft);
    --ts-otp-border: var(--site-border-strong);
    --ts-otp-color: var(--site-fg);
    --ts-otp-label-color: var(--site-fg);
    --ts-otp-hint-color: var(--site-muted);
}

/* PluginNumberInput */
.lab {
    --ts-ni-bg: var(--site-raised);
    --ts-ni-border: var(--site-border-strong);
    --ts-ni-border-focus: var(--site-accent);
    --ts-ni-btn-bg: var(--site-surface);
    --ts-ni-btn-hover: var(--site-border);
    --ts-ni-text: var(--site-fg);
    --ts-ni-muted: var(--site-muted);
    --ts-ni-radius: var(--site-radius-sm);
}

/* PluginTagsInput */
.lab {
    --ts-ti-bg: var(--site-raised);
    --ts-ti-border: var(--site-border-strong);
    --ts-ti-border-hover: var(--site-faint);
    --ts-ti-border-focus: var(--site-accent);
    --ts-ti-text: var(--site-fg);
    --ts-ti-placeholder: var(--site-faint);
    --ts-ti-radius: var(--site-radius-sm);
    --ts-ti-tag-bg: var(--site-accent-soft);
    --ts-ti-tag-text: var(--site-accent-strong);
    --ts-ti-tag-border: color-mix(in srgb, var(--site-accent) 30%, transparent);
    --ts-ti-tag-radius: 999px;
}

/* PluginToast, built on Bootstrap's .toast */
.toast-container .toast {
    --bs-toast-bg: var(--site-raised);
    --bs-toast-color: var(--site-fg);
    --bs-toast-header-bg: var(--site-raised);
    --bs-toast-header-color: var(--site-fg);
    --bs-toast-border-color: var(--site-border);
    --bs-toast-header-border-color: var(--site-border);
    font-family: var(--site-font);
    border: 1px solid var(--site-border) !important;
    border-radius: var(--site-radius);
    box-shadow: var(--site-shadow) !important;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* The lab's tab strip has six files; the language label is redundant there */
.lab .ts-code-window__lang {
    display: none;
}

.lab .ts-code-window__chrome .ts-code-window__tabs {
    flex: 1 1 auto;
    min-width: 0;
}

.lab .ts-code-window__tab {
    padding: 0 11px;
}

/* Inline code outside the docs article (Bootstrap colors it pink by default) */
.hero code,
.section code,
.site-footer code {
    padding: 0.1em 0.4em;
    font-size: 0.85em;
    color: var(--site-fg);
    background: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: 4px;
}

.section pre code,
.lab pre code {
    padding: 0;
    background: none;
    border: 0;
}

.section--flush {
    padding-top: 0;
    border-top: 0;
}

/* Step code blocks fill the column so the three line up */
.step > :last-child {
    flex: 1 1 auto;
}

/* Short demos still fill the code window */
.lab__code [data-plugin-code-window],
.lab__code .ts-code-window {
    height: 100%;
}

.lab__code .ts-code-window {
    display: flex;
    flex-direction: column;
}

.lab__code .ts-code-window__body {
    flex: 1 1 auto;
    min-height: 340px;
}

/* Command menu items: label above description */
.command-menu [data-command-item] .cmd-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

html body .command-menu [data-command-item] .cmd-text [data-command-label] + [data-command-description] {
    flex: none;
    width: auto;
    margin: 1px 0 0;
}

html body .command-menu [data-command-group-heading] {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

/* Keep toasts clear of the sticky nav */
.toast-container.top-0 {
    top: var(--site-nav-h) !important;
}

/* Meta links sit inside the article but shouldn't look like prose links */
.doc-prose.ts-markdown .doc-meta a {
    color: var(--site-muted);
    font-weight: 500;
    text-decoration: none;
}

.doc-prose.ts-markdown .doc-meta a:hover {
    color: var(--site-fg);
}
