:root {
    --color-bg: #0b0b0f;
    --color-surface: rgba(255, 255, 255, 0.06);
    --color-text: #ffffff;
    --color-text-secondary: rgba(255, 255, 255, 0.6);
    --color-accent: #4d7cff;
    --color-error: #ff4d4d;
    --radius-lg: 20px;
    --radius-md: 14px;
    --blur-glass: 24px;
    --app-max-width: 768px;
}

* {
    box-sizing: border-box;
}

input, textarea, button {
    outline: none;
}

/* Без этого повторный тап по ОДНОЙ и той же кнопке (тот же эмодзи в пикере/быстрой
   реакции, та же реакция под сообщением и т.п.) мобильный браузер может принять за
   двойной тап и зумнуть страницу вместо второго клика — двойной тап на разных
   координатах так не срабатывает, поэтому баг всплывает именно на повторном выборе
   одного и того же пункта. touch-action: manipulation убирает эту задержку/жест на
   кнопках, не трогая обычный pinch-zoom всей страницы. */
button {
    touch-action: manipulation;
}

/* --- утилита: блокировать нативное выделение текста/картинок, лупу и драг иконки
   при тапе/долгом нажатии. Без неё браузер на телефоне вместо клика по кастомному
   жестовому элементу (кнопка свайпа, пункт меню и т.п.) может начать выделение или
   драг картинки — тогда первый тап "съедается", и реагирует только повторный клик.
   Вешать на любой кастомный тап/свайп/долгое-нажатие элемент — писать заново не надо. */
.no-native-select {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#app {
    min-height: 100%;
    max-width: var(--app-max-width);
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 16px;
}

.input-field.error {
    border-color: var(--color-error);
}

.liquid-glass {
    backdrop-filter: blur(var(--blur-glass));
    -webkit-backdrop-filter: blur(var(--blur-glass));
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* ==================== auth.php ==================== */

.auth-step {
    display: none;
}

.auth-step[data-active="true"] {
    display: flex;
}

/* --- log in / 00: splash --- */

.auth-splash {
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100dvh;
    width: 100%;
    background: linear-gradient(204.46deg, rgb(135, 147, 182) 0.12%, rgb(103, 115, 145) 20.317%, rgb(1, 5, 18) 95.897%);
    animation: auth-splash-fade-in 0.6s ease both;
}

.auth-splash.is-leaving {
    animation: auth-splash-fade-out 0.4s ease both;
}

.auth-splash__icon {
    width: 48px;
    height: 48px;
    margin-bottom: 39.5dvh;
}

.auth-splash__icon img {
    width: 100%;
    height: 100%;
}

.auth-splash__logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.auth-splash__logo img {
    display: block;
}

.auth-splash__logo-monolit {
    width: 110px;
    height: 24.6px;
}

.auth-splash__logo-chat {
    width: 51.8px;
    height: 8.8px;
}

@keyframes auth-splash-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes auth-splash-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* --- log in / 01: выбор способа входа --- */

.auth-method {
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 34dvh;
    height: 100dvh;
    width: 100%;
    background: #f4f4f5;
    animation: auth-step-fade-in 0.4s ease both;
}

.auth-method__top {
    display: flex;
    flex-direction: column;
    gap: 48px;
    width: 100%;
}

.auth-method__header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    padding: 0 24px;
    text-align: center;
}

.auth-method__title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1c2233;
}

.auth-method__subtitle {
    margin: 0;
    font-size: 16px;
    color: #787b83;
}

.auth-method__buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 24px;
    width: 100%;
}

.auth-method__button {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
    height: 60px;
    padding: 16px 40px;
    border: none;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 2px 6.5px rgba(185, 190, 204, 0.16);
    font-size: 16px;
    font-weight: 600;
    color: #1c2233;
    letter-spacing: 0.08px;
    cursor: pointer;
    text-align: left;
}

.auth-method__button-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.auth-method__footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.auth-method__footer img {
    width: 113px;
    height: 42px;
}

@keyframes auth-step-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-step.is-leaving:not(.auth-splash) {
    animation: auth-step-fade-out 0.25s ease both;
}

@keyframes auth-step-fade-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-8px); }
}

/* --- log in / 02-04, password: форма с одним полем --- */

.auth-form {
    flex-direction: column;
    min-height: 100dvh;
    width: 100%;
    background: #f4f4f5;
    padding-top: 54px;
    animation: auth-step-fade-in 0.4s ease both;
}

.auth-form__nav {
    padding: 0 16px;
}

.auth-form__back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 0;
    background: none;
    border: none;
    color: #787b83;
    font-size: 16px;
    cursor: pointer;
}

.auth-form__back img {
    width: 24px;
    height: 24px;
}

.auth-form__header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    text-align: center;
    padding: 44px 24px 0;
}

.auth-form__title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1c2233;
}

.auth-form__subtitle {
    margin: 0;
    font-size: 16px;
    color: #787b83;
}

.auth-form__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 24px;
    margin-top: 48px;
}

.auth-form__input {
    width: 100%;
    height: 60px;
    padding: 16px 32px;
    border: none;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 2px 6.5px rgba(185, 190, 204, 0.16);
    font-size: 16px;
    font-weight: 600;
    color: #1c2233;
    font-family: inherit;
}

.auth-form__input::placeholder {
    color: #b9becc;
    font-weight: 600;
}

.auth-form__error {
    margin: 0;
    color: #f37269;
    font-size: 14px;
    font-weight: 500;
    display: none;
}

.auth-form__error.is-visible {
    display: block;
}

.auth-form__submit-wrap {
    padding: 24px;
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.auth-form__submit {
    position: relative;
    width: 100%;
    height: 60px;
    border: none;
    border-radius: 60px;
    background: rgba(185, 190, 204, 0.3);
    color: #ffffff;
    font-size: 17px;
    font-family: inherit;
    cursor: not-allowed;
    transition: background 0.2s ease, width 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-radius 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-form__submit.is-enabled {
    background: #1c2233;
    cursor: pointer;
}

.auth-form__submit .btn-label {
    display: inline-block;
    transition: opacity 0.15s ease;
}

.auth-form__submit .btn-spinner {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    animation: btn-spin 0.7s linear infinite;
}

.auth-form__submit.is-loading {
    width: 60px;
    background: #1c2233;
    pointer-events: none;
}

.auth-form__submit.is-loading .btn-label {
    opacity: 0;
}

.auth-form__submit.is-loading .btn-spinner {
    display: block;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

@keyframes shake-x {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

.is-shake {
    animation: shake-x 0.4s ease;
}

/* --- log in / 05-09: код подтверждения --- */

.auth-code {
    display: flex;
    gap: 24px;
    padding: 0 24px;
    width: 100%;
    margin-top: 48px;
    transition: opacity 0.2s ease;
}

.auth-code.is-checking {
    opacity: 0.5;
    pointer-events: none;
}

.auth-code__group {
    display: flex;
    flex: 1;
    gap: 8px;
    min-width: 0;
}

.auth-code__input {
    flex: 1;
    min-width: 0;
    height: 60px;
    border: 1.5px solid transparent;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 2px 6.5px rgba(185, 190, 204, 0.16);
    font-size: 24px;
    font-family: inherit;
    text-align: center;
    color: #1c2233;
}

.auth-code__input:focus {
    outline: none;
    border-color: rgba(185, 190, 204, 0.3);
}

.auth-code__input.is-error {
    color: #f37269;
}

.auth-code__error {
    text-align: center;
    padding: 0 24px;
    margin-top: 16px !important;
}

.auth-code__resend-wrap {
    margin-top: 40px;
    padding: 0 24px;
    text-align: center;
}

.auth-code__timer {
    margin: 0;
    font-size: 14px;
    color: #787b83;
}

/* --- log in / 10, 23, 11: профиль --- */

.auth-profile__body {
    gap: 16px;
}

.auth-profile__field {
    position: relative;
}

.auth-form__input--with-icon {
    padding-right: 48px;
}

.auth-profile__info-button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    opacity: 0.5;
}

.auth-profile__info-button img {
    width: 100%;
    height: 100%;
}

/* --- Bottom Sheet (переиспользуемый компонент, см. также раздел 6 ТЗ) --- */

.bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 40;
}

.bottom-sheet-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: fixed;
    left: 50%;
    bottom: 0;
    width: 100%;
    max-width: var(--app-max-width);
    background: rgba(245, 245, 245, 0.85);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 34px 34px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
    z-index: 41;
    /* 100% сдвигает вниз ровно на высоту САМОЙ шторки — для маленьких шторок это
       с большим запасом (они и так уже давно за экраном), но для шторок, у которых
       .is-expanded (98dvh) стоит ПОСТОЯННО в разметке, а не навешивается только
       при открытии (task-archive-sheet, task-project-label-sheet) — их верхний
       край в закрытом виде оказывается ровно у нижней границы экрана, и
       box-shadow (тянется на ~38px вверх от края) виден как чёрная полоса внизу
       экрана даже когда шторка "закрыта". +40px гарантированного запаса чинит
       это для всех шторок разом, визуально не влияя на уже-далеко-за-экраном маленькие.
    */
    transform: translate(-50%, calc(100% + 40px));
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-sheet.is-dragging {
    transition: none;
}

.bottom-sheet.is-open {
    transform: translate(-50%, 0);
}

.bottom-sheet__grabber-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 0 22px;
    margin: -10px 0 -12px;
    touch-action: none;
    cursor: grab;
    /* Тянуть за граббер — тоже жест (см. BottomSheet.init в app.js), а не просто тап;
       без этого iOS может показать callout/выделение, если палец на миг замер перед
       движением. Тот же набор свойств, что и в .no-native-select. */
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    -webkit-tap-highlight-color: transparent;
}

.bottom-sheet__grabber-wrap:active {
    cursor: grabbing;
}

.bottom-sheet__grabber {
    width: 40px;
    height: 4px;
    border-radius: 100px;
    background: #b9becc;
    opacity: 0.6;
}

.bottom-sheet__content {
    padding: 12px 31px 32px;
}

.bottom-sheet__title {
    font-size: 20px;
    font-weight: 700;
    color: #1c2233;
    line-height: 1.3;
    margin: 0 0 16px;
}

.bottom-sheet__list {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bottom-sheet__list li {
    font-size: 15px;
    line-height: 1.3;
    color: #1c2233;
}

/* ==================== chats.php ==================== */

.chats-page {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    background: #f8f8f8;
    color: #1c2233;
}

.liquid-glass-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 14px;
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 24px rgba(153, 150, 150, 0.19);
    color: #1c2233;
    cursor: pointer;
}

.chats-navbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 12px 24px calc(24px + env(safe-area-inset-bottom));
}

