/* AutoDoc Website/css/styles.css — marketing site aligned with desktop app tokens (tailwind.config.js + Outfit) */

:root {
    /* Slate scale — mirrors app Tailwind extension */
    --slate-50: #f0f7fd;
    --slate-100: #e0effa;
    --slate-200: #c2e0f5;
    --slate-300: #8ec3ec;
    --slate-400: #7da7c2;
    --slate-500: #4b7d9c;
    --slate-600: #1a71b1;
    --slate-700: #0b538a;
    --slate-800: #093e68;
    --slate-900: #062640;
    --slate-950: #031828;

    /* Blue accent — app default */
    --blue-400: #85c7eb;
    --blue-500: #5fb4e5;
    --blue-600: #39a1df;
    --blue-glow: rgba(95, 180, 229, 0.25);

    --color-background: var(--slate-950);
    --color-surface: var(--slate-900);
    --color-surface-raised: var(--slate-800);
    --color-primary: var(--blue-500);
    --color-primary-hover: var(--blue-600);
    --color-text: var(--slate-50);
    --color-text-muted: var(--slate-400);
    --color-border: color-mix(in srgb, var(--slate-800) 70%, transparent);
    --color-border-strong: var(--slate-800);

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;

    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --container-width: 1200px;

    --header-height: 4rem;
}

/* Base Styles */
body {
    font-family: 'Outfit', system-ui, sans-serif;
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Typography */
h1 {
    font-size: clamp(2.25rem, 5vw, 3.25rem);
    line-height: 1.15;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.25rem);
    line-height: 1.25;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.02em;
}

h3 {
    font-size: 1.375rem;
    line-height: 1.35;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

h4 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-sm);
}

p {
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-muted);
}

/* Header — frosted bar like MainEditor top bar */
.site-header {
    background: color-mix(in srgb, var(--slate-950) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: var(--spacing-sm) 0;
    padding-top: calc(var(--spacing-sm) + env(safe-area-inset-top, 0px));
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--color-border);
    transition: box-shadow 0.2s ease;
}

.site-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: var(--header-height);
}

.logo img {
    height: auto;
    max-height: 3.25rem;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--blue-400);
}

/* Hero — deep slate gradient + soft blue vignette like app chrome */
.hero {
    background:
        radial-gradient(ellipse 80% 55% at 70% 20%, rgba(95, 180, 229, 0.12), transparent 55%),
        linear-gradient(165deg, var(--slate-900) 0%, var(--slate-950) 45%, #020f18 100%);
    color: var(--color-text);
    padding: calc(var(--spacing-xl) + var(--header-height)) 0 var(--spacing-xl);
    position: relative;
    overflow: hidden;
}

.hero h1 {
    color: var(--slate-50);
}

.hero .hero-text {
    color: var(--slate-300);
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
}

.hero-text {
    font-size: 1.125rem;
    line-height: 1.65;
    margin-bottom: var(--spacing-md);
    max-width: 36rem;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

/* Keeps screenshot inside the hero grid column (fixes overflow vs. ~half of 1200px container). */
.hero-image {
    min-width: 0;
    justify-self: end;
}

.hero-image img {
    display: block;
    width: min(560px, 100%);
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.45),
        0 0 0 1px var(--color-border);
}

/* Buttons — primary/outline aligned with app (blue + slate borders) */
.button {
    display: inline-block;
    padding: 0.875rem 1.625rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.button:focus-visible {
    outline: 2px solid var(--blue-500);
    outline-offset: 3px;
}

.button:hover:not(.button-disabled) {
    transform: translateY(-1px);
}

.button-primary {
    background-color: var(--blue-600);
    color: #fff;
    box-shadow:
        0 8px 24px rgba(57, 161, 223, 0.35),
        0 0 0 1px color-mix(in srgb, var(--blue-500) 35%, transparent);
}

.button-primary:hover {
    background-color: var(--color-primary);
    box-shadow:
        0 12px 32px rgba(57, 161, 223, 0.4),
        0 0 0 1px color-mix(in srgb, var(--blue-400) 40%, transparent);
}

.button-secondary {
    background-color: rgba(6, 38, 64, 0.5);
    color: var(--slate-100);
    border: 1px solid var(--color-border-strong);
    backdrop-filter: blur(8px);
}

.button-secondary:hover {
    border-color: var(--slate-500);
    background-color: rgba(9, 62, 104, 0.45);
}

.button-disabled {
    background-color: var(--slate-800) !important;
    color: var(--slate-500) !important;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none !important;
    transform: none !important;
    border-color: transparent !important;
}

/* Features */
.features {
    padding: var(--spacing-xl) 0;
    background-color: var(--color-surface);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.features h2 {
    text-align: center;
    color: var(--slate-50);
}

.features-lead {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 1.0625rem;
    max-width: 44rem;
    margin: var(--spacing-md) auto 0;
    line-height: 1.65;
}

.features-note {
    text-align: center;
    color: var(--slate-500);
    font-size: 0.9375rem;
    max-width: 42rem;
    margin: var(--spacing-md) auto 0;
    line-height: 1.6;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.feature-card {
    background: color-mix(in srgb, var(--slate-950) 65%, var(--slate-900));
    padding: var(--spacing-md);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--blue-500) 35%, var(--slate-800));
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.35),
        0 0 0 1px color-mix(in srgb, var(--blue-500) 18%, transparent);
}

.feature-marker {
    width: 2.5rem;
    height: 0.22rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--blue-600), var(--blue-400));
    margin-bottom: var(--spacing-sm);
}

