/*
 * Performance summary table
 *
 * Keep Lumina's own table look (header shading, row hover, borders) instead
 * of porting over the old Furo styling. Lumina renders tables as
 * `display: block; overflow-x: auto` by default, which breaks the rowspan
 * model-name column; force it back to `display: table` and layer on a
 * subtle divider between each model's group of rows (one <tbody> per model)
 * plus centering for the numeric columns.
 */
.lumina-article table.perf-table {
    display: table;
    width: 100%;
}

/* Separate each model's group of rows with a divider, since the single
 * thead/tbody structure otherwise reads as one undifferentiated block. */
.lumina-article table.perf-table tbody {
    border-top: 1px solid var(--lumina-border);
}

.lumina-article table.perf-table thead + tbody {
    border-top: none;
}

/* Emphasize the model name (the rowspan cell at the start of each group)
 * and center it vertically against the full height of its row group. */
.lumina-article table.perf-table tbody tr:first-child td:first-child {
    font-weight: 600;
    vertical-align: middle;
}

/* Center the four numeric columns (PPL, MMLU, Time, CUDA). Use nth-last-child
 * so the rule holds in rowspan rows that omit the leading model-name cell. */
.lumina-article table.perf-table th:nth-last-child(1),
.lumina-article table.perf-table th:nth-last-child(2),
.lumina-article table.perf-table th:nth-last-child(3),
.lumina-article table.perf-table th:nth-last-child(4),
.lumina-article table.perf-table td:nth-last-child(1),
.lumina-article table.perf-table td:nth-last-child(2),
.lumina-article table.perf-table td:nth-last-child(3),
.lumina-article table.perf-table td:nth-last-child(4) {
    text-align: center;
}

/*
 * Tab-set vertical rhythm
 *
 * Lumina zeroes the margin on code blocks inside .sd-tab-content (so the
 * first/last block sits flush with the tab panel edge), but a <p> between
 * two code blocks (e.g. the "Load the model..." / "...requires an unlabeled
 * dataset" captions in adaround.rst's tab-set) only carries margin-bottom,
 * not margin-top. That leaves 0px above the paragraph and the text reads as
 * crammed against the preceding code block.
 */
.sd-tab-content p {
    margin-top: 1.125rem;
}

/* Lumina zeroes the tab panel's own padding (.sd-tab-set > .sd-tab-content
 * { padding: 0 }) because code blocks and images carry their own inset.
 * Plain text content -- a caption paragraph, a bullet list -- has no such
 * inset of its own and ends up flush against the panel's edges. Give it the
 * same horizontal gutter code blocks use (1.25rem). Admonitions (.. note::)
 * are exempt: they already carry their own margin/padding as self-contained
 * boxes, so this would just double their inset. */
.sd-tab-content > p,
.sd-tab-content > ul,
.sd-tab-content > ol {
    margin-inline: 1.25rem;
}

/* When two code blocks are adjacent with no caption between them (e.g.
 * adaround.rst's model-setup and dataloader-setup snippets), the zeroed
 * margin leaves them visually fused into one block. Restore a gap.
 * `literalinclude`/`code-block` render as <div class="highlight-LANG"> or
 * <div class="literal-block-wrapper"> wrapping the Lumina-styled
 * div.highlight -- the adjacency rule has to key off those outer wrappers. */
.sd-tab-content > [class*="highlight-"] + [class*="highlight-"],
.sd-tab-content > .literal-block-wrapper + .literal-block-wrapper,
.sd-tab-content > [class*="highlight-"] + .literal-block-wrapper,
.sd-tab-content > .literal-block-wrapper + [class*="highlight-"] {
    margin-top: 1.25rem;
}

/* Hide the "Expand all / Collapse all" text toolbar Lumina inserts above
 * API signature lists -- it's redundant with the per-signature chevron
 * (dt.sig > .lumina-api-toggle), which stays as the discoverability cue
 * that a signature is clickable to reveal its docstring. */
