/* =========================================
   CORE CONFIGURATION & FLUID ROOT VARIABLES
   ========================================= */
:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);

    --bg-color: #000000;
    --text-color: #ffffff;
    --border-color: #1a1a1a;
    --accent-color: #888888;
    --panel-color: #0a0a0a;
    --muted-color: #9e9e9e;
    --success-color: #27d67d;
    --warning-color: #ffcc00;
    --danger-color: #d63031;

    --base-font-size: clamp(11px, 0.35vw + 10px, 14px);
    --title-font-size: clamp(13px, 0.5vw + 12px, 18px);
    --toolbar-padding: clamp(8px, 1vw + 5px, 15px);
    --toolbar-gap: clamp(10px, 1vw + 5px, 20px);
    --content-padding: clamp(12px, 2vw + 10px, 24px);
}

/* =========================================
   GLOBAL BASE / RESET
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: monospace;
}

html, body {
    width: 100%;
    min-height: 100%;
    min-width: 320px;
    background: var(--bg-color);
    color: var(--text-color);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-width: 320px;
    min-height: 100vh;
    min-height: 100svh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    font-size: var(--base-font-size);
    padding-top: var(--safe-top);
    padding-right: var(--safe-right);
    padding-bottom: var(--safe-bottom);
    padding-left: var(--safe-left);
    touch-action: manipulation;
    overscroll-behavior: none;
}

@supports (height: 100svh) {
    body {
        min-height: 100svh;
        height: 100svh;
    }
}

@supports not (height: 100svh) {
    body {
        min-height: 100vh;
        height: 100vh;
    }
}

/* =========================================
   HEADER & NAVIGATION BRANDING
   ========================================= */
#brand-logo {
    height: 32px;
    width: auto;
    border-radius: 4px;
    margin-right: 2px;
    object-fit: contain;
    display: block;
    filter: none !important;
    background-color: transparent !important;
    color: initial !important;
    border: none !important;
}

.bottom-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    height: 48px;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    z-index: 10;
    letter-spacing: 1px;
    font-size: clamp(10px, 0.5vw + 8px, 12px);
    text-transform: uppercase;
    position: relative;
}

.bottom-nav h1 {
    margin: 0;
    display: inline-block;
    white-space: nowrap;
}

.dmg-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   TOOLBAR / CONTROLS / DROPDOWNS
   ========================================= */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--toolbar-gap);
    padding: var(--toolbar-padding);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 20;
    background-color: var(--bg-color);
    min-height: 64px;
}

.toolbar > * {
    flex-shrink: 0;
}

.notification-trigger-wrapper {
    position: relative;
    margin-right: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

.tool-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--accent-color);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    position: relative;
}

.tool-btn:hover {
    background: var(--border-color);
    color: var(--text-color);
}

.tool-btn.active {
    background: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}

.api-status {
    font-size: clamp(10px, 0.2vw + 9px, 12px);
    color: #00b894;
    font-weight: bold;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.custom-dropdown {
    position: relative;
    cursor: pointer;
    user-select: none;
    width: max-content;
}

.dropdown-selected {
    border: 1px solid var(--border-color);
    padding: 5px 15px;
    background: var(--bg-color);
    white-space: nowrap;
    font-size: clamp(11px, 0.25vw + 10px, 13px);
    line-height: 1.4;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.dropdown-selected:hover {
    border-color: rgba(255,255,255,0.22);
}

.dropdown-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 100%;
    width: max-content;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    list-style: none;
    z-index: 2000;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 14px 26px rgba(0,0,0,0.32);
}

.dropdown-options li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    font-size: clamp(11px, 0.25vw + 10px, 13px);
    color: var(--text-color);
    transition: background 0.16s ease, color 0.16s ease;
}

.dropdown-options li:last-child {
    border-bottom: none;
}

.dropdown-options li:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

.dropdown-options li img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 50%;
    background: #ffffff;
}

.dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.dropdown-options::-webkit-scrollbar-track {
    background: var(--bg-color);
}

.dropdown-options::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

.custom-dropdown.active .dropdown-options {
    display: block;
}

/* =========================================
   DECILE MOMENTUM GRID (DMG)
   ========================================= */
