/* Color country-flag emoji everywhere, including Windows/older browsers. */
        @font-face {
            font-family: 'Twemoji Country Flags';
            src: url("../fonts/TwemojiCountryFlags.a19faae092f7.woff2") format('woff2');
            unicode-range: U+1F1E6-1F1FF;
            font-display: swap;
        }

        :root {
            --primary: #2a2a2a; /* Grey opaque */
            --primary-dark: #1a1a1a;
            --success: #10b981;
            --danger: #ef4444;
            --warning: #f59e0b;
            --dark: #0f172a;
            --gray: #64748b;
            --light-gray: #181818;
            --border: #262626;
            --white: #ffffff;
            --bg-primary: #0a0a0a;
            --bg-secondary: #121212;
            --bg-tertiary: #181818;
            --text-primary: #f8fafc;
            --text-secondary: #94a3b8;
            background-color: #0a0a0a;
            color: #f8fafc;
            /* 'Twemoji Country Flags' + 'Noto Color Emoji' sit in the stack as
               glyph-only fallbacks: Latin text is served by Inter, but any flag
               or pictographic emoji falls through to a bundled vector color font
               so it renders identically even on browsers with no emoji font
               (e.g. Windows Chrome flags, minimal Linux, older Android). */
            --font-sans: 'Manrope', 'Inter', 'Twemoji Country Flags', 'Noto Color Emoji', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            --font-heading: 'Space Grotesk', 'Outfit', var(--font-sans);
            --font-mono: 'JetBrains Mono', 'Twemoji Country Flags', 'Noto Color Emoji', 'Courier New', Courier, monospace;
            --header-bg: rgba(255, 255, 255, 0.75);
            --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
            --glow-color: rgba(42, 42, 42, 0.08);
            /* Design surface/text scale (light-theme fallbacks; dark overrides below) */
            --surface-raised: #ffffff;
            --surface-inset: #f1f5f9;
            --surface-footer: #f8fafc;
            --text-muted: #64748b;
            --text-faint: #94a3b8;
            --cta-gradient: linear-gradient(135deg, #ffb066, #ff8438);

            /* Spacing scale (rhythm established by the blog post page) */
            --nav-height: 64px;
            --header-offset: calc(var(--nav-height) + 1px);
            --content-gap-top: 2.5rem;
            --content-gap-bottom: 4rem;
            --breadcrumb-gap: 2.5rem;
            --hero-gap: 3rem;
            --section-padding: 3rem;
            --section-gap-lg: 5rem;
        }
        
        [data-theme="dark"] {
            --primary: #ff9a5c; /* Network-control-room orange */
            --primary-dark: #ff8438;
            --success: #34d399;
            --danger: #ef4444;
            --warning: #f59e0b;
            --dark: #f8fafc;
            --gray: #94a3b8;
            --light-gray: #2a2a2a;
            --border: rgba(255, 255, 255, 0.09);
            --white: #121212;
            --bg-primary: #121212;   /* page */
            --bg-secondary: #1e1e1e;  /* cards/sections */
            --bg-tertiary: #2a2a2a;   /* chips/inputs/hover */
            --surface-raised: #232323; /* raised cards (configurator) */
            --surface-inset: #191919;  /* inset panels (totals) */
            --surface-footer: #0f0f0f; /* footer */
            --text-primary: #f6f7f8;
            --text-secondary: #9a9ea3;
            --text-muted: #8a9097;
            --text-faint: #6b7176;
            --header-bg: rgba(18, 18, 18, 0.75);
            --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
            --glow-color: rgba(255, 154, 92, 0.13);
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        html {
            overflow-x: clip;
            width: 100%;
            scroll-behavior: smooth;
        }
        
        body {
            font-family: var(--font-sans);
            line-height: 1.6;
            color: var(--text-primary);
            background: var(--bg-primary);
            transition: background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            overflow-x: clip;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 0 24px;
            width: 100%;
        }

        /*
         * Shared breadcrumb component -- used site-wide (blog post, blog
         * category, country, operator pages) so every page gets the exact
         * same sticky full-bleed bar directly under the navbar.
         */
        .blog-breadcrumb {
            display: flex;
            /* Override the generic `nav { justify-content: space-between }`
               rule below -- without this the breadcrumb nav inherits that
               site-header rule and gets pushed apart instead of staying
               left-aligned. */
            justify-content: flex-start;
            align-items: center;
            gap: 0.5rem;
            flex-wrap: wrap;
            font-family: var(--font-mono);
            font-size: 0.72rem;
            letter-spacing: 0.01em;
            /* Full-bleed: escape the centered .container so the bar always
               spans the whole viewport, whatever wrapper it's rendered in. */
            width: 100vw;
            margin-left: calc(50% - 50vw);
            /* Pull the bar up through <main>'s top padding so it sits flush
               against the navbar at page load -- no strip of page background
               shows between the two bars. */
            margin-top: calc(-1 * var(--content-gap-top));
            text-align: left;
            position: sticky;
            /* Sits 1px under the navbar's bottom edge so no hairline seam
               shows between the two bars while stuck. */
            top: calc(var(--header-offset) - 2px);
            z-index: 95;
            background: var(--bg-primary);
            border-bottom: 1px solid var(--border);
            padding: 0.75rem 0;
            margin-bottom: var(--breadcrumb-gap);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1), padding 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }

        /* Once the page scrolls (header gains .scrolled), collapse the
           stuck breadcrumb to roughly two-thirds of its resting height. */
        header.scrolled ~ main .blog-breadcrumb {
            height: calc(var(--nav-height) * 0.65);
            padding: 0.4rem 0;
        }

        /*
         * Shared inner row used by both breadcrumb variants. Pages that
         * need extra width/padding (e.g. a full-bleed sticky bar) add it
         * on top of this via their own page-specific override.
         */
        .breadcrumb-container {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            gap: 0.5rem;
            flex-wrap: wrap;
            min-width: 0;
            width: 100%;
            /* Keep the row's content aligned with the page container even
               though the bar itself is full-bleed. */
            max-width: 1400px;
            margin: 0 auto;
            padding: 0 24px;
            box-sizing: border-box;
        }

        .blog-breadcrumb a {
            color: var(--text-muted);
            text-decoration: none;
            font-weight: 500;
            transition: color 0.2s;
        }

        .blog-breadcrumb a:hover {
            color: var(--text-secondary);
            text-decoration: none;
        }

        .blog-breadcrumb span.sep {
            color: var(--text-faint);
            opacity: 1;
            font-size: 0.72rem;
        }

        .blog-breadcrumb span.current {
            color: var(--text-primary);
            font-weight: 500;
            cursor: default;
            min-width: 0;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        /* Promo Banner */
        .promo-banner {
            background: #000000;
            color: #ffffff;
            padding: 0.35rem 0;
            height: 40px;
            position: relative;
            font-size: 0.8rem;
            font-family: var(--font-sans);
            overflow: hidden;
            display: flex;
            align-items: center;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            z-index: 60;
        }

        /* Fully collapses the banner's box (not just its content) once
           closed, so it stops reserving its 40px of vertical space. Zero-flicker. */
        html.promo-banner-closed #promoBanner,
        html.promo-banner-closed .promo-banner,
        .promo-banner.hidden {
            display: none !important;
            height: 0 !important;
            min-height: 0 !important;
            padding: 0 !important;
            margin: 0 !important;
            border: 0 !important;
            opacity: 0 !important;
            pointer-events: none !important;
        }

        /* Modern smooth cross-fade page view-transitions */
        @view-transition {
            navigation: auto;
        }
        ::view-transition-old(root) {
            animation: 70ms ease-out both vtFadeOut;
        }
        ::view-transition-new(root) {
            animation: 100ms ease-in both vtFadeIn;
        }
        @keyframes vtFadeOut {
            from { opacity: 1; }
            to { opacity: 0; }
        }
        @keyframes vtFadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        /* High-performance top progress bar for instant navigation */
        #pxm2-loader {
            position: fixed;
            top: 0;
            left: 0;
            height: 2.5px;
            width: 0;
            background: linear-gradient(90deg, #ff8438, #ffb066);
            z-index: 99999;
            transition: width 0.2s ease, opacity 0.25s ease;
            box-shadow: 0 0 10px rgba(255, 132, 56, 0.7);
            pointer-events: none;
        }
        
        .promo-content {
            display: flex;
            align-items: center;
            width: calc(100% - 58px);
            height: 100%;
            line-height: 1;
            overflow: hidden;
            white-space: nowrap;
            position: relative;
        }

        .promo-marquee {
            display: flex;
            width: max-content;
            animation: promoTicker 20s linear infinite;
            will-change: transform;
        }

        .promo-track {
            display: inline-flex;
            align-items: center;
            gap: 2rem;
            flex-shrink: 0;
            min-width: 50vw;
            justify-content: center;
            padding-right: 2rem;
        }

        .promo-banner:hover .promo-marquee {
            animation-play-state: paused;
        }
        
        .promo-icon {
            display: inline-flex;
            align-items: center;
            opacity: 0.8;
            color: var(--primary);
        }

        .promo-flag {
            vertical-align: -0.1em;
            margin: 0 0.2em;
        }
        
        .promo-text {
            font-family: var(--font-mono);
            font-weight: 500;
            letter-spacing: 0.01em;
            color: #e2e8f0;
        }
        
        .promo-link {
            color: #ffffff;
            text-decoration: none;
            font-weight: 600;
            font-size: 0.75rem;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 999px;
            padding: 0.25rem 0.75rem;
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            transition: all 0.2s ease;
            background: rgba(255, 255, 255, 0.05);
        }
        
        .promo-link:hover {
            background: #ffffff;
            color: #000000;
            border-color: #ffffff;
        }

        .promo-sep {
            color: rgba(255, 255, 255, 0.25);
        }
        
        .promo-close {
            position: absolute;
            right: 1rem;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(255, 255, 255, 0.1);
            border: none;
            color: #ffffff;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.9rem;
            line-height: 1;
            transition: all 0.2s;
        }
        
        .promo-close:hover {
            background: rgba(255, 255, 255, 0.25);
        }

        @keyframes promoTicker {
            0% {
                transform: translateX(0);
            }
            100% {
                transform: translateX(-33.3333%);
            }
        }
        

    /* Page-level ambient glow bubbles */
    .page-ambient {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 105vh;
        z-index: 0;
        pointer-events: none;
        overflow: hidden;
        -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 42%, transparent 82%);
                mask-image: linear-gradient(to bottom, #000 0%, #000 42%, transparent 82%);
    }

    .hero-glow-blob {
        position: absolute !important;
        border-radius: 50%;
        pointer-events: none;
        z-index: 0 !important;
        opacity: 0.22;
        will-change: transform;
        transform: translateZ(0);
    }

    .hero-blob-orange {
        width: 620px;
        height: 620px;
        background: radial-gradient(circle, rgba(255, 163, 102, 0.42) 0%, rgba(255, 163, 102, 0.16) 32%, transparent 68%);
        top: -4%;
        left: -2%;
        opacity: 0.5;
        animation: floatBlob1 22s cubic-bezier(0.37, 0, 0.63, 1) infinite;
    }

    .hero-blob-gray {
        width: 720px;
        height: 720px;
        background: radial-gradient(circle, rgba(148, 163, 184, 0.32) 0%, rgba(148, 163, 184, 0.12) 32%, transparent 68%);
        top: 12%;
        right: -3%;
        opacity: 0.45;
        animation: floatBlob2 28s cubic-bezier(0.37, 0, 0.63, 1) infinite;
    }

    .hero-blob-accent {
        width: 460px;
        height: 460px;
        background: radial-gradient(circle, rgba(249, 115, 22, 0.35) 0%, rgba(249, 115, 22, 0.12) 32%, transparent 68%);
        top: 38%;
        left: 38%;
        opacity: 0.4;
        animation: floatBlob3 34s cubic-bezier(0.45, 0, 0.55, 1) infinite;
    }

    @keyframes floatBlob1 {
        0%   { transform: translate(0, 0) scale(1); }
        22%  { transform: translate(130px, 70px) scale(1.14); }
        48%  { transform: translate(-70px, 150px) scale(0.9); }
        74%  { transform: translate(-140px, 55px) scale(1.08); }
        100% { transform: translate(0, 0) scale(1); }
    }

    @keyframes floatBlob2 {
        0%   { transform: translate(0, 0) scale(1); }
        26%  { transform: translate(-160px, -95px) scale(1.15); }
        54%  { transform: translate(110px, -130px) scale(0.88); }
        80%  { transform: translate(80px, 75px) scale(1.06); }
        100% { transform: translate(0, 0) scale(1); }
    }

    @keyframes floatBlob3 {
        0%   { transform: translate(0, 0) scale(1); }
        33%  { transform: translate(105px, -80px) scale(1.2); }
        66%  { transform: translate(-95px, 70px) scale(0.85); }
        100% { transform: translate(0, 0) scale(1); }
    }

    @media (prefers-reduced-motion: reduce) {
        .hero-glow-blob {
            animation: none !important;
        }
    }

    /* Modal Overlay & Modal Dialogs */
    .modal-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(10, 10, 10, 0.6);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        z-index: 9998;
        align-items: center;
        justify-content: center;
        padding: 1rem;
    }

    .modal-overlay.active {
        display: flex !important;
    }

    .dashboard-mobile-only {
        display: none;
    }

        /* Header */
        header {
            /* No hard divider at the top of the page so the header blends
               into the hero; the line fades in only once scrolled. */
            border-bottom: 1px solid transparent;
            position: sticky;
            top: 0;
            z-index: 100;
            transition: border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                        box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        }

        /* The blurred background lives on a ::before layer instead of on
           header itself. backdrop-filter (like transform/filter) makes an
           element the containing block for any position:fixed descendant --
           since the mobile nav drawer (#navLinks) and its overlay live
           inside <header>, that turned their "fixed" positioning into
           something anchored to the header box instead of the viewport,
           which is why the drawer could jump/vanish while the page
           scrolled. Keeping backdrop-filter off header keeps header out of
           that containing-block chain. */
        header::before {
            content: '';
            position: absolute;
            inset: 0;
            z-index: -1;
            background: var(--header-bg);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            transition: background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        }

        header.scrolled {
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
            border-color: rgba(255, 255, 255, 0.12);
        }

        [data-theme="dark"] header.scrolled::before {
            background: rgba(30, 30, 30, 0.85);
        }

        [data-theme="light"] header.scrolled::before {
            background: rgba(255, 255, 255, 0.85);
        }
        
        nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.75rem 0;
            height: var(--nav-height);
        }
        
        /* Logo Letters Animation */
        .logo {
            display: flex;
            align-items: center;
            text-decoration: none;
            font-family: var(--font-heading);
            font-weight: 800;
            font-size: 1.6rem;
            letter-spacing: -0.02em;
            color: var(--text-primary);
            position: relative;
        }

        .logo-pulse-dot {
            width: 9px;
            height: 9px;
            border-radius: 50%;
            background: var(--primary);
            box-shadow: 0 0 10px var(--glow-color);
            margin-right: 9px;
            flex-shrink: 0;
            animation: logoPulse 2.4s ease-in-out infinite;
        }

        @keyframes logoPulse {
            0%, 100% { opacity: 0.4; }
            50% { opacity: 1; }
        }

        @media (prefers-reduced-motion: reduce) {
            .logo-pulse-dot { animation: none; opacity: 1; }
        }

        .logo-letters {
            display: inline-flex;
            align-items: center;
        }

        .logo-letter {
            display: inline-block;
            transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            will-change: transform;
            color: var(--primary);
        }

        .logo:hover .logo-letter {
            transform: translateY(-4px);
        }
        
        .nav-links {
            display: flex;
            gap: 0.5rem;
            list-style: none;
            align-items: center;
        }

        .nav-links li {
            position: relative;
        }
        
        .nav-links a {
            color: var(--text-secondary);
            text-decoration: none;
            font-weight: 500;
            font-size: 0.85rem;
            padding: 0.5rem 1rem;
            border-radius: 999px;
            transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
            display: inline-flex;
            align-items: center;
        }
        
        .nav-links a:hover {
            color: var(--text-primary);
            background: rgba(255, 255, 255, 0.06);
        }

        .nav-links a.active {
            color: var(--text-primary);
            background: rgba(255, 255, 255, 0.08);
            font-weight: 600;
        }

        [data-theme="light"] .nav-links a:hover,
        [data-theme="light"] .nav-links a.active {
            background: var(--bg-secondary);
        }

        .nav-dropdown-menu {
            position: absolute;
            top: calc(100% + 0.5rem);
            left: 50%;
            transform: translateX(-50%) translateY(8px);
            min-width: 200px;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 12px;
            box-shadow: var(--card-shadow);
            padding: 0.4rem;
            list-style: none;
            opacity: 0;
            visibility: hidden;
            transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
            z-index: 100;
        }

        .nav-dropdown:hover .nav-dropdown-menu,
        .nav-dropdown:focus-within .nav-dropdown-menu {
            opacity: 1;
            visibility: visible;
            transform: translateX(-50%) translateY(0);
        }

        .nav-dropdown-menu a {
            display: flex;
            padding: 0.5rem 0.75rem;
            border-radius: 8px;
            font-size: 0.82rem;
            color: var(--text-secondary);
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
            white-space: normal;
            overflow-wrap: anywhere;
            transition: all 0.2s;
        }

        .nav-dropdown-menu a:hover {
            background: var(--bg-tertiary);
            color: var(--text-primary);
        }

        /* Chevron toggle for the mobile accordion (see @media block below) --
           hidden on desktop, where hover/focus-within already reveals the
           dropdown, so it never appears next to "Proxies" or the language
           name in the desktop nav bar. */
        .nav-dropdown-row {
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }

        .nav-dropdown-toggle {
            display: none;
            align-items: center;
            justify-content: center;
            width: 2.25rem;
            height: 2.25rem;
            flex-shrink: 0;
            padding: 0;
            background: none;
            border: none;
            border-radius: 8px;
            color: var(--text-secondary);
            cursor: pointer;
        }

        .nav-dropdown-toggle:hover {
            background: var(--bg-secondary);
            color: var(--text-primary);
        }

        .nav-lang-caret {
            display: none;
            margin-left: auto;
            flex-shrink: 0;
        }

        .nav-dropdown-caret,
        .nav-lang-caret {
            transition: transform 0.2s ease;
        }

        .nav-dropdown-toggle[aria-expanded="true"] .nav-dropdown-caret,
        .nav-lang-current[aria-expanded="true"] .nav-lang-caret {
            transform: rotate(180deg);
        }

        /* Language switcher: reuses .nav-dropdown/.nav-dropdown-menu for the
           popup shell, but its options are <button>s inside <form>s (each
           submits its own language), not <a> tags -- browser default button
           chrome needs resetting to match the .nav-dropdown-menu a styling
           above instead of looking like a stray HTML form control. */
        .nav-lang-switcher .nav-lang-current {
            cursor: pointer;
            max-width: 100%;
            box-sizing: border-box;
        }

        .nav-lang-form {
            margin: 0;
            width: 100%;
        }

        .nav-lang-flag {
            /* Country-flag glyphs need the Twemoji fallback font on
               platforms (e.g. Windows) whose system emoji set lacks them. */
            font-family: 'Twemoji Country Flags', var(--font-sans);
            margin-right: 0.45rem;
        }

        .nav-lang-option {
            display: flex;
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
            padding: 0.5rem 0.75rem;
            border-radius: 8px;
            font-size: 0.82rem;
            font-family: inherit;
            color: var(--text-secondary);
            background: none;
            border: none;
            text-align: left;
            white-space: normal;
            overflow-wrap: anywhere;
            cursor: pointer;
            transition: all 0.2s;
        }

        .nav-lang-option:hover {
            background: var(--bg-tertiary);
            color: var(--text-primary);
        }

        .nav-lang-option.active {
            color: var(--text-primary);
            font-weight: 600;
            background: var(--bg-tertiary);
        }

        .nav-links .nav-logout-link {
            color: var(--danger);
        }

        .nav-links .nav-logout-link:hover {
            color: #ffffff;
            background: var(--danger);
        }

        /* Higher specificity than [data-theme="dark"] .btn-secondary's color
           rule, which would otherwise win the cascade tie and repaint the
           mobile dashboard-menu Logout button's text the default grey. */
        .nav-links .btn.nav-logout-link {
            color: var(--danger);
        }

        .nav-links .btn.nav-logout-link:hover {
            color: #ffffff;
            background: var(--danger);
        }
        
        /* Mobile Menu Toggle */
        .mobile-menu-toggle {
            display: none;
            background: none;
            border: none;
            cursor: pointer;
            color: var(--text-primary);
            padding: 0.5rem;
            z-index: 100;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            gap: 5px;
            width: 32px;
            height: 32px;
        }

        .hamburger-bar {
            display: block;
            width: 20px;
            height: 2px;
            background: currentColor;
            border-radius: 2px;
            transition: transform 0.25s ease, opacity 0.2s ease;
        }

        .mobile-menu-toggle.active .hamburger-bar:nth-child(1) {
            transform: translateY(7px) rotate(45deg);
        }
        .mobile-menu-toggle.active .hamburger-bar:nth-child(2) {
            opacity: 0;
        }
        .mobile-menu-toggle.active .hamburger-bar:nth-child(3) {
            transform: translateY(-7px) rotate(-45deg);
        }

        .mobile-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.45);
            z-index: 9998;
            cursor: pointer;
        }
        .mobile-overlay.active { display: block; }
        
        /* Buttons */
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0.6rem 1.25rem;
            border: 1px solid transparent;
            border-radius: 10px;
            font-weight: 600;
            font-size: 0.85rem;
            text-decoration: none;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            gap: 0.5rem;
        }
        
        .btn-primary {
            background: var(--primary);
            color: var(--white);
            border-color: var(--primary);
            box-shadow: 0 4px 14px var(--glow-color);
        }
        
        .btn-primary:hover {
            background: var(--primary-dark);
            border-color: var(--primary-dark);
            transform: translateY(-1px);
            box-shadow: 0 6px 20px var(--glow-color);
            color: var(--white);
        }
        
        .btn-secondary {
            background: var(--bg-secondary);
            color: var(--text-primary);
            border-color: var(--border);
        }
        
        .btn-secondary:hover {
            background: var(--bg-tertiary);
            transform: translateY(-1px);
        }
        
        .btn-sm {
            padding: 0.45rem 1rem;
            font-size: 0.8rem;
            border-radius: 8px;
        }
        
        /* Stock Badges - Global Styles */
        .stock-badge {
            display: inline-flex;
            align-items: center;
            padding: 0.2rem 0.5rem;
            border-radius: 6px;
            font-size: 0.72rem;
            font-weight: 600;
            border: 1px solid;
            line-height: 1;
            gap: 0.25rem;
        }
        
        .stock-available {
            background: rgba(16, 185, 129, 0.1);
            color: var(--success);
            border-color: rgba(16, 185, 129, 0.2);
        }
        
        .stock-low {
            background: rgba(245, 158, 11, 0.1);
            color: var(--warning);
            border-color: rgba(245, 158, 11, 0.2);
        }
        
        .stock-out {
            background: rgba(239, 68, 68, 0.1);
            color: var(--danger);
            border-color: rgba(239, 68, 68, 0.2);
        }
        
        /* Main Layout */
        main {
            padding: var(--content-gap-top) 0 var(--content-gap-bottom);
            min-height: calc(100vh - 110px - 280px);
            position: relative;
        }
        
        /* Messages & Alerts */
        .messages {
            margin-bottom: 2rem;
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }
        
        .alert {
            padding: 0.85rem 1.25rem;
            border-radius: 10px;
            border: 1px solid;
            font-size: 0.9rem;
            font-weight: 500;
        }
        
        .alert-success {
            background: rgba(16, 185, 129, 0.08);
            border-color: rgba(16, 185, 129, 0.2);
            color: var(--success);
        }
        
        .alert-error, .alert-danger {
            background: rgba(239, 68, 68, 0.08);
            border-color: rgba(239, 68, 68, 0.2);
            color: var(--danger);
        }

        .alert-warning {
            background: rgba(245, 158, 11, 0.08);
            border-color: rgba(245, 158, 11, 0.2);
            color: var(--warning);
        }
        
        /* Footer */
        footer {
            background: var(--bg-secondary);
            border-top: 1px solid var(--border);
            padding: 4rem 0 3rem;
            color: var(--text-secondary);
            font-size: 0.85rem;
            transition: background-color 0.3s, border-color 0.3s;
        }
        
        .footer-content {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 2rem;
            margin-bottom: 2rem;
        }
        
        .footer-section h3 {
            margin-bottom: 1rem;
            color: var(--primary);
        }
        
        .footer-links {
            list-style: none;
        }
        
        .footer-links a {
            color: var(--text-secondary);
            text-decoration: none;
            display: block;
            padding: 0.25rem 0;
            transition: color 0.3s;
        }
        
        .footer-links a:hover {
            color: var(--primary);
        }
        
        .contact-info {
            font-size: 0.95rem;
            line-height: 1.8;
        }
        
        .contact-info p {
            margin: 0.5rem 0;
            color: var(--text-secondary);
        }
        
        .contact-info a {
            color: var(--primary);
            text-decoration: none;
            cursor: pointer;
            transition: color 0.3s;
        }
        
        .contact-info a:hover {
            color: var(--primary-dark);
            text-decoration: underline;
        }
        
        .contact-info .copy-wechat {
            color: var(--primary);
            cursor: pointer;
            transition: color 0.3s;
        }
        
        .contact-info .copy-wechat:hover {
            color: var(--primary-dark);
            text-decoration: underline;
        }

        .contact-info .wechat-qr {
            display: block;
            width: 120px;
            height: 120px;
            margin-top: 0.5rem;
            border-radius: 8px;
            background: #fff;
            padding: 6px;
        }
        
        .footer-bottom {
            text-align: center;
            padding-top: 2rem;
            border-top: 1px solid var(--gray);
            color: var(--gray);
        }
        
        /* Messages */
        .messages {
            margin: 1rem 0;
        }
        
        .alert {
            padding: 1rem;
            border-radius: 4px;
            margin-bottom: 1rem;
        }
        
        .alert-success {
            background: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }
        
        .alert-error {
            background: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }
        
        .alert-warning {
            background: #fff3cd;
            color: #856404;
            border: 1px solid #ffeaa7;
        }
        
        /* Dark theme specific adjustments */
        [data-theme="dark"] .btn-primary {
            background: var(--primary);
            color: #1a1a1a;
        }
        
        [data-theme="dark"] .btn-primary:hover {
            background: var(--primary-dark);
        }
        
        [data-theme="dark"] .btn-secondary {
            background: var(--light-gray);
            color: var(--text-primary);
            border: 1px solid var(--border);
        }
        
        [data-theme="dark"] input,
        [data-theme="dark"] textarea,
        [data-theme="dark"] select {
            background: var(--light-gray);
            color: var(--text-primary);
            border-color: var(--border);
        }
        
        [data-theme="dark"] code {
            background: var(--light-gray);
            color: var(--primary);
        }
        
        /* Responsive */
        @media (max-width: 768px) {

            /* backdrop-filter blur combined with position:sticky and a
               z-index-layered child (the hamburger toggle) is a known
               WebKit/Blink compositing quirk -- the sticky layer can fail
               to repaint mid-scroll, making the toggle button intermittently
               invisible. Drop the blur on mobile (where this misbehaves and
               is least likely to be missed) and use a solid-enough
               background instead, applied unconditionally rather than only
               post-scroll so there's no transition window either. */
            header::before {
                backdrop-filter: none;
                -webkit-backdrop-filter: none;
            }

            [data-theme="dark"] header::before {
                background: rgba(20, 20, 20, 0.97);
            }

            [data-theme="light"] header::before {
                background: rgba(255, 255, 255, 0.97);
            }

            .container {
                padding: 0 1rem;
            }

            .breadcrumb-container {
                padding: 0 1rem;
            }

            .footer-content {
                grid-template-columns: 1fr;
                gap: 2rem;
            }
            
            .btn {
                font-size: 0.875rem;
                padding: 0.625rem 1rem;
            }
            
            
            .logo {
                font-size: 1.5rem;
            }
            
            /* Mobile Menu */
            .mobile-menu-toggle {
                display: flex;
                z-index: 10000;
                position: relative;
            }
            
            nav {
                display: flex;
                justify-content: space-between;
                align-items: center;
            }
            
            .nav-links {
                position: fixed;
                top: 0;
                right: -100%;
                height: 100vh;
                width: 280px;
                max-width: 100%;
                background: var(--bg-primary);
                flex-direction: column;
                padding: 5.5rem 2rem 2rem;
                gap: 1rem;
                box-shadow: -2px 0 10px rgba(0,0,0,0.3);
                transition: right 0.3s ease;
                z-index: 9999;
                align-items: flex-start;
                overflow-y: auto;
                overflow-x: hidden;
            }

            .nav-links.active {
                right: 0;
            }

            .nav-links li {
                width: 100%;
                max-width: 100%;
            }

            /* Country/language submenus collapse by default on mobile and
               expand in place when their toggle is tapped -- previously they
               were force-rendered open+inline, which for an uncapped country
               list meant a lot of wide always-visible content sitting inside
               the fixed-width drawer. */
            .nav-dropdown-menu {
                position: static;
                opacity: 1;
                visibility: visible;
                transform: none;
                min-width: 100%;
                max-width: 100%;
                max-height: 0;
                overflow: hidden;
                border: none;
                box-shadow: none;
                margin-top: 0;
                padding: 0 0.25rem;
                transition: max-height 0.25s ease, margin-top 0.25s ease, padding 0.25s ease;
            }

            .nav-dropdown-menu.open {
                max-height: 1000px;
                margin-top: 0.35rem;
                padding: 0.25rem;
                border: 1px solid var(--border);
            }

            /* Tapping a dropdown trigger focuses it, so the desktop
               `.nav-dropdown:focus-within .nav-dropdown-menu` rule above
               (higher specificity than the plain `.nav-dropdown-menu`
               reset just above) reapplies its translateX(-50%) centering
               even here -- shifting the now-static, full-width menu half
               its own width to the left, out past the drawer's left edge
               where `.nav-links`'s overflow-x:hidden clips it. Match that
               rule's selector so this override actually wins the cascade. */
            .nav-dropdown:hover .nav-dropdown-menu,
            .nav-dropdown:focus-within .nav-dropdown-menu {
                transform: none;
            }

            .nav-dropdown > a {
                margin-bottom: 0.15rem;
            }

            .nav-links a {
                display: block;
                padding: 0.75rem 1rem;
                width: 100%;
                border-radius: 8px;
            }

            .nav-dropdown-row > a {
                width: auto;
                flex: 1;
                min-width: 0;
            }

            .nav-dropdown-toggle {
                display: flex;
            }

            .nav-lang-switcher .nav-lang-current {
                display: flex;
                align-items: center;
            }

            .nav-lang-caret {
                display: inline-flex;
            }

            .nav-lang-option {
                padding: 0.75rem 1rem;
            }

            .nav-links .nav-logout-item {
                margin-top: 0.4rem;
                padding-top: 0.7rem;
                border-top: 1px solid var(--border);
            }

            /* On the dashboard page, mobile shows the dashboard's own
               section menu (injected by injectDashboardMobileMenuLinks())
               instead of these -- see .dashboard-mobile-only. */
            .nav-links .nav-dashboard-desktop-item {
                display: none;
            }

            .nav-links .nav-logout-link {
                display: block;
                width: 100%;
                text-align: left;
                padding: 0.75rem 1rem;
                border-radius: 8px;
            }
            
            .nav-links a.active::after {
                display: none;
            }
            
            .nav-links a.active {
                background: var(--light-gray);
            }
            
            .nav-links a:hover {
                background: var(--light-gray);
            }
            
            .nav-links .btn {
                width: 100%;
                text-align: center;
            }
            
            .theme-toggle {
                width: 100%;
                justify-content: center;
                padding: 0.5rem;
            }
            
            
            footer {
                padding: 2rem 0;
            }
        }