.feature-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.65rem;
    color: var(--slate-50);
}

.feature-pro-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0.2rem 0.45rem;
    border-radius: 0.35rem;
    background: rgba(251, 191, 36, 0.14);
    color: #fcd34d;
    border: 1px solid rgba(251, 191, 36, 0.32);
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.08);
    line-height: 1;
}

.feature-pro-badge--inline {
    font-size: 0.5625rem;
    padding: 0.14rem 0.38rem;
    vertical-align: 0.1em;
}

.feature-body {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.feature-body kbd {
    font-family: ui-monospace, 'Cascadia Code', monospace;
    font-size: 0.8em;
    font-weight: 600;
    padding: 0.12em 0.4em;
    border-radius: 0.3rem;
    border: 1px solid var(--slate-700);
    background: color-mix(in srgb, var(--slate-950) 80%, var(--slate-800));
    color: var(--slate-200);
}

/* How It Works — deepest band before pricing */
.how-it-works {
    padding: var(--spacing-xl) 0;
    text-align: center;
    background: var(--color-background);
}

.how-it-works h2 {
    color: var(--slate-50);
}

.how-it-intro {
    color: var(--color-text-muted);
    font-size: 1.0625rem;
    line-height: 1.65;
    max-width: 40rem;
    margin: var(--spacing-md) auto 0;
}

/* Keep parentheses with the PRO chip so wrapping text cannot orphan ")" */
.pro-parenthetical {
    white-space: nowrap;
}

.step .feature-pro-badge--inline {
    vertical-align: 0.05em;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.step p {
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0;
}

.step h3 {
    color: var(--slate-50);
}

.step-number {
    width: 2.75rem;
    height: 2.75rem;
    background: linear-gradient(145deg, var(--blue-600), var(--blue-500));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin: 0 auto var(--spacing-sm);
    box-shadow: 0 8px 20px var(--blue-glow);
}

/* Download */
.download {
    padding: var(--spacing-xl) 0;
    background:
        radial-gradient(ellipse 70% 50% at 30% 80%, rgba(95, 180, 229, 0.1), transparent 50%),
        linear-gradient(170deg, var(--slate-900), var(--slate-950));
    color: var(--color-text);
    text-align: center;
}

.download h2,
.download h1 {
    color: var(--slate-50);
}

.download-changelog-note {
    margin-top: var(--spacing-md);
    margin-bottom: 0;
    font-size: 0.9375rem;
}

.download-changelog-note a {
    color: var(--blue-400);
    text-decoration: underline;
}

.download-changelog-note a:hover {
    color: var(--blue-300);
}

.download > .container > p {
    font-size: 1.0625rem;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
}

.version-info {
    margin-top: var(--spacing-md);
    color: var(--slate-500);
    font-size: 0.875rem;
    margin-bottom: 0;
}

/* Footer */
.site-footer {
    background-color: var(--color-background);
    padding: var(--spacing-xl) 0 var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

.footer-content {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

.footer-logo img {
    height: auto;
    max-height: 2.85rem;
    width: auto;
    display: block;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
}

.footer-column ul {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.footer-column a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-column a:hover {
    color: var(--blue-400);
}

.footer-bottom {
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.footer-bottom p {
    color: var(--slate-500);
    font-size: 0.875rem;
    margin-bottom: 0;
}

/* Pricing — lifted surface slab (matches Features) so “Choose your plan” stands apart */
.pricing {
    padding: var(--spacing-xl) 0;
    background-color: var(--color-surface);
    text-align: center;
    border-top: 1px solid color-mix(in srgb, var(--blue-500) 22%, var(--color-border));
    border-bottom: 1px solid var(--color-border);
}

.pricing h2 {
    color: var(--slate-50);
}

.pricing-intro {
    color: var(--color-text-muted);
    font-size: 1.0625rem;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0;
    line-height: 1.6;
}

.pricing-intro strong {
    color: var(--slate-200);
    font-weight: 600;
}

.pricing-focus {
    max-width: 26rem;
    margin: var(--spacing-lg) auto 0;
    text-align: left;
}

.pricing-aside-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-md);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

.pricing-aside-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--slate-50);
    margin-bottom: 0.35rem;
}

.pricing-aside-lead {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
    font-variant-numeric: tabular-nums;
}

.pricing-aside-card .pricing-features {
    text-align: left;
    margin-bottom: var(--spacing-md);
    list-style: none;
    padding: 0;
}

.pricing-aside-card .pricing-features li {
    position: relative;
    margin-bottom: 0.5rem;
    padding-left: 1.35rem;
    color: var(--slate-200);
    font-size: 0.9375rem;
}

.pricing-aside-card .pricing-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--blue-400);
    font-weight: 700;
    font-size: 0.85rem;
}

.pricing-aside-card .pricing-features li:last-child {
    margin-bottom: 0;
}

.pricing-cta {
    width: 100%;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-image {
        justify-self: center;
    }

    .nav-links {
        gap: var(--spacing-sm);
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .footer-logo {
        text-align: center;
    }

}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-card,
.step {
    animation: fadeIn 0.55s ease-out forwards;
}

/* Legal stub pages (privacy.html, terms.html) */
.legal-stub {
    min-height: 100vh;
    background: var(--color-background);
    color: var(--color-text);
    font-family: 'Outfit', system-ui, sans-serif;
    padding: var(--spacing-md) 0 var(--spacing-xl);
}

.legal-stub-header {
    border-bottom: 1px solid var(--color-border);
    padding: var(--spacing-sm) 0;
    margin-bottom: var(--spacing-lg);
}

.legal-stub-brand {
    font-weight: 700;
    color: var(--slate-50);
    text-decoration: none;
}

.legal-stub-brand:hover {
    color: var(--blue-400);
}

.legal-stub h1 {
    color: var(--slate-50);
    font-size: 1.75rem;
    margin-bottom: var(--spacing-md);
}

.legal-stub .legal-lead {
    color: var(--color-text-muted);
    font-size: 1rem;
    line-height: 1.65;
    margin-bottom: var(--spacing-md);
}

.legal-stub .legal-box {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.legal-stub .legal-box dt {
    font-weight: 700;
    color: var(--slate-200);
    margin-top: var(--spacing-sm);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.legal-stub .legal-box dt:first-child {
    margin-top: 0;
}

.legal-stub .legal-box dd {
    margin: 0.25rem 0 0;
    color: var(--slate-400);
    font-size: 0.9375rem;
}

.legal-stub .legal-box a {
    color: var(--blue-400);
}

.legal-stub .legal-box a:hover {
    color: var(--blue-300);
}

/* Footer imprint (company particulars) */
.footer-imprint {
    max-width: var(--container-width);
    margin: 0 auto var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-md) 0;
    border-top: 1px solid var(--color-border);
    text-align: left;
}

.footer-imprint p {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--slate-500);
}

.footer-imprint strong {
    color: var(--slate-300);
    font-weight: 600;
}

.footer-imprint a {
    color: var(--blue-400);
    text-decoration: none;
}

.footer-imprint a:hover {
    color: var(--blue-300);
    text-decoration: underline;
}

.footer-imprint-note {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--slate-600);
}

.legal-stub-header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
}

