/* =========================================
   PSI Kyiv STEM Student Portal
   Brand-compliant styles from PSI-Kyiv-Brand-Book
   ========================================= */

/* =========================================
   FONT DECLARATIONS
   ========================================= */
@font-face {
    font-family: 'Navigo';
    src: local('Navigo'), local('navigo');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'Navigo';
    src: local('Navigo SemiBold'), local('navigo-semibold');
    font-weight: 600;
    font-style: normal;
}
@font-face {
    font-family: 'Navigo';
    src: local('Navigo Bold'), local('navigo-bold');
    font-weight: 700;
    font-style: normal;
}
@font-face {
    font-family: 'Navigo';
    src: local('Navigo ExtraBold'), local('navigo-extrabold');
    font-weight: 800;
    font-style: normal;
}

/* =========================================
   CSS CUSTOM PROPERTIES
   ========================================= */
:root {
    /* Primary Brand Colors */
    --primary-blue: #003DA5;
    --dark-blue: #001452;
    --mint: #AFDFE0;

    /* Secondary Colors - Purples */
    --purple-extra-dark: #291849;
    --purple-medium: #63539D;
    --purple-light: #A18DBE;

    /* Secondary Colors - Tomato Reds */
    --tomato-dark: #69270A;
    --tomato-medium: #E1633B;
    --tomato-light: #EB9B73;

    /* Secondary Colors - Pinks */
    --pink-violet: #843648;
    --pink: #F0B8B4;
    --pink-misty: #F8E1DE;

    /* Secondary Colors - Warm */
    --chocolate: #321800;
    --orange: #EA903D;
    --amber: #FACC46;

    /* Digital Colors */
    --digital-dark: #020D2A;
    --digital-key1: #012FD7;
    --digital-key2: #000871;
    --digital-light: #EEEFF1;
    --digital-blue-2: #2C65F6;
    --digital-blue-3: #43AFFC;
    --digital-blue-4: #A2D5FE;
    --digital-blue-5: #E0E9F1;
    --digital-yellow: #F9DD17;

    /* Typography */
    --font-primary: 'Navigo', -apple-system, system-ui, 'Helvetica Neue', 'Calibri Light', 'Roboto', sans-serif;
    --font-accent: 'Lora', Georgia, serif;

    /* Spacing */
    --section-padding: 2rem;
    --container-max: 1200px;

    /* Shadows */
    --shadow-large: 0px 8px 56px rgba(17,17,26,0.1), 0px 32px 140px rgba(17,17,26,0.1);
    --shadow-small: 0px 1px 4px rgba(17,17,26,0.05), 0px 0px 8px rgba(17,17,26,0.05);
    --shadow-card: 0 2px 12px rgba(0,20,82,0.08);
    --shadow-lg: 0 8px 24px rgba(0,20,82,0.12);
    --shadow: 0 2px 8px rgba(0,20,82,0.08);

    /* Semantic tokens */
    --surface: #f4f6fa;
    --border: #dee2e8;
    --text: #1a1a2e;
    --text-muted: #555b63;
    --radius: 8px;
    --transition: 0.2s ease;

    /* Font alias */
    --font-body: var(--font-primary);
}

/* =========================================
   RESET & BASE STYLES
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-primary);
    font-weight: 400;
    line-height: 1.5;
    color: var(--digital-dark);
    background: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body > .footer {
    margin-top: auto;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 1rem;
}

h1 { font-size: 3.5rem; font-weight: 800; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p { margin-bottom: 1rem; }

a {
    color: var(--digital-key1);
    text-decoration: none;
    transition: all 200ms ease;
}

a:hover {
    color: var(--primary-blue);
}

/* Prevent generic a:hover from overriding button text colors */
a.btn-solid:hover,
a.btn-outline:hover,
a.btn-primary:hover {
    color: #fff;
}

img { max-width: 100%; height: auto; display: block; }

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 768px) {
    .container { padding: 0 2rem; }
}

@media (min-width: 1200px) {
    .container { padding: 0; }
}

/* =========================================
   NAVIGATION (from Brand Book)
   ========================================= */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 20, 82, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    padding: 1rem 2rem;
    box-shadow: var(--shadow-small);
    transition: transform 0.3s ease;
}

/* Prevent navbar FOUC — applied by inline script before paint */
body.nav-is-hidden .nav {
    transform: translateY(-100%) !important;
}

body.nav-is-hidden .nav-show-btn {
    transform: translateX(-50%) translateY(0) !important;
}

.lang-switch-form { display: inline-flex; margin-left: 0.25rem; }
.lang-switch-btn {
    background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25);
    color: white; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.5px;
    padding: 0.2rem 0.5rem; border-radius: 4px; cursor: pointer; transition: background 0.2s;
}
.lang-switch-btn:hover { background: rgba(255,255,255,0.3); }

/* Hero lab app buttons */
.hero-lab-apps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.6rem 0;
}
.hero-lab-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    color: #fff;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
    backdrop-filter: blur(4px);
}
.hero-lab-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    color: #fff;
}
.hero-lab-icon {
    font-size: 1.1rem;
}
.hero-lab-name {
    line-height: 1;
}
@media (max-width: 480px) {
    .hero-lab-apps {
        gap: 0.35rem;
    }
    .hero-lab-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
}

/* Nav quick actions (search + lab apps) */
.nav-quick-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    margin-right: 0.75rem;
}

.nav-container.menu-open .nav-quick-actions {
    display: none;
}
.nav-quick-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}
.nav-quick-btn:hover {
    background: rgba(255,255,255,0.25);
    color: #fff;
    transform: scale(1.08);
}
/* Fixed Search Button — top right corner */
.labs-scroll-fixed {
    position: fixed;
    top: 0.6rem;
    right: 1rem;
    z-index: 1100;
}
.labs-scroll-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(0, 61, 165, 0.15);
    border-radius: 10px;
    color: var(--primary-blue, #003DA5);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-primary, 'Inter', sans-serif);
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(0, 20, 82, 0.08);
    transition: all 0.2s ease;
}
.labs-scroll-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 61, 165, 0.15);
    border-color: var(--primary-blue, #003DA5);
    background: rgba(255, 255, 255, 0.97);
}
.labs-scroll-btn:active {
    transform: scale(0.97);
}
.labs-scroll-icon {
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
}
.labs-scroll-label {
    line-height: 1;
    opacity: 0.7;
}
.labs-scroll-btn .search-shortcut-hint {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    background: rgba(0, 61, 165, 0.08);
    border-radius: 4px;
    color: rgba(0, 61, 165, 0.5);
    font-family: var(--font-mono, monospace);
    margin-left: 0.15rem;
}

/* Dark mode */
body.dark-mode .labs-scroll-btn {
    background: rgba(22, 27, 34, 0.9);
    border-color: #30363d;
    color: #e6edf3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
body.dark-mode .labs-scroll-btn:hover {
    border-color: #388bfd;
    box-shadow: 0 4px 16px rgba(56, 139, 253, 0.15);
    background: rgba(22, 27, 34, 0.95);
}
body.dark-mode .labs-scroll-btn .search-shortcut-hint {
    background: rgba(56, 139, 253, 0.1);
    color: #58a6ff;
}
body.dark-mode .labs-scroll-label { opacity: 0.6; }

/* Elder Scroll style parchment menu */
.nav-labs-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    background: linear-gradient(170deg, #f5e6c8 0%, #e8d5a8 30%, #f0debb 60%, #e2ca96 100%);
    border: 3px solid #8b6914;
    box-shadow:
        0 15px 50px rgba(0,0,0,0.35),
        inset 0 0 30px rgba(139,105,20,0.15),
        0 0 15px rgba(139,105,20,0.2);
    border-radius: 4px;
    z-index: 1001;
    padding: 0;
    transform-origin: top center;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}
.nav-labs-menu::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 28px, rgba(139,105,20,0.06) 28px, rgba(139,105,20,0.06) 29px),
        radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.2), transparent 60%),
        radial-gradient(ellipse at 80% 80%, rgba(101,67,0,0.08), transparent 50%);
    pointer-events: none;
    z-index: 1;
}
/* Scroll roll top decoration */
.nav-labs-menu::before {
    content: '⚔️ LABORATORY SCROLLS ⚔️';
    display: block;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #5a3e0a;
    padding: 0.6rem 0.5rem 0.3rem;
    border-bottom: 2px solid rgba(139,105,20,0.25);
    background: linear-gradient(180deg, rgba(201,168,76,0.25), transparent);
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
    font-family: Georgia, 'Times New Roman', serif;
}
.nav-labs-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    text-decoration: none;
    color: #3d2b08;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
    border-bottom: 1px solid rgba(139,105,20,0.12);
}
.nav-labs-item:last-child {
    border-bottom: none;
}
.nav-labs-item:hover {
    background: linear-gradient(90deg, rgba(201,168,76,0.3), rgba(201,168,76,0.1));
    text-shadow: 0 0 8px rgba(201,168,76,0.4);
    transform: translateX(3px);
}
.nav-labs-item:hover .nav-labs-icon {
    transform: scale(1.2) rotate(-5deg);
    filter: drop-shadow(0 0 4px rgba(201,168,76,0.5));
}
.nav-labs-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 34px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.nav-labs-item strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    color: #2a1d05;
    font-family: Georgia, 'Times New Roman', serif;
    letter-spacing: 0.02em;
}
.nav-labs-item small {
    font-size: 0.68rem;
    color: #7a5c20;
    line-height: 1.2;
    font-style: italic;
}
/* Scroll bottom seal */
.nav-labs-menu-seal {
    text-align: center;
    padding: 0.35rem;
    font-size: 0.55rem;
    color: #8b6914;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-top: 2px solid rgba(139,105,20,0.2);
    background: linear-gradient(0deg, rgba(201,168,76,0.2), transparent);
    font-family: Georgia, 'Times New Roman', serif;
    position: relative;
    z-index: 2;
}

/* Pulsing glow for labs button */
@keyframes lab-btn-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201,168,76,0.7); }
    50% { box-shadow: 0 0 0 8px rgba(201,168,76,0); }
}

/* Mobile: smaller scroll button */
@media (max-width: 768px) {
    .labs-scroll-fixed {
        top: 0.5rem;
        right: 0.5rem;
    }
    .labs-scroll-label {
        display: none;
    }
    .labs-scroll-btn {
        padding: 0.3rem 0.5rem;
    }
    .nav-labs-menu {
        width: 200px;
    }
}
/* Print: hide scroll */
@media print {
    .labs-scroll-fixed { display: none !important; }
}
@media (max-width: 768px) {
    .nav-quick-actions {
        margin-right: 0.3rem;
        gap: 0.3rem;
    }
    .nav-quick-btn {
        width: 30px;
        height: 30px;
    }
    .nav-labs-menu {
        right: -2rem;
        width: 200px;
    }
}

.nav-hide-btn {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    background: rgba(0, 20, 82, 0.9);
    color: white;
    border: none;
    border-radius: 0 0 8px 8px;
    padding: 0.2rem 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    transition: background 0.2s;
    z-index: 1001;
}

.nav-hide-btn:hover {
    background: rgba(0, 20, 82, 1);
}

.nav-show-btn {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    z-index: 1001;
    background: rgba(0, 20, 82, 0.9);
    color: white;
    border: none;
    border-radius: 0 0 8px 8px;
    padding: 0.2rem 1.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.nav-show-btn.visible {
    transform: translateX(-50%) translateY(0);
}

.nav-show-btn:hover {
    background: rgba(0, 20, 82, 1);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
}

.nav-brand:hover { color: var(--mint); }

.nav-logo {
    height: 40px;
    width: auto;
}

.nav-logo-invert {
    filter: brightness(0) invert(1);
}

.nav-brand-text { color: white; }

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 200ms ease;
}

.nav-links a:hover {
    color: var(--mint);
    transform: translateY(-2px);
}

.nav-login-btn {
    background: var(--primary-blue) !important;
    color: white !important;
    padding: 0.5rem 1.5rem !important;
    border-radius: 8px;
}

.nav-login-btn:hover {
    background: var(--digital-key1) !important;
    transform: scale(1.05) !important;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 200ms;
}

/* =========================================
   HERO / COVER SECTION (from Brand Book)
   ========================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, rgba(0,61,165,0.75) 0%, rgba(0,20,82,0.8) 50%, rgba(41,24,73,0.85) 100%);
    color: white;
    text-align: center;
    padding: 8rem 2rem 4rem;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 50%, rgba(175,223,224,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(99,83,157,0.15) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    text-align: center;
    animation: fadeInUp 1.2s ease-out;
}

.hero-badge {
    width: 160px;
    height: auto;
    margin: 0 auto 2rem;
    display: block;
}

.hero-logo {
    width: 200px;
    height: auto;
    margin: 0 auto 3rem;
    display: block;
    animation: pulse 3s ease-in-out infinite;
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 1rem;
}

.hero-tagline {
    font-family: var(--font-accent);
    font-style: italic;
    font-size: 2rem;
    color: var(--mint);
    margin: 2rem 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: bounce 2s ease-in-out infinite;
}

/* =========================================
   GATEWAY - Non-authenticated landing (Moodle-style)
   ========================================= */
.gateway {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0,61,165,0.75) 0%, rgba(0,20,82,0.8) 50%, rgba(41,24,73,0.85) 100%);
    position: relative;
    overflow: hidden;
}

.gateway::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(175,223,224,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(99,83,157,0.15) 0%, transparent 50%);
}

.gateway-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 480px;
    padding: 2rem;
    animation: fadeInUp 1.2s ease-out;
}

.gateway-logo {
    width: 140px;
    height: auto;
    margin: 0 auto 2rem;
    animation: pulse 3s ease-in-out infinite;
}

.gateway-title {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.25rem;
}

.gateway-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gateway-tagline {
    font-family: var(--font-accent);
    font-style: italic;
    font-size: 1.4rem;
    color: var(--mint);
    margin-bottom: 3rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.gateway-login {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
}

.gateway-login h2 {
    font-size: 1.3rem;
    color: white;
    margin-bottom: 0.5rem;
}

.gateway-login p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 1.5rem;
}

.gateway-login .btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.05rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gateway-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.gateway-footer a {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    font-weight: 500;
}

.gateway-footer a:hover {
    color: var(--mint);
}

.gateway-footer span {
    color: rgba(255,255,255,0.3);
}

/* =========================================
   COMPACT HERO - Authenticated users
   ========================================= */
.hero-compact {
    min-height: auto;
    padding: 3.2rem 2rem 1.25rem;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    align-items: flex-start;
}

.hero-compact .hero-content {
    max-width: 800px;
    width: 100%;
}

.hero-compact h1 {
    font-size: 2rem;
    margin-bottom: 0.4rem;
}

.hero-compact .hero-subtitle {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

/* =========================================
   QUICK LINKS GRID - Authenticated dashboard
   ========================================= */
.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: var(--container-max);
    margin: 0 auto;
}

.quick-link-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-small);
    transition: all 300ms ease;
    color: var(--dark-blue);
    text-decoration: none;
}

.quick-link-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-large);
    color: var(--primary-blue);
}

.quick-link-card svg {
    margin: 0 auto 0.75rem;
    color: var(--primary-blue);
}

.quick-link-card h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.quick-link-card p {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

@media (max-width: 992px) {
    .quick-links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .gateway-title {
        font-size: 1.5rem;
    }

    .gateway-tagline {
        font-size: 1.1rem;
    }

    .gateway-login {
        padding: 1.5rem;
    }

    .hero-compact {
        padding: 3rem 1.5rem 1rem;
    }

    .hero-compact h1 {
        font-size: 1.5rem;
        margin-bottom: 0.3rem;
    }

    .quick-links-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .quick-link-card {
        padding: 1.25rem 1rem;
    }
}

/* =========================================
   BUTTONS (from Brand Book)
   ========================================= */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 200ms ease;
    border: 2px solid transparent;
    text-decoration: none;
}

.btn:hover {
    transform: scale(1.05);
}

.btn:active {
    transform: scale(1.02);
}

/* Brand button variants */
.btn-solid {
    background: var(--primary-blue);
    color: white;
}

.btn-solid:hover,
.btn-solid:focus {
    background: var(--dark-blue);
    color: #fff;
}
.btn-solid:focus-visible {
    background: var(--dark-blue);
    color: #fff;
}
.btn-solid:focus:not(:focus-visible) { outline: none; }

.btn-outline {
    background: transparent;
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-outline:hover,
.btn-outline:focus {
    background: var(--primary-blue);
    color: #fff;
}
.btn-outline:focus-visible {
    background: var(--primary-blue);
    color: #fff;
}
.btn-outline:focus:not(:focus-visible) { outline: none; }

.btn-transparent {
    background: transparent;
    color: var(--primary-blue);
    text-decoration: underline;
}

/* Border radius variants */
.btn-sharp { border-radius: 0; }
.btn-soft { border-radius: 4px; }
.btn-rounded { border-radius: 8px; }
.btn-pill { border-radius: 100px; }

/* Portal-specific button styles */
.btn-primary {
    background: var(--mint);
    color: var(--dark-blue);
    border-radius: 8px;
}

.btn-primary:hover {
    background: white;
    color: var(--dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: transparent;
    color: white;
    border-color: rgba(255,255,255,0.4);
    border-radius: 8px;
}

.btn-secondary:hover {
    border-color: var(--mint);
    color: var(--mint);
    transform: translateY(-2px);
}

/* =========================================
   SECTION STYLES (from Brand Book)
   ========================================= */
.section {
    padding: var(--section-padding) 2rem;
    position: relative;
}

.section-alt {
    background: var(--digital-light);
}

.section-dark {
    background: var(--dark-blue);
    color: white;
}

.section-gradient {
    background: linear-gradient(to bottom, rgba(0,20,82,0.65), rgba(0,20,82,0.92));
    color: white;
}

.section-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.section-label {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.section-dark .section-label,
.section-gradient .section-label {
    color: var(--mint);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.section-description {
    font-size: 0.95rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

.section-dark .section-description,
.section-gradient .section-description {
    color: rgba(255,255,255,0.8);
}

[data-widget="lab-services"] { padding-top: 1.5rem; padding-bottom: 1.5rem; }
[data-widget="lab-services"] .section-header { margin-bottom: 0.75rem; }
[data-widget="lab-services"] .section-title { font-size: 1.3rem; margin-bottom: 0.15rem; }
[data-widget="lab-services"] .section-description { font-size: 0.82rem; }

/* ---- Explore CTA Widget ---- */
.explore-cta-section {
    padding: 1rem 0 1.5rem;
    background: var(--digital-light);
}

.explore-cta {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    padding: 2.5rem 3rem;
    text-align: center;
    color: var(--digital-dark);
    box-shadow: var(--shadow-small);
    border: 1px solid rgba(0,61,165,0.06);
    transition: box-shadow 300ms ease;
}

.explore-cta:hover {
    box-shadow: var(--shadow-large);
}

.explore-cta-bg {
    display: none;
}

.explore-cta-content {
    position: relative;
    z-index: 1;
}

.explore-cta-icon {
    font-size: 2.2rem;
    margin-bottom: 0.6rem;
}

.explore-cta h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 0.4rem;
    color: var(--dark-blue);
}

.explore-cta p {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0 auto 1.25rem;
    max-width: 440px;
    line-height: 1.5;
}

.explore-cta-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.explore-cta-primary {
    background: var(--primary-blue) !important;
    color: #fff !important;
    border: none !important;
    padding: 0.65rem 1.8rem;
    font-size: 0.92rem;
    font-weight: 700;
    box-shadow: 0 2px 12px rgba(0,61,165,0.2);
    transition: all 250ms ease;
}

.explore-cta-primary:hover {
    background: var(--digital-key1) !important;
    box-shadow: 0 4px 20px rgba(0,61,165,0.3);
    transform: translateY(-2px);
}

.explore-cta-secondary {
    background: transparent !important;
    color: var(--primary-blue) !important;
    border: 1.5px solid var(--primary-blue) !important;
    padding: 0.65rem 1.8rem;
    font-size: 0.92rem;
    font-weight: 600;
    transition: all 250ms ease;
}

.explore-cta-secondary:hover {
    background: rgba(0,61,165,0.05) !important;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .explore-cta-section {
        padding: 0.5rem 0 1rem;
    }
    .explore-cta {
        padding: 1.25rem 1.25rem;
        border-radius: 12px;
        display: flex;
        align-items: center;
        gap: 1rem;
        text-align: left;
    }
    .explore-cta-icon {
        font-size: 1.5rem;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    .explore-cta h2 {
        font-size: 1rem;
        margin-bottom: 0.1rem;
    }
    .explore-cta p {
        font-size: 0.78rem;
        margin-bottom: 0.5rem;
        max-width: none;
    }
    .explore-cta-actions {
        gap: 0.5rem;
    }
    .explore-cta-primary,
    .explore-cta-secondary {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
    }
}

/* Backwards compat with simpler section headers */
.section-header h2 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--dark-blue);
    margin-bottom: 1.5rem;
}

.section-dark .section-header h2 {
    color: white;
}

.section-header p {
    font-size: 1.2rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

.section-dark .section-header p {
    color: rgba(255,255,255,0.8);
}

/* =========================================
   SERVICE CARDS (value-card pattern from Brand Book)
   ========================================= */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    max-width: var(--container-max);
    margin: 0 auto;
}

.service-card {
    background: white;
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-small);
    transition: all 300ms ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.service-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-large);
}

.service-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: white;
}

.service-card-icon svg {
    width: 24px;
    height: 24px;
}

.service-card h3 {
    font-size: 1.1rem;
    color: var(--dark-blue);
    margin-bottom: 0.35rem;
}

.service-card p {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.service-card-tagline {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-muted, #94a3b8);
    text-align: center;
}
body.dark-mode .service-card-tagline { color: #8b949e; }

.service-card-actions {
    margin-top: auto;
    padding-top: 0.75rem;
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
    justify-content: center;
    width: 100%;
}

.service-card-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    border: 2px solid transparent;
    text-decoration: none;
    transition: all 200ms ease;
    white-space: nowrap;
}

.service-card-actions .btn-solid {
    flex: 1 1 0;
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.service-card-actions .btn-solid:hover {
    background: var(--dark-blue);
    border-color: var(--dark-blue);
    color: #fff;
    transform: scale(1.05);
}

.service-card-actions .btn-outline {
    flex: 0 0 auto;
    background: transparent;
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.service-card-actions .btn-outline:hover {
    background: var(--primary-blue);
    color: #fff;
    transform: scale(1.05);
}

.service-card-actions .btn svg {
    flex-shrink: 0;
}

/* =========================================
   ANNOUNCEMENTS
   ========================================= */
.announcements-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.announcement-item {
    background: white;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-small);
    border-left: 4px solid var(--primary-blue);
    transition: all 300ms ease;
}

.announcement-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-large);
}

.announcement-item.pinned {
    border-left-color: var(--amber);
}

.announcement-item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--dark-blue);
}

