/* Navbar component styles. */
/* ═══════════════════════════════════════════════════════════════
   NAVBAR DESIGN TOKENS — Bright Institutional
   Synced with personal.php v4.1 + footer.php v6.0
   ═══════════════════════════════════════════════════════════════ */
.tb1-topbar,
.tb1-navbar {
    --nb-blue-900: #1E3A8A;
    --nb-blue-800: #1E40AF;
    --nb-blue-700: #1D4ED8;
    --nb-blue-600: #2563EB;
    --nb-blue-500: #3B82F6;
    --nb-blue-400: #60A5FA;
    --nb-blue-300: #93C5FD;
    --nb-blue-200: #BFDBFE;
    --nb-blue-100: #DBEAFE;
    --nb-blue-50: #EFF6FF;
    --nb-blue-25: #F5F9FF;

    --nb-sky-500: #0EA5E9;
    --nb-sky-400: #38BDF8;
    --nb-sky-300: #7DD3FC;
    --nb-sky-200: #BAE6FD;
    --nb-sky-100: #E0F2FE;
    --nb-sky-50: #F0F9FF;

    --nb-gold-600: #B45309;
    --nb-gold-500: #D97706;
    --nb-gold-400: #F59E0B;
    --nb-gold-300: #FBBF24;

    --nb-slate-900: #0F172A;
    --nb-slate-800: #1E293B;
    --nb-slate-700: #334155;
    --nb-slate-600: #475569;
    --nb-slate-500: #64748B;
    --nb-slate-400: #94A3B8;
    --nb-slate-300: #CBD5E1;
    --nb-slate-200: #E2E8F0;
    --nb-slate-100: #F1F5F9;
    --nb-slate-50: #F8FAFC;
    --nb-white: #FFFFFF;

    --nb-font-display: 'Noto Serif Thai', Georgia, serif;
    --nb-font-body: 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;

    --nb-r-sm: 8px;
    --nb-r-md: 12px;
    --nb-r-full: 9999px;
    --nb-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --nb-transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
    --nb-shell-width: 1440px;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.tb1-topbar *,
.tb1-topbar *::before,
.tb1-topbar *::after,
.tb1-navbar *,
.tb1-navbar *::before,
.tb1-navbar *::after {
    box-sizing: inherit;
}

/* ═══════════════════════════════════════════════════════════════
   TOP BAR
   ═══════════════════════════════════════════════════════════════ */
.tb1-topbar {
    background: linear-gradient(135deg, var(--nb-white) 0%, var(--nb-blue-50) 50%, var(--nb-sky-50) 100%);
    padding: 8px 0;
    position: relative;
    z-index: 1001;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, #1D4ED8, #2563EB, #3B82F6, #60A5FA, #0EA5E9) 1;
    font-family: var(--nb-font-body);
}

.tb1-topbar-container {
    max-width: var(--nb-shell-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tb1-topbar-left,
.tb1-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tb1-topbar-contact {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.tb1-topbar-contact a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--nb-slate-500);
    text-decoration: none;
    font-size: 12px;
    transition: var(--nb-transition);
}

.tb1-topbar-contact a:hover {
    color: var(--nb-blue-700);
}

.tb1-topbar-contact a i {
    font-size: 12px;
    color: var(--nb-blue-500);
}

.tb1-topbar-contact a:nth-child(2) i {
    color: var(--nb-sky-500);
}

.tb1-topbar-contact a:nth-child(3) i {
    color: var(--nb-blue-400);
}

/* ─── Royal Badge ─── */
.tb1-royal-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: linear-gradient(135deg, var(--nb-gold-500), var(--nb-gold-400));
    border-radius: var(--nb-r-full);
    color: white;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.3);
    animation: nbPulseBadge 3s ease-in-out infinite;
}

@keyframes nbPulseBadge {

    0%,
    100% {
        box-shadow: 0 0 12px rgba(217, 119, 6, 0.3);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 22px rgba(217, 119, 6, 0.5);
        transform: scale(1.02);
    }
}

/* ─── Social Links ─── */
.tb1-social-links {
    display: flex;
    gap: 5px;
}

.tb1-social-links a {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nb-blue-50);
    color: var(--nb-slate-500);
    border-radius: var(--nb-r-sm);
    font-size: 12px;
    border: 1px solid var(--nb-blue-100);
    transition: var(--nb-transition);
    text-decoration: none;
}