.lumina-api-toolbar {
    display: none !important;
}

/* A class/function with no docstring (e.g. a dataclass whose only "doc" is
 * its auto-generated __init__ signature) renders an empty <dd>. Lumina
 * strips the dt.sig left/right padding and indent for this case (see
 * dl:has(> dt.sig) > dt.sig:has(+ dd:empty) in api.css), leaving the
 * signature flush left and misaligned with its chevroned/indented
 * siblings. Restore just the padding/indent -- NOT a bottom border, which
 * would frame the empty <dd> below it plus the dl's normal margin as a
 * visible blank box. */
.lumina-article dl:has(> dt.sig) > dt.sig:has(+ dd:empty) {
    padding-inline-start: 2.75rem;
    padding-inline-end: 1.5rem;
    min-height: 3.5rem;
}

/*
 * Font stack
 *
 * Lumina bundles its own webfonts (Source Sans 3 / JetBrains Mono) by
 * default. Revert to the native OS font stack the old Furo-based docs used,
 * so the site matches https://qualcomm.github.io/aimet-pages look-and-feel
 * instead of introducing a new branded typeface.
 */
:root {
    --lumina-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    --lumina-font-mono: "SFMono-Regular", Menlo, Consolas, Monaco, "Liberation Mono", "Lucida Console", monospace;
}

/*
 * Landing page (index.rst, `:template: landing.html`)
 *
 * Layout: a two-column hero (headline, lead, CTAs on the left; an animated
 * int4 quantization grid built from real MobileNetV2 weights on the right,
 * driven by _static/aimet-landing.js) above a seamless 3x3 grid of
 * sphinx-design cards. Everything is scoped under .lumina-landing-content,
 * which only the landing template emits, and colors come from Lumina's theme
 * tokens so the theme toggle drives light/dark.
 *
 * The section is a two-column CSS grid. The hero containers are
 * `display: contents`, so the eyebrow, page title (which RST can't nest
 * inside a container), lead, CTAs and framework line each take one row of
 * the left column while the figure spans those rows on the right.
 */
#lumina-content.lumina-landing-content {
    max-width: 76rem;
    padding-top: 0;
}

.lumina-landing-content {
    --aimet-viz-accent: var(--lumina-link);
}

.lumina-landing-content .body > section {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    column-gap: 3.5rem;
}

.lumina-landing-content .body > section > * {
    grid-column: 1 / -1;
}

.lumina-landing-content .body > section > span:first-child,
.lumina-landing-content .toctree-wrapper {
    display: none; /* the `top-index` anchor and the hidden toctree */
}

/* -- Hero -- */

.lumina-landing-content .aimet-hero,
.lumina-landing-content .aimet-hero-text {
    display: contents;
}

.lumina-landing-content .aimet-eyebrow { grid-row: 1; }
.lumina-landing-content .aimet-lead { grid-row: 3; }
.lumina-landing-content .aimet-ctas { grid-row: 4; }
.lumina-landing-content .aimet-frameworks { grid-row: 5; }

.lumina-landing-content .body > section > h1 {
    grid-row: 2;
    margin: 1.375rem 0 0;
    font-size: clamp(2.5rem, 1.4rem + 3.6vw, 4.125rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.02;
}

.lumina-landing-content .body > section > h1 .aimet-accent {
    color: var(--lumina-link);
}

.lumina-landing-content .body > section > h1 > a.headerlink {
    display: none;
}

.lumina-landing-content .aimet-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: max-content;
    max-width: 100%;
    margin: 0;
    padding: 0.3125rem 0.75rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--lumina-accent) 9%, transparent);
    color: var(--lumina-link);
    font-family: var(--lumina-font-mono);
    font-size: 0.8125rem;
}

.lumina-landing-content .aimet-eyebrow::before {
    content: "";
    flex: none;
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background: var(--lumina-accent);
}

