/* Kira v0.6: разметка ответов, файлы, реклама, презентации, стоп и правка, меню бесед, камера, загрузка. */

/* ---------- Разметка ответа (Markdown, таблицы, формулы) ---------- */
.md { white-space: normal; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 0.7em; }
.md h2, .md h3, .md h4 { margin: 1.1em 0 0.45em; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.md h2 { font-size: 1.22em; }
.md h3 { font-size: 1.1em; }
.md h4 { font-size: 1em; color: #ddd; }
.md ul, .md ol { margin: 0 0 0.75em; padding-left: 1.35em; }
.md li { margin: 0.22em 0; padding-left: 0.15em; }
.md ul > li::marker { color: var(--muted); }
.md ol > li::marker { color: var(--muted); font: 600 0.85em var(--mono); }
.md strong { font-weight: 700; color: #fff; }
.md em { font-style: italic; color: #e6e6e6; }
.md del { color: var(--muted); text-decoration-color: #f87171; }
.md mark { background: linear-gradient(transparent 52%, rgba(250, 204, 21, 0.38) 52%); color: inherit; padding: 0 0.08em; border-radius: 2px; }
.md a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.4); text-underline-offset: 3px; }
.md hr { border: 0; height: 1px; margin: 1em 0; background: repeating-linear-gradient(90deg, var(--line-strong) 0 4px, transparent 4px 8px); }
.md blockquote { margin: 0 0 0.75em; padding: 2px 0 2px 12px; border-left: 2px solid var(--line-strong); color: #cfcfcf; }
.md code { padding: 0.1em 0.38em; border-radius: 6px; background: #161616; border: 1px solid var(--line); font: 0.86em var(--mono); }
.md-code { margin: 0 0 0.8em; border-radius: 14px; border: 1px solid var(--line-strong); background: #070707; overflow: hidden; box-shadow: 3px 3px 0 rgba(255, 255, 255, 0.06); }
.md-code__head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--line); font: 600 10.5px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.md-code__head button { padding: 4px 9px; border-radius: 8px; border: 1px solid var(--line-strong); font: 500 10.5px var(--mono); text-transform: none; letter-spacing: 0; color: #ddd; }
.md-code pre { margin: 0; padding: 12px; overflow-x: auto; }
.md-code code { padding: 0; border: 0; background: none; font: 12.5px/1.6 var(--mono); font-variant-ligatures: none; font-feature-settings: "calt" 0, "liga" 0; white-space: pre; }
.md-table { margin: 0 0 0.85em; overflow-x: auto; border-radius: 14px; border: 1px solid var(--line-strong); background: #050505; -webkit-overflow-scrolling: touch; }
.md-table table { border-collapse: collapse; min-width: 100%; font-size: 14px; }
.md-table th, .md-table td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); white-space: nowrap; }
.md-table td { white-space: normal; min-width: 90px; }
.md-table th { font: 700 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: #111; }
.md-table tr:last-child td { border-bottom: 0; }
.md-table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.025); }
.md-math { font-family: var(--mono); font-size: 0.92em; color: #ddd; }
.md-math.is-display { display: block; margin: 0.2em 0 0.85em; padding: 12px 14px; overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); background: #070707; text-align: center; }
.md-math.is-ready { font-family: inherit; color: inherit; }
.md-math .katex { font-size: 1.08em; }
.md-math.is-display .katex-display { margin: 0; }

/* ---------- Карточки файлов ---------- */
.file-cards { display: grid; gap: 8px; margin: 12px 0 4px; }
.file-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 10px 10px 10px; text-align: left; border-radius: 18px; border: 1px solid var(--line-strong);
  background-color: #070707; background-image: var(--dots); background-size: 7px 7px; box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.08);
  animation: file-in 0.45s cubic-bezier(0.2, 1.2, 0.35, 1) both; animation-delay: calc(var(--i, 0) * 70ms); transition: transform 0.15s, box-shadow 0.15s; }
.file-card:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 rgba(255, 255, 255, 0.08); }
@keyframes file-in { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
.file-card__icon { position: relative; flex: none; width: 50px; height: 56px; display: grid; place-items: center; border-radius: 10px 16px 10px 10px; background: #fff; color: #000; }
.file-card__icon::before { content: ""; position: absolute; top: 0; right: 0; width: 14px; height: 14px; border-radius: 0 0 0 6px; background: #c9c9c9; }
.file-card__icon .kemoji { width: 26px; height: 26px; margin-top: -8px; }
.file-card__icon i { position: absolute; bottom: 5px; left: 0; right: 0; text-align: center; font: 800 8.5px var(--mono); font-style: normal; letter-spacing: 0.06em; }
.file-card[data-ext="pptx"] .file-card__icon, .file-card[data-ext="ppt"] .file-card__icon { background: #ffd8c2; }
.file-card[data-ext="pdf"] .file-card__icon { background: #ffd3d3; }
.file-card[data-ext="docx"] .file-card__icon, .file-card[data-ext="doc"] .file-card__icon { background: #d6e4ff; }
.file-card[data-ext="xlsx"] .file-card__icon, .file-card[data-ext="csv"] .file-card__icon { background: #d4f5df; }
.file-card__info { flex: 1; min-width: 0; display: grid; gap: 3px; }
.file-card__info b { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-card__info small { font: 400 11px var(--mono); color: var(--muted); }
.file-card__dl { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: #000; }
.file-card__dl svg { width: 20px; height: 20px; }

/* ---------- Реклама Free ---------- */
.ad-banner { margin: 12px 0 2px; padding: 12px 14px; border-radius: 18px; border: 1px dashed rgba(255, 255, 255, 0.3); background: #060606; animation: file-in 0.45s ease both 0.15s; }
.ad-banner__tag { display: inline-flex; align-items: center; gap: 6px; font: 700 10px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.ad-banner__tag .kemoji { width: 16px; height: 16px; }
.ad-banner p { margin: 6px 0 10px; font-size: 14px; line-height: 1.5; color: #e8e8e8; }
.ad-banner button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: #fff; color: #000; font: 600 13px var(--font); box-shadow: 3px 3px 0 rgba(255, 255, 255, 0.14); }
.ad-banner button svg { width: 16px; height: 16px; }

/* ---------- Презентация: форма ---------- */
.deck-form { display: grid; gap: 10px; margin: 12px 0 4px; padding: 14px; border-radius: 22px; border: 1px solid var(--line-strong); background-color: #070707; background-image: var(--dots); background-size: 7px 7px;
  box-shadow: 5px 5px 0 rgba(255, 255, 255, 0.08); animation: file-in 0.5s cubic-bezier(0.2, 1.2, 0.35, 1) both; }
.deck-form.is-sent { opacity: 0.45; pointer-events: none; filter: grayscale(1); transition: opacity 0.3s; }
.deck-form__field { display: grid; gap: 6px; }
.deck-form__field > span, .deck-form__label { font: 700 10.5px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.deck-form input, .deck-form textarea { width: 100%; padding: 11px 13px; border-radius: 14px; border: 1px solid var(--line-strong); background: #000; color: #fff; font: 15px/1.45 var(--font); resize: none; }
.deck-form input:focus, .deck-form textarea:focus { outline: none; border-color: #fff; }
.deck-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.deck-chips button { min-width: 44px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line-strong); font: 600 13px var(--mono); transition: background 0.15s, color 0.15s, transform 0.12s; }
.deck-chips button[aria-pressed="true"] { background: #fff; color: #000; border-color: #fff; box-shadow: 3px 3px 0 rgba(255, 255, 255, 0.16); }
.deck-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; }
.deck-themes button { display: grid; gap: 6px; padding: 7px; border-radius: 14px; border: 1px solid var(--line-strong); text-align: left; font: 500 11.5px var(--font); }
.deck-themes button i { height: 34px; border-radius: 8px; background: var(--bg, #111); position: relative; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.12); }
.deck-themes button i::before { content: ""; position: absolute; left: 6px; top: 7px; width: 55%; height: 5px; border-radius: 3px; background: var(--ac, #fff); }
.deck-themes button i::after { content: ""; position: absolute; left: 6px; top: 17px; width: 70%; height: 3px; border-radius: 2px; background: var(--ac, #fff); opacity: 0.35; box-shadow: 0 6px 0 currentColor; color: color-mix(in srgb, var(--ac, #fff) 35%, transparent); }
.deck-themes button[data-theme="auto"] i { background: conic-gradient(from 90deg, #101c2b, #fff, #a03663, #247d87, #101c2b); }
.deck-themes button[aria-pressed="true"] { border-color: #fff; background: rgba(255, 255, 255, 0.08); box-shadow: 3px 3px 0 rgba(255, 255, 255, 0.14); }

/* ---------- Презентация: сборка ---------- */
.deck-live { margin: 4px 0 10px; padding: 12px; border-radius: 22px; border: 1px solid var(--line-strong); background: #050505; box-shadow: 5px 5px 0 rgba(255, 255, 255, 0.07); animation: file-in 0.45s ease both; }
.deck-live.is-collapsing { animation: deck-out 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes deck-out { to { opacity: 0; transform: scale(0.94); } }
.deck-live__stage { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background-color: #0b0b0b; background-image: var(--dots); background-size: 9px 9px; border: 1px solid var(--line); perspective: 900px; }
.deck-live__slides { position: absolute; inset: 9% 7%; }
.deck-slide { position: absolute; inset: 0; padding: 7% 8%; border-radius: 8px; background: #f4f4f1; color: #111; box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55); display: grid; align-content: start; gap: 7%;
  animation: slide-in 0.62s cubic-bezier(0.2, 0.9, 0.25, 1) both; }
.deck-slide.is-out { animation: slide-out 0.6s cubic-bezier(0.5, 0, 0.75, 0) forwards; }
@keyframes slide-in { from { opacity: 0; transform: translateX(46%) rotateY(-22deg) scale(0.9); } }
@keyframes slide-out { to { opacity: 0; transform: translateX(-46%) rotateY(22deg) scale(0.9); } }
.ds-title { display: block; font: 800 clamp(9px, 3.2vw, 14px)/1.15 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; clip-path: inset(0 100% 0 0); animation: ds-type 0.7s steps(18) 0.25s forwards; }
.ds-title i { display: block; width: 62%; height: 9px; border-radius: 4px; background: #111; }
@keyframes ds-type { to { clip-path: inset(0 0 0 0); } }
.ds-sub { display: block; width: 40%; height: 5px; border-radius: 3px; background: #9a9a9a; transform-origin: left; animation: ds-grow 0.5s ease 0.8s both; }
.ds-lines { display: grid; gap: 7px; align-content: start; }
.ds-lines i { display: block; height: 5px; border-radius: 3px; background: #bdbdbd; transform-origin: left; animation: ds-grow 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(0.75s + var(--n, 0) * 0.16s); }
.ds-lines i:nth-child(1) { --n: 0; width: 92%; } .ds-lines i:nth-child(2) { --n: 1; width: 78%; } .ds-lines i:nth-child(3) { --n: 2; width: 86%; } .ds-lines i:nth-child(4) { --n: 3; width: 60%; }
@keyframes ds-grow { from { transform: scaleX(0); opacity: 0; } }
.deck-slide.is-image, .deck-slide.is-split { grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; column-gap: 8%; }
.deck-slide.is-image .ds-title, .deck-slide.is-split .ds-title { grid-column: 1 / -1; }
.ds-img { border-radius: 6px; background: linear-gradient(135deg, #2b2b2b, #6d6d6d); position: relative; overflow: hidden; animation: ds-pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) 0.6s both; }
.ds-img::before { content: ""; position: absolute; left: 14%; bottom: 0; width: 60%; height: 52%; background: #9c9c9c; clip-path: polygon(0 100%, 40% 20%, 62% 62%, 78% 40%, 100% 100%); }
.ds-img::after { content: ""; position: absolute; right: 16%; top: 18%; width: 16%; aspect-ratio: 1; border-radius: 50%; background: #e8e8e8; }
.deck-slide.is-split .ds-img { order: 2; }
@keyframes ds-pop { from { transform: scale(0.6); opacity: 0; } }
.ds-chart { display: flex; align-items: flex-end; gap: 8%; height: 60%; padding: 0 6%; }
.ds-chart i { flex: 1; border-radius: 4px 4px 0 0; background: #111; transform-origin: bottom; animation: ds-bar 0.6s cubic-bezier(0.2, 1.2, 0.4, 1) both; }
.ds-chart i:nth-child(1) { height: 40%; animation-delay: 0.7s; } .ds-chart i:nth-child(2) { height: 72%; animation-delay: 0.82s; } .ds-chart i:nth-child(3) { height: 55%; animation-delay: 0.94s; } .ds-chart i:nth-child(4) { height: 92%; animation-delay: 1.06s; background: #777; }
@keyframes ds-bar { from { transform: scaleY(0); } }
.deck-live__scan { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s; }
.deck-live.is-checking .deck-live__scan { opacity: 1; }
.deck-live__scan::before { content: ""; position: absolute; left: 0; right: 0; height: 26%; top: -26%; background: linear-gradient(transparent, rgba(160, 200, 255, 0.28) 70%, rgba(220, 235, 255, 0.95) 98%, transparent); animation: deck-scan 1.6s cubic-bezier(0.45, 0, 0.55, 1) infinite; }
.deck-live__scan::after { content: "✓"; position: absolute; right: 9%; top: 12%; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: #000; font: 800 12px var(--font); animation: deck-check 1.6s ease infinite; }
@keyframes deck-scan { to { top: 100%; } }
@keyframes deck-check { 0%, 55% { transform: scale(0); opacity: 0; } 70% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
.deck-live__num { position: absolute; right: 10px; bottom: 7px; font: 700 10px var(--mono); color: #bbb; letter-spacing: 0.08em; }
.deck-live__status { display: grid; gap: 2px; margin: 12px 4px 10px; }
.deck-live__status b { font-size: 15px; font-weight: 600; }
.deck-live__status small { font: 400 11.5px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; }
.deck-steps li { position: relative; padding: 9px 4px 7px; border-radius: 10px; border: 1px solid var(--line); text-align: center; font: 600 10px var(--mono); color: var(--dim); overflow: hidden; transition: color 0.3s, border-color 0.3s, background 0.3s; }
.deck-steps li[data-state="active"] { color: #fff; border-color: var(--line-strong); }
.deck-steps li[data-state="active"]::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 40%; background: #fff; animation: step-run 1.2s ease-in-out infinite; }
.deck-steps li[data-state="done"] { color: #000; background: #fff; border-color: #fff; }
@keyframes step-run { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

/* ---------- Стоп, правка, действия с сообщением ---------- */
.composer.is-busy .send { background: #fff; color: #000; }
.composer.is-busy .send svg { display: none; }
.composer.is-busy .send::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: currentColor; animation: stop-in 0.25s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.composer.is-busy .send::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid transparent; border-top-color: rgba(255, 255, 255, 0.85); animation: stop-spin 1s linear infinite; }
.composer.is-busy .send { position: relative; }
.composer.is-stopping .send { opacity: 0.5; }
@keyframes stop-in { from { transform: scale(0) rotate(-45deg); } }
@keyframes stop-spin { to { transform: rotate(360deg); } }
.edit-banner { display: flex; align-items: center; gap: 10px; margin: -2px 0 8px; padding: 8px 8px 8px 10px; border-radius: 14px; background: #111; border: 1px solid var(--line-strong); animation: file-in 0.3s ease both; }
.edit-banner .kemoji { width: 20px; height: 20px; flex: none; }
.edit-banner span { flex: 1; min-width: 0; display: grid; }
.edit-banner b { font: 700 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.edit-banner small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edit-banner button { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); }
.edit-banner svg { width: 14px; height: 14px; }
.msg--user[data-editable] .msg__bubble { cursor: pointer; transition: transform 0.15s; }
.msg--user[data-editable] .msg__bubble:active { transform: scale(0.97); }
.msg-actions { display: flex; gap: 6px; animation: actions-in 0.28s cubic-bezier(0.2, 1.3, 0.4, 1) both; }
.msg-actions button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: #0a0a0a; font: 500 13px var(--font); }
.msg-actions button:first-child { background: #fff; color: #000; border-color: #fff; }
.msg-actions .kemoji { width: 16px; height: 16px; }
@keyframes actions-in { from { opacity: 0; transform: translateY(-6px) scale(0.9); } }
.stream-note { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0; padding: 5px 10px; border-radius: 999px; border: 1px dashed var(--line-strong); font: 500 11.5px var(--mono); color: var(--muted); }
.stream-note .kemoji { width: 14px; height: 14px; }

/* ---------- Беседы: закрепить, переименовать, удалить ---------- */
.drawer__row { position: relative; display: flex; align-items: stretch; gap: 4px; margin-bottom: 4px; overflow: hidden; }
.drawer__row .drawer__chat { margin-bottom: 0; flex: 1; min-width: 0; }
.drawer__more { flex: none; width: 36px; display: flex; align-items: center; justify-content: center; gap: 3px; border-radius: 14px; color: var(--muted); }
.drawer__more i { width: 3.5px; height: 3.5px; border-radius: 50%; background: currentColor; }
.drawer__more:active { background: #161616; color: #fff; }
.drawer__pin { flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12); }
.chat-menu { position: fixed; z-index: 120; width: min(260px, calc(100vw - 24px)); padding: 8px; border-radius: 20px; border: 1px solid var(--line-strong); background-color: #070707; background-image: var(--dots); background-size: 7px 7px;
  box-shadow: 5px 5px 0 rgba(255, 255, 255, 0.08), 0 24px 60px rgba(0, 0, 0, 0.75); transform-origin: top right; animation: menu-in 0.26s cubic-bezier(0.2, 1.3, 0.4, 1) both; }
.chat-menu.is-leaving { animation: menu-out 0.18s ease-in forwards; }
@keyframes menu-in { from { opacity: 0; transform: scale(0.85) translateY(-6px); } }
@keyframes menu-out { to { opacity: 0; transform: scale(0.92); } }
.chat-menu__title { margin: 4px 8px 8px; font: 700 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-menu__note { margin: 0 8px 10px; font-size: 13.5px; line-height: 1.45; color: #ddd; }
.chat-menu > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 10px; border-radius: 12px; font: 500 15px var(--font); text-align: left; }
.chat-menu > button:active { background: #161616; }
.chat-menu > button .kemoji { width: 20px; height: 20px; }
.chat-menu .is-danger { color: #ff8a8a; }
.chat-menu__input { width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid #fff; background: #000; color: #fff; font: 15px var(--font); }
.chat-menu__row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.chat-menu__row button { padding: 10px; border-radius: 12px; border: 1px solid var(--line-strong); font: 600 14px var(--font); }
.chat-menu__row .is-primary { background: #fff; color: #000; border-color: #fff; }
.chat-menu__row .is-danger { background: #ff5c5c; color: #000; border-color: #ff5c5c; }

/* ---------- Камера ---------- */
.camera-sheet { position: fixed; inset: 0; z-index: 130; background: #000; animation: cam-in 0.3s ease both; }
.camera-sheet.is-leaving { animation: cam-out 0.22s ease forwards; }
@keyframes cam-in { from { opacity: 0; transform: scale(1.04); } }
@keyframes cam-out { to { opacity: 0; } }
.camera-sheet video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; visibility: hidden; pointer-events: none; }
.camera-sheet.is-ready video { visibility: visible; }
.camera-sheet video::-webkit-media-controls, .camera-sheet video::-webkit-media-controls-start-playback-button { display: none !important; }
.camera-sheet video.is-mirror { transform: scaleX(-1); }
.camera-sheet__top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(var(--safe-top) + 12px) 16px 12px; background: linear-gradient(rgba(0, 0, 0, 0.6), transparent); font: 700 11px var(--mono); letter-spacing: 0.2em; }
.camera-sheet__top button { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.3); }
.camera-sheet__top svg { width: 20px; height: 20px; }
.camera-sheet__bar { position: absolute; left: 0; right: 0; bottom: 0; display: grid; place-items: center; padding: 22px 0 calc(var(--safe-bottom) + 30px); background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)); }
.camera-shutter { width: 76px; height: 76px; border-radius: 50%; border: 4px solid #fff; display: grid; place-items: center; transition: transform 0.12s; }
.camera-shutter i { width: 60px; height: 60px; border-radius: 50%; background: #fff; transition: transform 0.12s; }
.camera-shutter:active i { transform: scale(0.85); }
.camera-sheet__flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.camera-sheet.is-shot .camera-sheet__flash { animation: cam-flash 0.35s ease-out; }
@keyframes cam-flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }

/* ---------- Экран загрузки ---------- */
#app-gate { position: fixed; inset: 0; z-index: 99999; display: grid; place-content: center; justify-items: center; gap: 0; padding: 24px; text-align: center; color: #fff; font-family: var(--font);
  transition: clip-path 0.75s cubic-bezier(0.7, 0, 0.2, 1), opacity 0.75s ease; clip-path: circle(150% at 50% 45%); }
.gate-core { position: relative; width: 120px; height: 120px; display: grid; place-items: center; margin-bottom: 22px; }
.gate-core img { width: 84px; position: relative; z-index: 1; animation: boot-breathe 3s ease-in-out infinite; filter: drop-shadow(0 0 26px rgba(255, 255, 255, 0.18)); }
.gate-ring { position: absolute; inset: 0; }
.gate-ring i { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, 0.28); animation: gate-spin 14s linear infinite; }
.gate-ring i:last-child { inset: 12px; border: 1.5px solid transparent; border-top-color: #fff; border-right-color: rgba(255, 255, 255, 0.35); animation-duration: 1.4s; }
@keyframes gate-spin { to { transform: rotate(360deg); } }
.gate-title { display: flex; gap: 0.5em; margin: 0; font: 800 24px var(--mono); letter-spacing: 0; }
.gate-title span { display: inline-block; animation: gate-letter 0.6s cubic-bezier(0.2, 1.2, 0.35, 1) both; }
.gate-title span:nth-child(2) { animation-delay: 0.08s; } .gate-title span:nth-child(3) { animation-delay: 0.16s; } .gate-title span:nth-child(4) { animation-delay: 0.24s; }
@keyframes gate-letter { from { opacity: 0; transform: translateY(12px); } }
.gate-bar { position: relative; width: 150px; height: 3px; margin: 20px auto 0; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.gate-bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 40%; border-radius: 3px; background: #fff; animation: gate-load 1.3s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
@keyframes gate-load { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
#app-gate p { margin: 14px auto 0; max-width: 300px; font: 12px/1.6 var(--mono); color: #9a9a9a; }
#app-gate a { margin: 18px auto 0; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
#app-gate.is-error a { opacity: 1; pointer-events: auto; }
#app-gate.is-error .gate-bar, #app-gate.is-error .gate-ring i:last-child { display: none; }
#app-gate.is-done { clip-path: circle(0% at 50% 45%); opacity: 0.6; pointer-events: none; }
#app-gate.is-done .gate-bar i { animation: none; width: 100%; transform: none; transition: width 0.3s; }
#app-gate.is-done .gate-core { transform: scale(0.8); transition: transform 0.6s cubic-bezier(0.7, 0, 0.2, 1); }
body.app-entering .app { animation: app-enter 0.85s cubic-bezier(0.2, 0.9, 0.25, 1) both; }
@keyframes app-enter { from { opacity: 0; transform: scale(0.965); } }

/* ---------- Brief: заставка 3 секунды ---------- */
.brief-intro.is-holding { position: relative; cursor: pointer; }
.brief-intro.is-holding::after { content: ""; position: absolute; left: 50%; bottom: 18%; width: 120px; height: 2px; margin-left: -60px; border-radius: 2px;
  background: linear-gradient(90deg, var(--side-accent, #fff) 50%, rgba(255, 255, 255, 0.15) 50%); background-size: 200% 100%; background-position: 100% 0; animation: hold-bar var(--hold, 3s) linear forwards; }
@keyframes hold-bar { to { background-position: 0 0; } }
.brief-skip { position: absolute; left: 0; right: 0; bottom: calc(18% - 28px); text-align: center; font: 500 11px var(--mono); color: var(--muted); letter-spacing: 0.04em; animation: file-in 0.5s ease 0.9s both; }

/* ---------- Пометки Annotated Text: свои цвета, как в оригинале ---------- */
.an-mark { color: var(--an, var(--side-accent, #fff)); }
.an-wavy { --an: #c084fc; }
.an-under:not(.an-wavy):not(.an-double):not(.an-arrow) { --an: #a78bfa; }
.an-double { --an: #34d399; }
.an-arrow { --an: #60a5fa; }
.an-highlight { --an: #eab308; }
.an-highlight .an-mark { opacity: 0.5; }
.an-circle { --an: #67e8f9; }
.an-box { --an: #fb923c; }
.an-bracket { --an: #a3a3a3; }
.an-strike, .an-cross { --an: #f87171; }
.an-dotted { background-image: radial-gradient(circle, #d4d4d4 1.1px, transparent 1.5px); }
.an-soft { background-repeat: no-repeat !important; background-position: 0 0 !important; background-size: 0% 100% !important; transition: background-size 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) 0.15s; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.an-soft.is-on { background-size: 100% 100% !important; }
.an-soft-hl { background-image: linear-gradient(transparent 55%, rgba(234, 179, 8, 0.45) 55%, rgba(234, 179, 8, 0.45) 92%, transparent 92%) !important; color: inherit; }
.an-soft-ul { background-image: linear-gradient(transparent calc(100% - 3px), #a78bfa calc(100% - 3px)) !important; padding-bottom: 1px; }
.an-soft-line { background-image: linear-gradient(transparent calc(100% - 2px), var(--side-accent, #fff) calc(100% - 2px)) !important; padding-bottom: 2px; }
.an-soft-del { text-decoration: line-through; text-decoration-color: #f87171; text-decoration-thickness: 2px; }
mark.an, mark.an-soft { background-color: transparent; color: inherit; }

/* ---------- Энергорежим и слабые устройства ---------- */
.perf-low .deck-slide, .perf-low .file-card, .perf-low .ad-banner, .perf-low .deck-form { animation-duration: 0.01s; }
@media (prefers-reduced-motion: reduce) {
  .deck-slide, .file-card, .ad-banner, .deck-form, .chat-menu, .camera-sheet, .msg-actions, .gate-title span, .gate-ring i, .gate-bar i, body.app-entering .app, body.app-entering [data-screen="chat"] { animation: none !important; }
  #app-gate { transition: none; }
}
