/* =====================================================================================================
   Vroom Performance Technologies - design system
   Bootstrap 5.3 provides the components; this file provides the look, in a light and a dark theme.
   The brand blue is the blue of the Vroom logo; orange is the accent for calls to action.
   ===================================================================================================== */

:root,
[data-bs-theme=light] {
    --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Barlow Semi Condensed", "Segoe UI", system-ui, sans-serif;
    --font-mono: "Cascadia Code", "JetBrains Mono", Consolas, "SFMono-Regular", Menlo, monospace;
    --brand: #2a328e;
    --brand-strong: #1d2370;
    --brand-bright: #3b48c8;
    --brand-soft: rgba(42, 50, 142, .08);
    --brand-rgb: 42, 50, 142;
    --accent: #f26b00;
    --accent-strong: #d45d00;
    --accent-text: #ffffff;
    --surface: #ffffff;
    --surface-2: #f4f5fa;
    --surface-3: #e9ebf4;
    --text: #161a33;
    --text-muted: #5b6078;
    --border: #e0e3ee;
    --shadow-sm: 0 1px 2px rgba(22, 26, 51, .06), 0 1px 3px rgba(22, 26, 51, .04);
    --shadow: 0 16px 40px -18px rgba(22, 26, 51, .28), 0 2px 6px rgba(22, 26, 51, .05);
    --radius: 14px;
    --radius-sm: 9px;
    --hero-1: #151a5c;
    --hero-2: #2a328e;
    --hero-3: #3b48c8;
    --code-bg: #f1f2f8;
    --logo-filter: none;
    --bs-body-bg: var(--surface);
    --bs-body-color: var(--text);
    --bs-body-font-family: var(--font-sans);
    --bs-border-color: var(--border);
    --bs-secondary-color: var(--text-muted);
    --bs-link-color: var(--brand-bright);
    --bs-link-color-rgb: 59, 72, 200;
    --bs-link-hover-color: var(--brand);
    --bs-link-hover-color-rgb: 42, 50, 142;
    --bs-emphasis-color: var(--text);
    --bs-primary: var(--brand);
    --bs-primary-rgb: 42, 50, 142;
}

[data-bs-theme=dark] {
    --brand: #8f9bff;
    --brand-strong: #b3bbff;
    --brand-bright: #9ea9ff;
    --brand-soft: rgba(143, 155, 255, .12);
    --brand-rgb: 143, 155, 255;
    --accent: #ff8a2b;
    --accent-strong: #ff9d4d;
    --accent-text: #1a1206;
    --surface: #10131f;
    --surface-2: #161a29;
    --surface-3: #1f2436;
    --text: #e6e8f2;
    --text-muted: #9aa0b8;
    --border: #272c40;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 16px 40px -18px rgba(0, 0, 0, .8), 0 2px 6px rgba(0, 0, 0, .3);
    --hero-1: #0b0e2b;
    --hero-2: #1a2066;
    --hero-3: #2a328e;
    --code-bg: #0b0e18;
    --logo-filter: brightness(0) invert(1);
    --bs-body-bg: var(--surface);
    --bs-body-color: var(--text);
    --bs-border-color: var(--border);
    --bs-secondary-color: var(--text-muted);
    --bs-link-color: var(--brand-bright);
    --bs-link-color-rgb: 158, 169, 255;
    --bs-link-hover-color: var(--brand-strong);
    --bs-link-hover-color-rgb: 179, 187, 255;
    --bs-emphasis-color: var(--text);
    --bs-tertiary-bg: var(--surface-3);
    --bs-secondary-bg: var(--surface-3);
    --bs-card-bg: var(--surface-2);
}

html { scroll-padding-top: 5rem; }

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    font-size: 1.0125rem;
}

h1, h2, h3, h4, .display-font {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -.005em;
    line-height: 1.1;
}

a { text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, pre, kbd { font-family: var(--font-mono); }
::selection { background: rgba(var(--brand-rgb), .2); }
.site-main { flex: 1 0 auto; }
.text-muted { color: var(--text-muted) !important; }
.min-w-0 { min-width: 0; }
.brand-text { color: var(--brand); }
.card { --bs-card-bg: var(--surface); border-color: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
[data-bs-theme=dark] .card { --bs-card-bg: var(--surface-2); }
.card-header { background: transparent; }

/* ----- Buttons --------------------------------------------------------------------------------------- */

.btn { --bs-btn-border-radius: 10px; --bs-btn-font-weight: 600; }
.btn-lg { --bs-btn-padding-y: .7rem; --bs-btn-padding-x: 1.4rem; --bs-btn-font-size: 1.05rem; }

.btn-primary {
    --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-strong); --bs-btn-hover-border-color: var(--brand-strong);
    --bs-btn-active-bg: var(--brand-strong); --bs-btn-active-border-color: var(--brand-strong);
    --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
}
[data-bs-theme=dark] .btn-primary {
    --bs-btn-color: #0d1030; --bs-btn-hover-color: #0d1030; --bs-btn-active-color: #0d1030; --bs-btn-disabled-color: #0d1030;
}

.btn-outline-primary {
    --bs-btn-color: var(--brand); --bs-btn-border-color: rgba(var(--brand-rgb), .45);
    --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand);
}
[data-bs-theme=dark] .btn-outline-primary { --bs-btn-hover-color: #0d1030; --bs-btn-active-color: #0d1030; }

.btn-accent {
    --bs-btn-color: var(--accent-text); --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
    --bs-btn-hover-color: var(--accent-text); --bs-btn-hover-bg: var(--accent-strong); --bs-btn-hover-border-color: var(--accent-strong);
    --bs-btn-active-color: var(--accent-text); --bs-btn-active-bg: var(--accent-strong); --bs-btn-active-border-color: var(--accent-strong);
    --bs-btn-disabled-color: var(--accent-text); --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent);
    box-shadow: 0 8px 20px -10px rgba(242, 107, 0, .7);
}
.btn-secondary-brand {
    --bs-btn-color: var(--brand); --bs-btn-bg: var(--brand-soft); --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--brand); --bs-btn-hover-bg: rgba(var(--brand-rgb), .16); --bs-btn-hover-border-color: transparent;
}
.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .25);
    border-color: var(--brand);
}
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--border); }
.btn-icon {
    --bs-btn-padding-x: .35rem; --bs-btn-padding-y: .25rem;
    color: var(--text-muted); border: 0; line-height: 1;
}
.btn-icon:hover { color: var(--text); background: var(--surface-3); }
.link-button { border: 0; background: none; padding: 0; color: var(--bs-link-color); }
.link-button:hover { text-decoration: underline; }