.chats-navbar__section-btn {
    font-size: 17px;
    font-weight: 600;
    font-family: inherit;
}

.chats-navbar__dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chats-navbar__dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 6px;
    background: #cdd0db;
}

.chats-navbar__dots .dot.is-active {
    background: #1c2233;
}

.chats-navbar__right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chats-navbar__filter-btn {
    padding: 0 22px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
}

.chats-navbar__plus-btn {
    width: 48px;
    padding: 0;
}

/* "Отменить" в режиме выбора задач (макет node 1-595) — та же кнопка "+", целиком
   переставшая быть иконкой и ставшая текстовой пилюлей (см. TaskSelect.updateCreateButton
   в task-select.js) — ширина/паддинги как у "Все" (.chats-navbar__filter-btn), а не
   узкий кружок под иконку. */
.chats-navbar__plus-btn--cancel {
    width: auto;
    padding: 0 22px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    white-space: nowrap;
}

/* Первое использование hidden на этих двух кнопках (TaskSelect прячет "Все" и меняет
   "+"/"Отменить" на весь режим выбора) — без этого liquid-glass-btn's display:inline-flex
   выиграл бы у [hidden] (тот же класс бага, что уже ловили несколько раз в проекте). */
.liquid-glass-btn[hidden] {
    display: none;
}

.chats-navbar__plus-btn img {
    width: 22px;
    height: 22px;
    /* На Android долгое нажатие ПРЯМО на <img> вызывает системное меню
       "сохранить/открыть картинку" — это отдельно от -webkit-touch-callout (тот
       только про iOS). pointer-events:none отдаёт весь тап родительской кнопке,
       картинка в жесте вообще не участвует. */
    pointer-events: none;
}

.chats-content {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-y;
}

.chats-content__track {
    display: flex;
    height: 100%;
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

.chats-content__track.is-dragging {
    transition: none;
}

.chats-content__pane {
    flex: 0 0 auto;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: pan-y;
    /* Явно серый, а не полагаемся на просвечивание сквозь .chats-page — гарантирует,
       что зазор между рядами (margin у .chat-swipe) всегда виден на сером, а не на
       случайно белом фоне. */
    background: #f8f8f8;
}

.chats-content__inner {
    min-height: 100%;
    /* margin-bottom стоит на каждой строке — но так первую строку сверху не от чего
       отделить, она упирается прямо в шапку списка. Добавляем свой отступ сверху. */
    padding-top: 16px;
    animation: auth-step-fade-in 0.25s ease both;
}

/* Группа закреплённых чатов — общий серый фон со скруглением только снизу (сверху
   ряды и так упираются в самый верх списка, скруглять нечего), как в макете Figma. */
.chats-pinned-group {
    background: #f4f4f5;
    border-radius: 0 0 38px 38px;
    overflow: hidden;
}

/* Плавный фолбэк-переход для ещё не закэшированных разделов (нечего показать вживую при драге) */
.chats-content__inner.is-leaving-left {
    animation: chats-slide-out-left 0.2s ease both;
}

.chats-content__inner.is-leaving-right {
    animation: chats-slide-out-right 0.2s ease both;
}

@keyframes chats-slide-out-left {
    to { opacity: 0; transform: translateX(-24px); }
}

@keyframes chats-slide-out-right {
    to { opacity: 0; transform: translateX(24px); }
}

/* --- empty-chats-welcome --- */

.chats-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    min-height: 100%;
    padding: 32px;
    text-align: center;
}

.chats-empty__icon {
    width: 140px;
    height: 140px;
    border-radius: 40px;
    object-fit: cover;
}

.chats-empty__text {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.chats-empty__title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #1c2233;
}

.chats-empty__subtitle {
    margin: 0;
    font-size: 16px;
    color: #787b83;
    max-width: 260px;
}

.chats-empty__button {
    margin-top: 8px;
    padding: 16px 28px;
    border: none;
    border-radius: 24px;
    background: #1c2233;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

/* --- список чатов (когда есть данные) --- */

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 0 20px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

/* В расширенном/детальном режиме аватар — НЕ круг, а высокая скруглённая капсула
   56x72 (radius 40px), на всю высоту ряда (72px), как в макете Figma; круглый аватар
   только в компактном режиме (см. .chat-item-compact__avatar ниже). */
.chat-item__avatar {
    flex-shrink: 0;
    width: 56px;
    height: 72px;
}

/* Обрезка фото/инициала под скруглённую капсулу — на ОТДЕЛЬНОЙ внутренней обёртке,
   а не на .chat-item__avatar: иначе overflow:hidden срезает мьют-бейдж, который по
   макету должен выступать НАРУЖУ за край аватара, а не быть обрезанным внутри него. */
.chat-item__avatar-photo {
    width: 100%;
    height: 100%;
    border-radius: 40px;
    background: #1c2233;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    overflow: hidden;
}

.chat-item__avatar-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-item__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-item__top-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.chat-item__name {
    font-size: 16px;
    font-weight: 600;
    color: #1c2233;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item__time {
    flex-shrink: 0;
    font-size: 13px;
    color: #787b83;
}

.chat-item__bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chat-item__preview {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #787b83;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item__preview.is-unread {
    color: #1c2233;
    font-weight: 600;
}

.chat-item__status-icon {
    width: 9px;
    height: 8px;
    flex-shrink: 0;
}

.chat-item__unread {
    flex-shrink: 0;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #4d7cff;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- компактный режим списка чатов --- */

.chat-item-compact {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 8px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.chat-item-compact__avatar {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
}

.chat-item-compact__avatar-photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #1c2233;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    overflow: hidden;
}

.chat-item-compact__avatar-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-item-compact__name {
    font-size: 17px;
    color: rgba(28, 34, 51, 0.9);
}

.chat-item-compact__name.is-unread {
    font-weight: 700;
    color: #1c2233;
}

/* --- режим массового выбора чатов --- */

.chat-item__checkbox {
    display: none;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #cdd0db;
    align-items: center;
    justify-content: center;
}

.chat-item__checkbox img {
    width: 13px;
    height: 13px;
    opacity: 0;
    /* Сам чекбокс на выбранном становится тёмным (#1c2233) — без инверта иконка
       той же тёмной галочки на нём почти не видна (тот же баг, что и в кружках-подтверждениях). */
    filter: invert(1);
}

/* Чекбоксы показываются только когда список в режиме выбора — класс вешается на
   #section-content целиком, а не на каждый ряд (см. chat-select.js). */
#section-content.is-select-mode .chat-item__checkbox {
    display: flex;
}

.chat-swipe.is-selected .chat-item__checkbox {
    background: #1c2233;
    border-color: #1c2233;
}

.chat-swipe.is-selected .chat-item__checkbox img {
    opacity: 1;
}

/* Панель массовых действий — плавающая внизу, тот же приём "стекла", что и у
   подтверждения удаления, показывается только когда что-то выбрано. */
.chats-select-bar {
    position: fixed;
    left: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: calc(100% - 32px);
    max-width: calc(var(--app-max-width) - 32px);
    z-index: 42;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 10px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(30px) saturate(1.8);
    -webkit-backdrop-filter: blur(30px) saturate(1.8);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease;
}

.chats-select-bar.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.chats-select-bar__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 13px;
    color: #1c2233;
    cursor: pointer;
    padding: 6px 10px;
}

