/* ════════════════════════════════════════════════════════════════════
   Каркас сайта для прототипа (меню, форма, список, панель, страница трека).
   В продакшене это вёрстка VeoSuno; стили мастеринга — в mastering.css.
   ════════════════════════════════════════════════════════════════════ */
/* ══════════════════════════════════════════════════════════════
   1. ТОКЕНЫ И БАЗА — цвета как на veosuno.ru, только тёмная тема
   ══════════════════════════════════════════════════════════════ */
:root {
  --bg: #101012; --panel: #151517; --card: #1F1F21; --line: #333335; --line2: #49494A;
  --fg: #FFFFFF; --fg2: #C9C9CB; --muted: #8D8D8F;
  --accent: #DE762B; --accent-ink: #101012;
  --ok: #2BDE90; --bad: #FF6B6B; --ref: #8FA3FF; --fade: #22D3EE;
  --grad: linear-gradient(135deg, #A23BF5, #E0457B 55%, #DE762B);
  --font: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 14px; }
button, input, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ══════════════════════════════════════════════════════════════
   2. КАРКАС САЙТА (прототип) — меню, форма создания, библиотека,
      правая панель трека с ручкой для растягивания
      В продакшене это вёрстка VeoSuno, здесь только для показа.
   ══════════════════════════════════════════════════════════════ */
html, body { height: 100%; overflow: hidden; }
.app { display: flex; height: calc(100vh - var(--siteplayer-h, 64px)); min-height: 0; }
/* плеер сайта внизу: всё приложение заканчивается над ним, поэтому липкие кнопки его не перекрывают */
.siteplayer { position: fixed; left: 0; right: 0; bottom: 0; height: var(--siteplayer-h, 64px); z-index: 50; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: #0c0c0e; border-top: 1px solid var(--line); opacity: .75; }
.siteplayer .sp-cover { width: 40px; height: 40px; border-radius: 8px; background: center/cover; }
.siteplayer b { display: block; font-size: 13px; } .siteplayer small { font-size: 11px; color: var(--muted); }
.siteplayer .sp-bar { flex: 2; height: 4px; border-radius: 2px; background: var(--line); } .siteplayer .sp-bar i { display: block; width: 23%; height: 100%; background: var(--fg2); border-radius: 2px; }
.nav { width: 240px; flex-shrink: 0; padding: 28px; display: flex; flex-direction: column; gap: 16px; border-right: 1px solid var(--line); }
.logo { font-size: 26px; font-weight: 700; background: linear-gradient(90deg, #A23BF5, #E0457B 50%, #DE762B); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 20px; }
.nav span { color: var(--muted); font-size: 13px; } .nav .on { color: var(--accent); }
/* форма создания музыки: можно свернуть, чтобы дать место панели */
.form { width: 480px; flex-shrink: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); overflow: hidden; transition: width .2s; min-height: 0; }
/* (заглушки формы больше не используются) */
.form .ph { background: var(--card); border-radius: 12px; padding: 12px; font-size: 12px; line-height: 18px; color: var(--muted); white-space: pre-line; }
.app.focus .form { width: 0; border: 0; }
.dim { opacity: .45; pointer-events: none; }
/* библиотека: список треков или страница трека */
.lib { flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden; }
.lib.covered { flex: 0 0 0; }
.list { padding: 20px 16px; display: flex; flex-direction: column; gap: 6px; }
.lbar { display: flex; gap: 18px; white-space: nowrap; overflow: hidden; font-size: 13px; color: var(--muted); padding: 0 8px 12px; } .lbar .on { color: var(--fg); font-weight: 600; }
.trow { display: flex; gap: 14px; align-items: center; padding: 8px; border-radius: 12px; border: 0; background: none; text-align: left; width: 100%; }
.trow:hover { background: var(--card); } .trow.on { background: var(--card); outline: 1px solid var(--line2); }
.trow .th { width: 52px; height: 52px; border-radius: 8px; background: var(--line) center/cover; flex-shrink: 0; }
.trow .t1 { font-weight: 600; font-size: 15px; } .trow .t2 { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* страница трека */
.tpage { padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.thead { display: flex; gap: 16px; align-items: flex-start; }
.thead img { width: 200px; height: 200px; border-radius: 14px; object-fit: cover; flex-shrink: 0; }
.thead h2 { margin: 0; font-size: 32px; line-height: 1.15; }
.ttabs { display: flex; gap: 6px; }
.ttab { height: 32px; padding: 0 14px; border-radius: 100px; border: 0; background: transparent; color: var(--fg2); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.ttab { font-weight: 600; }
.ttab[aria-selected=true] { background: var(--line); color: var(--fg); }
.tslot { --mbg: var(--bg); }
/* правая панель */
.panel { --mbg: var(--panel); position: relative; flex-shrink: 0; width: var(--pw, 400px); background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.panel.anim { transition: width .2s; }
.rs { position: absolute; left: -6px; top: 0; bottom: 0; width: 12px; cursor: ew-resize; z-index: 20; touch-action: none; }
.rs::before { content: ''; position: absolute; left: 5px; top: 0; bottom: 0; width: 2px; background: transparent; transition: background .15s; }
.rs::after { content: ''; position: absolute; left: 3px; top: 50%; width: 6px; height: 44px; margin-top: -22px; border-radius: 3px; background: var(--line2); transition: background .15s, height .15s, margin .15s; }
.rs:hover::before, .rs.drag::before { background: rgba(222,118,43,.5); }
.rs:hover::after, .rs.drag::after { background: var(--accent); height: 64px; margin-top: -32px; }
body.resizing { cursor: ew-resize; user-select: none; }
body.resizing iframe, body.resizing canvas { pointer-events: none; }
.wlabel { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); z-index: 21; background: var(--line); border-radius: 8px; padding: 4px 8px; font-size: 12px; font-variant-numeric: tabular-nums; pointer-events: none; }
.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0; }
.phead { position: relative; padding: 16px 16px 0; display: flex; flex-direction: column; gap: 12px; }
.phead .img { align-self: center; width: 220px; max-width: 100%; aspect-ratio: 1; border-radius: 16px; background: var(--line); }
.phead .img img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.pbtns { position: absolute; right: 16px; top: 16px; display: flex; gap: 6px; z-index: 3; }
.ttl { font-size: 21px; font-weight: 600; line-height: 1.2; }
.ptabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 4px -16px 0; padding: 0 16px; }
.ptab { height: 42px; padding: 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.ptab { font-weight: 600; }
.ptab[aria-selected=true] { color: var(--fg); border-bottom-color: var(--accent); } /* толщина шрифта одинаковая — табы не прыгают */
/* широкая панель: обложка слева, название справа, места под мастеринг больше */
.panel[data-w=wide] .phead { display: grid; grid-template-columns: 112px minmax(0, 1fr); column-gap: 16px; row-gap: 10px; align-items: end; padding-right: 130px; }
.panel[data-w=wide] .phead .img { width: 112px; border-radius: 12px; }
.panel[data-w=wide] .ptabs { grid-column: 1 / -1; margin-right: -130px; }
.panel-foot { border-top: 1px solid var(--line); background: var(--panel); padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
.panel-foot:empty { display: none; }
.lyrics { padding: 16px; color: var(--fg2); white-space: pre-line; font-size: 13px; line-height: 20px; }
/* подпись прототипа */
.protobar { position: fixed; left: 12px; bottom: 12px; z-index: 80; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 100px; background: rgba(31,31,33,.95); border: 1px solid var(--line2); font-size: 12px; color: var(--muted); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
@media (max-width: 900px) {
  .nav, .form { display: none; }
  .panel { position: fixed; inset: 0 0 var(--siteplayer-h, 64px) 0; width: 100% !important; z-index: 40; border: 0; }
  .rs, #expandBtn { display: none; }
  .protobar { left: 8px; right: auto; top: 8px; bottom: auto; padding: 3px; font-size: 11px; opacity: .92; } .protobar .mini-seg button { height: 24px; padding: 0 8px; font-size: 11px; }
  body > .protobar { color: transparent; gap: 0; }
}


/* общие элементы каркаса (в продакшене — стили сайта) */
.pill { height: 32px; padding: 0 14px; border-radius: 100px; border: 1px solid rgba(255,255,255,.15); background: var(--line2); color: #fff; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pill.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.iconbtn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255,255,255,.15); background: var(--panel); display: inline-flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0; }
.small { font-size: 12px; line-height: 17px; color: var(--muted); }
.grow { flex: 1; min-width: 0; }
.mini-seg { display: flex; padding: 2px; border-radius: 100px; background: var(--bg); border: 1px solid var(--line2); gap: 2px; }
.mini-seg button { height: 28px; padding: 0 12px; border-radius: 100px; border: 0; background: transparent; color: var(--muted); font-size: 13px; }
.mini-seg button[aria-pressed=true] { background: var(--line); color: var(--fg); }
.new { height: 18px; padding: 0 6px; border-radius: 100px; background: linear-gradient(90deg, #A23BF5, #E0457B 55%, #DE762B); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .04em; display: inline-flex; align-items: center; }
.panel-foot .actions { display: flex; gap: 8px; }
.panel-foot .actions .pill { height: 48px; flex: 1; }
.panel-foot .actions .btn-accent { flex: 1.5; height: 48px; }

/* ══════════════════════════════════════════════════════════════
   3. ШАПКА ТРЕКА: обложка с «Изменить», название, дата
   Как на странице трека сейчас: при наведении на обложку — «✎ Изменить»,
   меню: Загрузить, Оживить, Выбрать из существующих, Создать изображение.
   ══════════════════════════════════════════════════════════════ */
.cover-box { position: relative; border-radius: 16px; background: var(--line); }
.cover-box img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.cover-edit { position: absolute; left: 50%; bottom: 12px; transform: translate(-50%, 6px); opacity: 0; transition: opacity .15s, transform .15s; background: rgba(73,73,74,.92); border: 1px solid rgba(255,255,255,.15); color: #fff; height: 32px; padding: 0 14px; border-radius: 100px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; backdrop-filter: blur(6px); }
.cover-box:hover .cover-edit, .cover-box:focus-within .cover-edit, .cover-box.menu-open .cover-edit { opacity: 1; transform: translate(-50%, 0); }
@media (hover: none) { .cover-edit { opacity: 1; transform: translate(-50%, 0); } }
.cover-menu { position: absolute; left: 50%; top: calc(100% - 8px); transform: translateX(-50%); z-index: 30; min-width: 230px; background: var(--card); border: 1px solid var(--line2); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.6); padding: 6px; display: flex; flex-direction: column; }
.cover-menu button, .cover-menu label { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 50px; border: 0; background: none; color: var(--fg2); font-size: 14px; text-align: left; cursor: pointer; }
.cover-menu button:hover, .cover-menu label:hover { background: var(--line); color: #fff; }
.title-in { width: 100%; resize: none; overflow: hidden; line-height: 1.2; display: block; background: transparent; border: 1px solid transparent; border-radius: 8px; color: #fff; font: inherit; font-weight: 700; padding: 0 6px; margin-left: -7px; }
.title-in:hover { border-color: var(--line2); }
.title-in:focus { border-color: var(--accent); outline: none; background: var(--bg); }
.tmeta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.vtag { height: 22px; padding: 0 8px; border-radius: 100px; background: var(--line); color: #fff; font-size: 12px; display: inline-flex; align-items: center; }
.cover-menu .paid { color: #fff; }
.cover-menu .paid svg { stroke: #E0457B; }
.cover-menu .price { font-size: 11px; font-weight: 700; color: #fff; background: var(--grad); border-radius: 100px; padding: 1px 7px; }

/* ══════════════════════════════════════════════════════════════
   4. ФОРМА СОЗДАНИЯ — новый макет audiov4
   Колонка прокручивается сама, кнопка «Создать» прилипает к её низу (над плеером сайта).
   ══════════════════════════════════════════════════════════════ */
.cf-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.cf-select { height: 34px; padding: 4px 12px; border-radius: 100px; border: 1px solid var(--line2); background: none; color: #fff; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.cf-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px 12px; display: flex; flex-direction: column; gap: 12px; }
.cf-card { position: relative; background: var(--card); border-radius: 24px; padding: 16px 52px 12px 16px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.cf-card textarea { background: none; border: 0; color: #fff; font: inherit; font-size: 14px; line-height: 1.45; resize: none; outline: none; min-height: 60px; }
.cf-prompt { min-height: 280px; }
.cf-tools { position: absolute; right: 10px; top: 54px; display: flex; flex-direction: column; gap: 6px; }
.cf-ic { width: 32px; height: 32px; border-radius: 50%; border: 0; background: none; color: var(--fg2); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.cf-ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cf-ic:hover, .cf-ic[aria-expanded=true] { background: var(--line); color: #fff; }
.cf-foot { display: flex; justify-content: center; align-items: center; position: relative; min-height: 24px; }
.cf-count { position: absolute; right: -36px; font-size: 12px; color: var(--line2); }
.cf-pop { position: absolute; left: 10px; right: 10px; top: calc(100% - 30px); z-index: 20; background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; box-shadow: 0 12px 32px rgba(0,0,0,.6); padding: 10px; display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow: auto; }
.cf-pop input { height: 32px; border: 0; border-bottom: 1px solid var(--line2); background: none; color: #fff; font: inherit; font-size: 13px; outline: none; margin-bottom: 6px; }
.cf-pop .g { font-size: 11px; color: var(--muted); padding: 8px 8px 2px; }
.cf-pop button { text-align: left; border: 0; background: none; color: var(--fg2); font-size: 13px; padding: 7px 10px; border-radius: 50px; }
.cf-pop button:hover { background: var(--line); color: #fff; }
.cf-pop .rec { margin-top: 6px; text-align: center; background: var(--line2); color: #fff; }
.cf-hum { align-items: center; text-align: center; padding: 16px; border: 1px solid rgba(222,118,43,.6); }
.cf-mic svg { width: 34px; height: 34px; fill: none; stroke: #E54270; stroke-width: 1.8; }
.cf-start { height: 32px; padding: 0 16px; border-radius: 100px; border: 0; color: #fff; background: radial-gradient(140% 200% at -10% 20%, #DE642B 0%, #E54270 100%); }
.cf-name { height: 52px; padding: 0 18px; border: 0; color: #fff; font: inherit; font-size: 14px; outline: none; }
.cf-sticky { flex-shrink: 0; padding: 10px 12px 14px; background: linear-gradient(transparent, var(--bg) 30%); border-top: 1px solid var(--line); }
.cf-create { width: 100%; height: 44px; border: 0; border-radius: 100px; color: #fff; font-size: 15px; background: radial-gradient(140% 200% at -10% 20%, #DE642B 0%, #E54270 100%); }
.form[data-mode=beginner] .pro-only, .form[data-mode=pro] .beg-only { display: none !important; }

/* «Оживить обложку»: окно, переключатель «Обложка / Видео», имитация мини-клипа */
.smodal { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ssheet { width: 440px; max-width: 100%; background: var(--card); border-radius: 24px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.ssheet .row { display: flex; align-items: center; gap: 8px; }
.ssheet .field { width: 100%; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel); color: #fff; font: inherit; font-size: 13px; resize: vertical; }
.live-prev { position: relative; width: 140px; aspect-ratio: 1; border-radius: 14px; overflow: hidden; align-self: center; }
.live-prev img { width: 100%; height: 100%; object-fit: cover; animation: vs-live 5s ease-in-out infinite; }
.live-badge { position: absolute; left: 8px; bottom: 8px; font-size: 11px; background: rgba(0,0,0,.6); border-radius: 100px; padding: 2px 8px; }
.live-prog { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.live-prog i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .1s linear; }
.stoast { position: fixed; left: 50%; bottom: calc(var(--siteplayer-h, 64px) + 20px); transform: translateX(-50%); z-index: 95; background: var(--line); border-radius: 12px; padding: 10px 14px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.coverwrap { display: flex; flex-direction: column; align-items: center; gap: 10px; flex-shrink: 0; min-width: 0; }
.phead > .coverwrap { align-self: center; }
.live-sw { display: inline-flex; padding: 3px; border-radius: 100px; background: var(--card, #1f1f21); border: 1px solid var(--line2); box-shadow: 0 4px 14px rgba(0,0,0,.45); }
.live-sw button { height: 26px; padding: 0 12px; border: 0; border-radius: 100px; background: none; color: var(--fg2); font-size: 11px; }
.live-sw button[aria-pressed=true] { background: var(--grad); color: #fff; }
.cover-box.show-live:not(.video-ok) img { animation: vs-live-glow 5s ease-in-out infinite; }
.cover-box.show-live:not(.video-ok)::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(115deg, transparent 30%, rgba(255,80,160,.28) 50%, transparent 70%) 0 0 / 250% 100%; animation: vs-sweep 3s linear infinite; }
@keyframes vs-live-glow { 0%, 100% { filter: brightness(1) saturate(1); } 50% { filter: brightness(1.15) saturate(1.3) hue-rotate(-8deg); } }
@keyframes vs-sweep { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.cover-box video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: none; }
.cover-box.show-live video { display: block; }
.cover-box { overflow: visible; }
.cover-box img { will-change: transform; }
@keyframes vs-live { 0%, 100% { transform: scale(1); filter: brightness(1) saturate(1); } 50% { transform: scale(1.06) translateY(-1.5%); filter: brightness(1.12) saturate(1.2); } }

/* выбор модели */
.cf-model { position: relative; }
.cf-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 240px; background: var(--card); border: 1px solid var(--line2); border-radius: 16px; padding: 6px; box-shadow: 0 12px 32px rgba(0,0,0,.6); display: flex; flex-direction: column; gap: 2px; }
.cf-list button { text-align: left; border: 0; background: none; color: #fff; padding: 8px 12px; border-radius: 12px; display: flex; flex-direction: column; }
.cf-list button small { color: var(--muted); font-size: 12px; }
.cf-list button:hover, .cf-list button[aria-selected=true] { background: var(--line); }
.cf-list button[aria-selected=true] b::after { content: ' ✓'; color: var(--ok); }
/* аккуратные подсказки к иконкам и подписям */
[data-tt] { position: relative; }
[data-tt]:hover::after { content: attr(data-tt); position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); white-space: nowrap; background: var(--line); color: #fff; font-size: 12px; font-weight: 400; padding: 5px 9px; border-radius: 8px; box-shadow: 0 6px 16px rgba(0,0,0,.5); pointer-events: none; z-index: 40; animation: tt-in .15s ease-out; }
.cf-ctl [data-tt]:hover::after { right: auto; left: 0; top: auto; bottom: calc(100% + 6px); transform: none; white-space: normal; width: 220px; }
@keyframes tt-in { from { opacity: 0; } }
/* кнопка ИИ-помощника (как на audiov4) */
.cf-foot { min-height: 46px; }
.ai-button { position: relative; width: 45px; height: 45px; padding: 1.5px; border: none; border-radius: 12px; background: var(--line); cursor: pointer; overflow: hidden; transition: width .4s cubic-bezier(.22,1,.36,1); }
.ai-button__border { position: absolute; inset: 0; border-radius: inherit; opacity: 0; transition: opacity .3s .15s; background: linear-gradient(90deg, transparent 0%, #DE642B 25%, #E54270 50%, #DE642B 75%, transparent 100%) 0 0 / 200% 100%; }
.ai-button__inner { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; width: 100%; height: 100%; border-radius: 10.5px; background: var(--card); overflow: hidden; white-space: nowrap; transition: background .25s; }
.ai-button__icon { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; }
.ai-button__label { font-size: 14px; font-weight: 500; color: #E4E4E7; padding-right: 16px; opacity: 0; transform: translateX(-8px); transition: opacity .3s .1s, transform .35s cubic-bezier(.22,1,.36,1) .1s; }
.ai-button:hover, .ai-button:focus-visible { width: 232px; }
.ai-button:hover .ai-button__label, .ai-button:focus-visible .ai-button__label { opacity: 1; transform: none; }
.ai-button:hover .ai-button__border, .ai-button:focus-visible .ai-button__border { opacity: 1; animation: borderMove 1.6s linear infinite; }
.ai-button:hover .ai-button__inner { background: #2a2a2d; }
.spark { fill: #E5705A; transform-origin: center; transform-box: fill-box; transition: fill .25s; }
.ai-button:hover .spark { fill: #F0815F; }
.spark-main { animation: sparkTwinkle 2.4s ease-in-out infinite; }
.spark-small { animation: sparkTwinkleSmall 2.4s ease-in-out .6s infinite; }
.spark-tiny { animation: sparkTwinkleSmall 2.4s ease-in-out 1.2s infinite; }
@keyframes borderMove { from { background-position: 0 0; } to { background-position: -200% 0; } }
@keyframes sparkTwinkle { 0%, 100% { transform: scale(1) rotate(0); opacity: .9; } 50% { transform: scale(1.18) rotate(8deg); opacity: 1; } }
@keyframes sparkTwinkleSmall { 0%, 100% { transform: scale(.8); opacity: .5; } 50% { transform: scale(1.1); opacity: 1; } }
/* настройки генерации — такие же ползунки, как в мастеринге */
.cf-sliders { display: flex; flex-direction: column; gap: 12px; padding: 12px 0 2px; margin-right: -36px; border-top: 1px solid var(--line); }
.cf-ctl { display: flex; flex-direction: column; gap: 6px; }
.cf-ctl .lab { display: flex; align-items: center; font-size: 13px; color: #fff; }
.cf-ctl .lab span { cursor: help; text-decoration: underline dotted rgba(255,255,255,.35); text-underline-offset: 3px; }
.cf-ctl .lab b { margin-left: auto; font-weight: 400; font-variant-numeric: tabular-nums; cursor: text; padding: 1px 6px; margin-right: -6px; border-radius: 6px; border: 1px dashed transparent; }
.cf-ctl .lab b:hover, .cf-ctl .lab b:focus-visible { border-color: var(--line2); outline: none; }
.cf-num { margin-left: auto; width: 64px; height: 24px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line2); background: var(--bg); color: #fff; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.cf-num:focus { outline: none; border-color: #DE762B; }
.cf-ctl input { width: 100%; margin: 0; height: 20px; accent-color: #C9C9CB; }
.cf-ctl.changed input { accent-color: #DE762B; } .cf-ctl.changed b { color: #DE762B; }
.cf-reset { align-self: flex-start; height: 28px; padding: 0 10px; border-radius: 100px; border: 1px solid rgba(255,255,255,.15); background: none; color: var(--fg2); font-size: 12px; }
.cf-ic[data-cf=settings][aria-expanded=true] { background: var(--grad); color: #fff; }
/* обязательные поля */
.cf-card.invalid { box-shadow: 0 0 0 1.5px #FF6B6B inset; animation: cf-shake .4s; }
.cf-err { font-size: 12px; color: #FF8A8A; margin-top: -2px; }
@keyframes cf-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
/* развёрнутый редактор текста (как на suno.com) */
.cf-editor { position: fixed; inset: 0; z-index: 85; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; padding: 24px; }
.cf-ed { width: min(860px, 100%); height: min(760px, 100%); background: var(--card); border-radius: 24px; display: flex; flex-direction: column; overflow: hidden; }
.cf-ed-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cf-ed-tags { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.cf-ed-tags button { height: 28px; padding: 0 10px; border-radius: 100px; border: 1px solid var(--line2); background: none; color: var(--fg2); font-size: 12px; }
.cf-ed-tags button:hover { background: var(--line); color: #fff; }
.cf-ed textarea { flex: 1; background: none; border: 0; color: #fff; font: inherit; font-size: 15px; line-height: 1.6; padding: 16px 20px; resize: none; outline: none; }
.cf-ed-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
/* анимация «Создать»: заливка, искры-ноты летят в список, в списке появляются два трека «Создаём…» */
.cf-create { position: relative; overflow: hidden; transition: transform .15s; }
.cf-create:active { transform: scale(.97); }
.cf-create.sending { pointer-events: none; }
.cf-create.sending::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.35), rgba(255,255,255,0)) 0 0 / 50% 100% no-repeat; animation: cf-sweep .9s ease-in-out infinite; }
.cf-create.done { background: linear-gradient(90deg, #2BDE90, #22D3EE); color: #101012; }
@keyframes cf-sweep { from { background-position: -60% 0; } to { background-position: 160% 0; } }
.cf-note { position: fixed; z-index: 99; pointer-events: none; font-size: 18px; color: #fff; text-shadow: 0 0 10px rgba(229,66,112,.9); }
.trow .crt { font-weight: 600; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.trow.creating .th { background: linear-gradient(90deg, var(--line) 0%, #49494A 50%, var(--line) 100%) 0 0 / 200% 100%; animation: cf-shim 1.2s linear infinite; }
.trow.creating { animation: cf-in .5s cubic-bezier(.2,1.3,.4,1); }
@keyframes cf-shim { to { background-position: -200% 0; } }
@keyframes cf-in { from { transform: translateY(-10px) scale(.96); opacity: 0; } }

/* ══ v7: форма как в Suno — шапка поля, сохранённые, примеры, теги, ручка высоты, «Больше опций» ══ */
.cf-card { padding-bottom: 20px; }
.cf-notools { padding-right: 16px; }
.cf-notools .cf-count { right: 0; }
.cf-h { display: flex; align-items: center; gap: 8px; margin: -6px -36px 0 0; min-height: 32px; }
.cf-notools .cf-h { margin-right: -6px; }
.cf-lab { font-size: 14px; font-weight: 600; color: #fff; }
.cf-hic { display: flex; gap: 2px; }
.cf-ic.sm { width: 30px; height: 30px; }
.cf-ic.sm svg { width: 16px; height: 16px; }
.cf-ic:disabled { opacity: .3; pointer-events: none; }
.cf-ic[data-cf=save][aria-pressed=true] { color: #fff; }
.cf-ic[data-cf=save][aria-pressed=true] svg { fill: currentColor; }
.cf-ic.saved-pop svg { animation: cf-pop .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes cf-pop { 40% { transform: scale(1.35); } }
.cf-field { position: relative; }
.cf-card textarea { width: 100%; display: block; transition: height .38s cubic-bezier(.22,1,.36,1); }
.cf-card textarea.nodrag-anim { transition: none; }
#cfStyle { min-height: 96px; }
/* пример в пустом поле: сменяется с лёгким размытием, Tab — взять */
.cf-ghost { position: absolute; left: 0; top: 0; right: 0; text-align: left; background: none; border: 0; padding: 0; font: inherit; font-size: 14px; line-height: 1.45; color: var(--muted); pointer-events: none; transition: opacity .45s, filter .45s, transform .45s; }
.cf-ghost.swap { opacity: 0; filter: blur(4px); transform: translateY(-3px); }
.cf-ghost .gt { display: block; }
.cf-ghost kbd { display: inline-block; margin-top: 8px; padding: 2px 8px; border: 1px solid var(--line2); border-radius: 7px; font: inherit; font-size: 11px; color: var(--fg2); pointer-events: auto; cursor: pointer; }
.cf-ghost kbd:hover { color: #fff; border-color: var(--muted); }
/* инструментал */
.cf-instr { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px 0 6px; border-radius: 100px; border: 0; background: none; color: var(--fg2); font-size: 12px; }
.cf-instr:hover { background: var(--line); color: #fff; }
.msw { position: relative; width: 28px; height: 16px; border-radius: 10px; background: var(--line2); transition: background .2s; flex-shrink: 0; }
.msw::after { content: ''; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .2s cubic-bezier(.3,1.4,.5,1); }
.cf-instr[aria-checked=true] { color: #fff; }
.cf-instr[aria-checked=true] .msw { background: var(--grad); }
.cf-instr[aria-checked=true] .msw::after { transform: translateX(12px); }
.cf-prompt.instr textarea { opacity: .15; }
.cf-instr-note { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; font-size: 13px; color: var(--fg2); }
/* теги новичка */
.cf-tags { display: flex; flex-direction: column; gap: 6px; margin-right: -36px; padding-top: 10px; border-top: 1px solid var(--line); }
.cf-tagrow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cf-taglab { font-size: 11px; color: var(--muted); width: 72px; flex-shrink: 0; }
.cf-tagscroll, .cf-sugg-list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); padding-right: 24px; }
.cf-tagscroll::-webkit-scrollbar, .cf-sugg-list::-webkit-scrollbar { display: none; }
.cf-tag { height: 28px; padding: 0 11px; border-radius: 100px; border: 1px solid var(--line2); background: none; color: var(--fg2); font-size: 12px; white-space: nowrap; flex-shrink: 0; transition: background .15s, color .15s, border-color .15s, transform .15s; }
.cf-tag:hover { color: #fff; border-color: var(--muted); }
.cf-tag[aria-pressed=true] { background: var(--grad); border-color: transparent; color: #fff; animation: cf-pop .35s cubic-bezier(.2,1.6,.4,1); }
.cf-tag.own { border-style: dashed; }
/* подсказки под стилями */
.cf-sugg { display: flex; align-items: center; gap: 6px; margin-right: -6px; }
.cf-sg { height: 30px; padding: 0 12px; border-radius: 100px; border: 0; background: var(--line); color: var(--fg2); font-size: 12px; white-space: nowrap; flex-shrink: 0; transition: background .15s, color .15s; }
.cf-sg:hover { background: var(--line2); color: #fff; }
.cf-foot.sm { min-height: 16px; }
/* ручка высоты поля */
.cf-grip { position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%); width: 64px; height: 16px; border: 0; background: none; cursor: ns-resize; padding: 0; touch-action: none; }
.cf-grip::before { content: ''; position: absolute; left: 16px; right: 16px; top: 6px; height: 4px; border-radius: 2px; background: var(--line2); transition: left .2s, right .2s, background .2s; }
.cf-grip:hover::before, .cf-grip.drag::before, .cf-grip:focus-visible::before { left: 6px; right: 6px; background: var(--muted); }
.cf-grip:focus-visible { outline: none; }
/* «Больше опций» */
.cf-more { padding: 0; }
.cf-more-h { display: flex; align-items: center; gap: 10px; width: 100%; height: 54px; padding: 0 18px; border: 0; background: none; color: #fff; font-size: 14px; text-align: left; }
.cf-more-h .chev { transition: transform .25s; flex-shrink: 0; }
.cf-more-h[aria-expanded=true] .chev { transform: rotate(90deg); }
.cf-more-h .small { color: #DE762B; }
.cf-more .cf-sliders { margin: 0; padding: 14px 18px 18px; border-top: 1px solid var(--line); animation: vs-drop .25s ease-out; }
@keyframes vs-drop { from { opacity: 0; transform: translateY(-6px); } }
.cf-negbox { position: relative; background: var(--bg); border-radius: 14px; padding: 10px 12px 22px; }
.cf-negbox textarea { min-height: 40px; }
.cf-negbox .cf-count { right: 12px; bottom: 6px; }
/* сохранённые */
.cf-lib { position: absolute; right: 8px; top: 46px; z-index: 25; width: min(400px, calc(100% - 16px)); max-height: 380px; display: flex; flex-direction: column; background: rgba(31,31,33,.98); border: 1px solid var(--line2); border-radius: 18px; box-shadow: 0 18px 40px rgba(0,0,0,.6); backdrop-filter: blur(10px); animation: cf-libin .2s cubic-bezier(.22,1,.36,1); transform-origin: top right; }
@keyframes cf-libin { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
.cf-lib-h { display: flex; align-items: center; gap: 8px; margin: 10px; padding: 0 14px; height: 40px; border-radius: 100px; background: var(--line); color: var(--muted); flex-shrink: 0; }
.cf-lib-h input { flex: 1; min-width: 0; border: 0; background: none; color: #fff; font: inherit; font-size: 14px; outline: none; }
.cf-lib-list { overflow-y: auto; padding: 0 6px 8px; }
.cf-lib-i { display: flex; align-items: flex-start; gap: 12px; padding: 10px; border-radius: 12px; cursor: pointer; }
.cf-lib-i:hover, .cf-lib-i:focus-visible { background: var(--line); outline: none; }
.cf-lib-ic { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--fg2); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; color: var(--fg2); flex-shrink: 0; margin-top: 2px; }
.cf-lib-i b { display: block; font-size: 14px; font-weight: 500; }
.cf-lib-i .tx { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; color: var(--fg2); line-height: 1.4; white-space: pre-line; }
.cf-lib-i small { font-size: 11px; color: var(--muted); }
.cf-lib-i .cf-ic { opacity: 0; flex-shrink: 0; }
.cf-lib-i:hover .cf-ic, .cf-lib-i:focus-within .cf-ic { opacity: 1; }
.cf-lib-empty { padding: 14px 14px 18px; font-size: 13px; color: var(--muted); line-height: 1.5; }
/* сообщение с действием */
.stoast { display: flex; align-items: center; gap: 12px; }
.stoast-act { height: 28px; padding: 0 12px; border-radius: 100px; border: 0; background: var(--grad); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; }
/* «Создать» неактивна, пока не заполнен минимум; когда можно — «просыпается» */
.cf-create:disabled { opacity: .4; filter: saturate(.35); cursor: not-allowed; }
.cf-create.wake { animation: cf-wake .6s cubic-bezier(.2,1.4,.4,1); }
@keyframes cf-wake { 0% { transform: scale(.97); box-shadow: 0 0 0 rgba(229,66,112,0); } 50% { transform: scale(1.03); box-shadow: 0 0 26px rgba(229,66,112,.55); } 100% { transform: none; box-shadow: 0 0 0 rgba(229,66,112,0); } }
/* полноэкранный редактор с ИИ-помощником */
.cf-editor { padding: 0; align-items: stretch; justify-content: stretch; }
.cf-ed { width: 100%; height: 100%; border-radius: 0; background: var(--panel); }
.cf-ed-head { padding: 12px 16px 12px 24px; }
.cf-ed-title { font-size: 16px; }
.cf-ed-aibtn { display: inline-flex; align-items: center; gap: 6px; }
.cf-ed-aibtn[aria-pressed=true] { background: var(--grad); color: #fff; border-color: transparent; }
.cf-ed-body { flex: 1; min-height: 0; display: flex; position: relative; overflow: hidden; }
.cf-ed-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cf-ed-main .cf-ed-tags { justify-content: center; }
.cf-ed-main textarea { flex: 1; padding: 24px max(24px, calc((100% - 760px) / 2)); font-size: 16px; line-height: 1.7; }
.cf-ai { flex: 0 0 380px; width: 380px; margin-right: -380px; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--bg); transition: margin-right .38s cubic-bezier(.22,1,.36,1); }
.ai-open .cf-ai { margin-right: 0; }
.cf-ai-h { display: flex; flex-direction: column; gap: 2px; padding: 16px 16px 10px; }
.cf-ai-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 6px 16px 10px; }
.cf-ai-msg { max-width: 94%; padding: 10px 12px; border-radius: 14px; font-size: 13px; line-height: 1.5; display: flex; flex-direction: column; gap: 8px; animation: vs-drop .25s ease-out; }
.cf-ai-msg.bot { background: var(--card); align-self: flex-start; }
.cf-ai-msg.me { background: rgba(222,118,43,.16); align-self: flex-end; }
.cf-ai-msg.demo { outline: 1px dashed var(--line2); }
.cf-ai-res { margin: 0; white-space: pre-wrap; font: inherit; max-height: 240px; overflow: auto; background: var(--bg); padding: 10px 12px; border-radius: 10px; color: #fff; }
.cf-ai-msg .dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.cf-ai-msg .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--fg2); animation: cf-dot 1s infinite; }
.cf-ai-msg .dots i:nth-child(2) { animation-delay: .15s; } .cf-ai-msg .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes cf-dot { 0%, 80%, 100% { opacity: .25; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
.cf-ai-acts { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px 0; }
.cf-ai-in { display: flex; gap: 8px; align-items: flex-end; margin: 10px 16px 16px; padding: 8px 8px 8px 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line2); }
.cf-ai-in:focus-within { border-color: var(--muted); }
.cf-ai-in textarea { flex: 1; min-width: 0; border: 0; background: none; color: #fff; font: inherit; font-size: 13px; line-height: 1.45; resize: none; outline: none; }
.cf-ai-send { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 900px) {
  .cf-ai { position: absolute; right: 0; top: 0; bottom: 0; width: min(380px, 100%); margin: 0; transform: translateX(100%); transition: transform .35s cubic-bezier(.22,1,.36,1); box-shadow: -12px 0 30px rgba(0,0,0,.5); }
  .ai-open .cf-ai { transform: none; }
}
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; }
.pill.ghost { background: none; }
.cf-ed .cf-ai-in textarea { flex: 1; padding: 6px 0; font-size: 13px; line-height: 1.45; }
