/* Пятница Чат — минимализм в графите, как на friday-ai.pro */
:root {
  --bg: #161616; --side: #111111; --panel: #1d1d1d; --raised: #242424; --hover: #2a2a2a;
  --line: #2c2c2c; --line2: #3a3a3a; --text: #ededed; --soft: #c4c4c4; --muted: #8a8a8a; --dim: #5f5f5f;
  --accent: #f2f2f2; --ok: #7ddc9a; --warn: #f0b45b; --bad: #ff7a70;
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Inter", Roboto, Arial, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 8px; }
::selection { background: #f2f2f2; color: #111; }

.ch { display: grid; grid-template-columns: 272px 1fr; height: 100dvh; }

/* ——— Боковая панель ——— */
.ch-side { display: flex; flex-direction: column; gap: 6px; min-height: 0; padding: 14px 10px 10px; background: var(--side); border-right: 1px solid #1f1f1f; }
.ch-side-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 10px; }
.ch-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 600; font-family: var(--display); font-size: 16px; letter-spacing: -.01em; }
.ch-brand img { border-radius: 7px; }
.ch-brand em { font-style: normal; color: var(--muted); font-weight: 500; }
.ch-new { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font-weight: 600; font-size: 14px; transition: background .15s, border-color .15s; }
.ch-new:hover { background: var(--raised); border-color: var(--line2); }
.ch-new kbd { margin-left: auto; font: 500 11px var(--font); color: var(--dim); }
.ch-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; margin-top: 2px; border-radius: 10px; color: var(--muted); }
.ch-search:focus-within { background: var(--panel); }
.ch-search input { flex: 1; min-width: 0; border: 0; background: none; outline: 0; font-size: 13.5px; color: var(--text); }
.ch-search input::placeholder { color: var(--dim); }
.ch-search input::-webkit-search-cancel-button { display: none; }