/* У чатов все 4 кнопки в баре всегда показаны вместе (открытие/закрытие — только
   через is-open на самом баре) — [hidden] тут не использовался. Задачи (см.
   tasks-select-bar/task-select.js) впервые переключают hidden на ОТДЕЛЬНЫХ кнопках
   этого класса — без явного правила [hidden] проиграл бы display:flex выше (та же
   ошибка с [hidden] vs явный display, что уже ловили на .task-create-sheet__wheel). */
.chats-select-bar__btn[hidden] {
    display: none;
}

.chats-select-bar__btn img {
    width: 22px;
    height: 22px;
}

.chats-select-bar__btn--danger {
    color: #ff3b30;
}

/* --- свайп действий на элементе чата (список чатов) --- */

.chat-swipe {
    position: relative;
    overflow: hidden;
    background: #fff;
    /* margin вместо gap — gap на обычном block-контейнере не везде надёжно
       поддерживается на мобильных браузерах, margin работает без исключений
       и не зависит от того, свайпнут ряд сейчас или нет. */
    margin-bottom: 16px;
}

.chat-swipe__front {
    --swipe-progress: 0;
    position: relative;
    z-index: 1;
    touch-action: pan-y;
    background-color: color-mix(in srgb, #ffffff, #eceef1 calc(var(--swipe-progress, 0) * 100%));
    border-radius: calc(var(--swipe-progress, 0) * 36px);
    /* Пружинный отскок при открытии/закрытии (easeOutBack) — лёгкий перехлёст и оседание,
       как в нативных iOS-жестах, без JS-анимации и сторонних библиотек. */
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
                clip-path 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
                background-color 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-radius 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-swipe__front.is-dragging {
    transition: none;
}

/* Пока тянут (--swipe-progress растёт от 0 до 1) — имя/сообщение/время карточки
   плавно гаснут, а не просто уезжают вместе с ней целиком (см. дизайн в Figma). */
.chat-item__body,
.chat-item-compact__name,
.task-item__body {
    opacity: calc(1 - var(--swipe-progress, 0) * 1.6);
    transition: opacity 0.05s linear;
}

.chat-swipe__actions {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
}

.chat-swipe__actions--left {
    right: 0;
    /* Доп. отступ слева — иначе первая кнопка (mute) слегка обрезается краем
       схлопывающейся карточки (overflow:hidden на .chat-swipe). */
    padding-left: 20px;
}

.chat-swipe__actions--right {
    left: 0;
}

.chat-swipe__btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: #eceef1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.chat-swipe__btn img {
    width: 20px;
    height: 20px;
}

.chat-swipe__btn--menu {
    background: #417ee9;
}

/* Свайп задач вправо (макет "задача со стрелкой") — одно действие, удаление. */
.chat-swipe__btn--delete {
    background: #fc3b3b;
}

/* Свайп задач влево (макет "поп ап меню") — "..." (обычный серый кружок, как
   .chat-swipe__btn по умолчанию) и зелёная галочка "выполнено". */
.chat-swipe__btn--done {
    background: #6aab46;
}

.chat-item__avatar,
.chat-item-compact__avatar {
    position: relative;
}

.chat-item__mute-badge {
    position: absolute;
    right: -4px;
    bottom: -2px;
    width: 24px;
    height: 22px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-item__mute-badge img {
    width: 12px;
    height: 12px;
}

/* --- меню чата (bottom sheet по клику на синюю кнопку в свайпе, "Menu - iPhone" из Figma) --- */

.chat-options-sheet {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    /* Базовый .bottom-sheet (0.85 alpha, только blur) на практике почти не показывал
       никакого просвечивания на телефоне — при такой непрозрачности блюру буквально
       нечего было показать. Тут ниже альфа + saturate() (тот самый приём "vibrancy" из
       iOS — не просто мутит, а поднимает насыщенность того, что просвечивает) + рамка-
       блик и тень, чтобы стекло читалось как стекло, даже если backdrop-filter слабый. */
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(30px) saturate(1.8);
    -webkit-backdrop-filter: blur(30px) saturate(1.8);
    border-top: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.chat-options-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 8px;
}

.chat-options-sheet__spacer {
    width: 36px;
}

.chat-options-sheet__close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    cursor: pointer;
}

.chat-options-sheet__close img {
    width: 18px;
    height: 18px;
}

.chat-options-sheet__item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    border: none;
    background: none;
    font-size: 17px;
    font-weight: 500;
    color: #333333;
    cursor: pointer;
    text-align: left;
}

.chat-options-sheet__item:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Класс уже задаёт display:flex — обычный [hidden] от браузера тут не сработает
   (см. тот же приём для .chats-select-bar__btn[hidden] выше). */
.chat-options-sheet__item[hidden] {
    display: none;
}

.chat-options-sheet__item img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.chat-options-sheet__item--danger span {
    color: #ff5343;
}

.chat-options-sheet__separator {
    height: 1px;
    margin: 4px 20px 8px;
    background: #e6e6e6;
}

/* --- "Поделиться задачей" по ссылке (см. ChatSwipe.bindTaskShareSheet) — два "экрана"
   внутри одной шторки (главный + настройка доступа), переключаются через hidden. --- */

.task-share-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 8px;
}

.task-share-sheet__spacer {
    width: 36px;
}

.task-share-sheet__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #1c2233;
}

.task-share-sheet__close,
.task-share-sheet__back {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    cursor: pointer;
}

.task-share-sheet__close img {
    width: 18px;
    height: 18px;
}

.task-share-sheet__back-chevron {
    width: 16px;
    height: 16px;
    transform: rotate(-90deg);
}

.task-share-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 16px 10px;
    padding: 12px 14px;
    width: calc(100% - 32px);
    border: none;
    border-radius: 14px;
    background: #ffffff;
    cursor: pointer;
    text-align: left;
}

.task-share-row__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f4f4f5;
}

.task-share-row__icon img {
    width: 18px;
    height: 18px;
}

.task-share-row__chevron {
    transform: rotate(90deg);
}

.task-share-row__info {
    flex: 1;
    min-width: 0;
}

.task-share-row__title {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 600;
    color: #1c2233;
}

.task-share-row__subtitle {
    margin: 0;
    font-size: 13px;
    color: #787b83;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-share-sheet__send-btn {
    width: calc(100% - 32px);
    margin: 6px 16px 20px;
    height: 50px;
    border: none;
    border-radius: 25px;
    background: #1c2233;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.task-share-access-option {
    width: calc(100% - 32px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 16px 10px;
    padding: 14px;
    border: 1.5px solid #ededed;
    border-radius: 14px;
    background: #ffffff;
    cursor: pointer;
    text-align: left;
}

.task-share-access-option__title {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 600;
    color: #1c2233;
}

.task-share-access-option__subtitle {
    margin: 0;
    font-size: 13px;
    color: #787b83;
}

.task-share-access-option__check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #d3d6dc;
}

.task-share-access-option.is-selected {
    border-color: #1c2233;
}

.task-share-access-option.is-selected .task-share-access-option__check {
    background: #1c2233;
    border-color: #1c2233;
}

/* --- шторка "В папку" / фильтр папок по кнопке "Все" (переиспользуют один и тот же
   список — просто разный заголовок и смысл клика по строке, см. chat-folders.js) --- */

.folder-picker-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 8px;
}

.folder-picker-sheet__spacer,
.folder-picker-sheet__add {
    width: 36px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    cursor: pointer;
}

.folder-picker-sheet__add img {
    width: 24px;
    height: 24px;
}

.folder-picker-sheet__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1c2233;
}

.folder-picker-sheet__list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
    max-height: 50vh;
    overflow-y: auto;
}

.folder-picker-sheet__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 48px;
    padding: 4px 16px;
    border: none;
    border-radius: 28px;
    background: none;
    cursor: pointer;
    text-align: left;
}

.folder-picker-sheet__row.is-static {
    cursor: default;
}

.folder-picker-sheet__label {
    font-size: 16px;
    letter-spacing: -0.43px;
    color: #1c2233;
}

.folder-picker-sheet__check-badge {
    display: none;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #1c2233;
}

.folder-picker-sheet__check-badge img {
    width: 12px;
    height: 12px;
    filter: invert(1);
}

.folder-picker-sheet__row.is-checked .folder-picker-sheet__check-badge {
    display: flex;
}

/* --- подтверждение удаления чата (маленький алерт снизу, не bottom-sheet) --- */

.chat-delete-confirm {
    position: fixed;
    left: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: calc(100% - 32px);
    max-width: calc(var(--app-max-width) - 32px);
    /* Выше .chats-select-bar (тоже 42) — иначе при массовом удалении панель
       выбора рисуется поверх диалога подтверждения и перехватывает тапы. */
    z-index: 43;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease;
}

