/* ============================================
   Redesigned Mobile Responsiveness 2026
   Focus: Touch-first, Clean UI, Readable Text
   ============================================ */

/* GLOBAL OVERRIDE: Hide mobile elements by default on Desktop */
.mobile-input-mode-container {
    display: none !important;
}

/* --- DESKTOP NAV STYLING (Converter Page Only) --- */
/* Scoped to .converter-page-body class which we will add to converter.html */
.converter-page-body .desktop-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    padding: 5px;
    border-radius: 12px;
    /* Rounded Rectangle */
    border: 1px solid var(--border);
}

.converter-page-body .nav-pill-link {
    padding: 8px 18px;
    border-radius: 8px;
    /* Soft edges, rectangle */
    text-decoration: none;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.converter-page-body .nav-pill-link:hover {
    color: var(--text-primary);
    background: rgba(128, 128, 128, 0.1);
}

.converter-page-body .nav-pill-link.active {
    background: var(--primary);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

/* Light/Dark mode specific adjustments if needed */
[data-theme='dark'] .converter-page-body .nav-pill-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile Hiding handled in media queries below */

/* --- GLOBAL MOBILE ADJUSTMENTS --- */
/* Increased breakpoint to 1150px to prevent navbar overflow on tablets/small laptops */
@media (max-width: 480px) {

    /* Base Container - Viewport Minimum (Scrollable) */
    html,
    body {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto !important;
        /* Allow scroll */
        -webkit-tap-highlight-color: transparent;
        /* Remove blue tap box */
    }

    /* APP-LIKE FEEL: Disable selection on UI elements */
    * {
        user-select: none;
        -webkit-user-select: none;
    }

    /* Re-enable selection for text inputs */
    input,
    textarea,
    [contenteditable] {
        user-select: text;
        -webkit-user-select: text;
    }

    /* Better touch response */
    button,
    .key,
    .nav-pill,
    a {
        touch-action: manipulation;
        /* Faster clicks */
        cursor: pointer;
    }

    /* Active state for ALL interactive elements on mobile */
    button:active,
    .key:active,
    .nav-pill:active,
    a:active {
        transform: scale(0.96);
        opacity: 0.8;
    }

    .app-container {
        padding: 0;
        margin: 0;
        width: 100%;
        height: auto !important;
        /* Allow it to grow */
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        overflow: visible !important;
        /* Allow full page scroll */
    }

    /* Main Content: Flex grow and scroll internally */
    .main-content {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        overflow: visible !important;
        /* No internal scroll */
        height: auto;
        padding-bottom: 20px !important;
        justify-content: flex-start;
    }

    /* Typing Area: This is the resizable spacer */
    .typing-area-wrapper {
        flex: 1 1 auto !important;
        /* Force it to grow and take all available space */
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        /* Ensure top alignment */
        align-items: stretch;
        min-height: 50vh !important;
        /* Take up more space */
        max-height: none !important;
        /* Remove the 60vh limit */
        padding: 16px 18px 20px;
        margin-bottom: 0px !important;
        /* Stats bar is hidden, no gap needed */
        border-radius: 18px;
    }

    /* Stats bar sits between text and keyboard */
    .stats-bar {
        flex: 0 0 auto;
        padding: 6px 4px !important;
        gap: clamp(5px, 2vw, 15px) !important;
        justify-content: space-evenly !important;
        width: 100% !important;
        margin: 5px 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .stat-item {
        min-width: 0;
        flex: 1;
    }

    .stat-item .label {
        font-size: 0.7rem !important;
        white-space: nowrap;
    }

    .stat-item .value {
        font-size: 1.1rem !important;
        white-space: nowrap;
    }

    .stat-item .value small {
        font-size: 0.6rem !important;
    }

    .restart-btn {
        padding: 6px 10px !important;
        font-size: 0.75rem !important;
        min-width: 70px !important;
    }

    /* Keyboard: FIXED dock at bottom of viewport */
    /* Keyboard: Relative flow (Scrolls with page) */
    .keyboard-section {
        flex: 0 0 auto;
        position: relative;
        width: 100%;
        padding-top: 15px !important;
        padding-bottom: 20px !important;
        background: var(--bg-color);
        border-top: 1px solid var(--border);
        box-shadow: none;
        margin-top: 20px;
    }



    /* Header remains sticky at top */

    /* --- 1. HEADER RE-DESIGN --- */
    .glass-header {
        position: sticky !important;
        top: 0 !important;
        /* Keep it sticky but honor the original styling */
        z-index: 1000;
        padding: 5px 12px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        height: 56px;
        margin-bottom: 0;
        width: 100%;
        background: var(--surface);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
        opacity: 1;
    }

    [data-theme='dark'] .glass-header {
        background: rgba(22, 27, 34, 0.95);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .header-left {
        flex: 1;
    }

    /* Logo - enhanced styling */
    .logo {
        font-size: 1.4rem;
        padding: 0;
        font-weight: 700;
    }

    .logo span {
        font-size: 1.4rem;
    }

    /* Hide Desktop Middle Nav */
    .header-center {
        display: none;
        /* Hidden by default, toggled via JS class */
    }

    /* Header Actions (Right Side) */
    /* Header Actions (Right Side) */
    .header-right {
        gap: 12px;
    }

    .header-actions {
        gap: 8px;
    }

    /* Hide large buttons on mobile */
    /* .see-more-btn MUST BE VISIBLE (Eye Icon) */
    .header-actions .stats-nav-btn span:not(.stats-icon),
    .input-mode-switcher {
        display: none !important;
    }

    /* Ensure Eye Icon is visible and sized correctly */
    .header-actions .see-more-btn {
        display: flex !important;
        width: 36px;
        height: 36px;
        padding: 0;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
    }

    /* Keep essential icons */
    .stats-nav-btn {
        width: 36px;
        height: 36px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
    }

    .stats-icon {
        margin: 0;
        font-size: 1.2rem;
    }

    /* Mobile Hamburger Trigger */
    .mobile-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        background: transparent;
        border: none;
        color: var(--text-primary);
        cursor: pointer;
    }

    /* Mobile Menu Card Handled in index.bundle.css */
    .mobile-hamburger {
        display: block !important;
    }

    .desktop-nav {
        display: none !important;
    }

    @keyframes mobileMenuSlide {
        from {
            transform: translateY(-10px);
            opacity: 0;
        }

        to {
            transform: translateY(0);
            opacity: 1;
        }
    }



    /* Mobile Mode Selector (Injected via JS if needed, or re-styled) */
    .mobile-mode-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid var(--border);
    }

    .mobile-mode-btn {
        padding: 12px;
        text-align: center;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 8px;
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--text-secondary);
        text-decoration: none;
    }

    .mobile-mode-btn.active {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

    /* --- 2. SECONDARY NAV (LESSON CONTROLS) --- */
    .secondary-nav-container {
        padding: 10px 12px;
        margin-top: 10px !important;
        /* Push down slightly to close visual gap? Or ensure clear separate? user said "alittle down so no more gap". margins collapse usually. */
        margin-bottom: 0 !important;
        /* Remove bottom gap */
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        background: var(--bg-color);
        border-bottom: 1px solid var(--border);
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-shrink: 0;
    }

    .secondary-nav-container::-webkit-scrollbar {
        display: none;
    }

    .nav-section-group,
    .view-toggle-group {
        display: flex;
        gap: 8px;
    }

    .nav-dropdown {
        position: static;
        /* Full width dropdown on mobile */
    }

    .dropdown-trigger {
        padding: 8px 12px;
        font-size: 0.9rem;
        background: var(--surface);
        border: 1px solid var(--border);
    }

    /* Full screen dropdown content */
    .nav-dropdown.open .dropdown-content {
        position: fixed;
        left: 0;
        right: 0;
        top: 110px;
        /* Header + SecNav height approx */
        bottom: 0;
        width: 100%;
        max-height: none;
        border-radius: 0;
        border: none;
        padding: 20px;
        z-index: 900;
        background: var(--surface);
        transform: translateY(0);
        overflow-y: auto;
    }

    /* --- 3. TYPING AREA --- */
    .main-grid {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .typing-section {
        padding: 10px 16px;
        width: 100%;
        margin: 0;
    }

    .typing-area-wrapper {
        min-height: 240px;
        /* room to write */
        max-height: 60vh;
        padding: 16px 18px 42px;
        margin-bottom: 8px;
        border-radius: 18px;
        display: flex;
        align-items: stretch;
        justify-content: flex-start;
        overflow: visible;
    }

    #text-display {
        font-size: 1.25rem !important;
        line-height: 1.55 !important;
        padding: 16px 18px 50px;
        width: 100%;
        text-align: left;
        flex: 1 1 auto;
        display: block !important;
        /* CRITICAL: Block allows text wrapping */
        white-space: pre-wrap !important;
        /* Allow wrapping */
        min-height: auto;
        /* Let content dictate height */
    }

    .dev-status-bar,
    .caps-lock-warning,
    #toggle-hands-btn,
    #free-toggle-hands-btn {
        display: none !important;
    }

    /* Free Zone Adjustments */
    #free-typing-area {
        width: 100% !important;
        height: auto !important;
        min-height: 50vh !important;
        /* Increased for mobile space */
        resize: vertical;
        font-size: 1.4rem;
        padding: 20px 20px 80px 20px;
        /* Formatting toolbar space */
        overflow-y: auto !important;
    }

    #free-typing-area.hidden {
        display: none !important;
    }

    .typing-area-actions {
        position: fixed !important;
        bottom: 12px !important;
        left: 12px !important;
        right: 12px !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        padding: 10px 14px !important;
        gap: 8px !important;
        width: auto !important;
        z-index: 100 !important;
        background: rgba(var(--surface-rgb, 255, 255, 255), 0.94) !important;
        border: 1px solid var(--border) !important;
        border-radius: 14px !important;
        box-shadow: 0 6px 18px rgb(0 0 0 / 0.18) !important;
    }

    /* Style Copy and Clear buttons for phone */
    #copy-free-btn,
    #clear-free-btn {
        padding: 10px 16px !important;
        font-size: 0.85rem !important;
        border-radius: 20px !important;
        background: var(--surface) !important;
        border: 1px solid var(--border) !important;
        color: var(--text-primary) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
        font-weight: 600 !important;
        min-width: 70px !important;
    }

    #copy-free-btn:active,
    #clear-free-btn:active {
        transform: scale(0.95) !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2) !important;
    }

    #clear-free-btn {
        background: var(--danger, #ef4444) !important;
        color: white !important;
        border-color: var(--danger, #ef4444) !important;
    }

    /* --- 4. COMPACT DASHBOARD - OPTIMIZED FOR PHONE --- */
    .global-dashboard-bottom {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        gap: 12px;
        margin: 0;
        background: var(--bg-color);
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
    }

    .dashboard-grid {
        display: flex;
        gap: 16px;
        width: auto;
        flex: 1;
    }

    .mini-stat {
        min-width: auto;
        text-align: center;
        padding: 8px 12px;
        background: var(--surface);
        border-radius: 12px;
        border: 1px solid var(--border);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
        display: flex !important;
        flex-direction: row !important;
        align-items: baseline !important;
        gap: 5px !important;
        white-space: nowrap !important;
    }

    .m-label {
        font-size: 0.55rem !important;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-secondary);
        font-weight: 700 !important;
        order: 2 !important;
    }

    .m-value {
        font-size: 1.3rem !important;
        font-weight: 700;
        color: var(--text-primary);
        line-height: 1;
        order: 1 !important;
    }

    /* Highlight specific stats with colors */
    .mini-stat:has(.m-label:contains("SPEED")) .m-value,
    .mini-stat:nth-child(1) .m-value {
        color: var(--primary, #3b82f6);
    }

    .mini-stat:has(.m-label:contains("ACCURACY")) .m-value,
    .mini-stat:nth-child(2) .m-value {
        color: var(--success, #10b981);
    }

    /* Hide detailed XP bars/hands on mobile stats */
    .nav-right-progress-bars,
    .hands-visual-container {
        display: none !important;
    }

    /* Restart button - more prominent */
    .nav-far-right {
        display: flex;
        margin-left: auto;
    }

    #restart-btn,
    .restart-btn {
        padding: 10px 20px !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        border-radius: 10px !important;
        background: var(--primary, #3b82f6) !important;
        color: white !important;
        border: none !important;
        box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3) !important;
        transition: all 0.2s ease !important;
    }

    #restart-btn:active,
    .restart-btn:active {
        transform: scale(0.95) !important;
        box-shadow: 0 1px 3px rgba(59, 130, 246, 0.4) !important;
    }

    /* --- FIX SPACING AND TEXT VISIBILITY --- */
    /* Add space between navbar and typing area */
    .main-content,
    main {
        padding-top: 15px !important;
        margin-top: 0 !important;
    }

    /* Fix typing area to show typed text properly */
    .typing-area-wrapper,
    #main-typing-area {
        padding: 16px 18px 42px !important;
        min-height: 240px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
    }

    .text-display,
    #text-display {
        min-height: 180px !important;
        padding: 16px 18px 50px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        display: block !important;
        width: 100% !important;
        line-height: 1.6 !important;
        font-size: 1.15rem !important;
        text-align: left !important;
        border-radius: 16px !important;
    }

    /* Ensure cursor and text are visible */
    .cursor {
        display: inline-block !important;
        vertical-align: baseline !important;
    }

    /* --- 5. MOBILE VIRTUAL KEYBOARD - AGGRESSIVE FIX --- */
    .keyboard-section,
    #keyboard-section {
        padding: 5px 2px !important;
        background: var(--bg-color) !important;
        overflow-x: hidden !important;
        width: 100% !important;
        margin-bottom: 0 !important;
        transform: none !important;
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        /* CRITICAL: Remove the 200px gap */
    }

    /* CRITICAL FIX: Hide the entire section when keyboard is toggled off 
       on mobile/tablet since hands are already hidden anyway. */
    body.hide-keyboard .keyboard-section {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #keyboard-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Force the inner keyboard container to fill space */
    .keyboard-container,
    #keyboard {
        transform: none !important;
        /* Remove specific keyboard scaling */
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        /* Stretch rows */
        margin: 0 !important;
        padding: 0 !important;
    }

    .keyboard-row {
        display: flex !important;
        justify-content: space-between !important;
        /* Spread keys */
        width: 100% !important;
        gap: 3px !important;
        margin-bottom: 4px !important;
        padding: 0 4px !important;
    }

    .key {
        display: flex !important;
        flex: 1 !important;
        /* Grow to fill */
        align-items: center;
        justify-content: center;
        height: 48px !important;
        /* Taller touch targets */
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 6px !important;
        position: relative !important;
    }

    /* Hide un-needed labels */
    .key-bg-label {
        display: none !important;
    }

    .key-label {
        font-size: 9px !important;
        top: 2px !important;
        left: 3px !important;
        position: absolute !important;
        color: var(--text-secondary);
    }

    /* Main Character size */
    .key-nepali {
        font-size: 18px !important;
        line-height: 48px !important;
        font-weight: bold;
    }

    .key-shift {
        font-size: 10px !important;
        top: 2px !important;
        right: 3px !important;
        position: absolute !important;
    }

    /* Specific Key Widths relative to others */
    .key[data-code="Space"] {
        flex: 4 !important;
    }

    .key[data-code="Enter"] {
        flex: 1.5 !important;
        background: var(--border);
    }

    .key[data-code="Backspace"] {
        flex: 1.5 !important;
    }

    .key[data-code="ShiftLeft"],
    .key[data-code="ShiftRight"] {
        flex: 1.2 !important;
    }

    .key[data-code="Tab"],
    .key[data-code="CapsLock"] {
        display: none !important;
    }

    /* Hide toggles in keyboard */
    .kb-toggle-group {
        display: none !important;
    }

    .key[data-code="CapsLock"] {
        display: none;
        /* Hide less useful keys on mobile to save space */
    }

    /* Hide toggles in keyboard */
    .kb-toggle-group {
        display: none !important;
    }

    /* --- TYPING AREA EXPANSION --- */
    .typing-area-wrapper {
        position: relative;
        flex: 1 1 auto;
        min-height: 40vh;
        max-height: none;
        justify-content: flex-start !important;
        padding: 24px 12px 14px 12px;
        overflow: hidden !important;
    }

    .typing-area-actions {
        overflow-x: auto !important;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .free-format-toolbar {
        flex: 0 0 auto !important;
        gap: 8px !important;
    }

    #free-typing-area {
        width: 100% !important;
        height: auto !important;
        min-height: 50vh !important;
        /* Increased for mobile space */
        resize: vertical;
        font-size: 1.4rem;
        padding: 20px 20px 80px 20px;
        /* Formatting toolbar space */
        overflow-y: auto !important;
    }

    #free-typing-area.hidden {
        display: none !important;
    }

    /* Learn Mode Display */
    #text-display {
        flex: 1 1 auto;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        /* Fix for scroll */
        min-height: 120px;
        max-height: 30vh;
        overflow-y: auto !important;
        pointer-events: auto !important;
        padding: 30px 20px;
        font-size: 2.4rem !important;
    }

    #text-display.line-view-mode .layers-container {
        margin-top: auto !important;
        margin-bottom: auto !important;
    }

    #text-display.paragraph-view-mode .layers-container {
        margin-top: 0 !important;
        margin-bottom: auto !important;
    }

    /* Optimized Focus Mode for Tablets */
    /* When keyboard is hidden on mobile/tablet, hands are already hidden by CSS, 
       so we only need to check for hide-keyboard to expand fully. */
    body.hide-keyboard.hide-hands .typing-area-wrapper,
    body.hide-keyboard .typing-area-wrapper {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
        margin-bottom: 0;
    }

    body.hide-keyboard.hide-hands .typing-area-wrapper {
        min-height: 52vh !important;
        height: 52vh !important;
        max-height: none !important;
    }

    body.hide-keyboard #text-display {
        font-size: 2.35rem !important;
        max-height: 100% !important;
        min-height: 0 !important;
    }

    body.text-view-line:not(.hide-keyboard.hide-hands) .typing-area-wrapper,
    body.text-view-paragraph:not(.hide-keyboard.hide-hands) .typing-area-wrapper,
    body.text-view-line:not(.hide-keyboard.hide-hands) #main-typing-area,
    body.text-view-paragraph:not(.hide-keyboard.hide-hands) #main-typing-area {
        height: clamp(150px, 19vh, 175px) !important;
        min-height: 150px !important;
        max-height: 175px !important;
    }

    /* Learn Mode Symbol Button - now inside flex bottom bar (no absolute positioning needed) */
    #learn-mode-alt-trigger {
        position: static !important;
        margin: 0 !important;
        padding: 4px 8px !important;
        background: transparent !important;
        z-index: 100 !important;
        transform: none !important;
        display: flex !important;
        width: auto;
        height: auto;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
    }

    /* HIDE SYMBOLS FOR NON-PREETI MODES (English/Unicode) */
    /* If the body input mode is NOT preeti (and attribute is present), hide it */
    body:not([data-input-mode="preeti"]) #learn-mode-alt-trigger,
    body:not([data-input-mode="preeti"]) .alt-helper-btn {
        display: none !important;
    }

    /* Hide Finger/Hands Guidance on Mobile */
    .hands-visual-container,
    .finger-guide-overlay,
    .hand {
        display: none !important;
    }

    /* --- 6. FOOTER & SEO --- */
    footer.pro-footer {
        padding: 30px 20px 40px 20px;
        /* Balanced bottom padding */
    }

    .footer-content {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }

    .footer-col {
        align-items: center;
    }

    .footer-links li {
        justify-content: center;
    }

    /* --- FREE MODE CONTROLS (Mobile) --- */
    .typing-area-actions {
        position: relative !important;
        width: 100%;
        display: flex !important;
        justify-content: space-between;
        /* Spread buttons out */
        align-items: center;
        gap: 12px;
        padding: 10px 5px;
        margin-bottom: 5px;
        background: transparent !important;
        pointer-events: auto !important;
        z-index: 50;
    }

    /* Larger Touch Targets */
    .alt-helper-btn {
        position: static !important;
        width: 48px !important;
        height: 48px !important;
        border-radius: 10px;
        font-size: 1.4rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .copy-btn,
    .clear-btn {
        font-size: 0.95rem;
        padding: 0 16px;
        height: 48px !important;
        flex: 1;
        /* Make them grow to be easily tappable */
        border-radius: 10px;
    }

    /* --- DUPLICATE ICON FIX --- */
    /* Hide Learn Mode trigger when in Free Mode */
    html.free-mode-init #learn-mode-alt-trigger {
        display: none !important;
    }

    /* Hide Free Mode controls when NOT in Free Mode */
    html:not(.free-mode-init) #free-mode-controls {
        display: none !important;
    }

    /* --- CONVERTER FIX --- */
    .converter-main-layout {
        flex-direction: column !important;
        gap: 20px;
        padding-bottom: 50px;
    }

    .textarea-wrapper textarea {
        min-height: 250px !important;
        /* MUCH TALLER */
        font-size: 1.1rem;
        padding: 15px;
    }

    .copy-btn,
    .clear-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
        height: 36px;
    }

    /* Override any absolute positioning causing overlap */
    #free-typing-area {
        margin-top: 0 !important;
    }

    /* --- FAB / CONTACT ICON FIX --- */
    .fab-container {
        bottom: 250px !important;
        right: 15px !important;
        z-index: 1000;
    }

    .contact-fab {
        width: 45px !important;
        height: 45px !important;
        /* Make smaller */
    }

    .contact-fab svg {
        width: 24px;
        height: 24px;
    }

    /* --- CONVERTER OPTIMIZATION (PHONE) --- */
    .converter-section {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 auto !important;
    }

    .converter-main-layout {
        flex-direction: column !important;
        gap: 8px !important;
        padding: 0 10px 20px 10px !important;
    }

    .converter-page {
        width: 100% !important;
        flex: none !important;
        position: relative !important;
    }

    .page-header {
        padding: 10px 15px !important;
        min-height: auto !important;
        padding-right: 10px !important;
    }

    /* Move buttons inside textarea at top-right */
    .page-actions {
        position: absolute !important;
        top: 10px !important;
        right: 10px !important;
        z-index: 10 !important;
        display: flex !important;
        gap: 6px !important;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(8px) !important;
        padding: 4px !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }

    [data-theme='dark'] .page-actions {
        background: rgba(22, 27, 34, 0.95) !important;
    }

    .tool-btn {
        font-size: 0.75rem !important;
        padding: 5px 8px !important;
        height: 28px !important;
        min-width: auto !important;
    }

    .textarea-wrapper {
        min-height: 200px !important;
        position: relative !important;
    }

    .textarea-wrapper textarea {
        min-height: 200px !important;
        max-height: 300px !important;
        font-size: 1rem !important;
        line-height: 1.6 !important;
        padding: 12px !important;
        padding-top: 45px !important;
        /* Space for floating buttons */
    }

    /* --- KEYBOARD EDGE-TO-EDGE --- */
    .keyboard-section {
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
        border-radius: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        left: 0 !important;
        box-sizing: border-box;
    }

    .keyboard-container {
        padding: 5px 2px !important;
        /* Minimal internal padding */
        width: 100% !important;
        max-width: none !important;
    }

    .keyboard {
        gap: 2px !important;
        /* Tighter gap */
    }

    .key {
        margin: 1px !important;
    }

    /* --- 7. MODALS & POPUPS (Robust Centering) --- */
    .modal-content {
        position: fixed !important;
        inset: 0 !important;
        margin: auto !important;
        width: 90% !important;
        max-width: 400px;
        height: fit-content !important;
        max-height: 85vh;
        overflow-y: auto;
        border-radius: 12px;
        padding: 20px;
        transform: none !important;
        background: var(--bg-color, #fff);
    }

    /* Theme Popup Check */
    .theme-popup {
        position: fixed !important;
        inset: 0 !important;
        margin: auto !important;
        width: 90% !important;
        max-width: 320px !important;
        height: fit-content !important;
        max-height: 70vh !important;
        overflow-y: auto !important;
        z-index: 2000 !important;
        background: var(--surface, #fff);
        border-radius: 16px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
        border: 1px solid var(--border);
        transform: none !important;
    }

    .text-view-toggle {
        position: static;
        transform: none;
    }

    .text-view-btn {
        font-size: 0.72rem;
        padding: 4px 8px;
    }
}

/* Extra Small Devices (< 360px) */
@media (max-width: 360px) {
    .key-nepali {
        font-size: 14px;
    }

    #text-display {
        font-size: 1.4rem !important;
    }
}