.ch-list { flex: 1; min-height: 0; overflow-y: auto; margin: 4px -4px 0; padding: 0 4px; scrollbar-width: thin; scrollbar-color: #2c2c2c transparent; }
.ch-group { padding: 14px 10px 6px; font-size: 11.5px; font-weight: 600; color: var(--dim); letter-spacing: .02em; }
.ch-item { position: relative; display: flex; align-items: center; border-radius: 10px; }
.ch-item a { flex: 1; min-width: 0; padding: 8px 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-decoration: none; color: var(--soft); font-size: 13.5px; border-radius: 10px; }
.ch-item:hover { background: #1b1b1b; }
.ch-item.on { background: var(--raised); }
.ch-item.on a { color: #fff; }
.ch-item .ch-more { position: absolute; right: 4px; opacity: 0; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.ch-item:hover .ch-more, .ch-item.on .ch-more, .ch-item .ch-more:focus-visible { opacity: 1; }
.ch-item:hover a, .ch-item.on a { padding-right: 34px; }
.ch-more:hover { color: #fff; background: #333; }
.ch-menu { position: fixed; z-index: 30; min-width: 170px; padding: 5px; border: 1px solid var(--line2); border-radius: 12px; background: #202020; box-shadow: 0 18px 40px rgba(0,0,0,.5); }
.ch-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; font-size: 13.5px; text-align: left; }
.ch-menu button:hover { background: #2c2c2c; }
.ch-menu .bad { color: var(--bad); }
.ch-rename { width: 100%; padding: 7px 10px; border: 1px solid #555; border-radius: 10px; background: #1b1b1b; outline: 0; font-size: 13.5px; }
.ch-empty-list { padding: 20px 12px; color: var(--dim); font-size: 13px; }

.ch-links { padding-top: 6px; border-top: 1px solid #1f1f1f; }
.ch-links a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; text-decoration: none; font-size: 13.5px; color: var(--soft); }
.ch-links a span { margin-left: auto; font-size: 11.5px; color: var(--dim); }
.ch-links a:hover { background: #1b1b1b; color: #fff; }

.ch-me { padding: 10px; border-radius: 14px; background: var(--panel); border: 1px solid #222; }
.ch-me-row { display: flex; align-items: center; gap: 10px; }
.ch-ava { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #333; font-weight: 600; font-size: 13px; flex: none; }
.ch-me-name { min-width: 0; flex: 1; line-height: 1.3; }
.ch-me-name b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-me-name span { font-size: 12px; color: var(--muted); }
.ch-tier { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line2); font-size: 11px; font-weight: 600; color: var(--soft); }
.ch-tier { --m-bg: var(--panel); }
.ch-tier.max { color: #ead9ff; }
.ch-tier.m-pro { color: #f2f2f2; }
.ch-meters { display: grid; gap: 8px; margin-top: 10px; }
.ch-meter { font-size: 11.5px; color: var(--muted); }
.ch-meter div { display: flex; justify-content: space-between; gap: 8px; }
.ch-meter i { display: block; height: 4px; margin-top: 4px; border-radius: 4px; background: #2c2c2c; overflow: hidden; }
.ch-meter i b { display: block; height: 100%; width: 0; border-radius: 4px; background: #e8e8e8; transition: width .4s; }
.ch-meter.hot i b { background: var(--warn); }
.ch-meter.full i b { background: var(--bad); }
.ch-up { display: block; margin-top: 10px; padding: 8px; border-radius: 10px; background: #f2f2f2; color: #111; text-align: center; font-size: 13px; font-weight: 600; text-decoration: none; }
.ch-up:hover { background: #fff; }
.ch-signin { width: 100%; height: 40px; border: 0; border-radius: 11px; background: #f2f2f2; color: #111; font-weight: 600; }
.ch-signin:hover { background: #fff; }
.ch-me p { margin: 8px 2px 0; font-size: 12px; color: var(--muted); line-height: 1.45; }

/* ——— Основная часть ——— */
.ch-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ch-top { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 18px; }
.ch-title { min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; font-size: 14.5px; color: var(--soft); }
.ch-mode { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--side); }
.ch-mode button { height: 30px; padding: 0 12px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: 13px; font-weight: 600; transition: background .15s, color .15s; }
.ch-mode button.on { background: var(--raised); color: #fff; }
.ch-icon { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--soft); }
.ch-icon:hover { background: var(--raised); color: #fff; }
.ch-only-phone { display: none; }

.ch-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-anchor: none; scrollbar-width: thin; scrollbar-color: #2c2c2c transparent; }
.ch-hello { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; padding: 0 20px 40px; text-align: center; }
.ch-hello[hidden] { display: none; }
.ch-wave { width: min(520px, 90vw); height: 110px; margin-bottom: 8px; }
.ch-hello h1 { margin: 0; font: 600 clamp(28px, 4.4vw, 40px)/1.1 var(--display); letter-spacing: -.03em; }
.ch-sub { margin: 12px 0 0; max-width: 520px; color: var(--muted); font-size: 15px; }
.ch-ideas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: min(720px, 100%); margin-top: 34px; }
.ch-idea { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: transparent; text-align: left; transition: background .15s, border-color .15s, transform .15s; }
.ch-idea b { font-size: 14px; font-weight: 600; }
.ch-idea span { font-size: 13px; color: var(--muted); }
.ch-idea:hover { background: var(--panel); border-color: var(--line2); transform: translateY(-1px); }

.ch-thread { width: min(780px, 100%); margin: 0 auto; padding: 8px 24px 40px; }
.ch-msg { margin: 26px 0; animation: ch-in .28s ease both; }
@keyframes ch-in { from { opacity: 0; transform: translateY(6px); } }
.ch-msg.user { display: flex; justify-content: flex-end; }
.ch-msg.user .ch-bubble { max-width: 82%; padding: 11px 16px; border-radius: 20px 20px 6px 20px; background: var(--raised); white-space: pre-wrap; word-wrap: break-word; }
.ch-msg.bot { display: grid; grid-template-columns: 30px 1fr; gap: 14px; }
.ch-msg.bot > img { width: 28px; height: 28px; border-radius: 8px; margin-top: 2px; }
.ch-body { min-width: 0; }
.ch-actions { display: flex; gap: 2px; margin-top: 6px; opacity: 0; transition: opacity .15s; }
.ch-msg:hover .ch-actions, .ch-msg.last .ch-actions, .ch-actions:focus-within { opacity: 1; }
.ch-actions button { height: 30px; padding: 0 8px; display: flex; align-items: center; gap: 6px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 12.5px; }
.ch-actions button:hover { background: var(--raised); color: #fff; }
.ch-actions svg { width: 16px; height: 16px; }

/* поток и ожидание */
.ch-think { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.ch-think i { display: flex; gap: 3px; align-items: center; height: 18px; }
.ch-think i b { width: 3px; border-radius: 3px; background: #d8d8d8; animation: ch-bar 1s ease-in-out infinite; }
.ch-think i b:nth-child(2) { animation-delay: .12s; } .ch-think i b:nth-child(3) { animation-delay: .24s; } .ch-think i b:nth-child(4) { animation-delay: .36s; }
@keyframes ch-bar { 0%, 100% { height: 5px; opacity: .5; } 50% { height: 17px; opacity: 1; } }
.ch-shimmer { background: linear-gradient(90deg, #777 0%, #eee 50%, #777 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ch-sh 1.6s linear infinite; }
@keyframes ch-sh { to { background-position: -200% 0; } }
.ch-caret::after { content: ""; display: inline-block; width: 8px; height: 16px; margin-left: 3px; vertical-align: -2px; border-radius: 2px; background: #eaeaea; animation: ch-blink 1s steps(2) infinite; }
@keyframes ch-blink { 50% { opacity: 0; } }
.ch-err { margin-top: 10px; padding: 11px 14px; border: 1px solid #4a2b28; border-radius: 12px; background: #221716; color: #ffb3ac; font-size: 14px; }
.ch-err a, .ch-err button { color: #fff; }
.ch-err button { margin-left: 8px; padding: 2px 10px; border: 1px solid #6a3a35; border-radius: 8px; background: none; font-size: 13px; }

/* Markdown */
.md { word-wrap: break-word; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 14px; }
.md h1, .md h2, .md h3, .md h4 { margin: 26px 0 10px; font-family: var(--display); letter-spacing: -.015em; line-height: 1.25; }
.md h1 { font-size: 24px; } .md h2 { font-size: 20px; } .md h3 { font-size: 17px; } .md h4 { font-size: 15px; }
.md ul, .md ol { margin: 0 0 14px; padding-left: 24px; }
.md li { margin: 5px 0; } .md li > ul, .md li > ol { margin: 4px 0; }
.md li::marker { color: var(--muted); }
.md a { color: #fff; text-decoration: underline; text-decoration-color: #666; text-underline-offset: 3px; }
.md a:hover { text-decoration-color: #fff; }
.md strong { font-weight: 650; color: #fff; }
.md blockquote { margin: 0 0 14px; padding: 2px 0 2px 16px; border-left: 2px solid #555; color: var(--soft); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.md code { padding: 2px 6px; border-radius: 6px; background: #262626; font: .88em var(--mono); }
.md .ch-code { margin: 0 0 16px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #0f0f0f; }
.md .ch-code header { display: flex; align-items: center; justify-content: space-between; height: 36px; padding: 0 8px 0 14px; background: #191919; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.md .ch-code header button { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-size: 12px; }
.md .ch-code header button:hover { background: #2a2a2a; color: #fff; }
.md .ch-code svg { width: 14px; height: 14px; }
.md pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13px/1.6 var(--mono); scrollbar-width: thin; }
.md pre code { padding: 0; background: none; font: inherit; }
.md .tk-k { color: #c9a7ff; } .md .tk-s { color: #a6e3a1; } .md .tk-c { color: #6c6c6c; font-style: italic; } .md .tk-n { color: #f9c97a; }
.md .ch-table { margin: 0 0 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.md table { width: 100%; border-collapse: collapse; font-size: 14px; }
.md th, .md td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.md th { background: #1c1c1c; font-weight: 600; color: #fff; }
.md tr:last-child td { border-bottom: 0; }

/* карточка собранного сайта */

/* ——— Поле ввода ——— */
.ch-foot { padding: 0 24px 14px; }
.ch-box { width: min(780px, 100%); margin: 0 auto; padding: 12px 12px 10px 18px; border: 1px solid var(--line2); border-radius: 26px; background: var(--panel); box-shadow: 0 10px 40px rgba(0,0,0,.35); transition: border-color .2s, box-shadow .2s; }
.ch-box:focus-within { border-color: #555; box-shadow: 0 10px 50px rgba(0,0,0,.45), 0 0 0 4px rgba(255,255,255,.03); }
.ch-box textarea { display: block; width: 100%; max-height: 40vh; min-height: 26px; padding: 4px 0; border: 0; background: none; outline: 0; resize: none; font-size: 15.5px; line-height: 1.55; }
.ch-box textarea::placeholder { color: var(--dim); }
.ch-box-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.ch-hint { flex: 1; min-width: 0; font-size: 12px; color: var(--dim); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ch-hint.warn { color: var(--warn); }
.ch-send { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #f2f2f2; color: #111; transition: transform .15s, background .15s, opacity .15s; }
.ch-send:hover:not(:disabled) { background: #fff; transform: scale(1.05); }
.ch-send:disabled { opacity: .25; cursor: default; }
.ch-send svg { width: 18px; height: 18px; stroke-width: 2.2; }
.ch-send .i-stop { display: none; fill: currentColor; stroke: none; }
.ch-send.busy .i-up { display: none; } .ch-send.busy .i-stop { display: block; }
.ch-legal { margin: 8px 0 0; text-align: center; font-size: 11.5px; color: var(--dim); }
.ch-legal a { color: var(--muted); text-decoration: none; }
.ch-legal a:hover { color: #fff; }
.ch-down { position: absolute; left: 50%; bottom: 150px; width: 36px; height: 36px; display: grid; place-items: center; margin-left: -18px; border: 1px solid var(--line2); border-radius: 50%; background: #202020; color: #ddd; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.ch-down:hover { background: #2a2a2a; }
.ch-down[hidden] { display: none; }

/* ——— Окно входа ——— */
.ch-dialog { width: min(420px, calc(100vw - 32px)); padding: 30px 28px 24px; border: 1px solid var(--line2); border-radius: 22px; background: #1a1a1a; color: var(--text); text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.ch-dialog::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(6px); }
.ch-dialog[open] { animation: ch-pop .22s ease both; }
@keyframes ch-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.ch-dialog img { margin: 0 auto 14px; border-radius: 12px; }
.ch-dialog h2 { margin: 0; font: 600 21px/1.2 var(--display); letter-spacing: -.02em; }
.ch-dialog > p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.ch-x { position: absolute; top: 10px; right: 10px; margin: 0; }
.ch-x button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--muted); }
.ch-x button:hover { background: #2a2a2a; color: #fff; }

.ch-toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translateX(-50%); padding: 10px 16px; border-radius: 12px; background: #f2f2f2; color: #111; font-size: 13.5px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: ch-in .2s ease both; }

/* ——— Телефон ——— */
/* ——— Размышления, как в DeepSeek: живые во время ответа, потом свёрнуты ——— */
.ch-reason { margin: 2px 0 12px; max-width: 100%; }
.ch-reason summary { display: inline-flex; align-items: center; gap: 9px; height: 32px; padding: 0 12px 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--soft); font-size: 13px; font-weight: 600; list-style: none; cursor: pointer; user-select: none; transition: background .15s, border-color .15s; }
.ch-reason summary::-webkit-details-marker { display: none; }
.ch-reason summary:hover { background: var(--raised); border-color: var(--line2); }
.ch-reason.empty summary { cursor: default; background: none; border-color: transparent; padding-left: 0; color: var(--muted); }
.ch-reason.empty .ch-reason-chev { display: none; }
.ch-reason-s { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.ch-reason-chev { width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
.ch-reason[open] .ch-reason-chev { transform: rotate(180deg); }
.ch-reason-ico { display: inline-flex; gap: 3px; align-items: center; height: 14px; }
.ch-reason-ico i { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }
.ch-reason.live .ch-reason-ico i { background: #e8e8e8; animation: ch-dot 1.2s ease-in-out infinite; }
.ch-reason.live .ch-reason-ico i:nth-child(2) { animation-delay: .15s; } .ch-reason.live .ch-reason-ico i:nth-child(3) { animation-delay: .3s; }
@keyframes ch-dot { 0%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-4px); opacity: 1; } }
.ch-reason.live .ch-reason-t { background: linear-gradient(90deg, #8a8a8a 0%, #f4f4f4 50%, #8a8a8a 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ch-sh 1.8s linear infinite; }
.ch-reason-body { position: relative; margin: 10px 0 0 6px; padding: 2px 0 2px 16px; border-left: 2px solid var(--line2); color: var(--muted); font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #2c2c2c transparent; }
.ch-reason.live .ch-reason-body { max-height: 180px; -webkit-mask-image: linear-gradient(transparent, #000 36px); mask-image: linear-gradient(transparent, #000 36px); }
.ch-reason-body:empty { display: none; }
.ch-msg.pending .ch-actions { visibility: hidden; }

/* ——— Сайт из чата ——— */
.ch-site { margin: 6px 0 16px; padding: 16px; border: 1px solid var(--line2); border-radius: 18px; background: linear-gradient(160deg, #222 0%, #191919 70%); box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .8); animation: ch-pop .35s ease-out; max-width: 560px; }
.ch-site-head { display: flex; align-items: center; gap: 14px; }
.ch-site-txt { min-width: 0; flex: 1; line-height: 1.4; }
.ch-site-txt b { display: block; font-size: 15.5px; font-family: var(--display); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-site-txt span { font-size: 13px; color: var(--muted); }
.ch-site-dot { width: 44px; height: 44px; flex: none; border-radius: 13px; background: #f2f2f2; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 8px 20px -10px currentColor; }
.ch-site-ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: #2a2a2a; color: #ddd; flex: none; }
.ch-site-ico svg { width: 22px; height: 22px; }
.ch-site.pending .ch-site-ico svg { animation: ch-spin 1.1s linear infinite; }
@keyframes ch-spin { to { transform: rotate(360deg); } }
.ch-site p { margin: 12px 0 0; color: var(--soft); font-size: 14px; line-height: 1.55; }
.ch-site-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ch-site-tags i { padding: 3px 10px; border: 1px solid var(--line2); border-radius: 999px; color: var(--soft); font: 500 12px var(--font); }
.ch-site-go { display: flex; align-items: center; gap: 10px; margin-top: 14px; height: 44px; padding: 0 16px; border-radius: 13px; background: #f2f2f2; color: #111; font-weight: 600; font-size: 14px; text-decoration: none; transition: background .15s, transform .15s; }
.ch-site-go:hover { background: #fff; transform: translateY(-1px); }
.ch-site-go em { margin-left: auto; font-style: normal; transition: transform .15s; }
.ch-site-go:hover em { transform: translateX(3px); }
.ch-site.bad { border-color: #4a2b28; background: #1d1716; }
.ch-steps { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ch-steps li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); animation: ch-in .25s ease-out; }
.ch-steps li svg { width: 16px; height: 16px; color: var(--ok); }
.ch-steps li i { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid #3a3a3a; border-top-color: #f2f2f2; animation: ch-spin .9s linear infinite; }
.ch-steps li.now { color: var(--text); }

/* ——— Чат связан с сайтом в Студио ——— */
.ch-project { display: inline-flex; align-items: center; gap: 7px; max-width: 240px; height: 32px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 999px; color: var(--soft); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.ch-project[hidden], .ch-mode[hidden], .ch-pick[hidden], .ch-models[hidden], .ch-down[hidden] { display: none; }
.ch-project:hover { background: var(--raised); color: #fff; }
.ch-project svg { width: 15px; height: 15px; }
.ch-project span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 860px) { .ch-project { display: none; } .ch-site-go { justify-content: center; } }

@media (max-width: 860px) {
  .ch { grid-template-columns: 1fr; }
  .ch-side { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .25s ease; padding-top: max(14px, env(safe-area-inset-top)); }
  .ch.side-open .ch-side { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.5); }
  .ch-scrim { position: fixed; z-index: 35; inset: 0; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .ch.side-open .ch-scrim { opacity: 1; pointer-events: auto; }
  .ch-only-phone { display: grid; }
  .ch-top { padding: 0 8px; padding-top: env(safe-area-inset-top); height: calc(52px + env(safe-area-inset-top)); }
  .ch-title { text-align: center; }
  .ch-mode button { padding: 0 9px; font-size: 12px; }
  .ch-thread { padding: 4px 16px 30px; }
  .ch-msg.bot { grid-template-columns: 1fr; gap: 6px; }
  .ch-msg.bot > img { width: 24px; height: 24px; }
  .ch-msg.user .ch-bubble { max-width: 90%; }
  .ch-ideas { grid-template-columns: 1fr; margin-top: 26px; }
  .ch-idea:nth-child(n+4) { display: none; }
  .ch-foot { padding: 0 10px max(10px, env(safe-area-inset-bottom)); }
  .ch-box { border-radius: 22px; padding-left: 16px; }
  .ch-legal { display: none; }
  .ch-down { bottom: 110px; }
  .ch-new kbd { display: none; }
}
@media (min-width: 861px) { .ch-scrim { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; } }

/* ——— Модели «Пятница 1»: серебро — Pro, фиолетовое сияние — Ultra (Max) ——— */
@property --ch-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes ch-turn { to { --ch-a: 360deg; } }
.m-pro { border: 1px solid transparent !important; background: linear-gradient(var(--m-bg, var(--panel)), var(--m-bg, var(--panel))) padding-box, linear-gradient(135deg, #6f6f6f, #f4f4f4 35%, #8d8d8d 60%, #e6e6e6 85%, #777) border-box !important; }
.m-max { border: 1px solid transparent !important; background: linear-gradient(var(--m-bg, var(--panel)), var(--m-bg, var(--panel))) padding-box, conic-gradient(from var(--ch-a), #5b21b6, #a855f7, #e9d5ff, #7c3aed, #c084fc, #5b21b6) border-box !important; animation: ch-turn 4s linear infinite; box-shadow: 0 0 22px -8px rgba(168, 85, 247, .55); }

.ch-pick { position: relative; }
.ch-model { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--side); color: var(--text); font-size: 13.5px; font-weight: 650; --m-bg: var(--side); transition: filter .15s; }
.ch-model:hover { filter: brightness(1.15); }
.ch-model svg { width: 16px; height: 16px; color: var(--muted); }
.ch-model-dot { width: 8px; height: 8px; border-radius: 50%; background: #cfcfcf; }
.ch-model.m-pro .ch-model-dot { background: linear-gradient(135deg, #fff, #8a8a8a); }
.ch-model.m-max .ch-model-dot { background: #b46cff; box-shadow: 0 0 10px #a855f7; animation: ch-glow 2s ease-in-out infinite; }
@keyframes ch-glow { 50% { box-shadow: 0 0 2px #a855f7; opacity: .7; } }
.ch-models { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 330px; padding: 6px; border: 1px solid var(--line2); border-radius: 16px; background: #1b1b1b; box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .8); animation: ch-pop .18s ease-out; display: grid; gap: 4px; }
.ch-mi { position: relative; display: grid; gap: 2px; width: 100%; padding: 10px 36px 10px 12px; border: 1px solid transparent; border-radius: 11px; background: none; text-align: left; --m-bg: #1b1b1b; }
.ch-mi:hover { --m-bg: #232323; background-color: #232323; }
.ch-mi:not(.m-pro):not(.m-max):hover { background: #232323; }
.ch-mi-name { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.ch-mi-name em { padding: 1px 7px; border-radius: 999px; font: 700 10px/1.6 var(--font); letter-spacing: .05em; font-style: normal; background: #2a2a2a; color: #cfcfcf; }
.ch-mi.m-max .ch-mi-name b { background: linear-gradient(90deg, #d8b4fe, #a855f7, #f0e2ff, #c084fc); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ch-sh 4s linear infinite; }
.ch-mi.m-max .ch-mi-name em { background: rgba(168, 85, 247, .18); color: #d8b4fe; }
.ch-mi-about { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.ch-mi > svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #fff; }
.ch-mi.locked { opacity: .72; }
.ch-mi.locked .ch-mi-name b { color: var(--soft); }
.ch-mi-up { display: block; margin: 4px 2px 2px; padding: 9px 10px; border-top: 1px solid var(--line); color: var(--soft); font-size: 12.5px; text-decoration: none; }
.ch-mi-up:hover { color: #fff; }

/* подпись модели над ответом */
.ch-by { display: inline-flex; align-items: center; height: 22px; margin: 0 0 8px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11.5px; font-weight: 650; letter-spacing: .01em; --m-bg: var(--bg); }
.ch-by.m-pro { color: #dcdcdc; }
.ch-by.m-max { color: #e9d5ff; }
.ch-body > .ch-by + .ch-reason, .ch-body > .ch-by + .ch-team { margin-top: 2px; }

/* команда Ultra */
.ch-team { margin: 0 0 14px; border-radius: 16px; border: 1px solid transparent; background: linear-gradient(#191919, #191919) padding-box, conic-gradient(from var(--ch-a), #3b1d6e, #a855f7, #2a2a2a, #7c3aed, #3b1d6e) border-box; animation: ch-turn 5s linear infinite; max-width: 680px; }
.ch-team:not(.live) { background: linear-gradient(#191919, #191919) padding-box, linear-gradient(135deg, #4c2a85, #2c2c2c 60%, #4c2a85) border-box; animation: none; }
.ch-team summary { display: flex; align-items: center; gap: 10px; padding: 11px 14px; list-style: none; cursor: pointer; font-size: 13.5px; }
.ch-team summary::-webkit-details-marker { display: none; }
.ch-team summary b { color: #efe4ff; font-weight: 650; }
.ch-team-s { color: var(--muted); font-size: 13px; margin-right: auto; }
.ch-team.live .ch-team-s { background: linear-gradient(90deg, #8a7aa3, #f3e8ff, #8a7aa3); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ch-sh 1.8s linear infinite; }
.ch-team[open] .ch-reason-chev { transform: rotate(180deg); }
.ch-orb { position: relative; width: 18px; height: 18px; flex: none; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f5e8ff, #a855f7 55%, #4c1d95); box-shadow: 0 0 14px rgba(168, 85, 247, .6); }
.ch-team.live .ch-orb { animation: ch-breathe 1.6s ease-in-out infinite; }
@keyframes ch-breathe { 50% { transform: scale(.82); box-shadow: 0 0 4px rgba(168, 85, 247, .4); } }
.ch-team-body { padding: 0 14px 14px; }
.ch-team-goal { margin: 0 0 10px; color: var(--soft); font-size: 13px; }
.ch-agents { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ch-agent { display: flex; gap: 11px; padding: 10px 12px; border: 1px solid #262626; border-radius: 12px; background: #151515; animation: ch-in .3s ease-out both; }
.ch-agent:nth-child(2) { animation-delay: .06s; } .ch-agent:nth-child(3) { animation-delay: .12s; } .ch-agent:nth-child(4) { animation-delay: .18s; }
.ch-agent > div { min-width: 0; flex: 1; }
.ch-agent-h { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.ch-agent-h b { color: #f2f2f2; }
.ch-agent-h span { color: #b9a6d6; font-size: 11.5px; font-weight: 600; }
.ch-agent-h time { margin-left: auto; color: var(--dim); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.ch-agent p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.ch-agent-st { width: 18px; height: 18px; flex: none; display: grid; place-items: center; margin-top: 1px; }
.ch-agent-st i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #3a2a55; border-top-color: #c084fc; animation: ch-spin .8s linear infinite; }
.ch-agent-st svg { width: 16px; height: 16px; color: #c084fc; }
.ch-agent.error .ch-agent-st { color: var(--bad); font-weight: 700; }
.ch-agent.done { border-color: #2b2236; }
.ch-team.merge .ch-agents { opacity: .75; }
@media (max-width: 860px) { .ch-models { position: fixed; left: 10px; right: 10px; top: calc(56px + env(safe-area-inset-top)); width: auto; } .ch-model { height: 32px; font-size: 12.5px; padding: 0 8px 0 10px; } }

/* ——— Установка на телефон и Telegram ——— */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
.ch-install { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.ch-install:hover { background: var(--raised); }
.ch-install svg { width: 17px; height: 17px; }
.ch-install span { margin-left: auto; color: var(--dim); font-size: 12px; font-weight: 500; }
.ch-install[hidden] { display: none; }
.ch-install-hello { display: inline-flex; width: auto; margin: 18px auto 0; height: 40px; padding: 0 16px; border-radius: 999px; }
.ch-ios { margin: 4px 0 14px; padding-left: 20px; text-align: left; display: grid; gap: 8px; color: var(--soft); }
.ch-ios svg { width: 16px; height: 16px; vertical-align: -3px; }
@media (max-width: 860px) {
  .ch-box textarea, .ch-search input, .ch-rename, .ch-dialog input { font-size: 16px !important; }   /* iOS не увеличивает страницу при вводе */
}
html.in-tg .ch-legal { display: none; }

/* ——— Вложения ——— */
.ch-tool { width: 36px; height: 36px; display: grid; place-items: center; flex: none; border: 0; border-radius: 50%; background: none; color: var(--muted); transition: background .15s, color .15s, transform .15s; }
.ch-tool:hover { background: var(--raised); color: #fff; }
.ch-tool:active { transform: scale(.94); }
.ch-tool svg { width: 20px; height: 20px; }
.ch-talk { background: var(--raised); color: #eee; }
.ch-talk:hover { background: #333; }
.ch-box-row .ch-tool:first-child { margin-left: -8px; }
.ch-files { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin-right: -2px; scrollbar-width: none; }
.ch-files::-webkit-scrollbar { display: none; }
.ch-chip { position: relative; display: flex; align-items: center; gap: 10px; flex: none; max-width: 240px; height: 58px; padding: 0 30px 0 8px; border: 1px solid var(--line2); border-radius: 14px; background: var(--raised); animation: ch-pop .25s ease both; }
.ch-chip.img { width: 58px; padding: 0; overflow: hidden; }
.ch-chip.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ch-chip.load::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.12) 50%, transparent 70%) 0 0/250% 100%; animation: ch-shine 1.1s linear infinite; }
.ch-chip-ico { position: relative; width: 40px; height: 40px; display: grid; place-items: center; flex: none; border-radius: 10px; background: #2f2f2f; color: #ddd; }
.ch-chip-ico svg { width: 20px; height: 20px; }
.ch-chip-ico em { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); padding: 0 4px; border-radius: 4px; background: #f2f2f2; color: #111; font: 700 8.5px/1.45 var(--font); font-style: normal; text-transform: uppercase; letter-spacing: .02em; }
.ch-chip-t { min-width: 0; line-height: 1.3; }
.ch-chip-t b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-chip-t small { font-size: 11.5px; color: var(--muted); }
.ch-chip button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(20,20,20,.82); color: #ddd; backdrop-filter: blur(4px); }
.ch-chip button:hover { background: #f2f2f2; color: #111; }
.ch-chip button svg { width: 13px; height: 13px; stroke-width: 2.2; }
.ch-chip.doc { padding-right: 14px; background: var(--panel); }
@keyframes ch-shine { to { background-position: -250% 0; } }

.ch-msg.user { flex-direction: column; align-items: flex-end; gap: 6px; }
.ch-att { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: min(82%, 420px); }
.ch-att-imgs { display: grid; gap: 4px; width: 100%; border-radius: 18px; overflow: hidden; }
.ch-att-imgs.n1 { width: auto; max-width: 320px; }
.ch-att-imgs.n2, .ch-att-imgs.n4 { grid-template-columns: 1fr 1fr; }
.ch-att-imgs.n3 { grid-template-columns: 1fr 1fr 1fr; }
.ch-att-img { display: block; padding: 0; border: 0; background: var(--raised); cursor: zoom-in; overflow: hidden; }
.ch-att-imgs:not(.n1) .ch-att-img { aspect-ratio: 1; }
.ch-att-img img { display: block; width: 100%; height: 100%; max-height: 360px; object-fit: cover; transition: transform .3s; }
.ch-att-img:hover img { transform: scale(1.03); }

.ch-drop { position: absolute; inset: 10px; z-index: 30; display: grid; place-items: center; border: 2px dashed #6a6a6a; border-radius: 26px; background: rgba(18,18,18,.88); backdrop-filter: blur(8px); animation: ch-fade .15s ease; pointer-events: none; }
.ch-drop div { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.ch-drop svg { width: 44px; height: 44px; stroke-width: 1.4; color: #fff; animation: ch-lift 1.2s ease-in-out infinite alternate; }
.ch-drop b { font: 600 19px var(--display); }
.ch-drop span { color: var(--muted); font-size: 13.5px; }
@keyframes ch-lift { to { transform: translateY(-6px); } }
@keyframes ch-fade { from { opacity: 0; } }

/* ——— Картинки в ответах ——— */
.md .ch-img { position: relative; display: block; width: fit-content; max-width: min(100%, 520px); margin: 14px 0 6px; border-radius: 18px; overflow: hidden; background: #1c1c1c; box-shadow: 0 0 0 1px var(--line2), 0 24px 50px -28px rgba(0,0,0,.9); }
.ch-img-open { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; }
.md .ch-img img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; }
.ch-img-bar { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; }
.ch-img:hover .ch-img-bar, .ch-img:focus-within .ch-img-bar { opacity: 1; transform: none; }
.ch-img-bar > * { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 11px; background: rgba(17,17,17,.78); color: #fff; backdrop-filter: blur(8px); text-decoration: none; transition: background .15s; }
.ch-img-bar > *:hover { background: #f2f2f2; color: #111; }
.ch-img.fresh img { animation: ch-reveal 1.6s cubic-bezier(.2,.7,.2,1) both; }
.ch-img.fresh::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%) 0 0/300% 100% no-repeat; animation: ch-sweep 1.4s .25s ease-out both; pointer-events: none; }
@keyframes ch-reveal { from { filter: blur(28px) saturate(.4) brightness(1.4); transform: scale(1.06); opacity: .2; } 60% { opacity: 1; } }
@keyframes ch-sweep { from { background-position: 150% 0; } to { background-position: -150% 0; } }
@media (hover: none) { .ch-img-bar { opacity: 1; transform: none; } }

/* Рисую картинку: живое полотно */
.ch-gen { width: min(100%, 440px); margin: 14px 0 6px; padding: 10px; border: 1px solid var(--line2); border-radius: 22px; background: linear-gradient(160deg, #222 0%, #181818 70%); box-shadow: 0 24px 50px -30px rgba(0,0,0,.9); animation: ch-pop .35s ease-out; }
.ch-gen-art { position: relative; aspect-ratio: 1; border-radius: 15px; overflow: hidden; background: #141414; }
.ch-gen-art canvas { display: block; width: 100%; height: 100%; }
.ch-gen-sweep { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.10) 50%, transparent 62%) 0 0/250% 100% no-repeat; animation: ch-sweep 2.6s ease-in-out infinite; }
.ch-gen-art::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), inset 0 0 60px rgba(0,0,0,.55); }
.ch-gen-info { display: flex; align-items: center; gap: 12px; padding: 12px 6px 4px; }
.ch-gen-info > div { flex: 1; min-width: 0; line-height: 1.35; }
.ch-gen-info b { display: block; font: 600 15px var(--display); letter-spacing: -.01em; }
.ch-gen-step { display: block; font-size: 13px; color: var(--muted); }
.ch-gen-step.swap { animation: ch-step .45s ease both; }
@keyframes ch-step { from { opacity: 0; transform: translateY(5px); } }
.ch-gen-info time { font: 500 12.5px var(--mono); color: var(--dim); font-variant-numeric: tabular-nums; }
.ch-gen-ico { position: relative; width: 36px; height: 36px; flex: none; border-radius: 11px; background: #2a2a2a; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 9px; }
.ch-gen-ico i { border-radius: 3px; background: #f2f2f2; animation: ch-tile 1.6s ease-in-out infinite; }
.ch-gen-ico i:nth-child(2) { animation-delay: .2s; } .ch-gen-ico i:nth-child(3) { animation-delay: .6s; } .ch-gen-ico i:nth-child(4) { animation-delay: .4s; }
@keyframes ch-tile { 0%, 100% { opacity: .18; transform: scale(.7); } 50% { opacity: 1; transform: none; } }
.ch-gen-ico.bad { display: grid; place-items: center; grid-template-columns: none; padding: 0; color: var(--bad); font-weight: 700; }
.ch-gen-prompt { margin: 6px 6px 4px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--soft); font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ch-gen.bad { padding: 6px 10px; }

/* Просмотр картинки */
.ch-view { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; display: none; place-items: center; }
.ch-view[open] { display: grid; animation: ch-fade .2s ease; }
.ch-view::backdrop { background: rgba(8,8,8,.92); backdrop-filter: blur(10px); }
.ch-view img { max-width: calc(100vw - 32px); max-height: calc(100dvh - 120px); border-radius: 14px; box-shadow: 0 30px 90px rgba(0,0,0,.7); animation: ch-pop .25s ease both; }
.ch-view-x { position: fixed; top: calc(14px + env(safe-area-inset-top)); right: 14px; margin: 0; }
.ch-view-x button, .ch-voice-x { width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(40,40,40,.9); color: #fff; }
.ch-view-x button:hover, .ch-voice-x:hover { background: #f2f2f2; color: #111; }
.ch-view-dl { position: fixed; bottom: calc(22px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px; background: #f2f2f2; color: #111; font-weight: 600; text-decoration: none; }
.ch-view-dl:hover { background: #fff; }

/* Кнопка «Озвучить» во время речи */
.ch-actions button.on { color: #fff; background: var(--raised); }
.ch-actions button.on svg { animation: ch-pulse 1s ease-in-out infinite; }
@keyframes ch-pulse { 50% { opacity: .35; } }

/* ——— Голосовой режим ——— */
.ch-voice { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px 20px calc(28px + env(safe-area-inset-bottom));
  background: radial-gradient(120% 80% at 50% 38%, #202020 0%, #141414 55%, #0f0f0f 100%); opacity: 0; transform: scale(1.02); transition: opacity .25s ease, transform .25s ease; }
.ch-voice.on { opacity: 1; transform: none; }
.ch-voice-x { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; }
.ch-voice-stage { width: min(68vmin, 380px); aspect-ratio: 1; }
.ch-voice-stage canvas { width: 100%; height: 100%; display: block; cursor: pointer; }
.ch-voice-state { font: 600 13px var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ch-voice[data-state=listen] .ch-voice-state { color: #fff; }
.ch-voice[data-state=listen] .ch-voice-state::before { content: ''; display: inline-block; width: 7px; height: 7px; margin: 0 8px 1px 0; border-radius: 50%; background: var(--bad); animation: ch-pulse 1.2s ease-in-out infinite; }
.ch-voice-text { max-width: 600px; min-height: 3.2em; margin: 4px 0 18px; text-align: center; font: 500 clamp(17px, 2.3vw, 21px)/1.45 var(--display); letter-spacing: -.01em; color: var(--text); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ch-voice-bar { display: flex; gap: 12px; }
.ch-vbtn { height: 56px; min-width: 56px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border: 1px solid var(--line2); border-radius: 999px; background: #222; color: #eee; font-weight: 600; transition: background .15s, transform .15s, color .15s; }
.ch-vbtn:hover { background: #2c2c2c; }
.ch-vbtn:active { transform: scale(.95); }
.ch-vbtn svg { width: 22px; height: 22px; }
.ch-vbtn.off { background: #3a1f1d; border-color: #5a2b28; color: var(--bad); }
.ch-vbtn.end { background: #f2f2f2; color: #111; border-color: #f2f2f2; }
.ch-vbtn.end:hover { background: #fff; }
.ch-voice-auto { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--muted); font-size: 13px; cursor: pointer; user-select: none; }
.ch-voice-auto input { position: absolute; opacity: 0; pointer-events: none; }
.ch-voice-auto span { position: relative; width: 36px; height: 21px; border-radius: 999px; background: #333; transition: background .2s; }
.ch-voice-auto span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #999; transition: transform .2s, background .2s; }
.ch-voice-auto input:checked + span { background: #f2f2f2; }
.ch-voice-auto input:checked + span::after { transform: translateX(15px); background: #111; }
.ch-voice-auto input:focus-visible + span { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 860px) { .ch-vbtn { height: 52px; } .ch-vbtn.wide span { display: none; } .ch-att { max-width: 88%; } }

.ch-voice[hidden], .ch-drop[hidden], .ch-files[hidden] { display: none; }

/* ——— Telegram: «Пятница на главном экране» ——— */
.ch-tghome { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 520px; margin: 0 auto 18px; padding: 12px 12px 12px 14px; border: 1px solid var(--line2); border-radius: 16px; background: linear-gradient(160deg, #232323, #1a1a1a); text-align: left; animation: ch-pop .3s ease-out; }
.ch-tghome[hidden] { display: none; }
.ch-tghome img { border-radius: 11px; flex: none; }
.ch-tghome div { min-width: 0; flex: 1; line-height: 1.35; }
.ch-tghome b { display: block; font-size: 14.5px; }
.ch-tghome span { color: var(--muted); font-size: 12.5px; }
.ch-tghome button { flex: none; height: 36px; padding: 0 14px; border: 0; border-radius: 11px; background: #f2f2f2; color: #111; font-weight: 650; font-size: 13.5px; }

/* ——— Акция запуска ——— */
@property --pr-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes pr-turn { to { --pr-a: 360deg; } }
.ch-promo { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 640px; margin: 0 auto 18px; padding: 14px 14px 14px 16px; border-radius: 18px; text-align: left;
  border: 2px solid transparent; background: linear-gradient(#1a1418, #1a1418) padding-box, conic-gradient(from var(--pr-a), #ff8a3d, #ff4f8b, #a855f7, #ffd166, #ff8a3d) border-box;
  animation: pr-turn 5s linear infinite, ch-pop .35s ease-out; box-shadow: 0 0 40px -16px rgba(255, 110, 120, .7); }
.ch-promo[hidden] { display: none; }
.ch-promo-ico { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(135deg, #ffb36b, #ff4f8b 55%, #a855f7); color: #fff; }
.ch-promo-ico svg { width: 22px; height: 22px; }
.ch-promo-txt { min-width: 0; flex: 1; line-height: 1.35; }
.ch-promo-txt b { display: block; font-size: 15px; }
.ch-promo-txt span { color: var(--soft); font-size: 12.5px; }
.ch-promo button { flex: none; height: 38px; padding: 0 16px; border: 0; border-radius: 11px; background: #f2f2f2; color: #111; font-weight: 650; font-size: 13.5px; }
.ch-promo button:hover { background: #fff; }
@media (max-width: 560px) { .ch-promo { flex-wrap: wrap; } .ch-promo button { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .ch-promo { animation: none; } }

/* ——— Файлы Word / Excel / PowerPoint ——— */
.ch-doc { display: flex; align-items: center; gap: 14px; max-width: 520px; margin: 10px 0 14px; padding: 12px 12px 12px 14px; border: 1px solid var(--line2); border-radius: 16px; background: linear-gradient(160deg, #222, #1a1a1a); animation: ch-pop .3s ease-out; }
.ch-doc-ico { width: 44px; height: 52px; flex: none; display: grid; place-items: end center; padding-bottom: 7px; border-radius: 9px 14px 9px 9px; color: #fff; font: 800 11px/1 var(--font); letter-spacing: .06em; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.ch-doc.pptx .ch-doc-ico { background: linear-gradient(160deg, #f97316, #c2410c); }
.ch-doc.xlsx .ch-doc-ico { background: linear-gradient(160deg, #22c55e, #15803d); }
.ch-doc.docx .ch-doc-ico { background: linear-gradient(160deg, #3b82f6, #1d4ed8); }
.ch-doc-txt { min-width: 0; flex: 1; line-height: 1.35; }
.ch-doc-txt b { display: block; font-size: 14.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ch-doc-txt span { color: var(--muted); font-size: 12.5px; }
.ch-doc-go, .md a.ch-doc-go { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 11px; background: #f2f2f2; color: #111; font-weight: 650; font-size: 13.5px; text-decoration: none; }
.ch-doc-go:hover, .md a.ch-doc-go:hover { background: #fff; color: #000; }
.ch-doc-go svg { width: 16px; height: 16px; }
.ch-doc-spin { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid #3a3a3a; border-top-color: #f2f2f2; animation: ch-spin .8s linear infinite; }
.ch-doc.building .ch-doc-txt span { background: linear-gradient(90deg, #8a8a8a, #f0f0f0, #8a8a8a); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ch-sh 1.8s linear infinite; }

/* ——— Инкогнито ——— */
.ch-incog { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--side); color: var(--soft); font-size: 13px; font-weight: 600; }
.ch-incog svg { width: 17px; height: 17px; }
.ch-incog:hover { color: #fff; border-color: var(--line2); }
.ch-incog.on { background: #e9e9ef; color: #111; border-color: #e9e9ef; }
.ch-incog-bar { display: flex; align-items: center; gap: 10px; max-width: 780px; margin: 0 auto 8px; padding: 8px 8px 8px 14px; border: 1px dashed #4a4a55; border-radius: 12px; color: #cfcfe0; font-size: 12.5px; }
.ch-incog-bar[hidden] { display: none; }
.ch-incog-bar svg { width: 16px; height: 16px; flex: none; }
.ch-incog-bar button { margin-left: auto; height: 28px; padding: 0 12px; border: 0; border-radius: 8px; background: #2a2a33; color: #fff; font-size: 12px; font-weight: 600; }
body.incognito { --bg: #0e0e12; --side: #0a0a0d; }
body.incognito .ch-box { border-style: dashed; border-color: #4a4a55; }
body.incognito .ch-hello h1 { background: linear-gradient(100deg, #fff, #b8b8d8); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (max-width: 860px) { .ch-incog span { display: none; } .ch-incog { padding: 0 9px; height: 32px; } .ch-incog-bar { margin: 0 10px 6px; } }

/* ——— Пятница Редакция: Telegram-каналы ——— */
:root { --tg: #2aabee; --tg2: #1d8fd1; }
.tgp { fill: #fff; stroke: none !important; }
.ch-tgf { position: relative; flex: none; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(140deg, #3fbaf0, var(--tg2)); display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 4px 14px rgba(42,171,238,.35); }
.ch-tgf .tgp { width: 15px; height: 15px; margin-left: -1px; }
.ch-tgf i { position: absolute; right: -5px; bottom: -4px; width: 15px; height: 15px; border-radius: 5px; background: #f4f4f4; box-shadow: 0 0 0 2px #161616; display: flex; align-items: center; justify-content: center; gap: 1.5px; }
.ch-tgf i b { width: 2px; border-radius: 1px; background: #161616; }
.ch-tgf i b:nth-child(1) { height: 5px; } .ch-tgf i b:nth-child(2) { height: 8px; } .ch-tgf i b:nth-child(3) { height: 4px; }
.ch-tgf.big { width: 58px; height: 58px; margin: 4px auto 14px; }
.ch-tgf.big .tgp { width: 32px; height: 32px; }
.ch-tgf.big i { width: 26px; height: 26px; border-radius: 8px; right: -8px; bottom: -6px; gap: 3px; box-shadow: 0 0 0 3px #1b1b1b; }
.ch-tgf.big i b { width: 3px; } .ch-tgf.big i b:nth-child(1) { height: 9px; } .ch-tgf.big i b:nth-child(2) { height: 14px; } .ch-tgf.big i b:nth-child(3) { height: 7px; }

.ch-new-tg { margin-top: 8px; height: 52px !important; border-color: transparent !important; gap: 12px !important; background: linear-gradient(100deg, rgba(42,171,238,.16), rgba(42,171,238,.04)) !important; box-shadow: inset 0 0 0 1px rgba(42,171,238,.32) !important; }
.ch-new-tg:hover { box-shadow: inset 0 0 0 1px rgba(42,171,238,.6), 0 0 22px rgba(42,171,238,.18) !important; }
.ch-new-tg-t { display: flex; flex-direction: column; line-height: 1.15; text-align: left; flex: 1; min-width: 0; }
.ch-new-tg-t b { font-weight: 600; font-size: 14px; color: #fff; }
.ch-new-tg-t small { font-size: 11.5px; color: #8fcff2; font-weight: 500; }
.ch-new-tg em { font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; color: #e9ddff; box-shadow: inset 0 0 0 1px #8b5cf6; }

.ch-group.tg { color: #7cc6ef; }
.ch-item.tg { position: relative; margin: 2px 0; border-radius: 10px; background: linear-gradient(90deg, rgba(42,171,238,.13), rgba(42,171,238,.03)); box-shadow: inset 0 0 0 1px rgba(42,171,238,.28); }
.ch-item.tg a { display: flex; align-items: center; gap: 9px; color: #d6eefc; }
.ch-item.tg a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.ch-item.tg a .tgp { flex: none; width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: var(--tg); box-sizing: border-box; }
.ch-item.tg:hover, .ch-item.tg.on { background: linear-gradient(90deg, rgba(42,171,238,.24), rgba(42,171,238,.07)); box-shadow: inset 0 0 0 1px rgba(42,171,238,.65), 0 0 18px rgba(42,171,238,.22); }
.ch-item.tg.on a { color: #fff; }
.ch-badge { flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--tg); color: #fff; font-size: 11px; font-weight: 700; font-style: normal; display: grid; place-items: center; box-shadow: 0 0 10px rgba(42,171,238,.6); animation: ch-tgpulse 2.4s ease-in-out infinite; }
@keyframes ch-tgpulse { 50% { box-shadow: 0 0 2px rgba(42,171,238,.2); } }

.ch-chan { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 6px; border: 0; border-radius: 12px; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600; color: #fff; background: linear-gradient(100deg, rgba(42,171,238,.28), rgba(42,171,238,.12)); box-shadow: inset 0 0 0 1px rgba(42,171,238,.6); max-width: 260px; }
.ch-chan .tgp { flex: none; width: 24px; height: 24px; padding: 5px; border-radius: 50%; background: var(--tg); box-sizing: border-box; }
.ch-chan span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-chan em { font-style: normal; min-width: 18px; height: 18px; border-radius: 9px; background: #fff; color: #0b6fa8; font-size: 11px; font-weight: 800; display: grid; place-items: center; padding: 0 5px; }
.ch-chan .gear { flex: none; width: 15px; height: 15px; fill: none; stroke: #bfe6fb; stroke-width: 1.6; }
.ch-chan.off { background: rgba(42,171,238,.1); box-shadow: inset 0 0 0 1px rgba(42,171,238,.45); animation: ch-tgglow 2.6s ease-in-out infinite; }
@keyframes ch-tgglow { 50% { box-shadow: inset 0 0 0 1px rgba(42,171,238,.9), 0 0 16px rgba(42,171,238,.35); } }
body.channel-chat .ch-incog { display: none; }

/* вступление в чате канала */
.ch-chan-intro { border-radius: 18px; padding: 20px; background: linear-gradient(160deg, rgba(42,171,238,.12), rgba(255,255,255,.02) 55%); box-shadow: inset 0 0 0 1px rgba(42,171,238,.25); }
.ch-chan-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.ch-chan-hero .ch-tgf { width: 44px; height: 44px; } .ch-chan-hero .ch-tgf .tgp { width: 24px; height: 24px; }
.ch-chan-hero .ch-tgf i { width: 20px; height: 20px; right: -6px; bottom: -5px; border-radius: 6px; gap: 2px; } .ch-chan-hero .ch-tgf i b { width: 2.5px; }
.ch-chan-hero b { display: block; font-size: 18px; letter-spacing: -.01em; } .ch-chan-hero span { color: #9ccfeb; font-size: 13.5px; }
.ch-chan-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.ch-chan-steps li { display: flex; gap: 12px; align-items: flex-start; color: #8e8e8e; }
.ch-chan-steps li > i { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12.5px; font-weight: 700; background: #222; color: #9a9a9a; }
.ch-chan-steps li > i svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 2.2; }
.ch-chan-steps li b { display: block; color: #d9d9d9; font-weight: 600; font-size: 14.5px; margin: 3px 0 2px; }
.ch-chan-steps li span { font-size: 13.5px; line-height: 1.45; }
.ch-chan-steps li.now > i { background: var(--tg); color: #fff; box-shadow: 0 0 14px rgba(42,171,238,.5); }
.ch-chan-steps li.now b { color: #fff; }
.ch-chan-steps li.done > i { background: #1f7a4d; }
.ch-chan-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ch-cbtn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 11px; border: 0; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600; color: #e8e8e8; background: #262626; box-shadow: inset 0 0 0 1px #363636; text-decoration: none; }
.ch-cbtn:hover { background: #2e2e2e; }
.ch-cbtn.tg { background: var(--tg); color: #fff; box-shadow: none; }
.ch-cbtn.tg:hover { background: #3cb6f2; }
.ch-cbtn.tg .tgp { width: 16px; height: 16px; }
.ch-cbtn.main { background: #f2f2f2; color: #111; box-shadow: none; }
.ch-cbtn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.ch-cbtn:disabled { opacity: .55; cursor: default; }
.ch-chan-ideas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ch-chan-ideas .ch-idea { min-height: 0; padding: 11px 13px; }
.ch-chan-more { margin: 12px 0 0; font-size: 12.5px; color: #8a8a8a; }

/* карточка поста — как в Telegram */
.ch-post { margin: 12px 0; max-width: 460px; border-radius: 16px; overflow: hidden; background: #1d2733; box-shadow: inset 0 0 0 1px rgba(42,171,238,.22), 0 10px 30px rgba(0,0,0,.25); }
.ch-post-head { display: flex; align-items: center; gap: 9px; padding: 10px 12px; }
.ch-post-ava { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--tg); display: grid; place-items: center; }
.ch-post-ava .tgp { width: 14px; height: 14px; }
.ch-post-head b { font-size: 13.5px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ch-post-st { margin-left: auto; flex: none; font-size: 11.5px; font-weight: 600; color: #9fb4c6; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.06); }
.ch-post.st-pending .ch-post-st { color: #fff; background: var(--tg); }
.ch-post.st-published .ch-post-st { color: #b7f2cf; background: rgba(46,160,96,.22); }
.ch-post.st-scheduled .ch-post-st { color: #d8ccff; background: rgba(139,92,246,.22); }
.ch-post.st-failed .ch-post-st { color: #ffc2b8; background: rgba(220,80,60,.22); }
.ch-post.st-rejected { opacity: .55; }
.ch-post-img { display: block; width: 100%; padding: 0; border: 0; background: #0f151c; cursor: zoom-in; }
.ch-post-img img { display: block; width: 100%; max-height: 420px; object-fit: cover; }
.ch-post-draw { position: relative; height: 220px; background: radial-gradient(120% 90% at 30% 20%, rgba(42,171,238,.35), transparent 60%), radial-gradient(100% 80% at 80% 90%, rgba(139,92,246,.3), transparent 60%), #121a23; overflow: hidden; display: grid; place-items: end start; }
.ch-post-draw span { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.12) 50%, transparent 70%); animation: ch-postsweep 1.8s linear infinite; }
.ch-post-draw em { position: relative; margin: 12px; font-style: normal; font-size: 12.5px; color: #dbeefa; background: rgba(0,0,0,.35); padding: 5px 10px; border-radius: 999px; }
@keyframes ch-postsweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.ch-post-txt { padding: 10px 14px 12px; font-size: 14.5px; line-height: 1.5; color: #eef3f7; word-break: break-word; }
.ch-post-txt a { color: #6ec7f5; }
.ch-post.building .ch-post-txt { color: #c7d3dc; }
.ch-post.building .ch-post-st { animation: ch-tgpulse 1.4s infinite; color: #fff; background: rgba(42,171,238,.4); }
.ch-post-err { margin: 0 14px 10px; font-size: 12.5px; color: #ffb4a6; }
.ch-post-wait { display: flex; align-items: center; gap: 8px; margin: 0 14px 12px; font-size: 12.5px; color: #9fd6f5; }
.ch-post-wait i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(42,171,238,.3); border-top-color: var(--tg); animation: ch-spin .8s linear infinite; }
@keyframes ch-spin { to { transform: rotate(360deg); } }
.ch-post-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 12px; border-top: 1px solid rgba(255,255,255,.06); }
.ch-post-txt .ch-post-bar { border: 0; padding: 8px 0 0; }
.ch-pb { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border: 0; border-radius: 10px; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; color: #dfe9f0; background: rgba(255,255,255,.07); text-decoration: none; }
.ch-pb:hover { background: rgba(255,255,255,.12); }
.ch-pb svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.ch-pb .tgp { fill: #fff; }
.ch-pb.main { background: var(--tg); color: #fff; }
.ch-pb.main:hover { background: #3cb6f2; }
.ch-pb.icon { padding: 0 9px; margin-left: auto; }
.ch-pb:disabled { opacity: .5; cursor: default; }
.ch-post-edit { width: 100%; box-sizing: border-box; min-height: 110px; resize: vertical; border: 0; border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px; line-height: 1.5; color: #fff; background: rgba(0,0,0,.3); box-shadow: inset 0 0 0 1px rgba(42,171,238,.45); outline: none; }

/* настройки канала */
.ch-chan-dlg { width: min(560px, calc(100vw - 24px)); max-height: min(86vh, 860px); padding: 0; text-align: left; overflow: hidden; }
.ch-chan-dlg[open] { display: flex; flex-direction: column; }
.ch-chan-dlg-head { display: flex; align-items: center; gap: 14px; padding: 22px 56px 16px 22px; border-bottom: 1px solid #262626; }
.ch-chan-dlg-head .ch-tgf { width: 40px; height: 40px; } .ch-chan-dlg-head .ch-tgf .tgp { width: 22px; height: 22px; }
.ch-chan-dlg-head .ch-tgf i { width: 18px; height: 18px; right: -6px; bottom: -5px; border-radius: 6px; } .ch-chan-dlg-head .ch-tgf i b { width: 2.5px; }
.ch-chan-dlg-head h2 { margin: 0; font-size: 18px; } .ch-chan-dlg-head p { margin: 2px 0 0; color: #8d8d8d; font-size: 13px; }
.ch-saved { margin-left: 6px; color: #7fd3a4; opacity: 0; transition: opacity .25s; } .ch-saved.on { opacity: 1; }
.ch-chan-dlg-body { overflow-y: auto; padding: 6px 22px 22px; }
.ch-chan-dlg-body section { padding: 16px 0; border-bottom: 1px solid #232323; }
.ch-chan-dlg-body section:last-child { border: 0; }
.ch-chan-dlg-body section.dim { opacity: .55; }
.ch-chan-dlg-body h3 { margin: 0 0 12px; font-size: 14px; font-weight: 650; color: #fff; }
.ch-chan-dlg-body h3 small { font-weight: 500; color: #7a7a7a; margin-left: 6px; }
.ch-cnote { margin: 8px 0 0; font-size: 12.5px; line-height: 1.5; color: #8b8b8b; }
.ch-cnote.warn { color: #ffcf8a; }
.ch-cnote a, .ch-cline a:not(.ch-cbtn) { color: #7cc6ef; }
.ch-cc { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: rgba(42,171,238,.08); box-shadow: inset 0 0 0 1px rgba(42,171,238,.3); }
.ch-cc .ch-post-ava { width: 34px; height: 34px; } .ch-cc .ch-post-ava .tgp { width: 18px; height: 18px; }
.ch-cc > div { flex: 1; min-width: 0; } .ch-cc b { display: block; font-size: 14.5px; } .ch-cc span { font-size: 12.5px; color: #9ab9cc; }
.ch-cc.off { background: rgba(220,80,60,.08); box-shadow: inset 0 0 0 1px rgba(220,80,60,.35); } .ch-cc.off span { color: #ffb4a6; }
.ch-cline { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; color: #a8a8a8; line-height: 1.45; }
.ch-cline span { flex: 1; } .ch-cline.ok { color: #9fe0bb; } .ch-cline > svg { flex: none; width: 16px; height: 16px; fill: none; stroke: #7fd3a4; stroke-width: 2; }
.ch-cfield { display: grid; gap: 6px; margin-top: 12px; font-size: 12.5px; color: #8d8d8d; }
.ch-cfield select, .ch-cfield textarea, .ch-crow input, .ch-crow select, .ch-ctime input { font: inherit; font-size: 13.5px; color: #fff; background: #202020; border: 0; border-radius: 10px; padding: 9px 11px; box-shadow: inset 0 0 0 1px #343434; outline: none; }
.ch-cfield textarea { resize: vertical; min-height: 54px; }
.ch-cfield select:focus, .ch-cfield textarea:focus, .ch-crow input:focus, .ch-ctime input:focus { box-shadow: inset 0 0 0 1px var(--tg); }
.ch-cmore { margin-top: 12px; } .ch-cmore summary { cursor: pointer; font-size: 13px; color: #9a9a9a; } .ch-cmore[open] summary { margin-bottom: 8px; }
.ch-crow { display: flex; gap: 8px; margin-top: 8px; } .ch-crow input { flex: 1; min-width: 0; } .ch-crow select { max-width: 130px; }
.ch-crow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ch-ctime { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.ch-ctime input { width: 96px; color-scheme: dark; }
.ch-cdays { display: flex; gap: 4px; flex: 1; }
.ch-cdays button { width: 34px; height: 32px; border: 0; border-radius: 9px; font: inherit; font-size: 12px; font-weight: 600; color: #8a8a8a; background: #222; cursor: pointer; }
.ch-cdays button.on { color: #fff; background: rgba(42,171,238,.35); box-shadow: inset 0 0 0 1px var(--tg); }
.ch-cx { width: 30px; height: 30px; border: 0; border-radius: 9px; background: transparent; color: #8a8a8a; cursor: pointer; display: grid; place-items: center; }
.ch-cx svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; } .ch-cx:hover { background: #262626; color: #fff; }
.ch-cradio { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.ch-cradio label { cursor: pointer; } .ch-cradio input { position: absolute; opacity: 0; pointer-events: none; }
.ch-cradio span { display: block; height: 100%; box-sizing: border-box; padding: 12px; border-radius: 12px; background: #1f1f1f; box-shadow: inset 0 0 0 1px #333; }
.ch-cradio b { display: block; font-size: 13.5px; margin-bottom: 3px; } .ch-cradio small { font-size: 12px; color: #8a8a8a; line-height: 1.4; }
.ch-cradio input:checked + span { background: rgba(42,171,238,.12); box-shadow: inset 0 0 0 1.5px var(--tg); }
.ch-cradio input:focus-visible + span { outline: 2px solid var(--tg); outline-offset: 2px; }
.ch-ctog { display: flex; align-items: center; gap: 12px; padding: 10px 0; cursor: pointer; }
.ch-ctog > span { flex: 1; } .ch-ctog b { display: block; font-size: 13.5px; font-weight: 600; } .ch-ctog small { font-size: 12px; color: #8a8a8a; }
.ch-ctog input { position: absolute; opacity: 0; pointer-events: none; }
.ch-ctog i { flex: none; width: 40px; height: 24px; border-radius: 12px; background: #333; position: relative; transition: background .2s; }
.ch-ctog i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #bdbdbd; transition: transform .2s, background .2s; }
.ch-ctog input:checked + i { background: var(--tg); } .ch-ctog input:checked + i::after { transform: translateX(16px); background: #fff; }
.ch-ctog input:focus-visible + i { outline: 2px solid var(--tg); outline-offset: 2px; }

/* окно «в подписке Max / Пятница Бизнес» */
.ch-biz { width: min(440px, calc(100vw - 24px)); }
.ch-biz-list { list-style: none; margin: 14px 0 18px; padding: 0; text-align: left; display: grid; gap: 8px; }
.ch-biz-list li { position: relative; padding-left: 24px; font-size: 13.5px; color: #d0d0d0; line-height: 1.45; }
.ch-biz-list li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 9px; height: 5px; border-left: 2px solid var(--tg); border-bottom: 2px solid var(--tg); transform: rotate(-45deg); }
.ch-biz-go { display: flex; align-items: center; justify-content: center; height: 44px; border-radius: 12px; background: #fff; color: #111; font-weight: 700; text-decoration: none; box-shadow: 0 0 0 1px #8b5cf6, 0 0 24px rgba(139,92,246,.35); }
.ch-biz-soon { margin-top: 16px; padding: 14px; border-radius: 14px; text-align: left; background: #1d1d1d; box-shadow: inset 0 0 0 1px #2e2e2e; }
.ch-biz-soon > div { display: flex; align-items: center; gap: 8px; } .ch-biz-soon b { font-size: 14px; }
.ch-biz-soon em { font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #ffd28a; padding: 2px 7px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(255,210,138,.5); }
.ch-biz-soon > span { display: block; margin-top: 6px; font-size: 12.5px; color: #9a9a9a; line-height: 1.5; }
.ch-biz-srv { margin-top: 10px; padding-top: 10px; border-top: 1px solid #2a2a2a; }
.ch-biz-srv b { color: #6f6f6f; font-weight: 600; } .ch-biz-srv em { color: #777; box-shadow: inset 0 0 0 1px #444; }

@media (max-width: 860px) {
  .ch-chan { max-width: 46vw; padding-right: 10px; } .ch-chan .gear { display: none; }
  .ch-chan-ideas { grid-template-columns: 1fr; }
  .ch-crow { flex-wrap: wrap; } .ch-crow select { max-width: none; flex: 1; }
  .ch-cradio, .ch-crow2 { grid-template-columns: 1fr; }
  .ch-cdays button { width: 30px; }
  .ch-chan-dlg { max-height: 92vh; }
}
@media (prefers-reduced-motion: reduce) { .ch-badge, .ch-chan.off, .ch-post-draw span, .ch-post.building .ch-post-st { animation: none; } }
.ch-chan em[hidden] { display: none; }
@media (max-width: 860px) {
  body.channel-chat .ch-chan { max-width: 36vw; height: 34px; padding: 0 9px 0 5px; gap: 6px; font-size: 12.5px; }
  body.channel-chat .ch-chan .tgp { width: 22px; height: 22px; }
  body.channel-chat #modelName { white-space: nowrap; max-width: 24vw; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
}
#pwaGo { margin-top: 18px; } #pwaHow { margin-top: 14px; }

/* «Подключить канал» в списке чатов — спокойная строка, без подсветки */
.ch-chan-add { display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: 500 13px var(--font); text-align: left; cursor: pointer; }
.ch-chan-add:hover { background: var(--panel); color: var(--text); }
.ch-chan-add svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
/* бот и Mini App из чата */
.ch-build .ch-site-ico .tgp { width: 18px; height: 18px; fill: currentColor; }
.ch-build .ch-site-go .tgp { width: 16px; height: 16px; fill: currentColor; }
.ch-build-undo { margin-top: 8px; border: 0; background: none; color: var(--muted); font: 500 12.5px var(--font); cursor: pointer; padding: 4px 2px; }
.ch-build-undo:hover { color: var(--text); }
.ch-build-note { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.ch-build.off { opacity: .6; }
/* кнопка канала в шапке: только в чатах каналов и без яркой подсветки */
.ch-chan[hidden] { display: none !important; }
.ch-chan, .ch-chan.off { background: var(--panel) !important; box-shadow: inset 0 0 0 1px var(--line2) !important; animation: none !important; color: var(--soft) !important; font-weight: 500 !important; }
.ch-chan:hover { background: var(--raised) !important; color: var(--text) !important; }
.ch-chan .tgp { background: #2f3a42 !important; fill: #bfe6fb; }
.ch-chan .gear { stroke: var(--muted) !important; }
.ch-chan em { background: var(--text) !important; color: #111 !important; }

/* токены и лимиты */
.ch-limit-buy { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ch-limit-buy button { border: 1px solid var(--line2); background: var(--panel); color: var(--text); border-radius: 10px; padding: 8px 12px; font: 500 13px var(--font); cursor: pointer; }
.ch-limit-buy button:hover { background: var(--raised); }
.ch-wallet { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); } .ch-wallet b { color: var(--text); font-weight: 600; }
.ch-wallet-note { margin-top: 4px; font-size: 11.5px; color: #e9c46a; line-height: 1.4; }
button.ch-up { width: 100%; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; }
.ch-shop { width: min(620px, calc(100vw - 24px)); max-height: min(90vh, 860px); overflow-y: auto; text-align: left; }
.ch-shop h2 { margin: 0 0 6px; font-size: 20px; } .ch-shop h3 { margin: 18px 0 10px; font-size: 14px; font-weight: 650; }
.ch-shop-note { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0; } .ch-shop-note b { color: var(--text); } .ch-shop-note.small { margin-top: 16px; font-size: 12px; }
.ch-shop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ch-shop-item { position: relative; border: 1px solid var(--line2); border-radius: 14px; padding: 14px; background: var(--panel); display: flex; flex-direction: column; gap: 2px; }
.ch-shop-item.best { border-color: #8b5cf6; } .ch-shop-item b { font-size: 20px; letter-spacing: -.01em; } .ch-shop-item small { color: var(--muted); font-size: 12px; }
.ch-shop-item em { position: absolute; top: 12px; right: 12px; font-style: normal; font-size: 10.5px; font-weight: 700; color: #e9ddff; box-shadow: inset 0 0 0 1px #8b5cf6; border-radius: 999px; padding: 2px 7px; }
.ch-shop-pay { display: flex; gap: 6px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.ch-shop-pay button { border: 1px solid var(--line2); background: var(--raised); color: var(--text); border-radius: 9px; padding: 7px 11px; font: 600 13px var(--font); cursor: pointer; }
.ch-shop-pay button.ch-shop-stars { background: var(--text); color: #111; border-color: var(--text); }
.ch-shop-pay button:disabled { opacity: .5; } .ch-shop-pay span { color: var(--muted); font-size: 12.5px; }
.ch-shop-list { display: grid; gap: 8px; }
.ch-shop-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; background: var(--panel); }
.ch-shop-row b { display: block; font-size: 14px; } .ch-shop-row small { color: var(--muted); font-size: 12px; line-height: 1.4; } .ch-shop-row .ch-shop-pay { margin: 0; flex: none; }
@media (max-width: 560px) { .ch-shop-row { flex-direction: column; align-items: flex-start; } }

/* лимит исчерпан — пополнить */
.ch-refill { width: 100%; margin-top: 10px; border: 0; border-radius: 10px; padding: 9px 12px; background: var(--text); color: #111; font: 600 13px var(--font); cursor: pointer; }
.ch-refill:hover { opacity: .9; }
.ch-hint-buy { margin-left: 8px; border: 0; border-radius: 8px; padding: 4px 10px; background: var(--text); color: #111; font: 600 12px var(--font); cursor: pointer; vertical-align: middle; }
/* поиск в интернете */
.ch-web { display: inline-flex; align-items: center; gap: 8px; margin: 2px 0 8px; padding: 6px 12px; border-radius: 999px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line2); color: var(--muted); font-size: 12.5px; max-width: 100%; }
.ch-web span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-web svg { width: 14px; height: 14px; flex: none; }
.ch-web.live { color: var(--soft); }

/* правка запроса */
.ch-msg.user { position: relative; }
.ch-edit { position: absolute; right: 100%; bottom: 4px; margin-right: 6px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s; display: grid; place-items: center; }
.ch-edit svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.ch-msg.user:hover .ch-edit, .ch-edit:focus-visible { opacity: 1; } .ch-edit:hover { background: var(--panel); color: var(--text); }
@media (hover: none) { .ch-edit { opacity: .55; } }
.ch-msg.editing .ch-edit { display: none; }
.ch-edit-box { width: min(620px, 100%); display: flex; flex-direction: column; gap: 8px; }
.ch-edit-box textarea { width: 100%; box-sizing: border-box; resize: none; border: 1px solid var(--line2); border-radius: 14px; background: var(--panel); color: var(--text); font: 16px/1.5 var(--font); padding: 10px 14px; }
.ch-edit-box > div { display: flex; justify-content: flex-end; gap: 8px; }
.ch-edit-box button { border: 1px solid var(--line2); background: var(--raised); color: var(--text); border-radius: 10px; padding: 7px 14px; font: 500 13px var(--font); cursor: pointer; }
.ch-edit-box button.primary { background: var(--text); color: #111; border-color: var(--text); }
/* очередь сообщений во время ответа */
.ch-queue { display: flex; flex-direction: column; gap: 6px; margin: 0 auto 8px; width: 100%; max-width: 780px; box-sizing: border-box; }
.ch-queue[hidden] { display: none; }
.ch-queue-item { display: flex; align-items: center; gap: 8px; border: 1px dashed var(--line2); border-radius: 12px; padding: 7px 8px 7px 12px; background: var(--panel); font-size: 13.5px; }
.ch-queue-l { flex: none; color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ch-queue-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-queue-item button { flex: none; border: 0; background: var(--raised); color: var(--text); border-radius: 8px; padding: 4px 10px; font: 500 12.5px var(--font); cursor: pointer; }
/* во время ответа с текстом в поле — кнопка «добавить», а не «стоп» */
.ch-send.busy.queue .i-up { display: block; } .ch-send.busy.queue .i-stop { display: none; }
.ch-shop-link { color: var(--soft) !important; opacity: 1 !important; } .ch-shop-link:hover { color: var(--text) !important; }

.ch-mi-test { border-color: #e9c46a !important; color: #f3d98b !important; }

/* видео и графика (Ultra) */
.ch-vid { position: relative; display: block; margin: 10px 0; max-width: 560px; border-radius: 16px; overflow: hidden; background: #000; }
.ch-vid video { display: block; width: 100%; max-height: 70vh; background: #000; }
.ch-vid .ch-img-bar { position: absolute; top: 8px; right: 8px; }
.ch-svg { margin: 10px 0; max-width: 640px; border: 1px solid var(--line2); border-radius: 16px; overflow: hidden; background: #fff; }
.ch-svg .ch-img-open { display: block; width: 100%; padding: 0; border: 0; background: #fff; cursor: zoom-in; }
.ch-svg img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; }
.ch-svg-bar { display: flex; gap: 6px; padding: 8px; background: var(--panel); border-top: 1px solid var(--line2); }
.ch-svg-bar button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line2); background: var(--raised); color: var(--text); border-radius: 8px; padding: 5px 10px; font: 500 12.5px var(--font); cursor: pointer; }
.ch-svg-bar svg { width: 14px; height: 14px; }
.ch-svg pre { margin: 0; padding: 12px; max-height: 260px; overflow: auto; background: #111; font-size: 12px; }
.ch-svg.pending { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--panel); color: var(--muted); font-size: 13px; }
.ch-svg.pending svg { width: 15px; height: 15px; }
a.ch-chan-add { text-decoration: none; box-sizing: border-box; } a.ch-chan-add:hover { color: var(--text); }

/* кнопка «Токены и лимиты» */
.ch-up.ch-shop-link { font-size: 13px; font-weight: 600; padding: 8px 0; margin-top: 6px; }