.dmg-btn {
    width: auto;
    min-width: 74px;
    padding: 0 12px;
    font-size: 11px;
    letter-spacing: 0.8px;
    border: 1px solid var(--border-color);
    color: #7ef7b5;
    background: var(--bg-color);
    transition: all 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.dmg-btn:hover {
    border-color: var(--border-color);
    background: var(--bg-color);
}

.dmg-btn.active {
    background: rgba(39, 214, 125, 0.2);
    color: #dfffee;
    box-shadow: 0 0 12px rgba(39, 214, 125, 0.25);
    border-color: rgba(39, 214, 125, 0.95);
}

.dmg-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--bg-color);
    border: 1px solid rgba(39,214,125,0.4);
    border-radius: 6px;
    padding: 6px;
    min-width: 180px;
    z-index: 1000;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.dmg-panel.hidden {
    display: none;
}

.dmg-timeframe-btn {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--accent-color);
    cursor: pointer;
    padding: 4px 7px;
    font-size: 10px;
    border-radius: 3px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    min-width: 38px;
}

.dmg-timeframe-btn:hover,
.dmg-timeframe-btn.active {
    background: rgba(39, 214, 125, 0.15);
    border-color: rgba(39, 214, 125, 0.8);
    color: #dfffee;
}

.dmg-wrapper,
.smc-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   SMC (SMART MONEY CONCEPTS)
   ========================================= */
.smc-btn {
    width: auto;
    min-width: 74px;
    padding: 0 12px;
    font-size: 11px;
    letter-spacing: 0.8px;
    border: 1px solid var(--border-color);
    color: #8ec5ff;
    background: var(--bg-color);
    transition: all 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.smc-btn:hover {
    border-color: var(--border-color);
    background: var(--bg-color);
}

.smc-btn.active {
    background: rgba(76, 133, 255, 0.18);
    color: #dfeaff;
    box-shadow: 0 0 12px rgba(76, 133, 255, 0.25);
    border-color: rgba(110, 160, 255, 0.9);
}

.smc-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--bg-color);
    border: 1px solid rgba(110, 160, 255, 0.4);
    border-radius: 6px;
    padding: 6px;
    min-width: 180px;
    z-index: 1000;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.smc-panel.hidden {
    display: none;
}

.smc-timeframe-btn {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--accent-color);
    cursor: pointer;
    padding: 4px 7px;
    font-size: 10px;
    border-radius: 3px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    min-width: 38px;
}

.smc-timeframe-btn:hover,
.smc-timeframe-btn.active {
    background: rgba(76, 133, 255, 0.14);
    border-color: rgba(110, 160, 255, 0.8);
    color: #dfeaff;
}

/* =========================================
   CORE GRAPHICS / CANVAS UTILITIES
   ========================================= */
.chart-container {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 0;
    overflow: hidden;
    background: #000;
}

canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.spinner-container {
    position: absolute;
    inset: 0;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

.spinner-container.hidden {
    display: none;
}

.spinner {
    width: 35px;
    height: 35px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--text-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================
   REAL-TIME NOTIFICATION FEEDS
   ========================================= */
.notification-trigger-wrapper {
    position: relative;
}

#notification-widget {
    font-family: 'Courier New', monospace;
    border: 1px solid #333;
    background: #0a0a0a;
}

.notif-widget {
    position: absolute;
    top: 60px;
    left: 15px;
    width: min(360px, calc(100% - 30px));
    max-height: 450px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    z-index: 3000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.notif-widget.hidden {
    display: none;
}

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(17, 17, 17, 0.95);
}

.notif-header h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888888;
}

#notif-clear-all {
    background: transparent;
    border: none;
    color: #666666;
    font-size: 10px;
    cursor: pointer;
}

.notif-feed {
    overflow-y: auto;
    flex: 1;
    padding: 5px 0;
}

.notif-empty-state {
    padding: 20px;
    text-align: center;
    color: #444444;
    font-size: 11px;
}

.notif-item {
    padding: 10px 14px;
    border-bottom: 1px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notif-meta {
    display: flex;
    justify-content: space-between;
    font-size: 8px;
    color: #666;
    letter-spacing: 0.5px;
}

.notif-source {
    font-weight: bold;
    text-transform: uppercase;
}

.notif-time {
    color: #555555;
}

.notif-msg {
    font-size: 11px;
    color: #e0e0e0;
}

.filter-pill.filter-active {
    background: #111111 !important;
    color: #ffffff !important;
    border-color: #222222 !important;
}

/* =========================================
   CALENDAR BUTTON / MODAL
   ========================================= */
.calendar-launch-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.calendar-launch-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255,255,255,0.25);
}

.calendar-launch-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.calendar-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.76);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    padding: 24px;
}