.legal-lang {
    margin: 0;
    font-size: 0.875rem;
}

.legal-lang a {
    color: var(--blue-400);
    text-decoration: none;
    font-weight: 600;
}

.legal-lang a:hover {
    color: var(--blue-300);
    text-decoration: underline;
}

.legal-draft-badge {
    display: inline-block;
    margin: 0 0 var(--spacing-sm);
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(251, 191, 36, 0.35);
    color: #fcd34d;
    background: rgba(251, 191, 36, 0.1);
}

.legal-h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--slate-50);
    margin: var(--spacing-lg) 0 var(--spacing-sm);
}

.legal-h2:first-of-type {
    margin-top: var(--spacing-md);
}

.legal-list {
    margin: 0 0 var(--spacing-md);
    padding-left: 1.25rem;
    color: var(--color-text-muted);
    line-height: 1.65;
    font-size: 0.9375rem;
}

.legal-list li {
    margin-bottom: 0.5rem;
}

/* —— Changelog (export-inspired light “document” on dark marketing chrome) —— */
.changelog-page-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.changelog-page {
    flex: 1;
    /* Generous top offset below the site header */
    padding: calc(var(--spacing-xl) + var(--spacing-md)) 0 var(--spacing-xl);
}

.changelog-page-inner {
    display: flex;
    justify-content: center;
}