.lumina-landing-content .aimet-lead {
    margin: 1.5rem 0 0;
    max-width: 54ch;
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--lumina-text-muted);
}

.lumina-landing-content .aimet-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.lumina-landing-content .aimet-ctas p {
    display: contents;
}

.lumina-landing-content .aimet-ctas a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 2.75rem;
    padding-inline: 1.125rem;
    border: 1px solid var(--lumina-border);
    border-radius: 0.5rem;
    background: var(--lumina-bg);
    color: var(--lumina-text);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s;
}

.lumina-landing-content .aimet-ctas a:hover {
    border-color: var(--lumina-accent);
}

.lumina-landing-content .aimet-ctas a:first-child {
    border-color: transparent;
    background: var(--sd-color-primary);
    color: var(--sd-color-primary-text);
}

.lumina-landing-content .aimet-ctas a:first-child:hover {
    background: var(--sd-color-primary-highlight);
}

.lumina-landing-content .aimet-ctas a:first-child::after {
    content: "\2192";
    transition: transform 0.15s;
}

.lumina-landing-content .aimet-ctas a:first-child:hover::after {
    transform: translateX(3px);
}

.lumina-landing-content .aimet-frameworks {
    margin-top: 2.25rem;
}

.lumina-landing-content .aimet-frameworks p {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem 1rem;
    margin: 0;
    font-size: 0.875rem;
    color: var(--lumina-text-muted);
}

.lumina-article .aimet-frameworks code:not(pre code) {
    padding: 0.25rem 0.625rem;
    border: 1px solid var(--lumina-border);
    border-radius: 0.375rem;
    background: transparent;
    color: var(--lumina-text);
    font-size: 0.8125rem;
}

/* The animated quantization grid */
.lumina-landing-content .aimet-quant-viz {
    margin: 0;
    padding: 1.125rem 1.125rem 0.875rem;
    min-width: 0;
    border: 1px solid var(--lumina-border);
    border-radius: 1rem;
    background: var(--lumina-bg);
    box-shadow: 0 30px 60px -40px color-mix(in srgb, var(--lumina-accent) 45%, transparent);
    font-family: var(--lumina-font-mono);
    font-size: 0.75rem;
    color: var(--lumina-text-muted);
    font-variant-numeric: tabular-nums;
}

.lumina-landing-content .aimet-quant-viz b {
    font-weight: 500;
    color: var(--lumina-text);
}

.lumina-landing-content .aimet-viz-top,
.lumina-landing-content .aimet-viz-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.375rem 1rem;
}

.lumina-landing-content .aimet-viz-state {
    color: var(--lumina-link);
}

.lumina-landing-content .aimet-quant-viz canvas {
    display: block;
    width: 100%;
    height: 17.5rem;
    margin-top: 0.5rem;
}

.lumina-landing-content .aimet-viz-bottom {
    padding-top: 0.625rem;
    border-top: 1px dashed var(--lumina-border);
}

/* -- Documentation grid -- */

.lumina-landing-content .aimet-docs-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    margin-top: 5rem;
    margin-bottom: 1.5rem;
}

.lumina-landing-content .aimet-docs-head p {
    margin: 0;
    color: var(--lumina-text-muted);
    font-size: 0.9375rem;
}

.lumina-landing-content .aimet-docs-head p.rubric {
    color: var(--lumina-text);
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    text-transform: none;
}

/* One bordered block with hairline dividers, rather than nine floating
 * cards: the row's background shows through 1px gaps between cells. */
.lumina-landing-content .aimet-cards {
    margin-bottom: 0 !important;
}

.lumina-landing-content .aimet-cards > .sd-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--lumina-border);
    border-radius: 0.875rem;
    background: var(--lumina-border);
}

