/* ============================================================
   FORMYLA — Mobile App-Like Experience
   Bottom nav, drawer menu, compact header
   Breakpoints: 1024px (tablet), 768px (mobile), 375px (small)
   ============================================================ */

/* ── BURGER BUTTON ── */
.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 22px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10000;
    flex-shrink: 0;
}

.nav-burger span {
    display: block;
    width: 100%;
    height: 3px;
    background: #38ef7d;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.nav-burger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ── BOTTOM NAV (hidden on desktop) ── */
.mobile-bottom-nav {
    display: none;
}

/* ── DRAWER (hidden on desktop) ── */
.mobile-drawer-overlay {
    display: none;
}
.mobile-drawer {
    display: none;
}

/* ── TABLET ≤ 1024px ── */
@media (max-width: 1024px) {
    .nav-search input {
        width: 180px !important;
    }
    .nav-link {
        padding: 6px 10px !important;
        font-size: 14px !important;
    }
}

/* ── MOBILE ≤ 768px ── */
@media (max-width: 768px) {

    /* ═══════════════════════════════════════
       COMPACT HEADER
       ═══════════════════════════════════════ */
    .header {
        padding: 10px 16px !important;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    /* Smaller logo on mobile */
    .header .site-logo {
        width: 140px !important;
        height: 42px !important;
    }

    /* Show burger */
    .nav-burger {
        display: flex !important;
    }

    /* Hide desktop nav, search, auth on mobile */
    #navLinks,
    .nav {
        display: none !important;
    }

    .header form {
        display: none !important;
    }

    .header > div:last-child {
        display: none !important;
    }

    /* Prevent body scroll when drawer open */
    body.drawer-open {
        overflow: hidden !important;
    }

    /* ═══════════════════════════════════════
       DRAWER MENU (slide from left)
       ═══════════════════════════════════════ */
    .mobile-drawer-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .mobile-drawer-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    .mobile-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 300px;
        max-width: 85vw;
        background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
        border-right: 1px solid rgba(124, 58, 237, 0.2);
        z-index: 9999;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .mobile-drawer.open {
        transform: translateX(0);
    }

    /* Drawer header */
    .drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-soft);
        flex-shrink: 0;
    }

    .drawer-header .drawer-logo {
        font-size: 20px;
        font-weight: 800;
        color: #fff;
        letter-spacing: 1px;
        font-style: italic;
    }

    .drawer-close {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.08);
        border: none;
        color: #94a3b8;
        font-size: 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.2s;
        padding: 0;
        min-height: unset !important;
    }

    .drawer-close:hover {
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
    }

    /* Drawer user section */
    .drawer-user {
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-soft);
        flex-shrink: 0;
    }

    .drawer-user-info {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .drawer-avatar {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        flex-shrink: 0;
    }

    .drawer-username {
        font-weight: 600;
        color: #fff;
        font-size: 15px;
    }

    .drawer-user-sub {
        font-size: 12px;
        color: var(--text-muted);
        margin-top: 2px;
    }

    /* Drawer search */
    .drawer-search {
        padding: 12px 20px;
        border-bottom: 1px solid var(--border-soft);
        flex-shrink: 0;
    }

    .drawer-search form {
        display: flex !important;
        gap: 8px;
    }

    .drawer-search input {
        flex: 1;
        padding: 10px 14px !important;
        border-radius: 10px !important;
        border: 1px solid #334155 !important;
        background: #1e293b !important;
        color: #fff !important;
        font-size: 15px !important;
        min-width: 0 !important;
        width: auto !important;
    }

    .drawer-search button {
        padding: 10px 16px !important;
        background: #3b82f6 !important;
        color: #fff !important;
        border: none !important;
        border-radius: 10px !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        font-size: 14px !important;
        min-height: unset !important;
        box-shadow: none !important;
    }

    /* Drawer nav links */
    .drawer-nav {
        flex: 1;
        padding: 8px 0;
        overflow-y: auto;
    }

    .drawer-section-title {
        padding: 12px 20px 6px;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: var(--text-muted);
    }

    .drawer-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 13px 20px;
        color: var(--text-soft);
        text-decoration: none;
        font-size: 15px;
        font-weight: 500;
        transition: background 0.15s, color 0.15s;
        border-radius: 0;
    }

    .drawer-link:hover,
    .drawer-link:active {
        background: rgba(124, 58, 237, 0.1);
        color: #fff;
    }

    .drawer-link.active {
        background: rgba(124, 58, 237, 0.15);
        color: #a78bfa;
        font-weight: 600;
    }

    .drawer-link-icon {
        font-size: 18px;
        width: 24px;
        text-align: center;
        flex-shrink: 0;
    }

    .drawer-divider {
        height: 1px;
        background: var(--border-soft);
        margin: 8px 20px;
    }

    /* Drawer footer (logout) */
    .drawer-footer {
        padding: 12px 20px;
        border-top: 1px solid var(--border-soft);
        flex-shrink: 0;
    }

    .drawer-footer .drawer-link {
        color: #f87171;
        padding: 12px 0;
    }

    .drawer-footer .drawer-link:hover {
        color: #fca5a5;
        background: transparent;
    }

    /* Daily quest badge in drawer */
    .drawer-daily-badge {
        margin-left: auto;
        padding: 2px 8px;
        border-radius: 10px;
        font-size: 11px;
        font-weight: 700;
    }

    .drawer-daily-badge.done {
        background: rgba(16, 185, 129, 0.2);
        color: #34d399;
    }

    .drawer-daily-badge.progress {
        background: rgba(59, 130, 246, 0.2);
        color: #60a5fa;
    }

    .drawer-daily-badge.new {
        background: rgba(245, 158, 11, 0.2);
        color: #fbbf24;
    }

    /* ═══════════════════════════════════════
       BOTTOM NAVIGATION BAR
       ═══════════════════════════════════════ */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        /* Extra padding for devices with home indicator */
        padding-bottom: env(safe-area-inset-bottom, 0);
        background: rgba(11, 18, 32, 0.95);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 9000;
        justify-content: space-around;
        align-items: center;
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        flex: 1;
        height: 100%;
        text-decoration: none;
        color: #64748b;
        font-size: 10px;
        font-weight: 600;
        transition: color 0.2s;
        position: relative;
        -webkit-tap-highlight-color: transparent;
        padding: 0;
        background: none;
        border: none;
        cursor: pointer;
        min-height: unset !important;
    }

    .bottom-nav-item .bottom-nav-icon {
        font-size: 22px;
        line-height: 1;
        transition: transform 0.2s;
    }

    .bottom-nav-item .bottom-nav-label {
        font-size: 10px;
        line-height: 1;
        white-space: nowrap;
    }

    .bottom-nav-item.active {
        color: #a78bfa;
    }

    .bottom-nav-item.active .bottom-nav-icon {
        transform: scale(1.1);
    }

    /* Active indicator dot */
    .bottom-nav-item.active::after {
        content: '';
        position: absolute;
        top: 4px;
        width: 4px;
        height: 4px;
        border-radius: 50%;
        background: #a78bfa;
    }

    /* Daily badge on bottom nav */
    .bottom-nav-badge {
        position: absolute;
        top: 4px;
        right: calc(50% - 18px);
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 8px;
        background: #ef4444;
        color: #fff;
        font-size: 9px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

    .bottom-nav-badge.done {
        background: #10b981;
    }

    /* Main content padding to account for bottom nav */
    .main {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0)) !important;
    }

    /* Move tutor button above bottom nav */
    #tutorWidget {
        bottom: 76px !important;
    }

    #tutorBtn {
        width: 52px !important;
        height: 52px !important;
    }

    /* Tutor chat fullscreen on mobile */
    #tutorChat,
    #ai-tutor-popup {
        width: 100vw !important;
        height: calc(100vh - 60px) !important;
        bottom: 60px !important;
        right: 0 !important;
        left: 0 !important;
        top: auto !important;
        border-radius: 16px 16px 0 0 !important;
        max-width: 100vw !important;
        max-height: calc(100vh - 60px) !important;
    }

    /* ═══════════════════════════════════════
       LAYOUT ADJUSTMENTS
       ═══════════════════════════════════════ */

    /* Containers */
    .container,
    .page-content,
    [class*="container"] {
        padding: 12px !important;
        max-width: 100% !important;
    }

    /* Cards */
    .task-card,
    .card,
    [class*="card"]:not(.agent-card):not(.drawer-link) {
        padding: 14px !important;
        margin-bottom: 12px !important;
        border-radius: 10px !important;
    }

    /* Buttons — min 44px for touch */
    .btn,
    button:not(.nav-burger):not(.drawer-close):not(.bottom-nav-item),
    .btn-primary,
    .btn-secondary,
    .btn-solve,
    input[type="submit"],
    input[type="button"] {
        min-height: 44px !important;
        padding: 12px 18px !important;
        font-size: 15px !important;
    }

    /* Forms — font-size >= 16px prevents iOS zoom */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="search"],
    input[type="tel"],
    textarea,
    select {
        width: 100% !important;
        font-size: 16px !important;
        padding: 12px !important;
        box-sizing: border-box !important;
    }

    /* Tables — horizontal scroll */
    table {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Grids — single column */
    .tasks-grid,
    .mastery-grid,
    .topics-grid,
    .cards-grid,
    [class*="grid"]:not(.drawer-nav) {
        grid-template-columns: 1fr !important;
    }

    /* Typography */
    h1 { font-size: 24px !important; }
    h2 { font-size: 20px !important; }
    h3 { font-size: 17px !important; }

    /* KaTeX — no overflow */
    .katex-display,
    .katex,
    mjx-container,
    .MathJax,
    .MathJax_Display {
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Streak */
    .streak-num {
        font-size: 48px !important;
    }

    .streak-flame {
        font-size: 36px !important;
    }

    /* Mastery rings */
    .mastery-ring-wrapper {
        width: 60px !important;
        height: 60px !important;
    }

    /* Profile */
    .linked-accounts,
    .mastery-dashboard {
        padding: 16px !important;
    }

    /* Exam task */
    .exam-task {
        font-size: 15px !important;
        line-height: 1.6 !important;
    }

    /* Tutor body */
    .tutor-body {
        padding: 16px !important;
        font-size: 14px !important;
    }

    .tutor-body table {
        display: block !important;
        overflow-x: auto !important;
    }

    /* Daily quest */
    .daily-task-card {
        padding: 16px !important;
    }

    /* Leaderboard */
    .leaderboard-table {
        font-size: 13px !important;
    }

    /* Secrets */
    .secret-content {
        font-size: 14px !important;
        line-height: 1.7 !important;
    }

    /* Adaptive test */
    .adaptive-task-text {
        font-size: 15px !important;
        line-height: 1.6 !important;
    }

    /* Olympiad detail */
    .olympiad-problem {
        font-size: 14px !important;
    }

    /* Free mock */
    .free-mock-task {
        padding: 14px !important;
    }

    /* Progress bars */
    .progress-bar-container {
        height: 8px !important;
    }

    /* Badges / chips */
    .badge,
    .chip,
    .tag {
        font-size: 12px !important;
        padding: 4px 10px !important;
    }

    /* Modals */
    .modal,
    .modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
        margin: 10px auto !important;
        padding: 16px !important;
    }

    /* Footer */
    footer {
        padding: 20px 16px !important;
        font-size: 13px !important;
        margin-bottom: 60px !important;
    }
}