/* Mirrors standalone HTML export: white sheet, Outfit, blue top accent, soft cards */
.changelog-doc {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem 2rem;
    font-family: 'Outfit', system-ui, sans-serif;
    color: #333;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    border-top: 4px solid #2563eb;
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.12),
        0 4px 6px -2px rgba(0, 0, 0, 0.06);
}

.changelog-doc-header {
    text-align: center;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.changelog-doc .changelog-doc-header h1 {
    margin: 0 0 0.65rem;
    color: #111827;
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.changelog-doc-lead {
    margin: 0 auto;
    max-width: 36rem;
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.6;
}

.changelog-code {
    font-family: ui-monospace, 'Cascadia Code', monospace;
    font-size: 0.85em;
    padding: 0.12em 0.45em;
    border-radius: 6px;
    background: #f3f4f6;
    color: #1f2937;
}

.changelog-entries {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.changelog-loading,
.changelog-empty,
.changelog-error {
    margin: 0;
    padding: 1rem;
    border-radius: 12px;
    border: 1px dashed rgba(209, 213, 219, 1);
    color: #6b7280;
    font-size: 0.9375rem;
    text-align: center;
}

.changelog-error {
    border-style: solid;
    border-color: #fecaca;
    color: #991b1b;
    background: #fef2f2;
}

.changelog-error p {
    margin: 0 0 0.5rem;
    text-align: left;
}

.changelog-error p:last-child {
    margin-bottom: 0;
}

.changelog-error-detail {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #7f1d1d;
    word-break: break-all;
}

/* Step-like release cards inside the doc */
.changelog-release {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    padding: 1rem 1.1rem 1.15rem;
    overflow: hidden;
}

.changelog-release-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}

.changelog-release-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
}

.changelog-release-date {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
}

.changelog-installer {
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #374151;
    word-break: break-word;
}

.changelog-installer-label {
    font-weight: 600;
    color: #111827;
    margin-right: 0.25rem;
}

.changelog-installer-link {
    font-weight: 500;
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.changelog-installer-link:hover {
    color: #1d4ed8;
}

.changelog-highlights {
    margin: 0 0 0.85rem;
    padding-left: 1.2rem;
    color: #374151;
    font-size: 0.9375rem;
    line-height: 1.55;
}

.changelog-highlights li {
    margin-bottom: 0.35rem;
}

.changelog-change-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.changelog-change-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #374151;
}

.changelog-change-text {
    flex: 1;
    padding-top: 0.06rem;
}

.changelog-tag {
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.2rem 0.42rem;
    border-radius: 6px;
    line-height: 1.2;
}

.changelog-tag--added {
    background: #dcfce7;
    color: #166534;
}

.changelog-tag--changed {
    background: #dbeafe;
    color: #1e40af;
}

.changelog-tag--fixed {
    background: #fef3c7;
    color: #92400e;
}

.changelog-tag--removed {
    background: #fee2e2;
    color: #991b1b;
}

/* —— Documentation hub & viewer —— */
.docs-hub-doc .docs-hub-loading {
    margin: 0;
    padding: 1rem;
    border-radius: 12px;
    border: 1px dashed #d1d5db;
    color: #6b7280;
    font-size: 0.9375rem;
    text-align: center;
}

.docs-hub-empty,
.docs-hub-error {
    margin: 0;
    padding: 1rem;
    border-radius: 12px;
    border: 1px dashed #d1d5db;
    color: #6b7280;
    font-size: 0.9375rem;
    text-align: center;
}

.docs-hub-error {
    border-style: solid;
    border-color: #fecaca;
    color: #991b1b;
    background: #fef2f2;
    text-align: left;
}

.docs-hub-error-detail {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #7f1d1d;
    word-break: break-all;
}

.docs-hub-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.docs-hub-card {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.1rem 1.15rem 1.15rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
}

.docs-hub-card-title {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
}

.docs-hub-card-title a {
    color: #1d4ed8;
    text-decoration: none;
}

.docs-hub-card-title a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.docs-hub-card-desc {
    margin: 0 0 0.65rem;
    color: #4b5563;
    font-size: 0.9375rem;
    line-height: 1.55;
}

.docs-hub-card-meta {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    color: #6b7280;
}

.docs-hub-card-actions {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}

.docs-hub-read {
    font-size: 0.875rem;
    padding: 0.45rem 1rem;
}

.docs-hub-standalone {
    font-size: 0.875rem;
    font-weight: 500;
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.docs-hub-standalone:hover {
    color: #1d4ed8;
}

/* documentation-viewer page: measured header height for iframe offset */
:root {
    --docs-viewer-header-offset: 7.75rem;
}

.docs-viewer-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding-top: var(--docs-viewer-header-offset);
    background: var(--color-background);
}

/* Single fixed header: primary nav + guide title row (avoids sticky offset / height mismatch) */
.docs-viewer-header-inner {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding-bottom: 0.35rem;
}

.docs-viewer-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    min-height: var(--header-height);
}

