/* Мир: тёмная студия на палитре редактора Rendry. Главное действие везде мятное, покупки и цены — латунные,
   цвет вида работы (ответы фиолетовые, картинки зелёные) живёт только в значках. Интерфейс набран Golos Text,
   заголовки — Manrope. Раскладка: на телефоне колонка с панелью разделов снизу; в окне Telegram Desktop
   от 700px — панель слева, от 1100px — панель с подписями. */
@font-face { font-family: 'Golos Text'; font-weight: 400 700; font-display: swap; src: url(/static/fonts/golos-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-weight: 400 700; font-display: swap; src: url(/static/fonts/golos-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-weight: 800; font-display: swap; src: url(/static/fonts/manrope-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-weight: 800; font-display: swap; src: url(/static/fonts/manrope-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: dark;
  --shell: #111116;
  --panel: #19191e;
  --field: #232329;
  --stage: #2a2a31;
  --hover: #202026;
  --press: #0d0d11;
  --hair: #27272d;
  --guide: #33333b;
  --rule: #8a8a95;
  --val: #f4f4f5;
  --sec: #d2cec8;
  --quiet: #a09a90;
  --ink: #141418;
  --t-chat: #9a9cff;  --n-chat: #262848;
  --t-photo: #34d399; --n-photo: #173a2e;
  --mint: #6ee7d4;
  --bad: #f79a2e; --bad-bg: #35291d; --bad-tx: #f0e2cc;
  --money: #e8d877; --money-bg: #2d2b24;
  --paper: #f1e8db;
  --scrim: rgba(8, 8, 10, 0.64);
  --lift: 0 18px 44px rgba(0, 0, 0, 0.5);
  --display: 'Manrope', ui-sans-serif, system-ui, sans-serif;
  --sans: 'Golos Text', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --tabbar-h: 58px;
  --safe-b: max(8px, calc(max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px)) - 12px));
}
.m-chat { --t: var(--t-chat); --n: var(--n-chat); }
.m-photo { --t: var(--t-photo); --n: var(--n-photo); }

html, body { height: 100%; }
body { margin: 0; background: var(--shell); color: var(--val); font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--rule); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
img { display: block; }
svg { flex: none; }
[hidden] { display: none !important; }
.display { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; }
.num { font-variant-numeric: tabular-nums; }
.band { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.star { white-space: nowrap; }
.star svg { display: inline-block; width: 0.9em; height: 0.9em; margin-right: 1px; vertical-align: -0.1em; fill: currentColor; }

.app { position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.view { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 24px; }
.view.flush { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
.page { max-width: 640px; }
.rail-nav { display: none; }

.topbar { display: flex; align-items: center; gap: 10px; min-height: 56px; padding-block: 6px 4px; }
.brand { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.logo { flex: none; width: 30px; height: 30px; border-radius: 50%; }
.word { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
.title { flex: 1; min-width: 0; font-size: 26px; line-height: 1.15; }
.count-pill { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 20px; background: var(--field); font-size: 14px; font-weight: 500; white-space: nowrap; }
.count-pill svg { width: 17px; height: 17px; color: var(--money); }
.ava { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--stage); font-size: 14px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--guide); }
.ava.big { width: 64px; height: 64px; font-size: 22px; }
.hello { display: grid; gap: 4px; padding-block: 12px 4px; }
.hello h1 { font-size: 30px; line-height: 1.1; }
.hello p { color: var(--sec); font-size: 16.5px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-block: 28px 8px; }
.section-head h2 { font-size: 20px; line-height: 1.2; }
.link-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--mint); font-size: 14.5px; font-weight: 600; }
.foot { color: var(--quiet); font-size: 13.5px; }

.glyph { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--n, var(--stage)); color: var(--t, var(--val)); }
.glyph svg { width: 20px; height: 20px; }
.balance { margin: 0 0 6px; color: var(--sec); font-size: 16px; }
.balance .display { color: var(--money); font-size: 40px; line-height: 1; }

.card { display: grid; gap: 12px; padding: 16px; border-radius: 14px; border: 1px solid var(--hair); background: var(--panel); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-head b { font-size: 17px; font-weight: 600; }
.card p { color: var(--sec); font-size: 14.5px; }
.cards { display: grid; gap: 12px; padding-top: 8px; }
.me { display: flex; align-items: center; gap: 14px; padding-block: 8px 16px; }
.me h2 { font-size: 24px; }
.me-text { display: grid; gap: 2px; min-width: 0; }
.me-text span { color: var(--quiet); font-size: 14px; }
.btn2 { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--guide); background: var(--field); font-size: 14.5px; font-weight: 500; white-space: nowrap; }
.btn2 svg { width: 17px; height: 17px; color: var(--sec); }
.btn2.wide { width: 100%; }

.plan { display: grid; gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--hair); background: var(--shell); }
.plan.current { border-color: color-mix(in srgb, var(--mint) 45%, var(--hair)); }
.plan-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.plan h3 { font-size: 18px; }
.price-tag { flex: none; color: var(--money); font-size: 15px; font-weight: 600; }
.cta.buy { min-height: 46px; background: var(--money); }
.gains { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; color: var(--sec); font-size: 14.5px; }

/* Картинки: эффект на фото, картинка по описанию и результат. */
.upload { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 76px; box-sizing: border-box; padding: 14px 16px; margin-top: 16px; border-radius: 14px; border: 1.5px dashed color-mix(in srgb, var(--t-photo) 55%, var(--guide)); background: linear-gradient(160deg, var(--n-photo), var(--panel) 75%); text-align: left; }
.upload.draw { margin-top: 12px; border-style: solid; border-color: var(--hair); background: var(--panel); }
.upload > span:nth-child(2) { flex: 1; min-width: 0; display: grid; gap: 2px; }
.upload b { font-size: 16px; font-weight: 600; }
.upload > span:nth-child(2) > span { color: var(--sec); font-size: 14px; }
.upload > svg { width: 18px; height: 18px; color: var(--quiet); }
.upload.big { flex-direction: column; justify-content: center; min-height: 168px; margin-top: 0; text-align: center; }
.upload.big > span:nth-child(2) { flex: none; }
.rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: max(16px, env(safe-area-inset-left, 0px)); scrollbar-width: none; padding-block: 12px 2px; }
.rail::-webkit-scrollbar { display: none; }
.fx { flex: 0 0 29%; scroll-snap-align: start; display: grid; align-content: start; gap: 4px; text-align: left; }
.fx-art { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 10px; background: var(--stage); margin-bottom: 2px; }
.fx-art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fx b { font-size: 14px; font-weight: 600; }
.fx-desc { color: var(--quiet); font-size: 12.5px; line-height: 1.3; }
.fx.on .fx-art { box-shadow: 0 0 0 2px var(--shell), 0 0 0 4px var(--t-photo); }
.fx-src { position: absolute; left: 6px; bottom: 6px; width: 34%; aspect-ratio: 1; overflow: hidden; border-radius: 50%; box-shadow: 0 0 0 2px var(--shell), 0 2px 8px rgba(0, 0, 0, 0.45); }
.fx-src img { width: 100%; height: 100%; object-fit: cover; }
.fx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; align-items: start; }
.form { display: grid; gap: 12px; padding-block: 8px 0; }
.label { display: block; margin-top: 4px; color: var(--sec); font-size: 14px; font-weight: 500; }
.label i { color: var(--quiet); font-style: normal; font-weight: 400; }
.hint { color: var(--quiet); font-size: 13.5px; }
.field { border-radius: 12px; border: 1px solid var(--guide); background: var(--field); overflow: hidden; }
.field:focus-within { border-color: var(--mint); }
.field textarea, .field input { display: block; width: 100%; box-sizing: border-box; padding: 12px 14px; border: 0; background: none; color: var(--val); font: inherit; line-height: 1.45; resize: none; }
.field textarea:focus, .field input:focus { outline: none; }
.field ::placeholder { color: var(--quiet); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip.on { box-shadow: inset 0 0 0 1px var(--rule); background: var(--stage); color: var(--val); }
.chip:disabled:not(.on) { opacity: .4; }
.photo-pick { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; border: 1px solid var(--hair); background: var(--panel); }
.photo-pick img { width: 60px; height: 80px; object-fit: cover; border-radius: 8px; }
.photo-pick div { display: grid; gap: 2px; flex: 1; min-width: 0; }
.photo-pick span { color: var(--quiet); font-size: 13.5px; }
.mainbar { position: sticky; bottom: 0; display: grid; gap: 8px; margin-top: 8px; padding: 12px 0 8px; background: linear-gradient(to top, var(--shell) 74%, transparent); }
.cta { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 0 18px; box-sizing: border-box; border-radius: 12px; background: var(--mint); color: var(--ink); font-weight: 600; font-size: 16px; text-align: center; }
.cta svg { width: 19px; height: 19px; }
.cta:disabled { opacity: 0.45; cursor: default; }
.cost { color: var(--quiet); font-size: 13.5px; text-align: center; }
.result { display: grid; gap: 12px; padding-block: 8px 0; }
.result-art { position: relative; overflow: hidden; border-radius: 14px; background: var(--stage); }
.result-img { display: block; width: 100%; max-height: 72vh; object-fit: contain; background: var(--press); }
.result-img.developing { filter: blur(18px) saturate(0.4); transform: scale(1.05); }
.result-empty { display: grid; place-items: center; aspect-ratio: 3 / 4; }
.result-art .status { position: absolute; left: 10px; right: 10px; bottom: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(14, 14, 18, 0.72); font-size: 13.5px; }
.seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 12px; background: var(--field); }
.seg button { min-height: 44px; padding: 0 14px; border-radius: 10px; color: var(--quiet); font-size: 14px; font-weight: 500; text-align: center; }
.seg button.on { background: var(--stage); color: var(--val); }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; }
.delivered { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--quiet); font-size: 13.5px; }
.delivered svg { width: 16px; height: 16px; color: var(--t-photo); }
.link-btn.center { justify-content: center; width: 100%; }
.acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.acts > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.act { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 48px; border-radius: 12px; border: 1px solid var(--hair); background: var(--panel); color: var(--sec); font-size: 14px; font-weight: 500; }
.act svg { width: 19px; height: 19px; color: var(--val); }
.heroes { display: grid; gap: 4px; }
.hero-row { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; padding-block: 4px; }
.hero-row::-webkit-scrollbar { display: none; }
.hero { flex: none; width: 76px; display: grid; justify-items: center; align-content: start; gap: 6px; font-size: 13px; }
.hero b { max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-align: center; line-height: 1.25; font-weight: 500; }
.hero img, .hero-add { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--stage); }
.hero-add { display: grid; place-items: center; border: 1px dashed var(--guide); color: var(--mint); box-sizing: border-box; }
.hero-add svg { width: 22px; height: 22px; }
.hero-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-photos > img, .hero-photo { width: 72px; height: 96px; border-radius: 10px; object-fit: cover; background: var(--stage); }
.hero-photo { position: relative; overflow: hidden; display: grid; place-items: center; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo .x { position: absolute; top: 0; right: 0; width: 32px; height: 32px; display: grid; place-items: center; background: color-mix(in srgb, var(--press) 70%, transparent); color: var(--val); border-bottom-left-radius: 10px; }
.hero-photo .x svg { width: 14px; height: 14px; }
.hero-photo.add { border: 1px dashed var(--guide); color: var(--mint); box-sizing: border-box; }
.hero-photo.add svg { width: 22px; height: 22px; }
.library { display: grid; gap: 4px; padding-bottom: 8px; }
.library .section-head { padding-top: 12px; }
.lib-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tile { display: block; }
.tile-art { position: relative; display: block; overflow: hidden; aspect-ratio: 1 / 1; border-radius: 10px; background: var(--stage); }
.tile-art > img, .tile-art > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .pub { position: absolute; left: 6px; bottom: 6px; padding: 3px 7px; border-radius: 6px; background: rgba(14, 14, 18, 0.72); font-size: 12px; font-weight: 500; }

/* Лента: работы с автором, рецептом, лайками и повтором. */
.feed { display: grid; gap: 28px; padding-block: 16px 24px; }
.post { display: grid; gap: 10px; align-content: start; }
.post-head { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.post-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.icon-btn { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; color: var(--sec); }
.icon-btn svg { width: 20px; height: 20px; }
.shot { width: 100%; border-radius: 12px; background: var(--stage); object-fit: cover; }
.post-body { display: grid; gap: 6px; }
.post-prompt { font-size: 15px; }
.recipe { color: var(--quiet); font-size: 13.5px; }
.actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.like { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 10px; background: var(--field); color: var(--sec); font-size: 14px; font-weight: 500; }
.like svg { width: 18px; height: 18px; }
.like.on { color: var(--t-photo); }
.like.on svg { fill: currentColor; }
.remixed { margin-left: auto; color: var(--quiet); font-size: 13px; text-align: right; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 52px; padding: 10px 14px; box-sizing: border-box; border-radius: 12px; background: var(--field); text-align: left; }
.switch { flex: none; position: relative; width: 44px; height: 26px; border-radius: 13px; background: var(--stage); box-shadow: inset 0 0 0 1px var(--rule); transition: background 0.2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--rule); transition: transform 0.2s, background 0.2s; }
.toggle.on .switch { background: var(--mint); box-shadow: none; }
.toggle.on .switch::after { transform: translateX(18px); background: var(--ink); }

/* Чаты: список, переписка и поле вопроса. Переписку листает своя область, поле вопроса стоит внизу. */
.chat-aside { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.chats-note { padding-block: 18px 24px; }
.chats-empty { padding-block: 8px; color: var(--sec); }
.list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding-block: 8px; box-sizing: border-box; text-align: left; }
.row:active, .menu-row:active { background: var(--hover); }
.row.on { background: var(--field); }
.row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.row-top b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.row-top span { flex: none; color: var(--quiet); font-size: 13px; }
.row-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--quiet); font-size: 14px; }
.chat-top { flex: none; display: flex; align-items: center; gap: 10px; min-height: 56px; border-bottom: 1px solid var(--hair); }
.chat-title { flex: 1; min-width: 0; }
.chat-title b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.msgs { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 16px; padding-block: 16px 20px; }
.msgs > .link-btn { align-self: center; }
.bubble { align-self: flex-end; max-width: 86%; display: grid; gap: 6px; padding: 10px 14px; border-radius: 14px 14px 4px 14px; background: var(--paper); color: var(--ink); }
.answer { display: grid; gap: 8px; min-width: 0; }
.answer-meta { display: flex; align-items: center; gap: 8px; color: var(--quiet); font-size: 13px; }
.answer-meta .glyph, .model-pill .glyph { width: 24px; height: 24px; border-radius: 7px; }
.answer-meta .glyph svg, .model-pill .glyph svg { width: 14px; height: 14px; }
.md { min-width: 0; overflow-wrap: anywhere; }
.md p, .md ul, .md ol, .md h3, .md h4, .md blockquote, .md hr, .md .code, .md .table { margin: 0 0 8px; }
.md ul, .md ol { padding-left: 20px; }
.md li + li, .md li > ul, .md li > ol { margin-top: 3px; }
.md h3 { font-size: 16px; }
.md h4 { font-size: 15px; }
.md > :last-child { margin-bottom: 0; }
.md em { font-style: italic; }
.md s { color: var(--quiet); }
.md code { padding: 1px 4px; border-radius: 4px; background: var(--stage); font: 0.88em ui-monospace, SFMono-Regular, Menlo, monospace; }
.md pre { margin: 0; padding: 4px 12px 10px; overflow-x: auto; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.md pre code { padding: 0; background: none; font-size: inherit; }
.md .code { border-radius: 8px; background: var(--press); }
.md .code-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 0 12px; color: var(--quiet); font-size: 12px; }
.md .code-copy { min-height: 32px; padding: 0 10px; border-radius: 7px; color: var(--sec); font-size: 12.5px; }
.md .code-copy:active { background: var(--hover); }
.md blockquote { padding: 2px 0 2px 12px; border-left: 3px solid var(--guide); color: var(--sec); }
.md hr { border: 0; border-top: 1px solid var(--hair); }
/* Тень у края таблицы шире экрана подсказывает, что её можно листнуть: фон с attachment local уезжает вместе с
   таблицей и закрывает тень, когда край уже виден. */