.chat-delete-confirm.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.chat-delete-confirm__card {
    background: rgba(245, 245, 245, 0.85);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
}

.chat-delete-confirm__title {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 600;
    color: #1c2233;
}

.chat-delete-confirm__subtitle {
    margin: 0 0 16px;
    font-size: 14px;
    color: #787b83;
}

.chat-delete-confirm__delete {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.05);
    color: #ff3b30;
    font-size: 17px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.chat-delete-confirm__cancel {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 20px;
    background: rgba(245, 245, 245, 0.85);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    color: #1c2233;
    font-size: 17px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

/* --- разделы-заглушки (Задачи/Заметки/Архив) --- */

.chats-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 100%;
    padding: 32px;
    text-align: center;
}

.chats-placeholder__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1c2233;
}

.chats-placeholder__subtitle {
    margin: 0;
    font-size: 15px;
    color: #787b83;
}

/* --- меню разделов (bottom sheet, "Menu - iPhone" из Figma) --- */

.section-menu {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

.section-menu__quick-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 16px 24px;
}

.section-menu__segments {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    min-width: 0;
}

.section-menu__segment {
    height: 40px;
    padding: 6px 22px;
    border: none;
    border-radius: 20px;
    background: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: #1c2233;
    cursor: pointer;
}

.section-menu__segment.is-active {
    background: #ededed;
}

.section-menu__avatar-btn {
    display: block;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    background: #f7f7f7;
}

.section-menu__avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.section-menu__title {
    margin: 0;
    padding: 4px 24px 10px;
    font-size: 13px;
    font-weight: 510;
    color: #bfbfbf;
}

.section-menu__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 24px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.section-menu__item-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.section-menu__item span {
    font-size: 16px;
    color: #333333;
}

.section-menu__separator {
    height: 1px;
    margin: 0 24px 8px;
    background: #e6e6e6;
}

/* --- "Новый чат" (список чатов / плюсик / 11-13) --- */

.new-chat-sheet {
    background: #ffffff;
    border-radius: 38px 38px 0 0;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    transition: height 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.new-chat-sheet.is-expanded {
    height: 98dvh;
    display: flex;
    flex-direction: column;
}

.new-chat-sheet.is-expanded .new-chat-sheet__results {
    flex: 1;
    height: auto;
}

.new-chat-sheet__toolbar {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.new-chat-sheet__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 36px;
    padding: 0 16px;
}

.new-chat-sheet__spacer {
    width: 36px;
    height: 36px;
}

.new-chat-sheet__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1c2233;
}

.new-chat-sheet__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f4f4f5;
    cursor: pointer;
}

.new-chat-sheet__close img {
    width: 16px;
    height: 16px;
}

.new-chat-sheet__search-wrap {
    padding: 24px 16px 0;
}

.new-chat-sheet__search {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 46px;
    padding: 0 16px;
    border-radius: 100px;
    background: #f4f4f5;
}

.new-chat-sheet__search img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.new-chat-sheet__search input {
    flex: 1;
    min-width: 0;
    border: none;
    background: none;
    font-family: inherit;
    /* iOS Safari зумит при фокусе на инпуте с font-size < 16px. */
    font-size: 16px;
    font-weight: 500;
    color: #1c2233;
}

.new-chat-sheet__search input::placeholder {
    color: #787b83;
}

.new-chat-sheet__group-row {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 6px 16px;
    margin-top: 6px;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: none;
    cursor: pointer;
    text-align: left;
}

.new-chat-sheet__group-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 60px;
    background: #f8f8fa;
    flex-shrink: 0;
}

.new-chat-sheet__group-icon img {
    width: 20px;
    height: 20px;
}

.new-chat-sheet__group-label {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #1c2233;
}

.new-chat-sheet__group-chevron {
    width: 16px;
    height: 16px;
    transform: rotate(90deg);
}

.new-chat-sheet__results {
    height: 45dvh;
    overflow-y: auto;
    padding-top: 10px;
}

.new-chat-sheet__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 0 48px;
}

.new-chat-sheet__empty-icon {
    width: 76px;
    height: 72px;
    border-radius: 16px;
    object-fit: cover;
    margin-bottom: 24px;
}

.new-chat-sheet__empty-title {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 700;
    color: #1c2233;
}

.new-chat-sheet__empty-subtitle {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
    color: #787b83;
}

.new-chat-sheet__group-title {
    margin: 0;
    padding: 8px 16px 6px;
    font-size: 13px;
    color: #787b83;
}

.new-chat-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 8px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
}

.new-chat-result-item__avatar {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: #d9d9d9;
    color: #1c2233;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    overflow: hidden;
}

.new-chat-result-item__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.new-chat-result-item__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.new-chat-result-item__name {
    font-size: 16px;
    font-weight: 600;
    color: #1c2233;
}

.new-chat-result-item__username {
    font-size: 14px;
    color: #787b83;
}

.new-chat-sheet__no-results {
    padding: 24px 16px;
    text-align: center;
    color: #787b83;
    font-size: 15px;
}

/* --- групповой чат: выбор участников (список чатов / плюсик / новый чат или групповой чат) --- */

.group-picker-sheet {
    display: flex;
    flex-direction: column;
}

.group-picker-sheet__count {
    padding: 4px 16px 0;
    font-size: 13px;
    color: #787b83;
}

.group-picker-sheet__selected {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 12px 16px;
    scrollbar-width: none;
}

.group-picker-sheet__selected::-webkit-scrollbar {
    display: none;
}

.group-picker-sheet__selected[hidden] {
    display: none;
}

.group-picker-sheet__chip {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 56px;
}

.group-picker-sheet__chip-avatar {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: #d9d9d9;
    color: #1c2233;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    overflow: hidden;
}

.group-picker-sheet__chip-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.group-picker-sheet__chip-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #b9becc;
    color: #fff;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.group-picker-sheet__chip-name {
    font-size: 12px;
    color: #1c2233;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.group-picker-sheet__list {
    flex: 1;
    height: auto;
}

.contact-picker__section {
    display: flex;
    flex-direction: column;
}

.contact-picker__letter {
    padding: 8px 16px 4px;
    font-size: 13px;
    font-weight: 600;
    color: #787b83;
}

.contact-picker__row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 8px 16px;
    cursor: pointer;
}

.contact-picker__checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.contact-picker__radio {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid #d9d9d9;
    background: #fff;
    position: relative;
}

.contact-picker__checkbox:checked ~ .contact-picker__radio {
    background: #1c2233;
    border-color: #1c2233;
}

.contact-picker__checkbox:checked ~ .contact-picker__radio::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/assets/icons/checkbox-check-v2.svg') center / 12px no-repeat;
}

.contact-picker__avatar {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: #d9d9d9;
    color: #1c2233;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    overflow: hidden;
}

.contact-picker__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact-picker__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.contact-picker__name {
    font-size: 16px;
    font-weight: 600;
    color: #1c2233;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-picker__username {
    font-size: 14px;
    color: #787b83;
}

.group-picker-sheet__footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.group-picker-sheet__search {
    flex: 1;
}

.group-picker-sheet__next {
    flex-shrink: 0;
    height: 46px;
    padding: 0 20px;
    border: none;
    border-radius: 100px;
    background: #1c2233;
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.group-picker-sheet__next:disabled {
    opacity: 0.4;
    cursor: default;
}

/* --- групповой чат: карточка группы (фото/название/описание/участники/админы) --- */

.group-info-sheet__body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.group-info-sheet__photo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 16px 0 8px;
    cursor: pointer;
}

.group-info-sheet__photo {
    width: 120px;
    height: 120px;
    border-radius: 28px;
    background: #f4f4f5;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.group-info-sheet__photo::before {
    content: '';
    width: 40px;
    height: 40px;
    background: url('/assets/icons/plus-camera.svg') center / contain no-repeat;
    opacity: 0.3;
}

.group-info-sheet__photo.has-photo::before {
    display: none;
}

.group-info-sheet__photo-label {
    font-size: 15px;
    font-weight: 500;
    color: #1c2233;
}

.group-info-sheet__name {
    width: 100%;
    border: none;
    text-align: center;
    font-family: inherit;
    font-size: 24px;
    font-weight: 700;
    color: #1c2233;
    padding: 8px 0 4px;
}

.group-info-sheet__name::placeholder {
    color: #cdd0db;
}

.group-info-sheet__description {
    width: 100%;
    border: none;
    text-align: center;
    font-family: inherit;
    font-size: 16px;
    color: #1c2233;
    padding: 0 0 12px;
}

.group-info-sheet__description::placeholder {
    color: #b9becc;
}

.group-info-sheet__stats {
    width: 100%;
    margin-top: 12px;
    border-radius: 20px;
    background: #f4f4f5;
    overflow: hidden;
}