/* ── SMALL MOBILE ≤ 375px (iPhone SE) ── */
@media (max-width: 375px) {
    .header .site-logo {
        width: 110px !important;
        height: 34px !important;
    }

    h1 { font-size: 20px !important; }
    h2 { font-size: 17px !important; }
    h3 { font-size: 15px !important; }

    .btn,
    button:not(.nav-burger):not(.drawer-close):not(.bottom-nav-item) {
        font-size: 14px !important;
        padding: 10px 14px !important;
    }

    .mobile-drawer {
        width: 280px;
    }

    .bottom-nav-item .bottom-nav-label {
        font-size: 9px;
    }

    .bottom-nav-item .bottom-nav-icon {
        font-size: 20px;
    }
}

/* ── TOUCH DEVICES — remove hover effects ── */
@media (hover: none) {
    .task-card:hover,
    .card:hover,
    .btn:hover,
    a:hover {
        transform: none !important;
        box-shadow: none !important;
    }

    .task-card:active,
    .card:active {
        transform: scale(0.98) !important;
        opacity: 0.9 !important;
    }

    .btn:active,
    button:active {
        transform: scale(0.96) !important;
        opacity: 0.85 !important;
    }

    /* Haptic-like feedback for bottom nav */
    .bottom-nav-item:active .bottom-nav-icon {
        transform: scale(0.9);
    }

    /* Drawer link tap feedback */
    .drawer-link:active {
        background: rgba(124, 58, 237, 0.15) !important;
    }
}

