/* ==========================================================================
   Портал Стокцен — телефон и узкий планшет
   Утверждённые макеты: design/mobile (HANDOFF.md). Все правила внутри
   @media (max-width: 900px) — на компьютере этот файл ничего не меняет.

   Вёрстка резиновая: макеты нарисованы на 390 и 360 px, но телефоны бывают
   любые. Значения из макетов — опорные точки clamp(): размер на 390 px
   получается сам, а между 320 и 900 px всё меняется плавно, без ступенек.
   Отдельные @media — только там, где меняется раскладка, а не размер.
   ========================================================================== */

/* Помощники «только на телефоне» / «только на компьютере» */
.m-only { display: none !important; }

@media (max-width: 900px) {
  :root {
    /* Поля по краям: 16 px на 390, 14 на 360, не меньше 12 на совсем узких */
    --m-gutter: clamp(12px, 4.1vw, 24px);
    /* Заголовок экрана: 30 на 390, 26–27 на 360 */
    --m-title: clamp(24px, 7.7vw, 34px);
    /* Приветствие: 26 на 390, 23–24 на 360 */
    --m-hello: clamp(20px, 6.7vw, 30px);
    /* Зазор между карточками — 10–12 px */
    --m-gap: clamp(10px, 3vw, 14px);
    /* Карточка: внутренние поля 16 на 390 */
    --m-pad: clamp(14px, 4.1vw, 20px);
    --m-card-shadow: 0 1px 2px rgba(27, 29, 24, .04), 0 6px 18px rgba(27, 29, 24, .05);
    --m-tap: 48px;
  }

  .m-only { display: revert !important; }
  .m-hide { display: none !important; }

  body { font-size: 16px; }

  /* Содержимое не шире 600 px: на больших телефонах и в портретном
     планшете строки не растягиваются от края до края */
  .content {
    padding: 8px var(--m-gutter) 24px;
    max-width: 600px; margin: 0 auto;
  }
  .main { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

  /* ---------- Нижнее меню ---------- */
  .tabbar {
    gap: 2px;
    padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
  }
  .tab-item {
    min-height: 56px; border-radius: 14px; gap: 3px;
    font-size: clamp(10.5px, 2.9vw, 12px); font-weight: 700;
    -webkit-tap-highlight-color: transparent;
  }
  .tab-pill {
    width: 56px; height: 30px; border-radius: 15px;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s var(--ease);
  }
  .tab-item.active { color: var(--accent-ink); }
  .tab-item.active .tab-pill { background: var(--accent-soft); }
  .tab-badge { top: 2px; left: calc(50% + 8px); display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
  .tab-badge.hidden { display: none; }

  /* На экранах подробностей своя нижняя панель действий — меню уходит */
  #app[data-view="task"] .tabbar,
  #app[data-view="assignment"].testing .tabbar { display: none; }
  #app[data-view="task"] .main { padding-bottom: 0; }

  /* ---------- Шапка ----------
     На телефоне общей шапки нет: у главной своя (аватар, день, место,
     поиск, колокольчик), у «Материалов» — заголовок и поле поиска,
     остальные экраны начинаются сразу с крупного заголовка.
     Сам блок остаётся в разметке нулевой высоты: в нём живёт панель
     уведомлений, которую открывает и пункт «Уведомления» в «Ещё» */
  .topbar {
    padding: max(12px, env(safe-area-inset-top)) var(--m-gutter) 8px;
    gap: 10px; max-width: 600px; width: 100%; margin: 0 auto;
    position: relative; top: auto;
  }
  .topbar > *, .topbar > .m-only { display: none !important; }
  .topbar > .bell-wrap { display: block !important; }
  .topbar #bell-btn { display: none; }
  #app:not([data-view="card"]):not([data-view="common"]):not([data-view="all"]):not([data-view="category"]):not([data-view="folder"]):not([data-view="favorites"]) .topbar {
    height: 0; padding: 0; overflow: visible;
  }

  /* Главная: аватар, день и филиал, лупа и колокольчик */
  #app[data-view="card"] .topbar > .m-ident,
  #app[data-view="card"] .topbar > #m-search-btn { display: inline-flex !important; }
  #app[data-view="card"] .topbar #bell-btn { display: inline-flex; }
  .m-ident {
    flex: 1; min-width: 0; align-items: center; gap: 12px;
    padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
  }
  .m-ident .user-avatar { width: 44px; height: 44px; font-size: 16px; flex: none; }
  .m-ident-text { display: flex; flex-direction: column; min-width: 0; }
  .m-ident-date { font-size: 13px; font-weight: 700; color: #3f6b21; }
  .m-ident-place {
    font-size: 15px; font-weight: 800; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .topbar .icon-btn {
    width: 44px; height: 44px; border-radius: 14px;
    background: var(--surface); box-shadow: 0 1px 2px rgba(27, 29, 24, .06);
    color: #2b2e27;
  }
  .topbar .icon-btn .icon { width: 22px; height: 22px; }
  /* Новые уведомления — точкой: число на маленькой кнопке не читается */
  .bell-badge {
    top: 9px; right: 10px; min-width: 0; width: 10px; height: 10px; padding: 0;
    font-size: 0; border: 2px solid var(--surface); border-radius: 50%;
  }

  /* «Материалы»: крупный заголовок и поле поиска на всю ширину */
  #app[data-view="common"] .topbar,
  #app[data-view="all"] .topbar,
  #app[data-view="category"] .topbar,
  #app[data-view="folder"] .topbar,
  #app[data-view="favorites"] .topbar { flex-wrap: wrap; padding-top: max(20px, env(safe-area-inset-top)); }
  #app[data-view="common"] .topbar > .search-wrap,
  #app[data-view="all"] .topbar > .search-wrap,
  #app[data-view="category"] .topbar > .search-wrap,
  #app[data-view="folder"] .topbar > .search-wrap,
  #app[data-view="favorites"] .topbar > .search-wrap { display: block !important; flex: 1 1 100%; max-width: none; margin: 0; order: 2; }
  .search-wrap input { height: 48px; font-size: 16px; border-radius: 16px; }

  /* Панель уведомлений — лист снизу во всю ширину */
  .bell-panel {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 60;
    width: auto; max-width: none; max-height: 80vh; max-height: 80dvh;
    border-radius: 26px 26px 0 0; box-shadow: var(--shadow-lg);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bell-head { padding: 18px var(--m-pad) 10px; }
  .bell-head h3 { font-size: 20px; }
  .bell-item { padding: 12px var(--m-pad); min-height: var(--m-tap); }
  .bell-title { font-size: 15px; }

  /* ---------- Заголовки экранов ---------- */
  .page-head { margin: 12px 0 16px; }
  .page-head h1, .page-head-row h1 { font-size: var(--m-title); line-height: 1.1; }
  .page-sub { font-size: 15px; }

  /* ---------- Карточки ---------- */
  .card-block {
    padding: var(--m-pad); margin-bottom: var(--m-gap);
    border: 0; border-radius: 20px; box-shadow: var(--m-card-shadow);
  }
  .card-block h2 { font-size: 17px; margin-bottom: 10px; }
  .card-block-head { margin-bottom: 4px; }
  .card-block-all { min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; font-weight: 700; color: #3f6b21; }
  .common-layout { gap: var(--m-gap); }

  .progress { display: block; height: 8px; border-radius: 4px; background: var(--separator); }
  .progress .progress-fill { display: block; border-radius: 4px; background: var(--brand); }
  .progress.late .progress-fill { background: #d98a1e; }

  /* ---------- Главная ---------- */
  .hello {
    flex-direction: column; align-items: stretch; gap: 14px;
    margin-bottom: var(--m-gap); padding: clamp(16px, 4.6vw, 22px);
    border-radius: 22px;
  }
  .hello::before { right: -50px; top: -60px; width: 160px; height: 160px; }
  .hello::after { display: none; }
  .hello-text { flex: none; }
  .hello h1 { margin: 0; font-size: var(--m-hello); line-height: 1.15; text-wrap: balance; }
  .hello-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hello-stat { min-width: 0; padding: 12px 14px; border-radius: 16px; }
  .hello-stat b { font-size: clamp(20px, 6.2vw, 26px); line-height: 1.1; }
  .hello-stat span { font-size: 13px; }

  .card-block.card-leader { position: relative; padding-left: calc(var(--m-pad) + 48px); }
  .card-leader .card-block-head { margin-bottom: 4px; min-height: 0; }
  .card-leader h2 { font-size: 15px; margin: 0; }
  .card-leader .leader-ico { position: absolute; left: var(--m-pad); top: var(--m-pad); width: 36px; height: 36px; }
  .card-leader .card-frame { font-size: 16px; line-height: 1.45; }

  /* «Сегодня»: две ближайшие задачи, остальные — по «Все задачи» */
  .home-today { padding-bottom: 4px; }
  .home-today .home-list { gap: 0; }
  .home-today .home-row:nth-child(n+3) { display: none; }
  .home-row {
    min-height: 56px; padding: 10px 0; border-radius: 0; gap: 12px;
  }
  .home-row + .home-row { border-top: 1px solid var(--separator); }
  .home-row:hover { background: none; }
  .home-row-title { font-size: 15px; font-weight: 800; }
  .home-row-sub { font-size: 13px; }
  .home-row.overdue .home-row-sub { color: var(--orange); font-weight: 700; }
  .home-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #c7ccbc; }
  .home-dot.urgent { background: var(--accent-2); }
  .home-dot.important { background: #d29b1e; }

  .home-course { display: flex !important; flex-direction: column; gap: 10px; color: var(--text); text-decoration: none; }
  .home-course-head { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
  .home-course-head b:first-child { min-width: 0; overflow-wrap: anywhere; }
  .home-course-count { flex: none; font-size: 14px; color: #3f6b21; }
  .home-course-due { font-size: 13px; font-weight: 700; color: var(--text-3); }
  .home-course-due.urgent { color: var(--orange); }

  /* Поздравления, новости, заметки и анкета на телефоне не на главной:
     главная — это не больше четырёх блоков. Анкета — в профиле, заметки — в «Ещё» */
  #app[data-view="card"] .celebrate,
  #app[data-view="card"] .news-aside { display: none; }

  /* ---------- Профиль и чужая карточка ---------- */
  .person-head { gap: 14px; margin-bottom: 16px; }
  .person-head .person-avatar { width: 64px; height: 64px; font-size: 24px; position: relative; border: 0; cursor: pointer; padding: 0; }
  .person-title h1 { font-size: clamp(22px, 6.7vw, 30px); }
  .person-actions { margin-left: 0; width: 100%; }
  .person-actions .btn { flex: 1 1 auto; min-height: 44px; justify-content: center; }
  .person-actions .btn-label { display: inline; }
  .card-row { grid-template-columns: 1fr; gap: 2px; padding: 10px 0; font-size: 16px; }
  .card-row-label { font-size: 13px; font-weight: 600; color: var(--text-3); }

  .breadcrumb { margin: 12px 0 10px; min-height: 44px; display: flex; align-items: center; }

  /* ---------- «Ещё» ---------- */
  .more-page { display: flex; flex-direction: column; gap: var(--m-gap); padding-top: max(12px, env(safe-area-inset-top)); }
  .more-profile {
    display: flex; align-items: center; gap: 14px; width: 100%;
    padding: var(--m-pad); border: 0; border-radius: 22px;
    background: var(--accent-soft); font: inherit; color: var(--text); text-align: left; cursor: pointer;
  }
  .more-profile .person-avatar { width: clamp(52px, 14vw, 60px); height: clamp(52px, 14vw, 60px); font-size: 22px; box-shadow: 0 0 0 4px #fff; }
  .more-profile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .more-profile-text b { font-size: clamp(17px, 4.8vw, 20px); font-weight: 800; overflow-wrap: anywhere; }
  .more-profile-text span { font-size: 14px; color: var(--text-2); }
  .more-profile > .icon { color: var(--accent); }

  .more-label {
    margin: 6px 4px 8px; font-size: 13px; font-weight: 800; letter-spacing: .06em;
    text-transform: uppercase; color: var(--text-3);
  }
  .more-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
  .more-stat {
    display: flex; flex-direction: column; min-width: 0; padding: 12px 14px;
    border-radius: 16px; background: var(--surface); box-shadow: var(--m-card-shadow);
    color: var(--text); text-decoration: none;
  }
  .more-stat b { font-size: clamp(20px, 6vw, 24px); font-weight: 800; line-height: 1.15; }
  .more-stat span { font-size: 13px; color: var(--text-3); }
  .more-stat.late { background: #fdf0e8; }
  .more-stat.late b { color: var(--orange); }
  .more-stat.good b { color: var(--accent-ink); }

  .more-people, .more-list {
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--surface); border-radius: 20px; box-shadow: var(--m-card-shadow);
  }
  .more-person {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px;
    padding: 12px var(--m-pad); border: 0; background: none;
    font: inherit; color: inherit; text-align: left; cursor: pointer;
  }
  .more-person + .more-person { border-top: 1px solid var(--separator); }
  .more-person.late { background: #fff9f4; }
  .more-person .person-avatar { width: 40px; height: 40px; font-size: 16px; box-shadow: none; }
  .more-person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
  .more-person-name { font-size: 15px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .more-person .progress { height: 6px; max-width: 160px; }
  .more-flag {
    flex: none; max-width: 45%; padding: 4px 10px; border-radius: var(--pill);
    font-size: 12px; font-weight: 700; text-align: center;
  }
  .more-flag.late { background: var(--orange-soft); color: var(--orange); }
  .more-flag.review { background: var(--amber-soft); color: var(--amber); }
  .more-all {
    display: flex; align-items: center; justify-content: center; gap: 4px; min-height: var(--m-tap);
    border-top: 1px solid var(--separator); font-size: 14px; font-weight: 700; color: var(--accent); text-decoration: none;
  }

  .more-item {
    display: flex; align-items: center; gap: 16px; width: 100%; min-height: 56px;
    padding: 0 var(--m-pad); border: 0; background: none;
    font: inherit; font-size: 17px; font-weight: 700; color: var(--text); text-align: left; cursor: pointer;
  }
  .more-item + .more-item { border-top: 1px solid var(--separator); }
  .more-item > .icon:first-child { width: 22px; height: 22px; color: var(--text-2); }
  .more-item > span { flex: 1; }
  .more-item .more-go { width: 18px; height: 18px; color: var(--text-3); }
  .more-item.danger, .more-item.danger > .icon:first-child { color: var(--red); }
}

/* Узкие телефоны: длинные подписи в одну строку с многоточием */
@media (max-width: 360px) {
  .home-row-title, .home-course-head b:first-child {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
}

/* Низкий экран (iPhone SE и подобные): приветствие компактнее,
   «От руководства» сворачивается в одну строку */
@media (max-width: 900px) and (max-height: 700px) {
  .hello { gap: 10px; padding: 14px 16px; }
  .hello h1 { font-size: clamp(19px, 5.4vw, 22px); }
  .hello-stat { padding: 8px 12px; }
  .hello-stat b { font-size: 20px; }
  .card-leader .card-frame {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
}

/* ==========================================================================
   Задачи: список (экран 02)
   ========================================================================== */
@media (max-width: 900px) {
  /* Метки состояния — как в макетах: «Новая» серая, «В работе» синяя,
     «На проверке» жёлтая, отказ и возврат — тёплые, «Принята» зелёная */
  .tsk-status.st-new { background: #eef0e8; color: #3e4238; }
  .tsk-status.st-progress { background: var(--blue-soft); color: var(--blue); }
  .tsk-status.st-review { background: var(--amber-soft); color: var(--amber); }
  .tsk-status.st-declined { background: var(--orange-soft); color: var(--orange); }
  .tsk-status.st-done { background: var(--green-soft); color: var(--green); }
  .tag.tsk-status { height: 24px; padding: 0 10px; font-size: 12.5px; font-weight: 700; border-radius: var(--pill); }

  .page-head-row { flex-wrap: wrap; gap: 8px; }
  #app[data-view="tasks"] .page-sub { display: none; }
  #tsk-notify { display: none; }

  /* Переключатель «Мне / Я поставил / Архив» — во всю ширину, сегменты 40 px */
  .chips {
    display: flex; width: 100%; margin-bottom: 8px; padding: 4px;
    border-radius: 16px; background: #e9ebe2;
  }
  .chip { flex: 1 0 auto; justify-content: center; min-height: 40px; padding: 0 12px; font-size: 15px; border-radius: 12px; }
  .chip.active { box-shadow: 0 1px 3px rgba(27, 29, 24, .10); }

  .tsk-group {
    margin: 18px 4px 8px; font-size: 13px; font-weight: 800;
    letter-spacing: .08em; text-transform: uppercase; color: var(--text-3);
  }
  .tsk-group.now { color: var(--orange); }
  .tsk-group + .tsk-list { margin-top: 0; }

  /* Карточка задачи: полоса важности слева, название, под ним метка и срок */
  .tsk-list { gap: var(--m-gap); }
  .tsk-card {
    position: relative; flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 8px 10px; padding: 14px var(--m-pad) 14px calc(var(--m-pad) + 2px);
    border: 0; border-radius: 18px; box-shadow: var(--m-card-shadow); overflow: hidden;
  }
  .tsk-card::before {
    content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 5px;
    border-radius: 0 3px 3px 0; background: #c7ccbc;
  }
  .tsk-card.is-urgent::before { background: var(--accent-2); }
  .tsk-card.is-important::before { background: #d29b1e; }
  .tsk-card.overdue { border: 0; }
  .tsk-card.waiting { box-shadow: var(--m-card-shadow), inset 0 0 0 2px var(--accent-2); }
  .tsk-card-title { order: -1; flex: 1 1 100%; font-size: 16px; font-weight: 800; line-height: 1.3; }
  .tsk-card-top { display: contents; }
  .tsk-card-marks, .tsk-card-progress { display: none; }
  .tsk-card-meta { display: contents; font-size: 14px; }
  .tsk-card-meta > span { font-size: 14px; color: var(--text-3); }
  .tsk-card-meta .hot { color: var(--orange); font-weight: 700; }
  .tsk-card-who.mine { display: none; }
  .tsk-card-wait {
    flex: 1 1 100%; order: 5; padding: 10px 12px; border-radius: 12px;
    background: #fff4e5; color: var(--text-2); font-size: 14px;
  }

  /* «+ Задача» плавает справа над нижним меню */
  .tsk-head-actions { width: auto; }
  .tsk-fab {
    position: fixed; z-index: 44;
    right: max(var(--m-gutter), env(safe-area-inset-right));
    bottom: calc(76px + env(safe-area-inset-bottom) + 12px);
    min-height: 56px; padding: 0 22px; border-radius: 18px; gap: 8px;
    font-size: 17px; font-weight: 800;
    box-shadow: 0 6px 18px rgba(72, 122, 38, .35);
  }
  .tsk-fab .icon { width: 22px; height: 22px; stroke-width: 2.2; }
  /* Последняя карточка не прячется под плавающей кнопкой */
  #app[data-view="tasks"] .content { padding-bottom: 96px; }
}

/* ==========================================================================
   Экраны подробностей: шапка «Назад · раздел · ⋯» (задача, назначение)
   ========================================================================== */
@media (max-width: 900px) {
  .m-detail-top {
    display: flex !important; align-items: center; gap: 12px;
    margin: max(8px, env(safe-area-inset-top)) 0 14px;
  }
  .m-back, .m-menu-btn {
    width: 44px; height: 44px; flex: none; border: 0; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface); color: var(--text); cursor: pointer;
    box-shadow: 0 1px 2px rgba(27, 29, 24, .06);
  }
  .m-back .icon { transform: rotate(180deg); width: 22px; height: 22px; stroke-width: 2; }
  .m-menu-btn .icon { width: 22px; height: 22px; }
  .m-detail-label { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; color: var(--text-2); }
}

/* ==========================================================================
   Задача (экран 03)
   ========================================================================== */
@media (max-width: 900px) {
  .task-head { margin: 0 0 14px; }
  .task-head-tags { gap: 8px; margin-bottom: 10px; }
  .task-head-tags .tsk-status { display: none; }
  .task-head .tsk-mark {
    height: 28px; padding: 0 12px; font-size: 13px; font-weight: 700;
    background: var(--accent-2-soft); color: var(--orange);
  }
  .task-head .tsk-mark::before { display: none; }
  .task-head .tsk-mark.important { background: var(--amber-soft); color: var(--amber); }
  .task-head .tsk-mark.long, .task-head .tsk-mark.due { background: var(--surface-inset); color: var(--text-2); }
  .task-head .tsk-mark.due.hot { background: var(--accent-2-soft); color: var(--orange); }
  .task-head-row h1 { flex: 1 1 100%; font-size: clamp(22px, 7.2vw, 32px); line-height: 1.15; margin: 0; }
  .task-who { display: block !important; margin-top: 8px; font-size: 14px; color: var(--text-3); }

  /* Путь из четырёх шагов вместо семи кружков */
  .tsk-steps { display: none; }
  .tsk-path {
    display: flex !important; margin: 0 0 var(--m-gap); padding: 16px 8px 14px; list-style: none;
    background: var(--surface); border-radius: 20px; box-shadow: var(--m-card-shadow);
  }
  .tsk-path li {
    position: relative; flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    font-size: clamp(11.5px, 3.3vw, 13.5px); font-weight: 700; color: var(--text-3); text-align: center;
  }
  .tsk-path li:not(:last-child)::after {
    content: ''; position: absolute; top: 11px; left: calc(50% + 14px); right: calc(-50% + 14px);
    height: 3px; border-radius: 2px; background: var(--separator);
  }
  .tsk-path li.done:not(:last-child)::after { background: var(--brand); }
  .tsk-path i {
    width: 24px; height: 24px; border-radius: 50%; background: #eceee6;
    display: flex; align-items: center; justify-content: center; color: #fff;
  }
  .tsk-path i .icon { width: 14px; height: 14px; stroke-width: 3; }
  .tsk-path li.done { color: var(--accent-ink); }
  .tsk-path li.done i { background: var(--brand); }
  .tsk-path li.now { color: var(--text); }
  .tsk-path li.now i { background: #fff; box-shadow: inset 0 0 0 3px var(--accent); }
  .tsk-path li.returned { color: var(--orange); }
  .tsk-path li.returned i { box-shadow: inset 0 0 0 3px var(--accent-2); }

  /* «Ваш ход» на телефоне — нижняя панель и меню «⋯» */
  .tsk-move { display: none; }
  .task-layout { display: block; }
  .task-main, .task-side { display: block; }
  .task-side { display: contents; }
  .task-body { font-size: 16px; line-height: 1.55; }

  .task-thread { gap: 8px; }
  .task-msg { max-width: 86%; padding: 10px 14px; font-size: 16px; line-height: 1.45; border-radius: 16px 16px 16px 4px; }
  .task-msg.mine { border-radius: 16px 16px 4px 16px; }
  .task-msg.system { max-width: none; padding: 2px 6px; font-size: 12.5px; text-align: center; }
  .task-msg-author { font-size: 13px; }
  .task-msg-time { font-size: 12px; }

  /* Нижняя панель: поле сообщения и главное действие шага. Пока поле пустое,
     справа кнопка шага; начали писать — она уступает место «Отправить» */
  #app[data-view="task"] .content { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .tsk-dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    display: flex; align-items: center; gap: 8px;
    padding: 10px max(var(--m-gutter), env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(var(--m-gutter), env(safe-area-inset-left));
    background: var(--surface); border-top: 1px solid var(--separator);
  }
  .tsk-dock input[type="text"] {
    flex: 1; min-width: 0; height: 52px; padding: 0 16px; font-size: 16px;
    border: 0; border-radius: 16px; background: #f1f2ec; box-shadow: none;
  }
  .tsk-dock-attach {
    width: 44px; height: 52px; flex: none; display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-2); cursor: pointer; border-radius: 14px;
  }
  .tsk-dock-attach .icon { width: 22px; height: 22px; }
  .tsk-dock-send {
    width: 52px; height: 52px; flex: none; border: 0; border-radius: 16px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent); color: #fff; cursor: pointer;
  }
  .tsk-dock-send .icon { width: 22px; height: 22px; stroke-width: 2.2; }
  .tsk-dock-next {
    flex: none; max-width: 52%; min-height: 52px; padding: 0 clamp(14px, 4.5vw, 24px);
    border-radius: 16px; font-size: clamp(15px, 4.4vw, 17px); font-weight: 800; white-space: nowrap;
  }
  .tsk-dock.no-say .tsk-dock-next { flex: 1; max-width: none; }
  .tsk-dock:has(.tsk-dock-next) input:placeholder-shown ~ .tsk-dock-send { display: none; }
  .tsk-dock input:not(:placeholder-shown) ~ .tsk-dock-next { display: none; }
  .tsk-dock input:not(:placeholder-shown) ~ .tsk-dock-send { display: inline-flex; }
  /* Пока пишут, скрепка не нужна — полю нужно место */
  .tsk-dock:has(input:not(:placeholder-shown)) .tsk-dock-attach { display: none; }

  /* ---------- Листы снизу: формы и меню действий ---------- */
  .modal { padding: 0; align-items: flex-end; }
  .modal-box {
    max-width: none; width: 100%; max-height: 92vh; max-height: 92dvh;
    border-radius: 26px 26px 0 0; padding-bottom: env(safe-area-inset-bottom);
  }
  .modal-box::before {
    content: ''; display: block; width: 40px; height: 5px; margin: 8px auto 0;
    border-radius: 3px; background: #dadDd2;
  }
  .modal-head { padding: 10px var(--m-pad) 8px; }
  .modal-head h2 { font-size: 22px; }
  .modal-close { border-radius: 14px; background: #f1f2ec; }
  .viewer-box::before { display: none; }

  .action-sheet .sheet-list { display: flex; flex-direction: column; padding: 4px var(--m-pad) 16px; }
  .sheet-item {
    display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 0 4px;
    border: 0; background: none; font: inherit; font-size: 17px; font-weight: 700; color: var(--text);
    text-align: left; cursor: pointer;
  }
  .sheet-item + .sheet-item { border-top: 1px solid var(--separator); }
  .sheet-item.danger { color: var(--red); }
}
@media (max-width: 900px) {
  .task-head .tsk-mark.due { display: inline-flex !important; }
}

/* ==========================================================================
   Формы листом снизу и «Новая задача» (экран 04)
   ========================================================================== */
@media (max-width: 900px) {
  .modal-form { padding: 8px var(--m-pad) 0; }
  .modal-form label { font-size: 15px; font-weight: 700; color: var(--text-2); }
  .modal-form input[type="text"], .modal-form input[type="search"], .modal-form input[type="date"],
  .modal-form input[type="email"], .modal-form input[type="tel"], .modal-form input[type="password"],
  .modal-form input[type="number"], .modal-form select, .modal-form textarea {
    min-height: 52px; font-size: 16px; border-radius: 14px; border-width: 1.5px;
  }
  .form-label { font-size: 15px; font-weight: 700; color: var(--text-2); }
  /* Главная кнопка формы прилипает к низу листа: открытая клавиатура
     сжимает лист, а не прячет кнопку. Закрывает лист крестик сверху */
  .modal-form .form-actions {
    position: sticky; bottom: 0; z-index: 2;
    margin: 8px calc(-1 * var(--m-pad)) 0; padding: 10px var(--m-pad) 14px;
    background: var(--surface);
  }
  .modal-form .form-actions [data-cancel] { display: none; }
  .modal-form .form-actions [type="submit"] {
    flex: 1; min-height: 56px; border-radius: 16px; font-size: 17px; font-weight: 800;
  }

  /* «Кому»: плитки по две, список сжимается вместе с экраном */
  .who-head .form-label { margin: 0; }
  .who-count { font-size: 14px; }
  .tsk-filter { min-height: 48px; border: 0 !important; background: #f1f2ec !important; border-radius: 16px !important; }
  .who-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: min(300px, 32dvh); }
  .who-tile.check-line { min-height: 56px; padding: 8px 28px 8px 10px; gap: 10px; }
  .who-ava { width: 30px; height: 30px; font-size: 12px; }
  .who-text b { font-size: 13.5px; }
  .who-text small { font-size: 11.5px; }
  .who-check { width: 18px; height: 18px; }

  /* Срок и метки — пилюли: выбранная тёмная с белым текстом */
  .tsk-due-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  .tsk-pill, .tsk-flag {
    min-height: 40px; padding: 0 clamp(8px, 2.6vw, 18px); border: 0; border-radius: var(--pill);
    background: #f1f2ec; color: var(--text); font: inherit; font-size: clamp(14.5px, 4.1vw, 16px); font-weight: 600; cursor: pointer;
  }
  .tsk-pill { flex: 1 1 auto; white-space: nowrap; }
  .tsk-pill.on { background: var(--text); color: #fff; }
  .tsk-due-field.hidden { display: none; }
  .tsk-flags { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
  .tsk-flag { justify-content: center; min-height: 44px; }
  .tsk-flag input { position: absolute; opacity: 0; width: 1px; height: 1px; }
  .tsk-flag small { display: none; }
  .tsk-flag b { font-size: 16px; font-weight: 700; }
  .tsk-flag:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }
  .tsk-flag.urgent:has(input:checked), .tsk-flag.important:has(input:checked) {
    border: 0; background: var(--text); color: #fff;
  }
  .tsk-hint { font-size: 14px; }
  .tsk-more { margin-bottom: 8px; }
  .tsk-more > summary {
    min-height: 44px; display: flex; align-items: center; cursor: pointer;
    font-size: 15px; font-weight: 700; color: var(--accent);
  }

  /* На время набора нижнее меню уходит: клавиатура и так съела пол-экрана */
  body:has(input:focus, textarea:focus) .tabbar { display: none; }
}

/* ==========================================================================
   Обучение (экран 05) и тест (экран 06)
   ========================================================================== */
@media (max-width: 900px) {
  #app[data-view="learning"] .page-sub,
  #app[data-view="learning"] .learn-total { display: none; }
  .learn-tabs { display: flex; width: 100%; margin: 4px 0 10px; border-radius: 16px; background: #e9ebe2; }
  .learn-tab { flex: 1; justify-content: center; min-height: 40px; font-size: 15px; font-weight: 700; border-radius: 12px; }

  .lm-list { display: flex; flex-direction: column; gap: var(--m-gap); }
  .lm-card {
    display: flex; flex-direction: column; gap: 14px; width: 100%;
    padding: var(--m-pad); border: 0; border-radius: 20px;
    background: var(--surface); box-shadow: var(--m-card-shadow);
    font: inherit; color: var(--text); text-align: left; cursor: pointer;
  }
  .lm-card.open { cursor: default; gap: 12px; }
  .lm-open-head { padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
  .lm-head { display: flex; align-items: flex-start; gap: 14px; }
  .lm-tile {
    width: clamp(40px, 11.3vw, 48px); height: clamp(40px, 11.3vw, 48px); flex: none; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent);
  }
  .lm-tile.test { background: #fdf0e3; color: #9a4a0b; }
  .lm-tile .icon { width: 22px; height: 22px; }
  .lm-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .lm-head-text b { font-size: clamp(16px, 4.6vw, 19px); font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
  .lm-head-text span { font-size: 14px; color: var(--text-3); }
  .lm-chip {
    flex: none; padding: 4px 10px; border-radius: var(--pill);
    font-size: 13px; font-weight: 700; background: var(--surface-inset); color: var(--text-2);
  }
  .lm-chip.late { background: var(--accent-2-soft); color: var(--orange); }
  .lm-progress { display: flex; align-items: center; gap: 12px; }
  .lm-progress .progress { flex: 1; }
  .lm-progress b { font-size: 15px; font-weight: 800; color: var(--accent-ink); white-space: nowrap; }

  .lm-steps { margin: 0; padding: 0; list-style: none; cursor: pointer; }
  .lm-step {
    display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 8px 0;
    border-top: 1px solid var(--separator); font-size: 16px; color: var(--text-2);
  }
  .lm-step i {
    width: 24px; height: 24px; flex: none; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: #eef0e8; color: var(--text-3);
  }
  .lm-step i .icon { width: 14px; height: 14px; stroke-width: 3; }
  .lm-step span { flex: 1; min-width: 0; }
  .lm-step.done i { background: var(--brand); color: #fff; }
  .lm-step.now { color: var(--text); font-weight: 800; }
  .lm-step.now i { background: #fff; box-shadow: inset 0 0 0 2.5px var(--accent); }
  .lm-step.locked i .icon { stroke-width: 2; }
  .lm-go { width: 18px; height: 18px; color: var(--text-2); }
  .lm-continue { min-height: 52px; border-radius: 16px; font-size: 17px; font-weight: 800; }

  /* ---------- Тест ---------- */
  #app.testing .tabbar { display: none; }
  #app.testing .main { padding-bottom: 0; }
  .test-top { margin: max(8px, env(safe-area-inset-top)) 0 12px; gap: 12px; flex-wrap: nowrap; }
  .test-exit { border-radius: 14px; flex: none; }
  .test-top-count { flex: 1; min-width: 0; font-size: 16px; font-weight: 800; }
  .test-top-rule { flex: none; font-size: 14px; color: var(--text-3); white-space: nowrap; }
  .test-steps { gap: 18px; margin-top: 0; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .test-progress-text { display: none; }
  .test-segs { gap: 5px; }
  .test-segs i { height: 6px; border-radius: 3px; }
  .test-steps .test-q { padding: 0; background: none; box-shadow: none; border-radius: 0; gap: 10px; }
  .test-steps .test-q legend { font-size: clamp(19px, 5.6vw, 24px); line-height: 1.3; margin-bottom: 8px; }
  .test-steps .test-opt { min-height: 60px; padding: 12px 16px; font-size: 16px; border-radius: 16px; }
  .test-steps .test-opt input { width: 24px; height: 24px; }
  .test-note { display: none; }
  .test-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; flex-wrap: nowrap; gap: 10px;
    padding: 12px max(var(--m-gutter), env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(var(--m-gutter), env(safe-area-inset-left));
    background: var(--bg);
  }
  .test-nav #test-prev { width: 56px; min-width: 56px; height: 56px; padding: 0; justify-content: center; border-radius: 16px; }
  .test-nav #test-prev .icon { width: 22px; height: 22px; }
  .test-nav .btn-primary { flex: 1; min-width: 0; min-height: 56px; border-radius: 16px; font-size: 17px; font-weight: 800; }
  .result-card { border-radius: 22px; }
}

/* ==========================================================================
   Материалы (экран 07)
   ========================================================================== */
@media (max-width: 900px) {
  /* Заголовок «Материалы» стоит в шапке над полем поиска: поле живёт вне
     содержимого и не теряет фокус, когда список перерисовывается */
  #app[data-view="common"] .topbar > .m-page-title,
  #app[data-view="all"] .topbar > .m-page-title,
  #app[data-view="category"] .topbar > .m-page-title,
  #app[data-view="folder"] .topbar > .m-page-title {
    display: block !important; flex: 1 1 100%; order: 1; margin: 0;
    font-size: var(--m-title); line-height: 1.1;
  }
  .search-wrap input { box-shadow: var(--m-card-shadow); border: 0; }
  .chips-row { display: none; }

  .mat-pills {
    display: flex !important; gap: 8px; margin: 2px calc(-1 * var(--m-gutter)) 14px;
    padding: 2px var(--m-gutter); overflow-x: auto; scrollbar-width: none;
    scroll-snap-type: x proximity; overscroll-behavior-x: contain;
  }
  .mat-pills::-webkit-scrollbar { display: none; }
  .mat-pill {
    flex: none; min-height: 40px; padding: 0 clamp(14px, 4.3vw, 20px); border: 0; border-radius: var(--pill);
    background: var(--surface); box-shadow: var(--m-card-shadow);
    font: inherit; font-size: 16px; font-weight: 700; color: var(--text); white-space: nowrap; cursor: pointer;
    scroll-snap-align: start;
  }
  .mat-pill.on { background: var(--text); color: #fff; }

  .common-section { margin-bottom: 18px; }
  .common-section-head { margin: 4px 4px 8px; padding: 0; border: 0; gap: 8px; }
  .common-section-head h2 { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }

  /* Папки — плитками по две */
  .folders-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--m-gap); margin-bottom: var(--m-gap); }
  .folder-card {
    flex-direction: column; align-items: flex-start; gap: 10px; min-height: 0;
    padding: var(--m-pad); border: 0; border-radius: 20px; box-shadow: var(--m-card-shadow);
  }
  .folder-icon { width: 36px; height: 36px; border-radius: 10px; }
  .folder-card:nth-child(2n) .folder-icon { background: #fdf0e3; color: #9a4a0b; }
  .folder-name { font-size: 16px; font-weight: 700; }
  .folder-count { font-size: 14px; }
  .folder-actions { position: absolute; top: 8px; right: 8px; }

  /* Файлы — одним списком в белой карточке, строка 64 px */
  .materials-grid {
    display: flex; flex-direction: column; gap: 0; overflow: hidden;
    background: var(--surface); border-radius: 20px; box-shadow: var(--m-card-shadow);
  }
  .materials-grid:empty { display: none; }
  .material-card {
    flex-direction: row; align-items: center; gap: 0; padding: 12px var(--m-pad);
    border: 0; border-radius: 0; box-shadow: none; min-height: 64px;
  }
  .material-card + .material-card { border-top: 1px solid var(--separator); }
  .material-card .card-top { flex: 1; align-items: center; min-width: 0; }
  .material-card .kind-icon { width: 30px; height: 30px; border-radius: 9px; }
  .material-card .kind-icon .icon { width: 16px; height: 16px; }
  .material-card .card-title { font-size: 16px; font-weight: 800; line-height: 1.3; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .material-card .card-meta { font-size: 14px; }
  .material-card .card-foot { display: none; }
  .fresh-chip {
    display: inline-flex !important; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--pill);
    background: var(--accent-2-soft); color: var(--orange); font-size: 12px; font-weight: 800;
  }
}

/* Скрытое остаётся скрытым и в телефонной раскладке: .m-only не должен
   перебивать .hidden, иначе «только на телефоне» значило бы «всегда» */
@media (max-width: 900px) {
  .m-only.hidden { display: none !important; }
}

/* ==========================================================================
   Просмотр документа (экран 08)
   ========================================================================== */
@media (max-width: 900px) {
  #viewer-modal { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  #viewer-modal .viewer-box {
    height: 100vh; height: 100dvh; max-height: none; border-radius: 0;
    background: var(--bg); box-shadow: none; animation: none;
    padding: 0 0 env(safe-area-inset-bottom);
  }
  .viewer-head {
    gap: 12px; border: 0; background: var(--bg);
    padding: max(10px, env(safe-area-inset-top)) var(--m-gutter) 10px;
  }
  .viewer-head .m-back {
    display: inline-flex !important; width: 44px; height: 44px; flex: none;
    border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgba(27, 29, 24, .06);
  }
  .viewer-head .kind-icon { width: 36px; height: 36px; border-radius: 10px; flex: none; }
  .viewer-heading h2, .viewer-head .viewer-heading h2 { font-size: 16px; }
  .viewer-meta { font-size: 13px; }
  /* Справа одна кнопка — «Поделиться» (скопировать ссылку). Доступ,
     «Скачать» и крестик на телефоне живут в других местах */
  .viewer-head .modal-head-actions > *:not(#viewer-copy-link) { display: none !important; }
  #viewer-copy-link {
    width: 44px; height: 44px; padding: 0; justify-content: center;
    border: 0; border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgba(27, 29, 24, .06);
  }
  #viewer-copy-link .icon { width: 20px; height: 20px; }

  .viewer-main { flex: 1; min-height: 0; position: relative; }
  .viewer-body {
    flex: 1; margin: 0 clamp(8px, 2vw, 16px); border-radius: 20px;
    background: var(--surface); box-shadow: var(--m-card-shadow);
  }
  .viewer-body iframe { height: 100%; min-height: 60vh; }
  .viewer-doc { padding: 22px clamp(16px, 5vw, 28px); font-size: 16px; line-height: 1.6; }

  /* Заглушка вместо предпросмотра: кнопки в столбик во всю ширину.
     Это единственный путь к файлу, когда показать его нельзя, — промахнуться
     по ним пальцем нельзя */
  .viewer-stub { padding: 36px var(--m-gutter) 40px; }
  .viewer-stub-actions { flex-direction: column; }
  .viewer-stub-btn { width: 100%; min-height: 52px; }

  /* Комментарии — лист снизу поверх документа */
  .viewer-comments { display: none; }
  #viewer-modal.show-comments .viewer-comments {
    display: flex; flex-direction: column;
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; max-height: 75%;
    padding: 18px var(--m-pad) 14px; border: 0; border-radius: 26px 26px 0 0;
    background: var(--surface); box-shadow: 0 -12px 32px rgba(27, 29, 24, .16);
  }
  #viewer-modal.show-comments #comments-list { flex: 1; overflow-y: auto; }
  .viewer-comments h3 { font-size: 20px; }

  .viewer-course {
    display: flex !important; align-items: center; gap: 12px;
    margin: 10px clamp(8px, 2vw, 16px) 0; padding: 12px clamp(12px, 4vw, 18px);
    border-radius: 18px; background: var(--accent-soft);
  }
  .viewer-course.hidden { display: none !important; }
  .viewer-course-text { flex: 1; min-width: 0; font-size: 15px; color: var(--accent-ink); line-height: 1.35; }
  .viewer-course-text b { font-weight: 800; }
  .viewer-course .btn { flex: none; min-height: 44px; border-radius: 14px; font-size: 16px; font-weight: 800; gap: 6px; }
  .viewer-course-done { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--accent-ink); }
  .viewer-course .icon { width: 18px; height: 18px; stroke-width: 2.4; }

  .viewer-dock {
    display: flex !important; margin-top: 10px; padding: 4px 8px;
    background: var(--surface); border-top: 1px solid var(--separator);
  }
  .viewer-dock-btn {
    flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; font: inherit; font-size: clamp(12px, 3.4vw, 14px); font-weight: 700;
    color: var(--text-2); text-decoration: none; cursor: pointer;
  }
  .viewer-dock-btn .icon { width: 22px; height: 22px; }
  .viewer-dock-btn.on { color: #8a5a00; }
  .viewer-dock-btn.on .icon { fill: #b7791f; stroke: #b7791f; }
  .viewer-dock-btn.hidden { display: none; }
}
@media (max-width: 900px) {
  .viewer-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .viewer-doc, .viewer-text, .viewer-loading { overflow-wrap: anywhere; }
}

/* ==========================================================================
   Вход (экран 10) и мелочи «Ещё»
   ========================================================================== */
@media (max-width: 900px) {
  .login-screen { flex-direction: column; flex-wrap: nowrap; min-height: 100vh; min-height: 100dvh; }
  .login-brand {
    flex: none; justify-content: flex-start; gap: clamp(14px, 4vw, 22px);
    padding: max(clamp(48px, 14vw, 72px), env(safe-area-inset-top)) var(--m-gutter) clamp(36px, 10vw, 56px) calc(var(--m-gutter) + 8px);
  }
  .login-brand::before { right: -80px; top: -100px; width: min(300px, 75vw); height: min(300px, 75vw); background: #3a6620; }
  .login-brand::after { left: auto; right: clamp(20px, 10vw, 60px); bottom: -45px; width: 90px; height: 90px; background: var(--brand); }
  .login-logo .brand-word { font-size: clamp(28px, 8.7vw, 38px); }
  .login-logo .brand-tag { font-size: 13px; }
  .login-pitch-title { font-size: clamp(20px, 5.9vw, 26px); line-height: 1.25; max-width: 16em; }
  .login-card {
    flex: 1; display: flex; flex-direction: column; align-self: stretch;
    padding: clamp(24px, 7vw, 36px) var(--m-gutter) max(20px, env(safe-area-inset-bottom)) calc(var(--m-gutter) + 8px);
  }
  .login-card h1 { font-size: var(--m-title); margin-bottom: 20px; }
  /* Подписи — над полями, а не внутри: так их видно, когда поле заполнено */
  .login-card .field { display: flex; flex-direction: column-reverse; gap: 8px; }
  .login-card .field label {
    position: static; transform: none !important; color: var(--text-2) !important;
    font-size: 15px; font-weight: 700; pointer-events: auto;
  }
  .login-card .field input {
    min-height: 54px; padding: 0 16px; border-radius: 16px; font-size: 17px;
    background: var(--surface); border: 1.5px solid var(--separator-strong);
  }
  .login-card .field-stack { gap: 16px; }
  .login-card [type="submit"] { margin-top: auto; min-height: 56px; border-radius: 16px; font-size: 17px; font-weight: 800; }
  .login-forgot { display: block !important; margin: 14px 0 0; text-align: center; font-size: 14px; color: var(--text-3); }

  .more-item .more-go { display: none; }
}
@media (max-width: 900px) {
  /* Пять пунктов делят ширину поровну даже на 320 px: у кнопки нет своего
     минимума, пилюля и подпись ужимаются вместе с ней */
  .tab-item { min-width: 0; padding: 0; }
  .tab-pill { width: min(56px, 100%); }
  .tab-item > span:not(.tab-pill) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- Мои телефоны и приложение для телефона ---------- */
@media (max-width: 900px) {
  /* «Отозвать» стоит под датами, в столбце текста: рядом с именем ему на
     узком экране не хватило бы места, а уезжать на свою строку то справа,
     то слева в зависимости от длины имени он не должен */
  .phone-row {
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start;
    gap: 10px clamp(10px, 3vw, 14px); padding: clamp(12px, 3.5vw, 16px) 0;
  }
  .phone-ico { width: clamp(36px, 10.5vw, 44px); height: clamp(36px, 10.5vw, 44px); border-radius: 12px; }
  .phone-text b { font-size: clamp(15px, 4.2vw, 17px); }
  .phone-text span { font-size: clamp(13px, 3.5vw, 14px); }
  .phone-revoke { grid-column: 2; justify-self: start; min-height: 44px; }
  .phone-foot { flex-direction: column; align-items: stretch; }
  .phone-foot .btn { min-height: var(--m-tap); justify-content: center; }
  .phone-hint { font-size: clamp(13px, 3.5vw, 14px); }

  .app-get { display: flex; width: 100%; min-height: var(--m-tap); justify-content: center; border-radius: 16px; font-size: 16px; }
  .app-steps { padding-left: 1.2em; font-size: clamp(14px, 4vw, 16px); }
  .app-steps li + li { margin-top: 6px; }
  .app-cert { padding: clamp(10px, 3vw, 14px); border-radius: 14px; }
  .app-cert code { font-size: clamp(11px, 3.1vw, 13px); }
}
