/**
 * Мобильная (< 768px) и планшетная (768–1100px) раскладка кабинета (psmy-75).
 * Мобильная: панель уходит, появляются шапка 56px, полоса «Сайт» 44px и нижние вкладки 64px.
 * Планшет: панель сворачивается до иконок 56px.
 */

/* планшет: узкая панель */
@media (min-width: 768px) and (max-width: 1100px){
    #layout-wrapper.cab{ grid-template-columns: var(--c-side-w-narrow) minmax(0, 1fr); --cab-side-col: var(--c-side-w-narrow); }
    .cab-side{ padding: 14px 9px; gap: 14px; }
    .cab-logo span, .cab-nav__label, .cab-site__text, .cab-site__btn .cab-ico, .cab-site--empty{ display: none; }
    .cab-logo{ padding: 0 5px; }
    .cab-site__btn{ justify-content: center; padding: 0; min-height: 36px; }
    .cab-site__btn::before{
        content: '';
        width: 8px; height: 8px; border-radius: 50%; background: var(--c-accent);
    }
    .cab-site__list{ left: 0; right: auto; min-width: 260px; }
    .cab-nav__link{ justify-content: center; padding: 0; min-height: 38px; }
    .cab-nav__link .cab-ico{ width: 20px; height: 20px; }
    .cab-search{ width: 280px; }
}