.tb1-social-links a:nth-child(1):hover {
    background: linear-gradient(135deg, #1877F2, #42A5F5);
    color: white;
    border-color: #1877F2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.35);
}

.tb1-social-links a:nth-child(2):hover {
    background: linear-gradient(135deg, #FF0000, #FF5252);
    color: white;
    border-color: #FF0000;
    transform: translateY(-2px);
}

.tb1-social-links a:nth-child(3):hover {
    background: linear-gradient(135deg, #00B900, #4CAF50);
    color: white;
    border-color: #00B900;
    transform: translateY(-2px);
}

.tb1-social-links a:nth-child(4):hover {
    background: linear-gradient(135deg, var(--nb-blue-600), var(--nb-blue-500));
    color: white;
    transform: translateY(-2px);
}

/* ─── Theme Toggle ─── */
.tb1-theme-toggle {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nb-blue-50);
    color: var(--nb-blue-600);
    border-radius: var(--nb-r-sm);
    font-size: 12px;
    border: 1px solid var(--nb-blue-200);
    cursor: pointer;
    transition: var(--nb-transition);
}

.tb1-theme-toggle:hover {
    background: linear-gradient(135deg, var(--nb-blue-500), var(--nb-blue-400));
    color: white;
    transform: translateY(-2px) rotate(15deg);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   AQI WIDGET
   ═══════════════════════════════════════════════════════════════ */
.aqi-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 6px;
    background: var(--nb-blue-50);
    border: 1px solid var(--nb-blue-200);
    border-radius: var(--nb-r-md);
    cursor: pointer;
    transition: var(--nb-transition);
    text-decoration: none;
    margin-right: 8px;
    position: relative;
    min-height: 40px;
}

.aqi-widget:hover {
    background: var(--nb-blue-100);
    border-color: var(--nb-blue-300);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
}

.aqi-widget-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 1.05rem;
    position: relative;
}

.aqi-widget-icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 12px;
    border: 2px solid;
    border-color: inherit;
    opacity: 0.25;
    animation: nbAqiRing 2.5s ease-out infinite;
}

@keyframes nbAqiRing {
    0% {
        transform: scale(0.85);
        opacity: 0.4;
    }

    100% {
        transform: scale(1.25);
        opacity: 0;
    }
}

.aqi-widget-content {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 55px;
}

.aqi-widget-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0;
}