@media (min-width: 576px) {
    .lumina-landing-content .aimet-cards > .sd-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .lumina-landing-content .aimet-cards > .sd-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.lumina-landing-content .aimet-cards > .sd-row > .sd-col {
    width: auto;
    max-width: none;
    padding: 0 !important;
}

.lumina-landing-content .aimet-cards .sd-card {
    border: 0 !important;
    border-radius: 0 !important;
}

.lumina-landing-content .aimet-cards .sd-card-hover:is(:hover, :focus-within) {
    background: var(--lumina-bg-secondary) !important;
}

.lumina-landing-content .aimet-cards .sd-card:has(a:focus-visible) {
    outline-offset: -2px;
}

.lumina-landing-content .aimet-cards .sd-card-body {
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.5rem 1.625rem;
}

.lumina-landing-content .aimet-cards .sd-card-title {
    order: 2;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem !important;
    font-size: 1.1875rem;
    font-weight: 600 !important;
    letter-spacing: -0.02em;
}

.lumina-landing-content .aimet-cards .sd-card-title::after {
    content: "\2192";
    color: var(--lumina-link);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.15s, transform 0.15s;
}

.lumina-landing-content .aimet-cards .sd-card:hover .sd-card-title::after {
    opacity: 1;
    transform: none;
}

.lumina-landing-content .aimet-cards .sd-card-text {
    order: 3;
    margin: 0;
    font-size: 0.9375rem;
}

.lumina-landing-content .aimet-cards .sd-card-text.aimet-tag {
    order: 1;
    margin-bottom: 0.5rem;
    font-family: var(--lumina-font-mono);
    font-size: 0.71875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* -- Two-column hero on wide screens -- */

@media (min-width: 992px) {
    .lumina-landing-content .body > section {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
        padding-top: 4.5rem;
    }
    .lumina-landing-content .body > section > h1,
    .lumina-landing-content .aimet-hero-text > * {
        grid-column: 1;
    }
    .lumina-landing-content .aimet-quant-viz {
        grid-column: 2;
        grid-row: 1 / 6;
        align-self: center;
    }
}

@media (max-width: 991.98px) {
    .lumina-landing-content .body > section {
        padding-top: 3rem;
    }
    .lumina-landing-content .aimet-quant-viz {
        grid-row: 6;
        margin-top: 2.5rem;
    }
}

@media (max-width: 575.98px) {
    .lumina-landing-content .aimet-quant-viz canvas {
        height: 13.75rem;
    }
    .lumina-landing-content .aimet-docs-head {
        margin-top: 3.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lumina-landing-content .aimet-cards .sd-card-title::after,
    .lumina-landing-content .aimet-ctas a:first-child::after {
        transition: none;
    }
}

/* ==========================================================================
 * Color system
 *
 * 1. Neutrals retinted from Lumina's green-gray (built for its emerald
 *    accent) to a cool slate that sits with the #2A2AEA brand blue.
 * 2. A small categorical palette (teal, violet, amber) used only to encode
 *    meaning: doc section, landing-card tag, framework tab. Blue stays the
 *    only interactive color (links, buttons, focus).
 * 3. A thin brand-gradient strip on the header -- the one decorative use.
 * 4. Diagram tokens (--aimet-dia-*) so inline SVGs share one palette.
 *
 * Every text/background pairing clears WCAG AA (4.5:1) in both themes.
 * Lumina injects the accent/link overrides in an inline <style> after this
 * file, so those are left alone; everything else is overridden here with
 * higher-specificity selectors (html:root, html[data-theme=...]).
 * ========================================================================== */

html:root,
html[data-theme="light"] {
    --lumina-bg: #fcfcfd;
    --lumina-bg-secondary: #f3f4f8;
    --lumina-text: #1e2230;
    --lumina-text-muted: #586075;
    --lumina-border: #dde1ea;
    --lumina-code-bg: #f5f6fa;
    --lumina-navigation-bg: #f8f9fc;
    --lumina-floating-bg: #fcfcfd;

    --aimet-blue: #2a2aea;
    --aimet-blue-text: #2323c4;
    --aimet-teal: #0f766e;
    --aimet-violet: #6d28d9;
    --aimet-amber: #a1460a;
    --aimet-onnx: var(--aimet-blue-text);
    --aimet-torch: #c2410c;  /* PyTorch's orange family, darkened to clear AA */

    --aimet-tint: 9%;        /* category-tinted surfaces */
    --aimet-strip: linear-gradient(90deg, #2a2aea 0%, #7c3aed 50%, #0d9488 100%);
}

html[data-theme="dark"] {
    --lumina-bg: #12141c;
    --lumina-bg-secondary: #1b1e29;
    --lumina-text: #e4e7ef;
    --lumina-text-muted: #a3a9bb;
    --lumina-border: #2b3040;
    --lumina-code-bg: #181b25;
    --lumina-navigation-bg: #141720;
    --lumina-floating-bg: #1e2230;

    --aimet-blue: #6b6bff;
    --aimet-blue-text: #a5b4fc;
    --aimet-teal: #2dd4bf;
    --aimet-violet: #a78bfa;
    --aimet-amber: #fbbf24;
    --aimet-onnx: var(--aimet-blue-text);
    --aimet-torch: #fb8a64;

    --aimet-tint: 14%;
    --aimet-strip: linear-gradient(90deg, #4f4fff 0%, #8b5cf6 50%, #14b8a6 100%);
}

/* -- Header brand strip -- */

#lumina-header header::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--aimet-strip);
    pointer-events: none;
}

/* -- Section colors --
 * body[data-aimet-section] is set per page in conf.py (_add_section_context).
 * The section color tints the page title rule, the eyebrow label above it,
 * and the matching sidebar icon. */

body { --aimet-section: var(--aimet-blue); --aimet-section-text: var(--aimet-blue-text); }
body[data-aimet-section="tutorials"] { --aimet-section: var(--aimet-teal); --aimet-section-text: var(--aimet-teal); }
body[data-aimet-section="techniques"] { --aimet-section: var(--aimet-violet); --aimet-section-text: var(--aimet-violet); }
body[data-aimet-section="ptq"] { --aimet-section: var(--aimet-amber); --aimet-section-text: var(--aimet-amber); }
body[data-aimet-section="api"] { --aimet-section: var(--aimet-blue); --aimet-section-text: var(--aimet-blue-text); }

body[data-aimet-section] .lumina-article .body > section:first-of-type > h1:first-of-type::before {
    display: block;
    margin-bottom: 0.625rem;
    color: var(--aimet-section-text);
    font-family: var(--lumina-font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
body[data-aimet-section="overview"] .lumina-article .body > section:first-of-type > h1:first-of-type::before { content: "Overview"; }
body[data-aimet-section="tutorials"] .lumina-article .body > section:first-of-type > h1:first-of-type::before { content: "Tutorials"; }
body[data-aimet-section="techniques"] .lumina-article .body > section:first-of-type > h1:first-of-type::before { content: "Techniques"; }
body[data-aimet-section="ptq"] .lumina-article .body > section:first-of-type > h1:first-of-type::before { content: "PTQ Techniques"; }
body[data-aimet-section="api"] .lumina-article .body > section:first-of-type > h1:first-of-type::before { content: "API Reference"; }

/* Title rule: a short bar in the section color under every page title
 * (not the landing page, whose hero headline has its own treatment). */
#lumina-content:not(.lumina-landing-content) .lumina-article .body > section:first-of-type > h1:first-of-type::after {
    content: "";
    display: block;
    width: 3rem;
    height: 3px;
    margin-top: 0.875rem;
    border-radius: 3px;
    background: var(--aimet-section);
}

/* Section headings: a small accent tick before each h2. */
.lumina-article h2 {
    position: relative;
}

.lumina-article h2::before {
    content: "";
    position: absolute;
    inset-inline-start: -0.875rem;
    top: 0.3em;
    bottom: 0.3em;
    width: 3px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--aimet-section) 70%, transparent);
}

/* Sidebar: each top-level section's icon wears its color. */
.lumina-sidebar-nav > ul > li > a[href$="tutorials/index.html"] .lumina-sidebar-icon { color: var(--aimet-teal); }
.lumina-sidebar-nav > ul > li > a[href$="techniques/index.html"]:not([href$="ptq_techniques/index.html"]) .lumina-sidebar-icon { color: var(--aimet-violet); }
.lumina-sidebar-nav > ul > li > a[href$="ptq_techniques/index.html"] .lumina-sidebar-icon { color: var(--aimet-amber); }
.lumina-sidebar-nav > ul > li > a[href$="apiref/index.html"] .lumina-sidebar-icon { color: var(--aimet-blue-text); }
.lumina-sidebar-nav > ul > li > a[href$="overview/index.html"] .lumina-sidebar-icon { color: var(--aimet-blue-text); }

/* -- Framework tabs: ONNX blue, PyTorch orange -- */

.sd-tab-set.sd-tab-set > input:checked + label[data-sync-id="onnx"] {
    color: var(--aimet-onnx);
    border-bottom-color: var(--aimet-onnx);
}

.sd-tab-set.sd-tab-set > input:checked + label[data-sync-id="torch"] {
    color: var(--aimet-torch);
    border-bottom-color: var(--aimet-torch);
}

.sd-tab-set.sd-tab-set > label[data-sync-id="onnx"]::before,
.sd-tab-set.sd-tab-set > label[data-sync-id="torch"]::before {
    content: "";
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    margin-inline-end: 0.4375rem;
    border-radius: 50%;
    vertical-align: 0.0625rem;
    background: currentColor;
    opacity: 0.35;
}

.sd-tab-set.sd-tab-set > label[data-sync-id="onnx"]::before { background: var(--aimet-onnx); }
.sd-tab-set.sd-tab-set > label[data-sync-id="torch"]::before { background: var(--aimet-torch); }
.sd-tab-set.sd-tab-set > input:checked + label[data-sync-id]::before { opacity: 1; }

/* -- Admonitions: stronger tint plus a solid leading edge -- */

.lumina-article .admonition {
    border-inline-start-width: 4px;
}

.lumina-article .admonition.note {
    border-inline-start-color: var(--lumina-adm-note);
    background: color-mix(in srgb, var(--lumina-adm-note) 7%, var(--lumina-bg));
}

.lumina-article .admonition:is(.tip, .hint) {
    border-inline-start-color: var(--lumina-adm-tip);
    background: color-mix(in srgb, var(--lumina-adm-tip) 7%, var(--lumina-bg));
}

.lumina-article .admonition:is(.warning, .caution, .attention) {
    border-inline-start-color: var(--lumina-adm-warning);
    background: color-mix(in srgb, var(--lumina-adm-warning) 9%, var(--lumina-bg));
}

.lumina-article .admonition:is(.danger, .error) {
    border-inline-start-color: var(--lumina-adm-danger);
    background: color-mix(in srgb, var(--lumina-adm-danger) 7%, var(--lumina-bg));
}

.lumina-article .admonition.important {
    border-inline-start-color: var(--lumina-adm-important);
    background: color-mix(in srgb, var(--lumina-adm-important) 7%, var(--lumina-bg));
}

.lumina-article .admonition.seealso {
    border-inline-start-color: var(--lumina-adm-seealso);
    background: color-mix(in srgb, var(--lumina-adm-seealso) 7%, var(--lumina-bg));
}

/* Tip/hint: Lumina's emerald clashes with the blue palette; use teal. */
html:root,
html[data-theme="light"] { --lumina-adm-tip: #0f766e; }
html[data-theme="dark"] { --lumina-adm-tip: #2dd4bf; }

/* -- Tables: brand-tinted header, faint zebra rows -- */

.lumina-article th {
    background: color-mix(in srgb, var(--lumina-accent) 9%, var(--lumina-bg));
}

.lumina-article tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--lumina-accent) 2.5%, transparent);
}

.lumina-article tbody tr:hover {
    background: color-mix(in srgb, var(--lumina-accent) 6%, transparent);
}

/* -- Landing page: one color per card tag -- */

.lumina-landing-content .aimet-cards .sd-card-text.aimet-tag {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 0.4375rem;
    color: var(--aimet-tag, var(--lumina-text-muted)) !important;  /* Lumina sets .sd-card-text !important */
}

.lumina-landing-content .aimet-cards .sd-card-text.aimet-tag::before {
    content: "";
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 2px;
    background: currentColor;
}

/* Each card's tag takes the color of the doc section it links to, matching the
 * section colors above (body[data-aimet-section]). Keyed off the card's link target,
 * so card order in index.rst doesn't matter. Cards outside a colored section
 * (Release Notes, Glossary) keep the neutral tag. */
.lumina-landing-content .aimet-cards .sd-col:has(a.sd-stretched-link[href^="overview/"]) { --aimet-tag: var(--aimet-blue-text); }
.lumina-landing-content .aimet-cards .sd-col:has(a.sd-stretched-link[href^="tutorials/"]) { --aimet-tag: var(--aimet-teal); }
.lumina-landing-content .aimet-cards .sd-col:has(a.sd-stretched-link[href^="techniques/"]) { --aimet-tag: var(--aimet-violet); }
.lumina-landing-content .aimet-cards .sd-col:has(a.sd-stretched-link[href^="ptq_techniques/"]) { --aimet-tag: var(--aimet-amber); }
.lumina-landing-content .aimet-cards .sd-col:has(a.sd-stretched-link[href^="apiref/"]) { --aimet-tag: var(--aimet-blue-text); }


/* -- Diagram tokens (inline SVGs such as images/aimet_how_it_works.svg) -- */

html:root,
html[data-theme="light"],
html[data-theme="dark"] {
    --aimet-dia-panel: color-mix(in srgb, var(--aimet-blue) var(--aimet-tint), var(--lumina-bg));
    --aimet-dia-panel-edge: color-mix(in srgb, var(--aimet-blue) 40%, transparent);
    --aimet-dia-card: var(--lumina-bg);
    --aimet-dia-io: var(--lumina-bg-secondary);
    --aimet-dia-edge: var(--lumina-border);
    --aimet-dia-ink: var(--lumina-text);
    --aimet-dia-ink-muted: var(--lumina-text-muted);
    --aimet-dia-1: var(--aimet-blue-text);   /* primary step */
    --aimet-dia-2: var(--aimet-teal);        /* improve / iterate */
    --aimet-dia-3: var(--aimet-violet);      /* output / export */
}

/* "How AIMET works" diagram (images/aimet_how_it_works.svg). Light keeps the original artwork colors. */
html:root,
html[data-theme="light"] {
    --aimet-hw-blue: #3555df;
    --aimet-hw-teal: #4ca3b6;
    --aimet-hw-slate: #4c5a76;
    --aimet-hw-gray: #aebad0;
    --aimet-hw-edge: #c3cbda;
    --aimet-hw-box: #3555df;
    --aimet-hw-text: var(--lumina-text);
    --aimet-hw-screen: #7b95f0;
    --aimet-hw-ring: #c9d3f6;
}

html[data-theme="dark"] {
    --aimet-hw-blue: #7089ff;
    --aimet-hw-teal: #5cc0d3;
    --aimet-hw-slate: #a3b0cc;
    --aimet-hw-gray: #5b6884;
    --aimet-hw-edge: #3a4256;
    --aimet-hw-box: #4a66ec;
    --aimet-hw-text: var(--lumina-text-muted);
    --aimet-hw-screen: #3555df;
    --aimet-hw-ring: #55639a;
}
