/* Личный кабинет (/my/*): мобильная вёрстка. */
/* Порядок подключения важен: файл подключается ПОСЛЕДНИМ и перекрывает фиксированные */
/* десктопные размеры (314px / 1046px и т.п.) из 01-12. Всё внутри media-запросов, */
/* поэтому на экранах шире 900px ничего не меняется. */
/* !important использован только там, где его уже ставят прежние правила (отмечено ниже). */

@media (max-width: 900px) {

  /* ===== Общая оболочка кабинета ===== */
  /* Сетка 314px + 1046px превращается в одну колонку: меню сверху, затем заголовок, затем контент. */
  .profile-page {
    width: calc(100% - 32px);
    min-height: 0;
    margin-bottom: 40px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 0;
  }
  .profile-page > * { grid-column: 1; min-width: 0; }
  .profile-sidebar { grid-row: 1; width: 100%; }
  .profile-menu-stack,
  .profile-menu-card { width: 100%; }
  /* Пункты меню ниже (было 62px), чтобы меню не занимало несколько экранов; всё равно >= 44px для пальца. */
  .profile-menu-items > button { height: 48px; min-height: 48px; }
  .profile-page-title {
    grid-row: 2;
    height: auto;
    min-height: 52px;
    margin: 16px 0 8px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    font-size: 24px;
    line-height: 30px;
  }
  /* Фильтры внутри заголовка (заявки, кампании) были absolute справа и налезали на текст. */
  .profile-page-title .catalog-sort { position: static; width: 100%; min-width: 0; }
  /* Любой основной блок страницы идёт в третью строку и без верхнего отступа 40px. */
  .profile-page > :not(.profile-sidebar):not(.profile-page-title) { grid-row: 3; margin-top: 0; }
  .profile-content,
  .profile-main-stack,
  .profile-main-stack .profile-content-main { width: 100%; max-width: 100%; min-width: 0; }

  /* ===== Профиль (/my/profile, также запасной экран /my/telegram-ads, /my/statistics) ===== */
  .profile-main-stack .profile-content-main,
  .profile-content-main { height: auto; padding: 20px 16px 24px; }
  .profile-id-row { grid-template-columns: minmax(0, 1fr); gap: 16px; }  /* было 479px 479px */
  .profile-id-field { height: auto; }
  .profile-actions { flex-wrap: wrap; }

  /* ===== Баланс (/my/balance) ===== */
  .profile-content-balance,
  .profile-balance-page { width: 100%; max-width: 100%; }
  .profile-balance-page { grid-template-columns: minmax(0, 1fr); }
  .profile-balance-hero,
  .profile-affiliate-card,
  .profile-balance-history { width: 100%; max-width: 100%; }
  /* Две валюты друг под другом вместо двух половин по 523px. */
  .profile-balance-hero { height: auto; grid-template-columns: minmax(0, 1fr); }
  .profile-balance-half { min-height: 96px; }
  .profile-balance-half b { font-size: 36px; line-height: 44px; }
  /* История операций: строка 1 = сумма + дата + время, строка 2 = описание на всю ширину. */
  .profile-history-list { padding: 16px; }
  .profile-history-row { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 10px; row-gap: 6px; }
  .profile-history-row > span { grid-column: 1; grid-row: 1; }
  .profile-history-row > time:nth-of-type(1) { grid-column: 2; grid-row: 1; justify-self: end; }
  .profile-history-row > time:nth-of-type(2) { grid-column: 3; grid-row: 1; }
  .profile-history-row > b { grid-column: 1 / -1; grid-row: 2; white-space: normal; min-width: 0; overflow-wrap: anywhere; }
  .profile-history-footer { flex-direction: column; align-items: flex-start; gap: 12px; }
  .profile-history-footer nav { flex-wrap: wrap; gap: 8px; }
  .profile-history-footer button { width: 44px; height: 44px; }
  /* Таблица партнёрки (6 колонок, 600px+) прокручивается внутри своей карточки. */
  .profile-affiliate-table { overflow-x: auto; }

  /* ===== Мои каналы (/my/channels) ===== */
  .profile-content-my-channels,
  .my-channels-list { width: 100%; }
  .my-channel-card { width: 100%; max-width: 100%; height: auto; min-height: 0; }
  /* Шапка карточки: аватар | название+статус | стрелка, ниже кнопка действия на всю ширину. */
  .my-channel-summary {
    width: 100%;
    height: auto;
    min-height: 84px;
    padding: 12px;
    grid-template-columns: 52px minmax(0, 1fr) 44px;
    grid-template-areas: "avatar info chevron" "actions actions actions";
    column-gap: 12px;
    row-gap: 10px;
  }
  .my-channel-avatar { grid-area: avatar; width: 52px; height: 52px; }
  .my-channel-info { grid-area: info; width: auto; min-width: 0; height: auto; flex-direction: column; align-items: flex-start; gap: 8px; }
  .my-channel-text { width: auto; max-width: 100%; min-width: 0; height: auto; }
  .my-channel-text strong { white-space: normal; text-align: left; overflow-wrap: anywhere; }
  .my-channel-status { flex: 0 0 auto; width: auto; min-width: 120px; height: 36px; padding: 0 12px; }
  .my-channel-actions { grid-area: actions; width: 100%; height: auto; }
  .my-channel-action,
  .my-channel-action.publish,
  .my-channel-action.pause { width: 100%; height: 44px; }
  .my-channel-chevron { grid-area: chevron; width: 44px; height: 44px; }
  /* Раскрытие: прежний max-height 84px/1800px не подходит (контент выше), поэтому
     закрытая карточка просто скрывает настройки, открытая растёт по содержимому.
     Анимация высоты на мобильном отключена. */
  .my-channel-card:not(.open) { max-height: none; border-radius: 24px; }
  .my-channel-card:not(.open) .my-channel-settings { display: none; }
  .my-channel-card.open { max-height: none !important; border-radius: 24px; }  /* !important: прежнее правило 1800px !important в 08 */
  .my-channel-settings,
  .my-channel-settings-body,
  .my-channel-divider { width: 100%; min-width: 0; }
  .my-channel-card.open .my-channel-settings-body { padding: 16px !important; }  /* !important: в 08 padding 24px !important */
  .my-channel-card.open .settings-line { width: calc(100% + 32px); margin-left: -16px; margin-right: -16px; }
  .my-channel-card.open .settings-delete-line { width: calc(100% + 32px) !important; margin: 20px -16px 0 !important; }  /* !important: в 08 то же правило с !important */
  /* Поля настроек: все сетки в одну колонку. */
  .settings-row.top,
  .settings-row.description,
  .settings-commerce,
  .settings-bottom-row { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .my-channel-card .settings-bottom-row { grid-template-columns: minmax(0, 1fr) !important; column-gap: 16px !important; row-gap: 16px; }  /* !important: в 08 колонки 520px max-content с !important */
  .my-channel-card .settings-flags { width: 100% !important; min-width: 0 !important; }  /* !important: в 08 width/min-width 520px с !important */
  .settings-row.description .settings-field.wide,
  .settings-row.description .settings-field.cover { width: 100%; }
  .settings-ad-availability,
  .settings-flags,
  .settings-normal,
  .settings-hot { width: 100%; min-width: 0; }
  .settings-flags { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .settings-flags label.settings-check { width: 100%; max-width: 100%; min-height: 30px; align-items: center; }
  .my-channel-card .settings-flags label.settings-check.settings-auto-calc { height: auto; min-height: 20px; }  /* длинная подпись переносится на 2-3 строки */
  .settings-auto-label { white-space: normal; min-width: 0; flex: 1 1 0; }
  .settings-caution-actions { width: 100%; flex-wrap: wrap; }
  .settings-caution-actions button { width: 100%; }
  .settings-channel-actions,
  .my-channel-card .settings-channel-actions { width: 100% !important; grid-template-columns: minmax(0, 1fr); }  /* !important: в 08 width: max-content !important */
  .settings-channel-actions button,
  .my-channel-card .settings-channel-actions button { width: 100%; white-space: normal; margin-left: 0; }
  .my-channel-settings-footer { flex-wrap: wrap; }
  /* Условия размещения: типы и цены помещаются в 311px. */
  .my-condition { grid-template-columns: 92px minmax(0, 1fr) minmax(0, 1fr); }
  .hot-condition-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hot-condition-row > .hot-row-button { grid-column: 1 / -1; width: 100%; }
  /* Дни недели и временные слоты. */
  .ad-week-days { flex-wrap: wrap; }
  .ad-week-day { width: auto; flex: 1 1 0; min-width: 36px; height: 44px; }
  .ad-time-slot-row { grid-template-columns: 44px minmax(0, 1fr) 44px 44px; gap: 6px; }
  .ad-time-slot-row > *,
  .ad-time-slot-picker,
  .ad-time-slot-toggle { width: 100%; min-width: 0; }

  /* ===== Заявки (/my/requests) и Моя реклама (/my/ads): карточки безопасных сделок ===== */
  .safe-deal-order-card { max-width: 100%; }
  .buyer-campaign-card.safe-deal-order-card .buyer-campaign-summary { grid-template-columns: 52px minmax(0, 1fr) 44px; }
  .safe-deal-order-card .buyer-campaign-info { height: auto; min-height: 52px; margin-left: 0; align-self: center; }
  .safe-deal-order-card .buyer-campaign-text { height: auto; flex-wrap: wrap; gap: 8px; }  /* сумма и статус переносятся */
  .safe-deal-order-card .safe-deal-order-final-status-chip { margin-left: 0; }
  .safe-deal-order-card .buyer-campaign-actions > .safe-deal-order-id-copy { transform: none; }
  .safe-deal-order-body { padding: 16px; }
  .safe-deal-order-body > .safe-deal-order-content-divider { width: calc(100% + 32px); margin-left: -16px; margin-right: -16px; }
  .safe-deal-order-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }  /* было 1fr 450px */
  .safe-deal-order-timeline { grid-template-columns: minmax(0, 1fr); }
  .safe-deal-order-stage .safe-deal-order-stage-content > p,
  .safe-deal-order-stage.is-current .safe-deal-order-stage-content > p,
  .safe-deal-order-stage.is-placement-completed .safe-deal-order-stage-content > p { white-space: normal; }
  .safe-deal-order-stage-row { flex-wrap: wrap; width: auto; }
  .safe-deal-order-preview-anchor { width: 100%; min-height: 0; align-items: stretch; }
  .safe-deal-order-preview-anchor > .buyer-creative-post-preview,
  .safe-deal-order-preview-counterparty { width: 100%; max-width: 100%; }
  .safe-deal-order-preview-status-row { width: 100%; max-width: 100%; height: auto; flex-wrap: wrap; }
  .safe-deal-order-placement-info { width: 100%; flex-wrap: wrap; }
  .safe-deal-order-counterparty-row-primary,
  .safe-deal-order-counterparty-row-stats { flex-wrap: wrap; }
  .safe-deal-order-card.open { max-height: none !important; }  /* !important: в 12 max-height 1800px !important */

  /* ===== Мои кампании (/my/campaigns) ===== */
  .profile-content-buyer-campaigns,
  .buyer-campaigns-list { width: 100%; }
  .buyer-campaign-card.expandable-card-primitive { width: 100%; max-width: 100%; height: auto; min-height: 0; }
  .buyer-campaign-card.expandable-card-primitive:not(.open) { max-height: none; border-radius: 24px; }
  .buyer-campaign-card.expandable-card-primitive:not(.open) .expandable-card-settings { display: none; }
  .buyer-campaign-card.expandable-card-primitive.open { border-radius: 24px; }
  .buyer-campaign-card.expandable-card-primitive .expandable-card-summary { height: auto; min-height: 84px; padding: 12px; grid-template-columns: 52px minmax(0, 1fr) 44px; gap: 10px; }
  .buyer-campaign-card.expandable-card-primitive .expandable-card-avatar { width: 52px; height: 52px; }
  .buyer-campaign-card.expandable-card-primitive .expandable-card-info { min-height: 0; }
  .buyer-campaign-card.expandable-card-primitive .expandable-card-text { max-width: 100%; height: auto; min-height: 24px; }
  .buyer-campaign-card.expandable-card-primitive .expandable-card-text strong { white-space: normal; overflow-wrap: anywhere; }
  .buyer-campaign-card.expandable-card-primitive .expandable-card-actions { grid-column: 1 / -1; grid-row: 2; width: 100%; min-width: 0; height: auto; justify-content: flex-start; }
  .buyer-campaign-card.expandable-card-primitive .expandable-card-actions:empty { display: none; }
  .buyer-campaign-card.expandable-card-primitive .expandable-card-chevron { grid-column: 3; grid-row: 1; width: 44px; height: 44px; margin: 0; align-self: center; }
  .buyer-campaign-card.expandable-card-primitive .buyer-campaign-creative-body { padding: 16px; }
  /* Зоны «добавить/импортировать креатив» и карусель: одна колонка, карусель листается внутри себя. */
  .buyer-campaign-card.buyer-campaign-expandable .buyer-campaign-creative-workspace { grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
  .buyer-campaign-card.buyer-campaign-expandable .buyer-campaign-creative-zones { grid-column: 1; flex-direction: row; flex-wrap: wrap; }
  .buyer-campaign-card.buyer-campaign-expandable .buyer-company-carousel { grid-column: 1; overflow-x: auto; }
  .buyer-campaign-card .buyer-creative-action-zone { width: 100%; max-width: none; min-height: 96px; height: 96px; }
  .buyer-campaign-card.buyer-campaign-expandable .buyer-campaign-editor-divider,
  .buyer-campaign-card.buyer-campaign-expandable .buyer-campaign-actions-divider { width: calc(100% + 32px); margin-left: -16px; margin-right: -16px; }
  .buyer-campaign-card.buyer-campaign-expandable .buyer-campaign-expanded-actions { justify-content: flex-start; }

  /* ===== Пользователи (/my/users) и Администраторы (/my/administrators) ===== */
  .profile-users-layout { width: 100%; grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .profile-users-list,
  .profile-users-sidebar { width: 100%; min-width: 0; }
  .profile-users-sidebar { order: -1; }  /* поиск и статистика над списком */
  .profile-user-card { width: 100%; max-height: none; border-radius: 24px; }
  .profile-user-card.open { max-height: none; }
  .profile-user-card.open .profile-user-content { height: auto; }
  /* Шапка: аватар + имя + стрелка в первой строке, чипы (username, id) во второй. */
  .profile-user-head { height: auto; min-height: 84px; flex-wrap: wrap; row-gap: 8px; padding: 12px 0 12px 12px; }
  .profile-user-name { flex: 1 1 calc(100% - 150px); max-width: none; }
  .profile-user-toggle.my-channel-chevron { order: 1; flex: 0 0 52px; width: 52px; height: 52px; margin-top: 0; margin-bottom: 0; }
  .profile-user-chip,
  .profile-user-go,
  .profile-user-name + .profile-user-chip { order: 2; margin-left: 0; margin-right: 5px; }
  .profile-user-settings,
  .profile-user-balance { margin-left: 16px; margin-right: 16px; }
  .profile-user-balance-current { flex-direction: column; align-items: stretch; gap: 8px; }
  .profile-user-balance-current span { height: auto; min-height: 34px; white-space: nowrap; }
  .profile-user-balance-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }  /* было 6 колонок */
  .profile-user-referral { grid-template-columns: minmax(0, 1fr) auto; }
  .profile-user-balance-actions button,
  .profile-user-referral button { min-height: 44px; }

  /* ===== Модерация (/my/moderation) ===== */
  .profile-content-moderation { width: 100%; min-height: 0; }
  .moderation-layout { width: 100%; grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .moderation-sidebar { order: -1; width: 100%; }
  .moderation-list { min-width: 0; }
  .moderation-side-card,
  .moderation-search,
  .moderation-stat { width: 100%; box-sizing: border-box; }
  /* Карточка заявки: превью и детали друг под другом (было 338px + 286px, высота 645px). */
  .moderation-card { width: 100%; height: auto; padding: 16px; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; row-gap: 16px; }
  .moderation-preview { width: 100%; max-width: 338px; height: auto; max-height: 489px; margin: 0 auto; }
  .moderation-details { width: 100%; min-width: 0; }
  .moderation-field textarea { width: 100%; box-sizing: border-box; }
  .moderation-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; }
  .moderation-actions .moderation-reason-selector { grid-column: 1 / -1; grid-row: auto; width: 100%; }
  .moderation-reason-selector { width: 100%; }

  /* ===== Настройки каталога (/my/settings) ===== */
  .profile-content-catalog-settings { width: 100%; }
  .catalog-settings-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }  /* было 515px 515px */
  .catalog-settings-right { min-width: 0; }
  .catalog-settings-block { width: 100%; min-width: 0; box-sizing: border-box; padding: 16px; }
  .catalog-settings-block h2 { font-size: 20px; line-height: 26px; margin-bottom: 16px; }
  .catalog-settings-row { width: 100%; min-width: 0; }
  .catalog-settings-chip,
  .catalog-settings-edit-input { flex: 1 1 auto; max-width: none; }
  .catalog-settings-edit,
  .catalog-settings-delete { margin-left: 8px; width: 36px; height: 36px; }
}

/* ===== Совсем узкие телефоны ===== */
@media (max-width: 480px) {
  .profile-page { width: calc(100% - 24px); }
  .profile-page-title { font-size: 22px; line-height: 28px; }
  .profile-balance-half b { font-size: 30px; line-height: 38px; }
  .profile-history-row > time { font-size: 14px; }
  .my-channel-card.open .my-channel-settings-body { padding: 12px !important; }  /* !important: перекрывает 08 */
  .safe-deal-order-body { padding: 12px; }
}

/* ======================================================================== */
/* ===== Ноутбуки 901–1460px: кабинет и каталог без горизонтального скролла ===== */
/* Десктопная вёрстка рассчитана на 1424px+ (колонка контента 1046px). Здесь колонка контента */
/* сжимается (меню слева 314px остаётся), карточки/сетки/формы внутри подстраиваются. */
/* На экранах шире 1460px и на мобильных (<=900px) эти правила не действуют. */
/* !important: только там, где прежние правила в 08/10 ставят свой !important (отмечено). */
/* ======================================================================== */
@media (min-width: 901px) and (max-width: 1460px) {

  /* ===== Общая оболочка кабинета ===== */
  /* Колонка сетки уже minmax(0,1046px); фиксированная ширина 1046px у блоков — причина скролла. */
  .profile-page > * { min-width: 0; }
  .profile-content,
  .profile-main-stack,
  .profile-main-stack .profile-content-main,
  .profile-content-balance,
  .profile-balance-page,
  .profile-balance-hero,
  .profile-balance-history,
  .profile-affiliate-card,
  .profile-content-my-channels,
  .my-channels-list,
  .my-channel-card,
  .profile-content-advix-ads,
  .profile-content-buyer-campaigns,
  .buyer-campaigns-list,
  .buyer-campaign-card.buyer-campaign-expandable,
  .buyer-campaign-card.expandable-card-primitive,
  .profile-content-users,
  .profile-content-administrators,
  .profile-users-layout,
  .profile-content-moderation,
  .moderation-layout,
  .advix-ads-layout,
  .profile-content-cart,
  .cart-layout,
  .profile-content-catalog-settings { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }

  /* ===== Профиль (/my/profile) ===== */
  .profile-id-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }  /* было 479px 479px */
  .profile-id-field { width: auto; min-width: 0; }
  .profile-actions { flex-wrap: wrap; }

  /* ===== Баланс (/my/balance) ===== */
  .profile-balance-page { grid-template-columns: minmax(0, 1fr); }
  .profile-balance-hero { height: auto; min-height: 120px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-balance-half { min-width: 0; padding: 0 12px; box-sizing: border-box; }
  .profile-balance-half b { font-size: min(48px, 3.75vw); line-height: 1.2; }  /* суммы уменьшаются вместе с шириной */
  .profile-balance-half img { width: min(38px, 3vw); height: auto; }
  .profile-history-row { grid-template-columns: auto minmax(0, 1fr) auto auto; column-gap: 24px; }  /* было 144px minmax(372px,1fr) 180px 64px */
  .profile-history-row b { white-space: normal; min-width: 0; overflow-wrap: anywhere; }
  .profile-history-footer { flex-wrap: wrap; gap: 12px; }
  .profile-history-footer nav { flex-wrap: wrap; max-width: 100%; }
  /* Таблица партнёрки прокручивается внутри своей карточки. */
  .profile-affiliate-table { overflow-x: auto; }
  .profile-affiliate-header,
  .profile-affiliate-row { min-width: 760px; grid-template-columns: minmax(200px, 1.6fr) 70px 90px 90px minmax(120px, 1fr) 52px; column-gap: 16px; }
  .profile-affiliate-copy,
  .profile-affiliate-add { width: 100%; max-width: 314px; }

  /* ===== Избранное (/my/favorites), каталог (/), горячие (/hot) ===== */
  /* Карточки канала фиксированной ширины 338px: число колонок подбирается по ширине, ряд по центру. */
  .page-shell:not(.channel-page) > * { min-width: 0; }
  .channel-grid,
  .profile-favorites-grid { width: 100%; grid-template-columns: repeat(auto-fill, 338px); justify-content: center; }
  .catalog-state-panel { width: 100%; box-sizing: border-box; }

  /* ===== Мои каналы (/my/channels): карточка и настройки ===== */
  .my-channel-summary,
  .my-channel-settings,
  .my-channel-settings-body { width: 100%; min-width: 0; box-sizing: border-box; }
  .my-channel-text { min-width: 0; }
  .settings-row.top { grid-template-columns: repeat(3, minmax(0, 1fr)); }  /* было 3 x 319.33px */
  .settings-row.description { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }  /* было 658px 320px */
  .settings-row.description .settings-field.wide,
  .settings-row.description .settings-field.cover { width: 100%; min-width: 0; }
  .settings-field { min-width: 0; grid-template-columns: minmax(0, 1fr); }
  .category-selector,
  .settings-field .channel-settings-input { width: 100%; max-width: 100%; box-sizing: border-box; }
  .category-selector .chips,
  .category-selector .selected-categories { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
  /* Обычные условия и горячие предложения друг под другом (рядом не помещаются). */
  .settings-commerce { grid-template-columns: minmax(0, 1fr); gap: 24px; }  /* было 376px 1fr */
  .settings-normal { min-width: 0; max-width: 376px; }
  .settings-hot,
  .hot-conditions { width: 100%; min-width: 0; }
  .my-condition { grid-template-columns: 80px repeat(2, minmax(0, 1fr)); }
  .hot-condition-row { grid-template-columns: minmax(0, 1.1fr) minmax(0, .8fr) repeat(2, minmax(0, 1fr)) 52px; }
  /* Нижний ряд: доступность рекламы | флаги, кнопки канала на всю ширину ниже. */
  .my-channel-card .settings-bottom-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; column-gap: 32px !important; row-gap: 20px; }  /* !important: в 08 и 10 колонки 412px 525px с !important */
  .settings-ad-availability { width: 100%; min-width: 0; }
  .settings-flags { grid-template-columns: minmax(0, 1fr); }
  .my-channel-card .settings-flags { width: 100% !important; min-width: 0 !important; }  /* !important: в 08 и 10 width/min-width 520/525px с !important */
  .settings-flags label.settings-check { max-width: 100%; min-width: 0; }
  .my-channel-card .settings-flags > label.settings-check { height: auto; min-height: 20px; }
  .settings-auto-label { white-space: normal; min-width: 0; flex: 1 1 0; }
  .settings-caution-actions { flex-wrap: wrap; }
  .settings-caution-share,
  .settings-caution-transfer { width: auto; flex: 1 1 140px; }
  .my-channel-card .settings-channel-actions { grid-column: 1 / -1; }
  .ad-week-days { flex-wrap: wrap; }

  /* ===== Мои кампании (/my/campaigns) ===== */
  .buyer-campaign-card.expandable-card-primitive .expandable-card-summary { grid-template-columns: 60px minmax(0, 1fr) auto 67px; }  /* было 60px 766px 93px 67px */
  .buyer-campaign-card.expandable-card-primitive .expandable-card-actions { width: auto; min-width: 93px; }

  /* ===== Пользователи / Администраторы / Модерация / Корзина: основная колонка + боковая 314px ===== */
  .profile-users-layout,
  .moderation-layout,
  .advix-ads-layout,
  .cart-layout { grid-template-columns: minmax(0, 1fr) 314px; gap: 24px; }  /* было 692px 314px, gap 40px */
  .profile-users-list,
  .profile-user-card,
  .moderation-list,
  .advix-ads-channel-block,
  .cart-list { width: 100%; min-width: 0; box-sizing: border-box; }
  .profile-users-sidebar,
  .moderation-sidebar,
  .profile-user-head,
  .profile-user-settings,
  .profile-user-balance { min-width: 0; }
  .profile-user-balance-current { flex-wrap: wrap; }
  .profile-user-balance-actions { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }  /* было 6 колонок 112/82/82/112/96/96 */
  .profile-user-referral { grid-template-columns: minmax(0, 220px) minmax(96px, 120px); }

  /* ===== Настройки каталога (/my/settings) ===== */
  .catalog-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }  /* было 515px 515px */
  .catalog-settings-right { min-width: 0; }
  .catalog-settings-block,
  .catalog-settings-row { width: 100%; min-width: 0; box-sizing: border-box; }
}