.aqi-widget-label {
    font-size: 0.55rem;
    color: var(--nb-slate-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aqi-widget-pm {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    padding: 1px 5px;
    background: rgba(37, 99, 235, 0.08);
    border-radius: 3px;
    margin-left: 3px;
}

.aqi-widget-status {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #34d399);
    border: 2px solid var(--nb-white);
    animation: nbStatusPulse 2s infinite;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.aqi-widget-status.stale {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.aqi-widget-status.offline {
    background: linear-gradient(135deg, #ef4444, #f87171);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    animation: none;
}

@keyframes nbStatusPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(0.9);
    }
}

.aqi-widget.loading .aqi-widget-icon {
    animation: nbAqiSpin 1s linear infinite;
}

@keyframes nbAqiSpin {
    from {
        transform: rotate(0)
    }

    to {
        transform: rotate(360deg)
    }
}

.aqi-widget.loading .aqi-widget-value {
    background: linear-gradient(90deg, var(--nb-blue-100), var(--nb-blue-50), var(--nb-blue-100));
    background-size: 200% 100%;
    animation: nbShimmer 1.5s infinite;
    border-radius: 4px;
    color: transparent;
}

@keyframes nbShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ═══════════════════════════════════════════════════════════════
   MAIN NAVBAR
   ═══════════════════════════════════════════════════════════════ */
.tb1-navbar {
    background: var(--nb-white);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    font-family: var(--nb-font-body);
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, #1D4ED8, #2563EB, #3B82F6, #60A5FA) 1;
}

.tb1-navbar.is-scrolled {
    box-shadow: 0 10px 32px rgba(37, 99, 235, 0.14);
}

.tb1-navbar-container {
    max-width: var(--nb-shell-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
}

/* ─── Logo ─── */
.tb1-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: var(--nb-transition);
    flex-shrink: 0;
    min-width: 0;
}

.tb1-logo:hover {
    transform: scale(1.02);
}

.tb1-logo-img {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.tb1-logo-text {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
    min-width: 0;
}

.tb1-logo-title {
    font-family: var(--nb-font-display);
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--nb-blue-700), var(--nb-blue-500), var(--nb-sky-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.tb1-logo-subtitle {
    font-size: 0.65rem;
    color: var(--nb-slate-400);
    font-weight: 400;
}

/* ─── Navigation ─── */
.tb1-nav {
    display: flex;
    align-items: center;
    min-width: 0;
}

.tb1-nav-menu {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tb1-nav-item {
    position: relative;
}

.tb1-nav-item.has-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: -10px;
    width: max(100%, 260px);
    height: 12px;
    display: none;
    background: transparent;
    pointer-events: auto;
    z-index: 999;
}

.tb1-nav-item.has-dropdown:hover::after,
.tb1-nav-item.has-dropdown:focus-within::after {
    display: block;
}

.tb1-nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 12px;
    color: var(--nb-slate-600);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--nb-r-sm);
    transition: var(--nb-transition);
    white-space: nowrap;
}

.tb1-nav-link:hover,
.tb1-nav-link.active,
.tb1-nav-link:focus-visible {
    color: var(--nb-blue-700);
    background: var(--nb-blue-50);
}

.tb1-social-links a:focus-visible,
.tb1-theme-toggle:focus-visible,
.aqi-widget:focus-visible,
.tb1-logo:focus-visible,
.tb1-nav-link:focus-visible,
.tb1-dropdown-link:focus-visible,
.tb1-mobile-toggle:focus-visible,
.tb1-mobile-theme-toggle:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.35);
    outline-offset: 3px;
}

.tb1-nav-link i.fa-chevron-down {
    font-size: 9px;
    transition: var(--nb-transition);
    opacity: 0.7;
}

.tb1-nav-link i.fa-home {
    font-size: 13px;
    background: linear-gradient(135deg, var(--nb-blue-600), var(--nb-blue-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Dropdown ─── */
.tb1-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 240px;
    background: var(--nb-white);
    border-radius: var(--nb-r-md);
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.12);
    border: 1px solid var(--nb-blue-100);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.22s var(--nb-ease), visibility 0.22s var(--nb-ease), transform 0.22s var(--nb-ease), background-color 0.22s var(--nb-ease), border-color 0.22s var(--nb-ease), box-shadow 0.22s var(--nb-ease);
    list-style: none;
    z-index: 1000;
    pointer-events: none;
}

.tb1-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: var(--nb-white);
    border-left: 1px solid var(--nb-blue-100);
    border-top: 1px solid var(--nb-blue-100);
    transform: rotate(45deg);
}

.tb1-nav-item:hover .tb1-dropdown,
.tb1-nav-item:focus-within .tb1-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.tb1-nav-item:hover .tb1-nav-link i.fa-chevron-down,
.tb1-nav-item:focus-within .tb1-nav-link i.fa-chevron-down {
    transform: rotate(180deg);
}

.tb1-dropdown-item {
    margin: 0;
}

.tb1-dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--nb-slate-600);
    text-decoration: none;
    font-size: 12px;
    font-weight: 400;
    border-radius: var(--nb-r-sm);
    transition: var(--nb-transition);
}

.tb1-dropdown-link:hover {
    background: var(--nb-blue-50);
    color: var(--nb-blue-700);
    padding-left: 16px;
}

.tb1-dropdown-link i {
    width: 18px;
    font-size: 12px;
    color: var(--nb-blue-400);
}

.tb1-dropdown-link:hover i {
    color: var(--nb-blue-600);
}

.tb1-dropdown-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--nb-blue-100), transparent);
    margin: 6px 10px;
}

/* ─── Mobile Toggle ─── */
.tb1-mobile-toggle {
    display: none;
    background: var(--nb-blue-50);
    border: 1px solid var(--nb-blue-200);
    font-size: 18px;
    color: var(--nb-blue-600);
    cursor: pointer;
    padding: 8px 10px;
    border-radius: var(--nb-r-sm);
    transition: var(--nb-transition);
}

.tb1-mobile-toggle:hover {
    background: linear-gradient(135deg, var(--nb-blue-500), var(--nb-blue-400));
    color: white;
}