.md .table { overflow-x: auto; border: 1px solid var(--hair); border-radius: 8px;
  background: linear-gradient(to right, var(--shell) 30%, transparent) left / 32px 100% no-repeat local,
    linear-gradient(to left, var(--shell) 30%, transparent) right / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(255, 255, 255, 0.14), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(255, 255, 255, 0.14), transparent) right / 12px 100% no-repeat scroll; }
.md table { min-width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.45; }
.md th, .md td { padding: 7px 10px; border-bottom: 1px solid var(--hair); overflow-wrap: normal; text-align: left; vertical-align: top; }
.md .nw { white-space: nowrap; }
.md th { background: var(--field); font-weight: 600; }
.md tr:last-child td { border-bottom: 0; }
.md a { color: var(--mint); }
.answer-head .answer-meta { flex-wrap: wrap; }
.answer-when::before { content: '·'; margin-right: 8px; }
.answer-full { max-width: 760px; padding-block: 4px 16px; font-size: 15.5px; line-height: 1.6; }
.answer-full h3 { margin-top: 18px; font-size: 18px; }
.answer-full h4 { margin-top: 14px; font-size: 16px; }
.answer-tools { padding-block: 0 16px; }
.bubble .md code { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.dots { display: inline-flex; gap: 4px; padding-block: 6px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--t); animation: blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.empty-chat { margin-top: auto; display: grid; gap: 10px; }
.empty-chat p { color: var(--sec); font-size: 14.5px; }
.ideas { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 10px; background: var(--field); color: var(--sec); font-size: 14px; }
.chat-empty { flex: 1; display: grid; place-items: center; padding: 24px; color: var(--quiet); text-align: center; }
.files { display: flex; flex-wrap: wrap; gap: 6px; }
.file { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 36px; padding-left: 10px; border-radius: 10px; background: var(--field); color: var(--sec); font-size: 13.5px; overflow-wrap: anywhere; }
.bubble .file { padding-right: 10px; background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.file .x { width: 44px; height: 44px; margin: -4px 0; display: grid; place-items: center; color: var(--quiet); }
.file .x svg { width: 16px; height: 16px; }
.composer { flex: none; display: grid; gap: 8px; padding-block: 8px var(--safe-b); border-top: 1px solid var(--hair); background: var(--shell); }
.c-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.model-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; max-width: 100%; padding: 0 10px 0 8px; border-radius: 12px; background: var(--field); font-size: 14px; font-weight: 600; }
.model-pill > svg { width: 16px; height: 16px; color: var(--quiet); }
.left-note { flex: none; color: var(--money); font-size: 13.5px; }
.c-row { display: flex; align-items: flex-end; gap: 8px; }
.c-input { flex: 1; min-width: 0; min-height: 44px; max-height: 132px; box-sizing: border-box; padding: 11px 14px; border: 1px solid var(--guide); border-radius: 12px; background: var(--field); color: var(--val); font: inherit; line-height: 1.35; resize: none; }
.c-input:focus { outline: none; border-color: var(--mint); }
.c-input::placeholder { color: var(--quiet); }
.btn-sq { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--sec); }
.btn-sq svg { width: 22px; height: 22px; }
.send { background: var(--mint); color: var(--ink); }
.send:disabled { opacity: 0.35; cursor: default; }
.note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 12px; border-radius: 10px; background: var(--bad-bg); color: var(--bad-tx); font-size: 14px; }
.note b { font-weight: 600; }
.note .link { min-height: 36px; color: var(--val); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.menu-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 68px; padding: 10px 12px; box-sizing: border-box; border-radius: 14px; background: var(--field); text-align: left; }
.menu-row b { font-size: 16px; font-weight: 600; }
.menu-row .row-sub { white-space: normal; }
.menu-row > svg { width: 20px; height: 20px; color: var(--mint); }
.menu-row.on { box-shadow: inset 0 0 0 1.5px var(--mint); }