.group-info-sheet__stat-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: none;
    font-family: inherit;
    font-size: 16px;
    color: #1c2233;
    cursor: pointer;
}

.group-info-sheet__stat-row:last-child {
    border-bottom: none;
}

.group-info-sheet__stat-row img {
    width: 18px;
    height: 18px;
}

.group-info-sheet__create {
    flex-shrink: 0;
    margin: 12px 16px calc(16px + env(safe-area-inset-bottom));
    height: 52px;
    border: none;
    border-radius: 100px;
    background: #1c2233;
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.group-info-sheet__create:disabled {
    opacity: 0.4;
    cursor: default;
}

/* --- "Новая папка" (список чатов / плюсик / 19-20) --- */

.new-folder-sheet {
    height: 98dvh;
    display: flex;
    flex-direction: column;
    background: #f4f4f5;
    border-radius: 38px 38px 0 0;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.new-folder-sheet__toolbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.new-folder-sheet__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 36px;
    padding: 0 16px;
}

.new-folder-sheet__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1c2233;
}

.new-folder-sheet__close,
.new-folder-sheet__confirm {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.new-folder-sheet__close {
    background: rgba(0, 0, 0, 0.05);
}

.new-folder-sheet__close img {
    width: 16px;
    height: 16px;
}

.new-folder-sheet__confirm {
    background: #1c2233;
}

.new-folder-sheet__confirm img {
    width: 14px;
    height: 14px;
    filter: invert(1);
}

.new-folder-sheet__input-wrap {
    flex-shrink: 0;
    padding: 24px 16px 0;
}

.new-folder-sheet__input {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 28px;
    background: #ffffff;
    box-shadow: 0 4px 60px rgba(136, 136, 136, 0.18);
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    color: #1c2233;
}

.new-folder-sheet__input::placeholder {
    color: #9498a3;
}

.new-folder-sheet__section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 24px 24px 10px;
    font-size: 13px;
    font-weight: 510;
    letter-spacing: -0.08px;
    color: #bfbfbf;
    text-transform: uppercase;
}

.new-folder-sheet__selected-count {
    color: #787b83;
    text-transform: none;
}

.new-folder-sheet__list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: #ffffff;
}

.folder-chat-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 64px;
    padding: 2px 16px;
    /* Сброс на случай, если это <button> (шторка "Переслать"), а не <div>
       (шторка "Новая папка") — на div эти свойства ни на что не влияют. */
    border: none;
    background: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.folder-chat-row__name {
    flex: 1;
    min-width: 0;
    font-size: 17px;
    color: #1c2233;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-chat-row .chat-item__checkbox {
    display: flex;
}

.folder-chat-row.is-selected .chat-item__checkbox {
    background: #1c2233;
    border-color: #1c2233;
}

.folder-chat-row.is-selected .chat-item__checkbox img {
    opacity: 1;
}

/* --- "Настроить" (folder-manage-sheet) — реюз .new-folder-sheet под другой контент:
   вместо списка чатов список папок с drag-handle + крестиком удаления. --- */
.folder-manage-sheet__list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: #ffffff;
    padding: 4px 0;
}

.folder-manage-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    padding: 2px 16px;
    background: #ffffff;
    touch-action: none;
}

.folder-manage-row.is-dragging {
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
}

.folder-manage-row__handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: #9498a3;
    cursor: grab;
}

.folder-manage-row__handle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.folder-manage-row__name {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    color: #1c2233;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-manage-row__delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

.folder-manage-row__delete img {
    width: 10px;
    height: 10px;
}

.folder-manage-sheet__empty {
    padding: 24px 16px;
    color: #9498a3;
    font-size: 15px;
    text-align: center;
}

/* --- баннер разрешения на уведомления --- */

.push-permission-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: #1c2233;
    flex-shrink: 0;
}

.push-permission-banner.is-visible {
    display: flex;
}

.push-permission-banner__text {
    font-size: 14px;
    color: #ffffff;
    line-height: 1.3;
}

.push-permission-banner__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.push-permission-banner__allow {
    border: none;
    border-radius: 12px;
    background: #ffffff;
    color: #1c2233;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    cursor: pointer;
}

.push-permission-banner__dismiss {
    border: none;
    background: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
}

.push-permission-banner__dismiss img {
    width: 16px;
    height: 16px;
    filter: invert(1);
}

/* --- мини-уведомление в приложении (пока пользователь на сайте — вместо браузерного push) --- */

