/* Мобильные стили: shell*.css (подключается сразу после основного файла) */

/* ── из shell.css ── */
/* ── Телефон ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    :is(body, body.dark-theme) .header {
        gap: 10px;
        min-height: 0;
        margin-bottom: 12px;
        padding: 10px 12px;
        border-radius: 16px;
    }

    :is(body, body.dark-theme) .header-left { gap: 10px; }

    /* Значок и название страницы - вместе по центру шапки; меню слева и уведомления/аватар справа не занимают места в потоке */
    :is(body, body.dark-theme) .header { position: relative; min-height: 58px; }
    :is(body, body.dark-theme) .header-left {
        flex: 1 1 auto;
        justify-content: center;
        min-width: 0;
        padding: 0 46px;   /* меню слева и аватар справа - по ~44px; колокольчик на телефоне скрыт (base-mobile.css) */
    }
    :is(body, body.dark-theme) .hamburger-btn {
        position: absolute;
        left: 8px;
        top: 50%;
        transform: translateY(-50%);
        margin: 0;
    }
    :is(body, body.dark-theme) .header-right {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
    }
    :is(body, body.dark-theme) .header-info { flex: 0 1 auto !important; width: auto !important; min-width: 0; text-align: center; }
    :is(body, body.dark-theme) .logo { flex: none; }
    :is(body, body.dark-theme) .header-subtitle { overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
    /* Название страницы не обрезается «...»: шире места нет - переносится на вторую строку */
    :is(body, body.dark-theme) .header-title { overflow: visible; text-align: center; text-overflow: clip; white-space: normal; line-height: 1.2; overflow-wrap: anywhere; }
    :is(body, body.dark-theme) .header-info { max-width: 100%; }
    :is(body, body.dark-theme) .header-right { gap: 8px; }
    :is(body, body.dark-theme) .logo { width: 38px; height: 38px; border-radius: 12px; }
    :is(body, body.dark-theme) .logo svg { width: 20px; height: 20px; }
    :is(body, body.dark-theme) .header-title { font-size: 16px; }
    :is(body, body.dark-theme) .header-subtitle { font-size: 12px; }
    :is(body, body.dark-theme) .global-notify-btn { width: 42px; height: 42px; border-radius: 50%; }

    /* меню и аватар - без «контейнера»: только значок */
    :is(body, body.dark-theme) .hamburger-btn {
        width: 44px;
        height: 44px;
        background: transparent !important;
        border: 0 !important;
        border-radius: 50%;
        box-shadow: none !important;
    }
    :is(body, body.dark-theme) .hamburger-btn:hover,
    :is(body, body.dark-theme) .hamburger-btn:active,
    :is(body, body.dark-theme) .hamburger-btn:focus {
        background: transparent !important;
        border: 0 !important;
        transform: translateY(-50%);
        outline: none;
    }
    :is(body, body.dark-theme) .hamburger-btn { -webkit-tap-highlight-color: transparent; }

    /* Нажатие: полоски «разбегаются» и собираются в ровную стопку, цвет - акцентный */
    :is(body, body.dark-theme) .hamburger-btn span {
        transform-origin: center;
        transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.28s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, opacity 0.2s ease;
    }
    :is(body, body.dark-theme) .hamburger-btn:active span,
    :is(body, body.dark-theme) .hamburger-btn.is-pressed span { background: var(--au-accent) !important; }
    :is(body, body.dark-theme) .hamburger-btn:active span:nth-child(1),
    :is(body, body.dark-theme) .hamburger-btn.is-pressed span:nth-child(1) { transform: translateX(5px) scaleX(0.7); }
    :is(body, body.dark-theme) .hamburger-btn:active span:nth-child(2),
    :is(body, body.dark-theme) .hamburger-btn.is-pressed span:nth-child(2) { width: 19px; }
    :is(body, body.dark-theme) .hamburger-btn:active span:nth-child(3),
    :is(body, body.dark-theme) .hamburger-btn.is-pressed span:nth-child(3) { transform: translateX(-5px) scaleX(0.7); }
    :is(body, body.dark-theme) .hamburger-btn:focus-visible { outline: 0; }

    /* имя пользователя скрыто - остаётся круглый аватар */
    :is(body, body.dark-theme) .user-name { display: none !important; }
    :is(body, body.dark-theme) .user-info,
    :is(body, body.dark-theme) .user-info:hover,
    :is(body, body.dark-theme) .user-info.active {
        width: 44px;
        height: 44px;
        min-width: 44px;
        padding: 4px !important;
        justify-content: center;
        background: transparent !important;
        border: 0;
        box-shadow: none !important;
    }
    :is(body, body.dark-theme) .user-info::after { display: none; }
    :is(body, body.dark-theme) .user-avatar { width: 36px !important; height: 36px !important; }}

@media (max-width: 480px) {
    :is(body, body.dark-theme) .header-subtitle { display: none; }
    :is(body, body.dark-theme) .header-title { font-size: 15.5px; }}

@media (max-width: 768px) {
    :is(body, body.dark-theme) #ai-chat-window { right: 0; left: 0; bottom: 0; width: 100%; height: min(78vh, 640px); border-radius: 22px 22px 0 0; animation: au-sheet 0.25s ease-out; }
    :is(body, body.dark-theme) .global-notify-panel { width: 100%; border-radius: 22px 22px 0 0; }}
@media (max-width: 768px) {
    .hdr-desk { display: none; }
    .hdr-mob { display: inline; }}

/* AI-ассистент открыт: затемнение как у уведомлений, фон не прокручивается */
@media (max-width: 768px) {
    .ai-chat-overlay { position: fixed; inset: 0; z-index: 20000; display: block; background: var(--au-scrim, rgba(15, 23, 42, 0.45)); opacity: 0; visibility: hidden; pointer-events: none; touch-action: none; transition: opacity 0.2s ease, visibility 0.2s ease; }
    .ai-chat-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }
    body.ai-chat-open { overflow: hidden; overscroll-behavior: none; }
    html:has(body.ai-chat-open) { overflow: hidden; }
    #ai-chat-messages { overscroll-behavior: contain; }
}

/* Короткое название страницы в шапке на телефоне (в разметке: <span class="ht-full"> и <span class="ht-short">) */
.ht-short { display: none; }
@media (max-width: 768px) {
    .ht-full { display: none; }
    .ht-short { display: inline; }
}