.calendar-modal.hidden {
    display: none;
}

.calendar-hero {
    width: min(92vw, 440px);
    background: #0a0a0a;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.calendar-hero-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.00));
}

.calendar-kicker {
    font-size: 9px;
    letter-spacing: 1.6px;
    color: #a7a7a7;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.calendar-hero-header h3 {
    font-size: 16px;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.calendar-close-btn {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-color);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 11px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.calendar-close-btn:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.2);
}

.calendar-shell {
    padding: 10px 12px 14px;
    background: #0d0d0d;
}

#economicCalendarWidget {
    width: 100%;
    min-height: 420px;
    overflow: hidden;
    border-radius: 10px;
    background: #0c0c0c;
}

#economicCalendarWidget iframe,
#economicCalendarWidget embed,
#economicCalendarWidget object {
    width: 100% !important;
    max-width: 100% !important;
    border: none;
    display: block;
    background: #0b0b0b;
}

/* =========================================
   PWA INSTALL INTERFACE BANNER
   ========================================= */
#pwa-install-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: min(90vw, 400px);
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    z-index: 100000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#pwa-install-banner.hidden {
    display: none;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.pwa-text h4 {
    font-size: 13px;
    color: var(--text-color);
    margin-bottom: 4px;
}

.pwa-text p {
    font-size: 10px;
    color: var(--accent-color);
    line-height: 1.3;
}

.pwa-actions {
    display: flex;
    gap: 10px;
}

.pwa-btn-primary {
    flex: 1;
    background: var(--text-color);
    color: var(--bg-color);
    border: none;
    padding: 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
}

.pwa-btn-secondary {
    flex: 1;
    background: transparent;
    color: var(--accent-color);
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}

#pwa-manual-instructions {
    background: #1a1a1a;
    padding: 10px;
    border-radius: 4px;
    font-size: 10px;
    color: #ffcc00;
    text-align: center;
}

#pwa-ios-instructions {
    background: #1a1a1a;
    padding: 10px;
    border-radius: 4px;
    font-size: 10px;
    color: #ffcc00;
    text-align: center;
}

/* =========================================
   BNWT FLOATING PARTNER WIDGET
   ========================================= */
#bnwt-widget-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-150%);
    width: min(100% - 32px, 440px);
    max-width: 440px;
    background-color: #191b1f;
    border: 1px solid #2a2e3d;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    z-index: 99999;
    display: flex;
    align-items: center;
    padding: 10px 14px;
    box-sizing: border-box;
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

#bnwt-widget-container.bnwt-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

#bnwt-widget-card {
    display: flex;
    align-items: center;
    flex: 1;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    margin-right: 8px;
}

.bnwt-widget-thumb {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 10px;
    overflow: hidden;
    background-color: #0d0e11;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.bnwt-widget-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bnwt-widget-body {
    flex: 1;
    min-width: 0;
}

.bnwt-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.bnwt-category {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #848e9c;
}

.bnwt-counter {
    font-family: monospace;
    font-size: 11px;
    color: #5e6673;
}

.bnwt-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #eaedd1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

#bnwt-widget-close {
    background: transparent;
    border: none;
    color: #5e6673;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: color 0.2s, background-color 0.2s;
}

#bnwt-widget-close:hover {
    color: #f0b90b;
    background-color: rgba(255, 255, 255, 0.05);
}

/* =========================================
   SPLASH ENGINE
   ========================================= */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background-color: #000000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    z-index: 99999;
    overflow: hidden;
    padding: 20px;
    box-sizing: border-box;
    transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.4s ease;
}

.splash-center-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.splash-logo {
    width: clamp(80px, 15vmin, 135px);
    height: auto;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.05);
    object-fit: contain;
}

.splash-developer-signature {
    font-family: monospace;
    font-size: clamp(10px, 1.8vmin, 12px);
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-align: center;
    width: 100%;
    margin-bottom: calc(env(safe-area-inset-bottom, 0px) + 50px);
    opacity: 0;
    animation: professionalPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 1.5s;
}

@keyframes professionalPopIn {
    0% {
        transform: translateY(10px) scale(0.95);
        opacity: 0;
        color: #222222;
    }
    50% {
        color: #ffffff;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
        color: #cccccc;
    }
}

/* =========================================
   RESPONSIVE / DESKTOP / TV OPTIMIZATION
   ========================================= */