.mini-push-toast {
    display: none;
    align-items: center;
    gap: 8px;
    position: fixed;
    top: calc(10px + env(safe-area-inset-top));
    left: 10px;
    right: 10px;
    max-width: calc(var(--app-max-width) - 20px);
    margin: 0 auto;
    z-index: 60;
    background: #1c2233;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    padding: 6px;
    transform: translateY(-150%);
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

.mini-push-toast.is-visible {
    display: flex;
    transform: translateY(0);
}

.mini-push-toast__body {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 8px 10px;
    border: none;
    background: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.mini-push-toast__name {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.mini-push-toast__text {
    min-width: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-push-toast__close {
    flex-shrink: 0;
    border: none;
    background: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
}

.mini-push-toast__close img {
    width: 14px;
    height: 14px;
    filter: invert(1);
}

/* --- раздел "Задачи" (базовая версия — просто список, без свайпов/статусов) --- */

.task-item {
    width: 100%;
    padding: 10px 20px;
}

.task-item__row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.task-item__avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #1c2233;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    overflow: hidden;
}

.task-item__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.task-item__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.task-item__name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.task-item__name {
    font-size: 15px;
    font-weight: 600;
    color: #1c2233;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Задача поставлена другим участником и появилась после моего последнего захода
   в "Задачи" — см. sections/tasks.php (is_new) и users.tasks_last_seen_at. Пропадает
   сама по себе при следующем открытии раздела, отдельного действия "отметить как
   прочитанное" не требуется. */
.task-item__new-badge {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 10px;
    background: #d9971f;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.task-item--new {
    background: #fff8ea;
    box-shadow: inset 3px 0 0 #d9971f;
}

.task-item__text {
    font-size: 14px;
    color: #787b83;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- сводка заполненных значений (макет "задача со стрелкой") — чипы дедлайна/
   напоминания/чек-листа/приоритета/статуса. Горизонтальный скролл в 1 строку, если
   чипов больше, чем помещается, а не перенос — стрелка разворота при этом всегда
   на виду (она НЕ часть скролл-контейнера, а закреплённый сосед рядом с ним). --- */

.task-item__summary {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    /* Раньше был padding-left: 60px (выравнивание под текстом, а не под аватаром) —
       по макету (node 1:1108) ряд чипов должен занимать всю ширину карточки, начинаясь
       от левого края (под аватаром), а не быть с отступом — тот же баг, что уже правили
       у .task-item__detail (см. комментарий там же чуть ниже). */
}

.task-item__summary-scroll {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.task-item__summary-scroll::-webkit-scrollbar {
    display: none;
}

.task-item__chip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border-radius: 24px;
    background: rgba(28, 34, 51, 0.05);
    font-size: 14px;
    color: #787b83;
    white-space: nowrap;
}

.task-item__chip img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.task-item__chip--pill {
    padding: 6px 12px 6px 6px;
    color: #fff;
}

.task-item__chip--pill img {
    width: 16px;
    height: 16px;
}

.task-item__expand-toggle {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.task-item__expand-toggle img {
    width: 32px;
    height: 32px;
    /* Базовый актив уже "смотрит влево" (см. assets/icons/task-item-expand.svg) —
       -90deg даёт вниз (свёрнуто), +90deg от базы (см. .is-expanded) даёт вверх. */
    transform: rotate(-90deg);
    transition: transform 0.15s ease;
}

.task-item__expand-toggle.is-expanded img {
    transform: rotate(90deg);
}

/* --- развёрнутая детализация (макет "задача со стрелкой развёрнута") — те же карточки
   Дедлайн/Напоминание/Приоритет/Статус, что и в форме создания задачи, полностью
   редактируемые прямо в списке. --- */

.task-item__detail {
    margin-top: 12px;
    /* Раньше был padding-left: 60px (выравнивание под аватар, как у .task-item__summary) —
       но карточки Дедлайн/Приоритет/Статус ниже уже сами обнуляют свой боковой margin
       (см. .task-item__detail > .task-create-sheet__deadline), так что тот паддинг давал
       асимметричный отступ (60px слева, 0 справа) — карточки выглядели узкими и съехавшими,
       а не на всю ширину, как в макете. */
}

.task-item__detail[hidden] {
    display: none;
}

.task-item__detail > .task-create-sheet__deadline,
.task-item__detail > .task-create-sheet__checklist {
    margin: 0 0 8px;
}

.task-item__detail > .task-create-sheet__deadline:last-child,
.task-item__detail > .task-create-sheet__checklist:last-child {
    margin-bottom: 0;
}

/* --- шапка списка задач: "ВСЕ ЗАДАЧИ N" + кнопка сортировки/группировки --- */

.task-list-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 20px 12px;
}

.task-list-header__pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.18px;
    text-transform: uppercase;
    color: #1c2233;
}

.task-list-header__count {
    color: #b9becc;
}

.task-list-header__sort-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-list-header__sort-btn img {
    width: 20px;
    height: 20px;
}

.task-sort-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 20px;
    z-index: 20;
    width: 210px;
    padding: 12px 8px;
    border-radius: 24px;
    background: rgba(245, 245, 245, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.task-sort-menu[hidden] {
    display: none;
}

.task-sort-menu__section-title {
    padding: 4px 8px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #bfbfbf;
}

.task-sort-menu__separator {
    margin: 4px 8px;
    height: 1px;
    background: #e6e6e6;
}

.task-sort-menu__item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 10px 8px;
    border: none;
    background: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 16px;
    color: #333;
    text-align: left;
    cursor: pointer;
}

.task-sort-menu__item:active {
    background: rgba(0, 0, 0, 0.04);
}

.task-sort-menu__check {
    display: none;
    width: 16px;
    height: 16px;
    filter: invert(1);
}

.task-sort-menu__item.is-selected .task-sort-menu__check {
    display: block;
}

/* --- заголовки секций группировки (Сегодня/Завтра/день недели/Без срока и т.п.) --- */

.task-group__header {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 16px 20px 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.18px;
    text-transform: uppercase;
    color: #787b83;
}

.task-group__count {
    color: #b9becc;
}

/* --- Карусель "РЕКОМЕНДАЦИИ ЗАДАЧ" (soft-предложения от AI, см. sections/tasks.php) --- */

.task-suggestions {
    padding: 4px 0 12px;
}

.task-suggestions__label {
    padding: 0 20px 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.18px;
    text-transform: uppercase;
    color: #1c2233;
}

.task-suggestions__track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0 20px 4px;
    scroll-snap-type: x proximity;
}

.task-suggestion-card {
    flex: 0 0 auto;
    scroll-snap-align: start;
    width: 220px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.task-suggestion-card__body {
    flex: 1;
    min-width: 0;
}

.task-suggestion-card__source {
    margin: 0 0 2px;
    font-size: 12px;
    color: #b9becc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-suggestion-card__title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1c2233;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-suggestion-card__reject,
.task-suggestion-card__accept {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.task-suggestion-card__reject {
    background: #f4f4f5;
}

.task-suggestion-card__reject img {
    width: 12px;
    height: 12px;
}

.task-suggestion-card__accept {
    background: #4d7cff;
}

.task-suggestion-card__accept img {
    width: 14px;
    height: 14px;
    filter: invert(1);
}

.task-quick-add {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
}

.task-quick-add__input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 16px;
    border: none;
    border-radius: 20px;
    background: #f4f4f5;
    font-family: inherit;
    font-size: 16px;
    color: #1c2233;
}

.task-quick-add__input::placeholder {
    color: #787b83;
}

/* Иконка справа от строки быстрого добавления — пока пусто, пунктирный "+" (открыть
   полную форму создания с нуля); как только что-то напечатали, меняется на "..." —
   тот же переход в полную форму, но уже с текущим текстом как названием задачи
   (там можно сразу задать дедлайн/приоритет и т.п., не только быстрый плоский текст). */
.task-quick-add__icon-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1.5px dashed #cdd0db;
    border-radius: 50%;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.task-quick-add__icon-btn[data-mode="menu"] {
    border-style: solid;
    border-color: transparent;
    background: #f4f4f5;
}

.task-quick-add__icon {
    width: 18px;
    height: 18px;
}

/* --- шторка "Добавить задачу" (подробная форма через "+" в разделе "Задачи") --- */

/* Раньше шторка просто росла по контенту и при разворачивании календаря/колеса времени
   могла стать выше экрана — а прокрутки внутри не было, так что до названия наверху было
   не добраться. Теперь шапка (крестик/галочка) всегда на месте, а всё остальное скроллится
   внутри .task-create-sheet__body — тот же приём, что и в .new-chat-sheet.is-expanded. */
.task-create-sheet {
    max-height: 90dvh;
    display: flex;
    flex-direction: column;
}

.task-create-sheet__body {
    flex: 1;
    min-height: 0; /* без этого flex-item не сжимается и overflow не скроллит, а раздувает родителя */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 16px;
}

.task-create-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 36px;
    padding: 0 16px;
    flex-shrink: 0;
}

.task-create-sheet__spacer {
    flex: 1;
}

.task-create-sheet__close,
.task-create-sheet__save {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.task-create-sheet__close {
    background: rgba(0, 0, 0, 0.05);
}

.task-create-sheet__close img {
    width: 16px;
    height: 16px;
}

.task-create-sheet__save {
    background: #1c2233;
}

.task-create-sheet__save img {
    width: 14px;
    height: 14px;
    filter: invert(1);
}

.task-create-sheet__save.is-loading img {
    visibility: hidden;
}

.task-create-sheet__save.is-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    animation: task-save-spin 0.7s linear infinite;
}

@keyframes task-save-spin {
    to { transform: rotate(360deg); }
}

.task-create-sheet__fields {
    margin: 16px 16px 0;
    padding: 4px 16px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 60px rgba(136, 136, 136, 0.18);
}

.task-create-sheet__title-input {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    color: #1c2233;
}

.task-create-sheet__description-input {
    width: 100%;
    padding: 10px 0;
    border: none;
    resize: none;
    font-family: inherit;
    font-size: 15px;
    color: #1c2233;
    max-height: 80px;
}

.task-create-sheet__title-input::placeholder,
.task-create-sheet__description-input::placeholder {
    color: #9498a3;
}

.task-create-sheet__project-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(100% - 32px);
    margin: 12px 16px 0;
    padding: 10px 12px;
    border: none;
    border-radius: 16px;
    background: #ffffff;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.task-create-sheet__project-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1c2233;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
}

/* Проект ещё не выбран — content пуст, показываем просто прозрачный кружок вместо
   залитого тёмным "будто сломано" (см. innerHTML = '' в setTaskCreateProject). */
.task-create-sheet__project-avatar:empty {
    background: transparent;
}

.task-create-sheet__project-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* "Ярлык" — тут в кружке не фото/инициал, а статичная иконка (нет привязки к
   чату/аватару), поэтому вместо object-fit:cover на весь кружок — маленькая
   иконка по центру. task-new-project.svg тёмная по умолчанию (как и большинство
   иконок в проекте, см. память про checkbox-check-v2.svg) — на тёмном кружке нужен
   invert, иначе просто не видна. */
.task-create-sheet__project-avatar--label {
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-create-sheet__project-avatar--label img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    filter: invert(1);
}

.task-create-sheet__project-name {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1c2233;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-create-sheet__project-chevron {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    opacity: 0.4;
    /* chevron-right.svg на самом деле "смотрит вверх" — во всех местах, где нужно
       "вправо" (.new-chat-sheet__group-chevron и т.п.), уже стоит этот же поворот. */
    transform: rotate(90deg);
}

.task-create-sheet__separator {
    height: 16px;
}

.task-create-sheet__feature-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 16px 8px;
    padding: 12px;
    border-radius: 16px;
    background: #f4f4f5;
    font-size: 15px;
    color: #1c2233;
    /* Пока не рабочие — курсор обычный, не pointer, чтобы не намекать на кликабельность. */
}

.task-create-sheet__feature-row span:first-of-type {
    flex: 1;
}

.task-create-sheet__value {
    font-size: 14px;
    color: #9498a3;
}

/* --- чек-лист: одна серая карточка-контейнер, внутри строки-пункты + строка ввода --- */

.task-create-sheet__checklist {
    margin: 0 16px 8px;
    border-radius: 16px;
    background: #f4f4f5;
    overflow: hidden;
}

/* Заглушка "Чек-лист" переиспользует .task-create-sheet__feature-row, но теперь она
   внутри уже-серого контейнера — свой отступ/фон убираем, чтобы не было двойной рамки.
   Раньше было завязано на конкретный id #task-create-checklist-placeholder — совпадал
   только у шторки создания, не у карточек списка (id там task-create-<taskId>-checklist-
   placeholder, см. task-detail-fields.php) — тот же класс бага, что и со статус-пилюлей. */
.task-create-sheet__checklist > .task-create-sheet__feature-row {
    margin: 0;
    background: none;
    cursor: pointer;
}

.task-create-sheet__checklist-item,
.task-create-sheet__checklist-input-row,
.task-create-sheet__checklist-add-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    font-size: 15px;
    color: #1c2233;
}

.task-create-sheet__checklist-circle {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #cdd0db;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.task-create-sheet__checklist-item.is-checked .task-create-sheet__checklist-circle {
    background: #1c2233;
    border-color: #1c2233;
}

.task-create-sheet__checklist-item.is-checked .task-create-sheet__checklist-circle::after {
    content: '';
    width: 5px;
    height: 9px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg) translate(-1px, -1px);
}

.task-create-sheet__checklist-text {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.task-create-sheet__checklist-item.is-checked .task-create-sheet__checklist-text {
    color: #9498a3;
    text-decoration: line-through;
}

.task-create-sheet__checklist-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 15px;
    color: #1c2233;
    padding: 0;
}

.task-create-sheet__checklist-input:focus {
    outline: none;
}

.task-create-sheet__checklist-input::placeholder {
    color: #9498a3;
}

.task-create-sheet__checklist-add-row {
    cursor: pointer;
    color: #9498a3;
}

.task-create-sheet__checklist-add-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    box-sizing: border-box;
    border-radius: 50%;
    border: 1.5px dashed #cdd0db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
}