.tb1-mobile-theme-toggle {
    display: none;
    width: 100%;
    padding: 12px 14px;
    background: var(--nb-blue-50);
    border: 1px solid var(--nb-blue-200);
    border-radius: var(--nb-r-sm);
    color: var(--nb-slate-600);
    font-family: var(--nb-font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--nb-transition);
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.tb1-mobile-theme-toggle:hover {
    background: linear-gradient(135deg, var(--nb-blue-500), var(--nb-blue-400));
    color: white;
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════════════════ */
:is(body.dark-mode, html.dark-mode body) .tb1-topbar {
    background:
        radial-gradient(circle at 18% 0%, rgba(56, 189, 248, 0.18), transparent 22rem),
        linear-gradient(135deg, rgba(8, 47, 73, 0.96) 0%, rgba(12, 74, 110, 0.94) 52%, rgba(29, 78, 216, 0.88) 100%);
    border-image: linear-gradient(90deg, var(--nb-blue-400), var(--nb-sky-400), var(--nb-blue-300)) 1;
    box-shadow: inset 0 -1px rgba(186, 230, 253, 0.18);
}

:is(body.dark-mode, html.dark-mode body) .tb1-topbar-contact a {
    color: #CBD5E1;
}

:is(body.dark-mode, html.dark-mode body) .tb1-topbar-contact a:hover {
    color: var(--nb-blue-300);
}

:is(body.dark-mode, html.dark-mode body) .tb1-social-links a,
:is(body.dark-mode, html.dark-mode body) .tb1-theme-toggle {
    background: rgba(186, 230, 253, 0.1);
    border-color: rgba(125, 211, 252, 0.28);
    color: #dff7ff;
}

:is(body.dark-mode, html.dark-mode body) .tb1-navbar {
    background:
        radial-gradient(circle at 16% 0%, rgba(56, 189, 248, 0.2), transparent 24rem),
        linear-gradient(135deg, rgba(7, 47, 74, 0.98) 0%, rgba(12, 74, 110, 0.96) 48%, rgba(30, 64, 175, 0.92) 100%);
    box-shadow: 0 4px 30px rgba(14, 165, 233, 0.16), inset 0 1px rgba(186, 230, 253, 0.16);
    border-image: linear-gradient(90deg, var(--nb-blue-400), var(--nb-blue-300), var(--nb-sky-400)) 1;
    backdrop-filter: blur(18px);
}

:is(body.dark-mode, html.dark-mode body) .tb1-navbar.is-scrolled {
    box-shadow: 0 14px 34px rgba(8, 47, 73, 0.36), 0 0 24px rgba(14, 165, 233, 0.12);
}

:is(body.dark-mode, html.dark-mode body) .tb1-logo-title {
    background: linear-gradient(135deg, var(--nb-blue-300), var(--nb-sky-400), var(--nb-blue-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

:is(body.dark-mode, html.dark-mode body) .tb1-logo-subtitle {
    color: #94A3B8;
}

:is(body.dark-mode, html.dark-mode body) .tb1-nav-link {
    color: #e0f2fe;
}

:is(body.dark-mode, html.dark-mode body) .tb1-nav-link:hover,
:is(body.dark-mode, html.dark-mode body) .tb1-nav-link.active,
:is(body.dark-mode, html.dark-mode body) .tb1-nav-link:focus-visible {
    color: #f0fbff;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.34), rgba(14, 165, 233, 0.22));
    box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.18), 0 8px 22px rgba(14, 165, 233, 0.14);
}

:is(body.dark-mode, html.dark-mode body) .tb1-dropdown {
    background:
        linear-gradient(180deg, rgba(13, 58, 89, 0.98), rgba(9, 42, 69, 0.98));
    border-color: rgba(125, 211, 252, 0.24);
    box-shadow: 0 18px 48px rgba(8, 47, 73, 0.42), 0 0 0 1px rgba(56, 189, 248, 0.08);
    backdrop-filter: blur(18px);
}

:is(body.dark-mode, html.dark-mode body) .tb1-dropdown::before {
    background: rgba(13, 58, 89, 0.98);
    border-color: rgba(125, 211, 252, 0.24);
}

:is(body.dark-mode, html.dark-mode body) .tb1-dropdown-link {
    color: #dff7ff;
}

:is(body.dark-mode, html.dark-mode body) .tb1-dropdown-link:hover,
:is(body.dark-mode, html.dark-mode body) .tb1-dropdown-link:focus-visible {
    background: rgba(14, 165, 233, 0.18);
    color: #f0fbff;
}

:is(body.dark-mode, html.dark-mode body) .aqi-widget {
    background: rgba(186, 230, 253, 0.1);
    border-color: rgba(125, 211, 252, 0.28);
}

:is(body.dark-mode, html.dark-mode body) .tb1-mobile-toggle {
    background: rgba(186, 230, 253, 0.1);
    border-color: rgba(125, 211, 252, 0.28);
    color: #dff7ff;
}

:is(body.dark-mode, html.dark-mode body) .tb1-mobile-theme-toggle {
    background: rgba(186, 230, 253, 0.1);
    border-color: rgba(125, 211, 252, 0.28);
    color: #e0f2fe;
}

:is(body.dark-mode, html.dark-mode body) .tb1-nav {
    background: transparent;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width:1300px) {
    .tb1-nav-link {
        padding: 8px 10px;
        font-size: 12px;
    }

    .aqi-widget {
        padding: 4px 9px 4px 5px;
    }

    .aqi-widget-icon {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
}

@media (max-width:1100px) {
    .tb1-logo-subtitle {
        display: none;
    }

    .aqi-widget-content {
        display: none;
    }

    .aqi-widget {
        padding: 5px;
        border-radius: 9px;
    }
}

@media (max-width:992px) {
    .tb1-topbar {
        display: none;
    }

    .tb1-navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
    }

    body {
        padding-top: 65px;
    }

    body.tb1-menu-open {
        overflow: hidden;
        touch-action: none;
    }

    .tb1-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        padding: 0;
        flex-shrink: 0;
    }

    .tb1-mobile-theme-toggle {
        display: flex;
    }

    .tb1-nav {
        position: fixed;
        top: 65px;
        left: max(12px, env(safe-area-inset-left));
        right: max(12px, env(safe-area-inset-right));
        background: var(--nb-white);
        box-shadow: 0 16px 40px rgba(37, 99, 235, 0.1);
        display: flex;
        flex-direction: column;
        padding: 12px;
        max-height: calc(100vh - 82px);
        max-height: calc(100dvh - 82px);
        overflow-y: auto;
        overscroll-behavior: contain;
        border-top: 3px solid transparent;
        border-image: linear-gradient(90deg, var(--nb-blue-500), var(--nb-blue-400), var(--nb-sky-500)) 1;
        border-radius: 0 0 var(--nb-r-md) var(--nb-r-md);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-10px);
        transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
        z-index: 1002;
        scrollbar-width: thin;
    }

    .tb1-nav.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .tb1-nav-menu {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 2px;
    }

    .tb1-nav-item {
        width: 100%;
    }

    .tb1-nav-item.has-dropdown::after {
        display: none !important;
    }

    .tb1-nav-link {
        padding: 12px 14px;
        font-size: 13px;
        min-height: 44px;
        justify-content: flex-start;
        white-space: normal;
    }

    .tb1-nav-link i.fa-chevron-down {
        margin-left: auto;
    }

    .tb1-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        box-shadow: none;
        border: none;
        display: none;
        background: var(--nb-blue-50);
        border-radius: var(--nb-r-sm);
        margin-top: 4px;
    }

    :is(body.dark-mode, html.dark-mode body) .tb1-dropdown {
        background: rgba(14, 116, 144, 0.14);
        border: 1px solid rgba(125, 211, 252, 0.14);
    }

    .tb1-dropdown::before {
        display: none;
    }

    .tb1-nav-item.active .tb1-dropdown {
        display: block;
    }

    .tb1-logo-subtitle {
        display: block;
    }
}

@media (max-width:576px) {
    body {
        padding-top: 58px;
    }

    .tb1-nav {
        top: 58px;
        left: max(8px, env(safe-area-inset-left));
        right: max(8px, env(safe-area-inset-right));
        max-height: calc(100vh - 70px);
        max-height: calc(100dvh - 70px);
        padding: 10px;
    }

    .tb1-navbar-container {
        padding: 0 12px;
        min-height: 55px;
        gap: 10px;
    }

    .tb1-logo-img {
        width: 38px;
        height: 38px;
    }

    .tb1-logo-title {
        font-size: 0.85rem;
        max-width: calc(100vw - 112px);
        overflow-wrap: anywhere;
    }
}

@media (max-width:420px) {
    .tb1-logo {
        gap: 8px;
    }

    .tb1-logo-img {
        width: 34px;
        height: 34px;
    }

    .tb1-logo-title {
        font-size: 0.78rem;
        line-height: 1.25;
    }

    .tb1-logo-subtitle {
        display: none;
    }

    .tb1-mobile-toggle {
        width: 40px;
        height: 40px;
    }
}

@media (hover:none) {
    .tb1-logo:hover,
    .tb1-social-links a:hover,
    .tb1-theme-toggle:hover,
    .aqi-widget:hover,
    .tb1-nav-link:hover,
    .tb1-dropdown-link:hover,
    .tb1-mobile-toggle:hover,
    .tb1-mobile-theme-toggle:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion:reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.15s !important;
    }
}

@media print {

    .tb1-topbar,
    .tb1-navbar {
        display: none !important;
    }
}