.docs-viewer-nav-row .logo {
    flex-shrink: 0;
}

.docs-viewer-subbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: 0.65rem 0 0.15rem;
    border-top: 1px solid var(--color-border);
}

.docs-viewer-subbar-title {
    margin: 0;
    font-size: clamp(1.05rem, 2.4vw, 1.3rem);
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
    flex: 1;
    min-width: min(100%, 12rem);
    line-height: 1.25;
}

.docs-viewer-subbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    align-items: center;
    justify-content: flex-end;
}

.docs-viewer-subbar-actions .button {
    font-size: 0.875rem;
    padding: 0.45rem 1rem;
}

.docs-viewer-frame-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #0f172a;
}

.docs-viewer-error-host {
    padding: var(--spacing-md);
}

.docs-viewer-error {
    max-width: 40rem;
    margin: 0 auto;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.9375rem;
}

.docs-viewer-error-detail {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: #7f1d1d;
}

.docs-viewer-frame {
    flex: 1;
    width: 100%;
    min-height: calc(100vh - var(--docs-viewer-header-offset));
    border: 0;
    background: #fff;
}

.docs-viewer-frame--inactive {
    display: none;
}

/* —— Documentation shell (sidebar tree + content, GitBook-style) —— */
.docs-shell-body {
    background: var(--color-background);
    scroll-behavior: auto;
}

/* Same horizontal band as header/footer (.container); wide viewports show background gutters. */
.docs-shell-page-wrap {
    width: 100%;
    box-sizing: border-box;
}

.docs-shell-layout {
    display: grid;
    grid-template-columns: minmax(240px, 17.5rem) minmax(0, 1fr);
    gap: 0;
    min-height: calc(100vh - 12rem);
    padding-top: calc(var(--spacing-sm) * 2 + var(--header-height) + env(safe-area-inset-top, 0px));
    position: relative;
}