@media (max-width: 600px) {
    .toolbar {
        padding: 8px 10px;
        gap: 10px;
    }

    .notif-widget {
        width: calc(100% - 20px);
        left: 10px;
        right: 10px;
        top: 55px;
        max-height: 70dvh;
    }

    .splash-developer-signature {
        margin-bottom: 30px;
    }

    .bottom-nav {
        gap: 8px;
    }

    .dropdown-selected {
        padding: 5px 10px;
    }
}

@media (min-width: 601px) and (max-width: 1024px) {
    .toolbar {
        gap: 12px;
    }

    .dropdown-selected {
        padding: 5px 10px;
    }

    #bnwt-widget-container {
        width: min(100% - 32px, 420px);
    }
}

@media (min-width: 768px) {
    .toolbar {
        justify-content: space-between;
        align-items: center;
    }

    .notification-trigger-wrapper {
        margin-right: 0;
    }

    .custom-dropdown {
        min-width: 122px;
    }
}

@media (min-width: 1024px) {
    .toolbar {
        gap: clamp(12px, 1.2vw, 24px);
        padding: 12px clamp(14px, 1.5vw, 26px);
    }

    .tool-btn {
        width: 36px;
        height: 36px;
        font-size: 17px;
    }

    .calendar-launch-btn {
        width: 36px;
        height: 36px;
    }

    .dropdown-selected {
        min-height: 32px;
        padding: 6px 14px;
    }
}

@media (min-width: 1025px) {
    .toolbar {
        gap: clamp(12px, 1vw, 18px);
        padding: 12px clamp(12px, 1.5vw, 24px);
    }

    .notification-trigger-wrapper {
        margin-right: 0;
    }

    .custom-dropdown {
        min-width: 120px;
    }
}

@media (min-width: 1280px) {
    .toolbar {
        min-height: 74px;
    }

    #brand-logo {
        height: clamp(30px, 2.2vw, 46px);
    }

    .tool-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .calendar-launch-btn {
        width: 40px;
        height: 40px;
    }

    .api-status {
        min-width: 170px;
        text-align: right;
    }
}

@media (min-width: 1600px) {
    .toolbar {
        gap: clamp(18px, 1.4vw, 30px);
        padding-left: clamp(18px, 1.7vw, 34px);
        padding-right: clamp(18px, 1.7vw, 34px);
    }

    .notification-trigger-wrapper {
        gap: 10px;
    }

    .tool-btn {
        width: 42px;
        height: 42px;
        font-size: 19px;
    }

    .dropdown-selected {
        padding: 8px 16px;
        font-size: clamp(12px, 0.45vw, 16px);
    }

    .custom-dropdown {
        min-width: 140px;
    }

    #bnwt-widget-container {
        width: min(480px, 32vw);
    }

    .notif-widget {
        width: min(420px, 30vw);
    }
}

@media (min-width: 2200px) {
    .toolbar {
        min-height: 84px;
    }

    .tool-btn {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .calendar-launch-btn {
        width: 48px;
        height: 48px;
    }

    .dropdown-selected {
        padding: 9px 19px;
        font-size: 15px;
    }

    #pwa-install-banner {
        width: min(440px, 28vw);
    }
}

@media (max-width: 480px) {
    .toolbar {
        gap: 8px;
        padding: 8px 8px 10px;
    }

    .notification-trigger-wrapper {
        gap: 6px;
        margin-right: 0;
    }

    .tool-btn {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .calendar-launch-btn {
        width: 30px;
        height: 30px;
    }

    .dropdown-selected {
        padding: 5px 8px;
        font-size: 10px;
    }

    .api-status {
        font-size: 9px;
        letter-spacing: 0.1px;
    }

    .bottom-nav {
        gap: 6px;
    }
}

@media (max-width: 360px) {
    .toolbar {
        gap: 6px;
        padding-inline: 6px;
    }

    .notification-trigger-wrapper {
        gap: 5px;
    }

    .dropdown-selected {
        padding-inline: 7px;
    }

    .api-status {
        display: none;
    }
}

@media (orientation: landscape) and (max-height: 560px) {
    body {
        min-height: 100vh;
    }

    .toolbar {
        min-height: 52px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .bottom-nav {
        height: 42px;
    }

    .notif-widget {
        max-height: 58vh;
        top: 52px;
    }
}

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

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .notif-widget,
    #pwa-install-banner,
    .calendar-modal {
        background: rgba(10, 10, 10, 0.97);
    }
}

@media (display-mode: standalone) {
    body {
        padding-top: max(var(--safe-top), 0px);
    }
}
