
    @property --sheet-p { syntax: '<number>'; inherits: false; initial-value: 0; }
    .ui-sheet { position: fixed; inset: 0; z-index: 95; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgb(0 0 0 / 35%); }
    .ui-sheet[hidden] { display: none; }
    .ui-panel { position: relative; display: flex; flex-direction: column; width: min(520px, 100%); max-height: min(720px, calc(100dvh - 32px));
        border-radius: 26px; background: var(--surface); color: var(--fg); font-family: var(--font-sans); overflow: hidden;
        box-shadow: 0 30px 80px -20px rgb(0 0 0 / 45%); }
    .ui-panel.wide { width: min(720px, 100%); }
    .ui-top { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; padding: 16px 16px 10px; }
    .ui-top h2 { margin: 0; text-align: center; font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ui-round { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--border); border-radius: 50%;
        background: var(--surface-2); color: var(--fg); cursor: pointer; }
    .ui-round[hidden] { display: none; }
    .ui-round .icon { width: 18px; height: 18px; }
    .ui-round.ok { background: var(--fg); border-color: var(--fg); color: var(--bg); }
    .ui-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 14px 16px; overscroll-behavior: contain; }
    .ui-foot { padding: 10px 14px 16px; }
    .ui-cap { padding: 14px 14px 6px; color: var(--fg-muted); font-size: 13px; }
    .ui-note { margin: -4px 0 12px; padding: 0 14px; color: var(--fg-muted); font-size: 13px; line-height: 1.45; }
    .ui-none { padding: 18px 14px; color: var(--fg-faint); font-size: 14px; }
    .ui-group { margin-bottom: 12px; border-radius: 20px; background: color-mix(in srgb, var(--fg) 5%, transparent); overflow: hidden; }
    .ui-row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 14px; border: 0; background: none;
        color: var(--fg); font: inherit; font-size: 15px; text-align: left; text-decoration: none; cursor: pointer; }
    .ui-row:hover { background: color-mix(in srgb, var(--fg) 4%, transparent); }
    .ui-row[hidden] { display: none; }
    .ui-row:disabled { opacity: .45; cursor: default; }
    .ui-row + .ui-row::before { content: ''; position: absolute; left: 45px; right: 0; top: 0; border-top: 1px solid var(--border); }
    .ui-row > .icon, .ui-row > .ico { display: grid; place-items: center; width: 19px; height: 19px; flex: none; color: var(--fg-muted); }
    .ui-row > .ico .icon, .ui-row > .ico svg { width: 100%; height: 100%; }
    .ui-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ui-row .t small { display: block; margin-top: 1px; color: var(--fg-muted); font-size: .8em; overflow: hidden; text-overflow: ellipsis; }
    .ui-row .t small.mid { display: flex; min-width: 0; }
    .ui-row .t small.mid .a { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .ui-row .t small.mid .b { flex: none; max-width: 70%; overflow: hidden; text-overflow: ellipsis; }
    .ui-row .v { max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-muted); font-size: .9em; }
    .ui-row .chev { width: 15px; height: 15px; flex: none; color: var(--fg-faint); }
    .ui-row .tick { width: 18px; height: 18px; flex: none; color: var(--link); }
    .ui-row.danger, .ui-row.danger > .icon { color: var(--danger); }
    .ui-sw { position: relative; width: 40px; height: 24px; flex: none; border-radius: 999px; background: var(--surface-3); transition: background .15s; }
    .ui-sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
        box-shadow: 0 2px 4px rgb(0 0 0 / 25%); transition: transform .15s; }
    .ui-sw.on { background: var(--link); }
    .ui-sw.on::after { transform: translateX(16px); }
    .ui-search { display: flex; align-items: center; gap: 10px; height: 40px; margin: 0 0 12px; padding: 0 14px; border-radius: 999px;
        background: color-mix(in srgb, var(--fg) 5%, transparent); color: var(--fg-muted); }
    .ui-search .icon { width: 16px; height: 16px; flex: none; }
    .ui-search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: var(--fg); font: inherit; font-size: 15px; }
    /* Кнопка фильтра (воронка) везде: фильтр не по умолчанию — синяя точка в уголке (.has-filter). */
    .has-filter { position: relative; }
    .has-filter::after { content: ''; position: absolute; top: 12%; right: 12%; width: 8px; height: 8px; border-radius: 50%; background: #2f7cf6;
        box-shadow: 0 0 0 2px var(--bg); pointer-events: none; }
    .ui-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 46px; border: 0; border-radius: 999px;
        background: var(--fg); color: var(--bg); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; }
    .ui-btn .icon { width: 18px; height: 18px; }
    .ui-btn[hidden] { display: none; }

    /* Телефон и планшет: у круглых кнопок, капсул и поля ввода — тонкий контур, как у кнопок настроек.
       outline не двигает раскладку и идёт по скруглению. */
    @media (max-width: 899px) {
        :is(.chats-btn, .top-search, .foot-new, .m-new, .m-pill, .m-btn, .main .topbar-right, .main .topbar :is(.m-back, .m-ppill),
            .main .composer-wrap .composer, .home-composer .composer, .main .topbar .home-head, .sidebar-foot .user-pill .user-avatar, .area-switch, .ui-round, .ui-search) {
            outline: 1px solid color-mix(in srgb, var(--fg) 11%, transparent); outline-offset: -1px;
        }
    }

    @media (max-width: 640px) {
        .ui-sheet { padding: 0; align-items: flex-end; background: rgb(0 0 0 / 26%);
            top: var(--vvt, 0px); bottom: var(--vvb, 0px); height: var(--vvh, auto); overscroll-behavior: contain; }
        /* Как в iOS 26: 7 px от краёв и от низа экрана, скругление — вровень с углами телефона. */
        .ui-panel, .ui-panel.wide { width: calc(100% - 14px + 14px * var(--sheet-p, 0)); max-height: calc(var(--vvh, 100dvh) - 14px - env(safe-area-inset-top, 0px));
            margin: 0 calc(7px - 7px * var(--sheet-p, 0)) calc(7px - 7px * var(--sheet-p, 0)); border-radius: 44px;
            background: color-mix(in srgb, var(--surface) 80%, transparent); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
            box-shadow: 0 20px 60px -10px rgb(0 0 0 / 35%), inset 0 0 0 .5px rgb(255 255 255 / 18%);
            animation: ui-in .42s cubic-bezier(.32, .72, 0, 1); will-change: transform; }
        :is(.ui-card, .p-veil .p-dialog, .pk-veil .pk-box, .st-veil .st-box, .bd-scrim .bd) { border-radius: 44px !important; background: color-mix(in srgb, var(--surface) 82%, transparent) !important;
            -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
            outline: 1px solid color-mix(in srgb, var(--fg) 10%, transparent); outline-offset: -1px; box-shadow: 0 20px 60px -10px rgb(0 0 0 / 40%) !important; }
        .ui-card.ui-grab::before { content: ''; position: absolute; top: 8px; left: 50%; z-index: 4; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--border-strong); }
        .ui-panel.full { height: calc(var(--vvh, 100dvh) - 14px - env(safe-area-inset-top, 0px)); }
        /* Полвысоты и во весь экран (FzSheet в partials/fz): карточка встаёт не выше --sheet-mid — дотянуться
           пальцем; потянули вверх — .sheet-full: до строки состояния и к краям экрана (--sheet-p 0→1 — отступы). */
        [data-sheet-wired]:not(.full):not(.st-box):not(.sheet-full) { max-height: min(calc(var(--vvh, 100dvh) - 14px - env(safe-area-inset-top, 0px)), var(--sheet-mid, 56dvh)) !important; }
        [data-sheet-wired][data-sheet-wired].sheet-full { --sheet-p: 1; height: calc(var(--vvh, 100dvh) - 10px - env(safe-area-inset-top, 0px)) !important; max-height: none !important; }
        /* Низ шторки — над полоской «домой»: она лежит поверх карточки. */
        .ui-body { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px) * .6); }
        .ui-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px) * .6); }
        .ui-panel::before { content: ''; position: absolute; top: 8px; left: 50%; z-index: 4; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--border-strong); }
        @keyframes ui-in { from { transform: translateY(105%); } }
        .ui-top { grid-template-columns: 50px 1fr 50px; padding: 22px 14px 12px; }
        .ui-top h2 { font-size: 18px; }
        .ui-round { width: 48px; height: 48px; }
        .ui-round .icon { width: 21px; height: 21px; }
        .ui-body { padding: 0 12px 16px; }
        .ui-foot { padding: 10px 14px 14px; }
        .ui-cap { padding: 16px 16px 8px; font-size: 15px; }
        .ui-note { font-size: 14px; padding: 0 16px; }
        .ui-group { border-radius: 24px; background: color-mix(in srgb, var(--fg) 6%, transparent); }
        .ui-row { min-height: 52px; gap: 14px; padding: 0 16px; font-size: 17px; }
        .ui-row:hover { background: none; }
        .ui-row + .ui-row::before { left: 52px; right: 18px; border-top-width: .5px; border-color: color-mix(in srgb, var(--fg) 14%, transparent); }
        .ui-row:not(:has(> .ico, > .icon:first-child)) + .ui-row:not(:has(> .ico, > .icon:first-child))::before { left: 18px; }
        .ui-group { margin-bottom: 14px; border-radius: 28px; }
        .ui-group:has(> .ui-row:only-child) { border-radius: 999px; }
        .ui-group > .ui-row:only-child { min-height: 58px; padding: 0 20px; }
        .ui-row { padding: 0 18px; }
        .ui-row .t small { margin-top: 3px; font-size: 15px; line-height: 1.3; }
        .ui-row > .icon, .ui-row > .ico { width: 22px; height: 22px; }
        .ui-row .chev { width: 16px; height: 16px; }
        .ui-sw { width: 52px; height: 32px; }
        .ui-sw::after { top: 3px; left: 3px; width: 26px; height: 26px; }
        .ui-sw.on::after { transform: translateX(20px); }
        .ui-search { height: 46px; padding: 0 16px; }
        .ui-search input { font-size: 17px; }
        .ui-btn { height: 52px; font-size: 17px; }
    }
    /* Телефон: одна мерка для всех кнопок — круглые (назад, панель, фильтр, поиск, закрыть, аватарка)
       и таблетки («Новый чат», «Новый проект», действия) — 46px, значок внутри — 22px. Поля ввода в строке
       сообщения сюда не входят. */
    @media (max-width: 640px) {
        html body :is(.ui-round, .chats-btn, .main .topbar .m-back, .pm-round, .m-back, .m-x, .p-veil .p-dialog-head .icon-btn,
            .fs-close, .st-box .st-top .st-round, .ss .ss-btn, .docview-bar :is(.shut, .get), .tf .tf-x, .filespanel .fp-x,
            .main .topbar-right .files-main) { width: 46px !important; height: 46px !important; min-width: 46px; padding: 0 !important; }
        html body :is(.pm-new, .foot-new, .m-new, .m-add, .pm-find label, .fs-field, .p-veil .p-dialog .actions .p-btn, .ui-btn, .main .topbar .m-ppill) { height: 46px !important; min-height: 46px; }
        :is(html body :is(.ui-round, .chats-btn, .main .topbar .m-back, .top-search, .pm-round, .m-back, .m-x, .p-veil .p-dialog-head .icon-btn,
            .fs-close, .st-box .st-top .st-round, .ss .ss-btn, .docview-bar :is(.shut, .get), .tf .tf-x, .filespanel .fp-x,
            .main .topbar-right > .files-btn, .main .topbar-right .files-main), html body :is(.pm-new, .foot-new, .m-new, .m-add, .pm-find label, .fs-field, .p-veil .p-dialog .actions .p-btn, .ui-btn, .main .topbar .m-ppill)) :is(.icon, svg:not(.fz-avatar svg)) { width: 22px !important; height: 22px !important; }
        .sidebar .sidebar-foot .user-pill .user-avatar { --fz-avatar-size: 46px; }
        /* Круглая кнопка — один вид везде (как кнопка панели): светлое стекло без рамки и мягкая тень.
           Для новых кнопок — класс .fz-glass; старые перечислены здесь, чтобы не трогать разметку.
           Лупа панели, дотянутая до «Поиск» (.ready, partials/search-palette), — своя синяя таблетка. */
        :root { --glass-bg: color-mix(in srgb, var(--surface) 62%, transparent); --glass-shadow: 0 6px 22px rgb(0 0 0 / 14%); }
        :root[data-theme="dark"] { --glass-bg: color-mix(in srgb, #3a3a37 62%, transparent); --glass-shadow: 0 6px 22px rgb(0 0 0 / 40%); }
        @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --glass-bg: color-mix(in srgb, #3a3a37 62%, transparent); --glass-shadow: 0 6px 22px rgb(0 0 0 / 40%); } }
        html body :is(.fz-glass, .ui-round, .chats-btn, .main .topbar .m-back, .pm-round, .m-back, .m-x, .p-veil .p-dialog-head .icon-btn,
            .fs-close, .st-box .st-top .st-round, .ss .ss-btn, .docview-bar :is(.shut, .get), .tf .tf-x, .filespanel .fp-x,
            .mk-tools .mk-ib, .mk-dock [id="mkSearch"], .mk-find-x, .sidebar .top-search:not(.ready), .main .topbar-right, .tm-room .tm-tools .tm-plus, .tm-room .tm-pcall) {
            border: 0 !important; outline: 0 !important; color: var(--fg); background: var(--glass-bg) !important; box-shadow: var(--glass-shadow) !important;
            -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); }
        html body :is(.fz-glass, .ui-round, .pm-round, .m-back, .m-x, .mk-tools .mk-ib, .mk-dock [id="mkSearch"], .mk-find-x, .sidebar .top-search:not(.ready), .tm-room .tm-tools .tm-plus) { border-radius: 50% !important; }
        html body :is(.pm-dock .pm-round, .sidebar .top-search:not(.ready), .fz-glass, .tm-room .tm-tools .tm-plus) { width: 46px !important; height: 46px !important; min-width: 46px; padding: 0 !important; }
        html body :is(.mk-tools .mk-ib, .mk-dock [id="mkSearch"], .mk-find-x, .sidebar .top-search:not(.ready), .pm-round, .fz-glass, .tm-room .tm-tools .tm-plus, .tm-room .tm-pcall) :is(.icon, svg) { width: 22px !important; height: 22px !important; }
        html body:not(.files-open) .main .topbar-right { padding: 2px !important; }
        html body:not(.files-open) .main .topbar-right > :is(button, a) { width: 42px !important; height: 42px !important; min-width: 42px; }
        html body:not(.files-open) .main .topbar-right > :is(button, a) .icon { width: 22px; height: 22px; }
        html body.files-open.ws-file .ws-pill { height: 46px !important; padding: 0 2px !important; }
        html body.files-open.ws-file .ws-pill :is(.get, .ws-act, .ws-icon, .ws-more, .fzt-tbtn .b) { width: 42px !important; height: 42px !important; }
        html body.files-open.ws-file .ws-pill :is(.get, .ws-act, .ws-icon, .ws-more, .fzt-tbtn .b) .icon { width: 22px !important; height: 22px !important; }
    }
    /* Сенсорный экран (телефон, планшет): выпадающие меню крупные, как у Claude — строки 50px, текст 17px, значки 22px. */
    @media (hover: none) and (pointer: coarse) {
        html body :is(.slm, .mk-pop, .row-menu, .p-menu, .tm-drop) { min-width: 250px; max-width: calc(100vw - 24px); padding: 6px; border-radius: 26px; }
        html body :is(.slm, .mk-pop, .row-menu, .p-menu, .tm-drop) :is(button, a) { min-height: 50px; gap: 14px; padding: 0 16px; border-radius: 20px; font-size: 17px; }
        html body :is(.slm, .mk-pop, .row-menu, .p-menu, .tm-drop) :is(button, a) :is(.icon, svg, .ok) { width: 22px; height: 22px; }
        html body .slm button.two { padding-top: 10px; padding-bottom: 10px; }
        html body .slm button .l small { font-size: 15px; }
        html body .slm .head { padding: 10px 16px 6px; font-size: 15px; }
        html body .slm .note { padding: 6px 16px 10px; font-size: 14px; line-height: 1.4; white-space: normal; }
        html body .slm .sep { height: .5px; margin: 6px 16px; }
    }