.icon-button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
}
.icon-button:hover { color: var(--brand); border-color: rgba(var(--brand-rgb), .4); text-decoration: none; }
.theme-icon-dark { display: none; }
[data-bs-theme=dark] .theme-icon-dark { display: inline; }
[data-bs-theme=dark] .theme-icon-light { display: none; }

/* ----- Header and footer --------------------------------------------------------------------------- */

.admin-strip {
    background: #0e1135; color: #fff; font-size: .85rem; padding: .35rem 0;
}
.admin-strip a { color: #c9cdff; }
.admin-strip .container { flex-wrap: wrap; }

.site-header {
    position: sticky; top: 0; z-index: 1030;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.site-header .navbar { padding: .6rem 0; }
.brand-logo { height: 42px; width: auto; filter: var(--logo-filter); }
.site-header .nav-link {
    font-weight: 600; color: var(--text); border-radius: 8px; padding: .5rem .8rem !important;
}
.site-header .nav-link:hover, .site-header .nav-link.active { color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.dropdown-menu { border-color: var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: .4rem; }
.dropdown-item { border-radius: 6px; }
.dropdown-item:active { background: var(--brand); }
[data-bs-theme=dark] .navbar-toggler-icon { filter: invert(1); }

.site-footer {
    background: var(--surface-2); border-top: 1px solid var(--border);
    padding: 3.5rem 0 1.5rem; margin-top: 0; font-size: .95rem;
}
.site-footer h2 { font-family: var(--font-sans); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: .9rem; }
.site-footer ul:not(.footer-contact) { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin-bottom: .45rem; }
.site-footer a { color: var(--text); }
.site-footer a:hover { color: var(--brand); }
.footer-text { color: var(--text-muted); max-width: 24rem; }
.footer-contact li { display: flex; align-items: center; gap: .5rem; color: var(--text-muted); }
.site-footer .fine { border-top: 1px solid var(--border); margin-top: 2.5rem; padding-top: 1.25rem; color: var(--text-muted); font-size: .85rem; }
.site-version { margin-left: .5rem; padding-left: .6rem; border-left: 1px solid var(--border); font-family: var(--font-mono); font-size: .78rem; opacity: .8; }

/* ----- Page heads ------------------------------------------------------------------------------------ */

.page-head {
    background:
        radial-gradient(1000px 300px at 85% -40%, rgba(var(--brand-rgb), .12), transparent),
        var(--surface-2);
    border-bottom: 1px solid var(--border);
    padding: 3rem 0 2.5rem;
}
.page-head h1 { font-size: clamp(2.1rem, 4vw, 3rem); font-weight: 800; margin-bottom: .4rem; }
.page-head .lead { color: var(--text-muted); max-width: 46rem; margin-bottom: 0; }
.page-head-article h1 { max-width: 52rem; }
.crumbs { font-size: .88rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: .4rem; }
.crumbs span { color: var(--text-muted); }
.product-bar { border-bottom: 1px solid var(--border); background: var(--surface); padding: .55rem 0; font-size: .9rem; }

/* ----- Sections (blocks) -------------------------------------------------------------------------- */

.block { padding: 4.5rem 0; position: relative; }
.block + .block.tone-default:not(.block-hero) { padding-top: 1rem; }
.block-hero { padding: 0; }
.tone-muted { background: var(--surface-2); }
.tone-muted + .tone-muted { padding-top: 0; }
.tone-brand { background: linear-gradient(135deg, var(--hero-1), var(--hero-2) 55%, var(--hero-3)); color: #fff; }
.tone-dark { background: #0b0d22; color: #fff; }
.tone-brand, .tone-dark { --text-muted: rgba(255, 255, 255, .78); --bs-link-color: #fff; --bs-link-color-rgb: 255, 255, 255; --bs-link-hover-color: #fff; }
.tone-brand .prose a, .tone-dark .prose a { color: #fff; text-decoration: underline; }
.tone-brand .feature-card, .tone-dark .feature-card,
.tone-brand .quote-card, .tone-dark .quote-card,
.tone-brand .software-card, .tone-dark .software-card,
.tone-brand .article-card, .tone-dark .article-card { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); color: #fff; }
.tone-brand .feature-icon, .tone-dark .feature-icon { background: rgba(255, 255, 255, .12); color: #fff; }
.tone-brand .eyebrow, .tone-dark .eyebrow { color: #ffb072; }

.section-head { max-width: 46rem; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 800; margin-bottom: .6rem; }
.section-head .lead { color: var(--text-muted); font-size: 1.12rem; }
.eyebrow {
    font-family: var(--font-sans); font-size: .78rem; font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; color: var(--accent); margin-bottom: .6rem;
}

/* Long text. */
.prose { line-height: 1.7; }
.prose-narrow { max-width: 42rem; }
.prose-normal { max-width: 52rem; }
.prose-wide { max-width: 72rem; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin: 2rem 0 .8rem; font-weight: 700; }
.prose h2 { font-size: 1.85rem; }
.prose h3 { font-size: 1.4rem; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.prose blockquote { border-left: 4px solid var(--brand); padding: .3rem 0 .3rem 1rem; color: var(--text-muted); }
.prose table { width: auto; }
.prose :not(pre) > code { background: var(--code-bg); padding: .1em .35em; border-radius: 5px; font-size: .88em; }
.prose pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; font-size: .88rem; }
.prose pre code { background: none; padding: 0; }
.prose hr { margin: 2rem 0; opacity: .15; }
.markdown-alert { border-left: 4px solid var(--brand); background: var(--brand-soft); padding: .8rem 1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1rem 0; }
.markdown-alert-title { font-weight: 700; display: flex; align-items: center; gap: .4rem; margin-bottom: .2rem; }
.markdown-alert-title svg { fill: currentColor; }
.markdown-alert-tip { border-color: #12a150; background: rgba(18, 161, 80, .08); }
.markdown-alert-important { border-color: #8250df; background: rgba(130, 80, 223, .08); }
.markdown-alert-warning { border-color: #d4a017; background: rgba(212, 160, 23, .1); }
.markdown-alert-caution { border-color: #d1242f; background: rgba(209, 36, 47, .08); }
.hljs { background: transparent !important; }
[data-bs-theme=light] .hljs-keyword, [data-bs-theme=light] .hljs-built_in { color: #3b48c8; }
[data-bs-theme=light] .hljs-string { color: #a14a00; }
[data-bs-theme=light] .hljs-comment { color: #6b7280; font-style: italic; }
[data-bs-theme=dark] .hljs-keyword, [data-bs-theme=dark] .hljs-built_in { color: #9ea9ff; }
[data-bs-theme=dark] .hljs-string { color: #ffb072; }
[data-bs-theme=dark] .hljs-comment { color: #7d8399; font-style: italic; }

/* Hero: the brand gradient with the speed lines of the logo. */
.hero {
    position: relative; overflow: hidden; color: #fff;
    padding: 5.5rem 0 5rem;
}
.tone-default .hero, .tone-muted .hero { color: var(--text); }
.hero-lines {
    position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background:
        repeating-linear-gradient(180deg, transparent 0 14px, rgba(255, 255, 255, .07) 14px 16px);
    mask-image: linear-gradient(100deg, transparent 15%, #000 55%, transparent 95%);
    -webkit-mask-image: linear-gradient(100deg, transparent 15%, #000 55%, transparent 95%);
    transform: skewX(-18deg) scaleX(1.4);
}
.tone-default .hero-lines, .tone-muted .hero-lines { opacity: .9; background: repeating-linear-gradient(180deg, transparent 0 14px, rgba(var(--brand-rgb), .06) 14px 16px); }
.hero-copy { max-width: 46rem; }
.hero-title {
    font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 800; font-style: italic;
    letter-spacing: -.01em; line-height: 1; margin-bottom: 1.2rem; text-transform: none;
}
.hero-text { font-size: 1.2rem; line-height: 1.6; color: var(--text-muted); max-width: 40rem; }
.hero-copy.text-center .hero-text { margin-inline: auto; }
.hero-text p:last-child { margin-bottom: 0; }
.hero .button-row { margin-top: 2rem; }
/* Images are shown at their own size and only ever shrink to fit: a small image is never stretched. */
.hero-image {
    max-width: 100%; width: auto; height: auto; display: block; margin-inline: auto;
    filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .35));
}
.hero-image-below { max-width: 960px; margin: 3rem auto 0; }

.button-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Feature grid. */
.feature-card {
    position: relative; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tone-default .feature-card { background: var(--surface-2); box-shadow: none; }
[data-bs-theme=dark] .tone-default .feature-card { background: var(--surface-2); }
.feature-card:has(.stretched-link):hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(var(--brand-rgb), .35); }
.feature-card h3 { font-size: 1.35rem; margin-bottom: .5rem; }
.feature-icon {
    width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand); margin-bottom: 1.1rem;
}
.feature-image { width: 56px; height: 56px; object-fit: contain; margin-bottom: 1rem; }
.feature-text { color: var(--text-muted); }
.feature-text p:last-child { margin-bottom: 0; }
.feature-text ul { padding-left: 1.1rem; margin-bottom: 0; }
.feature-link { display: inline-flex; align-items: center; gap: .3rem; margin-top: .9rem; font-weight: 600; }

/* Text and image. */
.split-image { display: block; text-align: center; }
.split-image img { max-width: 100%; width: auto; height: auto; border-radius: var(--radius); }
.split-image.image-framed img { box-shadow: var(--shadow); border: 1px solid var(--border); }
.split-image.image-shadow img { box-shadow: var(--shadow); }
.split-image.image-floating img { border-radius: 0; filter: drop-shadow(0 18px 24px rgba(22, 26, 51, .22)); }
[data-bs-theme=dark] .split-image.image-floating img { filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .55)); }
.split-image.image-plain img { border-radius: 0; }

/* Gallery. */
.shot { margin: 0; }
/* Equal tiles; "scale-down" fits a large screenshot into the tile and leaves a small one at its own size. */
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: scale-down; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: transform .15s ease; }
.shot a:hover img { transform: scale(1.015); }
.shot figcaption { font-size: .9rem; color: var(--text-muted); margin-top: .5rem; }
.logo-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2.5rem 3.5rem; }
.logo-row img { max-height: 54px; max-width: 170px; width: auto; filter: grayscale(1); opacity: .75; transition: all .15s ease; }
.logo-row a:hover img, .logo-row img:hover { filter: none; opacity: 1; }
[data-bs-theme=dark] .logo-row img { filter: grayscale(1) invert(1) brightness(1.4); }

/* Lightbox (js/site.js). */
.lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(5, 7, 20, .9); display: grid; place-items: center; padding: 2rem; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 6rem); border-radius: 8px; box-shadow: 0 30px 60px rgba(0, 0, 0, .5); }
.lightbox figcaption { color: #fff; text-align: center; margin-top: .8rem; }

/* Testimonials. */
.quote-card {
    margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.8rem; display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
}
.tone-default .quote-card { background: var(--surface-2); box-shadow: none; }
.quote-card blockquote { font-size: 1.08rem; line-height: 1.6; flex: 1; margin-bottom: 1.4rem; }
.quote-card figcaption { display: flex; align-items: center; gap: .8rem; }
.quote-card figcaption img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.quote-card figcaption small { display: block; color: var(--text-muted); }

/* Numbers. */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2rem; text-align: center; }
.stat-value { font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: clamp(2.6rem, 5vw, 3.6rem); line-height: 1; color: var(--brand); }
.tone-brand .stat-value, .tone-dark .stat-value { color: #fff; }
.stat-label { font-weight: 600; margin-top: .4rem; }
.stat-text { color: var(--text-muted); font-size: .92rem; margin-top: .2rem; }

/* Questions. */
.faq { max-width: 50rem; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
    list-style: none; cursor: pointer; padding: 1.1rem 0; font-weight: 600; font-size: 1.08rem;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item .faq-chevron { transition: transform .15s ease; flex-shrink: 0; color: var(--text-muted); }
.faq-item[open] .faq-chevron { transform: rotate(180deg); }
.faq-item .prose { padding-bottom: 1.2rem; color: var(--text-muted); }

/* Call to action. */
.cta { max-width: 44rem; }
.cta h2 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; font-style: italic; margin-bottom: 1rem; }
.cta .lead { color: var(--text-muted); margin-bottom: 1.8rem; }

/* Team: no boxes, just the people. */
.team-member { text-align: center; max-width: 24rem; margin-inline: auto; }
.team-photo {
    width: 168px; height: 168px; margin: 0 auto 1.3rem; display: block; object-fit: cover; object-position: center 20%;
    box-shadow: var(--shadow); background: var(--surface-2);
}
.team-photo.shape-round { border-radius: 50%; }
.team-photo.shape-square { border-radius: var(--radius); }
.team-initials {
    display: grid; place-items: center; background: linear-gradient(135deg, var(--hero-2), var(--hero-3)); color: #fff;
    font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 3.4rem;
}
.team-member h3 { font-size: 1.45rem; margin-bottom: .15rem; }
.team-role { color: var(--accent); font-weight: 600; font-size: .95rem; margin-bottom: .8rem; }
.tone-brand .team-role, .tone-dark .team-role { color: #ffb072; }
.team-bio { color: var(--text-muted); }
.team-bio p:last-child { margin-bottom: 0; }
.team-links { display: flex; justify-content: center; gap: .5rem; margin-top: 1rem; }
.team-links a {
    width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
    color: var(--brand); background: var(--brand-soft); transition: background .15s ease, color .15s ease;
}
.team-links a:hover { background: var(--brand); color: #fff; }
.tone-brand .team-links a, .tone-dark .team-links a { color: #fff; background: rgba(255, 255, 255, .12); }

/* Video: a 16:9 frame (a video file keeps its own shape). */
.video { margin-bottom: 0; }
.video-frame { display: block; width: 100%; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #000; }
div.video-frame { position: relative; aspect-ratio: 16 / 9; }
div.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video figcaption { font-size: .92rem; color: var(--text-muted); margin-top: .7rem; text-align: center; }

/* Steps: numbered by the list itself. */
.steps-row {
    list-style: none; padding: 0; margin: 0; counter-reset: step;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem;
}
.step { counter-increment: step; position: relative; }
.step-number {
    width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 1rem;
    background: var(--brand); color: #fff; font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 1.5rem;
}
.step-number::before { content: counter(step); }
[data-bs-theme=dark] .step-number { color: #0b0d22; }
/* A line from each number to the next, on wide screens. */
@media (min-width: 992px) {
    .step:not(:last-child) .step-number::after {
        content: ""; position: absolute; top: 24px; left: 64px; right: -1rem; height: 2px;
        background: linear-gradient(90deg, rgba(var(--brand-rgb), .35), rgba(var(--brand-rgb), .08));
    }
}
.tone-brand .step-number, .tone-dark .step-number { background: #fff; color: var(--hero-2); }
.tone-brand .step:not(:last-child) .step-number::after, .tone-dark .step:not(:last-child) .step-number::after { background: rgba(255, 255, 255, .3); }
.step h3 { font-size: 1.3rem; margin-bottom: .4rem; }
.step-text { color: var(--text-muted); }
.step-text p:last-child { margin-bottom: 0; }

/* Pricing: cards on their own surface, so they read the same on any band. */
.pricing-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; align-items: stretch; max-width: calc(var(--plans) * 22rem); margin-inline: auto; }
@media (min-width: 768px) { .pricing-grid { grid-template-columns: repeat(min(var(--plans), 2), 1fr); } }
@media (min-width: 992px) { .pricing-grid { grid-template-columns: repeat(var(--plans), 1fr); } }
.price-card {
    position: relative; display: flex; flex-direction: column; background: var(--surface); color: var(--text);
    --text-muted: #5b6078; border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem 1.8rem; box-shadow: var(--shadow-sm);
}
[data-bs-theme=dark] .price-card { --text-muted: #9aa0b8; background: var(--surface-2); }
.price-card.is-highlighted { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.price-badge {
    position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%); white-space: nowrap;
    background: var(--accent); color: var(--accent-text); font-size: .75rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; padding: .3rem .8rem; border-radius: 999px;
}
.price-card h3 { font-size: 1.5rem; font-weight: 800; margin-bottom: .3rem; }
.price-description { color: var(--text-muted); margin-bottom: 1.2rem; }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.4rem; }
.price-value { font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 2.8rem; line-height: 1; color: var(--brand); }
.price-period { color: var(--text-muted); }
.price-features { list-style: none; padding: 0; margin: 0 0 1.8rem; display: grid; gap: .55rem; }
.price-features li { display: flex; gap: .55rem; align-items: flex-start; }
.price-check { color: #12a150; flex-shrink: 0; margin-top: .15rem; }
.pricing-note { text-align: center; color: var(--text-muted); font-size: .92rem; margin-top: 1.8rem; }

/* Notice: a tinted box in the color of its kind, opaque so it reads on any band. */
.notice {
    --notice: var(--brand-bright);
    max-width: 52rem; display: flex; gap: 1rem; align-items: flex-start; padding: 1.2rem 1.4rem;
    border: 1px solid color-mix(in srgb, var(--notice) 35%, transparent); border-left: 5px solid var(--notice);
    border-radius: var(--radius-sm); color: var(--text); --text-muted: #5b6078;
    background: color-mix(in srgb, var(--notice) 9%, var(--surface));
}
[data-bs-theme=dark] .notice { --text-muted: #9aa0b8; }
.notice-tip { --notice: #12a150; }
.notice-important { --notice: #8250df; }
.notice-warning { --notice: #d4a017; }
.notice-icon { color: var(--notice); flex-shrink: 0; margin-top: .05rem; }
.notice-title { font-weight: 700; font-size: 1.08rem; margin-bottom: .2rem; }
.notice .prose a { color: var(--bs-link-color); }

/* Comparison table. */
.comparison-wrap {
    max-width: 60rem; overflow-x: auto; background: var(--surface); color: var(--text); --text-muted: #5b6078;
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
[data-bs-theme=dark] .comparison-wrap { background: var(--surface-2); --text-muted: #9aa0b8; }
.comparison { width: 100%; border-collapse: collapse; }
.comparison th, .comparison td { padding: .85rem 1.1rem; border-bottom: 1px solid var(--border); text-align: center; vertical-align: middle; }
.comparison tbody tr:last-child > * { border-bottom: 0; }
.comparison thead th { font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; white-space: nowrap; }
.comparison th[scope=row] { text-align: left; font-weight: 600; min-width: 12rem; }
.comparison .is-highlighted { background: var(--brand-soft); }
.comparison thead .is-highlighted { color: var(--brand); box-shadow: inset 0 3px 0 var(--accent); }
.comparison-yes { color: #12a150; }
.comparison-no { color: var(--text-muted); opacity: .6; }

/* Downloads. */
.downloads-panel {
    max-width: 52rem; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow);
}
.tone-brand .downloads-panel, .tone-dark .downloads-panel { color: var(--text); --text-muted: #5b6078; }
[data-bs-theme=dark] .downloads-panel { background: var(--surface-2); }
.downloads-panel h2 { font-size: 1.9rem; font-weight: 800; }
.version-pill {
    display: inline-block; font-family: var(--font-mono); font-size: .82rem; font-weight: 600;
    background: var(--brand-soft); color: var(--brand); padding: .2rem .6rem; border-radius: 999px;
}
.download-list { display: grid; gap: .6rem; }
.download-row {
    display: flex; align-items: center; gap: 1rem; padding: .9rem 1rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text);
    transition: border-color .15s ease, background .15s ease;
}
.download-row:hover { border-color: rgba(var(--brand-rgb), .45); background: var(--brand-soft); text-decoration: none; color: var(--text); }
.download-row-sm { padding: .55rem .8rem; }
.download-icon { width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.download-row-sm .download-icon { width: 32px; height: 32px; }
/* Files: download rows on any page. */
.files-panel { max-width: 52rem; }
.files-panel h2 { font-size: 1.9rem; font-weight: 800; margin-bottom: .8rem; }
.tone-brand .files-panel, .tone-dark .files-panel {
    background: var(--surface); color: var(--text); --text-muted: #5b6078; padding: 2rem; border-radius: var(--radius); box-shadow: var(--shadow);
}
[data-bs-theme=dark] .tone-brand .files-panel, [data-bs-theme=dark] .tone-dark .files-panel { background: var(--surface-2); --text-muted: #9aa0b8; }
.release-notes summary { cursor: pointer; font-weight: 600; color: var(--brand); }

/* Software and article cards. */
.software-card, .article-card {
    display: flex; flex-direction: column; background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.software-card { padding: 1.5rem; }
.tone-default .software-card, .tone-default .article-card { background: var(--surface); }
[data-bs-theme=dark] .software-card, [data-bs-theme=dark] .article-card { background: var(--surface-2); }
.software-card:hover, .article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(var(--brand-rgb), .35); text-decoration: none; color: var(--text); }
.software-card h3 { font-size: 1.35rem; }
.software-card p { color: var(--text-muted); flex: 1; }
.software-card-foot { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.card-arrow { color: var(--brand); transition: transform .15s ease; }
.software-card:hover .card-arrow { transform: translateX(3px); }
.chip { display: inline-block; font-size: .78rem; font-weight: 600; padding: .18rem .6rem; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted); background: var(--surface); }

.app-icon {
    --hue: 232;
    display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 12px;
    width: 48px; height: 48px; font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 1.2rem; color: #fff;
    background: linear-gradient(135deg, hsl(var(--hue) 60% 32%), hsl(calc(var(--hue) + 12) 60% 50%));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.app-icon-sm { width: 34px; height: 34px; font-size: .9rem; border-radius: 9px; }
.app-icon-lg { width: 76px; height: 76px; font-size: 1.9rem; border-radius: 18px; }
.app-icon.has-image { position: relative; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.app-icon.has-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

.article-card { overflow: hidden; }
.article-card-image { aspect-ratio: 16 / 8; background: var(--surface-3); overflow: hidden; }
/* "scale-down" fits a large image and leaves a small one at its own size, centered either way. */
.article-card-image img { display: block; width: 100%; height: 100%; object-fit: scale-down; }
.article-card-body { padding: 1.3rem 1.4rem 1.5rem; }
.article-card h3 { font-size: 1.3rem; margin-bottom: .4rem; }
.article-card p { color: var(--text-muted); font-size: .95rem; }

/* Release history. */
.timeline { max-width: 52rem; }
.timeline-item { position: relative; padding: 0 0 2.2rem 1.6rem; border-left: 2px solid var(--border); }
.timeline-item::before {
    content: ""; position: absolute; left: -7px; top: .45rem; width: 12px; height: 12px;
    border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--surface);
}
.timeline-item:last-child { border-left-color: transparent; }

.auth-card { max-width: 420px; }

/* ----- Administration ----------------------------------------------------------------------------- */

.admin-shell { display: flex; min-height: 100vh; width: 100%; background: var(--surface-2); }
.admin-nav {
    width: 232px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 1rem .8rem;
}
.admin-brand { display: block; padding: .3rem .5rem 1.2rem; }
.admin-brand .brand-logo { height: 36px; }
.admin-nav nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav nav a {
    display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: 8px;
    color: var(--text); font-weight: 500; font-size: .95rem;
}
.admin-nav nav a:hover { background: var(--surface-3); text-decoration: none; }
.admin-nav nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.admin-nav-group { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); padding: 1rem .7rem .3rem; }
.admin-nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: .5rem; padding: .7rem; font-size: .9rem; border-top: 1px solid var(--border); }
.admin-nav-foot a, .admin-nav-foot .link-button { color: var(--text-muted); display: inline-flex; align-items: center; gap: .45rem; text-align: left; }
.admin-main { flex: 1; min-width: 0; }
.admin-page { padding: 2rem 2.2rem 4rem; }
@media (max-width: 991.98px) {
    .admin-shell { flex-direction: column; }
    .admin-nav { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem; }
    .admin-nav nav { flex-direction: row; flex-wrap: wrap; }
    .admin-nav-group, .admin-brand { display: none; }
    .admin-nav-foot { margin: 0; flex-direction: row; border: 0; }
    .admin-page { padding: 1.2rem 1rem 3rem; }
}

.stat-tile {
    display: flex; flex-direction: column; gap: .2rem; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.1rem 1.2rem; color: var(--text-muted); box-shadow: var(--shadow-sm);
}
.stat-tile:hover { border-color: rgba(var(--brand-rgb), .35); text-decoration: none; }
.stat-tile-value { font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; color: var(--text); line-height: 1.1; }
.stat-tile svg { color: var(--brand); }

.field { margin-bottom: 1rem; }
.field .form-label, .list-field > .form-label { font-weight: 600; font-size: .88rem; margin-bottom: .3rem; }
.form-text { font-size: .8rem; }

/* The page editor. */
.editor-top {
    position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border);
    padding: .9rem 1.5rem 0;
}
.editor-top .nav-underline .nav-link { padding: .6rem .2rem; font-weight: 600; color: var(--text-muted); border: 0; border-bottom: 2px solid transparent; background: none; }
.editor-top .nav-underline .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); }
.editor-top .nav-underline { --bs-nav-underline-gap: 1.4rem; align-items: center; }
.editor-body { display: grid; gap: 0; align-items: start; }
.editor-body.layout-split { grid-template-columns: minmax(380px, 5fr) 7fr; }
.editor-body.layout-edit .editor-pane { max-width: 980px; margin: 0 auto; width: 100%; }
.editor-pane { padding: 1.4rem 1.5rem 6rem; min-width: 0; }
.preview-pane { position: sticky; top: 118px; height: calc(100vh - 118px); overflow: auto; border-left: 1px solid var(--border); background: var(--surface-3); padding: 1rem; }
.layout-preview .preview-pane { position: static; height: auto; border: 0; padding: 1.5rem; }
.preview-frame { background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); overflow: hidden; }
.layout-split .preview-frame { zoom: .72; }
.preview-frame a { pointer-events: none; }
.preview-frame .block { padding: 3.5rem 0; }
.preview-frame .hero { padding: 4rem 0; }
@media (max-width: 1199.98px) {
    .editor-body.layout-split { grid-template-columns: 1fr; }
    .layout-split .preview-pane { position: static; height: auto; border-left: 0; border-top: 1px solid var(--border); }
}

.section-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm); transition: border-color .15s ease, opacity .15s ease;
}
.section-card.open { border-color: rgba(var(--brand-rgb), .45); box-shadow: 0 0 0 3px var(--brand-soft); }
.section-card.dragging { opacity: .45; }
.section-card.drop-target { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 107, 0, .2); }
.section-card-head { display: flex; align-items: center; gap: .25rem; padding: .45rem .5rem .45rem .3rem; }
.drag-handle { cursor: grab; color: var(--text-muted); padding: .2rem; display: inline-flex; }
.section-card-title { flex: 1; min-width: 0; text-align: left; border: 0; background: none; display: flex; align-items: center; gap: .7rem; padding: .25rem .3rem; color: var(--text); }
.section-type { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .9rem; white-space: nowrap; color: var(--brand); }
.section-summary { color: var(--text-muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tone-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; margin: 0 .3rem; border: 1px solid var(--border); }
.tone-dot.tone-muted { background: var(--surface-3); }
.tone-dot.tone-brand { background: #2a328e; }
.tone-dot.tone-dark { background: #0b0d22; }
.section-card-body { padding: .6rem 1.1rem 1.1rem; border-top: 1px solid var(--border); }
.section-advanced summary { font-size: .85rem; font-weight: 600; color: var(--text-muted); cursor: pointer; }

.add-section { height: 1.4rem; display: flex; align-items: center; justify-content: center; position: relative; }
.add-section:hover .add-section-button, .add-section.visible .add-section-button { opacity: 1; }
.add-section.visible { height: auto; min-height: 2.6rem; }
.add-section-button {
    opacity: .35; transition: opacity .1s ease; border: 1px dashed rgba(var(--brand-rgb), .5); background: var(--surface);
    color: var(--brand); font-size: .8rem; font-weight: 600; border-radius: 999px; padding: .1rem .7rem; display: inline-flex; align-items: center; gap: .3rem;
}
.add-section-menu { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 1rem; margin: .5rem 0; }
.add-section-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem; }
.add-section-option {
    display: flex; gap: .7rem; align-items: flex-start; text-align: left; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--surface); padding: .7rem; color: var(--text);
}
.add-section-option svg { color: var(--brand); flex-shrink: 0; margin-top: .1rem; }
.add-section-option small { display: block; color: var(--text-muted); font-size: .78rem; line-height: 1.35; margin-top: .15rem; }
.add-section-option:hover { border-color: var(--brand); background: var(--brand-soft); }

.list-field { margin-bottom: 1rem; }
.list-field-item { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .6rem; background: var(--surface-2); }
.list-field-head { display: flex; align-items: center; gap: .3rem; padding: .3rem .4rem .3rem .6rem; border-bottom: 1px solid var(--border); }
.list-field-index { font-size: .75rem; font-weight: 700; color: var(--text-muted); min-width: 1.2rem; }
.list-field-body { padding: .7rem .8rem .1rem; }

.md-help { font-size: .78rem; margin-bottom: .3rem; position: relative; }
.md-help summary { color: var(--text-muted); cursor: pointer; }
.md-help-body { position: absolute; right: 0; z-index: 30; width: 320px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: .6rem; display: flex; flex-wrap: wrap; gap: .3rem; }
.md-input { font-size: .86rem; line-height: 1.5; }

.image-field { display: flex; gap: .7rem; align-items: flex-start; }
.image-field-thumb {
    width: 76px; height: 56px; flex-shrink: 0; border-radius: 8px; border: 1px dashed var(--border); cursor: pointer;
    display: grid; place-items: center; background: var(--surface-3); color: var(--text-muted); overflow: hidden;
    background-image: linear-gradient(45deg, rgba(128,128,128,.12) 25%, transparent 25%, transparent 75%, rgba(128,128,128,.12) 75%), linear-gradient(45deg, rgba(128,128,128,.12) 25%, transparent 25%, transparent 75%, rgba(128,128,128,.12) 75%);
    background-size: 12px 12px; background-position: 0 0, 6px 6px;
}
/* Pinned to the box (the box is a grid that centers the placeholder icon; in a grid, a 100% height would not be the box's). */
.image-field-thumb { position: relative; }
.image-field-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

.icon-field { position: relative; }
.icon-grid {
    position: absolute; z-index: 40; top: 100%; left: 0; margin-top: .3rem; width: 340px; max-height: 260px; overflow: auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: .4rem;
}
.icon-grid-item { border: 0; background: none; border-radius: 6px; padding: .45rem; color: var(--text); display: grid; place-items: center; }
.icon-grid-item:hover, .icon-grid-item.active { background: var(--brand-soft); color: var(--brand); }

.picker-backdrop { position: fixed; inset: 0; background: rgba(5, 7, 20, .55); z-index: 1050; }
.picker {
    position: fixed; z-index: 1060; top: 6vh; left: 50%; transform: translateX(-50%); width: min(960px, 94vw); max-height: 88vh;
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.picker-head { display: flex; align-items: center; gap: .6rem; padding: .9rem 1rem; border-bottom: 1px solid var(--border); }
.picker-search { width: 200px; }
.picker-body { display: flex; min-height: 0; flex: 1; }
.picker-folders { width: 200px; flex-shrink: 0; overflow: auto; padding: .8rem .5rem; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: .15rem; }
@media (max-width: 575.98px) { .picker-folders { width: 140px; } }
.picker-grid { flex: 1; min-width: 0; align-content: start; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .7rem; padding: 1rem; }
.picker-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: .4rem; display: flex; flex-direction: column; gap: .3rem; color: var(--text); }
.picker-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.picker-file { width: 100%; aspect-ratio: 4 / 3; display: grid; place-items: center; color: var(--text-muted); }
.picker-item span { font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-item:hover { border-color: var(--brand); }

.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; }
.template-option { text-align: left; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: .9rem 1rem; color: var(--text); }
.template-option small { display: block; color: var(--text-muted); margin-top: .2rem; }
.template-option.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.upload-zone { position: relative; display: flex; gap: 1rem; align-items: center; padding: 1.25rem 1rem; border: 2px dashed rgba(var(--brand-rgb), .35); border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand); cursor: pointer; transition: border-color .15s, background-color .15s; }
.upload-zone-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-zone-title { font-weight: 600; }
.upload-zone .form-text { margin-top: .15rem; }
.upload-zone:hover, .upload-zone.is-dragging { border-color: var(--brand); background: rgba(var(--brand-rgb), .14); }
.upload-zone.is-dragging { border-style: solid; }
.upload-zone:focus-within { box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .3); }
.upload-zone.is-busy, .upload-zone.is-busy .upload-zone-input { cursor: progress; }

.menu-tree { display: flex; flex-direction: column; gap: .7rem; }
.menu-node { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem; }
.menu-row { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.menu-row.is-hidden { opacity: .55; }
.menu-label { width: 190px; font-weight: 600; }
.menu-target { width: 220px; }
.menu-url { flex: 1; min-width: 160px; }
.menu-child { margin: .5rem 0 0 2rem; padding-left: .8rem; border-left: 2px solid var(--border); }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.media-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 767.98px) { .media-layout { grid-template-columns: 1fr; } }
.media-folders { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: .15rem; }
.media-folder {
    display: flex; align-items: center; gap: .55rem; width: 100%; text-align: left; border: 1px solid transparent;
    background: none; color: var(--text); padding: .45rem .6rem; border-radius: var(--radius-sm); font-size: .92rem;
}
.media-folder:hover { background: var(--surface-2); }
.media-folder.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.media-folder.is-over { border-color: var(--brand); border-style: dashed; background: var(--brand-soft); }
.media-folder svg { flex-shrink: 0; opacity: .8; }
.media-folder-count { font-size: .78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.media-folders-divider { border-top: 1px solid var(--border); margin: .4rem 0; }
.media-folder-add { align-self: flex-start; display: inline-flex; align-items: center; gap: .3rem; margin-top: .3rem; text-decoration: none; }
.media-folder-new { padding: .3rem .2rem; }
.media-selection {
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .6rem .8rem; margin-bottom: 1rem;
    background: var(--brand-soft); border: 1px solid rgba(var(--brand-rgb), .3); border-radius: var(--radius-sm);
    position: sticky; top: .5rem; z-index: 5;
}
.media-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .5rem; }
.media-card.checked { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.media-check { position: absolute; top: .9rem; left: .9rem; z-index: 2; margin: 0; width: 1.15rem; height: 1.15rem; opacity: 0; transition: opacity .1s ease; }
.media-card:hover .media-check, .media-grid.selecting .media-check, .media-check:focus-visible { opacity: 1; }
@media (hover: none) { .media-check { opacity: 1; } }
.media-card.selected { border-color: var(--brand); }
.media-thumb { width: 100%; aspect-ratio: 4 / 3; border: 0; border-radius: 6px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-muted); overflow: hidden; }
.media-thumb { position: relative; }
.media-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.media-name { font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .4rem; }
.media-detail { width: min(640px, 94vw); overflow: auto; }
.media-detail-image { max-width: 100%; max-height: 320px; display: block; margin: 0 auto; border-radius: 6px; }

#blazor-error-ui {
    background: #fff4d6; color: #3d2b00; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 3000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

@media (max-width: 575.98px) {
    .block { padding: 3rem 0; }
    .hero { padding: 3.5rem 0; }
    .downloads-panel { padding: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}