.announcement-item h3 a {
    color: var(--dark-blue);
}

.announcement-item h3 a:hover {
    color: var(--primary-blue);
}

.announcement-date {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.5rem;
}

.announcement-body {
    color: #555;
    font-size: 0.95rem;
}

.pinned-badge {
    display: inline-block;
    background: var(--amber);
    color: var(--dark-blue);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 100px;
    margin-left: 0.5rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================
   CONTENT PAGES
   ========================================= */
.page-header {
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--digital-key2) 100%);
    color: white;
    padding: 140px 2rem 80px;
    text-align: center;
    position: relative;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 40%, rgba(175,223,224,0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(1,47,215,0.1) 0%, transparent 50%);
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    position: relative;
}

.page-header p {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.8);
    position: relative;
}

.page-content {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 3rem 2rem;
}

.page-content h2 { font-size: 1.8rem; margin-top: 2.5rem; color: var(--dark-blue); font-weight: 800; }
.page-content h3 { font-size: 1.4rem; margin-top: 1.5rem; color: var(--dark-blue); }
.page-content p { margin-bottom: 1rem; line-height: 1.7; }
.page-content ul, .page-content ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.page-content li { margin-bottom: 0.25rem; }
.page-content img { border-radius: 8px; margin: 1.5rem 0; box-shadow: var(--shadow-small); }

/* Code blocks (from Brand Book .code-block) */
.page-content pre,
.page-content code {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.page-content pre {
    background: var(--digital-dark);
    color: var(--mint);
    padding: 2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-large);
}

.page-content code {
    background: var(--digital-dark);
    color: var(--mint);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* =========================================
   MANUALS / VIDEOS INDEX (demo-card pattern)
   ========================================= */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.content-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-small);
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.content-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-large);
}

.content-card-body {
    padding: 1.5rem;
}

.content-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.content-card h3 a {
    color: var(--dark-blue);
}

.content-card h3 a:hover {
    color: var(--primary-blue);
}

.content-card .meta {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.5rem;
}

.content-card p {
    color: #666;
    font-size: 0.9rem;
}

/* Tags (from Brand Book demo-badge pattern) */
.tag {
    display: inline-block;
    background: var(--digital-blue-5);
    color: var(--primary-blue);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 100px;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================
   FAQ
   ========================================= */
.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--digital-light);
    padding: 1.5rem 0;
}

.faq-item h3 {
    font-size: 1.3rem;
    color: var(--dark-blue);
    margin-bottom: 0.75rem;
}

.faq-item div,
.faq-answer {
    color: #555;
    line-height: 1.7;
    font-size: 1.05rem;
}

.empty-state {
    text-align: center;
    color: #666;
    padding: 2rem;
    font-size: 1rem;
}

/* =========================================
   DASHBOARD
   ========================================= */
.dashboard-welcome {
    text-align: center;
    padding: 2rem 0 1rem;
}

.dashboard-welcome h2 {
    color: var(--dark-blue);
    font-size: 1.75rem;
}

/* ---- Mobile app slider (hidden on desktop) ---- */
.lab-apps-mobile {
    display: none;
    position: relative;
}

.lab-apps-track {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.25rem 0 0.5rem;
}

.lab-apps-track::-webkit-scrollbar {
    display: none;
}

.lab-app-tile {
    flex: 0 0 75%;
    max-width: 280px;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    text-decoration: none;
    color: inherit;
    transition: transform 150ms ease, box-shadow 150ms ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.lab-app-tile:hover {
    color: inherit;
    text-decoration: none;
}

.lab-app-tile:active {
    transform: scale(0.96);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.lab-app-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.lab-app-icon svg {
    width: 28px;
    height: 28px;
}

.lab-app-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dark-blue);
    text-align: center;
    line-height: 1.2;
}

.lab-app-desc {
    font-size: 0.78rem;
    color: #666;
    text-align: center;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Dot indicators */
.lab-apps-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 0.4rem 0 0;
}

.lab-apps-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0,61,165,0.2);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 200ms ease;
}

.lab-apps-dot.active {
    background: var(--primary-blue);
    width: 20px;
    border-radius: 4px;
}

body.dark-mode .lab-app-tile {
    background: #161b22;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

body.dark-mode .lab-app-name {
    color: #e6edf3;
}

body.dark-mode .lab-app-desc {
    color: #8b949e;
}

body.dark-mode .lab-app-icon {
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

body.dark-mode .lab-apps-dot {
    background: rgba(255,255,255,0.15);
}

body.dark-mode .lab-apps-dot.active {
    background: var(--digital-key);
}

/* =========================================
   ALERTS (from Brand Book)
   ========================================= */
.alert {
    padding: 0.875rem 1.25rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.alert-info {
    background: rgba(0,61,165,0.08);
    color: var(--primary-blue);
    border-left: 3px solid var(--primary-blue);
}

.alert-success {
    background: rgba(34,197,94,0.08);
    color: #16a34a;
    border-left: 3px solid #22c55e;
}

.alert-warning {
    background: rgba(234,144,61,0.08);
    color: #b45309;
    border-left: 3px solid var(--orange);
}

.alert-error {
    background: rgba(225,99,59,0.08);
    color: var(--tomato-dark);
    border-left: 3px solid var(--tomato-medium);
}

/* =========================================
   BREADCRUMBS (from Brand Book)
   ========================================= */
.breadcrumb {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #666;
    padding: 1rem 0;
    flex-wrap: wrap;
}

.breadcrumb ol {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    gap: 0.15rem;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.breadcrumb a {
    color: var(--primary-blue);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease;
}

.breadcrumb a:hover {
    color: var(--digital-key1);
    text-decoration: underline;
}

.breadcrumb-home {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.breadcrumb-home svg {
    flex-shrink: 0;
}

.breadcrumb-sep {
    color: #ccc;
    display: inline-flex;
    align-items: center;
    margin: 0 0.15rem;
}

.breadcrumb [aria-current="page"] {
    color: #666;
    font-weight: 400;
}

body.dark-mode .breadcrumb { color: #8b949e; }
body.dark-mode .breadcrumb a { color: #58a6ff; }
body.dark-mode .breadcrumb a:hover { color: #79c0ff; }
body.dark-mode .breadcrumb-sep { color: #484f58; }
body.dark-mode .breadcrumb [aria-current="page"] { color: #8b949e; }

/* =========================================
   SOCIAL LINKS (from Brand Book)
   ========================================= */
.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 8px;
    color: var(--dark-blue);
    font-weight: 600;
    box-shadow: var(--shadow-small);
    transition: all 300ms ease;
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-large);
    color: var(--primary-blue);
}

/* Social links in dark context */
.section-dark .social-link,
.section-gradient .social-link,
.footer .social-link {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    box-shadow: none;
}

.section-dark .social-link:hover,
.section-gradient .social-link:hover,
.footer .social-link:hover {
    background: rgba(255,255,255,0.1);
    color: var(--mint);
    box-shadow: none;
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
    background: rgba(0, 20, 82, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: rgba(255,255,255,0.65);
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

/* Decorative glow blob */
.footer-glow {
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 260px;
    background: radial-gradient(ellipse, rgba(1,47,215,0.12) 0%, rgba(175,223,224,0.06) 40%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.footer-inner {
    position: relative;
    z-index: 1;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
}

/* ---- Columns ---- */
.footer-columns {
    display: grid;
    grid-template-columns: 1.6fr repeat(4, 1fr);
    gap: 2rem;
    padding: 2.5rem 0 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.footer-col-brand {
    padding-right: 1rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.footer-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: contain;
    background: rgba(255,255,255,0.06);
    padding: 3px;
}

.footer-brand-name {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.footer-brand-desc {
    font-size: 0.82rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.45);
    margin: 0 0 0.75rem;
}

.footer-brand-tagline {
    display: inline-block;
    font-family: var(--font-accent);
    font-style: italic;
    font-size: 0.85rem;
    color: var(--mint);
    opacity: 0.8;
}

.footer-col-nav h4 {
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 0.85rem;
    opacity: 0.6;
}

.footer-col-nav a {
    display: block;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.88rem;
    padding: 0.25rem 0;
    transition: color 200ms ease, padding-left 200ms ease;
}

.footer-col-nav a:hover {
    color: var(--mint);
    padding-left: 4px;
}

/* Keyboard shortcut rows */
.footer-kbd-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.5);
}

.footer-kbd-row kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5em;
    height: 1.5em;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 5px;
    font-family: var(--font-primary);
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
}

.footer-kbd-row span {
    margin-left: 0.2rem;
    color: rgba(255,255,255,0.4);
}

/* ---- Bottom bar ---- */
.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1.2rem 0;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.35);
}

.footer-bottom a {
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    transition: color 200ms ease;
}

.footer-bottom a:hover {
    color: var(--mint);
}

.footer-dot {
    opacity: 0.25;
}

.footer-fact {
    cursor: pointer;
    transition: color 200ms ease;
}

.footer-fact:hover {
    color: var(--mint);
}

/* ---- Footer large screens ---- */
@media (min-width: 1200px) {
    .footer-inner {
        padding: 0 3rem;
    }
    .footer-columns {
        gap: 2.5rem;
        padding-bottom: 2.5rem;
    }
    .footer-glow {
        width: 900px;
        height: 350px;
    }
}

/* ---- Footer responsive ---- */
@media (max-width: 900px) {
    .footer-columns {
        grid-template-columns: 1fr 1fr;
        gap: 1.75rem;
    }
    .footer-col-brand {
        grid-column: 1 / -1;
        padding-right: 0;
    }
}

@media (max-width: 600px) {
    .footer-columns {
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem;
    }
    .footer-col-brand {
        grid-column: 1 / -1;
    }
}

/* =========================================
   SCROLL PROGRESS BAR (from Brand Book)
   ========================================= */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue), var(--mint), var(--digital-key1));
    z-index: 9999;
    width: 0%;
    transition: width 100ms ease-out;
}

/* =========================================
   SKIP NAVIGATION (WCAG accessibility)
   ========================================= */
.skip-nav {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--primary-blue);
    color: white;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    z-index: 10000;
    transition: top 200ms ease;
}

.skip-nav:focus {
    top: 0;
    color: white;
}
.skip-nav:focus-visible {
    top: 0;
    color: white;
}
.skip-nav:focus:not(:focus-visible) { outline: none; }

/* =========================================
   SCROLL REVEAL (from Brand Book)
   ========================================= */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   HERO META (from Brand Book)
   ========================================= */
.hero-meta {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    margin-top: 2rem;
}

.hero-meta strong {
    color: white;
    font-weight: 600;
}

/* =========================================
   UI COMPONENTS (from Brand Book)
   ========================================= */

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    margin-top: 3rem;
    padding: 1rem 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 200ms ease;
}

.pagination a:hover {
    background: var(--digital-light);
    color: var(--dark-blue);
}

.pagination .current {
    background: var(--primary-blue);
    color: white;
}

.pagination .disabled {
    color: #ccc;
    pointer-events: none;
}

/* Tables (from Brand Book .psi-table) */
.psi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.psi-table th {
    background: var(--dark-blue);
    color: white;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.psi-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--digital-light);
    color: #555;
}

.psi-table tr:hover td {
    background: rgba(0,61,165,0.03);
}

/* Form Inputs (from Brand Book .psi-input) */
.psi-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--digital-blue-5);
    border-radius: 6px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: var(--digital-dark);
    background: white;
    transition: border-color 200ms ease, box-shadow 200ms ease;
    outline: none;
}

.psi-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0,61,165,0.15);
}

.psi-input::placeholder {
    color: #767676;
}

.psi-input.error {
    border-color: var(--tomato-medium);
    box-shadow: 0 0 0 3px rgba(225,99,59,0.15);
}

.psi-input.success {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
}

/* Textarea (from Brand Book) */
.psi-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--digital-blue-5);
    border-radius: 6px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: var(--digital-dark);
    min-height: 80px;
    resize: vertical;
    transition: border-color 200ms ease, box-shadow 200ms ease;
    outline: none;
}

.psi-textarea:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0,61,165,0.15);
}

/* Select (from Brand Book) */
.psi-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--digital-blue-5);
    border-radius: 6px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: var(--digital-dark);
    background: white;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    cursor: pointer;
    transition: border-color 200ms ease;
    outline: none;
}

.psi-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0,61,165,0.15);
}

/* Label (from Brand Book) */
.psi-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 0.5rem;
}

/* Progress Bars (from Brand Book) */
.progress {
    width: 100%;
    height: 8px;
    background: var(--digital-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--digital-key1));
    border-radius: 4px;
    transition: width 600ms ease;
}

.progress-bar.success { background: linear-gradient(90deg, #22c55e, #16a34a); }
.progress-bar.warning { background: linear-gradient(90deg, var(--orange), var(--amber)); }
.progress-bar.error { background: linear-gradient(90deg, var(--tomato-medium), var(--tomato-dark)); }

/* Badges (from Brand Book) */
.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.badge-primary { background: var(--primary-blue); color: white; }
.badge-mint { background: var(--mint); color: var(--dark-blue); }
.badge-warning { background: var(--amber); color: var(--dark-blue); }
.badge-error { background: var(--tomato-medium); color: white; }
.badge-dark { background: var(--dark-blue); color: white; }
.badge-success { background: #22c55e; color: white; }
.badge-outline { background: transparent; border: 1px solid var(--primary-blue); color: var(--primary-blue); }

/* Modal (from Brand Book .psi-modal) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,20,82,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    max-width: 560px;
    width: 90%;
    box-shadow: var(--shadow-large);
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform 300ms ease;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal h3 {
    font-size: 1.5rem;
    color: var(--dark-blue);
    margin-bottom: 0.75rem;
}

.modal p {
    color: #666;
    margin-bottom: 2rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Toggle Switch (from Brand Book .psi-toggle) */
.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    cursor: pointer;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--digital-light);
    border-radius: 26px;
    transition: all 200ms ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow-small);
    transition: all 200ms ease;
}

.toggle input:checked + .toggle-slider {
    background: var(--primary-blue);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

/* Tooltip (from Brand Book) */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-blue);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 200ms ease, transform 200ms ease;
    transform: translateX(-50%) translateY(4px);
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--dark-blue);
}

.tooltip:hover .tooltip-content {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Skeleton Loading (from Brand Book) */
.skeleton {
    background: linear-gradient(90deg, var(--digital-light) 25%, #e8e9eb 50%, var(--digital-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.75rem;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-heading {
    height: 1.5rem;
    width: 40%;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-card {
    height: 200px;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Contact Card (from Brand Book) */
.contact-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-small);
}

.contact-card h4 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.contact-card p {
    color: #666;
    margin-bottom: 0.5rem;
}

.contact-card a {
    color: var(--digital-key1);
    font-weight: 600;
}

/* Glass Card (from Brand Book glassmorphism) */
.glass-card {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 300ms ease;
}

.glass-card:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

/* Tabs (from Brand Book) */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--digital-light);
    margin-bottom: 2rem;
}

.tab {
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all 200ms ease;
}

.tab:hover {
    color: var(--primary-blue);
}

.tab.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
}

/* Avatar (from Brand Book) */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-blue);
    color: white;
    font-weight: 700;
    overflow: hidden;
}

.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar { width: 40px; height: 40px; font-size: 0.85rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    margin-left: -8px;
    border: 2px solid white;
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* =========================================
   ANIMATIONS (from Brand Book)
   ========================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

@keyframes heroFloat {
    0%, 100% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.05) translateY(-20px); }
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* =========================================
   RESPONSIVE (from Brand Book)
   ========================================= */
@media (max-width: 992px) {
    :root {
        --section-padding: 2.5rem;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .hero-tagline {
        font-size: 1.5rem;
    }

    .section-title,
    .section-header h2 {
        font-size: 1.5rem;
    }

    .nav-links {
        display: none;
    }

    .nav-links.active {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(0, 20, 82, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 0.5rem 1.25rem 1rem;
        gap: 0;
        z-index: 999;
        box-shadow: 0 8px 24px rgba(0,0,0,0.3);
        border-bottom: 2px solid rgba(175,223,224,0.15);
        list-style: none;
        margin: 0;
    }

    .nav-links.active li {
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .nav-links.active li:last-child {
        border-bottom: none;
    }

    .nav-links.active a {
        display: flex;
        align-items: center;
        padding: 0.75rem 0.25rem;
        font-size: 0.95rem;
        font-weight: 600;
        letter-spacing: 0.3px;
        color: rgba(255,255,255,0.9);
        text-decoration: none;
        transition: color 150ms ease, padding-left 150ms ease;
    }

    .nav-links.active a:hover,
    .nav-links.active a:active {
        color: var(--mint);
        padding-left: 0.5rem;
    }

    /* Hide search and notification in mobile menu */
    .nav-links.active .nav-search-trigger,
    .nav-links.active .notification-bell {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }
}

/* Tablet-specific (from Brand Book) */
@media (min-width: 768px) and (max-width: 991px) {
    .cards-grid,
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Tablet: show mobile app tiles, hide desktop grid */
    .lab-cards-desktop {
        display: none !important;
    }

    .lab-apps-mobile {
        display: block !important;
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    .hero-badge {
        width: 120px;
    }

    .hero-logo {
        width: 180px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 2rem;
    }

    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }

    .hero {
        min-height: 85vh;
        padding: 5rem 1.5rem 3rem !important;
    }

    .hero-badge {
        width: 80px;
    }

    .hero-logo {
        width: 160px;
        margin-bottom: 2rem;
    }

    .hero h1 {
        font-size: 2.2rem !important;
        line-height: 1.15;
        letter-spacing: -0.5px;
    }

    .hero-tagline {
        font-size: 1.1rem !important;
        line-height: 1.4;
    }

    .section {
        padding: 60px 1.5rem;
    }

    .nav {
        background: rgba(0, 20, 82, 0.92) !important;
        backdrop-filter: blur(24px) saturate(180%) !important;
        -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    }

    .cards-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header {
        padding: 100px 1.5rem 50px;
    }

    /* Mobile: show app tiles, hide desktop grid */
    .lab-cards-desktop {
        display: none !important;
    }

    .lab-apps-mobile {
        display: block !important;
    }

    /* Mobile button touch feedback */
    .btn {
        min-height: 48px;
        font-size: 0.95rem;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .btn:active {
        transform: scale(0.96) !important;
        transition: transform 100ms ease !important;
    }

    /* Mobile scroll animations (smoother/faster) */
    .section {
        animation-duration: 600ms !important;
    }

    /* Mobile gradient overlays */
    .section-gradient::after,
    .section-dark::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg,
            transparent 0%,
            var(--mint) 20%,
            var(--primary-blue) 50%,
            var(--mint) 80%,
            transparent 100%
        );
        opacity: 0.3;
    }

    /* Mobile section dividers */
    .section + .section-alt,
    .section-alt + .section {
        position: relative;
    }

    .section + .section-alt::before,
    .section-alt + .section::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 60px;
        height: 3px;
        background: linear-gradient(90deg, var(--primary-blue), var(--mint));
        border-radius: 2px;
    }

    /* Mobile card touch feedback */
    .service-card,
    .content-card,
    .announcement-item {
        transition: transform 200ms ease, box-shadow 200ms ease;
    }

    .service-card:active,
    .content-card:active {
        transform: scale(0.97);
    }

    /* Mobile shadow enhancements */
    .section-alt {
        box-shadow: inset 0 1px 0 rgba(0,61,165,0.05), inset 0 -1px 0 rgba(0,61,165,0.05);
    }

    /* Mobile section label */
    .section-label {
        font-size: 0.75rem !important;
        letter-spacing: 1.5px !important;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile safe areas */
    .nav {
        padding-top: max(1rem, env(safe-area-inset-top));
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .section:last-of-type {
        padding-bottom: max(60px, calc(60px + env(safe-area-inset-bottom)));
    }

    /* Mobile smooth scroll */
    html {
        -webkit-overflow-scrolling: touch;
    }

    /* Mobile glass cards */
    .glass-card {
        border-radius: 12px;
        padding: 1.25rem;
    }
}

/* STREAK MINI INDICATOR */
.streak-mini {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #f5a623;
    color: #fff;
    font-size: 0.6rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid var(--dark-blue);
}

.nav-dropdown-toggle {
    position: relative;
}

/* CONTINUE READING SECTION */
.continue-reading-section {
    padding: 2rem 0;
}

.continue-reading-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.continue-reading-card {
    display: block;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s;
}

.continue-reading-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    color: var(--text);
}

.continue-reading-card h3 {
    margin: 0.75rem 0 0.25rem;
    font-size: 1rem;
}

/* =========================================
   PRINT STYLES (from Brand Book)
   ========================================= */
@media print {
    .nav,
    .hero-scroll,
    .footer {
        display: none;
    }

    .section {
        page-break-inside: avoid;
        padding: 40px 20px;
    }

    .hero {
        min-height: auto;
        padding: 40px 20px;
    }

    body {
        font-size: 12pt;
    }

    h1 { font-size: 24pt; }
    h2 { font-size: 20pt; }
    h3 { font-size: 16pt; }
}

/* =========================================
   REDUCED MOTION (from Brand Book)
   ========================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    html { scroll-behavior: auto !important; }
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =========================================
   SEARCH PAGE
   ========================================= */
.search-form {
    margin-bottom: 2rem;
}

.search-input-group {
    display: flex;
    gap: 0.75rem;
    max-width: 600px;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: border-color var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.search-meta {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.search-result-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}

.search-result-item h3 {
    margin-bottom: 0.25rem;
}

.search-result-item h3 a {
    color: var(--primary-blue);
    text-decoration: none;
}

.search-result-item h3 a:hover {
    text-decoration: underline;
}

.search-result-item p {
    color: var(--text-muted);
    margin: 0;
}

/* =========================================
   CODE BLOCK
   ========================================= */
.code-block {
    margin: 1.5rem 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.code-block-header {
    background: var(--dark-blue);
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.code-block pre {
    margin: 0;
    padding: 1.25rem;
    background: #0a1628;
    color: #e0e6f0;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.6;
}

.code-block code {
    font-family: "Fira Code", "Consolas", "Monaco", monospace;
}

/* =========================================
   ALERT BLOCK
   ========================================= */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.alert-info {
    background: #e8f4fd;
    border-left-color: var(--primary-blue);
    color: var(--dark-blue);
}

.alert-warning {
    background: #fff8e1;
    border-left-color: #f9a825;
    color: #5d4037;
}

.alert-success {
    background: #e8f5e9;
    border-left-color: #43a047;
    color: #1b5e20;
}

.alert-danger {
    background: #fce4ec;
    border-left-color: #e53935;
    color: #b71c1c;
}

/* =========================================
   VIDEO EMBED
   ========================================= */
.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* =========================================
   CONTACT FORM
   ========================================= */
.contact-form {
    max-width: 640px;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--dark-blue);
}

.form-group .required {
    color: #e53935;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.help-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.error-list {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0;
    color: #e53935;
    font-size: 0.85rem;
}

/* =========================================
   TAG LIST
   ========================================= */
.tag-list {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-body);
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition);
}

.btn-primary {
    background: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
}

.btn-primary:hover {
    background: var(--dark-blue);
    border-color: var(--dark-blue);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-outline:hover {
    background: var(--primary-blue);
    color: #fff;
}

/* =========================================
   PAGINATION
   ========================================= */
.pagination {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* =========================================
   FILTER BAR
   ========================================= */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.filter-chip {
    display: inline-block;
    padding: 0.375rem 1rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.filter-chip:hover,
.filter-chip.active {
    background: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
}

.filter-active {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #e8f4fd;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.filter-clear {
    color: var(--primary-blue);
    font-weight: 600;
    text-decoration: none;
}

.filter-clear:hover {
    text-decoration: underline;
}

/* =========================================
   CONTENT CARD THUMBNAIL
   ========================================= */
.content-card-thumb {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
}

.content-card-thumb .card-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--transition);
}

.content-card:hover .content-card-thumb .card-img {
    transform: scale(1.03);
}

.duration-badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* =========================================
   PAGINATION INFO
   ========================================= */
.pagination-info {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =========================================
   ERROR PAGES
   ========================================= */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 2rem;
}

.error-content {
    max-width: 480px;
}

.error-code {
    font-size: 8rem;
    font-weight: 700;
    color: var(--primary-blue);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.error-content h2 {
    margin-bottom: 0.75rem;
    color: var(--dark-blue);
}

.error-content p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* =========================================
   RELATED CONTENT
   ========================================= */
.related-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.related-section h3 {
    margin-bottom: 1rem;
    color: var(--dark-blue);
}

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

.related-item {
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: box-shadow var(--transition);
}

.related-item:hover {
    box-shadow: var(--shadow);
}

.related-item h4 {
    margin-bottom: 0.25rem;
    color: var(--primary-blue);
}

.related-item .meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* =========================================
   REVIEW BADGE
   ========================================= */
.review-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #fff8e1;
    color: #f57f17;
    margin-left: 0.5rem;
}

/* =========================================
   TOAST NOTIFICATIONS
   ========================================= */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: var(--dark-blue);
    color: #fff;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
}

.toast-success { background: #43a047; }
.toast-error { background: #e53935; }
.toast-warning { background: #f9a825; color: #333; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(1rem); }
    to { opacity: 1; transform: translateX(0); }
}

/* =========================================
   USER DROPDOWN MENU
   ========================================= */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
}

.nav-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--mint);
    color: var(--dark-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    transition: box-shadow var(--transition);
}

.nav-dropdown-toggle:hover .nav-user-avatar {
    box-shadow: 0 0 0 3px rgba(175, 223, 224, 0.5);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 0.5rem 0;
    z-index: 1000;
    list-style: none;
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu li a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background var(--transition);
}

.nav-dropdown-menu li a:hover {
    background: var(--surface);
    color: var(--primary-blue);
}

.dropdown-user-info {
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.25rem;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0;
}

/* =========================================
   ACCOUNT PAGES
   ========================================= */
.account-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.form-card {
    max-width: 600px;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header-row h3 {
    margin: 0;
}

.link-subtle {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.link-subtle:hover {
    text-decoration: underline;
}

/* Profile */
.profile-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 768px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }
}

.profile-header-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-header-info h2 {
    margin: 0 0 0.25rem;
}

.profile-bio {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
}

.profile-bio h4 {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.profile-actions {
    display: flex;
    gap: 0.75rem;
}

/* Sidebar nav */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background var(--transition);
}

.sidebar-nav a:hover {
    background: var(--surface);
    color: var(--primary-blue);
}

.count-badge {
    margin-left: auto;
    background: var(--primary-blue);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 2rem;
}

/* Info list */
.info-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    font-size: 0.9rem;
}

.info-list dt {
    color: var(--text-muted);
    font-weight: 500;
}

.info-list dd {
    margin: 0;
    color: var(--text);
}

/* Activity list */
.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background var(--transition);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: var(--surface);
    border-radius: var(--radius);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.activity-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.activity-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.activity-title {
    font-weight: 500;
    color: var(--dark-blue);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Notes */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.note-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--primary-blue);
}

