/* ============================================================
   PLUTO LEARN — COMPREHENSIVE MOBILE PORTRAIT RESPONSIVENESS
   Mobile-first overhaul: targets 320px–767px portrait screens
   Added v59 — November 2026
   ============================================================ */

/* ─────────────────────────────────────────────────────────────
   1. BASE RESETS FOR MOBILE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    * {
        -webkit-tap-highlight-color: transparent;
        box-sizing: border-box;
    }

    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }

    /* Prevent horizontal scroll from any element */
    #landing-page,
    #app,
    #login-screen,
    #invite-screen {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Prevent text from being too small on tap */
    input, textarea, select, button {
        font-size: 16px !important; /* Prevents iOS auto-zoom */
    }

    /* Core padding tokens on mobile */
    .p-6 { padding: 1rem !important; }
    .p-8 { padding: 1rem !important; }
    .px-6 { padding-left: 1rem !important; padding-right: 1rem !important; }
    .px-8 { padding-left: 1rem !important; padding-right: 1rem !important; }
    .py-6 { padding-top: 1.25rem !important; padding-bottom: 1.25rem !important; }
}


/* ─────────────────────────────────────────────────────────────
   2. APP SHELL — HEADER & CONTENT AREA
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    /* App header: compact, no overflow */
    #app > main > header {
        height: 54px !important;
        padding: 0 0.65rem !important;
        gap: 0.35rem !important;
    }

    #app > main > header .flex.items-center.gap-2 {
        gap: 0.3rem !important;
    }

    /* Page title: truncate cleanly */
    #page-title {
        font-size: 0.95rem !important;
        font-weight: 700 !important;
        max-width: 130px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    /* Header right action group */
    #app > main > header > div:last-child {
        gap: 0.15rem !important;
    }

    /* Streak badge: compact on mobile */
    #app > main > header .bg-surface-variant {
        padding: 0.2rem 0.5rem !important;
        font-size: 0.75rem !important;
        gap: 0.25rem !important;
    }

    /* Certificate header btn: icon only on mobile */
    .cert-nav-btn .cert-btn-inner {
        padding: 0.3rem 0.5rem !important;
        gap: 0.3rem !important;
    }
    .cert-nav-btn .cert-btn-inner span.text-xs {
        display: none !important;
    }
    .cert-nav-btn .cert-btn-inner .cert-status-pill {
        display: none !important;
    }

    /* Theme toggle and icon buttons: uniform tap target */
    .btn-icon, #theme-toggle, #useful-links-toggle {
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        min-width: 38px !important;
        flex-shrink: 0 !important;
    }

    /* AI chat toggle in header */
    #ai-chat-toggle {
        width: 42px !important;
        height: 42px !important;
        padding: 0 !important;
        flex-shrink: 0 !important;
    }

    /* Main content area: reduced padding, more space */
    #content {
        padding: 0.85rem 0.85rem 110px 0.85rem !important;
    }

    /* Sidebar toggle button */
    #sidebar-toggle {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        flex-shrink: 0 !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   3. SIDEBAR — FULL SHEET ON MOBILE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .sidebar {
        width: 80vw !important;
        max-width: 300px !important;
    }

    .sidebar .nav-link {
        min-height: 44px !important;
        font-size: 0.9rem !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   4. DASHBOARD CARDS & GRID
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    /* All cards: full padding reduction */
    .card {
        padding: 1rem !important;
        border-radius: 18px !important;
    }

    /* Dashboard stats: 2-column grid */
    .grid.grid-cols-4,
    .grid.grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.65rem !important;
    }

    /* Single-col on very narrow */
    @media (max-width: 360px) {
        .grid.grid-cols-4,
        .grid.grid-cols-3 {
            grid-template-columns: 1fr !important;
        }
    }

    /* 2-column intermediate -> single column */
    .grid.grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 0.65rem !important;
    }

    /* MD and SM responsive grids also collapse */
    .grid.md\:grid-cols-3,
    .grid.md\:grid-cols-4,
    .grid.sm\:grid-cols-2,
    .grid.sm\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }

    /* Progress bars and stats labels */
    .text-2xl { font-size: 1.35rem !important; }
    .text-3xl { font-size: 1.5rem !important; }
    .text-4xl { font-size: 1.65rem !important; }
}


