/* ==================================================================
   Экран «Сегодня» на телефоне — по макету «Мобильное приложение iOS».

   Отдельный слой: на мониторе его нет вовсе. Цвета системные — синий
   действия, красный опасное, зелёный успех; группы с заголовком
   заглавными; строка — это объект, кнопок в строке нет.
   ================================================================== */
.ios { display: none; }

@media (max-width: 860px) {
  .ios { display: block; }
  /*  Настольная разметка сводки на телефоне не показывается  */
  .dash-head, .split3, .dash-contracts, .dash-now, .dash-money,
  .dash-pretrial, .mob-context { display: none !important; }

  .ios {
    --blue: #168f89;          /* действие */
    --red: #ff3b30;           /* опасное */
    --green: #34c759;         /* успех */
    --grey: #8a8a8e;          /* вторичный текст */
    --sep: #e5e5ea;           /* разделитель */
    --fill: #f2f2f7;          /* фон групп */
    font-family: var(--font-tnr);
    color: #000;
    margin: 0 -16px;
    padding: 0 0 8px;
  }

  .ios-title { font-size: 32px; font-weight: 700; letter-spacing: -0.03em;
    margin: 4px 16px 0; }
  .ios-sub { font-size: 14px; color: var(--grey); margin: 2px 16px 14px; }

  /*  Переключатель «Все · Мои · Маши» вместо строки меток  */
  .ios-seg { display: flex; gap: 2px; margin: 0 16px 18px; padding: 2px;
    background: var(--fill); border-radius: 9px; }
  .ios-seg a { flex: 1 1 0; text-align: center; padding: 7px 4px;
    font-size: 14px; font-weight: 500; color: #000; text-decoration: none;
    border-radius: 7px; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; }
  .ios-seg a.on { background: #fff; font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,.12); }

  /*  Заголовок группы: 13/600 заглавными, действие справа синим  */
  .ios-head { display: flex; align-items: baseline; justify-content: space-between;
    padding: 0 16px 7px; margin-top: 22px; }
  .ios-head span { font-size: 13px; font-weight: 600; letter-spacing: .04em;
    text-transform: uppercase; color: var(--grey); }
  .ios-head a { font-size: 15px; font-weight: 600; color: var(--blue);
    text-decoration: none; white-space: nowrap; }

  /*  Группа строк: белая карточка, разделитель с отступом слева  */
  .ios-list { list-style: none; margin: 0; padding: 0; background: #fff;
    border-radius: 14px; overflow: hidden; margin-inline: 16px; }
  .ios-list > li { position: relative; display: flex; align-items: stretch; }
  .ios-list > li + li::before { content: ""; position: absolute; left: 14px;
    right: 0; top: 0; height: 1px; background: var(--sep); }

  .ios-row { flex: 1 1 auto; display: flex; align-items: flex-start; gap: 12px;
    padding: 11px 14px; min-height: 44px; text-decoration: none; color: inherit; }
  .ios-row:active { background: var(--fill); }

  .ios-time { flex: 0 0 62px; display: flex; flex-direction: column;
    font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
  .ios-time em { font-style: normal; font-size: 12px; font-weight: 400;
    color: var(--grey); }

  .ios-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column;
    gap: 2px; }
  .ios-badge { align-self: flex-start; font-size: 12px; font-weight: 600;
    padding: 2px 7px; border-radius: 6px; background: #e8f0ff; color: #0a58d0; }
  .ios-badge.is-call { background: #efe9ff; color: #5a3ec8; }
  /*  Две строки максимум: длинное название задачи раздувало строку
      до трёхсот пикселей, и пять задач занимали два экрана  */
  .ios-name { font-size: 16px; font-weight: 600; line-height: 1.25;
    overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden; }
  .ios-note { font-size: 13.5px; color: var(--grey); line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; }

  .ios-sum { flex: 0 0 auto; align-self: center; font-size: 16px; font-weight: 600;
    font-variant-numeric: tabular-nums; white-space: nowrap; }
  .ios-sum.is-late { color: var(--red); }
  .ios-sum.is-ok { color: var(--green); }

  .ios-meta { flex: 0 0 auto; align-self: center; font-size: 13px; color: var(--grey);
    white-space: nowrap; }
  .ios-meta.is-late { color: var(--red); font-weight: 600; }

  .ios-chev { flex: 0 0 auto; align-self: center; color: #c4c4c7; font-size: 20px;
    line-height: 1; }
  .ios-empty { display: block; padding: 14px; color: var(--grey); font-size: 15px; }
  .ios-row.is-link .ios-name { color: var(--blue); font-weight: 600; }

  /*  Кружок выполнения слева, как в «Напоминаниях»  */
  .ios-tick { flex: 0 0 auto; display: flex; align-items: center; padding-left: 14px; }
  .ios-tick button { width: 24px; height: 24px; min-height: 24px; padding: 0;
    border: 1.6px solid #c4c4c7; border-radius: 50%; background: #fff; }
  .ios-tick button:active { background: var(--fill); }
  .ios-row.is-task { padding-left: 10px; }

  /*  Календарь месяца внутри карточки  */
  .ios-card { background: #fff; border-radius: 14px; margin-inline: 16px;
    padding: 10px 12px; overflow-x: auto; }
  /*  Календарь месяца — сеткой чисел, без списка событий в клетках:
      иначе карточка вырастает на два экрана  */
  /*  Календарь показывается целиком: обрезка прятала последнюю неделю,
      и до неё нельзя было домотать  */
  .ios-cal { max-height: none; overflow: visible; }
  .ios-cal .cal-head, .ios-cal .cal-filters, .ios-cal .calm-add,
  .ios-cal .calm-evs, .ios-cal .calm-more, .ios-cal .cal-legend { display: none; }
  .ios-cal .cal td, .ios-cal .calm-day { height: auto; min-height: 34px;
    padding: 2px; }
  .ios-cal .calm-num { font-size: 15px; font-weight: 500; }
}

/* ==================================================================
   Действия по строке: свайп влево открывает кнопки.

   Кнопки внутри строки на узком экране переносились на вторую строку и
   ломали высоту, поэтому они спрятаны под строкой — как в «Почте» и
   «Напоминаниях». Чтобы приём был заметен, после загрузки первая строка
   каждого списка один раз приоткрывается и возвращается назад.
   ================================================================== */
@media (max-width: 860px) {
  .ios-swipe { position: relative; overflow: hidden; }
  /*  Кнопки под строкой видны только во время свайпа и в открытой строке.
      Иначе при быстрой прокрутке телефон не успевал дорисовать белую
      строку, и жёлтые и красные кнопки мелькали сквозь неё  */
  .ios-acts {
    position: absolute; right: 0; top: 0; bottom: 0; display: flex;
    align-items: stretch;
    visibility: hidden; transition: visibility 0s linear .2s;
  }
  .ios-swipe.open > .ios-acts, .ios-swipe.peek > .ios-acts,
  .ios-swipe.drag > .ios-acts { visibility: visible; transition: none; }
  /*  Вертикаль — браузеру, горизонталь — нашему свайпу: прокрутка не ждёт жеста  */
  .ios-swipe { touch-action: pan-y; }
  .ios-swipe.drag > .ios-row, .ios-swipe.drag > .ios-tick { transition: none; }
  .ios-acts form, .ios-acts a { display: flex; }
  .ios-acts button, .ios-acts a {
    border: 0; min-width: 84px; padding: 0 14px; font-size: 15px;
    font-weight: 600; color: #fff; background: var(--grey);
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; border-radius: 0; min-height: 100%;
  }
  .ios-acts .act-skip button { background: #ff9500; }
  .ios-acts .act-edit { background: var(--blue); }
  .ios-acts .act-del button { background: var(--red); }

  /*  Сама строка едет поверх кнопок  */
  .ios-swipe > .ios-row, .ios-swipe > .ios-tick {
    position: relative; z-index: 1; background: #fff;
    transition: transform .2s cubic-bezier(.2, .8, .2, 1);
  }
  .ios-swipe.open > .ios-row, .ios-swipe.open > .ios-tick {
    transform: translateX(var(--acts, -168px));
  }
  /*  Подсказка при первом показе: строка приоткрывается и возвращается  */
  .ios-swipe.peek > .ios-row, .ios-swipe.peek > .ios-tick {
    transform: translateX(-26px);
  }
}

/*  Счётчик в заголовке группы — серым, не ссылкой  */
@media (max-width: 860px) {
  .ios-count { font-size: 15px; font-weight: 400; color: var(--grey);
    text-transform: none; letter-spacing: 0; }
}

/* ==================================================================
   Остальные разделы на телефоне: убираем управление с экрана списка.

   Выгрузки, архивы прошлых лет, формы заведения и поля отбора нужны
   на мониторе. На телефоне они занимают первые два экрана, и до данных
   человек не доходит. Всё это открывается кнопками в шапке: «⌕» и «＋».
   ================================================================== */
@media (max-width: 860px) {
  /*  Выгрузки и загрузки файлов  */
  .excel-line, .refresh-line, .sources,
  form[action*="export"], a[href*="export.xlsx"], a[href*="/export"],
  form[action*="sync-edo"], form[action*="/import"] { display: none !important; }

  /*  Переключатель архивных лет  */
  .year-switch, .years-line { display: none !important; }

  /*  Плашки «Добавить …» и «Настройки»: заводить — кнопкой «＋» в шапке  */
  details.panel.add-any, details.add-act,
  details.panel > summary[class*="add"], .panel > details[open] > summary { }
  main > details.panel:has(> summary:first-child) { }

  /*  Пояснительные абзацы под заголовком: на телефоне это стена текста  */
  .page-sub + p.small.muted, h1 + p.small.muted,
  .page-desc, .help-text, .desc-under { display: none; }

  /*  Поля отбора в потоке страницы  */
  main > form.inline:not(.search-form):not(.filters-form) { display: none; }
}

/*  Третья кнопка действия — «Открыть»: серо-синяя, как в iOS  */
@media (max-width: 860px) {
  .ios-acts .act-open { background: #5856d6; }
}

/*  Три цифры по деньгам: кегль 30, как в макете  */
@media (max-width: 860px) {
  .ios-big { flex: 0 0 auto; align-self: center; font-size: 26px; font-weight: 700;
    letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .ios-big.is-late { color: var(--red); }
  .ios-big.is-ok { color: var(--green); }
  .ios-nums .ios-row { padding-top: 14px; padding-bottom: 14px; }
}

/* ==================================================================
   Списки на «Сегодня» листаются внутри карточки.

   Показывать пять строк и прятать остальное за ссылкой оказалось мало:
   чтобы увидеть шестое заседание, приходилось уходить в другой раздел.
   Теперь в карточке двенадцать записей, она высотой в пять строк и
   листается сама — с видимой полосой справа, чтобы это было заметно.
   ================================================================== */
@media (max-width: 860px) {
  .ios-scroll {
    max-height: 62vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /*  Прокрутка списка не «протекает» на страницу и наоборот  */
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  /*  Полоса видна всегда, а не только в движении: иначе непонятно,
      что список можно листать  */
  .ios-scroll::-webkit-scrollbar { width: 5px; }
  .ios-scroll::-webkit-scrollbar-thumb {
    background: #c4c4c7; border-radius: 3px;
  }
  .ios-scroll::-webkit-scrollbar-track { background: transparent; }
  /*  Тень у нижнего края подсказывает, что под ней ещё записи  */
  .ios-scroll { position: relative; }
  .ios-list.ios-scroll::after {
    content: ""; position: sticky; bottom: 0; left: 0; right: 0;
    display: block; height: 18px; margin-top: -18px;
    background: linear-gradient(transparent, rgba(255,255,255,.96));
    pointer-events: none;
  }
}

/* ==================================================================
   Экраны телефона: Входящие, Дела, Сводка, заявки ЛОГИКА, карточка дела.
   Тот же язык, что у «Сегодня»: группа — белая карточка, строка — объект,
   цвет только по смыслу
   ================================================================== */
@media (max-width: 860px) {
  /*  Оранжевый и зелёный для текста темнее системных: #ff9500 и #34c759
      на белом читаются плохо (контраст около 2:1)  */
  .ios { --orange: #b86200; --green-ink: #1f7a3c; }

  /*  Число на вкладке «Входящие»  */
  .tabbar a { position: relative; }
  .tabbar .tab-n { position: absolute; top: 4px; left: calc(50% + 5px);
    min-width: 16px; padding: 0 5px; border-radius: 9px; background: #ff3b30;
    color: #fff; font-size: 10.5px; line-height: 16px; font-weight: 600;
    text-align: center; font-family: -apple-system, system-ui, sans-serif; }

  /*  Непрочитанное — синяя точка слева  */
  .ios-dot { flex: 0 0 8px; height: 8px; border-radius: 50%;
    background: var(--blue); margin-top: 7px; }
  .ios-dot.is-off { background: transparent; }

  .ios-badge.is-mail { background: #e3f7e8; color: #1f7a3c; }
  .ios-badge.is-req { background: #fff2dc; color: #a35d00; }
  .ios-badge.is-red { background: #ffe9e7; color: #c4271f; }
  .ios-badge.is-green { background: #e3f7e8; color: #1f7a3c; }

  .ios-meta.is-warn { color: var(--orange); font-weight: 600; }
  .ios-meta.is-ok { color: var(--green-ink); font-weight: 600; }
  .ios-sum.is-in { color: var(--green-ink); }
  .ios-meta.is-link { color: var(--blue); font-weight: 600; }
  .ios-danger { color: var(--red); }

  .ios-hint { font-size: 13px; color: var(--grey); margin: 10px 16px 0; }
  .ios-back { margin: -8px 16px -6px; }
  /*  Палец должен попадать: высота строки 44 px, как у кнопок iOS  */
  .ios-back a { display: inline-flex; align-items: center; min-height: 44px;
    padding-right: 16px; color: var(--blue); font-size: 17px; text-decoration: none; }
  .ios-title-s { font-size: 24px; }
  .ios-stage { display: inline-block; margin: -6px 16px 0; padding: 2px 8px;
    border-radius: 6px; background: #e8f0ff; color: #0a58d0;
    font-size: 12.5px; font-weight: 600; }

  /*  Поиск — серое поле во всю ширину, как в iOS  */
  .ios-srch { margin: 0 16px 6px; }
  .ios-srch input { width: 100%; box-sizing: border-box; border: 0;
    border-radius: 10px; background: #e3e3e8; padding: 9px 12px;
    font: 16px var(--font-tnr); color: #000; }

  /*  Справка «поле — значение»  */
  .ios-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px;
    margin-block: 0; }
  .ios-kv dt { font-size: 13.5px; color: var(--grey); }
  .ios-kv dd { margin: 0; font-size: 15px; overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums; }
  .ios-text { font-size: 15px; line-height: 1.4; white-space: pre-line; }
  .ios-text-s { font-size: 15px; line-height: 1.35; white-space: pre-line;
    overflow-wrap: anywhere; }

  /*  Кнопки действий рядом: одна строка, переносятся при нехватке места  */
  .ios-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 16px; }
  .ios-btns form { flex: 1 1 30%; display: flex; }
  .ios-btns button { flex: 1; min-height: 44px; display: flex; align-items: center;
    justify-content: center; text-align: center; border: 0; border-radius: 10px;
    background: #fff; color: var(--blue); font: 600 14.5px var(--font-tnr);
    box-shadow: none; padding: 8px 6px; line-height: 1.2; }
  .ios-btns button.is-danger { color: var(--red); }
  .ios-btns button:active { background: var(--fill); }

  .ios-note-form { display: flex; flex-direction: column; gap: 8px; }
  .ios-note-form textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--sep);
    border-radius: 10px; padding: 8px 10px; font: 15px var(--font-tnr); resize: vertical; }
  .ios-note-form button { align-self: flex-end; border: 0; border-radius: 10px;
    background: var(--blue); color: #fff; font: 600 15px var(--font-tnr);
    padding: 8px 16px; box-shadow: none; }

  /*  Клиент → его дела: свёрнутая группа  */
  .ios-group { margin-top: 8px; }
  .ios-group > summary { list-style: none; display: flex; justify-content: space-between;
    align-items: center; margin: 0 16px; padding: 11px 14px; background: #fff;
    border-radius: 14px; font-size: 16px; font-weight: 600; cursor: pointer; }
  .ios-group > summary::-webkit-details-marker { display: none; }
  .ios-group > summary::after { content: "›"; color: #c4c4c7; font-size: 20px;
    margin-left: 8px; transition: transform .15s; }
  .ios-group[open] > summary::after { transform: rotate(90deg); }
  .ios-group[open] > summary { border-radius: 14px 14px 0 0; }
  .ios-group[open] > .ios-list { border-radius: 0 0 14px 14px; }
  .ios-group > summary .ios-count { margin-left: auto; }
  .ios-rest { margin-top: 22px; }
  /*  Выбор галочкой, как в настройках iOS: вся строка — нажатие  */
  .ios-checks .ios-row { align-items: center; cursor: pointer; }
  .ios-checks input { position: absolute; opacity: 0; pointer-events: none; }
  .ios-mark { flex: 0 0 22px; height: 22px; border-radius: 50%;
    border: 1.6px solid #c4c4c7; }
  .ios-checks input:checked ~ .ios-mark { border-color: var(--blue);
    background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
  .ios-checks input:focus-visible ~ .ios-mark { outline: 2px solid var(--blue); outline-offset: 2px; }

  .ios-btns-top { margin-top: 10px; }
  .ios-form-full { border-radius: 14px; }
  .ios-gap { margin-top: 14px; }
  /*  «Срочная» — переключатель строкой, а не выпадающий список из двух слов  */
  .ios-form .ios-switch { flex-direction: row; align-items: center; justify-content: space-between;
    font-size: 16px; color: #000; min-height: 44px; }
  .ios-form .ios-switch input[type=checkbox] { order: 2; width: 51px; min-height: 31px; height: 31px;
    flex: 0 0 51px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 16px;
    background: #e3e3e8; position: relative; padding: 0; cursor: pointer; transition: background .2s; }
  .ios-form .ios-switch input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px;
    width: 27px; height: 27px; border-radius: 50%; background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
  .ios-form .ios-switch input[type=checkbox]:checked { background: #34c759; }
  .ios-form .ios-switch input[type=checkbox]:checked::after { transform: translateX(20px); }
  .ios-btns button.is-on { background: var(--blue); color: #fff; }
  .ios-btns button.is-plain { background: transparent; }

  .ios-warn { background: #fff4e0; font-size: 15px; line-height: 1.4; margin-top: 12px; }
  .ios-warn form { margin-top: 8px; }
  .ios-warn button { border: 0; border-radius: 10px; background: #fff; color: var(--blue);
    font: 600 15px var(--font-tnr); padding: 8px 12px; box-shadow: none; }

  /*  Форма внутри карточки: подпись над полем, поля во всю ширину  */
  .ios-form { display: flex; flex-direction: column; gap: 12px; border-radius: 0 0 14px 14px;
    margin-top: 0; }
  .ios-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px;
    color: var(--grey); }
  .ios-form input, .ios-form select, .ios-form textarea { width: 100%; box-sizing: border-box;
    min-height: 42px; border: 1px solid var(--sep); border-radius: 10px; padding: 8px 10px;
    font: 16px var(--font-tnr); color: #000; background: #fff; }
  .ios-form button { align-self: stretch; min-height: 44px; display: flex; align-items: center;
    justify-content: center; border: 0; border-radius: 10px;
    background: var(--blue); color: #fff; font: 600 16px var(--font-tnr); box-shadow: none; }

  /*  Карточка дела-справка: свой «‹ Дела», крошки и скрепка сверху лишние  */
  main:has(> .ios) > .crumbs { display: none; }
  .ios-rest > summary { color: var(--grey); font-weight: 500; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .ios-group > summary::after { transition: none; }
}

/* ==================================================================
   Вкладки телефона: Расписание · Задачи · Дела · ЛОГИКА · Ещё (29.09).
   Приёмы iOS: крупный заголовок, сгруппированные списки, переключатель,
   «пилюли» отбора, цветная полоска вида записи (суд — красная,
   встреча — синяя, звонок — зелёная), карточка заседания крупно.
   ================================================================== */
@media (max-width: 860px) {
  .ios { --orange: #ff9500; --indigo: #5856d6; }
  .m-red { color: var(--red); font-weight: 600; }

  /*  «Пилюли» отбора — строкой с прокруткой вбок  */
  .m-chips { display: flex; flex-wrap: nowrap !important; gap: 8px; overflow-x: auto; padding: 0 16px 4px;
    margin: -6px 0 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .m-chips::-webkit-scrollbar { display: none; }
  .m-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 13px; border-radius: 999px; background: #fff; color: #000;
    font-size: 14px; font-weight: 500; text-decoration: none;
    box-shadow: inset 0 0 0 1px var(--sep); }
  .m-chip span { color: var(--grey); font-weight: 400; font-variant-numeric: tabular-nums; }
  .m-chip.on { background: #000; color: #fff; box-shadow: none; }
  .m-chip.on span { color: rgba(255,255,255,.7); }
  .m-chip.k-court::before, .m-chip.k-meet::before, .m-chip.k-call::before {
    content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
  .m-chip.k-meet::before { background: var(--blue); }
  .m-chip.k-call::before { background: var(--green); }
  .m-chip.k-late.on { background: var(--red); }

  .m-seg-main a { font-size: 15px; padding: 8px 4px; }
  .m-seg-n { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 2px;
    border-radius: 9px; background: var(--red); color: #fff; font-size: 12px;
    line-height: 18px; font-weight: 600; }

  /*  Напоминание наверху (заседания без итога)  */
  .m-alert { display: flex; align-items: center; gap: 12px; margin: 0 16px 14px;
    padding: 11px 14px; border-radius: 14px; background: #fff4e5; color: inherit;
    text-decoration: none; }
  .m-alert-ico { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--orange);
    color: #fff; font-weight: 700; display: grid; place-items: center; }

  /*  Полоса двух недель, как в «Календаре» iOS  */
  .m-strip { display: flex; flex-wrap: nowrap; gap: 4px; overflow-x: auto; padding: 0 16px 2px;
    scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: 16px; }
  .m-strip::-webkit-scrollbar { display: none; }
  .m-day { flex: 0 0 44px; scroll-snap-align: start; display: flex; flex-direction: column;
    align-items: center; gap: 2px; padding: 6px 0 7px; border-radius: 12px;
    text-decoration: none; color: #000; }
  .m-day-wd { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--grey); }
  .m-day b { font-size: 19px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
  .m-day.is-wknd b { color: var(--grey); }
  .m-day.is-off b { color: #c4c4c7; }
  .m-day.is-today { background: var(--red); }
  .m-day.is-today b, .m-day.is-today .m-day-wd { color: #fff; }
  .m-day-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
  .m-day-dot.is-court { background: var(--red); }
  .m-day.is-today .m-day-dot { background: #fff; }
  .m-daysec { scroll-margin-top: 64px; }

  /*  Строка записи расписания: время · полоска вида · что и где  */
  .m-ev-row { flex: 1 1 auto; display: flex; align-items: stretch; gap: 10px;
    padding: 11px 12px 11px 14px; min-height: 60px; color: inherit; text-decoration: none; }
  .m-ev-row:active { background: var(--fill); }
  .m-ev-time { flex: 0 0 46px; display: flex; flex-direction: column; padding-top: 1px;
    font-variant-numeric: tabular-nums; }
  .m-ev-time b { font-size: 16px; font-weight: 600; }
  .m-ev-time em { font-style: normal; font-size: 13px; color: var(--grey); }
  .m-ev-bar { flex: 0 0 4px; border-radius: 2px; background: var(--blue); }
  .k-court .m-ev-bar { background: var(--red); }
  .k-call .m-ev-bar { background: var(--green); }
  .m-ev-kind { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--blue); }
  .k-court .m-ev-kind { color: var(--red); }
  .k-call .m-ev-kind { color: #248a3d; }
  .m-ev-place { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px;
    font-size: 14px; color: #3a3a3c; line-height: 1.3; }
  /*  Кабинет — главное, что ищут у здания суда  */
  .m-room { flex: 0 0 auto; padding: 1px 7px; border-radius: 6px; background: #fdecea;
    color: #c4271c; font-size: 14px; font-weight: 700; }
  .m-ev-row.is-past { opacity: .45; }
  .m-ev-row.is-skip .ios-name { text-decoration: line-through; color: var(--grey); }
  .m-more { margin-top: 18px; }

  /*  Задачи  */
  .m-head-red span { color: var(--red); }
  .m-flag { color: var(--red); font-weight: 800; }
  .m-kind { align-self: flex-start; font-size: 12px; font-weight: 600; padding: 2px 7px;
    border-radius: 6px; background: #efe9ff; color: #5a3ec8; }
  .m-done-all { text-align: center; padding: 40px 16px; color: var(--grey); }
  .m-done-ico { display: inline-grid; place-items: center; width: 56px; height: 56px;
    border-radius: 50%; background: #e8f8ec; color: var(--green); font-size: 28px; font-weight: 700; }
  .m-done-all p { margin: 10px 0 0; font-size: 16px; }

  /*  Дела: дата ближайшего суда справа  */
  .m-case-stage { font-size: 12.5px; color: var(--grey); }
  .m-when { flex: 0 0 auto; align-self: center; display: flex; flex-direction: column;
    align-items: flex-end; padding: 4px 8px; border-radius: 9px; background: var(--fill);
    font-variant-numeric: tabular-nums; }
  .m-when b { font-size: 13.5px; font-weight: 600; }
  .m-when em { font-style: normal; font-size: 12.5px; color: var(--grey); }
  .m-when.is-soon { background: #fff4e5; }
  .m-when.is-today { background: var(--red); }
  .m-when.is-today b, .m-when.is-today em { color: #fff; }

  /*  Карточка дела  */
  .m-case-head { padding: 0 16px; }
  .m-case-head .ios-title { margin-inline: 0; }
  .m-case-parties { display: flex; align-items: baseline; justify-content: space-between;
    gap: 10px; margin: 6px 0 0; font-size: 15px; }
  .m-case-parties b { font-weight: 600; min-width: 0; }
  .m-case-parties span { flex: 0 0 auto; font-size: 13px; color: var(--grey); }
  .m-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
  .m-pill { padding: 3px 9px; border-radius: 999px; background: #e8f0ff; color: #0a58d0;
    font-size: 13px; font-weight: 600; }
  .m-pill.is-soft { background: var(--fill); color: #3a3a3c; font-weight: 500; }

  .m-hero { margin: 16px 16px 0; padding: 16px; border-radius: 18px; background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06); }
  .m-hero-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .m-hero-kind { font-size: 13px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .04em; color: var(--red); }
  .m-hero.is-empty .m-hero-kind { color: var(--grey); }
  .m-hero-left { font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
    background: var(--fill); color: #3a3a3c; white-space: nowrap; }
  .m-hero-left.is-now { background: var(--red); color: #fff; }
  .m-hero-when { display: flex; align-items: center; gap: 14px; margin: 8px 0 2px; }
  .m-hero-time { font-size: 46px; font-weight: 700; letter-spacing: -.03em; line-height: 1;
    font-variant-numeric: tabular-nums; }
  .m-hero-date { font-size: 17px; font-weight: 600; line-height: 1.2; }
  .m-hero-date em { font-style: normal; font-weight: 400; color: var(--grey); font-size: 15px; }
  .m-hero-tz { margin: 4px 0 0; font-size: 13px; color: var(--orange); font-weight: 600; }
  .m-hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 14px 0 0; }
  .m-hero-grid > div { min-width: 0; }
  .m-hero-grid dt { font-size: 12px; color: var(--grey); margin: 0; }
  .m-hero-grid dd { margin: 1px 0 0; font-size: 15px; font-weight: 500; line-height: 1.3;
    overflow-wrap: anywhere; }
  /*  Кабинет — крупно и цветом, во всю ширину первой строки  */
  .m-hero-room { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px;
    padding: 10px 12px; border-radius: 12px; background: #fdecea; }
  .m-hero-room dt { color: #c4271c; font-size: 14px; font-weight: 600; }
  .m-hero-room dd { font-size: 28px; font-weight: 700; color: #c4271c; letter-spacing: -.02em;
    font-variant-numeric: tabular-nums; }
  .m-hero-desc { margin: 12px 0 0; font-size: 14px; color: #3a3a3c; line-height: 1.35; }
  .m-prep { margin-top: 14px; font-size: 13px; color: var(--grey); }
  .m-prep i { display: block; height: 6px; margin-top: 5px; border-radius: 3px;
    background: linear-gradient(90deg, var(--green) var(--p), var(--fill) var(--p)); }
  .m-hero-btns { display: flex; gap: 8px; margin-top: 14px; }
  .m-btn { flex: 1 1 0; text-align: center; padding: 10px 6px; border-radius: 11px;
    background: var(--fill); color: var(--blue); font-size: 15px; font-weight: 600;
    text-decoration: none; white-space: nowrap; }
  .m-btn.is-primary { background: var(--blue); color: #fff; }
  .m-hero-next { display: block; margin-top: 12px; font-size: 14px; color: var(--blue);
    text-decoration: none; }

  .m-done summary { color: var(--green); }
  .m-done-row { align-items: center; }
  .m-check { flex: 0 0 24px; height: 24px; border-radius: 50%; background: var(--green);
    color: #fff; font-size: 14px; font-weight: 700; display: grid; place-items: center; }
  .m-done-row .ios-name { color: var(--grey); font-weight: 500; }

  .m-act-date { flex: 0 0 40px; display: flex; flex-direction: column; align-items: center;
    padding-top: 1px; font-variant-numeric: tabular-nums; }
  .m-act-date b { font-size: 19px; font-weight: 700; line-height: 1.1; }
  .m-act-date em { font-style: normal; font-size: 11.5px; color: var(--grey); }
  .m-pdf { flex: 0 0 auto; align-self: center; padding: 3px 7px; border-radius: 6px;
    background: #fdecea; color: #c4271c; font-size: 12px; font-weight: 700; }
  .ios-list > li[hidden] { display: none; }
  .m-show-more { width: 100%; border: 0; background: none; text-align: left; font: inherit; }

  /*  «Ещё»: значки разделов, как в «Настройках» iOS  */
  .m-menu-row { align-items: center; }
  .m-ico { flex: 0 0 29px; height: 29px; border-radius: 7px; background: var(--grey);
    display: grid; place-items: center; }
  .m-ico svg { width: 19px; height: 19px; }
  .m-ico.i-inbox { background: var(--blue); } .m-ico.i-chart { background: var(--indigo); }
  .m-ico.i-cal { background: var(--red); } .m-ico.i-people { background: var(--orange); }
  .m-ico.i-doc { background: #af52de; } .m-ico.i-folder { background: #32ade6; }
  .m-ico.i-mail { background: #5ac8fa; } .m-ico.i-ip { background: #8e8e93; }
  .m-ico.i-money { background: var(--green); }
  .m-badge { flex: 0 0 auto; align-self: center; min-width: 22px; padding: 0 7px; border-radius: 11px;
    background: var(--red); color: #fff; font-size: 13px; font-weight: 600; line-height: 22px;
    text-align: center; }

  /*  Пять вкладок внизу: подписи мельче, чтобы «Расписание» помещалось  */
  .tabbar a .t { font-size: 10.5px; letter-spacing: -.01em; }
}