.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.note-card-header h3,
.note-card-header h4 {
    margin: 0;
    font-size: 1rem;
}

.note-preview {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.note-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.note-actions {
    display: flex;
    gap: 0.5rem;
}

/* Bookmark & action buttons on pages */
.page-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-icon:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background: #f0f7ff;
}

.bookmark-btn.bookmarked {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
    background: #f0f7ff;
}

/* Small button variant */
.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

.btn-danger-outline {
    color: #e53935;
    border-color: #e53935;
}

.btn-danger-outline:hover {
    background: #e53935;
    color: #fff;
}

/* Content card footer */
.content-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
}

.card-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0.5rem 0 0;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--dark-blue);
}

.empty-state p {
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.form-error {
    display: block;
    color: #e53935;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.form-help {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: border-color var(--transition), box-shadow var(--transition);
    background: #fff;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.1);
}

textarea.form-input {
    resize: vertical;
}

/* Auth form (login page) */
.auth-form {
    text-align: left;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.auth-form .form-input {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.auth-form .form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.auth-form .form-input:focus {
    border-color: var(--mint);
    box-shadow: 0 0 0 3px rgba(175, 223, 224, 0.2);
}

/* Text utilities */
.text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Alert for forms */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.alert-danger {
    background: #fde8e8;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.alert-warning {
    background: #fff8e1;
    color: #f57f17;
    border: 1px solid #ffe082;
}

/* =========================================
   NAV BADGE (unread announcements)
   ========================================= */
.nav-link-badge-wrap {
    position: relative;
}

.nav-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #e53935;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* =========================================
   NAV SEARCH BUTTON
   ========================================= */
.nav-search-trigger {
    display: flex;
    align-items: center;
}

.nav-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-primary);
    font-size: 0.85rem;
}

.nav-search-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.nav-search-hint {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.02em;
}

@media (max-width: 768px) {
    .nav-search-hint {
        display: none;
    }
    .nav-search-btn {
        padding: 0.3rem;
        border: none;
        background: transparent;
    }
}

/* =========================================
   TABLE OF CONTENTS
   ========================================= */
.toc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.toc h4 {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.toc ol {
    margin: 0;
    padding-left: 1.25rem;
    list-style: decimal;
}

.toc ol li {
    padding: 0.25rem 0;
}

.toc ol li a {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 0.95rem;
}

.toc ol li a:hover {
    text-decoration: underline;
}

/* =========================================
   FAQ ACCORDION
   ========================================= */
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    background: #fff;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    list-style: none;
    color: var(--dark-blue);
    transition: background var(--transition);
}

.faq-question:hover {
    background: var(--surface);
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    color: var(--text-muted);
}

details.faq-item[open] .faq-chevron {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1.25rem 1.25rem;
    color: var(--text);
    line-height: 1.7;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

/* =========================================
   CODE BLOCK COPY BUTTON
   ========================================= */
.code-block {
    position: relative;
    margin-bottom: 1.5rem;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--dark-blue);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius) var(--radius) 0 0;
}

.code-copy-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition);
}

.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.code-copy-btn.copied {
    color: var(--mint);
    border-color: var(--mint);
}

.code-block pre {
    margin: 0;
    background: #1a1a2e;
    padding: 1.25rem;
    overflow-x: auto;
    border-radius: 0 0 var(--radius) var(--radius);
}

.code-block code {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #e0e0e0;
}

/* =========================================
   MANUAL PAGE CONTENT (Brand Book compliant)
   ========================================= */
.manual-body {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text);
}

.manual-body h2 {
    font-family: var(--font-accent);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-blue);
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--mint);
}

.manual-body h2:first-child {
    margin-top: 0;
}

.manual-body h3 {
    font-family: var(--font-accent);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin: 2rem 0 0.75rem;
}

.manual-body p {
    margin-bottom: 1rem;
}

.manual-body ul,
.manual-body ol {
    margin: 0.5rem 0 1.25rem 1.5rem;
    line-height: 1.8;
}

.manual-body li {
    margin-bottom: 0.35rem;
}

.manual-body img {
    border-radius: var(--radius);
    box-shadow: var(--shadow-small);
    margin: 1rem 0;
}

.manual-body hr {
    border: none;
    border-top: 2px dashed var(--border);
    margin: 2rem 0;
}

/* ── Interactive Keyboard Key Caps (Brand Book .key-cap) ── */
.keyboard-shortcut {
    display: inline-flex;
    gap: 0.25rem;
    align-items: center;
}

.key-cap {
    display: inline-block;
    background: linear-gradient(180deg, #fff 0%, var(--digital-light) 100%);
    border: 1px solid #c0c4cc;
    border-bottom-width: 3px;
    border-radius: 5px;
    padding: 0.2rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-primary);
    color: var(--dark-blue);
    min-width: 26px;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,20,82,0.1), inset 0 1px 0 rgba(255,255,255,0.8);
    transition: all 0.15s ease;
    cursor: default;
    user-select: none;
    line-height: 1.4;
}

.key-cap:hover {
    background: linear-gradient(180deg, #fff 0%, #e4e8f0 100%);
    border-color: var(--primary-blue);
    box-shadow: 0 2px 4px rgba(0,61,165,0.15), inset 0 1px 0 rgba(255,255,255,0.9);
    transform: translateY(-1px);
}

.key-cap:active {
    transform: translateY(1px);
    border-bottom-width: 1px;
    box-shadow: 0 0 2px rgba(0,20,82,0.1);
}

/* Special wider key caps for modifier keys */
.key-cap.key-wide {
    padding: 0.2rem 0.7rem;
    min-width: 42px;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
}

/* Plus sign between keys */
.key-plus {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.7rem;
    margin: 0 1px;
    user-select: none;
}

/* Fallback: also style plain <b> inside table cells as key caps
   when content looks like keyboard shortcuts */
kbd, .manual-body kbd {
    display: inline-block;
    background: linear-gradient(180deg, #fff 0%, var(--digital-light) 100%);
    border: 1px solid #c0c4cc;
    border-bottom-width: 3px;
    border-radius: 5px;
    padding: 0.2rem 0.55rem;
    font-family: var(--font-primary);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--dark-blue);
    min-width: 26px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,20,82,0.1), inset 0 1px 0 rgba(255,255,255,0.8);
    margin: 0 2px;
    white-space: nowrap;
    line-height: 1.4;
    transition: all 0.15s ease;
    cursor: default;
}

kbd:hover, .manual-body kbd:hover {
    background: linear-gradient(180deg, #fff 0%, #e4e8f0 100%);
    border-color: var(--primary-blue);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,61,165,0.15), inset 0 1px 0 rgba(255,255,255,0.9);
}

kbd:active, .manual-body kbd:active {
    transform: translateY(1px);
    border-bottom-width: 1px;
    box-shadow: 0 0 2px rgba(0,20,82,0.1);
}

/* ── Browser Icons in Tables ── */
.browser-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
    position: relative;
    top: -1px;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.compare-table td .browser-icon,
.manual-body table td .browser-icon {
    opacity: 0.9;
}

.compare-table tbody tr:hover .browser-icon,
.manual-body table tbody tr:hover .browser-icon {
    opacity: 1;
    transform: scale(1.15);
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

/* ── OS Switcher Badges ── */
.os-switcher {
    display: inline-flex;
    gap: 0;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,20,82,0.1);
    border: 1px solid var(--border);
}

.os-switcher .os-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-primary);
    letter-spacing: 0.02em;
    background: #fff;
    color: var(--text-muted);
    border: none;
    border-right: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
}

.os-switcher .os-badge:last-child {
    border-right: none;
}

.os-switcher .os-badge:hover {
    background: var(--surface);
    color: var(--dark-blue);
}

.os-switcher .os-badge.active {
    background: var(--primary-blue);
    color: #fff;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.15);
}

.os-switcher .os-badge svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.os-switcher .os-badge.active svg {
    fill: #fff;
}

/* Hide OS-specific cells when not active */
.manual-body table .os-cell { display: none; }
.manual-body table .os-cell.os-active { display: table-cell; }

/* OS-specific header */
.manual-body table .os-header { display: none; }
.manual-body table .os-header.os-active { display: table-cell; }

/* Inline shortcut OS variants */
.os-shortcut { display: none; }
.os-shortcut.os-active { display: inline; }

/* Global OS switcher (sticky at top of shortcuts section) */
.os-switcher-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0 1rem;
}

.os-switcher-wrapper .os-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Reference Tables (Brand Book .demo-table) ── */
.compare-table,
.manual-body table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.25rem 0 1.5rem;
    font-size: 0.92rem;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,20,82,0.06), 0 4px 12px rgba(0,20,82,0.04);
    border: 1px solid var(--border);
}

.compare-table th,
.manual-body table th {
    background: var(--dark-blue);
    color: #fff;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.compare-table td,
.manual-body table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--digital-light);
    color: #555;
    vertical-align: middle;
}

.compare-table tbody tr:nth-child(even) td,
.manual-body table tbody tr:nth-child(even) td {
    background: var(--surface);
}

.compare-table tbody tr:hover td,
.manual-body table tbody tr:hover td {
    background: rgba(0,61,165,0.03);
}

.compare-table tbody tr:last-child td,
.manual-body table tbody tr:last-child td {
    border-bottom: none;
}

.compare-table .check {
    color: #16a34a;
    font-weight: 700;
}

/* ── Inline code ── */
.manual-body code {
    background: rgba(0,61,165,0.06);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.88rem;
    color: var(--digital-key1);
    border: 1px solid rgba(0,61,165,0.08);
}

/* Don't double-style code inside code blocks */
.code-block code {
    background: none;
    padding: 0;
    color: #e0e0e0;
    border: none;
}

/* ── Step indicators ── */
.manual-body p > b:first-child {
    color: var(--dark-blue);
}

/* ── Alerts (Brand Book .demo-alert) ── */
.alert {
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
    font-size: 0.95rem;
    line-height: 1.65;
    border-left-width: 3px;
    border-left-style: solid;
}

.alert-info {
    background: rgba(0,61,165,0.06);
    color: var(--primary-blue);
    border-left-color: var(--primary-blue);
}

.alert-success {
    background: rgba(34,197,94,0.06);
    color: #16a34a;
    border-left-color: #22c55e;
}

.alert-warning {
    background: rgba(234,144,61,0.06);
    color: #b45309;
    border-left-color: var(--orange);
}

.alert-danger {
    background: rgba(225,99,59,0.06);
    color: var(--tomato-dark);
    border-left-color: var(--tomato-medium);
}

.alert b, .alert strong {
    color: inherit;
}

.alert p:last-child {
    margin-bottom: 0;
}

/* ── TOC enhancements ── */
.toc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary-blue);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.toc h4 {
    margin: 0 0 0.75rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary-blue);
    font-weight: 700;
}

.toc ol {
    margin: 0;
    padding-left: 1.25rem;
    list-style: decimal;
}

.toc ol li {
    padding: 0.3rem 0;
}

.toc ol li a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.toc ol li a:hover {
    color: var(--primary-blue);
    text-decoration: underline;
}

/* =========================================
   BACK TO TOP BUTTON
   ========================================= */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-blue);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--dark-blue);
    transform: translateY(-2px);
}

/* =========================================
   SEARCH PAGE — Rich Results
   ========================================= */
.search-page {
    padding: 2rem 0 3rem;
    min-height: 60vh;
}
.search-hero {
    text-align: center;
    margin-bottom: 1.5rem;
}
.search-hero h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a2e);
    margin-bottom: 1rem;
}
.search-highlight {
    color: var(--primary-blue);
}