/* Avoid layout jump; both-edges caused inconsistent centering across full reload vs in-app navigation */
html:has(.docs-shell-layout) {
    scrollbar-gutter: stable;
    /* reset.css sets body { scroll-behavior: smooth }; avoid animated viewport when guide height changes */
    scroll-behavior: auto;
}

.docs-shell-sidebar {
    position: sticky;
    top: calc(var(--spacing-sm) * 2 + var(--header-height) + env(safe-area-inset-top, 0px));
    align-self: start;
    max-height: calc(100vh - var(--header-height) - 3rem);
    overflow: auto;
    padding: var(--spacing-md) var(--spacing-sm) var(--spacing-lg) var(--spacing-md);
    border-right: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--slate-900) 65%, transparent);
}

.docs-shell-sidebar-head {
    margin-bottom: var(--spacing-sm);
    padding-right: var(--spacing-xs);
}

.docs-shell-sidebar-title {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin: 0 0 0.35rem;
}

.docs-shell-search {
    margin-top: 0.65rem;
}

.docs-shell-search-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.docs-shell-search-input {
    box-sizing: border-box;
    width: 100%;
    padding: 0.45rem 0.55rem;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text);
    background: color-mix(in srgb, var(--slate-800) 85%, transparent);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    outline: none;
}

.docs-shell-search-input::placeholder {
    color: var(--slate-500);
}

.docs-shell-search-input:hover {
    border-color: color-mix(in srgb, var(--slate-400) 35%, var(--color-border));
}

.docs-shell-search-input:focus {
    border-color: color-mix(in srgb, var(--blue-500) 55%, var(--color-border));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue-500) 22%, transparent);
}

.docs-search-panel {
    margin: 0.5rem 0 var(--spacing-sm);
    padding-right: var(--spacing-xs);
}

.docs-search-empty {
    margin: 0;
    padding: 0.65rem 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--slate-400);
    background: color-mix(in srgb, var(--slate-800) 80%, transparent);
    border-radius: var(--radius-sm);
}

.docs-search-results {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    max-height: min(50vh, 22rem);
    overflow: auto;
}

.docs-search-result-link {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.45rem 0.5rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--slate-200);
    background: color-mix(in srgb, var(--slate-800) 70%, transparent);
    border: 1px solid transparent;
    font-size: 0.8125rem;
    line-height: 1.35;
    font-weight: 600;
}

.docs-search-result-link:hover {
    color: var(--color-text);
    background: color-mix(in srgb, var(--slate-800) 92%, transparent);
}

.docs-search-result-link.is-active {
    color: var(--blue-400);
    background: color-mix(in srgb, var(--blue-500) 18%, transparent);
    border-color: color-mix(in srgb, var(--blue-500) 35%, transparent);
}

.docs-search-result-trail {
    display: block;
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--slate-500);
}

.docs-search-result-link:hover .docs-search-result-trail {
    color: var(--slate-400);
}

.docs-tree-nav {
    font-size: 0.875rem;
}

.docs-tree-loading {
    margin: 0;
    font-size: 0.875rem;
    color: var(--slate-400);
}

.docs-tree-error,
.docs-tree-empty {
    margin: 0;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--slate-800) 80%, transparent);
    color: var(--slate-400);
    font-size: 0.8125rem;
}

.docs-tree-error {
    border: 1px solid #7f1d1d;
    color: #fecaca;
}

.docs-tree-root,
.docs-tree-nested {
    list-style: none;
    margin: 0;
    padding: 0;
}

.docs-tree-nested {
    margin-top: 0.2rem;
    padding-left: 0.55rem;
    border-left: 1px solid var(--color-border);
}

.docs-tree-item {
    margin-bottom: 0.15rem;
}

.docs-tree-item--branch {
    margin-bottom: 0.35rem;
}

.docs-tree-branch-row {
    display: flex;
    align-items: stretch;
}

.docs-tree-branch-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    padding: 0.35rem 0.4rem;
    margin: 0;
    font: inherit;
    text-align: left;
    color: var(--color-text);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.docs-tree-branch-toggle:hover {
    background: color-mix(in srgb, var(--blue-500) 12%, transparent);
}