/* --- дедлайн: тумблер + аккордеон "Дата"/"Время" с календарём и колёсиком времени --- */

.task-create-sheet__deadline {
    margin: 0 16px 8px;
    border-radius: 16px;
    background: #f4f4f5;
    overflow: hidden;
}

/* Строка тумблера переиспользует .task-create-sheet__feature-row, но уже внутри
   серого контейнера — свой отступ/фон убираем (тот же приём, что и у чек-листа). */
.task-create-sheet__deadline > .task-create-sheet__feature-row {
    margin: 0;
    background: none;
}

.task-create-sheet__deadline-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: none;
    font-family: inherit;
    font-size: 15px;
    color: #1c2233;
    text-align: left;
    cursor: pointer;
}

.task-create-sheet__deadline-row span:first-child {
    flex: 1;
}

.task-create-sheet__deadline-chevron {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    opacity: 0.35;
    /* chevron-right.svg на самом деле "смотрит вверх" — тот же приём, что и везде
       в проекте (см. .task-create-sheet__project-chevron): 90deg = вниз. */
    transform: rotate(90deg);
}

/* Разворачивая "Дата"/"Время", шеврон меняется на явную галочку — иначе непонятно,
   как закрыть колесо времени (у него, в отличие от календаря, нет отдельного тапа-
   подтверждения — прокрутка идёт непрерывно). Тап по галочке просто сворачивает панель. */
.task-create-sheet__deadline-check {
    display: none;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.task-create-sheet__deadline-row.is-expanded .task-create-sheet__deadline-chevron {
    display: none;
}

.task-create-sheet__deadline-row.is-expanded .task-create-sheet__deadline-check {
    display: block;
}

.task-create-sheet__deadline-value-weekday {
    color: #9498a3;
    font-weight: 400;
}

.task-create-sheet__deadline-value-date {
    color: #1c2233;
    font-weight: 600;
}

.task-create-sheet__calendar {
    padding: 0 12px 12px;
}

.task-create-sheet__calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 4px 12px;
}

.task-create-sheet__calendar-month {
    font-size: 14px;
    font-weight: 600;
    color: #1c2233;
}

.task-create-sheet__calendar-nav {
    display: flex;
    gap: 4px;
}

.task-create-sheet__calendar-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

.task-create-sheet__calendar-nav-btn img {
    width: 12px;
    height: 12px;
    opacity: 0.6;
}

/* chevron-right.svg на самом деле "смотрит вверх" — поворот такой же, как везде
   в проекте (см. .task-create-sheet__project-chevron), плюс вторая ориентация "влево". */
.task-create-sheet__calendar-nav-btn--prev img {
    transform: rotate(-90deg);
}

.task-create-sheet__calendar-nav-btn--next img {
    transform: rotate(90deg);
}

.task-create-sheet__calendar-weekdays,
.task-create-sheet__calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
}

.task-create-sheet__calendar-weekdays span {
    font-size: 12px;
    color: #9498a3;
    padding: 4px 0;
}

.task-create-sheet__calendar-days {
    row-gap: 2px;
}

.task-create-sheet__calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    font-size: 14px;
    color: #1c2233;
    border-radius: 50%;
    cursor: pointer;
}

.task-create-sheet__calendar-day--today {
    background: rgba(28, 34, 51, 0.08);
}

.task-create-sheet__calendar-day--selected {
    background: #1c2233;
    color: #fff;
}

/* Колесо времени: два независимых скролл-колеса со scroll-snap (не физика драга —
   браузер сам держит инерцию/прилипание). Высота строки 56px, паддинг колонки тоже
   56px сверху/снизу — так первая/последняя строка тоже может доскроллить до центра. */
/* [hidden] и класс с явным display одинаковой специфичности — класс, идущий позже
   в файле, побеждает и "отменяет" hidden. Без этой строки колесо оставалось видимым
   (display:flex) и занимало 168px места ДАЖЕ когда атрибут hidden стоял в разметке. */
.task-create-sheet__wheel[hidden] {
    display: none;
}

.task-create-sheet__wheel {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 24px;
    height: 168px;
    margin: 0 12px 12px;
}

.task-create-sheet__wheel-highlight {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 56px;
    height: 56px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    pointer-events: none;
}

.task-create-sheet__wheel-col {
    width: 60px;
    height: 168px;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 56px 0;
    scrollbar-width: none;
}

.task-create-sheet__wheel-col::-webkit-scrollbar {
    display: none;
}

.task-create-sheet__wheel-item {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: #c3c6cf;
    font-variant-numeric: tabular-nums;
    scroll-snap-align: center;
}

.task-create-sheet__wheel-item.is-selected {
    color: #1c2233;
    font-weight: 700;
    font-size: 22px;
}

/* Явная кнопка "Готово" сразу под колесом — галочка в шапке строки "Время" технически
   тоже закрывает колесо, но внимание в момент прокрутки на самом колесе, а не наверху,
   поэтому одной мелкой иконки там оказалось недостаточно (не находили, чем закрыть). */
.task-create-sheet__wheel-done[hidden] {
    display: none;
}

.task-create-sheet__wheel-done {
    display: block;
    width: calc(100% - 24px);
    margin: 0 12px 12px;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: #1c2233;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}

/* --- "Повтор" напоминания: тот же аккордеон, что "Дата"/"Время", но список вариантов
   вместо календаря/колеса (макет "напоминание/повтор"). --- */

.task-create-sheet__repeat-list[hidden] {
    display: none;
}

.task-create-sheet__repeat-list {
    display: flex;
    flex-direction: column;
}

.task-create-sheet__repeat-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px;
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: none;
    font-family: inherit;
    font-size: 15px;
    color: #1c2233;
    text-align: left;
    cursor: pointer;
}

/* Тёмный кружок с белой галочкой — тот же приём, что и в .task-project-row__check
   (checkbox-check-v2.svg по умолчанию тёмный, на тёмном фоне нужен invert). Пользователь
   явно попросил именно этот стиль вместо плоской галочки из макета — так виднее,
   какой вариант выбран. */
.task-create-sheet__repeat-check {
    display: none;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1c2233;
    align-items: center;
    justify-content: center;
}

.task-create-sheet__repeat-check img {
    width: 11px;
    height: 11px;
    filter: invert(1);
}

.task-create-sheet__repeat-option.is-selected .task-create-sheet__repeat-check {
    display: flex;
}

/* --- "Приоритет"/"Статус": строка с иконкой+названием+значением-пилюлей (см. Figma
   "все варианты выбранных" — заменяет тумблер целиком, тогда как Дата/Время/Повтор его
   сохраняют). Тап по строке разворачивает список вариантов; выбор варианта сворачивает
   список и показывает цветную пилюлю вместо шеврона. Цветные иконки пламени per-уровню
   приоритета и та же тёмная галочка-бейдж, что у "Повтор", вместо плоской галочки
   из макета. --- */

/* Дедлайн/Напоминание используют .task-create-sheet__feature-row на <div> (только
   тумблер внутри кликабелен) — у Приоритета/Статуса кликабельна вся строка целиком,
   поэтому она <button>. Ничего в цепочке классов не сбрасывало нативный вид кнопки
   (рамка/фон браузера по умолчанию) и её "по ширине контента" — отсюда рамка вокруг
   кнопки вместо рамки вокруг иконки/пилюли и "не на всю ширину" в баг-репорте. */
.task-create-sheet__value-row {
    width: 100%;
    border: none;
    background: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.task-create-sheet__value-pill[hidden] {
    display: none;
}

.task-create-sheet__value-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 6px 14px 6px 6px;
    border-radius: 24px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

/* У "Статус" иконка (белая) лежит прямо на цветном фоне пилюли без подложки —
   у "Приоритет" наоборот, свой цветной кружок под белым бейджем (см. ниже). Раньше
   это правило было завязано на #task-create-status-pill — конкретный id ЕДИНСТВЕННОГО
   статус-пилюли в форме создания, который никогда не совпадал с id-паттерном
   task-create-<taskId>-status-pill у карточек в списке (см. task-detail-fields.php),
   так что там статус-пилюля всегда получала чужой (для приоритета) паддинг. */
.task-create-sheet__value-pill--status {
    padding: 6px 14px;
}

.task-create-sheet__value-pill img {
    width: 16px;
    height: 16px;
}

.task-create-sheet__value-pill-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
}

