    /* ═══════════════════════════════════════════════════════════════════════
       FRAGRANCE ENGINE — The Perfumer's Workshop
       A warm, refined, light aesthetic inspired by French perfumery ateliers
       ═══════════════════════════════════════════════════════════════════════ */

    :root {
        /* Height of the sticky top nav. base.js overwrites this with the live
           measured height on load + resize; this is the pre-JS fallback.
           Slide-in drawers start at this offset so they never clip under the
           nav (the .page-shell stacking context traps their z-index). */
        --nav-h: 56px;

        /* ── Palette: Warm Parchment ────────────────────────────────────── */
        --ivory:       #FAF7F2;
        --parchment:   #F3EDE4;
        --sand:        #E8DFD3;
        --stone:       #D4C9BA;
        --warm-gray:   #A89B8C;
        --espresso:    #2C1810;
        --ink:         #1A0F08;

        /* ── Accent: Rose Gold + Botanical ──────────────────────────────── */
        --rose-gold:     #C4956A;
        --rose-gold-soft: rgba(196, 149, 106, 0.12);
        --rose-gold-hover: #D4A87A;
        --rose-gold-deep: #A8794A;  /* deeper warm rose-gold (founder pick): title keyword + Accord Composer accents; 3.27:1 on parchment, AA large text */
        --sage:          #7A9A7E;
        --sage-soft:     rgba(122, 154, 126, 0.12);
        --amber:         #C8943E;
        --amber-soft:    rgba(200, 148, 62, 0.10);
        --gold:          var(--rose-gold-deep);   /* editorial title keyword accent, now warm rose-gold-deep not mustard (founder 2026-06-04) */
        --plum:          #8B6B82;
        --plum-soft:     rgba(139, 107, 130, 0.10);
        --terracotta:    #C17A5A;
        --terracotta-soft: rgba(193, 122, 90, 0.10);

        /* ── Surfaces ───────────────────────────────────────────────────── */
        --bg:          var(--ivory);
        --surface:     #FFFFFF;
        --surface-alt: var(--parchment);
        --surface-hover: rgba(196, 149, 106, 0.06);
        --surface-active: rgba(196, 149, 106, 0.10);

        /* ── Text ───────────────────────────────────────────────────────── */
        --text-primary:   var(--espresso);
        --text-secondary: #6B5D52;
        --text-muted:     #736760;
        --text-faint:     #BEB2A6;
        --text-on-accent: #FFFFFF;

        /* ── Borders ────────────────────────────────────────────────────── */
        --border:        rgba(44, 24, 16, 0.08);
        --border-strong: rgba(44, 24, 16, 0.14);
        --border-accent: rgba(196, 149, 106, 0.4);

        /* ── Semantic ───────────────────────────────────────────────────── */
        --success:     #5A8F5E;
        --success-soft: rgba(90, 143, 94, 0.10);
        --warning:     #C8943E;
        --warning-soft: rgba(200, 148, 62, 0.10);
        --danger:      #B85450;
        --danger-soft:  rgba(184, 84, 80, 0.08);

        /* ── Note Colors (perfumery-specific) ───────────────────────────── */
        --top-note:    var(--sage);
        --mid-note:    var(--amber);
        --base-note:   var(--plum);
        /* Aliases referenced by the Formulary + accord/preview templates.
           Resolve to the real note tokens (which flip in dark), so the old
           --accord-* names render in the correct palette instead of pastels. */
        --accord-top:  var(--top-note);
        --accord-mid:  var(--mid-note);
        --accord-base: var(--base-note);

        /* ── Typography ─────────────────────────────────────────────────── */
        --font-display: 'Instrument Serif', Georgia, serif;
        --font-serif:   'Instrument Serif', Georgia, serif; /* alias: materials.html + others reference --font-serif */
        --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;
        --font-mono:    'DM Mono', 'Consolas', monospace;

        /* ── Spatial ────────────────────────────────────────────────────── */
        --radius-xs: 4px;
        --radius-sm: 6px;
        --radius-md: 10px;
        --radius-lg: 14px;
        --radius-xl: 20px;
        --radius-full: 999px;

        --space-1: 0.25rem;
        --space-2: 0.5rem;
        --space-3: 0.75rem;
        --space-4: 1rem;
        --space-5: 1.5rem;
        --space-6: 2rem;
        --space-7: 2.5rem;
        --space-8: 3rem;
        --space-10: 4rem;
        --space-12: 5rem;

        /* ── Motion ─────────────────────────────────────────────────────── */
        --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
        --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
        --duration-fast: 0.12s;
        --duration-normal: 0.2s;
        --duration-slow: 0.35s;

        /* ── Shadows ────────────────────────────────────────────────────── */
        --shadow-sm:  0 1px 2px rgba(44, 24, 16, 0.04);
        --shadow-md:  0 2px 8px rgba(44, 24, 16, 0.06), 0 1px 2px rgba(44, 24, 16, 0.04);
        --shadow-lg:  0 4px 16px rgba(44, 24, 16, 0.08), 0 2px 4px rgba(44, 24, 16, 0.04);
        --shadow-xl:  0 8px 32px rgba(44, 24, 16, 0.10), 0 2px 8px rgba(44, 24, 16, 0.05);
        --shadow-glow: 0 0 0 3px rgba(196, 149, 106, 0.15);
    }

    /* ═══ Dark Mode ════════════════════════════════════════════════════ */

    [data-theme="dark"] {
        --ivory:       #161412;
        --parchment:   #1C1916;
        --sand:        #2A2520;
        --stone:       #3D362F;
        --warm-gray:   #8A7E72;
        --espresso:    #E8E0D6;
        --ink:         #F0EDE8;

        --rose-gold:     #D4A87A;
        --rose-gold-soft: rgba(212, 168, 122, 0.12);
        --rose-gold-hover: #E0BC94;
        --rose-gold-deep: #D8AE7E;  /* deeper warm rose-gold for dark; same warm family as light, brighter on dark parchment */
        --sage:          #8AB08E;
        --sage-soft:     rgba(138, 176, 142, 0.12);
        --amber:         #D8A44E;
        --amber-soft:    rgba(216, 164, 78, 0.10);
        --gold:          var(--rose-gold-deep);   /* title keyword = warm rose-gold-deep in dark too, kills the old mustard-to-yellow jump */
        --plum:          #A87B9A;
        --plum-soft:     rgba(168, 123, 154, 0.10);
        --terracotta:    #D08A6A;
        --terracotta-soft: rgba(208, 138, 106, 0.10);

        --bg:          var(--ivory);
        --surface:     #211E1A;
        --surface-alt: var(--parchment);
        --surface-hover: rgba(212, 168, 122, 0.06);
        --surface-active: rgba(212, 168, 122, 0.10);

        --text-primary:   var(--espresso);
        --text-secondary: #B0A898;
        --text-muted:     #90857B;
        --text-faint:     #5A524A;
        --text-on-accent: #FFFFFF;

        --border:        rgba(255, 255, 255, 0.07);
        --border-strong: rgba(255, 255, 255, 0.12);
        --border-accent: rgba(212, 168, 122, 0.35);

        --success:     #6AAF6E;
        --success-soft: rgba(106, 175, 110, 0.12);
        --warning:     #D8A44E;
        --warning-soft: rgba(216, 164, 78, 0.12);
        --danger:      #D06A66;
        --danger-soft:  rgba(208, 106, 102, 0.10);

        --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.2);
        --shadow-md:  0 2px 8px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.15);
        --shadow-lg:  0 4px 16px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.15);
        --shadow-xl:  0 8px 32px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
        --shadow-glow: 0 0 0 3px rgba(212, 168, 122, 0.2);

        color-scheme: dark;
    }

    [data-theme="dark"] body::before {
        background:
            radial-gradient(ellipse at 20% 0%, rgba(212, 168, 122, 0.03), transparent 50%),
            radial-gradient(ellipse at 80% 100%, rgba(138, 176, 142, 0.02), transparent 50%);
    }

    [data-theme="dark"] .navbar {
        background: rgba(22, 20, 18, 0.88);
    }

    [data-theme="dark"] .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%238A7E72' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }

    [data-theme="dark"] .navbar-brand svg path {
        stroke: var(--rose-gold);
    }
    [data-theme="dark"] .navbar-brand svg circle {
        fill: var(--rose-gold);
    }

    /* ── Navbar logo (PNG, theme-adaptive via two img tags) ─────────── */
    .navbar-pipette-icon {
        height: 28px;
        width: auto;
        display: block;
        opacity: 0.9;
        transition: opacity 0.15s ease;
    }
    .navbar-pipette-icon--dark {
        display: none;
    }
    .navbar-pipette-icon:hover { opacity: 1; }
    [data-theme="dark"] .navbar-pipette-icon--light {
        display: none;
    }
    [data-theme="dark"] .navbar-pipette-icon--dark {
        display: block;
    }

    /* (legacy rule kept for any inline SVG elsewhere on the page) */
    .navbar-pipette-svg {
        height: 30px;
        width: 30px;
        display: block;
        color: var(--text-primary);
        opacity: 0.92;
        transition: opacity 0.15s ease, transform 0.2s var(--ease-out);
    }
    .navbar-brand:hover .navbar-pipette-svg {
        opacity: 1;
        transform: rotate(-4deg);
    }

    /* ── Wide brand logo (used on generator hero) ────────────────────── */
    .brand-logo-wide {
        height: clamp(101px, 9.8vw, 118px);
        width: auto;
        max-width: 100%;
        display: block;
        opacity: 1;
    }
    .brand-logo-wide--dark {
        display: none;
    }
    [data-theme="dark"] .brand-logo-wide--light {
        display: none;
    }
    [data-theme="dark"] .brand-logo-wide--dark {
        display: block;
    }

    [data-theme="dark"] .btn-close {
        filter: invert(1) grayscale(100%) brightness(0.8);
    }

    [data-theme="dark"] img {
        opacity: 0.92;
    }

    [data-theme="dark"] .dropdown-menu {
        background: #242424;
        border-color: rgba(255,255,255,0.08);
        box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    }
    [data-theme="dark"] .dropdown-item {
        color: var(--ink);
    }
    [data-theme="dark"] .dropdown-item:hover,
    [data-theme="dark"] .dropdown-item:focus {
        background: rgba(255,255,255,0.05);
    }

    /* ── Theme Toggle Button ─────────────────────────────────────────── */
    .theme-toggle {
        background: var(--surface-alt);
        border: 1px solid var(--border-strong);
        border-radius: var(--radius-full);
        width: 34px;
        height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background var(--duration-fast) ease,
                    border-color var(--duration-fast) ease,
                    transform var(--duration-fast) ease;
        padding: 0;
        color: var(--text-muted);
    }

    .theme-toggle:hover {
        background: var(--surface-hover);
        border-color: var(--border-accent);
        color: var(--rose-gold);
        transform: scale(1.08);
    }

    .theme-toggle svg {
        width: 16px;
        height: 16px;
        transition: transform 0.3s var(--ease-out);
    }

    .theme-toggle:hover svg {
        transform: rotate(15deg);
    }

    /* ═══ Reset & Base ═══════════════════════════════════════════════════ */

    *, *::before, *::after {
        box-sizing: border-box;
    }

    body {
        margin: 0;
        background: var(--bg);
        color: var(--text-primary);
        font-family: var(--font-body);
        font-size: 0.9375rem;
        font-weight: 400;
        line-height: 1.6;
        letter-spacing: -0.01em;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        min-height: 100vh;
    }

    /* Subtle texture */
    body::before {
        content: '';
        position: fixed;
        inset: 0;
        pointer-events: none;
        z-index: 0;
        background:
            radial-gradient(ellipse at 20% 0%, rgba(196, 149, 106, 0.04), transparent 50%),
            radial-gradient(ellipse at 80% 100%, rgba(122, 154, 126, 0.03), transparent 50%);
    }

    /* ═══ Typography ═════════════════════════════════════════════════════ */

    h1, h2, h3, h4, h5, h6 {
        font-family: var(--font-display);
        color: var(--text-primary);
        font-weight: 400;
        letter-spacing: -0.02em;
        line-height: 1.15;
        margin-bottom: var(--space-3);
    }

    h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
    h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
    h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
    h4 { font-size: 1.15rem; }
    h5 { font-size: 1rem; font-family: var(--font-body); font-weight: 600; }

    p, li { color: var(--text-secondary); line-height: 1.65; }

    a {
        color: var(--rose-gold);
        text-decoration: none;
        transition: color var(--duration-fast) ease;
    }
    a:hover { color: var(--rose-gold-hover); }

    .font-display { font-family: var(--font-display); }
    .font-mono { font-family: var(--font-mono); }

    .text-primary-forced { color: var(--text-primary) !important; }
    .text-secondary { color: var(--text-secondary) !important; }
    .text-muted { color: var(--text-muted) !important; }
    .text-faint { color: var(--text-faint) !important; }
    .text-rose { color: var(--rose-gold) !important; }
    .text-sage { color: var(--sage) !important; }
    .text-amber-tone { color: var(--amber) !important; }
    .text-plum { color: var(--plum) !important; }
    .text-danger { color: var(--danger) !important; }
    .text-success { color: var(--success) !important; }

    .accent { color: var(--rose-gold) !important; }
    .text-light { color: var(--text-primary) !important; }
    .text-green { color: var(--sage) !important; }
    .text-violet { color: var(--plum) !important; }
    .text-amber { color: var(--amber) !important; }

    /* Editorial keyword accent: gold the last word of a short display title
       (applied by feGoldenizeTitles in base.js). --gold is theme-tuned for
       WCAG AA on the parchment surfaces; never --rose-gold (reserved for the
       primary action + brand mark). */
    .fe-kw { color: var(--gold); }

    /* ═══ Utility Classes ═════════════════════════════════════════════════ */
    .font-mono { font-family: var(--font-mono); }
    .font-display { font-family: var(--font-display); }
    .fs-xs { font-size: 0.72rem; }
    .fs-sm { font-size: 0.82rem; }
    .fs-md { font-size: 0.88rem; }
    .label-upper {
        font-size: 0.72rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted);
    }

    /* ═══ Page Title ══════════════════════════════════════════════════════ */

    .page-title {
        font-family: var(--font-display);
        font-size: clamp(1.75rem, 3vw, 2.25rem);
        font-weight: 400;
        color: var(--text-primary);
        letter-spacing: -0.03em;
        -webkit-background-clip: unset;
        -webkit-text-fill-color: unset;
        background-clip: unset;
        background: none;
    }

    .page-subtitle {
        font-size: 0.9375rem;
        color: var(--text-muted);
        max-width: 50ch;
    }

    /* ═══ Navbar ══════════════════════════════════════════════════════════ */

    .navbar {
        background: rgba(250, 247, 242, 0.85);
        border-bottom: 1px solid var(--border);
        backdrop-filter: blur(20px) saturate(1.6);
        -webkit-backdrop-filter: blur(20px) saturate(1.6);
        padding: 0 var(--space-6);
        position: sticky;
        top: 0;
        z-index: 1030;
    }

    .navbar-brand {
        font-family: var(--font-display);
        font-size: 1.15rem;
        color: var(--text-primary) !important;
        padding: 0.75rem 0;
        display: flex;
        align-items: center;
        gap: 0.6rem;
        letter-spacing: -0.02em;
        text-decoration: none;
        background: none;
        -webkit-background-clip: unset;
        -webkit-text-fill-color: unset;
    }

    .navbar-brand svg {
        flex-shrink: 0;
    }

    .navbar-brand:hover {
        color: var(--rose-gold) !important;
    }

    .nav-link {
        color: var(--text-muted) !important;
        font-family: var(--font-body);
        font-weight: 500;
        font-size: 0.84rem;
        padding: 0.75rem 0.65rem !important;
        position: relative;
        transition: color var(--duration-fast) ease;
        letter-spacing: 0.01em;
    }

    .nav-link:hover,
    .nav-link:focus {
        color: var(--text-primary) !important;
    }

    .nav-link.active {
        color: var(--rose-gold) !important;
    }

    .nav-link.active::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0.65rem;
        right: 0.65rem;
        height: 2px;
        background: var(--rose-gold);
        border-radius: 2px 2px 0 0;
    }

    .nav-divider {
        width: 1px;
        height: 16px;
        background: var(--border);
        margin: 0 0.2rem;
        align-self: center;
    }

    /* ── Nav Dropdown ── */
    .dropdown-menu {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        box-shadow: 0 8px 24px rgba(0,0,0,0.1);
        padding: 0.35rem 0;
        min-width: 180px;
    }
    .dropdown-item {
        color: var(--espresso);
        font-size: 0.82rem;
        padding: 0.4rem 0.75rem;
        transition: background var(--duration-fast) ease;
    }
    .dropdown-item:hover, .dropdown-item:focus {
        background: var(--sand);
        color: var(--espresso);
    }
    .dropdown-item.active {
        background: rgba(189,154,122,0.12);
        color: var(--rose-gold);
        font-weight: 600;
    }
    .dropdown-divider {
        border-color: var(--border);
        margin: 0.25rem 0;
    }
    .dropdown-toggle::after {
        vertical-align: 0.1em;
        margin-left: 0.15em;
    }

    .navbar-toggler {
        border-color: var(--border);
        padding: 0.4rem 0.65rem;
    }

    .navbar-toggler:focus {
        box-shadow: var(--shadow-glow);
    }

    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%236B5D52' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }

    /* ═══ Unified nav (.fe-nav) — one header for app + public ═════════════
       Layers on top of the .navbar rules above so app and public pages share
       one identical editorial header. Markup: templates/_partials/nav.html. */
    .fe-nav__inner {
        max-width: 1280px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        gap: var(--space-4);
        padding-left: 0;
        padding-right: 0;
    }
    .fe-nav__brand { gap: var(--space-2); }
    .fe-nav__mark {
        height: 26px;
        width: auto;
        opacity: 0.92;
        flex-shrink: 0;
    }
    .fe-nav__brand:hover .fe-nav__mark { opacity: 1; }
    .fe-nav__mark--dark { display: none; }
    [data-theme="dark"] .fe-nav__mark--light { display: none; }
    [data-theme="dark"] .fe-nav__mark--dark  { display: inline-block; }
    .fe-nav__wordmark {
        font-family: var(--font-display);
        font-size: 1.25rem;
        line-height: 1;
        letter-spacing: -0.01em;
        color: var(--text-primary);
    }
    .fe-nav__links { gap: 0.1rem; }
    .fe-nav__icon { vertical-align: -2px; margin-right: 2px; opacity: 0.8; }

    /* Theme toggle (shared, both modes) */
    .fe-nav__theme {
        background: none;
        border: 0;
        padding: 0.4rem;
        line-height: 0;
        color: var(--text-secondary);
        cursor: pointer;
        border-radius: var(--radius-sm);
        transition: color var(--duration-fast) var(--ease-out),
                    background var(--duration-fast) var(--ease-out);
    }
    .fe-nav__theme:hover { color: var(--text-primary); background: var(--surface-hover); }

    /* Public CTA pill */
    .fe-nav__cta {
        display: inline-flex;
        align-items: center;
        margin-left: var(--space-2);
        padding: 0.5rem 1.05rem;
        background: var(--rose-gold);
        color: var(--text-on-accent) !important;
        border-radius: var(--radius-full);
        font-family: var(--font-body);
        font-weight: 500;
        font-size: 0.86rem;
        letter-spacing: 0.01em;
        text-decoration: none;
        transition: background var(--duration-fast) var(--ease-out),
                    transform var(--duration-fast) var(--ease-out);
    }
    .fe-nav__cta:hover { background: var(--rose-gold-hover); transform: translateY(-1px); color: var(--text-on-accent) !important; }

    .fe-nav__account-name { font-size: 0.82rem; }
    .fe-nav__admin-badge { color: var(--rose-gold); font-weight: 700; font-size: 0.72rem; }
    .fe-nav__menu .dropdown-header {
        font-family: var(--font-mono);
        font-size: 0.72rem;
        letter-spacing: 0.04em;
        color: var(--text-muted);
    }

    /* Mobile: stack the collapsed nav with breathing room + 44px targets */
    @media (max-width: 991.98px) {
        .fe-nav .navbar-collapse { padding: var(--space-3) 0 var(--space-4); }
        .fe-nav__links { gap: 0.15rem; align-items: stretch; }
        .fe-nav .nav-link { padding: 0.6rem 0.5rem !important; min-height: 44px; display: flex; align-items: center; }
        .fe-nav__cta { margin: var(--space-2) 0 0; justify-content: center; min-height: 44px; }
        .fe-nav .nav-divider { display: none; }
        .fe-nav__theme { min-height: 44px; min-width: 44px; justify-content: center; display: inline-flex; align-items: center; }
    }

    /* ═══ Page Shell ═════════════════════════════════════════════════════ */

    .page-shell {
        padding-top: var(--space-8) !important;
        padding-bottom: var(--space-10) !important;
        position: relative;
        z-index: 1;
    }

    /* ═══ Cards ═══════════════════════════════════════════════════════════ */

    .card,
    .formula-card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
        color: var(--text-primary);
        transition: transform var(--duration-normal) var(--ease-out),
                    box-shadow var(--duration-normal) var(--ease-out),
                    border-color var(--duration-normal) var(--ease-out);
        backdrop-filter: none;
    }

    .card:hover,
    .formula-card:hover {
        border-color: var(--border-accent);
        box-shadow: var(--shadow-md);
        transform: translateY(-1px);
    }

    .formula-card {
        border-left: 3px solid var(--rose-gold);
    }

    /* Dark mode: lift cards off the near-black bg with a clearer edge (F-510).
       Border carries the separation so muted text keeps its AA contrast. */
    [data-theme="dark"] .card,
    [data-theme="dark"] .formula-card {
        border-color: var(--border-strong);
    }

    .card-body { padding: var(--space-5); }

    .surface-subtle {
        background: var(--surface-alt);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
    }

    .section-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-3);
        margin-bottom: var(--space-4);
    }

    /* ═══ Section Dividers (numbered) ════════════════════════════════════ */

    .section-divider {
        display: flex;
        align-items: center;
        gap: 0.875rem;
        margin: var(--space-7) 0 var(--space-4);
    }

    .section-divider:first-child {
        margin-top: 0;
    }

    .section-number {
        width: 32px;
        height: 32px;
        border-radius: var(--radius-full);
        background: var(--rose-gold-soft);
        border: 1.5px solid rgba(196, 149, 106, 0.35);
        color: var(--rose-gold);
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: var(--font-display);
        font-size: 0.95rem;
        flex-shrink: 0;
    }

    .section-divider h4 {
        margin-bottom: 0;
        font-size: 1.1rem;
    }

    .section-divider .section-subtitle {
        color: var(--text-muted);
        font-size: 0.8rem;
        font-weight: 400;
        font-family: var(--font-body);
        margin-top: 0.1rem;
    }

    /* ═══ Tables ══════════════════════════════════════════════════════════ */

    .table {
        --bs-table-bg: transparent;
        --bs-table-color: var(--text-primary);
        --bs-table-border-color: var(--border);
        --bs-table-striped-bg: rgba(196, 149, 106, 0.03);
        --bs-table-striped-color: var(--text-primary);
        --bs-table-hover-bg: rgba(196, 149, 106, 0.05);
        --bs-table-hover-color: var(--text-primary);
        font-size: 0.875rem;
    }

    .table > :not(caption) > * > * {
        padding: 0.7rem 0.65rem;
        border-bottom-color: var(--border);
    }

    .table thead th {
        color: var(--text-muted);
        font-weight: 600;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        border-bottom: 1px solid var(--border-strong);
        font-family: var(--font-body);
        background: var(--surface-alt);
    }

    .table tbody tr {
        transition: background var(--duration-fast) ease;
    }

    .table tbody tr:hover {
        background: var(--surface-hover) !important;
    }

    /* ═══ Forms ═══════════════════════════════════════════════════════════ */

    .form-label,
    label {
        color: var(--text-secondary);
        font-weight: 500;
        font-size: 0.84rem;
        margin-bottom: var(--space-1);
        letter-spacing: 0.01em;
    }

    .form-control,
    .form-select,
    textarea {
        background-color: var(--surface);
        color: var(--text-primary);
        border: 1px solid var(--border-strong);
        border-radius: var(--radius-md);
        font-family: var(--font-body);
        font-size: 0.9rem;
        padding: 0.55rem 0.75rem;
        transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
    }

    .form-control::placeholder,
    textarea::placeholder {
        color: var(--text-faint);
    }

    .form-control:focus,
    .form-select:focus,
    textarea:focus {
        background-color: var(--surface);
        color: var(--text-primary);
        border-color: var(--rose-gold);
        box-shadow: var(--shadow-glow);
        outline: none;
    }

    .form-check-input:checked {
        background-color: var(--rose-gold);
        border-color: var(--rose-gold);
    }

    .form-check-input:focus {
        box-shadow: var(--shadow-glow);
        border-color: var(--rose-gold);
    }

    /* ═══ Buttons ═════════════════════════════════════════════════════════ */

    .btn {
        border-radius: var(--radius-md);
        font-family: var(--font-body);
        font-weight: 500;
        font-size: 0.84rem;
        letter-spacing: 0.01em;
        padding: 0.5rem 1rem;
        transition: all var(--duration-fast) var(--ease-out);
        cursor: pointer;
    }

    .btn:hover {
        transform: translateY(-1px);
    }

    .btn:active {
        transform: translateY(0);
    }

    .btn-primary {
        color: var(--text-on-accent);
        border: none;
        background: var(--rose-gold);
        box-shadow: var(--shadow-sm);
    }

    .btn-primary:hover,
    .btn-primary:focus {
        color: var(--text-on-accent);
        background: var(--rose-gold-hover);
        box-shadow: var(--shadow-md);
    }

    .btn-success {
        color: var(--text-on-accent);
        border: none;
        background: var(--sage);
        box-shadow: var(--shadow-sm);
    }

    .btn-success:hover,
    .btn-success:focus {
        color: var(--text-on-accent);
        background: #8BAA8F;
        box-shadow: var(--shadow-md);
    }

    .btn-outline-primary {
        color: var(--rose-gold);
        border: 1px solid rgba(196, 149, 106, 0.4);
        background: transparent;
    }

    .btn-outline-primary:hover,
    .btn-outline-primary:focus {
        color: var(--text-on-accent);
        background: var(--rose-gold);
        border-color: var(--rose-gold);
    }

    .btn-outline-warning {
        color: var(--rose-gold);
        border-color: rgba(196, 149, 106, 0.4);
    }

    .btn-outline-warning:hover,
    .btn-outline-warning:focus {
        color: var(--text-on-accent);
        background-color: var(--rose-gold);
        border-color: var(--rose-gold);
    }

    .btn-outline-secondary {
        color: var(--text-secondary);
        border-color: var(--border-strong);
        background: transparent;
    }

    .btn-outline-secondary:hover,
    .btn-outline-secondary:focus {
        color: var(--text-primary);
        background: var(--surface-alt);
        border-color: var(--border-strong);
    }

    .btn-outline-danger {
        border-color: rgba(184, 84, 80, 0.4);
        color: var(--danger);
    }

    .btn-outline-danger:hover,
    .btn-outline-danger:focus {
        background: var(--danger);
        border-color: var(--danger);
        color: #fff;
    }

    .btn-sm {
        padding: 0.35rem 0.75rem;
        font-size: 0.78rem;
        border-radius: var(--radius-sm);
    }

    .btn-lg {
        padding: 0.65rem 1.5rem;
        font-size: 0.95rem;
        border-radius: var(--radius-lg);
    }

    /* ═══ Badges ══════════════════════════════════════════════════════════ */

    .badge {
        font-weight: 500;
        letter-spacing: 0.01em;
        font-family: var(--font-body);
        font-size: 0.75rem;
        padding: 0.3em 0.65em;
        border-radius: var(--radius-full);
        border: 1px solid var(--border);
    }

    .badge.bg-warning {
        background: var(--rose-gold-soft) !important;
        color: var(--rose-gold) !important;
        border-color: rgba(196, 149, 106, 0.3);
    }

    .badge.bg-success {
        background: var(--sage-soft) !important;
        color: var(--sage) !important;
        border-color: rgba(122, 154, 126, 0.3);
    }

    .badge.bg-info {
        background: var(--amber-soft) !important;
        color: var(--amber) !important;
        border-color: rgba(200, 148, 62, 0.3);
    }

    .badge.bg-danger {
        background: var(--danger-soft) !important;
        color: var(--danger) !important;
        border-color: rgba(184, 84, 80, 0.3);
    }

    .badge.bg-secondary {
        background: var(--surface-alt) !important;
        color: var(--text-secondary) !important;
        border-color: var(--border);
    }

    /* ═══ Progress Bars ══════════════════════════════════════════════════ */

    .progress {
        height: 6px;
        background-color: var(--sand);
        border-radius: var(--radius-full);
        overflow: hidden;
    }

    .progress-bar {
        border-radius: var(--radius-full);
        background: linear-gradient(90deg, var(--rose-gold), var(--amber));
        transition: width 0.6s var(--ease-out);
    }

    .progress-bar.bg-warning {
        background: linear-gradient(90deg, var(--rose-gold), var(--amber)) !important;
    }

    /* ═══ Alerts ══════════════════════════════════════════════════════════ */

    .alert {
        border-radius: var(--radius-md);
        border: 1px solid var(--border);
        background: var(--surface);
        color: var(--text-primary);
        font-size: 0.875rem;
    }

    .alert-warning {
        border-color: rgba(200, 148, 62, 0.3);
        background: var(--warning-soft);
        color: #8B6B20;
    }

    .alert-danger {
        border-color: rgba(184, 84, 80, 0.3);
        background: var(--danger-soft);
        color: var(--danger);
    }

    .alert-success {
        border-color: rgba(90, 143, 94, 0.3);
        background: var(--success-soft);
        color: var(--success);
    }

    .btn-close {
        filter: none;
        opacity: 0.4;
    }
    .btn-close:hover { opacity: 0.7; }

    /* ═══ Misc ════════════════════════════════════════════════════════════ */

    hr {
        border: 0;
        border-top: 1px solid var(--border);
        margin: var(--space-5) 0;
    }

    ul { padding-left: 1.1rem; }

    .formula-title {
        color: var(--text-primary);
        text-decoration: none;
        font-family: var(--font-display);
    }
    .formula-title:hover { color: var(--rose-gold); }

    .value-chip {
        min-width: 3.25rem;
        text-align: right;
        font-variant-numeric: tabular-nums;
        font-weight: 600;
        font-family: var(--font-mono);
    }

    /* ═══ Fragrance Pyramid SVG ══════════════════════════════════════════ */

    .pyramid-visual {
        width: min(100%, 300px);
        padding: 0.35rem;
        border-radius: var(--radius-lg);
    }

    .fragrance-pyramid { width: 100%; height: auto; display: block; }

    .pyramid-layer-shell { fill: rgba(44, 24, 16, 0.03); }

    .pyramid-fill { transition: opacity 0.35s ease; }
    .pyramid-fill-top { fill: url(#pyrTopGrad); }
    .pyramid-fill-mid { fill: url(#pyrMidGrad); }
    .pyramid-fill-base { fill: url(#pyrBaseGrad); }

    .pyramid-outline,
    .pyramid-divider {
        fill: none;
        stroke: rgba(196, 149, 106, 0.35);
        stroke-width: 1.1;
    }

    /* ═══ Structural Metrics ═════════════════════════════════════════════ */

    .structural-metrics { display: grid; gap: 0.5rem; }

    .structural-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: var(--surface);
        padding: 0.55rem 0.75rem;
    }

    .structural-row.is-dominant {
        border-color: rgba(196, 149, 106, 0.3);
        background: var(--rose-gold-soft);
    }

    .structural-label { color: var(--text-secondary); font-weight: 500; }

    .structural-indicator {
        border-radius: var(--radius-full);
        padding: 0.38rem 0.72rem;
        font-weight: 600;
        letter-spacing: 0.01em;
        font-size: 0.82rem;
    }

    .structural-indicator-balanced { color: var(--sage); background: var(--sage-soft); }
    .structural-indicator-top_heavy,
    .structural-indicator-base_heavy { color: var(--amber); background: var(--amber-soft); }
    .structural-dominant { color: var(--rose-gold); background: var(--rose-gold-soft); }

    /* ═══ Summary Strip ══════════════════════════════════════════════════ */

    .summary-strip {
        display: grid;
        grid-template-columns: repeat(5, minmax(130px, 1fr));
        gap: 0.55rem;
    }

    .summary-metric {
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: var(--surface);
        padding: 0.6rem 0.75rem;
        min-width: 0;
        transition: border-color var(--duration-fast) ease;
    }

    .summary-metric:hover {
        border-color: var(--border-accent);
    }

    .summary-label {
        display: block;
        color: var(--text-muted);
        font-size: 0.68rem;
        margin-bottom: 0.2rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        font-weight: 600;
    }

    .summary-value {
        display: block;
        color: var(--text-primary);
        font-weight: 600;
        font-size: 0.95rem;
        line-height: 1.25;
        overflow-wrap: anywhere;
        font-family: var(--font-mono);
    }

    /* ═══ Custom Tabs ════════════════════════════════════════════════════ */

    .fe-tabs {
        border-bottom: 1px solid var(--border);
        gap: 0.2rem;
    }

    .fe-tabs .nav-link {
        border: none;
        border-bottom: 2px solid transparent;
        border-radius: 0;
        color: var(--text-muted) !important;
        padding: 0.6rem 0.9rem;
        font-weight: 500;
        font-size: 0.84rem;
    }

    .fe-tabs .nav-link:hover,
    .fe-tabs .nav-link:focus {
        border-bottom-color: rgba(196, 149, 106, 0.2);
        background: transparent;
        color: var(--text-primary) !important;
    }

    .fe-tabs .nav-link.active {
        color: var(--rose-gold) !important;
        background: transparent;
        border-bottom-color: var(--rose-gold);
    }

    .fe-tab-content .tab-pane {
        transition: opacity 0.18s ease;
    }

    /* ═══ Structural Analysis (SA) ═══════════════════════════════════════ */

    .sa-panel {
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: var(--surface);
        padding: 0.8rem;
    }

    .sa-kicker {
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--text-muted);
        font-size: 0.7rem;
        font-weight: 600;
    }

    .sa-type-badge {
        margin-top: 0.35rem;
        display: inline-block;
        padding: 0.45rem 0.85rem;
        border-radius: var(--radius-md);
        font-weight: 600;
        border: 1px solid transparent;
        font-size: 0.82rem;
    }

    .sa-type-balanced { color: var(--sage); background: var(--sage-soft); border-color: rgba(122, 154, 126, 0.25); }
    .sa-type-top { color: var(--sage); background: var(--sage-soft); border-color: rgba(122, 154, 126, 0.25); }
    .sa-type-base { color: var(--plum); background: var(--plum-soft); border-color: rgba(139, 107, 130, 0.25); }
    .sa-type-dominant { color: var(--danger); background: var(--danger-soft); border-color: rgba(184, 84, 80, 0.25); }

    .sa-dominant-value {
        font-size: 1.05rem;
        min-width: 4rem;
        font-family: var(--font-mono);
    }

    .sa-dominant-warn {
        border-color: rgba(200, 148, 62, 0.25);
        background: var(--warning-soft);
    }

    /* SA Bars */
    .sa-bar-row {
        display: grid;
        grid-template-columns: 42px 1fr auto;
        gap: 0.6rem;
        align-items: center;
        margin-bottom: 0.55rem;
    }

    .sa-bar-label { color: var(--text-secondary); font-weight: 500; font-size: 0.85rem; }

    .sa-bar-track {
        background: var(--sand);
        border-radius: var(--radius-full);
        height: 6px;
        overflow: hidden;
    }

    .sa-bar-fill {
        height: 100%;
        border-radius: var(--radius-full);
        transform-origin: left center;
        animation: sa-grow 0.75s var(--ease-out) forwards;
    }

    .sa-bar-top { background: linear-gradient(90deg, #9BB79E, var(--sage)); }
    .sa-bar-mid { background: linear-gradient(90deg, #D4A84E, var(--amber)); }
    .sa-bar-base { background: linear-gradient(90deg, #A08998, var(--plum)); }

    .sa-bar-dominant .sa-bar-fill {
        filter: brightness(1.1);
    }

    .sa-chip {
        border: 1px solid var(--border);
        background: var(--surface-alt);
        color: var(--text-primary);
        border-radius: var(--radius-full);
        padding: 0.34rem 0.72rem;
        font-size: 0.85rem;
        font-weight: 500;
    }

    .sa-flag-list {
        border: 1px solid rgba(200, 148, 62, 0.2);
        background: var(--warning-soft);
        border-radius: var(--radius-md);
        padding: 0.55rem 0.65rem;
    }

    .sa-flag-item {
        display: flex;
        align-items: flex-start;
        gap: 0.45rem;
        color: #8B6B20;
        margin-bottom: 0.38rem;
    }
    .sa-flag-item:last-child { margin-bottom: 0; }

    .sa-flag-icon {
        width: 1rem;
        height: 1rem;
        border-radius: var(--radius-full);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(200, 148, 62, 0.35);
        font-size: 0.68rem;
        font-weight: 700;
        color: #8B6B20;
        line-height: 1;
        margin-top: 0.12rem;
        flex: 0 0 auto;
    }

    /* ═══ Evolution Chart ════════════════════════════════════════════════ */

    .evolution-chart-wrap {
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: var(--surface);
        padding: 0.55rem;
    }

    .evolution-chart { width: 100%; height: auto; display: block; }
    .evolution-grid-line { stroke: var(--border); stroke-width: 1; }
    .evolution-axis-line { stroke: var(--border-strong); stroke-width: 1.1; }
    .evolution-phase-band { fill: rgba(196, 149, 106, 0.04); }
    .evolution-phase-label { fill: var(--text-muted); font-size: 11px; letter-spacing: 0.03em; }

    .evolution-curve {
        fill: none;
        stroke: var(--rose-gold);
        stroke-width: 2.5;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-dasharray: 880;
        stroke-dashoffset: 880;
        animation: evolution-draw 1.1s ease forwards;
    }

    .evolution-point { fill: var(--rose-gold); stroke: var(--surface); stroke-width: 1.5; }
    .evolution-x-label { fill: var(--text-secondary); font-size: 10px; text-anchor: middle; }

    .evolution-chip {
        border: 1px solid rgba(196, 149, 106, 0.25);
        background: var(--rose-gold-soft);
        color: var(--rose-gold);
        font-weight: 500;
    }

    .evolution-log-card {
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: var(--surface);
        padding: 0.55rem;
    }

    /* ═══ Version Timeline ═══════════════════════════════════════════════ */

    .version-timeline { display: flex; flex-direction: column; gap: 0; }
    .vt-item {
        position: relative;
        padding: 0.6rem 0.75rem 0.6rem 1rem;
        border-left: 2px solid var(--border);
        margin-left: 0.55rem;
        margin-bottom: 0.2rem;
        transition: background var(--duration-fast) ease;
    }
    .vt-item:hover { background: var(--surface-hover); }
    .vt-latest { border-left-color: var(--rose-gold); }
    .vt-badge {
        font-variant-numeric: tabular-nums;
        font-family: var(--font-mono);
        min-width: 2.3rem;
        text-align: center;
    }

    /* ═══ Formula Summary Card ═══════════════════════════════════════════ */

    .fsc-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
        gap: 0.6rem;
    }
    .fsc-block {
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: var(--surface);
        padding: 0.6rem 0.75rem;
        transition: border-color var(--duration-fast) ease;
    }
    .fsc-block:hover { border-color: var(--border-accent); }
    .fsc-label {
        display: block;
        color: var(--text-muted);
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        margin-bottom: 0.22rem;
        font-weight: 600;
    }
    .fsc-value {
        color: var(--text-primary);
        font-weight: 600;
        font-size: 0.93rem;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }
    .fsc-sub {
        color: var(--text-muted);
        font-size: 0.78rem;
        margin-top: 0.15rem;
    }

    /* ═══ Engine Docs ════════════════════════════════════════════════════ */

    .docs-section {
        border-left: 3px solid var(--rose-gold);
        padding-left: 1.1rem;
        margin-bottom: 2rem;
    }
    .docs-kicker {
        text-transform: uppercase;
        letter-spacing: 0.08em;
        font-size: 0.7rem;
        color: var(--text-muted);
        margin-bottom: 0.3rem;
        font-weight: 600;
    }
    .docs-formula {
        font-family: var(--font-mono);
        background: var(--surface-alt);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        padding: 0.55rem 0.85rem;
        font-size: 0.85rem;
        color: var(--rose-gold);
        display: inline-block;
        margin: 0.3rem 0;
    }

    /* ═══ Range Sliders ══════════════════════════════════════════════════ */

    .form-range {
        height: 1.3rem;
        padding: 0;
        margin-top: 0.2rem;
        background: transparent;
    }

    .form-range:focus { outline: none; }

    .form-range::-webkit-slider-runnable-track {
        height: 4px;
        border-radius: var(--radius-full);
        background: var(--sand);
    }

    .form-range::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 16px;
        height: 16px;
        margin-top: -6px;
        border-radius: 50%;
        border: 2px solid var(--surface);
        background: var(--rose-gold);
        box-shadow: 0 1px 4px rgba(44, 24, 16, 0.15);
        transition: transform 0.12s ease, box-shadow 0.18s ease;
    }

    .form-range::-moz-range-track {
        height: 4px;
        border: 0;
        border-radius: var(--radius-full);
        background: var(--sand);
    }

    .form-range::-moz-range-thumb {
        width: 16px;
        height: 16px;
        border-radius: 50%;
        border: 2px solid var(--surface);
        background: var(--rose-gold);
        box-shadow: 0 1px 4px rgba(44, 24, 16, 0.15);
        transition: transform 0.12s ease, box-shadow 0.18s ease;
    }

    .form-range:active::-webkit-slider-thumb {
        transform: scale(1.15);
        box-shadow: var(--shadow-glow);
    }

    .form-range:active::-moz-range-thumb {
        transform: scale(1.15);
        box-shadow: var(--shadow-glow);
    }

    /* ═══ Collapse ═══════════════════════════════════════════════════════ */

    .collapse, .collapsing { will-change: height, opacity; }
    .collapsing { opacity: 0.65; transition: height 0.22s ease, opacity 0.22s ease; }
    .collapse.show { opacity: 1; }

    /* ═══ Animations ═════════════════════════════════════════════════════ */

    .card,
    .formula-card,
    .alert {
        animation: section-fade 0.35s var(--ease-out);
    }

    @keyframes section-fade {
        from { opacity: 0; transform: translateY(8px); }
        to { opacity: 1; transform: translateY(0); }
    }

    @keyframes evolution-draw {
        to { stroke-dashoffset: 0; }
    }

    @keyframes sa-grow {
        from { transform: scaleX(0); }
        to { transform: scaleX(1); }
    }

    .animate-in {
        opacity: 0;
        transform: translateY(10px);
        transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
    }
    .animate-in.visible {
        opacity: 1;
        transform: translateY(0);
    }

    /* Staggered entrance */
    .stagger-in > * {
        opacity: 0;
        transform: translateY(12px);
        animation: stagger-fade 0.4s var(--ease-out) forwards;
    }
    .stagger-in > *:nth-child(1) { animation-delay: 0.05s; }
    .stagger-in > *:nth-child(2) { animation-delay: 0.1s; }
    .stagger-in > *:nth-child(3) { animation-delay: 0.15s; }
    .stagger-in > *:nth-child(4) { animation-delay: 0.2s; }
    .stagger-in > *:nth-child(5) { animation-delay: 0.25s; }
    .stagger-in > *:nth-child(6) { animation-delay: 0.3s; }

    @keyframes stagger-fade {
        to { opacity: 1; transform: translateY(0); }
    }

    /* ═══ Toast Notifications ════════════════════════════════════════════ */

    .toast-container {
        position: fixed;
        top: 72px;
        right: 20px;
        z-index: 9999;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        pointer-events: none;
    }

    .fe-toast {
        pointer-events: auto;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        padding: 0.65rem 1rem;
        min-width: 260px;
        max-width: 380px;
        box-shadow: var(--shadow-lg);
        display: flex;
        align-items: center;
        gap: 0.75rem;
        font-size: 0.85rem;
        animation: toast-slide-in 0.3s var(--ease-out);
    }

    .fe-toast-success { border-left: 3px solid var(--success); }
    .fe-toast-danger { border-left: 3px solid var(--danger); }
    .fe-toast-info { border-left: 3px solid var(--rose-gold); }

    .fe-toast .toast-close {
        background: none;
        border: none;
        color: var(--text-muted);
        cursor: pointer;
        margin-left: auto;
        padding: 0 0.25rem;
        font-size: 1.1rem;
        line-height: 1;
    }
    .fe-toast .toast-close:hover { color: var(--text-primary); }

    @keyframes toast-slide-in {
        from { opacity: 0; transform: translateX(20px); }
        to { opacity: 1; transform: translateX(0); }
    }

    /* ═══ Breadcrumbs ════════════════════════════════════════════════════ */

    .fe-breadcrumb {
        font-size: 0.78rem;
        color: var(--text-muted);
        margin-bottom: var(--space-4);
        display: flex;
        align-items: center;
        gap: 0.35rem;
    }
    .fe-breadcrumb a {
        color: var(--text-secondary);
        text-decoration: none;
        transition: color var(--duration-fast) ease;
    }
    .fe-breadcrumb a:hover { color: var(--rose-gold); }
    .fe-breadcrumb .sep { color: var(--text-faint); font-size: 0.65rem; }

    /* ═══ Floating Action Button ═════════════════════════════════════════ */

    .fab {
        position: fixed;
        bottom: 1.5rem;
        right: 1.5rem;
        width: 48px;
        height: 48px;
        border-radius: var(--radius-full);
        background: var(--rose-gold);
        border: none;
        color: var(--text-on-accent);
        font-size: 1.2rem;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: var(--shadow-lg);
        cursor: pointer;
        z-index: 1000;
        transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease;
    }
    .fab:hover {
        transform: scale(1.06);
        box-shadow: var(--shadow-xl);
    }

    /* ═══ Accessibility ══════════════════════════════════════════════════ */

    :focus-visible {
        outline: 2px solid var(--rose-gold);
        outline-offset: 2px;
    }

    .btn:focus-visible {
        outline: 2px solid var(--rose-gold);
        outline-offset: 3px;
    }

    .skip-link {
        position: absolute;
        top: -40px;
        left: 16px;
        background: var(--rose-gold);
        color: var(--text-on-accent);
        padding: 0.5rem 1rem;
        border-radius: var(--radius-md);
        z-index: 9999;
        font-weight: 600;
        text-decoration: none;
        transition: top 0.2s ease;
    }
    .skip-link:focus { top: 8px; }

    @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }

    /* ═══ Archetype Grid (index page) ════════════════════════════════════ */

    .archetype-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.5rem;
    }

    .archetype-card {
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        padding: 0.65rem 0.75rem;
        cursor: pointer;
        background: var(--surface);
        transition: all var(--duration-fast) ease;
    }

    .archetype-card:hover {
        border-color: var(--border-accent);
        background: var(--surface-hover);
    }

    .archetype-card.active {
        border-color: var(--rose-gold);
        background: var(--rose-gold-soft);
    }

    /* ═══ Responsive ═════════════════════════════════════════════════════ */

    @media (max-width: 1200px) {
        .summary-strip { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
    }

    @media (max-width: 768px) {
        .summary-strip { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
        .page-shell { padding-top: var(--space-5) !important; }
        .nav-divider { display: none; }
        .navbar { padding: 0 var(--space-4); }
    }

    @media (max-width: 576px) {
        .summary-strip { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
        .fsc-grid { grid-template-columns: repeat(2, 1fr); }
        h1, .page-title { font-size: 1.5rem !important; }
        h2 { font-size: 1.35rem; }
        .archetype-grid { grid-template-columns: repeat(2, 1fr); }
    }

    @media (min-width: 1600px) {
        .container { max-width: 1400px; }
    }

    /* ═══ Olfactive Slider Rows (index page) ═════════════════════════════ */

    .olfactive-row {
        display: grid;
        grid-template-columns: 1fr 2fr auto;
        gap: 0.75rem;
        align-items: center;
        padding: 0.45rem 0;
        border-bottom: 1px solid var(--border);
    }

    .olfactive-row:last-child { border-bottom: none; }

    .olfactive-label {
        font-size: 0.84rem;
        color: var(--text-secondary);
        font-weight: 500;
    }

    .olfactive-value {
        font-family: var(--font-mono);
        font-size: 0.82rem;
        color: var(--text-primary);
        font-weight: 500;
        min-width: 2.5rem;
        text-align: right;
    }

    /* ═══ Tag / Chip styles ══════════════════════════════════════════════ */

    .tag-chip {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        padding: 0.25em 0.6em;
        border-radius: var(--radius-full);
        font-size: 0.75rem;
        font-weight: 500;
        border: 1px solid var(--border);
        background: var(--surface-alt);
        color: var(--text-secondary);
        transition: all var(--duration-fast) ease;
    }

    .tag-chip:hover {
        border-color: var(--border-accent);
        color: var(--text-primary);
    }

    /* ═══ Empty States ═══════════════════════════════════════════════════ */

    .empty-state {
        text-align: center;
        padding: var(--space-10) var(--space-5);
        color: var(--text-muted);
    }

    .empty-state-icon {
        font-size: 2.5rem;
        margin-bottom: var(--space-4);
        opacity: 0.4;
    }

    .empty-state h3 {
        font-family: var(--font-display);
        color: var(--text-secondary);
        margin-bottom: var(--space-2);
    }

    .empty-state p {
        max-width: 40ch;
        margin: 0 auto;
        font-size: 0.9rem;
    }

    /* ═══ Workspace panels (shared) ═════════════════════════════════════ */

    .workspace-panel {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        padding: var(--space-6);
        box-shadow: var(--shadow-sm);
    }

    .panel-label {
        font-family: var(--font-body);
        font-size: 0.68rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-muted);
        margin-bottom: var(--space-4);
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    .panel-label::before {
        content: '';
        display: inline-block;
        width: 8px;
        height: 8px;
        border-radius: 2px;
        background: var(--rose-gold);
        opacity: 0.6;
    }

    /* ═══ Utility classes ════════════════════════════════════════════════ */

    .ai-subdued { opacity: 0.85; }

    .btn-close-white {
        filter: invert(0.4);
    }

    /* ═══ Keyboard Shortcut Overlay ════════════════════════════════════ */

    .kb-overlay {
        position: fixed;
        inset: 0;
        z-index: 9999;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(26, 15, 8, 0.55);
        backdrop-filter: blur(8px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }
    .kb-overlay.visible {
        opacity: 1;
        visibility: visible;
    }
    .kb-panel {
        background: var(--surface);
        border: 1px solid var(--sand);
        border-radius: 16px;
        padding: 2rem 2.5rem;
        max-width: 420px;
        width: 90%;
        box-shadow: 0 24px 64px rgba(44, 24, 16, 0.18);
    }
    .kb-title {
        font-family: var(--font-display);
        font-size: 1.35rem;
        color: var(--espresso);
        margin-bottom: 1.25rem;
    }
    .kb-grid {
        display: grid;
        grid-template-columns: 48px 1fr;
        gap: 0.5rem 1rem;
        align-items: center;
    }
    .kb-key {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 32px;
        height: 28px;
        padding: 0 8px;
        border-radius: 6px;
        border: 1px solid var(--stone);
        background: var(--parchment);
        font-family: var(--font-mono);
        font-size: 0.75rem;
        font-weight: 500;
        color: var(--espresso);
        letter-spacing: 0.02em;
    }
    .kb-desc {
        font-size: 0.85rem;
        color: var(--warm-gray);
    }
    .kb-divider {
        grid-column: 1 / -1;
        height: 1px;
        background: var(--sand);
        margin: 0.35rem 0;
    }
    .kb-hint {
        margin-top: 1.25rem;
        font-size: 0.75rem;
        color: var(--warm-gray);
        text-align: center;
    }

    /* ═══ Material Hover Preview ══════════════════════════════════════ */

    .mat-hover {
        cursor: default;
        border-bottom: 1px dotted var(--border-strong);
        transition: color var(--duration-fast) ease;
    }
    .mat-hover:hover {
        color: var(--rose-gold);
    }

    .mat-preview {
        position: fixed;
        z-index: 9999;
        pointer-events: none;
        background: var(--surface);
        border: 1px solid var(--border-strong);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-lg);
        padding: 0.65rem 0.85rem;
        min-width: 220px;
        max-width: 300px;
        opacity: 0;
        transform: translateY(4px);
        transition: opacity 0.15s ease, transform 0.15s ease;
        font-size: 0.8rem;
        line-height: 1.5;
    }
    .mat-preview.visible {
        opacity: 1;
        transform: translateY(0);
    }
    .mat-preview-name {
        font-family: var(--font-display);
        font-size: 0.95rem;
        color: var(--text-primary);
        margin-bottom: 0.3rem;
    }
    .mat-preview-role {
        display: inline-block;
        font-size: 0.65rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        padding: 0.1rem 0.45rem;
        border-radius: var(--radius-full);
        margin-left: 0.4rem;
        vertical-align: middle;
    }
    .mat-preview-role.top { background: rgba(122,154,126,0.15); color: var(--sage); }
    .mat-preview-role.mid { background: rgba(200,148,62,0.15); color: var(--amber); }
    .mat-preview-role.base { background: rgba(139,107,130,0.15); color: var(--plum); }
    .mat-preview-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.15rem 0;
        color: var(--text-secondary);
    }
    .mat-preview-row + .mat-preview-row {
        border-top: 1px solid var(--border);
    }
    .mat-preview-label {
        color: var(--text-muted);
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }
    .mat-preview-val {
        font-family: var(--font-mono);
        font-size: 0.78rem;
        color: var(--text-primary);
    }

    /* ═══ Page loading bar ═════════════════════════════════════════════ */

    .nav-progress {
        position: fixed;
        top: 0;
        left: 0;
        height: 3px;
        width: 0;
        z-index: 10000;
        background: linear-gradient(90deg, var(--rose-gold), var(--sage));
        transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        pointer-events: none;
    }
    .nav-progress.running { width: 70%; transition-duration: 8s; }
    .nav-progress.done    { width: 100%; transition-duration: 0.2s; }
    .nav-progress.hide    { opacity: 0; transition: opacity 0.3s ease 0.15s; }

    /* ═══ Pipette drop loader (universal small loader) ═════════════════ */
    /* The brand mark in motion. Uses the real corner-logo pixels, split into
       a static pipette layer and a separate drop layer (img/loader/*.png,
       produced by build_extract_loader.py). The drop hangs from the tip and
       breathes while work is underway, occasionally sheds one, and releases a
       final satisfying drop on completion (.is-releasing). Sized in em so one
       component serves both buttons and large surfaces; the light/white logo
       variants swap with the theme, exactly like the navbar mark.
       The %s below are the pipette/drop position within the logo's tight
       bounding box (union 1153 x 1819 in FragranceEngine.Icon1.png). */

    .fe-visually-hidden {
        position: absolute !important;
        width: 1px; height: 1px;
        margin: -1px; padding: 0; border: 0;
        overflow: hidden; white-space: nowrap;
        clip: rect(0 0 0 0); clip-path: inset(50%);
    }

    .fe-drop-loader {
        display: inline-flex;
        align-items: center;
        gap: 0.5em;
        vertical-align: middle;
        line-height: 1;
    }
    .fe-drop-loader__label {
        font-size: 0.95em;
        letter-spacing: 0.01em;
    }
    .fe-drop-loader__art {
        position: relative;
        height: 1.3em;
        width: 0.824em;          /* 1.3em x (1153 / 1819) preserves logo aspect */
        flex: 0 0 auto;
    }
    .fe-drop-loader__pipette,
    .fe-drop-loader__drop,
    .fe-drop-loader__ghost {
        position: absolute;
        background-repeat: no-repeat;
        background-position: center;
        background-size: 100% 100%;
    }
    .fe-drop-loader__pipette {
        left: 0; top: 0;
        width: 98.7%; height: 77.9%;
        background-image: url("../img/loader/pipette.png");
    }
    .fe-drop-loader__drop,
    .fe-drop-loader__ghost {
        left: 78.1%; top: 79.8%;
        width: 21.9%; height: 20.2%;
        background-image: url("../img/loader/drop.png");
        transform-origin: 50% 0%;
    }
    .fe-drop-loader__ghost { opacity: 0; }

    [data-theme="dark"] .fe-drop-loader__pipette {
        background-image: url("../img/loader/pipette-white.png");
    }
    [data-theme="dark"] .fe-drop-loader__drop,
    [data-theme="dark"] .fe-drop-loader__ghost {
        background-image: url("../img/loader/drop-white.png");
    }

    .fe-drop-loader__drop  { animation: fe-drop-breathe 1.5s var(--ease-out) infinite; }
    .fe-drop-loader__ghost { animation: fe-drop-shed 4.8s ease-in infinite; }

    @keyframes fe-drop-breathe {
        0%, 100% { transform: translateY(0) scale(0.9);      opacity: 0.82; }
        50%      { transform: translateY(0.04em) scale(1.06); opacity: 1; }
    }
    /* occasional shed: idle at the tip most of the cycle, then one falls away */
    @keyframes fe-drop-shed {
        0%, 80%  { transform: translateY(0) scale(0.82);    opacity: 0; }
        86%      { opacity: 0.9; }
        100%     { transform: translateY(0.6em) scale(0.95); opacity: 0; }
    }

    /* the satisfying ender: the held drop swells, detaches, falls and fades */
    .fe-drop-loader.is-releasing .fe-drop-loader__ghost { animation: none; opacity: 0; }
    .fe-drop-loader.is-releasing .fe-drop-loader__drop  {
        animation: fe-drop-release 0.6s var(--ease-out) forwards;
    }
    @keyframes fe-drop-release {
        0%   { transform: translateY(0) scale(1);          opacity: 1; }
        24%  { transform: translateY(-0.02em) scale(1.12); opacity: 1; }
        100% { transform: translateY(0.72em) scale(0.9);   opacity: 0; }
    }

    @media (prefers-reduced-motion: reduce) {
        .fe-drop-loader__drop  { animation: fe-drop-fade 1.6s ease-in-out infinite; }
        .fe-drop-loader__ghost { display: none; }
        .fe-drop-loader.is-releasing .fe-drop-loader__drop { animation: none; opacity: 1; }
    }
    @keyframes fe-drop-fade { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