.docs-tree-branch-caret {
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid var(--slate-400);
    border-bottom: 2px solid var(--slate-400);
    transform: rotate(-45deg);
    margin-top: -0.15rem;
    transition: transform 0.15s ease;
}

.docs-tree-branch-toggle[aria-expanded='true'] .docs-tree-branch-caret {
    transform: rotate(45deg);
    margin-top: 0.1rem;
}

.docs-tree-branch-label {
    flex: 1;
    font-weight: 600;
    font-size: 0.8125rem;
    line-height: 1.35;
}

.docs-tree-link {
    display: block;
    padding: 0.35rem 0.5rem 0.35rem 1.5rem;
    margin: 0;
    border-radius: var(--radius-sm);
    color: var(--slate-300);
    text-decoration: none;
    font-weight: 500;
    line-height: 1.4;
    border: 1px solid transparent;
}

.docs-tree-link:hover {
    color: var(--color-text);
    background: color-mix(in srgb, var(--slate-800) 90%, transparent);
}

.docs-tree-link.is-active {
    color: var(--blue-400);
    background: color-mix(in srgb, var(--blue-500) 18%, transparent);
    border-color: color-mix(in srgb, var(--blue-500) 35%, transparent);
    font-weight: 600;
}

.docs-shell-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--slate-950);
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-lg);
}

.docs-shell-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin: 0 0 var(--spacing-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--slate-400);
}

.docs-shell-bc-link {
    color: var(--blue-400);
    text-decoration: none;
}

.docs-shell-bc-link:hover {
    text-decoration: underline;
}

.docs-shell-bc-sep {
    color: var(--slate-600);
    user-select: none;
}

.docs-shell-bc-part {
    color: var(--slate-400);
}

.docs-shell-bc-current {
    color: var(--slate-200);
    font-weight: 600;
}

.docs-shell-content-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.docs-shell-page-title {
    margin: 0;
    font-size: clamp(1.25rem, 3vw, 1.6rem);
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.docs-shell-content-actions .button {
    font-size: 0.8125rem;
    padding: 0.4rem 0.9rem;
}

.docs-shell-content-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Full-width row so the guide card is centered with symmetric gutters (flex align-self was skewed by scrollbar, etc.) */
.docs-shell-frame-center {
    display: flex;
    justify-content: center;
    width: 100%;
    min-width: 0;
}

.docs-shell-frame-area {
    box-sizing: border-box;
    align-self: center;
    width: fit-content;
    max-width: 100%;
    min-width: min(100%, 280px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: var(--radius-md);
    overflow-x: hidden;
    overflow-y: hidden;
    border: 1px solid var(--color-border);
    background: #fff;
}

.docs-shell-frame-area[hidden] {
    display: none !important;
}

.docs-shell-error-host {
    padding: var(--spacing-md);
    align-self: stretch;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

.docs-shell-error {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.9375rem;
}

.docs-shell-frame-hug {
    flex: 1;
    min-height: 0;
    min-width: min(100%, 1px);
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
}

/* Shrink-wrap to #documentation-inline-host; flex:1 was stretching full frame width and left-aligning the host, leaving empty white on the right */
.docs-shell-inline-scroll {
    flex: 0 1 auto;
    width: fit-content;
    max-width: 100%;
    min-height: 0;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    /* Short guides (e.g. Welcome) otherwise “ease” scroll when height snaps; prefer instant like long guides */
    scroll-behavior: auto;
}

.docs-shell-inline-host {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    /* Height comes from applyGuideZoom minHeight; a large default made short pages shrink one frame later */
    min-height: 0;
    border: 0;
    background: #fff;
}

.docs-shell-inline--inactive {
    display: none !important;
}

@media (max-width: 900px) {
    .docs-shell-layout {
        grid-template-columns: minmax(11rem, 36vw) minmax(0, 1fr);
    }

    .docs-shell-sidebar {
        padding: var(--spacing-sm) var(--spacing-xs) var(--spacing-md) var(--spacing-sm);
    }

    .docs-shell-main {
        padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-md);
    }
}

.nav-links a[aria-current='page'] {
    color: var(--blue-400);
    font-weight: 600;
}