.task-create-sheet__value-pill-badge img {
    width: 12px;
    height: 12px;
}

.task-create-sheet__priority-list[hidden] {
    display: none;
}

.task-create-sheet__priority-list {
    display: flex;
    flex-direction: column;
}

.task-create-sheet__priority-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: none;
    font-family: inherit;
    font-size: 15px;
    color: #1c2233;
    text-align: left;
    cursor: pointer;
}

.task-create-sheet__priority-option img:first-child {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
}

.task-create-sheet__priority-option span:first-of-type {
    flex: 1;
}

/* Баг: этот селектор раньше был .task-create-sheet__repeat-option.is-selected — не
   совпадал с .task-create-sheet__priority-option, поэтому галочка никогда не показывалась. */
.task-create-sheet__priority-option.is-selected .task-create-sheet__repeat-check {
    display: flex;
}

.task-create-sheet__toggle {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    width: 44px;
    height: 26px;
}

.task-create-sheet__toggle input {
    /* Настоящий чекбокс остаётся в DOM (семантика/будущая логика), но визуально
       скрыт — вид переключателя целиком рисует .task-create-sheet__toggle-track. */
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    /* Без этого палец при горизонтальном драге тоггла может увести жест в скролл
       шторки на телефоне — см. DraggableToggle в app.js. */
    touch-action: none;
}

.task-create-sheet__toggle-track {
    position: absolute;
    inset: 0;
    background: #e3e3e6;
    border-radius: 999px;
    pointer-events: none;
    transition: background-color 0.2s ease;
}

.task-create-sheet__toggle-track::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 22px;
    height: 22px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    /* --knob-x во время драга (DraggableToggle в app.js) двигает кружок пальцем в
       реальном времени; без активного драга он просто равен 0 или 18px по чекнутости. */
    transform: translateX(var(--knob-x, 0px));
    transition: transform 0.2s ease;
}

.task-create-sheet__toggle input:checked + .task-create-sheet__toggle-track {
    background: #1c2233;
}

.task-create-sheet__toggle input:checked + .task-create-sheet__toggle-track::before {
    --knob-x: 18px;
}

/* Во время активного драга снимаем transition — кружок должен идти строго за пальцем,
   без задержки, а не "догонять" его. Плавный transition возвращается только на "доводку". */
.task-create-sheet__toggle.is-dragging .task-create-sheet__toggle-track,
.task-create-sheet__toggle.is-dragging .task-create-sheet__toggle-track::before {
    transition: none;
}

/* --- "Ответственный" (макет node 1:71/5:631/1:323/5:1167) — стопка аватарок вместо
   тумблера, когда назначены люди; .task-create-sheet__toggle--display — тот же тумблер,
   что и у Дедлайна/Напоминания, но без <input> внутри (чисто визуальный, всегда "выкл",
   тап по всей строке открывает пикер вместо переключения состояния). --- */
.task-create-sheet__assignee-avatars[hidden] {
    display: none;
}

.task-create-sheet__assignee-avatars {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.task-create-sheet__assignee-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #c7c9d1;
    border: 2px solid #f4f4f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    margin-left: -8px;
}

.task-create-sheet__assignee-avatar:first-child {
    margin-left: 0;
}

.task-create-sheet__assignee-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.task-create-sheet__assignee-avatar--more {
    background: #1c2233;
    font-size: 11px;
}

.task-assignee-picker__section-title {
    padding: 16px 20px 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #9498a3;
    text-transform: uppercase;
}

/* --- шторка выбора "Проекта" (переиспользует .folder-chat-row/.chat-item-compact) --- */

.task-project-picker-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 36px;
    padding: 0 16px;
}

.task-project-picker-sheet__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1c2233;
}

.task-project-picker-sheet__spacer,
.task-project-picker-sheet__search-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.task-project-picker-sheet__search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    cursor: pointer;
}

.task-project-picker-sheet__search-btn img {
    width: 20px;
    height: 20px;
}

.task-project-picker-sheet__search-wrap {
    display: none;
    padding: 8px 16px 0;
}

.task-project-picker-sheet__search-wrap.is-visible {
    display: block;
}

.task-project-picker-sheet__search-input {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 20px;
    background: #f4f4f5;
    font-family: inherit;
    font-size: 16px;
    color: #1c2233;
}

.task-project-picker-sheet__list {
    padding: 12px 16px 24px;
    max-height: 50vh;
    overflow-y: auto;
}

/* При активном поиске шторка разворачивается почти на весь экран — как "Новый чат"
   (см. .new-chat-sheet.is-expanded), тот же паттерн. */
.task-project-picker-sheet.is-expanded {
    height: 98dvh;
    display: flex;
    flex-direction: column;
    transition: height 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.task-project-picker-sheet.is-expanded .task-project-picker-sheet__list {
    flex: 1;
    max-height: none;
}

.task-project-row {
    position: relative;
}

/* --- шторка выбора "Ярлыка" (task_projects) — переиспользует .new-chat-sheet.is-expanded
   (та же "почти на весь экран" шторка, что и архив задач) + .task-filter-menu__action/
   __new-project (создание нового ярлыка — та же строка+инпут, что и в меню "Все"). --- */
.task-project-label-sheet__actions {
    padding: 8px 16px 0;
}

.task-project-row__check {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1c2233;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-project-row__check img {
    width: 12px;
    height: 12px;
    filter: invert(1);
}

/* --- меню кнопки "Все" в разделе "Задачи" (шапка/подвал, макет node 1:2962) —
   лёгкие проекты-ярлыки для фильтрации + архив выполненных. Живёт внутри
   .chats-navbar (position:relative) как сосед кнопки "Все" и якорится absolute
   прямо над ней (навбар внизу экрана) — как .task-sort-menu якорится под своей
   кнопкой, только в другую сторону. Раньше был position:fixed по центру экрана,
   из-за чего меню "улетало" не рядом с кнопкой. */

.task-filter-menu {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: calc(100% + 8px);
    z-index: 30;
    display: flex;
    padding: 12px 8px;
    border-radius: 24px;
    background: rgba(245, 245, 245, 0.9);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 70vh;
    overflow-y: auto;
}

.task-filter-menu[hidden] {
    display: none;
}

.task-filter-menu__col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.task-filter-menu__divider {
    width: 1px;
    align-self: stretch;
    background: #e6e6e6;
    margin: 4px 8px;
}

.task-filter-menu__action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 8px;
    border: none;
    background: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    color: #333;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
}

.task-filter-menu__action:active {
    background: rgba(0, 0, 0, 0.04);
}

.task-filter-menu__action img {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.task-filter-menu__new-project {
    padding: 4px 8px 8px;
}

.task-filter-menu__new-project[hidden] {
    display: none;
}

.task-filter-menu__new-project input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: none;
    border-radius: 12px;
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    color: #1c2233;
}

.task-filter-menu__filter {
    width: 100%;
    padding: 10px 8px;
    border: none;
    background: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 16px;
    color: #333;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-filter-menu__filter:active {
    background: rgba(0, 0, 0, 0.04);
}

.task-filter-menu__filter.is-selected {
    background: #e2e2e4;
    font-weight: 600;
}

/* --- /telegram/link/ — страница привязки аккаунта, открывается кнопкой web_app
   из бота, живёт вне общего #app-каркаса (своя отдельная простая страница). --- */
.tg-link {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #f4f4f5;
}

.tg-link__card {
    width: 100%;
    max-width: 360px;
    padding: 28px 24px;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 4px 40px rgba(136, 136, 136, 0.14);
    text-align: center;
}

.tg-link__title {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 700;
    color: #1c2233;
}

.tg-link__subtitle {
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.4;
    color: #787b83;
}

.tg-link__confirm-btn {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 26px;
    background: #1c2233;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.tg-link__confirm-btn:disabled {
    opacity: 0.5;
}

.tg-link__status {
    margin: 14px 0 0;
    font-size: 14px;
    color: #1c2233;
}

/* --- Аккаунт заблокирован (см. js/socket.js showBlockedScreen) — перекрывает ЛЮБУЮ
   страницу приложения поверх всего, независимо от того, что там уже отрисовано. --- */

#account-blocked-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--color-bg);
}

.account-blocked-screen__card {
    max-width: 320px;
    text-align: center;
}

.account-blocked-screen__title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
}

.account-blocked-screen__text {
    margin: 0 0 24px;
    font-size: 15px;
    line-height: 1.4;
    color: var(--color-text-secondary);
}

.account-blocked-screen__btn {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 24px;
    background: var(--color-accent);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