/* мобильные */
@media (max-width: 767px){
    :root{ --c-pad: 16px; --c-ctl: 44px; --c-ctl-s: 36px; }
    #layout-wrapper.cab{ grid-template-columns: minmax(0, 1fr); background: var(--c-canvas); }
    .cab-side, .cab-top{ display: none; }
    .cab-body{ padding-bottom: calc(var(--c-mtabs-h) + env(safe-area-inset-bottom, 0px)); }

    /* шапка */
    .cab-mhead{
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        height: var(--c-mhead-h);
        padding: 0 16px;
        background: var(--c-side-bg);
        color: #FFFFFF;
    }
    .cab-mhead .cab-logo{ padding: 0; font-size: 13px; }
    .cab-mhead__right{ display: flex; align-items: center; gap: 14px; }
    .cab-mhead__icon{ display: inline-flex; color: var(--c-side-text); }
    .cab-mhead__icon .cab-ico{ width: 22px; height: 22px; }

    /* полоса «Сайт» */
    .cab-msite{
        display: block;
        position: relative;
        background: var(--c-side-active);
        color: #FFFFFF;
    }
    .cab-msite .cab-site__btn{
        min-height: var(--c-msite-h);
        border: none;
        border-radius: 0;
        background: transparent;
        padding: 0 16px;
    }
    .cab-msite .cab-site__text{ flex-direction: row; align-items: center; gap: 8px; }
    .cab-msite .cab-site__name{ font-size: 12.5px; }
    .cab-msite .cab-site__list{ left: 8px; right: 8px; }
    .cab-msite .cab-site--empty{ border: none; border-radius: 0; flex-direction: row; align-items: center; gap: 8px; min-height: var(--c-msite-h); padding: 0 16px; box-sizing: border-box; }

    /* шапка страницы и контент */
    .cab-head{ padding: 14px var(--c-pad) 0; }
    .cab-head__row{ flex-direction: column; align-items: stretch; gap: 12px; padding-bottom: 12px; }
    .cab-head__actions{ justify-content: flex-start; }
    .cab-head__actions .button, .cab-head__actions button{ flex: 1 1 auto; }
    .cab-content{ padding: 16px var(--c-pad) 24px; }

    body.cabinet .content-card > .content-wrapper,
    body.cabinet .content-card.compact .content-wrapper,
    body.cabinet .content-wrapper{ padding: 12px; }
    body.cabinet .content-card .content-card-header{ flex-wrap: wrap; }
    body.cabinet .row{ flex-wrap: wrap; }

    /* таблицы движка в две строки */
    body.cabinet .flex-table .flex-table-title{ display: none; }
    body.cabinet .flex-table .flex-table-body .flex-table-row{ display: flex; flex-wrap: wrap; padding: 6px 0; }
    body.cabinet .flex-table .flex-table-cell{ flex: 1 1 45%; min-width: 0; padding: 4px 12px; overflow-wrap: anywhere; flex-direction: column; align-items: flex-start; gap: 2px; }
    body.cabinet .flex-table .flex-table-cell > .cell-title{ display: block; white-space: nowrap; min-width: 0; font-size: var(--c-fs-caps); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-text-3); }

    body.cabinet ul.my-sites{ grid-template-columns: minmax(0, 1fr); }
    body.cabinet .fieldblock.fieldblock-horizontal{ flex-direction: column; align-items: stretch; }
    body.cabinet .fieldblock.fieldblock-horizontal > label{ line-height: 1.3; }
    body.cabinet .modal-window{ width: calc(100vw - 24px) !important; max-width: none; }

    /* нижние вкладки */
    .cab-mtabs{
        display: flex;
        align-items: stretch;
        position: fixed;
        z-index: 40;
        left: 0; right: 0; bottom: 0;
        height: calc(var(--c-mtabs-h) + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--c-surface);
        border-top: 1px solid var(--c-line);
    }
    body.cabinet .cab-mtabs__item{
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        flex: 1;
        min-width: 0;
        padding: 6px 2px 8px;
        color: var(--c-text-3);
        text-decoration: none;
        font-size: 10.5px;
        font-weight: 600;
        line-height: 1;
        border: none;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        height: auto;
        min-height: 0;
        font-family: var(--c-font);
        cursor: pointer;
    }
    .cab-mtabs__item .cab-ico{ width: 22px; height: 22px; }
    .cab-mtabs__item span{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    .cab-mtabs__item:hover{ color: var(--c-text); text-decoration: none; background: transparent; }
    .cab-mtabs__item.is-active{ color: var(--c-text); }
    .cab-mtabs__item.is-active .cab-ico{ color: var(--c-accent); }

    /* лист «Меню» */
    .cab-sheet{ display: none; position: fixed; z-index: 50; inset: 0; }
    .cab-sheet.is-open{ display: block; }
    .cab-sheet__backdrop{ position: absolute; inset: 0; background: rgba(31, 41, 51, 0.5); }
    .cab-sheet__panel{
        position: absolute;
        left: 0; right: 0; bottom: 0;
        max-height: 85vh;
        overflow-y: auto;
        background: var(--c-surface);
        border-radius: 12px 12px 0 0;
        padding: 8px 12px calc(16px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -12px 40px rgba(31, 41, 51, 0.24);
    }
    .cab-sheet__head{ display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 4px; }
    .cab-sheet__title{ font-size: 15px; font-weight: 600; }
    body.cabinet .cab-sheet__close{ border: none !important; background: transparent !important; width: 36px; height: 36px !important; min-height: 0 !important; padding: 0 !important; color: var(--c-text-2); }
    .cab-sheet__user{ display: flex; align-items: center; gap: 12px; padding: 10px 4px 14px; border-bottom: 1px solid var(--c-line); margin-bottom: 8px; }
    .cab-sheet__user .cab-avatar{ width: 40px; height: 40px; font-size: 14px; }
    .cab-sheet__user-name{ font-weight: 600; }
    .cab-sheet__user-mail{ font-size: var(--c-fs-xs); color: var(--c-text-3); overflow-wrap: anywhere; }
    .cab-sheet .cab-nav__link{ min-height: 44px; color: var(--c-text); font-size: 14px; }
    .cab-sheet .cab-nav__link .cab-ico{ color: var(--c-text-3); }
    .cab-sheet .cab-nav__item.is-active > .cab-nav__link{ background: var(--c-canvas); color: var(--c-text); }
    .cab-sheet .cab-side__divider{ background: var(--c-line); margin: 8px 4px; }
    .cab-sheet__row{ display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 10px; font-size: 14px; }
    .cab-sheet__row .lang-widget .dropdown{ right: 0; }
    .cab-sheet__row a{ color: var(--c-text); font-weight: 600; text-decoration: none; }
    /* новые ответы по обращениям: точка на иконке в шапке (psmy-84) */
    .cab-mhead__icon--dot{ position: relative; }
    .cab-mhead__icon--dot::after{
        content: '';
        position: absolute;
        top: 4px;
        right: 4px;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--c-accent);
        border: 2px solid var(--c-ink);
    }
    /* заголовок блока разделов сайта в листе «Меню» (psmy-81) */
    .cab-sheet__row--site{ min-height: 36px; color: var(--c-text-2); font-size: 12.5px; }
    .cab-sheet__site{ color: var(--c-text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
}