.tabbar { flex: none; display: flex; justify-content: space-around; padding-bottom: var(--safe-b); border-top: 1px solid var(--hair); background: var(--panel); }
.tab { position: relative; flex: 1; max-width: 120px; display: grid; justify-items: center; align-content: center; gap: 4px; min-height: var(--tabbar-h); color: var(--quiet); font-size: 11.5px; font-weight: 500; }
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--val); }
.tab.on::before { content: ""; position: absolute; top: 0; left: 50%; width: 24px; height: 2px; border-radius: 0 0 2px 2px; background: var(--mint); transform: translateX(-50%); }

.scrim { position: absolute; inset: 0; z-index: 30; display: flex; align-items: flex-end; background: var(--scrim); }
.sheet { width: 100%; max-height: 90%; overflow-y: auto; box-sizing: border-box; padding-block: 8px calc(12px + var(--safe-b)); border-top: 1px solid var(--hair); border-radius: 18px 18px 0 0; background: var(--panel); box-shadow: var(--lift); }
.grabber { width: 36px; height: 4px; margin: 0 auto 6px; border-radius: 2px; background: var(--guide); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-block: 2px 10px; }
.sheet-head h2 { font-size: 20px; line-height: 1.2; }
.close { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--field); color: var(--sec); }
.close svg { width: 18px; height: 18px; }
.sheet-body { display: grid; gap: 12px; }

