:root {
    /* Map Fluent UI core design tokens directly to LetterlAIne theme variables */
    --neutral-foreground-rest: var(--theme-color-text, #121316);
    --neutral-fill-rest: var(--theme-color-surface, #ffffff);
    --neutral-fill-hover: var(--theme-color-surface2, #f8fafb);
    --neutral-fill-input-rest: var(--theme-color-surface, #ffffff);
    --neutral-fill-input-hover: var(--theme-color-surface2, #f8fafb);
    --neutral-stroke-rest: var(--theme-color-border, #d7dee3);
    --neutral-stroke-input-rest: var(--theme-color-border, #d7dee3);
    --neutral-fill-strong-rest: var(--theme-color-border, #d7dee3);
    
    --accent-fill-rest: var(--theme-color-primary, #0f766e);
    --accent-fill-hover: var(--theme-color-primaryHover, #115e59);
    --accent-fill-active: var(--theme-color-primaryActive, #134e4a);
    --accent-foreground-rest: var(--theme-color-textInverse, #ffffff);

    /* Dynamic spacing variables scaled by density */
    --ui-space-1: calc(var(--theme-space-1, 4px) * var(--theme-density-multiplier, 1));
    --ui-space-2: calc(var(--theme-space-2, 8px) * var(--theme-density-multiplier, 1));
    --ui-space-3: calc(var(--theme-space-3, 12px) * var(--theme-density-multiplier, 1));
    --ui-space-4: calc(var(--theme-space-4, 16px) * var(--theme-density-multiplier, 1));
    --ui-space-5: calc(var(--theme-space-5, 20px) * var(--theme-density-multiplier, 1));
    --ui-space-6: calc(var(--theme-space-6, 28px) * var(--theme-density-multiplier, 1));

    /* Semantic layout variables */
    --ui-gap-sm: var(--ui-space-2);
    --ui-gap-md: calc(var(--theme-grid-gap, var(--theme-space-4, 16px)) * var(--theme-density-multiplier, 1));
    --ui-gap-lg: var(--ui-space-6);

    --ui-card-padding: var(--ui-space-4);
    --ui-section-gap: var(--ui-space-5);
    --ui-page-margin: calc(var(--theme-margin-page, 2rem) * var(--theme-density-multiplier, 1));

    --ui-radius-pill: 9999px;
    --ui-font-monospace: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html,
body {
    margin: 0;
    background: var(--theme-color-bg, #f7f8fa);
    color: var(--theme-color-text, #20242a);
    font-family: var(--theme-font-family), "Inter", "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.bootstrap-status {
    max-width: 760px;
    padding: 64px 32px;
}

.eyebrow {
    color: var(--theme-color-textMuted, #55616f);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 0 0 12px;
    text-transform: uppercase;
}

h1 {
    font-size: 2.4rem;
    line-height: 1.1;
    margin: 0 0 16px;
}

p {
    font-size: 1rem;
    line-height: 1.6;
}

.app-icon {
    display: inline-block;
    flex: 0 0 auto;
    vertical-align: -0.15em;
}

.authz-message {
    max-width: 720px;
    padding: 48px 32px;
}

.authz-message h1 {
    color: var(--theme-color-heading, #111827);
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.authz-message p {
    color: var(--theme-color-textMuted, #55616f);
    margin: 0;
}

/* ── 2026 Web Design Trend integrations ── */

/* Editorial Typography with safe font stacks */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--theme-font-headingFamily), "Geist", "Satoshi", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: var(--theme-font-headingWeight, 800);
    letter-spacing: var(--theme-font-headingLetterSpacing, -0.02em);
    line-height: var(--theme-font-headingLineHeight, 1.25);
    transition: all var(--theme-transition-speed, 0.16s) var(--theme-transition-timing, cubic-bezier(0.4, 0, 0.2, 1));
}

.card-title,
.section-title,
.sidebar-title,
strong,
th {
    font-weight: var(--theme-font-weight-bold, 760);
}

body,
p,
span,
div,
input,
select,
textarea,
td {
    font-weight: var(--theme-font-weight-normal, 450);
}

/* Human Touch: Global SVG Grain Overlay with strict guardrails */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    opacity: var(--theme-grain-opacity, 0);
    background: var(--theme-color-grainTint, transparent);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 99999;
}

/* Aurora UI: Vibrant radial light background bubbles */
.aurora-bg {
    position: relative;
    overflow: hidden;
}

.aurora-bg::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: 
        radial-gradient(at 0% 0%, var(--theme-color-aurora1, rgba(37, 87, 214, 0.12)) 0px, transparent 50%),
        radial-gradient(at 100% 0%, var(--theme-color-aurora2, rgba(199, 249, 79, 0.1)) 0px, transparent 50%),
        radial-gradient(at 50% 100%, var(--theme-color-aurora3, rgba(235, 95, 95, 0.08)) 0px, transparent 50%);
    opacity: 0.85;
    pointer-events: none;
    z-index: 0;
}

/* Glassmorphism panel styling with robust color-mix fallback and accessibility safety */
.glass-panel {
    background: var(--theme-color-surface, #ffffff);
    border: 1px solid var(--theme-color-border, #d8e0ec);
    box-shadow: var(--theme-shadow-md);
}

@supports (background: color-mix(in srgb, red 50%, transparent)) {
    .glass-panel {
        background: color-mix(in srgb, var(--theme-color-surface, #ffffff) calc(var(--theme-glass-opacity, 0.75) * 100%), transparent);
    }
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
    .glass-panel {
        backdrop-filter: blur(var(--theme-glass-blur, 18px));
        -webkit-backdrop-filter: blur(var(--theme-glass-blur, 18px));
        border-color: color-mix(in srgb, var(--theme-color-border, #d8e0ec) 50%, transparent);
    }
}

/* Bento Layout elements */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--ui-gap-md);
}

.bento-card {
    border-radius: var(--theme-radius-card, 18px);
    box-shadow: var(--theme-shadow-md);
    background: var(--theme-color-card, #ffffff);
    border: 1px solid var(--theme-color-border, #d8e0ec);
    transition: transform var(--theme-transition-speed, 0.16s) var(--theme-transition-timing, cubic-bezier(0.4, 0, 0.2, 1)),
                box-shadow var(--theme-transition-speed, 0.16s) var(--theme-transition-timing, cubic-bezier(0.4, 0, 0.2, 1)),
                border-color var(--theme-transition-speed, 0.16s) var(--theme-transition-timing, cubic-bezier(0.4, 0, 0.2, 1));
}

/* Smooth microinteractions hover lifts with focus styling support */
.hover-lift:hover,
.hover-lift:focus-within {
    transform: translateY(var(--theme-hover-lift, -2px));
    box-shadow: var(--theme-shadow-lg);
    border-color: var(--theme-color-primary, #2557d6);
}

/* Accessibility: Support reduced motion settings */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-delay: -1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        background-attachment: initial !important;
        scroll-behavior: auto !important;
        transition-duration: 1ms !important;
        transition-delay: -1ms !important;
    }
    
    .hover-lift:hover,
    .hover-lift:focus-within {
        transform: none !important;
    }
}

/* Accessibility: Polish Focus Outlines */
h1[tabindex="-1"]:focus,
h2[tabindex="-1"]:focus,
h3[tabindex="-1"]:focus,
h4[tabindex="-1"]:focus,
h5[tabindex="-1"]:focus,
h6[tabindex="-1"]:focus,
.page-title[tabindex="-1"]:focus,
.page-heading[tabindex="-1"]:focus,
.focus-shell[tabindex="0"]:focus {
    outline: none !important;
}

:where(a, button, input, select, textarea, [role="button"], [tabindex]:not([tabindex="-1"])):focus-visible {
    outline: var(--theme-focus-ring-width, 3px) var(--theme-focus-ring-style, solid) var(--theme-color-focus) !important;
    outline-offset: 3px !important;
}