/* ── LANDSCAPE MOBILE ── */
@media (max-width: 768px) and (orientation: landscape) {
    .mobile-bottom-nav {
        height: 48px;
    }

    .bottom-nav-item .bottom-nav-icon {
        font-size: 18px;
    }

    .bottom-nav-item .bottom-nav-label {
        font-size: 9px;
    }

    .main {
        padding-bottom: 64px !important;
    }

    #tutorWidget {
        bottom: 60px !important;
    }
}

/* ── iOS safe area support ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    @media (max-width: 768px) {
        .mobile-bottom-nav {
            height: calc(60px + env(safe-area-inset-bottom));
            padding-bottom: env(safe-area-inset-bottom);
        }

        .main {
            padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
        }
    }
}

/* ── Smooth transitions for drawer ── */
@media (prefers-reduced-motion: reduce) {
    .mobile-drawer,
    .mobile-drawer-overlay,
    .bottom-nav-item .bottom-nav-icon,
    .drawer-link {
        transition: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE HOME SLIDER  —  свайп-пейджер главных разделов на мобильной "/"
   Подход: нативный CSS scroll-snap + минимум JS (mobile_home_slider.js).
   На десктопе (>768px) полностью отключается — .m-only прячется,
   .m-hide показывается; десктопная вёрстка остаётся нетронутой.
   ═══════════════════════════════════════════════════════════════════════ */

/* По умолчанию (desktop): мобильный блок прячем, десктопный показываем */
.m-only { display: none !important; }
.m-hide { display: block; }

@media (max-width: 768px) {
    .m-only { display: block !important; }
    .m-hide { display: none !important; }

    /* На мобильных убираем стандартные отступы .main, чтобы слайдер мог
       тянуться до краёв экрана. Внутренние отступы — у каждой карточки. */
    .main { padding-left: 0 !important; padding-right: 0 !important; }

    /* ── Контейнер слайдера ─────────────────────────────────────────── */
    .mhome {
        position: relative;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* ── Лента слайдов (скроллится по горизонтали со snap'ом) ─────── */
    .mhome-track {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;          /* Firefox */
        overscroll-behavior-x: contain; /* не дёргать страницу */
    }
    .mhome-track::-webkit-scrollbar { display: none; }
    .mhome-track:focus-visible {
        outline: 2px solid var(--accent-2, #38bdf8);
        outline-offset: -2px;
        border-radius: 6px;
    }

    /* ── Слайд: занимает 100% ширины экрана ─────────────────────── */
    .mhome-slide {
        flex: 0 0 100%;
        width: 100%;
        min-width: 100%;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        padding: 14px 14px 8px;
        box-sizing: border-box;
    }

    /* ── Карточка-слайд ─────────────────────────────────────────── */
    .mhome-card {
        display: flex;
        flex-direction: column;
        gap: 16px;
        min-height: calc(100vh - 56px - 60px - 80px); /* header + bottom-nav + воздух */
        padding: 20px 18px 24px;
        background: linear-gradient(160deg, #1e293b 0%, #0f172a 100%);
        border: 1px solid rgba(56, 189, 248, 0.18);
        border-radius: 20px;
        box-shadow: 0 6px 24px rgba(0,0,0,0.35);
    }
    .mhome-card--daily { background: linear-gradient(160deg, #2a1a0f 0%, #1a1410 50%, #0f0a08 100%); border-color: rgba(249,115,22,0.30); }
    .mhome-card--themes { background: linear-gradient(160deg, #0e1c2e 0%, #0a1422 50%, #070d18 100%); border-color: rgba(59,130,246,0.30); }
    .mhome-card--olymp  { background: linear-gradient(160deg, #1d1a2e 0%, #14122a 50%, #0a0820 100%); border-color: rgba(168,85,247,0.30); }

    .mhome-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding-top: 8px; }
    .mhome-emoji {
        font-size: 56px;
        line-height: 1;
        filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
    }
    .mhome-title {
        margin: 0;
        font-size: 28px;
        font-weight: 800;
        color: #f8fafc;
        letter-spacing: 0.3px;
    }
    .mhome-sub {
        margin: 0;
        font-size: 14.5px;
        color: #94a3b8;
        max-width: 320px;
        line-height: 1.45;
    }

    /* ── Progress bar для слайда «Задачи дня» ─────────────────── */
    .mhome-progress { width: 100%; max-width: 280px; margin-top: 12px; }
    .mhome-progress-bar {
        position: relative;
        height: 10px;
        background: rgba(255,255,255,0.08);
        border-radius: 999px;
        overflow: hidden;
    }
    .mhome-progress-fill {
        height: 100%;
        background: linear-gradient(90deg, #f97316, #fb923c);
        border-radius: 999px;
        transition: width .4s ease;
    }
    .mhome-progress-text {
        margin-top: 6px;
        font-size: 13px;
        color: #cbd5e1;
        text-align: center;
        font-weight: 600;
    }
    .mhome-badge--new {
        display: inline-block;
        margin-top: 8px;
        padding: 3px 12px;
        background: linear-gradient(90deg, #f97316, #fb923c);
        color: #fff;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 1px;
        border-radius: 999px;
    }

    /* ── Главная кнопка слайда ─────────────────────────────────── */
    .mhome-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: auto;
        padding: 14px 22px;
        min-height: 48px;
        border-radius: 14px;
        font-size: 16px;
        font-weight: 700;
        text-decoration: none;
        text-align: center;
        transition: transform .15s ease, box-shadow .15s ease;
    }
    .mhome-btn--primary {
        background: linear-gradient(135deg, #38bdf8 0%, #3b82f6 100%);
        color: #0f172a;
        box-shadow: 0 4px 14px rgba(56,189,248,0.35);
    }
    .mhome-btn:active { transform: translateY(1px) scale(.99); }

    /* ── Сетка плиток для слайда «Темы» ────────────────────────── */
    .mhome-tiles {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-top: 10px;
    }
    .mhome-tile {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 92px;
        padding: 14px 10px;
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 14px;
        color: #e2e8f0;
        text-decoration: none;
        text-align: center;
        transition: background .15s ease, transform .15s ease;
    }
    .mhome-tile:active { background: rgba(56,189,248,0.10); transform: scale(.98); }
    .mhome-tile-emoji { font-size: 26px; line-height: 1; }
    .mhome-tile-title { font-size: 13.5px; font-weight: 600; line-height: 1.2; }

    /* ── Список-ссылки для слайда «Олимпиады» ──────────────────── */
    .mhome-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
    .mhome-row {
        display: flex;
        align-items: center;
        gap: 12px;
        min-height: 56px;
        padding: 10px 14px;
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 12px;
        color: #e2e8f0;
        text-decoration: none;
        transition: background .15s ease;
    }
    .mhome-row:active { background: rgba(168,85,247,0.12); }
    .mhome-row-icon { font-size: 22px; flex-shrink: 0; }
    .mhome-row-text { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
    .mhome-row-text b { font-size: 15px; font-weight: 700; color: #f8fafc; }
    .mhome-row-text small { font-size: 12.5px; color: #94a3b8; margin-top: 2px; }
    .mhome-row-chev { font-size: 22px; color: #64748b; flex-shrink: 0; }

    /* ── Индикатор страниц (точки) ─────────────────────────────── */
    .mhome-dots {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 14px 0 6px;
    }
    .mhome-dot {
        width: 10px;
        height: 10px;
        padding: 0;
        border: none;
        border-radius: 50%;
        background: rgba(148,163,184,0.35);
        cursor: pointer;
        transition: background .2s ease, transform .2s ease, width .2s ease;
        /* Тач-таргет ≥ 44px при наличии псевдоэлемента */
        position: relative;
    }
    .mhome-dot::after {
        /* увеличенная невидимая зона нажатия для удобного попадания пальцем */
        content: '';
        position: absolute;
        inset: -14px;
    }
    .mhome-dot.is-active {
        width: 28px;
        border-radius: 999px;
        background: linear-gradient(90deg, #38bdf8, #3b82f6);
    }
    .mhome-dot:focus-visible {
        outline: 2px solid #38bdf8;
        outline-offset: 3px;
    }

    .mhome-hint {
        margin: 0 0 6px;
        text-align: center;
        font-size: 11.5px;
        color: #64748b;
        letter-spacing: 0.4px;
    }

    /* ── Уменьшенная анимация ─────────────────────────────────── */
    @media (prefers-reduced-motion: reduce) {
        .mhome-track { scroll-behavior: auto; }
        .mhome-progress-fill,
        .mhome-tile,
        .mhome-row,
        .mhome-dot,
        .mhome-btn { transition: none !important; }
    }
}

/* ── На совсем узких экранах (≤375px, iPhone SE) — компактнее ── */
@media (max-width: 375px) {
    .mhome-card { padding: 16px 14px 20px; min-height: calc(100vh - 56px - 60px - 60px); }
    .mhome-emoji { font-size: 48px; }
    .mhome-title { font-size: 24px; }
    .mhome-tile { min-height: 84px; padding: 10px 8px; }
    .mhome-tile-emoji { font-size: 22px; }
}