.empty { display: grid; place-items: center; align-content: center; gap: 14px; min-height: 100%; padding: 24px; box-sizing: border-box; text-align: center; }
.empty .logo { width: 56px; height: 56px; }
.empty p { max-width: 320px; color: var(--sec); }
.loading .logo { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.4; } }

@media (hover: hover) {
  .btn2:hover, .close:hover, .count-pill:hover, .chip:hover, .btn-sq:hover, .model-pill:hover, .act:hover, .like:hover, .icon-btn:hover { filter: brightness(1.18); }
  .send:hover, .cta:hover { filter: brightness(1.07); }
  .fx:hover .fx-art, .tile:hover .tile-art, .upload:hover { outline: 2px solid var(--guide); outline-offset: 2px; }
  .rail-item:hover, .row:hover, .menu-row:hover { background: var(--hover); }
}

/* Окно Telegram Desktop от 700px: панель разделов слева, шторки — окнами по центру. */
@media (min-width: 700px) {
  .app { display: grid; grid-template-columns: 84px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .rail-nav { display: flex; flex-direction: column; gap: 4px; padding: 14px 8px; border-right: 1px solid var(--hair); background: var(--panel); overflow-y: auto; }
  .tabbar { display: none; }
  .band { padding-left: 28px; padding-right: 28px; }
  .rail-item { display: grid; justify-items: center; gap: 4px; min-height: 60px; padding: 8px 4px; border-radius: 12px; color: var(--quiet); font-size: 11.5px; font-weight: 500; text-align: center; }
  .rail-item svg { width: 24px; height: 24px; }
  .rail-item.on { background: var(--field); color: var(--val); }
  .rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; overflow: visible; scroll-snap-type: none; }
  .feed { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; align-items: start; }
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
  .mainbar { position: static; padding: 0; background: none; }
  .scrim { align-items: center; justify-content: center; }
  .sheet { width: min(480px, 92%); max-height: 86%; border: 1px solid var(--hair); border-radius: 18px; padding-bottom: 20px; }
  .sheet.band { padding-left: 24px; padding-right: 24px; }
  .grabber { display: none; }
}
@media (min-width: 1100px) {
  .app { grid-template-columns: 232px minmax(0, 1fr); }
  .feed { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chats-split { flex: 1; min-height: 0; display: grid; grid-template-columns: 360px minmax(0, 1fr); }
  .chats-split > .chat-aside { border-right: 1px solid var(--hair); }
  .chat-main { min-height: 0; display: flex; flex-direction: column; }
  .rail-nav { padding: 18px 14px; }
  .rail-item { grid-auto-flow: column; justify-content: start; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; font-size: 15px; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .loading .logo, .dots i { animation: none; }
}