/* Карточка модерации (превью 338px + детали 286px = 624px) и блок канала в рекламе: двумя колонками */
/* только когда помещаются (от 1380px), иначе друг под другом, как на мобильном. */
@media (min-width: 901px) and (max-width: 1379px) {
  .moderation-card,
  .advix-ads-channel-block { width: 100%; height: auto; box-sizing: border-box; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; row-gap: 16px; }
  .moderation-preview,
  .advix-ads-card-preview { width: 100%; max-width: 338px; margin: 0 auto; }
  .moderation-details { width: 100%; min-width: 0; }
  .moderation-field textarea { width: 100%; box-sizing: border-box; }
}

/* Узкие ноутбуки и планшеты 901–1180px: боковые колонки уходят наверх, формы в 1-2 колонки. */
@media (min-width: 901px) and (max-width: 1180px) {
  /* Общая оболочка: фильтры в заголовке (кампании, заявки) не налезают на текст. */
  .profile-page-title-buyer-campaigns,
  .profile-page-title-safe-deal-orders { justify-content: flex-start; }
  /* Мои каналы: настройки в одну колонку. */
  .my-channel-card .settings-bottom-row { grid-template-columns: minmax(0, 1fr) !important; }  /* !important: см. выше */
  .settings-row.top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-row.description { grid-template-columns: minmax(0, 1fr); }
  /* Пользователи / Администраторы / Модерация: поиск и статистика над списком; Корзина: итог под списком. */
  .profile-users-layout,
  .moderation-layout,
  .advix-ads-layout,
  .cart-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .profile-users-sidebar,
  .moderation-sidebar { order: -1; width: 100%; }
  .profile-users-sidebar > *,
  .moderation-sidebar > *,
  .moderation-side-card,
  .moderation-search,
  .moderation-stat { width: 100%; box-sizing: border-box; }
  /* Настройки каталога: блоки друг под другом. */
  .catalog-settings-grid { grid-template-columns: minmax(0, 1fr); }
}