/* ─────────────────────────────────────────────────────────────
   5. BOTTOM NAV — ENHANCED MOBILE BAR
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .mobile-bottom-nav {
        bottom: 12px !important;
        width: 92% !important;
        height: 62px !important;
        border-radius: 22px !important;
        padding: 0 6px !important;
    }

    .bottom-nav-item {
        font-size: 9.5px !important;
        gap: 3px !important;
        padding: 0 2px !important;
    }

    .bottom-nav-icon {
        width: 20px !important;
        height: 20px !important;
    }

    /* Active nav item: subtle pill highlight */
    .bottom-nav-item.active {
        background: rgba(253, 110, 139, 0.12) !important;
        border-radius: 14px !important;
        padding: 0.35rem 0.5rem !important;
    }

    /* Floating AI chat button above bottom nav */
    #floating-ai-chat-btn {
        bottom: 85px !important;
        right: 16px !important;
        width: 54px !important;
        height: 54px !important;
    }
    #floating-ai-chat-btn img {
        width: 34px !important;
        height: 34px !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   6. AI CHAT PANEL — FULL SCREEN ON MOBILE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    #ai-chat-panel {
        width: 100vw !important;
        min-width: unset !important;
        max-width: 100vw !important;
        top: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
    }

    /* Disable resizer on mobile */
    #ai-chat-resizer {
        display: none !important;
    }

    /* Chat input area: larger on mobile */
    .velo-chat-input-area {
        padding: 0.75rem !important;
    }

    .velo-input-row textarea,
    .velo-input-row input {
        font-size: 16px !important;
        min-height: 44px !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   7. LANDING PAGE — HEADER
   ───────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .brutal-navbar,
    .liquid-navbar {
        padding: 0.6rem 0.9rem !important;
    }

    .liquid-brand-logo-frame {
        width: 32px !important;
        height: 32px !important;
    }

    .brutal-brand-logo,
    .liquid-brand-logo {
        width: 22px !important;
        height: 22px !important;
    }

    .brutal-brand-text,
    .liquid-brand-text {
        font-size: 1rem !important;
    }

    .brutal-brand-tag,
    .liquid-brand-tag {
        display: none !important;
    }

    /* Hamburger tap target */
    .brutal-menu-toggle,
    .liquid-menu-toggle {
        width: 38px !important;
        height: 38px !important;
    }

    /* Sign in button: icon only */
    #nav-btn-signin span {
        display: none !important;
    }
    #nav-btn-signin i {
        display: none !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   8. LANDING PAGE — HERO SECTION
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .brutal-hero {
        padding: 3.5rem 1.1rem 3rem !important;
    }

    .brutal-hero-title {
        font-size: clamp(1.6rem, 7.5vw, 2.4rem) !important;
        line-height: 1.15 !important;
        letter-spacing: -0.025em !important;
        margin-bottom: 1rem !important;
    }

    .brutal-hero-sub {
        font-size: 0.95rem !important;
        margin-bottom: 1.5rem !important;
        line-height: 1.6 !important;
    }

    /* CTA Buttons: stack full-width */
    .brutal-cta-group {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
        margin-bottom: 1.5rem !important;
    }

    .brutal-cta-group .brutal-btn,
    .brutal-cta-group a.brutal-btn,
    .brutal-cta-group button {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 0.95rem 1rem !important;
        font-size: 0.95rem !important;
    }

    /* Tag strip: wrap & smaller */
    .brutal-tag-strip {
        gap: 0.5rem !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

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

@media (max-width: 400px) {
    .brutal-hero-title {
        font-size: 1.5rem !important;
    }
    .brutal-hero-sub {
        font-size: 0.88rem !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   9. LANDING PAGE — SECTIONS (ROADMAP, WHY US, PRICING, etc.)
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    /* Section headings scale down */
    .pluto-roadmap-title,
    .brutal-section-title,
    h2[class*="title"],
    h2[class*="heading"] {
        font-size: clamp(1.5rem, 6vw, 2rem) !important;
        line-height: 1.2 !important;
    }

    /* Section containers: proper padding */
    .pluto-roadmap-container,
    section > div {
        padding-left: 1.1rem !important;
        padding-right: 1.1rem !important;
    }

    /* Stats grid: 2-col */
    .brutal-stats-grid,
    .stats-liquid-island {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }

    .stat-liquid-pod {
        padding: 1.35rem 1rem !important;
        border-radius: 18px !important;
    }

    .stat-pod-icon-wrap {
        width: 36px !important;
        height: 36px !important;
        margin-bottom: 0.75rem !important;
    }

    .stat-pod-icon-wrap svg {
        width: 16px !important;
        height: 16px !important;
    }

    .brutal-stat-num {
        font-size: 1.65rem !important;
        margin-bottom: 0.35rem !important;
    }

    .brutal-stat-label {
        font-size: 0.72rem !important;
        margin-bottom: 0.25rem !important;
    }

    .brutal-stat-sub {
        font-size: 0.76rem !important;
        line-height: 1.35 !important;
    }

    /* Why Us, Cards: single column */
    .brutal-why-grid,
    .why-liquid-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .why-liquid-card {
        padding: 1.85rem 1.35rem !important;
        border-radius: 20px !important;
    }

    /* Track layout */
    .brutal-tracks-stack,
    .tracks-liquid-stack {
        gap: 1.35rem !important;
    }

    .track-liquid-card {
        padding: 1.85rem 1.35rem !important;
        border-radius: 22px !important;
    }

    .brutal-track-layout {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .track-liquid-action {
        padding: 1.35rem 1.15rem !important;
        border-radius: 18px !important;
    }

    /* Giant CTA Stage Banner */
    .cta-liquid-stage-section {
        padding: 4rem 1.1rem 3.5rem !important;
    }

    .cta-liquid-stage {
        padding: 3rem 1.25rem !important;
        border-radius: 24px !important;
    }

    .cta-liquid-stage .brutal-cta-title {
        font-size: 1.75rem !important;
        line-height: 1.15 !important;
        margin-bottom: 0.85rem !important;
    }

    .cta-liquid-stage .brutal-cta-sub {
        font-size: 0.95rem !important;
        margin-bottom: 2rem !important;
    }

    .cta-liquid-stage .brutal-cta-btn-wrap {
        flex-direction: column !important;
        width: 100% !important;
        gap: 0.85rem !important;
    }

    .cta-liquid-stage .brutal-btn,
    .cta-liquid-stage a.brutal-btn,
    .cta-liquid-stage button {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 1rem 1.25rem !important;
    }

    /* Contact Section */
    .contact-liquid-section {
        padding: 4rem 1.1rem 3.5rem !important;
    }

    .pluto-contact-grid {
        grid-template-columns: 1fr !important;
        gap: 2.5rem !important;
    }

    .contact-liquid-form {
        padding: 2rem 1.25rem !important;
        border-radius: 22px !important;
    }

    .contact-liquid-tile {
        padding: 1rem 1.15rem !important;
        border-radius: 18px !important;
    }

    /* Roadmap journey steps: single col */
    .pluto-roadmap-steps,
    [class*="roadmap-grid"],
    [class*="journey-grid"] {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Pricing: Cupertino liquid glass carousel scroll */
    .cpricing-section {
        padding: 4.5rem 1.15rem 3.5rem !important;
    }
    .cpricing-header {
        margin-bottom: 2.25rem !important;
    }
    .brutal-pricing-grid,
    .cpricing-grid {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        gap: 1rem !important;
        padding: 1rem 0.5rem 1.5rem !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .brutal-pricing-grid::-webkit-scrollbar,
    .cpricing-grid::-webkit-scrollbar { display: none !important; }
    .brutal-pricing-grid .brutal-card,
    .cpricing-grid .cpricing-card,
    .brutal-pricing-grid > * {
        flex: 0 0 86% !important;
        min-width: 86% !important;
        max-width: 86% !important;
        scroll-snap-align: center !important;
        transform: none !important;
        padding: 2.25rem 1.5rem 1.85rem !important;
    }
    .cpricing-card-featured {
        transform: none !important;
    }
    .pricing-carousel-indicators {
        display: flex !important;
    }

    /* Track layout */
    .brutal-track-layout {
        grid-template-columns: 1fr !important;
    }

    /* Footer grid */
    .brutal-footer-grid,
    .liquid-footer-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .brutal-footer-bottom {
        flex-direction: column !important;
        gap: 0.5rem !important;
        text-align: center !important;
    }

    /* Elite Next-Gen Footer Mobile Adjustments */
    .pluto-elite-footer {
        padding: 3.5rem 1.15rem 2rem !important;
    }
    .pluto-footer-main-grid {
        grid-template-columns: 1fr !important;
        gap: 2.25rem !important;
    }
    .pluto-footer-contact-ribbon {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
        padding: 1.5rem 0 !important;
    }
    .pluto-footer-watermark-row {
        padding: 1rem 0 2rem !important;
    }
    .pluto-footer-watermark-text {
        font-size: clamp(2.5rem, 11vw, 4.2rem) !important;
    }
    .pluto-footer-bottom-bar {
        flex-direction: column !important;
        text-align: center !important;
        gap: 0.75rem !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   10. MOBILE DRAWER MENU
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .brutal-mobile-drawer,
    .brutal-bottom-sheet {
        max-height: 88vh !important;
        border-radius: 24px 24px 0 0 !important;
    }

    .brutal-drawer-links {
        gap: 0.1rem !important;
    }

    .brutal-drawer-link {
        min-height: 48px !important;
        font-size: 1rem !important;
        padding: 0.75rem 1rem !important;
    }

    .brutal-drawer-footer {
        padding: 0.85rem 1rem 1.25rem !important;
    }

    .brutal-drawer-footer .brutal-btn {
        min-height: 50px !important;
        font-size: 0.95rem !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   11. LOGIN MODAL — MOBILE REFINEMENTS
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .login-modal-backdrop {
        padding: 0 !important;
        align-items: flex-end !important;
        background: rgba(4, 20, 43, 0.72) !important;
    }

    .login-dialog-card {
        grid-template-columns: 1fr !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 24px 24px 0 0 !important;
        box-shadow: 0 -16px 48px rgba(7, 45, 89, 0.3) !important;
        max-height: 94vh !important;
        overflow-y: auto !important;
        animation: loginSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    @keyframes loginSlideUp {
        from { transform: translateY(60px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }

    .login-left-brand-art {
        display: none !important;
    }

    .login-mobile-brand-header {
        display: flex !important;
        margin-bottom: 1.1rem !important;
        padding-right: 2.5rem !important;
    }

    .login-right-form-pane {
        padding: 1.5rem 1.25rem 2rem !important;
    }

    .login-modal-close-btn {
        top: 1rem !important;
        right: 1rem !important;
        width: 34px !important;
        height: 34px !important;
    }

    /* Grab bar hint for bottom sheet */
    .login-dialog-card::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: rgba(0,0,0,0.15);
        border-radius: 9999px;
        margin: 0.75rem auto -0.25rem;
        flex-shrink: 0;
    }

    /* OAuth buttons: larger touch targets */
    .btn-social-oauth {
        min-height: 50px !important;
        font-size: 0.95rem !important;
        gap: 0.5rem !important;
    }

    /* Name input field */
    .login-name-input-wrap input {
        font-size: 16px !important;
        height: 50px !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   12. LICENSE GATE (INVITE SCREEN) — MOBILE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    #invite-screen {
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-end !important;
    }

    .invite-container-wrapper {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-end !important;
        padding: 0 !important;
    }

    .invite-card {
        border-radius: 24px 24px 0 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 1.5rem 1.25rem 2rem !important;
        min-height: 60vh !important;
        box-shadow: 0 -16px 48px rgba(7, 45, 89, 0.2) !important;
        animation: loginSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
        overflow-y: auto !important;
    }

    /* Grab bar for invite sheet */
    .invite-card::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: rgba(0,0,0,0.12);
        border-radius: 9999px;
        margin: -0.5rem auto 1rem;
    }

    .invite-card input[type="text"],
    #invite-code-input,
    #invite-chosen-name {
        font-size: 16px !important;
        height: 50px !important;
    }

    #invite-code-input {
        font-size: 1.1rem !important;
        letter-spacing: 0.08em !important;
    }

    #btn-verify-invite {
        min-height: 52px !important;
        font-size: 1rem !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   13. CERTIFICATE MODAL — MOBILE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    #certificate-modal-overlay {
        padding: 0 !important;
        align-items: flex-end !important;
    }

    .cert-modal-container,
    [class*="cert-modal"] {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 24px 24px 0 0 !important;
        max-height: 92vh !important;
        overflow-y: auto !important;
    }

    /* Canvas preview: full width */
    #cert-preview-canvas {
        width: 100% !important;
        height: auto !important;
        border-radius: 12px !important;
    }

    /* Tab buttons: even distribution */
    .cert-tabs-row {
        gap: 0.5rem !important;
    }

    .cert-tab-btn {
        flex: 1 !important;
        font-size: 0.85rem !important;
        padding: 0.6rem 0.5rem !important;
    }

    /* Progress stacks: readable font sizes */
    .cert-prog-labels {
        font-size: 0.8rem !important;
    }

    /* Download button: full width */
    #cert-download-btn {
        width: 100% !important;
        min-height: 50px !important;
        font-size: 1rem !important;
    }

    /* Autogen grid: single col */
    .cert-autogen-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
    }

    .cert-autogen-tile {
        padding: 0.6rem !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   14. MODALS & OVERLAYS — GENERIC MOBILE FIX
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    /* Generic modals that use fixed+flex: bottom sheet them */
    .modal-backdrop,
    .modal-overlay,
    [class*="-overlay"]:not(#sidebar-overlay):not(.brutal-mobile-backdrop) {
        padding: 0 !important;
        align-items: flex-end !important;
    }

    /* Modal containers: slide-up sheet */
    .modal-container,
    .modal-card,
    [class*="-dialog"],
    [class*="-popup"] {
        border-radius: 24px 24px 0 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        max-height: 92vh !important;
        overflow-y: auto !important;
    }

    /* Modal padding */
    .modal-body,
    [class*="modal-body"] {
        padding: 1.25rem !important;
    }

    /* Modal close btn minimum size */
    [class*="modal-close"],
    [class*="close-btn"] {
        min-width: 36px !important;
        min-height: 36px !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   15. QUICK SYNC MODAL — MOBILE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    /* Cupertino Quick Sync panels */
    .cupertino-panel,
    .sync-modal-card,
    #quick-sync-panel {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 24px 24px 0 0 !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }

    .cupertino-qr-frame {
        width: min(240px, 70vw) !important;
        height: min(240px, 70vw) !important;
        margin: 0 auto !important;
    }

    .cupertino-qr-frame canvas,
    .cupertino-qr-frame img,
    .cupertino-qr-frame svg {
        width: 100% !important;
        height: 100% !important;
    }

    .cupertino-code-input {
        font-size: 1.15rem !important;
        letter-spacing: 0.18em !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   16. TABLES — MOBILE HORIZONTAL SCROLL
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .table-wrapper,
    [class*="table-container"],
    [class*="data-table"] {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 14px !important;
    }

    table {
        min-width: 540px !important;
        font-size: 0.82rem !important;
    }

    th, td {
        padding: 0.6rem 0.75rem !important;
        white-space: nowrap !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   17. 90-DAY PLANNER — MOBILE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    /* Day cards: single column stacked */
    .planner-day-grid,
    [class*="planner-grid"] {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Task items: larger touch target */
    .planner-task-item,
    [class*="task-item"] {
        min-height: 44px !important;
        font-size: 0.88rem !important;
    }

    /* Kanban board: horizontal scroll */
    .kanban-board {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 0.75rem !important;
        padding-bottom: 1.25rem !important;
    }

    .kanban-column {
        min-width: 260px !important;
        width: 260px !important;
    }

    /* Week selector: scroll row */
    .week-selector-row,
    [class*="week-tabs"],
    [class*="day-selector"] {
        overflow-x: auto !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 0.4rem !important;
        padding-bottom: 4px !important;
    }
    .week-selector-row::-webkit-scrollbar { display: none !important; }
}


/* ─────────────────────────────────────────────────────────────
   18. ROADMAPS — MOBILE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .roadmap-topic-grid,
    [class*="topic-grid"],
    [class*="roadmap-grid"] {
        grid-template-columns: 1fr !important;
        gap: 0.65rem !important;
    }

    .roadmap-category-tabs,
    [class*="category-tabs"] {
        overflow-x: auto !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
        padding-bottom: 4px !important;
    }
    .roadmap-category-tabs::-webkit-scrollbar { display: none !important; }
}


/* ─────────────────────────────────────────────────────────────
   19. RESUME BUILDER — MOBILE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .resume-split-layout {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .resume-preview-pane {
        display: none !important; /* Hide live preview on mobile to save space */
    }

    .resume-preview-pane.show-mobile {
        display: block !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   20. TYPOGRAPHY SCALE — MOBILE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    /* Section titles */
    h1 { font-size: clamp(1.5rem, 7vw, 2rem) !important; }
    h2 { font-size: clamp(1.25rem, 5.5vw, 1.65rem) !important; }
    h3 { font-size: clamp(1.05rem, 4.5vw, 1.3rem) !important; }

    /* Description text */
    .text-sm  { font-size: 0.82rem !important; }
    .text-xs  { font-size: 0.72rem !important; }
    .text-lg  { font-size: 1rem !important; }
    .text-xl  { font-size: 1.1rem !important; }
    .text-2xl { font-size: 1.25rem !important; }
    .text-3xl { font-size: 1.4rem !important; }
}


/* ─────────────────────────────────────────────────────────────
   21. BUTTONS — MOBILE TOUCH TARGETS
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .btn {
        min-height: 42px !important;
        font-size: 0.88rem !important;
    }

    .btn-lg {
        min-height: 50px !important;
        font-size: 0.95rem !important;
        padding: 0.75rem 1.25rem !important;
    }

    .btn-sm {
        min-height: 34px !important;
        font-size: 0.8rem !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   22. FORMS & INPUTS — MOBILE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .input,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px !important; /* Prevents iOS auto-zoom */
        min-height: 46px !important;
        border-radius: 12px !important;
    }

    textarea {
        min-height: 90px !important;
    }

    /* Form groups: more breathing room */
    .form-group,
    [class*="input-group"] {
        margin-bottom: 0.85rem !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   23. INTERVIEW & Q&A PAGES — MOBILE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .interview-category-tabs,
    .iq-tabs,
    [class*="interview-tabs"] {
        overflow-x: auto !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
    }
    .interview-category-tabs::-webkit-scrollbar { display: none !important; }

    [class*="interview-grid"],
    [class*="qa-grid"] {
        grid-template-columns: 1fr !important;
        gap: 0.65rem !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   24. SETTINGS PAGE — MOBILE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    /* Settings sections: single column */
    .settings-grid,
    [class*="settings-grid"] {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Theme cards: 2-col on mobile */
    .theme-card-row,
    [class*="theme-cards"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
    }

    /* Density cards */
    .density-card-row,
    [class*="density-cards"] {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   25. TOAST NOTIFICATIONS — MOBILE POSITIONING
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .toast-container {
        bottom: 90px !important; /* Above floating bottom nav */
        left: 50% !important;
        transform: translateX(-50%) !important;
        right: auto !important;
        width: 90vw !important;
        max-width: 360px !important;
    }

    .toast {
        width: 100% !important;
        font-size: 0.85rem !important;
        padding: 0.75rem 1rem !important;
        border-radius: 14px !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   26. VERIFY CERTIFICATE SECTION ON LANDING — MOBILE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    #verify-certificate,
    .vcert-section {
        padding: 3.5rem 1.15rem !important;
    }

    .vcert-header {
        margin-bottom: 2rem !important;
    }

    .vcert-shield-icon {
        width: 58px !important;
        height: 58px !important;
        border-radius: 18px !important;
    }

    .vcert-shield-icon svg,
    .vcert-shield-icon i {
        width: 28px !important;
        height: 28px !important;
    }

    #verify-certificate h2,
    .vcert-title {
        font-size: 1.65rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.75rem !important;
    }

    .vcert-subtitle {
        font-size: 0.88rem !important;
        line-height: 1.55 !important;
    }

    .vcert-card {
        padding: 1.35rem 1.1rem !important;
        border-radius: 22px !important;
    }

    .vcert-input-row,
    #verify-certificate .verify-input-row {
        flex-direction: column !important;
        padding: 0.75rem !important;
        gap: 0.75rem !important;
        border-radius: 16px !important;
    }

    .vcert-input-wrap {
        width: 100% !important;
        padding: 0.25rem 0.35rem !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
    }

    #verify-certificate input,
    .vcert-input {
        width: 100% !important;
        font-size: 16px !important; /* Prevents iOS auto-zoom */
    }

    #verify-certificate button,
    .vcert-verify-btn {
        width: 100% !important;
        min-height: 48px !important;
        justify-content: center !important;
        font-size: 0.94rem !important;
    }

    .vcert-badges {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
        max-width: 320px;
        margin: 1.85rem auto 0 !important;
    }

    .vcert-badge {
        font-size: 0.8rem !important;
    }

    .vcert-badge-sep {
        display: none !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   27. SAFE AREA INSETS (iPhone notch / home bar)
   ───────────────────────────────────────────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
    @media (max-width: 767px) {
        .mobile-bottom-nav {
            bottom: calc(12px + env(safe-area-inset-bottom)) !important;
        }

        .login-dialog-card,
        .invite-card {
            padding-bottom: calc(2rem + env(safe-area-inset-bottom)) !important;
        }

        #content {
            padding-bottom: calc(110px + env(safe-area-inset-bottom)) !important;
        }
    }
}


/* ─────────────────────────────────────────────────────────────
   28. VERY NARROW DEVICES (< 360px)
   ───────────────────────────────────────────────────────────── */
@media (max-width: 360px) {
    .brutal-hero-title {
        font-size: 1.4rem !important;
    }

    .card {
        padding: 0.85rem !important;
        border-radius: 14px !important;
    }

    .btn {
        font-size: 0.82rem !important;
    }

    .bottom-nav-item {
        font-size: 8px !important;
    }

    #content {
        padding: 0.65rem 0.65rem 110px !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   29. ABOUT PLUTO LEARN MISSION & STATS SECTION — MOBILE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    #about.pluto-about-section {
        padding: 4rem 1.15rem 3rem !important;
    }

    .pluto-about-title {
        font-size: 2.15rem !important;
        line-height: 1.15 !important;
        margin: 0.4rem 0 1rem !important;
    }

    .pluto-about-lead-box {
        padding-left: 0.95rem !important;
        border-left-width: 3px !important;
        margin-bottom: 1.1rem !important;
    }

    .pluto-about-desc {
        font-size: 1.08rem !important;
        line-height: 1.52 !important;
    }

    .pluto-about-subtext {
        font-size: 0.9rem !important;
        line-height: 1.65 !important;
        margin-bottom: 1.4rem !important;
    }

    .pluto-about-feature-chips {
        gap: 0.5rem !important;
    }

    .pluto-feature-chip {
        font-size: 0.78rem !important;
        padding: 0.35rem 0.75rem !important;
    }

    .pluto-about-visual-card {
        padding: 2rem 1.25rem 1.65rem !important;
        border-radius: 22px !important;
        min-height: auto !important;
    }

    .pluto-wall-brand {
        font-size: 1.75rem !important;
    }

    .pluto-about-office-desk {
        margin-top: 1.75rem !important;
        padding-top: 1.35rem !important;
    }

    .pluto-laptop-screen {
        width: 142px !important;
        height: 90px !important;
    }

    .pluto-laptop-base {
        width: 172px !important;
        height: 7px !important;
    }

    .pluto-desk-plant {
        width: 40px !important;
        height: 40px !important;
        border-radius: 12px !important;
    }

    .pluto-about-stats-strip {
        display: flex !important;
        flex-direction: column !important;
        padding: 1.75rem 1.25rem !important;
        gap: 1.4rem !important;
        border-radius: 24px !important;
    }

    .pluto-about-stat-col {
        padding: 0.25rem 0.5rem !important;
        width: 100% !important;
    }

    .pluto-stat-icon-wrap {
        width: 46px !important;
        height: 46px !important;
        border-radius: 14px !important;
        margin-bottom: 0.75rem !important;
    }

    .pluto-about-stat-num {
        font-size: 2.35rem !important;
        line-height: 1.05 !important;
        margin-bottom: 0.25rem !important;
    }

    .pluto-about-stat-name {
        font-size: 1.05rem !important;
        margin-bottom: 0.2rem !important;
    }

    .pluto-about-stat-micro {
        font-size: 0.78rem !important;
    }

    .pluto-about-stat-divider {
        width: 70% !important;
        height: 1px !important;
        background: linear-gradient(90deg, transparent 0%, rgba(7, 45, 89, 0.12) 30%, rgba(7, 45, 89, 0.12) 70%, transparent 100%) !important;
        margin: 0 auto !important;
    }

    [data-theme="dark"] .pluto-about-stat-divider {
        background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.12) 30%, rgba(255, 255, 255, 0.12) 70%, transparent 100%) !important;
    }
}


/* ─────────────────────────────────────────────────────────────
   30. ALUMNI NETWORK SHOWCASE — MOBILE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .brutal-hiring-strip.alumni-glass-section {
        padding: 2.75rem 1rem 2.5rem !important;
    }

    .alumni-header-wrap {
        margin-bottom: 1.5rem !important;
    }

    .brutal-hiring-title.alumni-strip-title {
        font-size: 0.72rem !important;
        letter-spacing: 0.14em !important;
    }

    .brutal-hiring-companies.alumni-glass-deck {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.65rem !important;
        max-width: 330px !important;
        margin: 0 auto !important;
    }

    .hiring-logo-item {
        width: 100% !important;
        min-width: 0 !important;
        height: 48px !important;
        padding: 0.6rem 0.85rem !important;
        border-radius: 16px !important;
    }

    .hiring-logo-svg {
        height: 19px !important;
    }
}

/* ─── Mobile Portrait Responsiveness for Bind Email License Popup ─── */
@media (max-width: 640px) {
    .bind-license-modal-backdrop {
        padding: 1rem !important;
        align-items: center !important;
    }

    .bind-license-card.cupertino-glass-dialog {
        padding: 1.65rem 1.25rem 1.4rem !important;
        border-radius: 24px !important;
        max-width: 100% !important;
    }

    .bind-license-close-btn {
        top: 1rem !important;
        right: 1rem !important;
        width: 32px !important;
        height: 32px !important;
    }

    .bind-license-icon-badge {
        width: 56px !important;
        height: 56px !important;
        margin-bottom: 0.75rem !important;
    }

    .bind-license-icon-core {
        width: 52px !important;
        height: 52px !important;
        border-radius: 17px !important;
    }

    .bind-license-icon-core svg {
        width: 24px !important;
        height: 24px !important;
    }

    .bind-license-icon-mini {
        width: 20px !important;
        height: 20px !important;
        border-radius: 6px !important;
    }

    .bind-license-icon-mini svg {
        width: 10px !important;
        height: 10px !important;
    }

    .bind-license-title {
        font-size: 1.35rem !important;
    }

    .bind-license-subtitle {
        font-size: 0.82rem !important;
        line-height: 1.45 !important;
    }

    .bind-license-key-box {
        padding: 0.75rem 0.9rem !important;
        margin-bottom: 1.15rem !important;
    }

    .bind-key-code-wrap {
        padding: 0.35rem 0.6rem !important;
    }

    .bind-key-code-input {
        font-size: 0.92rem !important;
    }

    .bind-field-input {
        height: 46px !important;
        font-size: 16px !important; /* Prevents iOS auto-zoom on input focus */
    }

    .bind-action-buttons {
        flex-direction: column-reverse !important;
        gap: 8px !important;
    }

    .bind-btn-primary,
    .bind-btn-secondary {
        width: 100% !important;
        flex: none !important;
        height: 46px !important;
        font-size: 0.92rem !important;
    }
}

@media (max-width: 360px) {
    .bind-license-modal-backdrop {
        padding: 0.5rem !important;
    }

    .bind-license-card.cupertino-glass-dialog {
        padding: 1.35rem 0.95rem 1.15rem !important;
        border-radius: 20px !important;
    }

    .bind-license-title {
        font-size: 1.2rem !important;
    }
}