/* Search input */
.search-page-form {
    max-width: 600px;
    margin: 0 auto;
}
.search-page-input-wrap {
    display: flex;
    align-items: center;
    background: var(--surface, #fff);
    border: 2px solid var(--border, #dee2e8);
    border-radius: 14px;
    padding: 0.25rem 0.25rem 0.25rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-page-input-wrap:focus-within {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.1);
}
.search-page-icon {
    flex-shrink: 0;
    color: var(--text-muted, #94a3b8);
    margin-right: 0.5rem;
}
.search-page-input {
    flex: 1;
    border: none;
    background: none;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary, #1a1a2e);
    outline: none;
    padding: 0.5rem 0;
}
.search-page-input::placeholder {
    color: var(--text-muted, #94a3b8);
}
.search-page-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    background: var(--primary-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s, background 0.2s;
    flex-shrink: 0;
}
.search-page-btn:hover {
    transform: scale(1.05);
    background: var(--digital-key1, #012FD7);
}
.search-page-btn svg {
    transform: rotate(90deg);
}

/* Filter pills */
.search-filters {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 1.5rem;
}
.search-filter-pill {
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    border: 1.5px solid var(--border, #dee2e8);
    background: var(--surface, #fff);
    color: var(--text-secondary, #64748b);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s;
}
.search-filter-pill:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}
.search-filter-pill.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: #fff;
}

/* Results header */
.search-results-header {
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted, #94a3b8);
}
.search-count {
    font-weight: 600;
}
.search-scope {
    margin-left: 0.3rem;
}

/* Result cards */
.search-results-grid {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.search-card {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #dee2e8);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}
.search-card:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 4px 20px rgba(0, 61, 165, 0.1);
    transform: translateY(-1px);
}
.search-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.search-card-body {
    flex: 1;
    min-width: 0;
}
.search-card-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}
.search-card-type {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.search-card-breadcrumb {
    font-size: 0.7rem;
    color: var(--text-muted, #94a3b8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a2e);
    margin: 0 0 0.25rem;
    line-height: 1.3;
}
.search-card:hover .search-card-title {
    color: var(--primary-blue);
}
.search-card-excerpt {
    font-size: 0.85rem;
    color: var(--text-secondary, #64748b);
    line-height: 1.45;
    margin: 0 0 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.search-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.search-card-tags {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    min-width: 0;
}
.search-tag {
    font-size: 0.68rem;
    padding: 0.1rem 0.45rem;
    border-radius: 6px;
    background: rgba(0, 61, 165, 0.07);
    color: var(--primary-blue);
    font-weight: 500;
    white-space: nowrap;
}
.search-card-date {
    font-size: 0.72rem;
    color: var(--text-muted, #94a3b8);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Pagination */
.search-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border, #dee2e8);
}
.search-page-link {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 1.5px solid var(--border, #dee2e8);
    background: var(--surface, #fff);
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.search-page-link:hover {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: #fff;
}
.search-page-info {
    font-size: 0.85rem;
    color: var(--text-muted, #94a3b8);
    font-weight: 600;
}

/* Empty state */
.search-empty {
    text-align: center;
    padding: 3rem 1rem;
}
.search-empty-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}
.search-empty h3 {
    font-size: 1.2rem;
    color: var(--text-primary, #1a1a2e);
    margin-bottom: 0.4rem;
}
.search-empty p {
    color: var(--text-secondary, #64748b);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.search-empty p a {
    color: var(--primary-blue);
}
.search-empty-tips {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
}

/* Dark mode */
body.dark-mode .search-hero h1 { color: #e6edf3; }
body.dark-mode .search-page-input-wrap { background: #161b22; border-color: #30363d; }
body.dark-mode .search-page-input-wrap:focus-within { border-color: #388bfd; box-shadow: 0 0 0 3px rgba(56,139,253,0.15); }
body.dark-mode .search-page-input { color: #e6edf3; }
body.dark-mode .search-page-btn { background: #388bfd; }
body.dark-mode .search-filter-pill { background: #161b22; border-color: #30363d; color: #8b949e; }
body.dark-mode .search-filter-pill.active { background: #388bfd; border-color: #388bfd; color: #fff; }
body.dark-mode .search-card { background: #161b22; border-color: #30363d; }
body.dark-mode .search-card:hover { border-color: #388bfd; box-shadow: 0 4px 20px rgba(56,139,253,0.12); }
body.dark-mode .search-card-title { color: #e6edf3; }
body.dark-mode .search-card:hover .search-card-title { color: #58a6ff; }
body.dark-mode .search-tag { background: rgba(88,166,255,0.1); color: #58a6ff; }
body.dark-mode .search-page-link { background: #161b22; border-color: #30363d; color: #58a6ff; }
body.dark-mode .search-page-link:hover { background: #388bfd; border-color: #388bfd; color: #fff; }
body.dark-mode .search-empty h3 { color: #e6edf3; }

/* Search correction banner ("did you mean?" / keyboard layout) */
.search-correction {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    color: #1e40af;
}
.search-correction p { margin: 0 0 0.25rem 0; }
.search-correction p:last-child { margin-bottom: 0; }
.search-correction-link {
    font-weight: 700;
    color: #003DA5;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.search-correction-hint {
    color: #6b7280;
    font-size: 0.85rem;
    font-style: italic;
}
.search-correction-original {
    font-size: 0.85rem;
    color: #6b7280;
}
.search-correction-original a {
    color: #4b5563;
    text-decoration: underline;
}
body.dark-mode .search-correction {
    background: linear-gradient(135deg, #0c1929 0%, #111827 100%);
    border-color: #1e3a5f;
    color: #93c5fd;
}
body.dark-mode .search-correction-link { color: #60a5fa; }
body.dark-mode .search-correction-hint { color: #9ca3af; }
body.dark-mode .search-correction-original { color: #9ca3af; }
body.dark-mode .search-correction-original a { color: #d1d5db; }

/* Search overlay correction hint */
.search-overlay-correction {
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
    color: #6b7280;
    background: #f0f9ff;
    border-bottom: 1px solid #e5e7eb;
}
.search-overlay-correction a {
    color: #003DA5;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}
body.dark-mode .search-overlay-correction {
    background: #0c1929;
    border-color: #1e3a5f;
    color: #9ca3af;
}
body.dark-mode .search-overlay-correction a { color: #60a5fa; }

/* Mobile */
@media (max-width: 600px) {
    .search-card { padding: 0.85rem; gap: 0.75rem; }
    .search-card-icon { width: 40px; height: 40px; font-size: 1.2rem; }
    .search-hero h1 { font-size: 1.2rem; }
    .search-empty-tips { flex-direction: column; gap: 0.4rem; }
}

/* =========================================
   TAG INLINE LISTS (for index pages)
   ========================================= */
.tag-list-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.tag-sm {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.75rem;
    border-radius: 2rem;
    text-decoration: none;
    transition: all var(--transition);
}

.tag-sm:hover {
    background: var(--primary-blue);
    color: #fff;
}

/* =========================================
   USER MANAGEMENT TABLE
   ========================================= */
.table-responsive {
    overflow-x: auto;
}

.account-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.account-table th,
.account-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.account-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.account-table tr:hover {
    background: var(--surface);
}

.account-table .row-inactive {
    opacity: 0.6;
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-muted {
    background: var(--surface);
    color: var(--text-muted);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.btn-danger-outline {
    border: 1px solid #dc3545;
    color: #dc3545;
    background: transparent;
    border-radius: 2rem;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-danger-outline:hover {
    background: #dc3545;
    color: #fff;
}

.btn-outline {
    border: 1px solid var(--border);
    color: var(--text);
    background: transparent;
    border-radius: 2rem;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
}

.btn-outline:hover {
    background: var(--surface);
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.container-narrow {
    max-width: 600px;
    margin: 0 auto;
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* =========================================
   PROGRESS DASHBOARD
   ========================================= */
.progress-bar-wrap {
    background: var(--surface);
    border-radius: 2rem;
    height: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-blue);
    border-radius: 2rem;
    transition: width 0.3s;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.progress-percent {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 3rem;
    text-align: right;
}

.continue-reading {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow var(--transition), border-color var(--transition);
}

.continue-reading:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-card);
    color: var(--text);
}

/* =========================================
   BADGES
   ========================================= */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

.badge-card {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
}

.badge-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.badge-card.earned {
    background: var(--surface);
    border-color: var(--primary-blue);
}

.badge-card.unearned {
    opacity: 0.4;
    filter: grayscale(1);
}

.badge-icon {
    font-size: 2.5rem;
}

.badge-tier {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--primary-blue);
    color: #fff;
    margin-top: 0.5rem;
}

.streak-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}

/* =========================================
   COMMENTS
   ========================================= */
.comments-section {
    margin-top: 3rem;
    border-top: 2px solid var(--border);
    padding-top: 2rem;
}

.comments-section h3 {
    font-family: var(--font-accent);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--dark-blue);
    margin-bottom: 1.5rem;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* -- Comment form card -- */
.comment-form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.comment-form-body {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}

.comment-form textarea.form-input {
    resize: vertical;
    min-height: 60px;
    border-radius: var(--radius);
    font-size: 0.92rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.comment-form textarea.form-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.08);
}

/* -- Individual comment -- */
.comment-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--digital-light);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--digital-key1));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0, 61, 165, 0.2);
}

.comment-avatar-sm {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
}

.comment-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.comment-meta strong {
    font-size: 0.9rem;
    color: var(--dark-blue);
}

.comment-meta .meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comment-body {
    margin-left: calc(36px + 0.75rem);
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text);
}

.comment-body p {
    margin: 0;
}

/* -- Comment actions (upvote, reply) -- */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.6rem;
    margin-left: calc(36px + 0.75rem);
}

.comment-actions .btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.comment-actions .btn-icon:hover {
    background: rgba(0, 61, 165, 0.06);
    color: var(--primary-blue);
}

.comment-actions .btn-icon svg {
    transition: transform 0.2s ease;
}

.comment-actions .btn-icon:hover svg {
    transform: scale(1.1);
}

.upvote-btn.upvoted,
.upvote-btn.voted {
    color: var(--primary-blue);
    font-weight: 700;
}

.upvote-btn.upvoted svg,
.upvote-btn.voted svg {
    fill: var(--primary-blue);
}

/* -- Replies (nested) -- */
.comment-replies {
    margin-left: calc(36px + 0.75rem);
    margin-top: 0.5rem;
    border-left: 2px solid var(--mint);
    padding-left: 1.25rem;
}

.comment-reply {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--digital-light);
}

.comment-reply:last-child {
    border-bottom: none;
}

.comment-reply .comment-body {
    margin-left: calc(28px + 0.75rem);
    font-size: 0.92rem;
}

.comment-reply .comment-actions {
    margin-left: calc(28px + 0.75rem);
}

/* -- Reply form -- */
.reply-form-container {
    margin-left: calc(36px + 0.75rem);
    margin-top: 0.75rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.reply-form-container .comment-form-body {
    gap: 0.65rem;
}

.reply-form-container textarea.form-input {
    min-height: 48px;
    font-size: 0.88rem;
}

/* -- Empty state -- */
.comments-section .empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.comments-section .empty-state .text-muted {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
}

/* =========================================
   NOTIFICATIONS
   ========================================= */
.notification-bell {
    position: relative;
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #dc3545;
    color: #fff;
    font-size: 0.65rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.notification-item.unread {
    background: rgba(0, 61, 165, 0.05);
}

.notification-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-blue);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.5rem;
}

.notification-dot.read {
    background: transparent;
}

/* =========================================
   LAB STATUS
   ========================================= */
.lab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.lab-card {
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.lab-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.lab-status-dot.up {
    background: #28a745;
}

.lab-status-dot.down {
    background: #dc3545;
}

.lab-status-dot.unknown {
    background: #6c757d;
}

/* =========================================
   EVENTS CALENDAR
   ========================================= */
.calendar-embed {
    width: 100%;
    border: none;
    height: 600px;
    border-radius: var(--radius);
}

.event-list {
    list-style: none;
    padding: 0;
}

.event-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.event-date-badge {
    background: var(--primary-blue);
    color: #fff;
    padding: 0.5rem;
    border-radius: var(--radius);
    text-align: center;
    min-width: 60px;
}

.event-date-badge .day {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.event-date-badge .month {
    font-size: 0.75rem;
    text-transform: uppercase;
}

.event-type-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
}

/* =========================================
   PROJECT SHOWCASE
   ========================================= */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.project-card-thumb {
    height: 180px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-card-body {
    padding: 1.25rem;
}

.project-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* =========================================
   RATING WIDGET
   ========================================= */
.rating-widget {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.rating-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rating-stars,
.stars {
    display: flex;
    gap: 0.2rem;
}

.rating-stars .star,
.stars .star,
.star {
    font-size: 1.6rem;
    color: #d1d5db;
    cursor: default;
    transition: color 0.15s, transform 0.15s;
    line-height: 1;
}

.rating-stars .star.star-filled,
.star.star-filled {
    color: #f59e0b;
}

.rating-stars-input .star {
    cursor: pointer;
}

.rating-stars-input .star:hover {
    transform: scale(1.2);
}

.rating-interactive {
    margin-top: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rating-interactive .text-muted {
    font-size: 0.85rem;
    margin: 0;
}

.rating-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* -- Feedback form -- */
.feedback-section {
    margin-top: 1rem;
    border: none;
}

.feedback-section summary {
    list-style: none;
    cursor: pointer;
}

.feedback-section summary::-webkit-details-marker {
    display: none;
}

.feedback-section[open] summary {
    margin-bottom: 0;
}

.feedback-form {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.35rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text);
}

.radio-label input[type="radio"] {
    accent-color: var(--primary-blue);
}

.feedback-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.feedback-type-btn {
    padding: 0.3rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 2rem;
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.feedback-type-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.feedback-type-btn.selected {
    background: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
}

/* =========================================
   CHEAT SHEETS
   ========================================= */
.cheat-sheet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.cheat-sheet-card {
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.language-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-blue);
    color: #fff;
}

.language-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.shortcut-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.shortcut-table th,
.shortcut-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.shortcut-table th {
    font-weight: 600;
    background: var(--surface);
}

.shortcut-table code {
    background: var(--surface);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85em;
}

.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .two-column {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   ONBOARDING OVERLAY
   ========================================= */
.shepherd-element {
    max-width: 400px;
}

/* =========================================
   PRINT STYLES
   ========================================= */
@media print {
    .nav, .footer, .scroll-progress, .skip-nav,
    .page-actions, .back-to-top, .toast-container,
    .breadcrumb, .related-section, .tag-list,
    .pagination, .filter-bar, .filter-active {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    .page-header {
        background: none !important;
        color: #000 !important;
        padding: 1rem 0 !important;
        min-height: auto !important;
    }

    .page-header h1 {
        color: #000 !important;
        font-size: 18pt;
    }

    .page-content {
        max-width: 100%;
        padding: 0;
    }

    .toc {
        border: 1px solid #ccc;
        page-break-after: always;
    }

    .code-block {
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }

    .code-block-header {
        background: #eee !important;
        color: #333 !important;
    }

    .code-copy-btn {
        display: none !important;
    }

    .code-block pre {
        background: #f5f5f5 !important;
        color: #000 !important;
    }

    a[href]:after {
        content: none;
    }

    h2, h3 {
        page-break-after: avoid;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}

/* =========================================
   READING TIME INDICATOR
   ========================================= */
.reading-time {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-left: 0.75rem;
}

.reading-time svg {
    flex-shrink: 0;
}

/* =========================================
   TOC TITLE (h2 styled like h4)
   ========================================= */
.toc-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* =========================================
   BREADCRUMB LIST RESET
   ========================================= */
.breadcrumb ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.breadcrumb ol li {
    display: inline-flex;
    align-items: center;
}

/* =========================================
   DARK MODE TOGGLE BUTTON
   ========================================= */
.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
    transform: scale(1.08);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform 0.4s ease, opacity 0.3s ease;
    position: absolute;
}

.theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

body.dark-mode .theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

body.dark-mode .theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* =========================================
   DARK MODE - prefers-color-scheme: dark
   Auto dark mode for users with OS-level preference.
   Uses :not(.light-mode-override) so manual toggle can override.
   ========================================= */
@media (prefers-color-scheme: dark) {
    :root:not(.light-mode-override) {
        --primary-blue: #4d8fcc;
        --dark-blue: #a0c4e8;
        --mint: #7ec8c9;
        --purple-extra-dark: #b8a0d4;
        --purple-medium: #9a8bc8;
        --purple-light: #c4b5da;
        --tomato-dark: #e8a080;
        --tomato-medium: #e8845e;
        --tomato-light: #f0b89a;
        --pink-violet: #c07888;
        --pink: #c89090;
        --pink-misty: #7a5858;
        --chocolate: #d4a070;
        --orange: #f0a860;
        --amber: #f0cc60;
        --digital-dark: #e6edf3;
        --digital-key1: #58a6ff;
        --digital-key2: #6888e8;
        --digital-light: #1c2333;
        --digital-blue-2: #5888f8;
        --digital-blue-3: #58b8f8;
        --digital-blue-4: #2a4060;
        --digital-blue-5: #1c2a3e;
        --digital-yellow: #f0d830;
        --shadow-large: 0px 8px 56px rgba(0,0,0,0.3), 0px 32px 140px rgba(0,0,0,0.2);
        --shadow-small: 0px 1px 4px rgba(0,0,0,0.2), 0px 0px 8px rgba(0,0,0,0.15);
        --shadow-card: 0 2px 12px rgba(0,0,0,0.25);
        --shadow-lg: 0 8px 24px rgba(0,0,0,0.3);
        --shadow: 0 2px 8px rgba(0,0,0,0.25);
        --surface: #161b22;
        --border: rgba(255,255,255,0.1);
        --text: #e6edf3;
        --text-muted: #8b949e;
    }

    body:not(.light-mode-override) {
        background: #0d1117;
        color: #e6edf3;
    }

    body:not(.light-mode-override) .nav {
        background: rgba(13, 17, 23, 0.92);
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    @media (max-width: 992px) {
        body:not(.light-mode-override) .nav-links {
            background: rgba(13, 17, 23, 0.98);
        }
    }

    @media (max-width: 768px) {
        body:not(.light-mode-override) .nav-links {
            background: rgba(13, 17, 23, 0.98);
        }
        body:not(.light-mode-override) .nav {
            background: rgba(13, 17, 23, 0.95) !important;
        }
    }

    body:not(.light-mode-override) .quick-link-card,
    body:not(.light-mode-override) .service-card,
    body:not(.light-mode-override) .content-card,
    body:not(.light-mode-override) .announcement-item,
    body:not(.light-mode-override) .social-link,
    body:not(.light-mode-override) .contact-card,
    body:not(.light-mode-override) .account-card,
    body:not(.light-mode-override) .note-card,
    body:not(.light-mode-override) .feedback-form,
    body:not(.light-mode-override) .continue-reading,
    body:not(.light-mode-override) .faq-item,
    body:not(.light-mode-override) .modal,
    body:not(.light-mode-override) .cheat-sheet-card,
    body:not(.light-mode-override) .lab-card,
    body:not(.light-mode-override) .badge-card,
    body:not(.light-mode-override) .project-card,
    body:not(.light-mode-override) .rating-widget {
        background: #161b22;
        border-color: rgba(255,255,255,0.1);
    }

    body:not(.light-mode-override) .quick-link-card p,
    body:not(.light-mode-override) .service-card p,
    body:not(.light-mode-override) .content-card p,
    body:not(.light-mode-override) .modal p {
        color: #8b949e;
    }

    body:not(.light-mode-override) .service-card h3,
    body:not(.light-mode-override) .announcement-item h3,
    body:not(.light-mode-override) .announcement-item h3 a,
    body:not(.light-mode-override) .content-card h3 a,
    body:not(.light-mode-override) .faq-question,
    body:not(.light-mode-override) .modal h3,
    body:not(.light-mode-override) .dashboard-welcome h2,
    body:not(.light-mode-override) .section-header h2,
    body:not(.light-mode-override) .empty-state h3,
    body:not(.light-mode-override) .related-section h3,
    body:not(.light-mode-override) .comments-section h3,
    body:not(.light-mode-override) .comment-meta strong,
    body:not(.light-mode-override) .activity-title,
    body:not(.light-mode-override) .error-content h2 {
        color: #e6edf3;
    }

    body:not(.light-mode-override) .section-description,
    body:not(.light-mode-override) .section-header p,
    body:not(.light-mode-override) .announcement-body,
    body:not(.light-mode-override) .announcement-date,
    body:not(.light-mode-override) .content-card .meta,
    body:not(.light-mode-override) .faq-item div,
    body:not(.light-mode-override) .faq-answer {
        color: #8b949e;
    }

    body:not(.light-mode-override) .quick-link-card {
        color: #e6edf3;
    }

    body:not(.light-mode-override) .nav-dropdown-menu {
        background: #1c2333;
        border: 1px solid rgba(255,255,255,0.1);
    }

    body:not(.light-mode-override) .nav-dropdown-menu li a {
        color: #c9d1d9;
    }

    body:not(.light-mode-override) .nav-dropdown-menu li a:hover {
        background: rgba(255,255,255,0.06);
    }

    body:not(.light-mode-override) .dropdown-user-info {
        color: #8b949e;
        border-bottom-color: rgba(255,255,255,0.1);
    }

    body:not(.light-mode-override) .section-alt {
        background: #161b22;
    }

    body:not(.light-mode-override) .compare-table td,
    body:not(.light-mode-override) .manual-body table td,
    body:not(.light-mode-override) .psi-table td,
    body:not(.light-mode-override) .account-table td,
    body:not(.light-mode-override) .shortcut-table td {
        color: #c9d1d9;
        border-bottom-color: rgba(255,255,255,0.06);
    }

    body:not(.light-mode-override) .compare-table tbody tr:nth-child(even) td,
    body:not(.light-mode-override) .manual-body table tbody tr:nth-child(even) td {
        background: rgba(255,255,255,0.02);
    }

    body:not(.light-mode-override) .compare-table tbody tr:hover td,
    body:not(.light-mode-override) .manual-body table tbody tr:hover td,
    body:not(.light-mode-override) .psi-table tr:hover td,
    body:not(.light-mode-override) .account-table tr:hover {
        background: rgba(255,255,255,0.04);
    }

    body:not(.light-mode-override) .compare-table,
    body:not(.light-mode-override) .manual-body table {
        border-color: rgba(255,255,255,0.1);
        box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    }

    body:not(.light-mode-override) .shortcut-table th {
        background: #161b22;
        color: #8b949e;
    }

    body:not(.light-mode-override) .psi-input,
    body:not(.light-mode-override) .psi-textarea,
    body:not(.light-mode-override) .psi-select,
    body:not(.light-mode-override) .form-input,
    body:not(.light-mode-override) .search-input,
    body:not(.light-mode-override) .form-group input[type="text"],
    body:not(.light-mode-override) .form-group input[type="email"],
    body:not(.light-mode-override) .form-group input[type="url"],
    body:not(.light-mode-override) .form-group input[type="number"],
    body:not(.light-mode-override) .form-group textarea,
    body:not(.light-mode-override) .form-group select {
        background: #0d1117;
        color: #e6edf3;
        border-color: rgba(255,255,255,0.15);
    }

    body:not(.light-mode-override) .psi-input::placeholder,
    body:not(.light-mode-override) .form-input::placeholder,
    body:not(.light-mode-override) .search-input::placeholder {
        color: #484f58;
    }

    body:not(.light-mode-override) .form-group label,
    body:not(.light-mode-override) .psi-label {
        color: #c9d1d9;
    }

    body:not(.light-mode-override) .btn-icon {
        background: #161b22;
        border-color: rgba(255,255,255,0.1);
        color: #8b949e;
    }

    body:not(.light-mode-override) .btn-icon:hover {
        background: #1c2333;
        border-color: #4d8fcc;
        color: #4d8fcc;
    }

    body:not(.light-mode-override) .filter-chip {
        background: #161b22;
        color: #8b949e;
        border-color: rgba(255,255,255,0.1);
    }

    body:not(.light-mode-override) .filter-active {
        background: rgba(77,143,204,0.12);
    }

    body:not(.light-mode-override) .os-switcher {
        border-color: rgba(255,255,255,0.1);
        box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    }

    body:not(.light-mode-override) .os-switcher .os-badge {
        background: #161b22;
        color: #8b949e;
        border-color: rgba(255,255,255,0.1);
    }

    body:not(.light-mode-override) .os-switcher .os-badge:hover {
        background: #1c2333;
    }

    body:not(.light-mode-override) .key-cap,
    body:not(.light-mode-override) kbd,
    body:not(.light-mode-override) .manual-body kbd {
        background: linear-gradient(180deg, #2d333b 0%, #1c2333 100%);
        border-color: rgba(255,255,255,0.15);
        color: #e6edf3;
        box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.06);
    }

    body:not(.light-mode-override) .key-cap:hover,
    body:not(.light-mode-override) kbd:hover,
    body:not(.light-mode-override) .manual-body kbd:hover {
        background: linear-gradient(180deg, #363d47 0%, #252d3a 100%);
        border-color: #4d8fcc;
        box-shadow: 0 2px 4px rgba(77,143,204,0.2), inset 0 1px 0 rgba(255,255,255,0.08);
    }

    body:not(.light-mode-override) .manual-body code {
        background: rgba(88,166,255,0.1);
        color: #58a6ff;
        border-color: rgba(88,166,255,0.15);
    }

    body:not(.light-mode-override) .manual-body h2 {
        color: #e6edf3;
        border-bottom-color: #7ec8c9;
    }

    body:not(.light-mode-override) .manual-body h3 {
        color: #58a6ff;
    }

    body:not(.light-mode-override) .manual-body hr {
        border-top-color: rgba(255,255,255,0.1);
    }

    body:not(.light-mode-override) .manual-body p > b:first-child {
        color: #e6edf3;
    }

    body:not(.light-mode-override) .page-content h2,
    body:not(.light-mode-override) .page-content h3 {
        color: #e6edf3;
    }

    body:not(.light-mode-override) .toc {
        background: #161b22;
        border-color: rgba(255,255,255,0.1);
        border-left-color: #4d8fcc;
    }

    body:not(.light-mode-override) .toc h4 {
        color: #4d8fcc;
    }

    body:not(.light-mode-override) .toc ol li a {
        color: #c9d1d9;
    }

    body:not(.light-mode-override) .alert-info {
        background: rgba(77,143,204,0.1);
        color: #58a6ff;
        border-left-color: #4d8fcc;
    }

    body:not(.light-mode-override) .alert-success {
        background: rgba(34,197,94,0.1);
        color: #3fb950;
        border-left-color: #3fb950;
    }

    body:not(.light-mode-override) .alert-warning {
        background: rgba(234,144,61,0.1);
        color: #d29922;
        border-left-color: #d29922;
    }

    body:not(.light-mode-override) .alert-danger {
        background: rgba(225,99,59,0.1);
        color: #f85149;
        border-left-color: #f85149;
    }

    body:not(.light-mode-override) .alert-info a { color: #58a6ff; }

    body:not(.light-mode-override) .tag {
        background: rgba(77,143,204,0.15);
        color: #58a6ff;
    }

    body:not(.light-mode-override) .tag-sm {
        background: #1c2333;
        color: #8b949e;
    }

    body:not(.light-mode-override) .breadcrumb { color: #8b949e; }
    body:not(.light-mode-override) .breadcrumb-sep { color: #484f58; }

    body:not(.light-mode-override) .pagination a,
    body:not(.light-mode-override) .pagination span { color: #8b949e; }

    body:not(.light-mode-override) .pagination a:hover {
        background: #1c2333;
        color: #e6edf3;
    }

    body:not(.light-mode-override) .footer {
        background: #010409;
        border-top: 1px solid rgba(255,255,255,0.06);
    }

    body:not(.light-mode-override) .toast {
        background: #1c2333;
        border: 1px solid rgba(255,255,255,0.1);
    }

    body:not(.light-mode-override) .back-to-top {
        background: #1c2333;
        border: 1px solid rgba(255,255,255,0.1);
    }

    body:not(.light-mode-override) .back-to-top:hover { background: #2d333b; }

    body:not(.light-mode-override) .toggle-slider { background: #2d333b; }

    body:not(.light-mode-override) .skeleton {
        background: linear-gradient(90deg, #161b22 25%, #1c2333 50%, #161b22 75%);
        background-size: 200% 100%;
    }

    body:not(.light-mode-override) .profile-bio { background: #161b22; }
    body:not(.light-mode-override) .sidebar-nav a:hover { background: #161b22; }
    body:not(.light-mode-override) .avatar-group .avatar { border-color: #0d1117; }
    body:not(.light-mode-override) .shortcut-table code { background: #1c2333; }
    body:not(.light-mode-override) .progress-bar-wrap { background: #1c2333; }

    body:not(.light-mode-override) .comment-form-card,
    body:not(.light-mode-override) .reply-form-container {
        background: #161b22;
        border-color: rgba(255,255,255,0.1);
    }

    body:not(.light-mode-override) .comment-item { border-bottom-color: rgba(255,255,255,0.06); }
    body:not(.light-mode-override) .comment-reply { border-bottom-color: rgba(255,255,255,0.06); }
    body:not(.light-mode-override) .comment-actions .btn-icon:hover { background: rgba(88,166,255,0.08); }
    body:not(.light-mode-override) .notification-item.unread { background: rgba(77,143,204,0.08); }

    body:not(.light-mode-override) .review-badge {
        background: rgba(245,127,23,0.15);
        color: #f5a623;
    }

    body:not(.light-mode-override) .badge-success {
        background: rgba(63,185,80,0.15);
        color: #3fb950;
    }

    body:not(.light-mode-override) .badge-muted {
        background: #1c2333;
        color: #8b949e;
    }

    body:not(.light-mode-override) .search-result-type { background: #1c2333; }
    body:not(.light-mode-override) .search-result-item h3 a { color: #e6edf3; }

    body:not(.light-mode-override) .feedback-type-btn {
        border-color: rgba(255,255,255,0.1);
        color: #8b949e;
    }

    body:not(.light-mode-override) .feedback-type-btn:hover {
        border-color: #4d8fcc;
        color: #4d8fcc;
    }

    body:not(.light-mode-override) .modal-overlay { background: rgba(0,0,0,0.6); }
    body:not(.light-mode-override) .bookmark-btn.bookmarked { background: rgba(77,143,204,0.12); }
    body:not(.light-mode-override) .project-card-thumb { background: #1c2333; }
    body:not(.light-mode-override) .section-label { color: #58a6ff; }
    body:not(.light-mode-override) .error-code { color: #4d8fcc; }

    body:not(.light-mode-override) .continue-reading-card {
        border-color: rgba(255,255,255,0.1);
        color: #e6edf3;
    }

    body:not(.light-mode-override) .continue-reading-card:hover { color: #e6edf3; }

    /* Auto-swap toggle icon for prefers-color-scheme */
    body:not(.light-mode-override) .theme-toggle .icon-moon {
        opacity: 0;
        transform: rotate(90deg) scale(0.5);
    }

    body:not(.light-mode-override) .theme-toggle .icon-sun {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }

    body:not(.light-mode-override) ::selection {
        background: rgba(88,166,255,0.3);
        color: #fff;
    }
}

/* =========================================
   DARK MODE - Manual Toggle (.dark-mode on body)
   ========================================= */
body.dark-mode {
    --primary-blue: #4d8fcc;
    --dark-blue: #a0c4e8;
    --mint: #7ec8c9;
    --purple-extra-dark: #b8a0d4;
    --purple-medium: #9a8bc8;
    --purple-light: #c4b5da;
    --tomato-dark: #e8a080;
    --tomato-medium: #e8845e;
    --tomato-light: #f0b89a;
    --pink-violet: #c07888;
    --pink: #c89090;
    --pink-misty: #7a5858;
    --chocolate: #d4a070;
    --orange: #f0a860;
    --amber: #f0cc60;
    --digital-dark: #e6edf3;
    --digital-key1: #58a6ff;
    --digital-key2: #6888e8;
    --digital-light: #1c2333;
    --digital-blue-2: #5888f8;
    --digital-blue-3: #58b8f8;
    --digital-blue-4: #2a4060;
    --digital-blue-5: #1c2a3e;
    --digital-yellow: #f0d830;
    --shadow-large: 0px 8px 56px rgba(0,0,0,0.3), 0px 32px 140px rgba(0,0,0,0.2);
    --shadow-small: 0px 1px 4px rgba(0,0,0,0.2), 0px 0px 8px rgba(0,0,0,0.15);
    --shadow-card: 0 2px 12px rgba(0,0,0,0.25);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.3);
    --shadow: 0 2px 8px rgba(0,0,0,0.25);
    --surface: #161b22;
    --border: rgba(255,255,255,0.1);
    --text: #e6edf3;
    --text-muted: #8b949e;
    background: #0d1117;
    color: #e6edf3;
}

body.dark-mode .nav {
    background: rgba(13, 17, 23, 0.92);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

@media (max-width: 992px) {
    body.dark-mode .nav-links {
        background: rgba(13, 17, 23, 0.98);
    }
}

@media (max-width: 768px) {
    body.dark-mode .nav-links {
        background: rgba(13, 17, 23, 0.98);
    }
    body.dark-mode .nav {
        background: rgba(13, 17, 23, 0.95) !important;
    }
}

body.dark-mode .quick-link-card,
body.dark-mode .service-card,
body.dark-mode .content-card,
body.dark-mode .announcement-item,
body.dark-mode .social-link,
body.dark-mode .contact-card,
body.dark-mode .account-card,
body.dark-mode .note-card,
body.dark-mode .feedback-form,
body.dark-mode .continue-reading,
body.dark-mode .faq-item,
body.dark-mode .modal,
body.dark-mode .cheat-sheet-card,
body.dark-mode .lab-card,
body.dark-mode .badge-card,
body.dark-mode .project-card,
body.dark-mode .rating-widget {
    background: #161b22;
    border-color: rgba(255,255,255,0.1);
}

body.dark-mode .quick-link-card p,
body.dark-mode .service-card p,
body.dark-mode .content-card p,
body.dark-mode .modal p {
    color: #8b949e;
}

body.dark-mode .service-card h3,
body.dark-mode .announcement-item h3,
body.dark-mode .announcement-item h3 a,
body.dark-mode .content-card h3 a,
body.dark-mode .faq-question,
body.dark-mode .modal h3,
body.dark-mode .dashboard-welcome h2,
body.dark-mode .section-header h2,
body.dark-mode .empty-state h3,
body.dark-mode .related-section h3,
body.dark-mode .comments-section h3,
body.dark-mode .comment-meta strong,
body.dark-mode .activity-title,
body.dark-mode .error-content h2 {
    color: #e6edf3;
}

body.dark-mode .section-description,
body.dark-mode .section-header p,
body.dark-mode .announcement-body,
body.dark-mode .announcement-date,
body.dark-mode .content-card .meta,
body.dark-mode .faq-item div,
body.dark-mode .faq-answer {
    color: #8b949e;
}

body.dark-mode .quick-link-card {
    color: #e6edf3;
}

body.dark-mode .nav-dropdown-menu {
    background: #1c2333;
    border: 1px solid rgba(255,255,255,0.1);
}

body.dark-mode .nav-dropdown-menu li a {
    color: #c9d1d9;
}

body.dark-mode .nav-dropdown-menu li a:hover {
    background: rgba(255,255,255,0.06);
}

body.dark-mode .dropdown-user-info {
    color: #8b949e;
    border-bottom-color: rgba(255,255,255,0.1);
}

body.dark-mode .section-alt {
    background: #161b22;
}

body.dark-mode .compare-table td,
body.dark-mode .manual-body table td,
body.dark-mode .psi-table td,
body.dark-mode .account-table td,
body.dark-mode .shortcut-table td {
    color: #c9d1d9;
    border-bottom-color: rgba(255,255,255,0.06);
}

body.dark-mode .compare-table tbody tr:nth-child(even) td,
body.dark-mode .manual-body table tbody tr:nth-child(even) td {
    background: rgba(255,255,255,0.02);
}

body.dark-mode .compare-table tbody tr:hover td,
body.dark-mode .manual-body table tbody tr:hover td,
body.dark-mode .psi-table tr:hover td,
body.dark-mode .account-table tr:hover {
    background: rgba(255,255,255,0.04);
}

body.dark-mode .compare-table,
body.dark-mode .manual-body table {
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

body.dark-mode .shortcut-table th {
    background: #161b22;
    color: #8b949e;
}

body.dark-mode .psi-input,
body.dark-mode .psi-textarea,
body.dark-mode .psi-select,
body.dark-mode .form-input,
body.dark-mode .search-input,
body.dark-mode .form-group input[type="text"],
body.dark-mode .form-group input[type="email"],
body.dark-mode .form-group input[type="url"],
body.dark-mode .form-group input[type="number"],
body.dark-mode .form-group textarea,
body.dark-mode .form-group select {
    background: #0d1117;
    color: #e6edf3;
    border-color: rgba(255,255,255,0.15);
}

body.dark-mode .psi-input::placeholder,
body.dark-mode .form-input::placeholder,
body.dark-mode .search-input::placeholder {
    color: #484f58;
}

body.dark-mode .form-group label,
body.dark-mode .psi-label {
    color: #c9d1d9;
}

body.dark-mode .btn-icon {
    background: #161b22;
    border-color: rgba(255,255,255,0.1);
    color: #8b949e;
}

body.dark-mode .btn-icon:hover {
    background: #1c2333;
    border-color: #4d8fcc;
    color: #4d8fcc;
}

body.dark-mode .filter-chip {
    background: #161b22;
    color: #8b949e;
    border-color: rgba(255,255,255,0.1);
}

body.dark-mode .filter-active {
    background: rgba(77,143,204,0.12);
}

body.dark-mode .os-switcher {
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

body.dark-mode .os-switcher .os-badge {
    background: #161b22;
    color: #8b949e;
    border-color: rgba(255,255,255,0.1);
}

body.dark-mode .os-switcher .os-badge:hover {
    background: #1c2333;
}

body.dark-mode .key-cap,
body.dark-mode kbd,
body.dark-mode .manual-body kbd {
    background: linear-gradient(180deg, #2d333b 0%, #1c2333 100%);
    border-color: rgba(255,255,255,0.15);
    color: #e6edf3;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.06);
}

body.dark-mode .key-cap:hover,
body.dark-mode kbd:hover,
body.dark-mode .manual-body kbd:hover {
    background: linear-gradient(180deg, #363d47 0%, #252d3a 100%);
    border-color: #4d8fcc;
    box-shadow: 0 2px 4px rgba(77,143,204,0.2), inset 0 1px 0 rgba(255,255,255,0.08);
}

body.dark-mode .manual-body code {
    background: rgba(88,166,255,0.1);
    color: #58a6ff;
    border-color: rgba(88,166,255,0.15);
}

body.dark-mode .manual-body h2 {
    color: #e6edf3;
    border-bottom-color: #7ec8c9;
}

body.dark-mode .manual-body h3 {
    color: #58a6ff;
}

body.dark-mode .manual-body hr {
    border-top-color: rgba(255,255,255,0.1);
}

body.dark-mode .manual-body p > b:first-child {
    color: #e6edf3;
}

body.dark-mode .page-content h2,
body.dark-mode .page-content h3 {
    color: #e6edf3;
}

body.dark-mode .toc {
    background: #161b22;
    border-color: rgba(255,255,255,0.1);
    border-left-color: #4d8fcc;
}

body.dark-mode .toc h4 {
    color: #4d8fcc;
}

body.dark-mode .toc ol li a {
    color: #c9d1d9;
}

body.dark-mode .alert-info {
    background: rgba(77,143,204,0.1);
    color: #58a6ff;
    border-left-color: #4d8fcc;
    border-color: rgba(77,143,204,0.2);
}

body.dark-mode .alert-success {
    background: rgba(34,197,94,0.1);
    color: #3fb950;
    border-left-color: #3fb950;
    border-color: rgba(34,197,94,0.2);
}

body.dark-mode .alert-warning {
    background: rgba(234,144,61,0.1);
    color: #d29922;
    border-left-color: #d29922;
    border-color: rgba(234,144,61,0.2);
}

body.dark-mode .alert-danger {
    background: rgba(225,99,59,0.1);
    color: #f85149;
    border-left-color: #f85149;
    border-color: rgba(225,99,59,0.2);
}

body.dark-mode .alert-info a { color: #58a6ff; }

body.dark-mode .tag {
    background: rgba(77,143,204,0.15);
    color: #58a6ff;
}

body.dark-mode .tag-sm {
    background: #1c2333;
    color: #8b949e;
}

body.dark-mode .breadcrumb { color: #8b949e; }
body.dark-mode .breadcrumb-sep { color: #484f58; }

body.dark-mode .pagination a,
body.dark-mode .pagination span { color: #8b949e; }

body.dark-mode .pagination a:hover {
    background: #1c2333;
    color: #e6edf3;
}

body.dark-mode .footer {
    background: rgba(13, 17, 23, 0.95);
    border-top: 1px solid rgba(255,255,255,0.06);
}

body.dark-mode .toast {
    background: #1c2333;
    border: 1px solid rgba(255,255,255,0.1);
}

body.dark-mode .back-to-top {
    background: #1c2333;
    border: 1px solid rgba(255,255,255,0.1);
}

body.dark-mode .back-to-top:hover { background: #2d333b; }
body.dark-mode .toggle-slider { background: #2d333b; }

body.dark-mode .skeleton {
    background: linear-gradient(90deg, #161b22 25%, #1c2333 50%, #161b22 75%);
    background-size: 200% 100%;
}

body.dark-mode .profile-bio { background: #161b22; }
body.dark-mode .sidebar-nav a:hover { background: #161b22; }
body.dark-mode .avatar-group .avatar { border-color: #0d1117; }
body.dark-mode .shortcut-table code { background: #1c2333; }
body.dark-mode .progress-bar-wrap { background: #1c2333; }

body.dark-mode .comment-form-card,
body.dark-mode .reply-form-container {
    background: #161b22;
    border-color: rgba(255,255,255,0.1);
}

body.dark-mode .comment-item { border-bottom-color: rgba(255,255,255,0.06); }
body.dark-mode .comment-reply { border-bottom-color: rgba(255,255,255,0.06); }
body.dark-mode .comment-actions .btn-icon:hover { background: rgba(88,166,255,0.08); }
body.dark-mode .notification-item.unread { background: rgba(77,143,204,0.08); }

body.dark-mode .review-badge {
    background: rgba(245,127,23,0.15);
    color: #f5a623;
}

body.dark-mode .badge-success {
    background: rgba(63,185,80,0.15);
    color: #3fb950;
}

body.dark-mode .badge-muted {
    background: #1c2333;
    color: #8b949e;
}

body.dark-mode .search-result-type { background: #1c2333; }
body.dark-mode .search-result-item h3 a { color: #e6edf3; }

body.dark-mode .feedback-type-btn {
    border-color: rgba(255,255,255,0.1);
    color: #8b949e;
}

body.dark-mode .feedback-type-btn:hover {
    border-color: #4d8fcc;
    color: #4d8fcc;
}

body.dark-mode .modal-overlay { background: rgba(0,0,0,0.6); }
body.dark-mode .bookmark-btn.bookmarked { background: rgba(77,143,204,0.12); }
body.dark-mode .project-card-thumb { background: #1c2333; }
body.dark-mode .section-label { color: #58a6ff; }
body.dark-mode .error-code { color: #4d8fcc; }

body.dark-mode .continue-reading-card {
    border-color: rgba(255,255,255,0.1);
    color: #e6edf3;
}

body.dark-mode .continue-reading-card:hover { color: #e6edf3; }

body.dark-mode ::selection {
    background: rgba(88,166,255,0.3);
    color: #fff;
}

/* =========================================
   TAG CLOUD
   ========================================= */
/* Horizontal scrolling tag strip */
.tag-strip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    margin: 0 auto;
    max-width: var(--container-width, 1200px);
    overflow: hidden;
    width: 100%;
    position: relative;
}
.tag-strip-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
    z-index: 1;
}
.tag-strip-scroll {
    display: flex;
    flex: 1;
    min-width: 0;
    gap: 0.4rem;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 0%, #000 92%, transparent 100%);
    mask-image: linear-gradient(to right, transparent, #000 0%, #000 92%, transparent 100%);
}
.tag-strip-scroll::-webkit-scrollbar { display: none; }
.tag-strip-scroll.dragging {
    cursor: grabbing;
    scroll-snap-type: none;
}
.tag-strip-scroll.dragging .tag-pill {
    pointer-events: none;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: rgba(0, 61, 165, 0.08);
    color: var(--primary-blue);
    text-decoration: none;
    font-family: var(--font-primary);
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.3;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.tag-pill:hover {
    background: var(--primary-blue);
    color: #fff;
    transform: translateY(-1px);
}

.tag-pill:hover .tag-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.tag-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4em;
    height: 1.4em;
    padding: 0 0.35em;
    border-radius: 999px;
    background: rgba(0, 61, 165, 0.12);
    color: var(--primary-blue);
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    transition: background 0.2s, color 0.2s;
}

/* Dark mode */
body.dark-mode .tag-strip-label { color: #8b949e; }
body.dark-mode .tag-pill { background: rgba(88,166,255,0.1); color: #58a6ff; }
body.dark-mode .tag-pill:hover { background: #58a6ff; color: #0d1117; }
body.dark-mode .tag-count { background: rgba(88,166,255,0.15); color: #58a6ff; }
body.dark-mode .tag-pill:hover .tag-count { background: rgba(13,17,23,0.2); color: #0d1117; }

/* =========================================
   NEWS & EVENTS SECTION
   ========================================= */
.news-events-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin-top: 1.5rem;
}

.news-events-col-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-primary);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-blue);
}

.news-events-col-title svg {
    flex-shrink: 0;
    color: var(--primary-blue);
}

/* --- News cards --- */
.news-card {
    display: block;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    background: #fff;
    border-radius: 10px;
    border: 1px solid rgba(0, 61, 165, 0.08);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 61, 165, 0.1);
    border-color: rgba(0, 61, 165, 0.18);
}

.news-card-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.news-date {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-blue);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.news-pin {
    font-size: 0.72rem;
    font-weight: 600;
    color: #d97706;
    background: rgba(217, 119, 6, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.news-card h4 {
    margin: 0 0 0.3rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-blue);
    line-height: 1.35;
}

.news-card p {
    margin: 0;
    font-size: 0.88rem;
    color: #5a6677;
    line-height: 1.5;
}

/* --- Event cards --- */
.event-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
    background: #fff;
    border-radius: 10px;
    border: 1px solid rgba(0, 61, 165, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 61, 165, 0.08);
}

.event-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    height: 54px;
    border-radius: 12px;
    background: var(--primary-blue);
    color: #fff;
    flex-shrink: 0;
}

.event-month {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1;
    opacity: 0.85;
}

.event-day {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.1;
}

/* Event date badge colors by type */
.event-badge-class { background: var(--primary-blue); }
.event-badge-exam { background: #dc2626; }
.event-badge-lab { background: #16a34a; }
.event-badge-event { background: #ea580c; }
.event-badge-deadline { background: #e11d48; }

.event-info {
    flex: 1;
    min-width: 0;
}

.event-info h4 {
    margin: 0 0 0.35rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark-blue);
    line-height: 1.3;
}

.event-details {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.event-type-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
}

.event-type-class { background: rgba(0, 61, 165, 0.1); color: var(--primary-blue); }
.event-type-exam { background: rgba(220, 38, 38, 0.1); color: #dc2626; }
.event-type-lab { background: rgba(22, 163, 74, 0.1); color: #16a34a; }
.event-type-event { background: rgba(234, 88, 12, 0.1); color: #ea580c; }
.event-type-deadline { background: rgba(225, 29, 72, 0.1); color: #e11d48; }

.event-time {
    font-size: 0.8rem;
    color: #5a6677;
    font-weight: 500;
}

.event-time::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #9ca3af;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.event-location {
    font-size: 0.8rem;
    color: #5a6677;
    font-weight: 500;
}

.event-location::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #9ca3af;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.news-column .btn,
.events-column .btn {
    margin-top: 0.5rem;
}

/* --- Responsive: stack on mobile --- */
@media (max-width: 768px) {
    .news-events-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* --- Dark mode --- */
body.dark-mode .news-events-col-title {
    color: #e6edf3;
    border-bottom-color: #58a6ff;
}

body.dark-mode .news-events-col-title svg { color: #58a6ff; }

body.dark-mode .news-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .news-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: rgba(88, 166, 255, 0.2);
}

body.dark-mode .news-card h4 { color: #e6edf3; }
body.dark-mode .news-card p { color: #8b949e; }
body.dark-mode .news-date { color: #58a6ff; }

body.dark-mode .event-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .event-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .event-info h4 { color: #e6edf3; }
body.dark-mode .event-time { color: #8b949e; }
body.dark-mode .event-location { color: #8b949e; }


/* =========================================
   FLOATING BACK BUTTON
   ========================================= */
.back-btn-float {
    position: fixed;
    bottom: 5rem;
    left: 1.5rem;
    z-index: 90;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 61, 165, 0.3);
    transition: transform 0.2s ease, background 0.2s ease, opacity 0.3s ease;
    text-decoration: none;
    opacity: 0.85;
}

.back-btn-float:hover {
    background: var(--digital-key1);
    transform: scale(1.1);
    opacity: 1;
}

.template-homepage .back-btn-float {
    display: none;
}

body.dark-mode .back-btn-float {
    background: #58a6ff;
    color: #0d1117;
    box-shadow: 0 4px 16px rgba(88, 166, 255, 0.3);
}

body.dark-mode .back-btn-float:hover {
    background: #79c0ff;
}

@media (max-width: 768px) {
    .back-btn-float {
        bottom: 4.5rem;
        left: 1rem;
        width: 40px;
        height: 40px;
    }
}

/* =========================================
   STATUS STRIP
   ========================================= */
.status-strip {
    padding: 0;
    margin-top: -1rem;
    position: relative;
    z-index: 3;
}

.status-strip .container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
}

.status-strip-grid {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.4rem 0 0.6rem;
}

.status-strip-grid::-webkit-scrollbar { display: none; }

.status-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(0, 20, 82, 0.06);
    box-shadow: 0 2px 8px rgba(0, 20, 82, 0.04);
    text-decoration: none;
    color: var(--dark-blue);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
}

.status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 20, 82, 0.08);
}

.status-number {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--primary-blue);
}

.status-number small { font-size: 0.75rem; font-weight: 600; opacity: 0.6; }

.status-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-top: 0.25rem;
}

.status-card-alert .status-number { color: #dc2626; }
.status-card-warn .status-number { color: #d97706; }

body.dark-mode .status-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
    color: #e6edf3;
}

body.dark-mode .status-card:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); }
body.dark-mode .status-number { color: #58a6ff; }
body.dark-mode .status-label { color: #8b949e; }
body.dark-mode .status-card-alert .status-number { color: #f85149; }
body.dark-mode .status-card-warn .status-number { color: #e3b341; }

@media (max-width: 768px) {
    .status-strip .container { padding: 0 1rem; }
    .status-card { min-width: 80px; padding: 0.5rem 0.75rem; }
    .status-number { font-size: 1.25rem; }
}

/* =========================================
   WIDGET TOGGLE (user show/hide sections)
   ========================================= */
.section-header {
    position: relative;
}

.section-header-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-header-inline .section-title {
    margin: 0;
}

.widget-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: rgba(0, 20, 82, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
    padding: 0;
}

.section-header-inline .widget-toggle {
    position: static;
}

.widget-toggle:hover {
    color: var(--primary-blue);
    background: rgba(0, 61, 165, 0.06);
}

.widget-toggle .icon-show {
    display: none;
}

.widget-section.collapsed .widget-toggle .icon-hide {
    display: none;
}

.widget-section.collapsed .widget-toggle .icon-show {
    display: block;
}

.widget-section.collapsed .cards-grid,
.widget-section.collapsed .lab-apps-mobile,
.widget-section.collapsed .quick-links-grid,
.widget-section.collapsed .widget-body,
.widget-section.collapsed .news-events-grid,
.widget-section.collapsed .continue-reading-grid,
.widget-section.collapsed .section-description,
.widget-section.collapsed .section-label {
    display: none !important;
}

.widget-section.collapsed .news-column .btn,
.widget-section.collapsed .events-column .btn {
    display: none;
}

.widget-section.collapsed {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.widget-section.collapsed .section-header {
    margin-bottom: 0;
}

.widget-section.collapsed .section-header-inline {
    margin-bottom: 0;
}

body.dark-mode .widget-toggle {
    color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .widget-toggle:hover {
    color: #58a6ff;
    background: rgba(88, 166, 255, 0.08);
}

/* =========================================
   HERO TICKER
   ========================================= */
.hero-ticker {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.hero-ticker-arrow {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease, transform 0.15s ease;
}

.hero-ticker-arrow:hover {
    color: #fff;
    transform: scale(1.15);
}

.hero-ticker-arrow:active {
    color: var(--mint);
}

.hero-ticker-track {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 1.6rem;
    overflow: hidden;
}

.hero-ticker-item {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.35s ease, transform 0.35s ease;
    line-height: 1.6rem;
}

.hero-ticker-item.active {
    position: relative;
    opacity: 1;
    transform: translateY(0);
}

.hero-ticker-item:hover {
    color: #fff;
}

.hero-ticker-tag {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.45rem;
    border-radius: 3px;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.ticker-tag-pinned {
    background: rgba(217, 119, 6, 0.35);
    color: #fbbf24;
}

.ticker-tag-news {
    background: rgba(88, 166, 255, 0.2);
    color: #93c5fd;
}

.ticker-tag-event {
    background: rgba(52, 211, 153, 0.2);
    color: #6ee7b7;
}

.ticker-tag-service {
    background: rgba(175, 223, 224, 0.25);
    color: #AFDFE0;
}

@media (max-width: 768px) {
    .hero-ticker-item {
        font-size: 0.85rem;
    }
}

/* =========================================
   STAFF EDIT BAR
   ========================================= */
.staff-edit-bar {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    display: flex;
    gap: 0.5rem;
    z-index: 5;
}

.staff-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.staff-edit-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

/* =========================================
   ADMIN FAB (Floating Action Button)
   ========================================= */
.admin-fab {
    position: fixed;
    bottom: 5.5rem;
    right: 1.5rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.fab-trigger {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--primary-blue);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 61, 165, 0.35), 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    position: relative;
    z-index: 2;
}

.fab-trigger:hover {
    background: var(--digital-key1);
    box-shadow: 0 6px 24px rgba(0, 61, 165, 0.45);
    transform: scale(1.05);
}

.fab-trigger .fab-icon-close {
    display: none;
}

.admin-fab.open .fab-trigger .fab-icon-open {
    display: none;
}

.admin-fab.open .fab-trigger .fab-icon-close {
    display: block;
}

.admin-fab.open .fab-trigger {
    background: #dc2626;
    transform: rotate(0);
}

.fab-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.admin-fab.open .fab-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.fab-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #fff;
    color: var(--dark-blue);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fab-action:hover {
    transform: translateX(-4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    color: var(--primary-blue);
}

.fab-action svg {
    flex-shrink: 0;
    color: var(--primary-blue);
}

body.dark-mode .fab-trigger {
    background: #58a6ff;
    color: #0d1117;
    box-shadow: 0 4px 16px rgba(88, 166, 255, 0.35);
}

body.dark-mode .fab-trigger:hover {
    background: #79c0ff;
}

body.dark-mode .admin-fab.open .fab-trigger {
    background: #f85149;
}

body.dark-mode .fab-action {
    background: #161b22;
    color: #e6edf3;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .fab-action:hover {
    color: #58a6ff;
}

body.dark-mode .fab-action svg {
    color: #58a6ff;
}

@media (max-width: 768px) {
    .admin-fab {
        bottom: 5rem;
        right: 1rem;
    }
    .fab-trigger {
        width: 46px;
        height: 46px;
    }
}

/* =========================================
   MOBILE BOTTOM NAVIGATION
   ========================================= */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: #fff;
        border-top: 1px solid rgba(0, 20, 82, 0.08);
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
        padding: 0.4rem 0;
        padding-bottom: max(0.4rem, env(safe-area-inset-bottom));
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.15rem;
        padding: 0.3rem 0;
        color: #6b7280;
        text-decoration: none;
        font-size: 0.65rem;
        font-weight: 500;
        transition: color 0.15s ease;
        position: relative;
    }

    .mobile-nav-item.active {
        color: var(--primary-blue);
    }

    .mobile-nav-item.active svg {
        stroke-width: 2.5;
    }

    .mobile-nav-item:active {
        color: var(--primary-blue);
    }

    .mobile-nav-badge {
        position: absolute;
        top: 0;
        right: 50%;
        transform: translateX(calc(50% + 10px));
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 8px;
        background: #dc2626;
        color: #fff;
        font-size: 0.6rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

    /* Add bottom padding to body so content isn't hidden behind bottom nav */
    body {
        padding-bottom: 60px;
    }

    /* Move back button and FAB above bottom nav */
    .back-btn-float {
        bottom: 5rem;
    }

    .admin-fab {
        bottom: 5.5rem;
    }

    /* Hide back-to-top when at bottom to avoid overlap */
    .back-to-top {
        bottom: 5rem;
    }

    body.dark-mode .mobile-bottom-nav {
        background: #161b22;
        border-top-color: rgba(255, 255, 255, 0.06);
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.3);
    }

    body.dark-mode .mobile-nav-item {
        color: #8b949e;
    }

    body.dark-mode .mobile-nav-item.active {
        color: #58a6ff;
    }
}

/* =========================================
   NEWS CARD DISMISS / MARK READ
   ========================================= */
.news-card-wrap {
    position: relative;
    margin-bottom: 0.75rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.news-card-wrap .news-card {
    margin-bottom: 0;
}

.news-card-wrap.dismissed {
    opacity: 0;
    transform: translateX(30px);
    pointer-events: none;
}

.news-dismiss {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    color: rgba(0, 61, 165, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s ease;
    padding: 0;
    z-index: 2;
}

.news-dismiss:hover {
    color: #16a34a;
    background: rgba(22, 163, 74, 0.1);
}

.news-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.news-mark-all {
    background: transparent;
    border: 1px solid rgba(0, 61, 165, 0.15);
    color: var(--primary-blue);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    transition: all 0.15s ease;
}

.news-mark-all:hover {
    background: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
}

body.dark-mode .news-dismiss {
    color: rgba(255, 255, 255, 0.15);
}

body.dark-mode .news-dismiss:hover {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

body.dark-mode .news-mark-all {
    border-color: rgba(88, 166, 255, 0.2);
    color: #58a6ff;
}

body.dark-mode .news-mark-all:hover {
    background: #58a6ff;
    color: #0d1117;
}

/* =========================================
   GLOBAL SEARCH OVERLAY
   ========================================= */
.search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 20, 82, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    animation: search-overlay-in 0.2s ease;
}
@media (prefers-reduced-motion: reduce) {
    .search-overlay { animation: none; }
}
@keyframes search-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.search-overlay.active {
    display: flex;
}
.search-overlay-box {
    background: #fff;
    border-radius: 16px;
    width: 92%;
    max-width: 640px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0,20,82,0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 75vh;
}

/* Input area */
.search-overlay-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 1.25rem;
    border-bottom: 1px solid rgba(0, 20, 82, 0.06);
}
.search-overlay-icon {
    flex-shrink: 0;
    color: var(--primary-blue);
    opacity: 0.5;
}
.search-overlay-input {
    flex: 1;
    padding: 1rem 0;
    border: none;
    outline: none;
    font-size: 1.1rem;
    font-family: var(--font-primary);
    color: var(--dark-blue);
    background: transparent;
    min-width: 0;
}
.search-overlay-input::placeholder {
    color: #9ca3af;
}
.search-overlay-shortcut-badge {
    flex-shrink: 0;
    padding: 0.15rem 0.5rem;
    background: rgba(0, 20, 82, 0.06);
    border-radius: 5px;
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
}

/* Filter pills */
.search-overlay-filters {
    display: flex;
    gap: 0.3rem;
    padding: 0.5rem 1.25rem;
    border-bottom: 1px solid rgba(0, 20, 82, 0.04);
    flex-wrap: wrap;
}
.search-filter-pill {
    padding: 0.25rem 0.65rem;
    border: 1.5px solid var(--border, #dee2e8);
    border-radius: 14px;
    background: transparent;
    color: var(--text-secondary, #64748b);
    font-size: 0.72rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.search-filter-pill:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}
.search-filter-pill.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: #fff;
}

/* Results */
.search-overlay-results {
    flex: 1;
    overflow-y: auto;
    padding: 0.4rem 0;
    scroll-behavior: smooth;
}
.search-overlay-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.6rem 1.25rem;
    text-decoration: none;
    color: var(--dark-blue);
    transition: background 0.1s ease;
    cursor: pointer;
    border-left: 3px solid transparent;
}
.search-overlay-item:hover,
.search-overlay-item.highlighted {
    background: rgba(0, 61, 165, 0.04);
    border-left-color: var(--primary-blue);
}
.search-overlay-item-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-top: 0.1rem;
}
.search-overlay-item-icon.cat-manual { background: rgba(0,61,165,0.08); }
.search-overlay-item-icon.cat-video { background: rgba(99,83,157,0.1); }
.search-overlay-item-icon.cat-news { background: rgba(225,99,59,0.1); }
.search-overlay-item-icon.cat-event { background: rgba(0,61,165,0.08); }
.search-overlay-item-icon.cat-faq { background: rgba(175,223,224,0.3); }
.search-overlay-item-icon.cat-glossary { background: rgba(99,83,157,0.08); }
.search-overlay-item-icon.cat-project { background: rgba(225,99,59,0.08); }
.search-overlay-item-icon.cat-page { background: rgba(0,20,82,0.05); }
.search-overlay-item-icon.cat-nav { background: rgba(0,61,165,0.06); }
.search-overlay-item-icon.cat-recent { background: rgba(0,20,82,0.04); }

.search-overlay-item-body {
    flex: 1;
    min-width: 0;
}
.search-overlay-item-title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.search-overlay-item-title mark {
    background: rgba(0, 61, 165, 0.12);
    color: var(--dark-blue);
    border-radius: 2px;
    padding: 0 1px;
}
.search-item-badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    white-space: nowrap;
}
.search-item-badge.new-badge {
    background: #dcfce7;
    color: #166534;
}
.search-item-badge.pinned-badge {
    background: #fef3c7;
    color: #92400e;
}
.search-overlay-item-excerpt {
    font-size: 0.78rem;
    color: var(--text-secondary, #64748b);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.1rem;
}
.search-overlay-item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.68rem;
    color: #9ca3af;
    margin-top: 0.15rem;
}
.search-overlay-item-breadcrumb {
    font-size: 0.68rem;
    color: #9ca3af;
}
.search-overlay-item-type {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Category headers */
.search-overlay-category {
    padding: 0.6rem 1.25rem 0.2rem;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.search-overlay-category::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0,20,82,0.06);
}

/* Hint / empty states */
.search-overlay-hint {
    padding: 0.75rem 1.25rem;
    font-size: 0.8rem;
    color: #9ca3af;
    text-align: center;
}
.search-overlay-empty {
    text-align: center;
    padding: 2rem 1.25rem;
    color: #9ca3af;
}
.search-overlay-empty svg { margin-bottom: 0.5rem; opacity: 0.4; }
.search-overlay-empty h4 { margin: 0 0 0.3rem; font-size: 0.95rem; color: var(--text-secondary); }
.search-overlay-empty p { font-size: 0.82rem; margin: 0; }
.search-overlay-empty a { color: var(--primary-blue); text-decoration: underline; }

/* Loading skeleton */
.search-overlay-loading {
    padding: 0.5rem 1.25rem;
}
.search-skel-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0;
}
.search-skel-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(0,20,82,0.06);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    background-size: 200% 100%;
    background-image: linear-gradient(90deg, rgba(0,20,82,0.06) 25%, rgba(0,20,82,0.02) 50%, rgba(0,20,82,0.06) 75%);
    flex-shrink: 0;
}
.search-skel-lines { flex: 1; }
.search-skel-line {
    height: 0.7rem;
    border-radius: 4px;
    background: rgba(0,20,82,0.06);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    background-size: 200% 100%;
    background-image: linear-gradient(90deg, rgba(0,20,82,0.06) 25%, rgba(0,20,82,0.02) 50%, rgba(0,20,82,0.06) 75%);
    margin-bottom: 0.35rem;
}
.search-skel-line:last-child { width: 50%; margin-bottom: 0; }

/* Recent searches */
.search-recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.search-recent-remove {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.2rem;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.15s;
}
.search-overlay-item:hover .search-recent-remove {
    opacity: 1;
}
.search-clear-recent {
    display: block;
    text-align: center;
    padding: 0.4rem;
    font-size: 0.72rem;
    color: var(--primary-blue);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    font-family: inherit;
}
.search-clear-recent:hover { text-decoration: underline; }

/* Footer */
.search-overlay-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1.25rem;
    border-top: 1px solid rgba(0, 20, 82, 0.06);
    font-size: 0.68rem;
    color: #9ca3af;
}
.search-overlay-footer kbd {
    display: inline-block;
    padding: 0.05rem 0.35rem;
    background: rgba(0, 20, 82, 0.06);
    border-radius: 3px;
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    font-weight: 600;
    color: #6b7280;
    margin-right: 0.15rem;
}
.search-overlay-footer-right { margin-left: auto; }
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Dark mode */
body.dark-mode .search-overlay { background: rgba(0, 0, 0, 0.65); }
body.dark-mode .search-overlay-box { background: #161b22; box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px #30363d; }
body.dark-mode .search-overlay-input-wrap { border-bottom-color: #30363d; }
body.dark-mode .search-overlay-input { color: #e6edf3; }
body.dark-mode .search-overlay-icon { color: #58a6ff; }
body.dark-mode .search-overlay-shortcut-badge { background: #21262d; color: #8b949e; }
body.dark-mode .search-overlay-filters { border-bottom-color: #21262d; }
body.dark-mode .search-filter-pill { border-color: #30363d; color: #8b949e; }
body.dark-mode .search-filter-pill:hover { border-color: #58a6ff; color: #58a6ff; }
body.dark-mode .search-filter-pill.active { background: #388bfd; border-color: #388bfd; color: #fff; }
body.dark-mode .search-overlay-item { color: #e6edf3; }
body.dark-mode .search-overlay-item:hover,
body.dark-mode .search-overlay-item.highlighted { background: rgba(56,139,253,0.06); border-left-color: #388bfd; }
body.dark-mode .search-overlay-item-title mark { background: rgba(56,139,253,0.2); color: #e6edf3; }
body.dark-mode .search-overlay-category { color: #484f58; }
body.dark-mode .search-overlay-category::after { background: #21262d; }
body.dark-mode .search-overlay-footer { border-top-color: #21262d; }
body.dark-mode .search-overlay-footer kbd { background: #21262d; color: #8b949e; }
body.dark-mode .search-item-badge.new-badge { background: #0d3321; color: #3fb950; }
body.dark-mode .search-overlay-empty h4 { color: #e6edf3; }
body.dark-mode .search-skel-icon,
body.dark-mode .search-skel-line {
    background-image: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
}

@media (max-width: 768px) {
    .search-overlay { padding-top: 5vh; }
    .search-overlay-box { width: 96%; max-height: 85vh; border-radius: 12px; }
    .search-overlay-filters { gap: 0.25rem; padding: 0.4rem 0.75rem; }
    .search-filter-pill { padding: 0.2rem 0.5rem; font-size: 0.68rem; }
    .search-overlay-item { padding: 0.5rem 0.75rem; }
    .search-overlay-footer { padding: 0.4rem 0.75rem; gap: 0.5rem; }
}

/* =========================================
   SKELETON LOADING
   ========================================= */
@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, rgba(0,20,82,0.06) 25%, rgba(0,20,82,0.02) 50%, rgba(0,20,82,0.06) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1rem;
    width: 60%;
    margin-bottom: 0.5rem;
}

.skeleton-text-short {
    height: 0.75rem;
    width: 35%;
}

.skeleton-card {
    height: 3.5rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.search-loading .search-overlay-results {
    padding: 1rem 1.5rem;
}

body.dark-mode .skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* Navigation dropdown groups */
.dropdown-group {
    padding: 0 !important;
}

.dropdown-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--primary-blue);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: color 0.15s ease;
}

.dropdown-group-toggle:hover {
    color: var(--digital-key1);
}

.dropdown-group-toggle svg {
    transition: transform 0.2s ease;
}

.dropdown-group-toggle.collapsed svg {
    transform: rotate(-90deg);
}

.dropdown-group-items {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.dropdown-group-items.collapsed {
    max-height: 0;
}

.dropdown-group-items li a {
    padding-left: 2rem !important;
    font-size: 0.85rem;
}

body.dark-mode .dropdown-group-toggle {
    color: #58a6ff;
}

body.dark-mode .dropdown-group-toggle:hover {
    color: #79c0ff;
}

/* (search-overlay-category moved to main search block above) */


/* =========================================
   KID-FRIENDLY ANIMATIONS & EFFECTS
   ========================================= */

/* 1. Animated gradient background for hero section */
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.hero-compact {
    background: linear-gradient(-45deg, #003DA5, #012FD7, #291849, #63539D) !important;
    background-size: 400% 400% !important;
    animation: gradient-shift 15s ease infinite !important;
}

/* 2. Button ripple effect */
.btn { position: relative; overflow: hidden; }
.btn .ripple {
    position: absolute; border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transform: scale(0); animation: ripple-anim 0.6s linear;
    pointer-events: none;
}
@keyframes ripple-anim {
    to { transform: scale(4); opacity: 0; }
}

/* 3. Bouncy card hover */
.quick-link-card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease !important;
}
.quick-link-card:hover {
    transform: translateY(-8px) scale(1.03) !important;
    box-shadow: 0 12px 32px rgba(0,61,165,0.18) !important;
}

/* 4. Animated status strip cards with glowing pulse */
.status-card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease !important;
}
.status-card:hover {
    transform: translateY(-4px) scale(1.05) !important;
}
.status-card-alert { animation: pulse-alert 2s ease infinite; }
@keyframes pulse-alert {
    0%, 100% { box-shadow: 0 0 0 0 rgba(225,99,59,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(225,99,59,0); }
}

/* 5. Confetti burst animation */
@keyframes confetti-fall {
    0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
.confetti-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9999; overflow: hidden; }
.confetti-piece {
    position: absolute; width: 10px; height: 10px; top: -10px;
    animation: confetti-fall 3s ease-in-out forwards;
}

/* 6. Animated floating particles in hero background */
@keyframes float-particle {
    0%, 100% { transform: translateY(0) translateX(0) scale(1); opacity: 0.3; }
    25% { transform: translateY(-20px) translateX(10px) scale(1.1); opacity: 0.6; }
    50% { transform: translateY(-10px) translateX(-10px) scale(0.9); opacity: 0.4; }
    75% { transform: translateY(-30px) translateX(5px) scale(1.05); opacity: 0.5; }
}
.hero-particles { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; pointer-events: none; }
.hero-particle {
    position: absolute; border-radius: 50%; background: rgba(175,223,224,0.3);
}

/* 7. Typewriter cursor for hero greeting */
@keyframes blink-cursor {
    0%, 100% { border-color: transparent; }
    50% { border-color: var(--mint); }
}
.typewriter-cursor {
    border-right: 3px solid var(--mint);
    animation: blink-cursor 0.7s infinite;
    padding-right: 4px;
}

/* 8. Rainbow border on focus for search */
@keyframes rainbow-border {
    0% { border-color: #003DA5; }
    25% { border-color: #63539D; }
    50% { border-color: #E1633B; }
    75% { border-color: #FACC46; }
    100% { border-color: #003DA5; }
}
.search-overlay-input:focus {
    animation: rainbow-border 3s linear infinite !important;
    border-width: 2px !important;
}

/* 9. Emoji wobble animation for reactions */
@keyframes emoji-wobble {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg) scale(1.2); }
    50% { transform: rotate(10deg) scale(1.3); }
    75% { transform: rotate(-5deg) scale(1.1); }
}
.emoji-react { cursor: pointer; display: inline-block; font-size: 1.2rem; transition: transform 0.2s; user-select: none; padding: 0.25rem; }
.emoji-react:hover { animation: emoji-wobble 0.5s ease; }
.emoji-react.selected { transform: scale(1.3); }
.emoji-react-bar { display: flex; gap: 0.25rem; padding: 0.5rem 0; }

/* 10. Streak flame animation */
@keyframes flame-flicker {
    0%, 100% { transform: scaleY(1) scaleX(1); }
    25% { transform: scaleY(1.1) scaleX(0.95); }
    50% { transform: scaleY(0.95) scaleX(1.05); }
    75% { transform: scaleY(1.05) scaleX(0.98); }
}
.streak-flame { display: inline-block; animation: flame-flicker 0.4s ease infinite; }

/* 11. Fun news card entrance animation */
@keyframes slide-in-right {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.news-card-wrap {
    animation: slide-in-right 0.5s ease forwards;
}
.news-card-wrap:nth-child(1) { animation-delay: 0s; }
.news-card-wrap:nth-child(2) { animation-delay: 0.1s; }
.news-card-wrap:nth-child(3) { animation-delay: 0.2s; }
.news-card-wrap:nth-child(4) { animation-delay: 0.3s; }
.news-card-wrap:nth-child(5) { animation-delay: 0.4s; }

/* 12. Colorful gradient borders on service cards */
.service-card::before {
    content: ''; position: absolute; top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(135deg, #003DA5, #63539D, #E1633B, #FACC46, #AFDFE0, #003DA5);
    background-size: 300% 300%;
    border-radius: inherit; z-index: -1; opacity: 0;
    animation: gradient-shift 4s ease infinite;
    transition: opacity 0.3s ease;
}
.service-card { position: relative !important; z-index: 1 !important; }
.service-card:hover::before { opacity: 1; }

/* 13. Achievement badge glow */
@keyframes badge-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(0,61,165,0.3); }
    50% { box-shadow: 0 0 20px rgba(0,61,165,0.6), 0 0 40px rgba(0,61,165,0.2); }
}
.badge-earned { animation: badge-glow 2s ease infinite; }

/* 14. Fun loading spinner */
@keyframes spin-bounce {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}
.fun-spinner {
    width: 40px; height: 40px;
    border: 4px solid var(--mint);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin-bounce 1s ease infinite;
}

/* 15. Tooltip with bounce-in */
@keyframes tooltip-bounce {
    0% { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.8); }
    60% { transform: translateX(-50%) translateY(-4px) scale(1.05); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.tooltip-fun {
    position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%); background: var(--digital-dark);
    color: white; padding: 0.5rem 0.75rem; border-radius: 8px;
    font-size: 0.75rem; white-space: nowrap;
    pointer-events: none; opacity: 0;
    animation: tooltip-bounce 0.3s ease forwards;
    z-index: 100;
}
.tooltip-fun::after {
    content: ''; position: absolute; top: 100%; left: 50%;
    transform: translateX(-50%); border: 6px solid transparent;
    border-top-color: var(--digital-dark);
}

/* 16. Event card date badge pop */
.event-date-badge {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
.event-card:hover .event-date-badge {
    transform: scale(1.15) rotate(-3deg) !important;
}

/* 17. Interactive progress bar with shimmer */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.progress-bar-fill {
    background: linear-gradient(90deg, var(--primary-blue) 0%, var(--digital-blue-2) 40%, var(--mint) 50%, var(--digital-blue-2) 60%, var(--primary-blue) 100%) !important;
    background-size: 200% 100% !important;
    animation: shimmer 2s linear infinite !important;
}

/* 18. Mobile bottom nav with active bounce */
.mobile-nav-item.active svg {
    animation: bounce-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes bounce-in {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* 19. Quick link icon spin on hover */
.quick-link-card svg {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
.quick-link-card:hover svg {
    transform: rotate(360deg) scale(1.2) !important;
}

/* 20. Toast notification slide-in with bounce */
.toast {
    animation: toast-slide 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
@keyframes toast-slide {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}


/* =========================================
   DARK MODE — KID-FRIENDLY ANIMATIONS
   ========================================= */
body.dark-mode .hero-compact {
    background: linear-gradient(-45deg, #020D2A, #001452, #291849, #000871) !important;
    background-size: 400% 400% !important;
    animation: gradient-shift 15s ease infinite !important;
}
body.dark-mode .service-card::before {
    background: linear-gradient(135deg, #012FD7, #63539D, #E1633B, #FACC46, #AFDFE0, #012FD7);
}
body.dark-mode .quick-link-card:hover {
    box-shadow: 0 12px 32px rgba(1,47,215,0.25) !important;
}
body.dark-mode .badge-earned {
    animation: badge-glow-dark 2s ease infinite;
}
@keyframes badge-glow-dark {
    0%, 100% { box-shadow: 0 0 5px rgba(1,47,215,0.4); }
    50% { box-shadow: 0 0 20px rgba(1,47,215,0.7), 0 0 40px rgba(1,47,215,0.3); }
}
body.dark-mode .status-card-alert {
    animation: pulse-alert-dark 2s ease infinite;
}
@keyframes pulse-alert-dark {
    0%, 100% { box-shadow: 0 0 0 0 rgba(225,99,59,0.3); }
    50% { box-shadow: 0 0 0 8px rgba(225,99,59,0); }
}
body.dark-mode .tooltip-fun {
    background: #161b22;
    color: #e6edf3;
    border: 1px solid rgba(255,255,255,0.1);
}
body.dark-mode .tooltip-fun::after {
    border-top-color: #161b22;
}
body.dark-mode .fun-spinner {
    border-color: rgba(175,223,224,0.3);
    border-top-color: #58a6ff;
}
body.dark-mode .hero-particle {
    background: rgba(88,166,255,0.2);
}
body.dark-mode .progress-bar-fill {
    background: linear-gradient(90deg, #012FD7 0%, #58a6ff 40%, #AFDFE0 50%, #58a6ff 60%, #012FD7 100%) !important;
}


/* =========================================
   WAVE EMOJI & FUN ELEMENTS
   ========================================= */
@keyframes wave-hand {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    30% { transform: rotate(14deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(10deg); }
    60% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}
.wave-emoji {
    display: inline-block;
    animation: wave-hand 2.5s ease-in-out infinite;
    transform-origin: 70% 70%;
    font-size: 0.85em;
}

.fun-tip {
    display: block;
    font-size: 0.75rem;
    margin-top: 0.5rem;
    padding: 0.35rem 0.5rem;
    background: rgba(175,223,224,0.15);
    border-radius: 6px;
    color: var(--text-muted);
    border-left: 3px solid var(--mint);
}
body.dark-mode .fun-tip {
    background: rgba(175,223,224,0.08);
    color: #8b949e;
}

/* Daily Tip Section */
.daily-tip-section {
    padding: 0.75rem 0;
}
.daily-tip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, rgba(175,223,224,0.15), rgba(0,61,165,0.08));
    border: 1px solid rgba(175,223,224,0.3);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    position: relative;
    overflow: hidden;
    animation: slide-in-right 0.5s ease forwards;
}
.daily-tip::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}
.daily-tip-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    z-index: 1;
}
.daily-tip-content {
    flex: 1;
    z-index: 1;
}
.daily-tip-content strong {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary-blue);
    margin-bottom: 0.15rem;
}
.daily-tip-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text);
}
.daily-tip-dismiss {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 1;
    line-height: 1;
}
.daily-tip-dismiss:hover {
    background: rgba(0,0,0,0.1);
    transform: scale(1.2);
}

body.dark-mode .daily-tip {
    background: linear-gradient(135deg, rgba(88,166,255,0.08), rgba(1,47,215,0.1));
    border-color: rgba(88,166,255,0.15);
}
body.dark-mode .daily-tip-content strong {
    color: #58a6ff;
}
body.dark-mode .daily-tip-content p {
    color: #e6edf3;
}
body.dark-mode .daily-tip-dismiss {
    color: #8b949e;
}
body.dark-mode .daily-tip-dismiss:hover {
    background: rgba(255,255,255,0.1);
}

/* Section emoji decorations */
.section-emoji {
    font-size: 1.2em;
    margin-right: 0.35rem;
    display: inline-block;
    animation: bounce-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Greeting emoji animation */
.greeting-emoji {
    display: inline-block;
    font-size: 1.1em;
    animation: wave-hand 2.5s ease-in-out infinite;
    transform-origin: 70% 70%;
}

/* =========================================
   HUMOR & EXTRA ANIMATIONS FOR KIDS
   ========================================= */

/* Animated mascot bounce */
@keyframes mascot-bounce {
    0%, 100% { transform: translateX(0) translateY(0) scaleX(1); }
    5%  { transform: translateX(6px) translateY(-10px) scaleX(1) rotate(5deg); }
    10% { transform: translateX(12px) translateY(0) scaleX(1) scaleY(0.92); }
    15% { transform: translateX(18px) translateY(-12px) scaleX(1) rotate(-4deg); }
    20% { transform: translateX(24px) translateY(0) scaleX(1); }
    25% { transform: translateX(28px) translateY(-8px) scaleX(1) rotate(6deg); }
    30% { transform: translateX(32px) translateY(0) scaleX(1); }
    /* pause & wave */
    35% { transform: translateX(32px) translateY(0) scaleX(1) rotate(0deg); }
    38% { transform: translateX(32px) translateY(-5px) scaleX(1) rotate(12deg); }
    41% { transform: translateX(32px) translateY(0) scaleX(1) rotate(-8deg); }
    44% { transform: translateX(32px) translateY(0) scaleX(1) rotate(0deg); }
    /* walk back (flipped) */
    48% { transform: translateX(28px) translateY(0) scaleX(-1); }
    52% { transform: translateX(22px) translateY(-11px) scaleX(-1) rotate(5deg); }
    56% { transform: translateX(16px) translateY(0) scaleX(-1) scaleY(0.93); }
    60% { transform: translateX(10px) translateY(-13px) scaleX(-1) rotate(-5deg); }
    64% { transform: translateX(4px) translateY(0) scaleX(-1); }
    68% { transform: translateX(-2px) translateY(-9px) scaleX(-1) rotate(4deg); }
    72% { transform: translateX(-6px) translateY(0) scaleX(-1); }
    /* pause at left */
    76% { transform: translateX(-6px) translateY(0) scaleX(-1) rotate(0deg); }
    79% { transform: translateX(-6px) translateY(-4px) scaleX(-1) rotate(-10deg); }
    82% { transform: translateX(-6px) translateY(0) scaleX(-1) rotate(6deg); }
    /* walk back to start */
    86% { transform: translateX(-4px) translateY(0) scaleX(1); }
    90% { transform: translateX(-2px) translateY(-8px) scaleX(1) rotate(3deg); }
    95% { transform: translateX(0px) translateY(0) scaleX(1); }
}
.mascot {
    display: inline-block;
    font-size: 2.5rem;
    cursor: pointer;
    user-select: none;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

/* Fun hover messages that pop up */
.hover-joke {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: #fff;
    border: 2px solid var(--primary-blue);
    border-radius: 16px;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 50;
    pointer-events: none;
}
.hover-joke::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--primary-blue);
}
*:hover > .hover-joke {
    transform: translateX(-50%) scale(1);
}
body.dark-mode .hover-joke {
    background: #161b22;
    color: #e6edf3;
    border-color: #58a6ff;
}
body.dark-mode .hover-joke::after {
    border-top-color: #58a6ff;
}

/* Jelly wobble on click */
@keyframes jelly {
    0% { transform: scale(1, 1); }
    25% { transform: scale(0.9, 1.1); }
    50% { transform: scale(1.1, 0.9); }
    75% { transform: scale(0.95, 1.05); }
    100% { transform: scale(1, 1); }
}
.jelly-click {
    animation: jelly 0.5s ease !important;
}

/* Wiggle animation for attention */
@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(6deg); }
    30% { transform: rotate(-6deg); }
    45% { transform: rotate(4deg); }
    60% { transform: rotate(-3deg); }
    75% { transform: rotate(1deg); }
}
.wiggle-attention {
    animation: wiggle 0.8s ease-in-out;
}

/* Rubber band effect */
@keyframes rubber-band {
    0% { transform: scale(1); }
    30% { transform: scaleX(1.25) scaleY(0.75); }
    40% { transform: scaleX(0.75) scaleY(1.25); }
    50% { transform: scaleX(1.15) scaleY(0.85); }
    65% { transform: scaleX(0.95) scaleY(1.05); }
    75% { transform: scaleX(1.05) scaleY(0.95); }
    100% { transform: scale(1); }
}

/* Floating emoji rain */
@keyframes emoji-rain {
    0% { transform: translateY(-100%) rotate(0deg); opacity: 1; }
    100% { transform: translateY(calc(100vh + 50px)) rotate(360deg); opacity: 0.3; }
}
.emoji-rain-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
}
.emoji-rain-drop {
    position: absolute;
    top: -50px;
    font-size: 1.5rem;
    animation: emoji-rain linear forwards;
    pointer-events: none;
}

/* Fun cursor trail */
.cursor-sparkle {
    position: fixed;
    pointer-events: none;
    font-size: 1rem;
    z-index: 9999;
    animation: sparkle-fade 0.6s ease forwards;
}
@keyframes sparkle-fade {
    0% { opacity: 1; transform: scale(1) translateY(0); }
    100% { opacity: 0; transform: scale(0.3) translateY(-30px); }
}
@keyframes shake {
    0%, 100% { transform: translate(-50%,-50%) rotate(0); }
    20% { transform: translate(-50%,-50%) translateX(-8px) rotate(-3deg); }
    40% { transform: translate(-50%,-50%) translateX(8px) rotate(3deg); }
    60% { transform: translate(-50%,-50%) translateX(-5px) rotate(-2deg); }
    80% { transform: translate(-50%,-50%) translateX(5px) rotate(2deg); }
}

/* Fun 404 mascot cry */
@keyframes cry-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Motivational quote banner */
.motivation-banner {
    text-align: center;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(0,61,165,0.05), rgba(99,83,157,0.05));
    border-radius: 12px;
    margin: 1rem 0;
    font-style: italic;
    color: var(--text-muted);
    position: relative;
    overflow: hidden;
}
.motivation-banner::before {
    content: '"';
    position: absolute;
    left: 1rem;
    top: -0.5rem;
    font-size: 4rem;
    font-family: var(--font-accent);
    color: rgba(0,61,165,0.1);
    line-height: 1;
}
.motivation-banner .quote-text {
    font-family: var(--font-accent);
    font-size: 1.05rem;
    position: relative;
    z-index: 1;
}
.motivation-banner .quote-author {
    display: block;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    font-style: normal;
    opacity: 0.7;
}
body.dark-mode .motivation-banner {
    background: linear-gradient(135deg, rgba(88,166,255,0.05), rgba(99,83,157,0.08));
}
body.dark-mode .motivation-banner::before {
    color: rgba(88,166,255,0.1);
}
body.dark-mode .motivation-banner .quote-text {
    color: #c9d1d9;
}

/* Emoji cursor on service cards */
.service-card { cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32'><text y='24' font-size='24'>🖱️</text></svg>") 16 16, pointer !important; }

/* Playful card tilt on touch */
@keyframes card-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* XP bar styling */
.xp-bar-wrap {
    background: rgba(0,0,0,0.08);
    border-radius: 20px;
    height: 10px;
    overflow: hidden;
    margin-top: 0.5rem;
}
.xp-bar-fill {
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(90deg, #FACC46, #EA903D, #E1633B);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.xp-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: flex;
    justify-content: space-between;
}
body.dark-mode .xp-bar-wrap {
    background: rgba(255,255,255,0.08);
}

/* Fun loading messages */
.fun-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
}
.fun-loader-emoji {
    font-size: 3rem;
    animation: mascot-bounce 1.5s ease-in-out infinite;
}
.fun-loader-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Sticker effect on badges */
@keyframes sticker-peel {
    0% { transform: perspective(400px) rotateY(0deg); }
    50% { transform: perspective(400px) rotateY(15deg); }
    100% { transform: perspective(400px) rotateY(0deg); }
}
.status-card:hover .status-label {
    animation: wiggle 0.5s ease-in-out;
}

/* Service card icon pulse on hover */
.service-card:hover .service-card-icon {
    animation: rubber-band 0.8s ease;
}

/* Fun empty states */
.empty-state-fun {
    text-align: center;
    padding: 2rem;
}
.empty-state-emoji {
    font-size: 3rem;
    animation: mascot-bounce 2s ease-in-out infinite;
    margin-bottom: 0.5rem;
}
.empty-state-text {
    font-size: 1rem;
    color: var(--text-muted);
}
.empty-state-subtext {
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* Gateway (login page) fun animations */
.gateway-logo {
    animation: mascot-bounce 3s ease-in-out infinite !important;
}
.gateway-tagline {
    font-family: var(--font-accent) !important;
    animation: pulse-glow 3s ease-in-out infinite;
}
@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 0 transparent; }
    50% { text-shadow: 0 0 20px rgba(175,223,224,0.5); }
}

/* Quick link card colorful left borders */
.quick-link-card:nth-child(1) { border-left: 3px solid var(--primary-blue) !important; }
.quick-link-card:nth-child(2) { border-left: 3px solid var(--purple-medium) !important; }
.quick-link-card:nth-child(3) { border-left: 3px solid var(--tomato-medium) !important; }
.quick-link-card:nth-child(4) { border-left: 3px solid var(--amber) !important; }
.quick-link-card:nth-child(5) { border-left: 3px solid var(--digital-key1) !important; }
.quick-link-card:nth-child(6) { border-left: 3px solid var(--orange) !important; }
.quick-link-card:nth-child(7) { border-left: 3px solid var(--pink-violet) !important; }
.quick-link-card:nth-child(8) { border-left: 3px solid var(--mint) !important; }

/* Animated scroll-down hint for hero */
@keyframes scroll-hint {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(8px); opacity: 1; }
}
.scroll-down-hint {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 0.75rem;
    text-align: center;
    animation: scroll-hint 2s ease-in-out infinite;
}
.scroll-down-hint svg {
    display: block;
    margin: 0.25rem auto 0;
}

/* Random fun background patterns */
.section-alt::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(175,223,224,0.1) 0%, transparent 70%);
    pointer-events: none;
}
.section-alt { position: relative; overflow: hidden; }

/* Hero ball styling */
/* Hero walking robot & ball - positioned by JS */
.hero-walker {
    position: absolute;
    bottom: 12px;
    z-index: 20;
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
}

/* Let clicks pass through hero-content to reach ball/robot behind it */
.hero-compact .hero-content {
    z-index: auto;
    pointer-events: none;
}
.hero-compact .hero-content .hero-mascot-row,
.hero-compact .hero-content .hero-ticker,
.hero-compact .hero-content h1,
.hero-compact .hero-content p,
.hero-compact .hero-content a,
.hero-compact .hero-content button {
    pointer-events: auto;
}
.hero-walker-robot {
    font-size: 1.4rem;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.2));
}
.hero-walker-ball {
    font-size: 1.3rem;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.15));
}
.hero-walker-bubble {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: #333;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.hero-walker-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: white;
}
.hero-walker-bubble.show {
    opacity: 1;
}
body.dark-mode .hero-walker-bubble {
    background: #2d333b;
    color: #e6edf3;
}
body.dark-mode .hero-walker-bubble::after {
    border-top-color: #2d333b;
}
@keyframes ball-bounce {
    0% { transform: translateY(0) rotate(0deg); }
    30% { transform: translateY(-30px) rotate(180deg); }
    50% { transform: translateY(-15px) rotate(270deg); }
    70% { transform: translateY(-5px) rotate(330deg); }
    100% { transform: translateY(0) rotate(360deg); }
}
/* Floating bouncing ball */
#bouncing-ball {
    will-change: left, top, transform;
    transition: none !important;
}
#bouncing-ball:hover {
    filter: drop-shadow(0 8px 24px rgba(250,204,70,0.5)) !important;
}

/* Tamagotchi widget */
#tamagotchi-widget {
    font-family: var(--font-primary);
}
#tamagotchi-toggle:hover {
    transform: scale(1.15) !important;
    box-shadow: 0 6px 24px rgba(0,61,165,0.4);
}
body.dark-mode #tamagotchi-toggle {
    background: #58a6ff;
    box-shadow: 0 4px 16px rgba(88,166,255,0.3);
}
body.dark-mode #tamagotchi-widget {
    background: #161b22 !important;
    border-color: #30363d !important;
    color: #e6edf3;
}
body.dark-mode #tamagotchi-widget .xp-label,
body.dark-mode #tamagotchi-widget span[style*="color:var(--text-muted)"] {
    color: #8b949e !important;
}

/* Arkanoid overlay */
#arkanoid-overlay {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
#arkanoid-overlay canvas {
    box-shadow: 0 0 40px rgba(0,61,165,0.3), inset 0 0 20px rgba(0,0,0,0.3);
}
#arkanoid-overlay button:hover {
    background: rgba(255,255,255,0.25) !important;
}

/* Hide tamagotchi on mobile (too small) */
@media (max-width: 767px) {
    #tamagotchi-widget { display: none !important; }
    #tamagotchi-toggle { bottom: 6rem !important; width: 38px !important; height: 38px !important; font-size: 1.1rem !important; }
}

/* Print: hide games */
@media print {
    #tamagotchi-widget, #tamagotchi-toggle, #arkanoid-overlay, #ghost-hunt-overlay, #furnace-overlay, .hero-ball { display: none !important; }
}

/* Easter egg hover colors on nav brand */
.nav-brand:hover .nav-brand-text {
    background: linear-gradient(90deg, #AFDFE0, #FACC46, #E1633B, #63539D, #003DA5);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 2s linear infinite;
}

/* =========================================
   PRINT STYLESHEET
   ========================================= */
@media print {
    /* Hide non-content elements */
    .nav, .nav-hide-btn, .nav-show-btn, .scroll-progress, .back-to-top, .back-btn-float,
    .mobile-bottom-nav, .admin-fab, .staff-edit-bar, .search-overlay,
    .footer, .toast-container, .skip-nav, .page-actions, .bookmark-btn,
    .os-switcher-wrapper, .toc, .rating-widget, .comments-section,
    .related-section, .tag-list, .tag-strip, .news-events-section,
    .continue-reading-section, .quick-links-grid, .hero, .hero-compact,
    .btn, button, .theme-toggle, .notification-bell, .nav-dropdown,
    .breadcrumb, .feedback-section, .note-actions, #wagtail-userbar,
    .daily-tip-section, .confetti-container, .hero-particles,
    .emoji-react-bar, .tooltip-fun, .time-greeting {
        display: none !important;
    }

    body, .page-content, .manual-body, .container {
        margin: 0;
        padding: 0;
        max-width: 100%;
        color: #000 !important;
        background: #fff !important;
        font-size: 12pt;
        line-height: 1.5;
    }

    .page-header { padding: 0 0 0.5rem; border-bottom: 2px solid #000; margin-bottom: 1rem; }
    .page-header h1 { font-size: 18pt; color: #000 !important; }

    h2 { font-size: 14pt; margin-top: 1.5rem; page-break-after: avoid; }
    h3 { font-size: 12pt; page-break-after: avoid; }

    img { max-width: 100%; page-break-inside: avoid; }
    pre, code { font-size: 9pt; border: 1px solid #ccc; padding: 0.5rem; }
    pre { page-break-inside: avoid; white-space: pre-wrap; }

    a { color: #000 !important; text-decoration: underline; }
    a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #666; }
    a[href^="/"]::after { content: " (student.psi.kyiv.ua" attr(href) ")"; font-size: 9pt; color: #666; }

    .alert { border: 1px solid #999; padding: 0.5rem; margin: 0.5rem 0; }
    table { border-collapse: collapse; width: 100%; }
    th, td { border: 1px solid #999; padding: 0.4rem; text-align: left; font-size: 10pt; }

    .reading-time { display: none; }

    @page { margin: 2cm; }
    @page :first { margin-top: 3cm; }
}


/* =========================================
   FORUM STYLES
   ========================================= */
.forum-categories { display: grid; gap: 1rem; }
.forum-category-card {
    display: flex; align-items: center; gap: 1.25rem;
    padding: 1.25rem; background: white; border-radius: var(--radius);
    border-left: 4px solid var(--primary-blue); box-shadow: var(--shadow-small);
    text-decoration: none; color: inherit; transition: box-shadow 0.2s;
}
.forum-category-card:hover { box-shadow: var(--shadow-lg); }
.forum-category-card h3 { font-size: 1.1rem; margin-bottom: 0.2rem; color: var(--dark-blue); }
.forum-category-card p { font-size: 0.85rem; color: var(--text-muted); margin: 0; }
.forum-category-meta { font-size: 0.8rem; color: var(--text-muted); margin-left: auto; white-space: nowrap; }

.forum-topic-list { display: grid; gap: 0.5rem; }
.forum-topic-row {
    display: flex; align-items: center; gap: 1rem;
    padding: 0.85rem 1.25rem; background: white; border-radius: var(--radius);
    box-shadow: var(--shadow-small); text-decoration: none; color: inherit;
    transition: box-shadow 0.2s;
}
.forum-topic-row:hover { box-shadow: var(--shadow-lg); }
.forum-topic-row h4 { font-size: 0.95rem; color: var(--dark-blue); margin: 0; }
.forum-topic-row .meta { font-size: 0.8rem; }
.forum-topic-stats { margin-left: auto; display: flex; gap: 1rem; font-size: 0.8rem; color: var(--text-muted); }

.forum-badge-pinned { background: var(--primary-blue); color: white; font-size: 0.7rem; padding: 0.1rem 0.5rem; border-radius: 10px; }
.forum-badge-solved { background: #16a34a; color: white; font-size: 0.7rem; padding: 0.1rem 0.5rem; border-radius: 10px; }

.forum-post { padding: 1.25rem; margin-bottom: 1rem; }
.forum-post-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.forum-post-avatar {
    width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-weight: 700; font-size: 0.9rem; color: white;
    background: linear-gradient(135deg, var(--primary-blue), var(--digital-key1));
}
.forum-post-body { font-size: 0.95rem; line-height: 1.7; }
.forum-post-body p { margin-bottom: 0.5rem; }

.forum-reply-form { margin-top: 1.5rem; }


/* =========================================
   LEARNING PATH STYLES
   ========================================= */
.path-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.path-card {
    padding: 1.25rem; background: white; border-radius: var(--radius);
    box-shadow: var(--shadow-small); text-decoration: none; color: inherit;
    transition: box-shadow 0.2s, transform 0.2s; display: flex; flex-direction: column;
}
.path-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.path-card h3 { font-size: 1.1rem; color: var(--dark-blue); margin-bottom: 0.35rem; }
.path-card p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; flex: 1; }
.path-card .progress-bar-wrap { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.path-card .progress-bar-fill { height: 100%; background: var(--primary-blue); border-radius: 3px; transition: width 0.3s; }
.path-meta { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; font-size: 0.8rem; }

.difficulty-beginner { background: #dcfce7; color: #166534; padding: 0.1rem 0.5rem; border-radius: 10px; font-size: 0.75rem; font-weight: 600; }
.difficulty-intermediate { background: #fef9c3; color: #854d0e; padding: 0.1rem 0.5rem; border-radius: 10px; font-size: 0.75rem; font-weight: 600; }
.difficulty-advanced { background: #fecaca; color: #991b1b; padding: 0.1rem 0.5rem; border-radius: 10px; font-size: 0.75rem; font-weight: 600; }

.path-steps { list-style: none; padding: 0; }
.path-step {
    display: flex; align-items: flex-start; gap: 1rem; padding: 1rem; margin-bottom: 0.5rem;
    background: white; border-radius: var(--radius); box-shadow: var(--shadow-small);
}
.step-number {
    width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
    background: var(--border); color: var(--text-muted);
}
.step-number.completed { background: #16a34a; color: white; }
.step-content { flex: 1; }
.step-content h4 { font-size: 0.95rem; margin-bottom: 0.2rem; }
.step-content p { font-size: 0.85rem; color: var(--text-muted); margin: 0; }


/* =========================================
   ASSIGNMENT STYLES
   ========================================= */
.assignment-card { padding: 1.25rem; margin-bottom: 1rem; }
.assignment-meta { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.5rem; }
.badge-submitted { background: #dbeafe; color: #1e40af; padding: 0.15rem 0.6rem; border-radius: 10px; font-size: 0.75rem; font-weight: 600; }
.badge-graded { background: #dcfce7; color: #166534; padding: 0.15rem 0.6rem; border-radius: 10px; font-size: 0.75rem; font-weight: 600; }
.badge-returned { background: #fef9c3; color: #854d0e; padding: 0.15rem 0.6rem; border-radius: 10px; font-size: 0.75rem; font-weight: 600; }
.badge-pastdue { background: #fecaca; color: #991b1b; padding: 0.15rem 0.6rem; border-radius: 10px; font-size: 0.75rem; font-weight: 600; }


/* =========================================
   TEACHER DASHBOARD STYLES
   ========================================= */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
    padding: 1.25rem; text-align: center; background: white; border-radius: var(--radius);
    box-shadow: var(--shadow-small); border-top: 3px solid var(--primary-blue);
}
.stat-card .stat-value { font-size: 2rem; font-weight: 800; color: var(--dark-blue); }
.stat-card .stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }

@media (max-width: 768px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
}


/* =========================================
   GLOSSARY STYLES
   ========================================= */
.glossary-search { margin-bottom: 1.5rem; display: flex; gap: 0.5rem; }
.glossary-search .form-input { flex: 1; }
.glossary-category-group { margin-bottom: 1.5rem; }
.glossary-category-group h3 { font-size: 1rem; color: var(--primary-blue); border-bottom: 2px solid var(--primary-blue); padding-bottom: 0.35rem; margin-bottom: 0.75rem; }
.glossary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.glossary-card { padding: 1rem; }
.glossary-card h4 { font-size: 1rem; color: var(--dark-blue); margin-bottom: 0.35rem; }
.glossary-card p { font-size: 0.85rem; color: var(--text-muted); }
.glossary-related { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }


/* =========================================
   FLASHCARD STYLES
   ========================================= */
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.deck-card { padding: 1.25rem; text-align: center; }
.deck-card h3 { font-size: 1.1rem; margin-bottom: 0.35rem; }
.deck-card p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.deck-card-count { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; }

.flashcard-container { max-width: 600px; margin: 0 auto; text-align: center; }
.flashcard {
    min-height: 250px; padding: 2rem; margin-bottom: 1.5rem; display: flex;
    align-items: center; justify-content: center; cursor: pointer;
    background: white; border-radius: var(--radius); box-shadow: var(--shadow-lg);
    font-size: 1.2rem; line-height: 1.6; transition: transform 0.3s;
    perspective: 1000px;
}
.flashcard:hover { transform: scale(1.02); }
.flashcard-front { font-weight: 700; color: var(--dark-blue); }
.flashcard-back { color: var(--text-muted); }
.flashcard-counter { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }
.flashcard-actions { display: flex; justify-content: center; gap: 1rem; }
.flashcard-actions .btn { min-width: 100px; }
.flashcard-done { padding: 3rem; text-align: center; }
.flashcard-done h2 { color: #16a34a; margin-bottom: 0.5rem; }


/* =========================================
   LEADERBOARD STYLES
   ========================================= */
.leaderboard-table { width: 100%; border-collapse: collapse; }
.leaderboard-table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); padding: 0.75rem; text-align: left; border-bottom: 2px solid var(--border); }
.leaderboard-table td { padding: 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.leaderboard-table tr:hover { background: rgba(0, 61, 165, 0.03); }
.leaderboard-table .current-user { background: rgba(0, 61, 165, 0.08); font-weight: 600; }
.leaderboard-rank { font-weight: 800; color: var(--dark-blue); width: 50px; }
.leaderboard-rank-1 { color: #eab308; }
.leaderboard-rank-2 { color: #94a3b8; }
.leaderboard-rank-3 { color: #d97706; }
.leaderboard-user { display: flex; align-items: center; gap: 0.75rem; }
.leaderboard-avatar {
    width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-weight: 700; font-size: 0.8rem; color: white;
    background: linear-gradient(135deg, var(--primary-blue), var(--digital-key1));
}
.leaderboard-points { font-weight: 700; color: var(--primary-blue); }
.user-rank-banner {
    padding: 1rem 1.25rem; background: rgba(0, 61, 165, 0.06); border-radius: var(--radius);
    margin-bottom: 1.25rem; display: flex; align-items: center; justify-content: space-between;
    border: 1px solid rgba(0, 61, 165, 0.12);
}
.user-rank-banner strong { color: var(--primary-blue); font-size: 1.1rem; }


/* =========================================
   KEYBOARD SHORTCUTS MODAL
   ========================================= */
.shortcuts-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    align-items: center; justify-content: center;
}
.shortcuts-modal-overlay.active { display: flex; }
.shortcuts-modal {
    background: white; border-radius: 12px; padding: 1.5rem 2rem; max-width: 500px; width: 90%;
    max-height: 80vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.shortcuts-modal h2 { font-size: 1.2rem; margin-bottom: 1rem; color: var(--dark-blue); }
.shortcuts-modal dl { margin: 0; }
.shortcuts-modal dt { font-weight: 600; font-size: 0.85rem; margin-top: 0.75rem; }
.shortcuts-modal dd { font-size: 0.85rem; color: var(--text-muted); margin: 0.15rem 0 0; }
.shortcuts-modal kbd {
    display: inline-block; padding: 0.15rem 0.5rem; background: #f1f5f9; border: 1px solid #cbd5e1;
    border-radius: 4px; font-family: monospace; font-size: 0.8rem; font-weight: 700;
}
.shortcuts-modal .close-btn { float: right; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }


/* =========================================
   CHANGELOG STYLES
   ========================================= */
.page-changelog { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.8rem; color: var(--text-muted); }
.page-changelog svg { vertical-align: middle; margin-right: 0.25rem; }


/* =========================================
   DARK MODE — NEW FEATURES
   ========================================= */
body.dark-mode .forum-category-card,
body.dark-mode .forum-topic-row,
body.dark-mode .path-card,
body.dark-mode .path-step,
body.dark-mode .assignment-card,
body.dark-mode .stat-card,
body.dark-mode .glossary-card,
body.dark-mode .deck-card,
body.dark-mode .flashcard,
body.dark-mode .forum-post {
    background: #161b22;
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

body.dark-mode .forum-category-card h3,
body.dark-mode .forum-topic-row h4,
body.dark-mode .path-card h3,
body.dark-mode .glossary-card h4,
body.dark-mode .deck-card h3,
body.dark-mode .stat-card .stat-value,
body.dark-mode .leaderboard-rank,
body.dark-mode .leaderboard-points,
body.dark-mode .shortcuts-modal h2 { color: #e6edf3; }

body.dark-mode .forum-category-card p,
body.dark-mode .forum-topic-row .meta,
body.dark-mode .path-card p,
body.dark-mode .glossary-card p,
body.dark-mode .deck-card p,
body.dark-mode .stat-card .stat-label { color: #8b949e; }

body.dark-mode .shortcuts-modal { background: #161b22; }
body.dark-mode .shortcuts-modal kbd { background: #21262d; border-color: #30363d; color: #e6edf3; }
body.dark-mode .leaderboard-table th { border-color: #30363d; color: #8b949e; }
body.dark-mode .leaderboard-table td { border-color: #21262d; }
body.dark-mode .leaderboard-table .current-user { background: rgba(56, 139, 253, 0.1); }
body.dark-mode .user-rank-banner { background: rgba(56, 139, 253, 0.08); border-color: rgba(56, 139, 253, 0.2); }
body.dark-mode .glossary-category-group h3 { color: #58a6ff; border-color: #58a6ff; }

/* =========================================
   Tama Combined Widget — coder + pet in one
   ========================================= */
.tama-row {
    display: flex;
    justify-content: center;
    margin-top: 0.8rem;
    width: 100%;
    position: relative;
    z-index: 3;
}

.tama-combined {
    display: flex;
    width: 620px;
    max-width: 95vw;
    height: 200px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    border: 2px solid #30363d;
    box-sizing: border-box;
}

/* Left side: screen + keyboard stacked */
.tama-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Right side: pet panel */
.tama-pet-panel {
    width: 170px;
    flex-shrink: 0;
    background: var(--surface, #f4f6fa);
    border-left: 1px solid #30363d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.3rem;
    gap: 0.15rem;
    overflow: hidden;
}

body.dark-mode .tama-pet-panel {
    background: #161b22;
    border-left-color: #444c56;
}

/* Speech bubble */
.tama-speech-bubble {
    background: var(--surface-raised, #fff);
    border: 1px solid var(--border, #dee2e8);
    border-radius: 8px;
    padding: 0.2rem 0.4rem;
    font-size: 0.55rem;
    color: var(--text, #333);
    text-align: center;
    line-height: 1.2;
    position: relative;
    max-width: 138px;
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
}

.tama-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--surface-raised, #fff);
}

body.dark-mode .tama-speech-bubble {
    background: #2d333b;
    color: #e6edf3;
    border-color: #444c56;
}
body.dark-mode .tama-speech-bubble::after {
    border-top-color: #2d333b;
}

/* Pet stats compact */
.tama-pet-stats {
    width: 100%;
    padding: 0 0.15rem;
}

.tama-pet-stat-row {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin-bottom: 1px;
    font-size: 0.5rem;
}

.tama-pet-stat-label {
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.tama-pet-stat-bar {
    flex: 1;
    height: 3px;
    background: rgba(0,0,0,0.08);
    border-radius: 2px;
    overflow: hidden;
}

.tama-pet-stat-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* Action buttons */
.tama-pet-actions {
    display: flex;
    gap: 2px;
    margin-top: 0.15rem;
    justify-content: center;
}

.tama-pet-actions button {
    width: 22px;
    height: 22px;
    border: 1px solid var(--border, #dee2e8);
    background: var(--surface, #f4f6fa);
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
    padding: 0;
}

.tama-pet-actions button:hover {
    transform: scale(1.15);
}

body.dark-mode .tama-pet-actions button {
    background: #2d333b;
    border-color: #444c56;
}

@media (max-width: 480px) {
    .tama-combined {
        height: auto;
        min-height: 160px;
        flex-direction: column;
    }
    .tama-pet-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid #30363d;
        flex-direction: row;
        padding: 0.3rem 0.5rem;
        gap: 0.4rem;
    }
}

/* =========================================
   Tamagotchi Coder - Screen & Keyboard
   ========================================= */
.tama-coder-screen {
    background: #0d1117;
    padding: 10px 14px 28px;
    width: 100%;
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #7ee787;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

.tama-coder-cursor {
    display: inline-block;
    width: 7px;
    height: 12px;
    background: #7ee787;
    animation: tama-blink 0.8s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 1px;
}

@keyframes tama-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Keyboard removed — Codey types directly on screen */

.tama-coder-pet {
    position: absolute;
    bottom: 4px;
    right: 10px;
    font-size: 1.1rem;
    z-index: 5;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease;
}

/* Walk/step animations removed — Codey sits and types */

.tama-code-line { display: block; white-space: pre; }
.tama-code-line .kw { color: #ff7b72; }
.tama-code-line .fn { color: #d2a8ff; }
.tama-code-line .str { color: #a5d6ff; }
.tama-code-line .cm { color: #484f58; }
.tama-code-line .num { color: #ffa657; }

/* Dark-mode keyboard styles removed — no keyboard */

/* Tamagotchi inline toggle — kept for non-homepage pages */
.tama-toggle-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0.6rem auto 0;
    padding: 8px 20px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--digital-key1, #012FD7) 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    box-shadow: 0 4px 16px rgba(0, 61, 165, 0.3);
    transition: all 0.3s ease;
}
.tama-toggle-inline:hover { transform: translateY(-2px) scale(1.03); }
.tama-toggle-emoji { font-size: 1.3rem; line-height: 1; }

.tama-widget-inline {
    width: 100%; max-width: 420px; margin: 0 auto;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #dee2e8);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-height: 0; opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}
.tama-widget-inline.open { max-height: 500px; opacity: 1; margin-top: 0.6rem; }

body.dark-mode .tama-toggle-inline { background: linear-gradient(135deg, #1f6feb 0%, #388bfd 100%); }
body.dark-mode .tama-widget-inline { background: #161b22; border-color: #30363d; }

/* =========================================
   AJAX CONTENT SLIDER
   ========================================= */
.content-slider-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.cs-tab {
    padding: 0.4rem 1rem;
    border: 1.5px solid var(--border, #dee2e8);
    border-radius: 20px;
    background: var(--surface, #fff);
    color: var(--text-secondary, #64748b);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}
.cs-tab:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}
.cs-tab.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: #fff;
}
.content-slider-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}
.cs-arrow {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--border, #dee2e8);
    background: var(--surface, #fff);
    color: var(--text-secondary, #64748b);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.cs-arrow:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: scale(1.1);
}
.cs-arrow:active { transform: scale(0.95); }
.content-slider-viewport {
    overflow: hidden;
    flex: 1;
    border-radius: 12px;
}
.content-slider-track {
    display: flex;
    gap: 1rem;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}
.cs-card {
    min-width: 280px;
    max-width: 280px;
    flex-shrink: 0;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #dee2e8);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    cursor: pointer;
}
.cs-card:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 4px 16px rgba(0, 61, 165, 0.12);
    transform: translateY(-2px);
}
.cs-card-type {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    width: fit-content;
}
.cs-card-type.type-news {
    background: rgba(225, 99, 59, 0.12);
    color: var(--tomato-medium, #E1633B);
}
.cs-card-type.type-event {
    background: rgba(0, 61, 165, 0.1);
    color: var(--primary-blue);
}
.cs-card-type.type-page {
    background: rgba(99, 83, 157, 0.1);
    color: var(--purple-medium, #63539D);
}
.cs-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a2e);
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cs-card-date {
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
}
.cs-card-excerpt {
    font-size: 0.82rem;
    color: var(--text-secondary, #64748b);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}
.cs-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
}
.cs-card-meta .pinned-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.65rem;
}
.cs-card-meta .event-location {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

/* Loading/empty states */
.cs-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted, #94a3b8);
    font-size: 0.9rem;
    width: 100%;
}
.cs-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted, #94a3b8);
    width: 100%;
}

/* Dots */
.content-slider-dots {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 0.75rem;
}
.cs-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: var(--border, #dee2e8);
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0;
}
.cs-dot.active {
    background: var(--primary-blue);
    width: 20px;
    border-radius: 4px;
}

/* Dark mode */
body.dark-mode .cs-tab {
    background: #161b22;
    border-color: #30363d;
    color: #8b949e;
}
body.dark-mode .cs-tab.active {
    background: #388bfd;
    border-color: #388bfd;
    color: #fff;
}
body.dark-mode .cs-arrow {
    background: #161b22;
    border-color: #30363d;
    color: #8b949e;
}
body.dark-mode .cs-arrow:hover {
    border-color: #388bfd;
    color: #388bfd;
}
body.dark-mode .cs-card {
    background: #161b22;
    border-color: #30363d;
}
body.dark-mode .cs-card:hover {
    border-color: #388bfd;
    box-shadow: 0 4px 16px rgba(56, 139, 253, 0.15);
}
body.dark-mode .cs-card-title { color: #e6edf3; }
body.dark-mode .cs-dot { background: #30363d; }
body.dark-mode .cs-dot.active { background: #388bfd; }

/* Mobile */
@media (max-width: 768px) {
    .cs-card { min-width: 240px; max-width: 240px; }
    .cs-arrow { width: 28px; height: 28px; }
    .content-slider-tabs { gap: 0.3rem; }
    .cs-tab { padding: 0.35rem 0.7rem; font-size: 0.78rem; }
}

/* =========================================
   TIPQUOTE BAR (Combined Tips & Quotes)
   ========================================= */
.tipquote-bar {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
    border-bottom: 1px solid rgba(0, 61, 165, 0.1);
    padding: 0.55rem 0;
    transition: opacity 0.3s ease, max-height 0.3s ease;
    overflow: hidden;
}
.tipquote-bar.hidden {
    max-height: 0;
    padding: 0;
    border: none;
    opacity: 0;
}
.tipquote-inner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: 900px;
    margin: 0 auto;
}
.tipquote-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
    line-height: 1;
    transition: transform 0.3s ease;
}
.tipquote-text {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text-primary, #1a1a2e);
    line-height: 1.4;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tipquote-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}
.tipquote-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(0, 61, 165, 0.15);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-secondary, #64748b);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    font-size: 0.75rem;
    font-family: inherit;
}
.tipquote-btn:hover {
    background: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
}
.tipquote-dismiss {
    margin-left: 0.15rem;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Dark mode */
body.dark-mode .tipquote-bar {
    background: linear-gradient(135deg, #161b22 0%, #1c2333 100%);
    border-bottom-color: #30363d;
}
body.dark-mode .tipquote-text {
    color: #c9d1d9;
}
body.dark-mode .tipquote-btn {
    border-color: #30363d;
    background: rgba(22, 27, 34, 0.7);
    color: #8b949e;
}
body.dark-mode .tipquote-btn:hover {
    background: #388bfd;
    color: #fff;
    border-color: #388bfd;
}

/* Mobile */
@media (max-width: 600px) {
    .tipquote-text {
        font-size: 0.8rem;
    }
    .tipquote-btn {
        width: 22px;
        height: 22px;
    }
}

/* =========================================
   MOBILE COMPACT — Homepage fits viewport
   Scrollable with compact layout
   ========================================= */
@media (max-width: 768px) {
    /* Allow scroll on mobile homepage */
    body.template-homepage {
        height: auto;
        overflow: auto;
    }
    .template-homepage #main-content {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    /* Hero: tight — !important needed to beat generic .hero !important */
    .template-homepage .hero-compact {
        padding: 0.6rem 1rem 0.2rem !important;
        min-height: auto !important;
        flex-shrink: 0;
    }
    .template-homepage .hero-compact h1 {
        font-size: 1.1rem;
        margin-bottom: 0.1rem;
    }
    .template-homepage .hero-compact .hero-subtitle {
        font-size: 0.75rem;
        margin-bottom: 0.15rem;
    }
    .template-homepage .hero-compact .hero-mascot-row {
        gap: 0.4rem;
    }

    /* Ticker: hide on mobile — services already in slider */
    .template-homepage .hero-ticker {
        display: none;
    }

    /* Kill gap between hero and lab services */
    .template-homepage .hero-compact {
        padding-bottom: 0.15rem;
    }

    /* Hide tag cloud on mobile if present */
    .template-homepage .tag-cloud-section {
        display: none;
    }

    /* Lab services panel on mobile */
    .template-homepage [data-widget="lab-services"] {
        padding: 0.5rem 1rem 0.75rem;
        margin: 0;
        border-radius: 0;
    }
    .template-homepage [data-widget="lab-services"] .container {
        padding: 0;
    }
    .template-homepage [data-widget="lab-services"] .section-header {
        margin-bottom: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
    }
    .template-homepage [data-widget="lab-services"] .section-title {
        font-size: 1rem;
        margin: 0;
    }
    .template-homepage [data-widget="lab-services"] .section-description {
        display: none;
    }
    .template-homepage [data-widget="lab-services"] .widget-toggle {
        position: static;
        flex-shrink: 0;
    }

    /* Hide desktop cards, show mobile app slider */
    .template-homepage .lab-cards-desktop {
        display: none !important;
    }
    .template-homepage .lab-apps-mobile {
        display: block !important;
    }

    /* Collapsed state on mobile */
    .template-homepage [data-widget="lab-services"].collapsed {
        padding: 0.4rem 1rem;
    }

    /* Hide explore CTA, content slider, continue reading on mobile homepage */
    .template-homepage .explore-cta-section,
    .template-homepage [data-widget="content-slider"],
    .template-homepage .continue-reading-section {
        display: none;
    }

    /* Footer: minimal */
    .template-homepage .footer {
        padding: 0.4rem 0.75rem;
        flex-shrink: 0;
    }
    .template-homepage .footer-columns {
        display: none;
    }
    .template-homepage .footer-bottom {
        font-size: 0.65rem;
        padding-top: 0;
        margin-top: 0;
        border-top: none;
    }

    /* Widget toggle buttons: smaller */
    .template-homepage .widget-toggle {
        padding: 0.1rem;
    }
}

/* Extra small phones */
@media (max-width: 400px) {
    .template-homepage .hero-compact {
        padding: 0.4rem 0.6rem 0.2rem;
    }
    .template-homepage .hero-compact h1 {
        font-size: 0.95rem;
    }
    .lab-app-tile {
        flex: 0 0 70%;
    }
    .lab-app-icon {
        width: 48px;
        height: 48px;
    }
    .lab-app-name {
        font-size: 0.85rem;
    }
    .lab-app-desc {
        font-size: 0.72rem;
    }
}