/* --- LANDSCAPE MODE OPTIMIZATION --- */
@media (max-height: 500px) and (orientation: landscape) {

    .glass-header,
    footer.pro-footer,
    .dev-status-bar,
    #shared-stats {
        display: none !important;
        /* Hide clutter */
    }

    .typing-area-wrapper {
        padding-top: 5px !important;
        min-height: 60px !important;
    }

    #text-display {
        min-height: 60px !important;
        max-height: 100px !important;
    }

    .keyboard-section {
        position: fixed;
        bottom: 0;
        height: auto;
    }

    /* Stats hotkey mapping specific fix */
    .stats-hotkey-map {
        display: none;
        /* Hide if taking too much space */
    }

    /* --- INPUT MODE VISIBILITY FIX --- */
    /* Show label for active mode so user knows which mode they're in */
    .mode-btn.active .mode-label {
        display: inline !important;
        font-size: 0.75rem !important;
    }

    /* Ensure mode buttons are visible and properly sized */
    .mode-btn {
        min-width: 40px !important;
        padding: 6px 8px !important;
    }

    .mode-btn.active {
        padding: 6px 12px !important;
        font-weight: 600 !important;
    }

    /* --- SYMBOLIC KEYS FOR MOBILE (Save Space) --- */
    .key[data-key="ShiftLeft"],
    .key[data-key="ShiftRight"],
    .key[data-key="Tab"],
    .key[data-key="Backspace"],
    .key[data-key="Enter"],
    .key[data-key="CapsLock"] {
        font-size: 0 !important;
        /* Hide text */
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .key[data-key="ShiftLeft"]::after,
    .key[data-key="ShiftRight"]::after,
    .key[data-key="Tab"]::after,
    .key[data-key="Backspace"]::after,
    .key[data-key="Enter"]::after,
    .key[data-key="CapsLock"]::after {
        font-size: 1.4rem !important;
        /* Restore size for icon */
        color: var(--text-primary);
        font-weight: bold;
    }

    .key[data-key="ShiftLeft"]::after,
    .key[data-key="ShiftRight"]::after {
        content: "⇧";
    }

    .key[data-key="Backspace"]::after {
        content: "⌫";
    }

    .key[data-key="Enter"]::after {
        content: "↵";
    }

    .key[data-key="Tab"]::after {
        content: "↹";
    }

    .keyboard>div:nth-child(3)> :first-child::after {
        content: "⇪";
    }

    /* EXTEND SYMBOLIC TO CTRL/ALT/WIN (Shifted indices due to toggle) */
    .keyboard>div:last-child> :nth-child(2),
    .keyboard>div:last-child> :nth-child(3),
    .keyboard>div:last-child> :nth-child(4),
    .keyboard>div:last-child> :nth-child(6),
    .keyboard>div:last-child> :nth-child(7) {
        font-size: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0 !important;
    }

    /* Replace Labels */
    .keyboard>div:last-child> :nth-child(2)::after,
    .keyboard>div:last-child> :nth-child(7)::after {
        content: "Ctrl";
        font-size: 0.9rem !important;
        display: block !important;
        color: var(--text-primary);
        font-weight: bold;
    }

    .keyboard>div:last-child> :nth-child(3)::after {
        content: "Win";
        font-size: 0.9rem !important;
        display: block !important;
        color: var(--text-primary);
        font-weight: bold;
    }

    .keyboard>div:last-child> :nth-child(4)::after,
    .keyboard>div:last-child> :nth-child(6)::after {
        content: "Alt";
        font-size: 0.9rem !important;
        display: block !important;
        color: var(--text-primary);
        font-weight: bold;
    }

    /* HIDE ORIGINAL TEXT CHILDREN to prevent deflection/duplicates (Targeting Symbolic Keys Only) */
    .key[data-key="Tab"]>*,
    .keyboard>div:nth-child(2)> :first-child>*,
    .key[data-key="CapsLock"]>*,
    .keyboard>div:nth-child(3)> :first-child>*,
    .key[data-key="ShiftLeft"]>*,
    .keyboard>div:nth-child(4)> :first-child>*,
    .key[data-key="ShiftRight"]>*,
    .keyboard>div:nth-child(4)> :last-child>*,
    .key[data-key="Enter"]>*,
    .keyboard>div:nth-child(3)> :last-child>*,
    .key[data-key="Backspace"]>*,
    .keyboard>div:nth-child(1)> :last-child>*,
    .keyboard>div:last-child> :nth-child(2)>*,
    .keyboard>div:last-child> :nth-child(3)>*,
    .keyboard>div:last-child> :nth-child(4)>*,
    .keyboard>div:last-child> :nth-child(6)>*,
    .keyboard>div:last-child> :nth-child(7)>* {
        display: none !important;
    }

    /* FORCE SPACE BAR ALIGNMENT */
    .key[data-key="Space"],
    .key[data-key="SPACE"],
    .key[data-key=" "] {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        padding: 0 !important;
    }

    .key[data-key="Space"] .key-label,
    .key[data-key="SPACE"] .key-label,
    .key[data-key=" "] .key-label {
        position: static !important;
        transform: none !important;
        margin: 0 !important;
        width: auto !important;
        display: inline-block !important;
        font-size: 1rem !important;
        /* Ensure visible size override */
    }

    /* --- HIDE ENGLISH LETTER HINTS ON KEYS (Preeti/Unicode modes only) --- */
    body[data-input-mode="preeti"] .keyboard .key .key-label,
    body[data-input-mode="unicode"] .keyboard .key .key-label,
    body[data-input-mode="unicode_roman"] .keyboard .key .key-label {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}

/* ============================================
   TABLET RESPONSIVENESS (800px - 1250px)
   ============================================ */
@media (min-width: 481px) and (max-width: 1024px) {

    /* 1. Show Hamburger for Unified Menu, Hide Pills */
    .mobile-hamburger {
        display: block !important;
    }

    .nav-pills {
        display: none !important;
    }

    .header-center {
        display: none;
        /* Only show when .mobile-open is active (triggered by hamburger) */
        padding: 0 5px;
        /* Minimal padding to save space */
    }

    /* 2. Show Tablet Triggers */
    .tablet-nav-toggle,
    .tablet-mode-toggle {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        background: var(--surface);
        border: 1px solid var(--border);
        padding: 8px 12px;
        height: 44px;
        border-radius: 10px;
        color: var(--text-primary);
        font-weight: 600;
        font-size: 0.95rem;
        cursor: pointer;
        z-index: 1002;
        /* SQUEEZE LOGIC */
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
    }


    .tablet-mode-toggle span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tablet-mode-toggle {
        border-color: var(--primary-glow);
    }

    /* 3. Navigation Dropdown */
    .nav-pills {
        display: none;
        position: absolute;
        top: 60px;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: column;
        background: var(--surface);
        border: 1px solid var(--border);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
        border-radius: 12px;
        padding: 8px;
        width: 220px;
        z-index: 2005;
    }

    .nav-pills.active {
        display: flex !important;
    }

    .nav-pill {
        width: 100%;
        justify-content: flex-start;
        padding: 10px;
    }

    /* 4. Input Mode Dropdown */
    .input-mode-switcher {
        display: none !important;
        position: absolute;
        top: 60px;
        right: 20px;
        flex-direction: column;
        background: var(--surface);
        border: 1px solid var(--border);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
        border-radius: 12px;
        padding: 8px;
        width: 200px;
        z-index: 2005;
        gap: 5px;
        /* Spacing between clones */
    }

    /* Split group fix for column layout: Stack them for 4 separate options */
    .mode-btn-split-group {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 5px;
    }

    .input-mode-switcher.active {
        display: flex !important;
    }

    .mode-btn {
        width: 100%;
        justify-content: flex-start;
    }

    /* Width Overrides Removed to allow proper squeezing */




    /* Compress Right Side */
    .header-right {
        gap: 6px;
    }

    /* Optional: Hide text labels on smaller tablets if needed */
    .nav-btn span {
        font-size: 0.9rem;
    }

    /* --- CONVERTER TABLET OPTIMIZATION --- */
    .converter-section {
        max-width: 1420px !important;
        width: 100% !important;
        padding: 0 20px !important;
        margin: 0 auto !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .converter-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    .converter-hero {
        padding: 20px 15px !important;
        margin-bottom: 10px !important;
    }

    .converter-hero h1 {
        font-size: 1.8rem !important;
        margin-bottom: 5px !important;
    }

    .converter-hero p {
        font-size: 0.95rem !important;
    }

    .converter-main-layout {
        flex-direction: column !important;
        gap: 8px !important;
        /* Reduced gap for bigger textareas */
        padding: 0 10px 20px 10px !important;
    }

    .converter-main-layout.mode-reversed {
        flex-direction: column-reverse !important;
    }

    .converter-page {
        width: 100% !important;
        flex: none !important;
        position: relative !important;
    }

    .page-header {
        padding: 10px 15px !important;
        min-height: auto !important;
        padding-right: 10px !important;
        /* Reduced since buttons moved */
    }

    .page-header h3 {
        font-size: 0.9rem !important;
    }

    .font-badge {
        font-size: 0.75rem !important;
        padding: 4px 10px !important;
    }

    /* Move buttons inside textarea at top-right */
    .page-actions {
        position: absolute !important;
        top: 10px !important;
        right: 10px !important;
        z-index: 10 !important;
        display: flex !important;
        gap: 6px !important;
        background: rgba(var(--surface-rgb, 255, 255, 255), 0.95) !important;
        backdrop-filter: blur(8px) !important;
        padding: 4px !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }

    .tool-btn {
        font-size: 0.8rem !important;
        padding: 5px 10px !important;
        height: 30px !important;
        min-width: auto !important;
    }

    .textarea-wrapper {
        min-height: 220px !important;
        position: relative !important;
        /* Increased from 200px - saved space from reduced gap */
    }

    .textarea-wrapper textarea {
        min-height: 220px !important;
        max-height: 320px !important;
        /* Bigger textareas for better content visibility */
        font-size: 1.35rem !important;
        line-height: 1.6 !important;
        padding: 15px !important;
        padding-top: 50px !important;
        /* Space for buttons */
    }

    .converter-divider {
        margin: 4px 0 !important;
        /* Further reduced */
        gap: 6px !important;
    }

    .swap-btn-circle {
        width: 36px !important;
        height: 36px !important;
    }

    .converter-footer-tools {
        padding: 12px 15px !important;
        gap: 10px !important;
    }

    /* --- TYPEBOX GHOST TEXT CENTERING --- */
    .typing-area-wrapper {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 180px !important;
        /* Reduced from 250px to make room for keyboard */
        max-height: 220px !important;
        /* Limit height on tablets */
    }

    .text-display {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        width: 100% !important;
        padding: 2.5rem 1.5rem !important;
        /* Increased padding */
        line-height: 1.25 !important;
        word-wrap: break-word !important;
        white-space: pre-wrap !important;
        /* Use pre-wrap for better ghost text behavior */
        flex-wrap: wrap !important;
        font-size: 2.2rem !important;
        /* CRITICAL: Increased font size for tablet */
        min-height: 180px !important;
    }

    /* --- KEYBOARD EXPANSION (Tablet) - UNIFORM ACROSS ALL TABLET SIZES --- */
    .keyboard-section {
        width: 100% !important;
        padding: 0 5px !important;
        margin: 0 auto !important;
        transform: none !important;
        /* Override index.bundle.css scale(0.9) */
        max-width: 750px !important;
        /* Lock to 750px appearance */
        overflow: visible !important;
        /* Ensure nothing is hidden */
    }

    .keyboard-container {
        width: 100% !important;
        max-width: 750px !important;
        /* Consistent with 750px view */
        padding: 8px 5px !important;
        /* Reduced padding */
        margin: 0 auto !important;
        /* Center it */
        transform: none !important;
        /* Remove any scaling */
    }

    .keyboard {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 4px !important;
        /* Reduced from 6px to save vertical space */
    }

    /* Keyboard Rows (assuming direct children of .keyboard are rows) */
    .keyboard>div {
        display: flex !important;
        width: 100% !important;
        justify-content: center !important;
        gap: 3px !important;
        /* Reduced from 4px */
    }

    /* Keys - Consistent sizing across all tablet widths */
    .key {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        flex: 1 !important;
        /* Grow to fill width */
        width: auto !important;
        min-width: 30px !important;
        max-width: 60px !important;
        /* Prevent keys from getting too wide on larger tablets */
        margin: 0 !important;
        height: 45px !important;
        /* Reduced from 50px to fit all rows */
        font-size: 1rem !important;
        /* Slightly smaller font */
        position: relative !important;
    }

    /* Special Keys Sizing Overrides */
    .key[data-key="Space"],
    .key[data-key="SPACE"],
    .key[data-key=" "],
    .keyboard>div:last-child> :nth-child(5) {
        flex: 25 !important;
        min-width: 250px !important;
        max-width: 400px !important;
        /* Reduced from 450px for consistency */
        width: auto !important;
    }

    .key[data-key="ShiftLeft"],
    .key[data-key="ShiftRight"] {
        flex: 2.5 !important;
        max-width: 90px !important;
    }

    .key[data-key="Enter"],
    .key[data-key="Backspace"],
    .key[data-key="CapsLock"],
    .key[data-key="Tab"] {
        flex: 2 !important;
        max-width: 80px !important;
    }
}

/* Base styles for triggers (Hidden on Desktop) */
.tablet-nav-toggle,
.tablet-mode-toggle {
    display: none;
}

/* ============================================
   GLOBAL HIDES FOR TABLET & MOBILE ONLY
   (Hide Hands Guide on Tablet & Mobile, Show on Small Laptops)
   ============================================ */
@media (max-width: 1024px) {

    .hand,
    .hands-container,
    .finger-highlight,
    .guide-hand {
        display: none !important;
    }

    /* SYMBOLIC KEYS (Replaces Text with Icons to fix deflection & save space) */
    .key[data-key="Tab"],
    .key[data-key="CapsLock"],
    .key[data-key="ShiftLeft"],
    .key[data-key="ShiftRight"],
    .key[data-key="Enter"],
    .key[data-key="Backspace"] {
        font-size: 0 !important;
        /* Hide Original Text */
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0 !important;
    }

    .key[data-key="Tab"]::after,
    .key[data-key="CapsLock"]::after,
    .key[data-key="ShiftLeft"]::after,
    .key[data-key="ShiftRight"]::after,
    .key[data-key="Enter"]::after,
    .key[data-key="Backspace"]::after {
        font-size: 1.4rem !important;
        color: var(--text-primary);
        font-weight: bold;
        position: static !important;
        display: block !important;
    }

    .key[data-key="ShiftLeft"]::after,
    .key[data-key="ShiftRight"]::after {
        content: "⇧";
    }

    .key[data-key="Backspace"]::after {
        content: "⌫";
    }

    .key[data-key="Enter"]::after {
        content: "↵";
    }

    .key[data-key="Tab"]::after {
        content: "↹";
    }

    .key[data-key="CapsLock"]::after {
        content: "⇪";
    }

    /* SYMBOLIC KEYS FALLBACKS (Positional) */
    .keyboard>div:nth-child(2)> :first-child,
    .keyboard>div:nth-child(3)> :first-child,
    .keyboard>div:nth-child(4)> :first-child,
    .keyboard>div:nth-child(4)> :last-child,
    .keyboard>div:nth-child(3)> :last-child,
    .keyboard>div:nth-child(1)> :last-child {
        font-size: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0 !important;
    }

    .keyboard>div:nth-child(2)> :first-child::after,
    .keyboard>div:nth-child(3)> :first-child::after,
    .keyboard>div:nth-child(4)> :first-child::after,
    .keyboard>div:nth-child(4)> :last-child::after,
    .keyboard>div:nth-child(3)> :last-child::after,
    .keyboard>div:nth-child(1)> :last-child::after {
        font-size: 1.4rem !important;
        color: var(--text-primary);
        font-weight: bold;
        position: static !important;
        display: block !important;
    }

    .keyboard>div:nth-child(4)> :first-child::after,
    .keyboard>div:nth-child(4)> :last-child::after {
        content: "⇧";
    }

    .keyboard>div:nth-child(1)> :last-child::after {
        content: "⌫";
    }

    .keyboard>div:nth-child(3)> :last-child::after {
        content: "↵";
    }

    .keyboard>div:nth-child(2)> :first-child::after {
        content: "↹";
    }

    .keyboard>div:nth-child(3)> :first-child::after {
        content: "⇪";
    }

    /* EXTEND SYMBOLIC TO CTRL/ALT/WIN (Shifted indices due to toggle) */
    .keyboard>div:last-child> :nth-child(2),
    .keyboard>div:last-child> :nth-child(3),
    .keyboard>div:last-child> :nth-child(4),
    .keyboard>div:last-child> :nth-child(6),
    .keyboard>div:last-child> :nth-child(7) {
        font-size: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0 !important;
    }

    /* Replace Labels */
    .keyboard>div:last-child> :nth-child(2)::after,
    .keyboard>div:last-child> :nth-child(7)::after {
        content: "Ctrl";
        font-size: 0.9rem !important;
        display: block !important;
        color: var(--text-primary);
        font-weight: bold;
    }

    .keyboard>div:last-child> :nth-child(3)::after {
        content: "Win";
        font-size: 0.9rem !important;
        display: block !important;
        color: var(--text-primary);
        font-weight: bold;
    }

    .keyboard>div:last-child> :nth-child(4)::after,
    .keyboard>div:last-child> :nth-child(6)::after {
        content: "Alt";
        font-size: 0.9rem !important;
        display: block !important;
        color: var(--text-primary);
        font-weight: bold;
    }

    /* HIDE ORIGINAL TEXT CHILDREN to prevent deflection/duplicates (Targeting Symbolic Keys Only) */
    .key[data-key="Tab"]>*,
    .keyboard>div:nth-child(2)> :first-child>*,
    .key[data-key="CapsLock"]>*,
    .keyboard>div:nth-child(3)> :first-child>*,
    .key[data-key="ShiftLeft"]>*,
    .keyboard>div:nth-child(4)> :first-child>*,
    .key[data-key="ShiftRight"]>*,
    .keyboard>div:nth-child(4)> :last-child>*,
    .key[data-key="Enter"]>*,
    .keyboard>div:nth-child(3)> :last-child>*,
    .key[data-key="Backspace"]>*,
    .keyboard>div:nth-child(1)> :last-child>*,
    .keyboard>div:last-child> :nth-child(2)>*,
    .keyboard>div:last-child> :nth-child(3)>*,
    .keyboard>div:last-child> :nth-child(4)>*,
    .keyboard>div:last-child> :nth-child(6)>*,
    .keyboard>div:last-child> :nth-child(7)>* {
        display: none !important;
    }
}

/* ============================================
   DESKTOP RESPONSIVE - GRADUAL GAP REDUCTION
   Reduce gap between keyboard and hands as screen squeezes
   Gap smoothly transitions: 0px → 30px, then stays at 30px
   ============================================ */

/* Small Desktop - Safe gap so hands don't overlap */
@media (min-width: 1025px) and (max-width: 1280px) {
    .keyboard-section {
        gap: clamp(15px, calc((100vw - 1025px) * 0.1176 + 15px), 40px) !important;
    }
}

/* Medium & Large Desktop - Fixed gap */
@media (min-width: 1281px) {
    .keyboard-section {
        gap: 40px !important;
    }
}