/* Знакора: чаты и поле ввода (js/chat-tools.js, js/composer-tools.js) */
.zt-overlay { display: flex; z-index: 10040; }
.zt-dialog { width: min(480px, calc(100vw - 24px)); max-height: min(760px, calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); display: flex; flex-direction: column; overflow: hidden; outline: 0; }
.zt-dialog.zt-wide { width: min(620px, calc(100vw - 24px)); }
.zt-body { display: flex; flex-direction: column; gap: 12px; padding: 4px 18px 20px; overflow: auto; overscroll-behavior: contain; }
.zt-note { margin: 0; color: var(--text-sec); font-size: 13px; line-height: 1.45; }
.zt-error { margin: 0; color: var(--danger); font-size: 14px; line-height: 1.4; }
.zt-error:empty { display: none; }
.zt-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-radius: 18px; background: var(--surface, rgba(127, 127, 127, .08)); cursor: pointer; }
.zt-row span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.zt-row b { font-weight: 500; font-size: 15px; color: var(--text-main); }
.zt-row small { color: var(--text-sec); font-size: 13px; line-height: 1.35; }
.zt-row input, .zt-day input[type=checkbox] { width: 22px; height: 22px; flex: 0 0 auto; accent-color: var(--primary); }
.zt-options { display: flex; flex-direction: column; gap: 8px; }
.zt-option { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid transparent; border-radius: 18px; background: var(--surface, rgba(127, 127, 127, .08)); color: var(--text-main); font: inherit; text-align: start; cursor: pointer; transition: background .16s, transform .16s; }
.zt-option:hover { background: var(--surface-raised); }
.zt-option:active { transform: scale(.985); }
.zt-option[aria-pressed="true"] { border-color: var(--primary); }
.zt-option b { font-weight: 600; font-size: 15px; }
.zt-option small { color: var(--text-sec); font-size: 13px; }
.zt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.zt-chip { padding: 8px 14px; border: 0; border-radius: 16px; background: var(--surface, rgba(127, 127, 127, .08)); color: var(--text-sec); font: inherit; font-size: 14px; cursor: pointer; }
.zt-chip[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.zt-log { display: flex; flex-direction: column; min-height: 120px; }
.zt-log-day { margin: 14px 2px 6px; color: var(--text-sec); font-size: 13px; font-weight: 600; letter-spacing: 0; }
.zt-log-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; padding: 8px 0; align-items: start; }
.zt-log-row img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.zt-log-row p { margin: 0; text-align: left; font-size: 15px; line-height: 1.4; color: var(--text-main); overflow-wrap: anywhere; }
.zt-log-row b { font-weight: 600; }
.zt-log-row small, .zt-log-row time { color: var(--text-sec); font-size: 12px; }
.zt-days { display: flex; flex-direction: column; border-radius: 18px; background: var(--surface, rgba(127, 127, 127, .08)); transition: opacity .18s; }
.zt-days.is-off { opacity: .55; }
.zt-day { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center; padding: 8px 12px; }
.zt-day label { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text-main); font-size: 15px; cursor: pointer; }
.zt-day .input { width: auto; min-width: 0; padding: 7px 9px; font-size: 16px; }
.zt-day > span { color: var(--text-sec); }
.zt-form { display: flex; flex-direction: column; gap: 12px; }
.zt-text { width: 100%; resize: vertical; min-height: 96px; font-size: 16px; }
.zt-field { display: flex; flex-direction: column; gap: 6px; color: var(--text-sec); font-size: 14px; }
.zt-field .input { font-size: 16px; }
@media (max-width: 420px) { .zt-day { grid-template-columns: minmax(0, 1fr) auto auto; } .zt-day label { grid-column: 1 / -1; } .zt-day > span { text-align: center; } }

/* Архив */
.zt-archive-row { display: flex; align-items: center; gap: 12px; width: calc(100% - 16px); margin: 2px 8px 4px; padding: 9px 12px; border: 0; border-radius: 14px; background: transparent; color: var(--text-main); font: inherit; text-align: start; cursor: pointer; }
.zt-archive-row:hover { background: var(--hover); }
.zt-archive-icon { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border-radius: 50%; background: var(--bg-tertiary, var(--surface)); color: var(--text-sec); }
.zt-archive-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.zt-archive-copy b { font-weight: 600; font-size: 14px; }
.zt-archive-copy small { overflow: hidden; color: var(--text-sec); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.zt-archive-row em { font-style: normal; }
.unread-badge.zt-mark { min-width: 12px; width: 12px; height: 12px; padding: 0; border-radius: 50%; }

/* Скрытый текст */
.zt-spoiler { padding: 0 2px; border-radius: 5px; background: color-mix(in srgb, currentColor 34%, transparent); cursor: pointer; transition: background .2s; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.zt-spoiler > span { opacity: 0; transition: opacity .2s; }
.zt-spoiler:not(.is-shown) { user-select: none; -webkit-user-select: none; }
.zt-spoiler:not(.is-shown) > span { pointer-events: none; }
.zt-spoiler.is-shown { background: color-mix(in srgb, currentColor 10%, transparent); }
.zt-spoiler.is-shown > span { opacity: 1; }
.zt-spoiler:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }

/* Отмена отправки и удаления */
.zc-dock { position: absolute; left: 50%; bottom: 92px; z-index: 11; width: calc(100% - 48px); max-width: 880px; transform: translateX(-50%); pointer-events: none; }
.zc-dock > * > * { pointer-events: auto; }
#messages-feed::after { content: ''; display: block; flex: 0 0 auto; height: var(--zc-dock, 0px); }
@media (max-width: 767px) { .zc-dock { width: calc(100% - 20px); } }
.zc-pending { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding: 2px 0 8px; animation: zc-in .24s cubic-bezier(.2, 1.2, .4, 1); transform-origin: bottom right; }
.zc-pending-text { max-width: min(74%, 520px); padding: 9px 14px; border-radius: 17px; background: var(--msg-out); color: var(--text-msg-out); font-size: var(--chat-font-size, 15px); line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.zc-undo { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 13px; border: 0; border-radius: 20px; background: var(--surface-raised); color: var(--text-main); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 3px 14px rgba(0, 0, 0, .16); }
.zc-undo:hover { background: var(--hover); }
.zc-ring { position: relative; display: inline-grid; place-items: center; width: 24px; height: 24px; color: var(--primary); font-size: 11px; font-variant-numeric: tabular-nums; }
.zc-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.zc-ring circle { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 63; animation: zc-ring var(--time, 4s) linear forwards; }
.zc-toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 10070; display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); padding: 10px 12px 10px 18px; border-radius: 22px; background: var(--surface-raised); color: var(--text-main); font-size: 15px; box-shadow: 0 8px 32px rgba(0, 0, 0, .24); transform: translateX(-50%); animation: zc-toast .24s ease; }
.zc-toast .zc-undo { box-shadow: none; background: transparent; color: var(--primary); }
.msg-row.zc-removing { display: none; }
@keyframes zc-ring { to { stroke-dashoffset: 63; } }
@keyframes zc-in { from { opacity: 0; transform: scale(.9); } }
@keyframes zc-toast { from { opacity: 0; transform: translate(-50%, 14px); } }

/* Подсказки */
.zc-hints { display: flex; align-items: center; gap: 6px; padding: 2px 2px 2px; overflow-x: auto; scrollbar-width: none; }
.zc-hints:empty { display: none; }
.zc-hint { flex: 0 0 auto; padding: 6px 12px; border: 0; border-radius: 16px; background: var(--surface-raised); color: var(--text-main); font: inherit; font-size: 15px; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); animation: zc-in .18s ease; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zc-hint.is-emoji { padding: 5px 9px; font-size: 20px; line-height: 1.2; }
.zc-hint:hover { background: var(--hover); }

/* Голосовые */
.zc-transcribe { margin-top: 6px; padding: 4px 10px; border: 0; border-radius: 12px; background: color-mix(in srgb, currentColor 12%, transparent); color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.zc-transcribe:disabled { opacity: .7; }
.zc-transcript { margin: 6px 2px 2px; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
.zc-listen { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 20px; background: var(--surface-raised); }
.zc-listen audio { flex: 1; min-width: 0; height: 38px; }

/* Загрузка */
.upl-note { color: var(--text-sec); font-size: 12px; }
.upl-note:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .zc-pending, .zc-toast, .zc-hint { animation: none; } .zt-spoiler, .zt-spoiler > span { transition: none; } }
