/* ============================================================
   Стиль Mini App — собран из 3 референсов:
   • Colbo       → глубокий тёмно-синий фон, мягкое свечение, белые "пилюли"-кнопки, точки-индикаторы
   • Sony        → шрифт Jost, золотисто-медные акценты, тонкие золотые линии
   • Lamborghini → заглавные буквы с широким разрядом, тонкие линии, золотая полоска-подчёркивание
   ============================================================ */

:root {
  /* Цветовая палитра */
  --bg-deep: #141a22;          /* самый тёмный фон */
  --bg: #1d2530;               /* основной тёмно-синий (Colbo) */
  --bg-card: #232c38;          /* карточки */
  --bg-card-hover: #2a3442;
  --line: rgba(255, 255, 255, 0.10);
  --text: #f2f2f0;             /* основной текст */
  --text-dim: #8c95a1;         /* приглушённый текст */
  --gold: #d99a5b;             /* медно-золотой акцент (Sony / Lamborghini) */
  --gold-soft: rgba(217, 154, 91, 0.35);
  --white: #ffffff;

  --font: "Jost", "Futura", "Century Gothic", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  min-height: 100%;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

body { position: relative; overflow-x: hidden; }

/* ---------- Фон ---------- */
.bg-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 70% 25%, rgba(70, 85, 105, 0.45), transparent 70%),
    radial-gradient(ellipse 70% 40% at 20% 100%, rgba(217, 154, 91, 0.07), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

.bg-lines {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.55;
  background:
    linear-gradient(115deg, transparent 38%, var(--gold-soft) 38.2%, transparent 38.5%),
    linear-gradient(62deg,  transparent 70%, rgba(217,154,91,0.22) 70.2%, transparent 70.5%),
    linear-gradient(160deg, transparent 15%, rgba(255,255,255,0.08) 15.2%, transparent 15.5%);
}

/* ---------- Каркас ---------- */
.app {
  position: relative; z-index: 2;
  max-width: 520px; margin: 0 auto;
  min-height: 100vh;
  padding: 18px 22px 24px;
  display: flex; flex-direction: column;
}

.topbar { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; }

.logo { font-weight: 500; font-size: 14px; letter-spacing: 0.35em; display: flex; align-items: center; gap: 6px; }
.logo-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }

.user-chip {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
}

/* ---------- Приветствие ---------- */
.screen { position: relative; flex: 1; display: flex; flex-direction: column; gap: 26px; padding-top: 18px; }

.hero { animation: rise 0.8s ease both; }

.eyebrow { color: var(--gold); font-size: 15px; font-weight: 400; margin-bottom: 8px; letter-spacing: 0.04em; }

.hero-title {
  font-weight: 500; font-size: clamp(32px, 9.5vw, 46px);
  line-height: 1.02; letter-spacing: 0.01em;
  text-shadow: 0 0 28px rgba(255, 255, 255, 0.12);
}

.hero-sub { margin-top: 16px; max-width: 360px; font-size: 15px; line-height: 1.55; color: #b4bbc4; }

/* Разделитель в стиле Lamborghini: линия — точка — линия */
.divider { display: flex; align-items: center; gap: 10px; margin-top: 22px; }
.divider span { flex: 1; height: 1px; background: var(--line); }
.divider i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }

/* ---------- Кнопки-переключатели задач ---------- */
.tasks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; animation: rise 0.9s 0.1s ease both; }
.task-card:last-child { grid-column: span 2; }

.task-card {
  position: relative; text-align: left; cursor: pointer;
  background: linear-gradient(160deg, var(--bg-card), rgba(35, 44, 56, 0.55));
  border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 14px 18px; color: var(--text); font-family: var(--font);
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease, border-color 0.25s ease, background 0.25s ease;
  overflow: hidden;
}
.task-card:active { transform: scale(0.97); }

/* Золотая полоска-подчёркивание у активной карточки (как у Lamborghini) */
.task-card::after {
  content: ""; position: absolute; left: 14%; right: 14%; bottom: 0; height: 2px;
  background: var(--gold); box-shadow: 0 0 12px var(--gold);
  transform: scaleX(0); transition: transform 0.35s ease;
}
.task-card.is-active { border-color: var(--gold-soft); background: var(--bg-card-hover); }
.task-card.is-active::after { transform: scaleX(1); }

.task-num { font-size: 11px; letter-spacing: 0.2em; color: var(--gold); }
.task-name { font-size: 17px; font-weight: 500; letter-spacing: 0.28em; }
.task-desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.35; }

/* ---------- Описание задачи ---------- */
.task-detail { animation: rise 1s 0.2s ease both; }
.detail-label { font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); }
.detail-text { margin-top: 8px; font-size: 14.5px; line-height: 1.55; color: #b4bbc4; min-height: 66px; }

.actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; }

/* Белая "пилюля" — как кнопка Add to card в Colbo */
.btn-pill {
  background: var(--white); color: #151b23; border: none; cursor: pointer;
  font-family: var(--font); font-weight: 500; font-size: 14px; letter-spacing: 0.08em;
  padding: 13px 38px; border-radius: 999px;
  box-shadow: 0 8px 22px rgba(255, 255, 255, 0.12);
  transition: transform 0.15s ease;
}
.btn-pill:active { transform: scale(0.96); }

.status { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dim); }

/* ---------- Точки справа (как в Colbo) ---------- */
.dots { position: absolute; right: -6px; top: 6px; display: flex; flex-direction: column; gap: 10px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); transition: all 0.3s; }
.dots i.on { background: var(--gold); box-shadow: 0 0 10px var(--gold); transform: scale(1.4); }

.footer { margin-top: 28px; text-align: center; font-size: 10.5px; letter-spacing: 0.35em; color: rgba(255, 255, 255, 0.28); }

/* ---------- Анимация появления ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   ЭКРАН «ТЕКСТ» (Спринт 2)
   ============================================================ */
[hidden] { display: none !important; }

.chat-screen { gap: 12px; padding-top: 4px; height: calc(100vh - 120px); height: calc(100dvh - 120px); min-height: 420px; animation: rise 0.5s ease both; }

.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chat-title {
  flex: 1; text-align: center; font-size: 12px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.icon-btn {
  background: transparent; color: var(--text-dim); font-family: var(--font); font-size: 12px; letter-spacing: 0.12em;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; cursor: pointer; transition: all 0.2s;
}
.icon-btn:active { transform: scale(0.95); }
.icon-btn.danger:hover { color: #e58b8b; border-color: rgba(229, 139, 139, 0.5); }

/* Переключатель модели */
.model-switch { display: flex; gap: 8px; }
.model-btn {
  flex: 1; cursor: pointer; font-family: var(--font); font-size: 13px; letter-spacing: 0.06em; color: var(--text-dim);
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; transition: all 0.25s;
}
.model-btn.is-active { color: var(--text); border-color: var(--gold-soft); box-shadow: inset 0 -2px 0 var(--gold); background: var(--bg-card-hover); }

/* Темы диалогов */
.sessions-bar { display: flex; align-items: center; gap: 8px; }
.sessions { flex: 1; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.sessions::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
  font-family: var(--font); font-size: 12.5px; color: var(--text-dim); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; transition: all 0.2s;
}
.chip.is-active { color: #151b23; background: var(--white); border-color: var(--white); }
.chip-new { color: var(--gold); border-color: var(--gold-soft); }

/* Сообщения */
.messages {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 6px 2px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.msg { max-width: 88%; display: flex; flex-direction: column; gap: 4px; }
.msg-body { padding: 11px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; font-weight: 400; }
.msg-user { align-self: flex-end; }
.msg-user .msg-body { background: var(--white); color: #151b23; border-bottom-right-radius: 4px; }
.msg-assistant { align-self: flex-start; }
.msg-assistant .msg-body { background: var(--bg-card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.has-copy .msg-body { position: relative; padding-bottom: 40px; }
.copy-btn {
  position: absolute; bottom: 6px; right: 6px; width: 28px; height: 28px; padding: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: transparent; color: var(--text-dim); border: none; border-radius: 8px; transition: all 0.2s;
}
.copy-btn:hover { color: var(--gold); background: rgba(255, 255, 255, 0.06); }
.copy-btn:active { transform: scale(0.9); }
.copy-btn.is-done { color: var(--gold); }
.msg-meta { font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); padding-left: 6px; }
.msg-hint, .msg-error { align-self: center; max-width: 94%; }
.msg-hint .msg-body { background: transparent; color: var(--text-dim); text-align: center; font-size: 13px; }
.msg-error .msg-body { background: rgba(229, 139, 139, 0.1); border: 1px solid rgba(229, 139, 139, 0.4); color: #f0b4b4; font-size: 13px; }
.is-typing .msg-body { color: var(--text-dim); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }

/* Поле ввода */
.composer { display: flex; align-items: flex-end; gap: 10px; }
.composer textarea {
  flex: 1; resize: none; max-height: 140px; font-family: var(--font); font-size: 16px; font-weight: 400; color: var(--text);
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 16px; outline: none; transition: border-color 0.2s;
}
.composer textarea:focus { border-color: var(--gold-soft); }
.composer textarea::placeholder { color: var(--text-dim); }
.send-btn {
  width: 44px; height: 44px; flex-shrink: 0; border: none; border-radius: 50%; cursor: pointer;
  background: var(--white); color: #151b23; font-size: 20px; font-weight: 500; box-shadow: 0 8px 22px rgba(255, 255, 255, 0.12);
}
.send-btn:disabled { opacity: 0.4; cursor: default; }
.send-btn:active { transform: scale(0.94); }


/* ============================================================
   СПРИНТ 3: графика, общие элементы, правки чата
   ============================================================ */
.head-spacer { width: 62px; }
.chat-head .icon-btn { flex-shrink: 0; }

.task-card.is-active { border-color: var(--line); background: linear-gradient(160deg, var(--bg-card), rgba(35, 44, 56, 0.55)); }
.task-card.is-active::after { transform: scaleX(0); }
.task-card:hover { border-color: var(--gold-soft); }
.task-card:hover::after { transform: scaleX(1); }

.setting-label { font-size: 11px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; display: block; }
.status.is-error { color: #f0a0a0; letter-spacing: 0.04em; text-transform: none; font-size: 13px; }

/* Переключатель модели в чате: крупные кнопки в 2 колонки */
.model-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.model-btn { padding: 12px 6px; font-size: 13.5px; }
/* Кнопка режима: название + короткое описание */
.model-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; text-align: left; }
.model-name { font-size: 13.5px; letter-spacing: 0.04em; color: inherit; }
.model-desc { font-size: 11px; line-height: 1.3; letter-spacing: 0; color: var(--text-dim); }

/* Группы кнопок (качество, разрешение, соотношение, режимы) */
.seg { display: flex; gap: 8px; }
.seg-btn {
  flex: 1; cursor: pointer; font-family: var(--font); font-size: 14px; letter-spacing: 0.06em; color: var(--text-dim);
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 11px 6px; transition: all 0.25s;
}
.seg-btn.is-active { color: var(--text); border-color: var(--gold-soft); box-shadow: inset 0 -2px 0 var(--gold); background: var(--bg-card-hover); }
.seg-btn:active { transform: scale(0.97); }

.image-screen { gap: 14px; padding-bottom: 12px; animation: rise 0.5s ease both; }
.mode-hint { font-size: 13.5px; line-height: 1.5; color: var(--text-dim); }
.setting { display: flex; flex-direction: column; }

.prompt-box {
  width: 100%; resize: vertical; min-height: 96px; font-family: var(--font); font-size: 16px; font-weight: 400; color: var(--text);
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; outline: none; transition: border-color 0.2s;
}
.prompt-box:focus { border-color: var(--gold-soft); }
.prompt-box::placeholder { color: var(--text-dim); }

/* Загрузка фото */
.uploads { display: flex; flex-direction: column; gap: 10px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb { position: relative; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.thumb { cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; }
.thumb.is-selected { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.thumb-check {
  position: absolute; bottom: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--gold); color: #151b23; font-size: 12px; font-weight: 600; line-height: 20px; text-align: center;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-del {
  position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border: none; border-radius: 50%; cursor: pointer;
  background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 15px; line-height: 22px; padding: 0;
}
/* Вкладка «Архив»: сетка готовых картинок с кнопками под каждой */
#gArchive { display: flex; flex-direction: column; gap: 14px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; align-items: start; }
.gallery .empty { grid-column: 1 / -1; font-size: 13.5px; line-height: 1.5; color: var(--text-dim); }
.tile { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 8px; background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px; }
.tile img { width: 100%; border-radius: 10px; display: block; object-fit: cover; cursor: zoom-in; }
.tile-actions { display: flex; flex-direction: column; gap: 6px; }
.tile-btn {
  cursor: pointer; font-family: var(--font); font-size: 12px; letter-spacing: 0.06em; color: var(--gold);
  background: transparent; border: 1px solid var(--gold-soft); border-radius: 999px; padding: 7px 8px; transition: all 0.2s;
}
.tile-btn:active { transform: scale(0.96); }
.tile-btn:disabled { opacity: 0.5; cursor: default; }
.tile-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.tile-meta { font-size: 11px; letter-spacing: 0.08em; color: var(--text-dim); }
.tile-dl { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); text-decoration: none; }

/* Вкладка «Библиотека»: сетка небольших, но чётких превью */
.lib-pane { display: flex; flex-direction: column; gap: 14px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.lib-tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-card); }
.lib-tile { cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; }
.lib-tile.is-selected { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.lib-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-zoom {
  position: absolute; bottom: 3px; right: 3px; width: 22px; height: 22px; border: none; border-radius: 50%; cursor: pointer;
  background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 15px; line-height: 22px; padding: 0;
}
.thumb img { cursor: zoom-in; }
.lib-grid .empty { grid-column: 1 / -1; font-size: 13.5px; line-height: 1.5; color: var(--text-dim); }
.uploads .empty { font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.btn-ghost {
  align-self: flex-start; cursor: pointer; font-size: 13px; letter-spacing: 0.08em; color: var(--gold);
  border: 1px dashed var(--gold-soft); border-radius: 999px; padding: 10px 18px; transition: all 0.2s;
}
.btn-ghost:active { transform: scale(0.96); }
.btn-pill:disabled { opacity: 0.5; cursor: default; }

/* Результат */
.results { display: flex; flex-direction: column; gap: 12px; }
.result { display: flex; flex-direction: column; gap: 8px; }
.result img { width: 100%; border-radius: 16px; border: 1px solid var(--line); display: block; box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35); }
.result a { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); text-decoration: none; }

/* Поле переименования темы в заголовке чата */
.title-input {
  flex: 1; min-width: 0; text-align: center; font-family: var(--font); font-size: 16px; font-weight: 400; color: var(--text);
  background: var(--bg-card); border: 1px solid var(--gold-soft); border-radius: 999px; padding: 7px 14px; outline: none;
}

/* Экран «Скоро» */
.soon-box { padding: 40px 6px; }


/* ============================================================
   ЭКРАН «ОЗВУЧКА»: выбор голоса, плеер, история
   (стили привязаны к #screen-voice и .voice-*, .player, .v-* — другие разделы не затронуты)
   ============================================================ */
#screen-voice { gap: 14px; padding-bottom: 12px; animation: rise 0.5s ease both; }
#screen-voice .counter { font-size: 12px; letter-spacing: 0.12em; color: var(--text-dim); text-align: right; margin-top: -8px; }
#screen-voice .empty { font-size: 13.5px; line-height: 1.5; color: var(--text-dim); }

/* Голоса: две группы (мужские / женские), плитки в 2 колонки */
.voices { display: flex; flex-direction: column; gap: 10px; }
.voice-group { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dim); margin-top: 4px; }
.voice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.voice-tile {
  display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; padding: 9px 10px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px; outline: none; transition: all 0.25s;
}
.voice-tile:focus-visible { border-color: var(--gold-soft); }
.voice-tile.is-active { border-color: var(--gold-soft); box-shadow: inset 0 -2px 0 var(--gold); background: var(--bg-card-hover); }
.voice-tile:active { transform: scale(0.98); }
.voice-play {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; padding: 0;
  font-family: var(--font); font-size: 12px; color: var(--gold); background: transparent; border: 1px solid var(--gold-soft); transition: all 0.2s;
}
.voice-play:active { transform: scale(0.92); }
.voice-play.is-loading { opacity: 0.6; cursor: default; }
.voice-info { min-width: 0; }
.voice-name { font-size: 14.5px; font-weight: 500; letter-spacing: 0.04em; color: var(--text); }
.voice-desc { font-size: 11.5px; line-height: 1.3; color: var(--text-dim); }

/* Аудиоплеер */
.player { display: flex; align-items: center; gap: 10px; }
.player[hidden] { display: none; }
.player-play {
  flex-shrink: 0; width: 38px; height: 38px; border: none; border-radius: 50%; cursor: pointer; padding: 0;
  background: var(--white); color: #151b23; font-size: 13px; box-shadow: 0 8px 22px rgba(255, 255, 255, 0.12);
}
.player-play:active { transform: scale(0.94); }
.player-bar { flex: 1; min-width: 0; accent-color: var(--gold); cursor: pointer; }
.player-time { flex-shrink: 0; font-size: 11.5px; letter-spacing: 0.04em; color: var(--text-dim); }
.btn-download { flex-shrink: 0; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); text-decoration: none; }

/* Карточки результата и истории озвучек */
#vResult, #vHistory { display: flex; flex-direction: column; gap: 10px; }
.v-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--bg-card); border: 1px solid var(--line); border-radius: 16px; }
.v-card-title { font-size: 14.5px; font-weight: 400; line-height: 1.4; color: var(--text); word-break: break-word; }
.v-card-meta { font-size: 11.5px; letter-spacing: 0.06em; color: var(--text-dim); }
.v-card-actions { display: flex; gap: 8px; }
.v-btn {
  cursor: pointer; font-family: var(--font); font-size: 12px; letter-spacing: 0.06em; color: var(--gold);
  background: transparent; border: 1px solid var(--gold-soft); border-radius: 999px; padding: 6px 14px; transition: all 0.2s;
}
.v-btn:active { transform: scale(0.96); }
.v-btn:disabled { opacity: 0.5; cursor: default; }
.v-btn.danger { color: #e58b8b; border-color: rgba(229, 139, 139, 0.4); }



/* ============================================================
   ЭКРАН «МУЗЫКА»: жанры, свой отрывок, карточки треков
   (стили привязаны к #screen-music и .genre-chip — другие разделы не затронуты;
   плеер и карточки .v-card общие с «Озвучкой»)
   ============================================================ */
#screen-music { gap: 14px; padding-bottom: 12px; animation: rise 0.5s ease both; }
#screen-music .empty { font-size: 13.5px; line-height: 1.5; color: var(--text-dim); }
#mResult, #mHistory { display: flex; flex-direction: column; gap: 10px; }
#mLyricsBox { gap: 8px; }

.genres { display: flex; flex-wrap: wrap; gap: 8px; }
.genre-chip {
  cursor: pointer; font-family: var(--font); font-size: 13px; letter-spacing: 0.04em; color: var(--text-dim);
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; transition: all 0.2s;
}
.genre-chip:active { transform: scale(0.96); }
.genre-chip.is-active { color: #151b23; background: var(--white); border-color: var(--white); }

/* Отметка «скачано»: бейдж в шапке карточки и подсветка кнопок MP3 / WAV */
.v-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.v-card-head .v-card-title { flex: 1; min-width: 0; }
.v-badge {
  flex-shrink: 0; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold);
  border: 1px solid var(--gold-soft); border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
.v-badge[hidden] { display: none; }

/* Переименование трека: компактная кнопка рядом с названием и поле ввода вместо него */
.v-title-box { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 8px; }
.v-title-box[hidden] { display: none; }
.v-title-box .v-card-title { flex: 0 1 auto; min-width: 0; }
.v-rename {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-top: 1px; padding: 0;
  cursor: pointer; color: var(--text-dim); background: transparent; border: 1px solid var(--line); border-radius: 50%; transition: all 0.2s;
}
.v-rename svg { display: block; }
.v-rename:hover, .v-rename:focus-visible { color: var(--gold); border-color: var(--gold-soft); background: rgba(217, 154, 91, 0.08); outline: none; }
.v-rename:active { transform: scale(0.92); }
.v-title-edit { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.v-title-input {
  flex: 1 1 160px; min-width: 0; font-family: var(--font); font-size: 16px; font-weight: 400; color: var(--text);
  background: var(--bg-deep); border: 1px solid var(--gold-soft); border-radius: 999px; padding: 6px 14px; outline: none;
}
.v-title-input:disabled { opacity: 0.6; }
.v-btn.v-btn-quiet { color: var(--text-dim); border-color: var(--line); }

/* «В основу»: компактная кнопка в ряду действий карточки; при наведении подсвечивается золотым */
#screen-music .v-card-actions { flex-wrap: wrap; }
#screen-music .v-btn.v-btn-base { padding: 6px 12px; color: var(--text-dim); border-color: var(--line); }
#screen-music .v-btn.v-btn-base::before { content: "↑"; margin-right: 5px; color: var(--gold); }
#screen-music .v-btn.v-btn-base:hover, #screen-music .v-btn.v-btn-base:focus-visible {
  color: var(--gold); border-color: var(--gold-soft); background: rgba(217, 154, 91, 0.08); outline: none;
}
#screen-music .btn-download.is-downloaded {
  letter-spacing: 0.06em; text-transform: none; font-size: 12px; border: 1px solid var(--gold); border-radius: 999px; padding: 6px 12px;
}
#screen-music .v-btn.is-downloaded { border-color: var(--gold); background: rgba(217, 154, 91, 0.12); }

.file-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-name { flex: 1; min-width: 0; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#screen-music .btn-ghost { align-self: auto; flex-shrink: 0; }
#screen-music .file-row { flex-wrap: wrap; }
#screen-music .setting { gap: 8px; }

/* Кнопки в несколько строк (голос, степень следования мелодии) */
.seg-wrap { flex-wrap: wrap; }
.seg-wrap .seg-btn { flex: 1 1 calc(50% - 8px); min-width: 0; }
/* «Мой голос» сохранён: подсветка, даже если сейчас выбран другой голос */
.seg-btn.is-saved { border-color: var(--gold-soft); color: var(--gold); }
.seg-btn.is-saved.is-active { color: var(--text); }

/* Запись с микрофона */
.btn-ghost.is-recording { color: #151b23; background: #e58b8b; border: 1px solid #e58b8b; animation: rec-pulse 1.2s ease-in-out infinite; }
.btn-ghost:disabled { opacity: 0.5; cursor: default; }
@keyframes rec-pulse { 50% { opacity: 0.65; } }
.voice-panel { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; background: var(--bg-card); border: 1px solid var(--line); border-radius: 16px; }
.voice-panel .btn-pill { align-self: auto; }
#screen-music .setting-label span { text-transform: none; letter-spacing: 0.04em; color: var(--text-dim); }



/* ============================================================
   ЭКРАН «ВИДЕО»: слоты фото, формат кадра, плеер MP4, карточки истории
   (стили привязаны к #screen-video и .video-*; карточки .v-card, кнопки .v-btn,
   бейдж .v-badge и карандаш .v-rename общие с «Озвучкой» и «Музыкой»)
   ============================================================ */
#screen-video { gap: 14px; padding-bottom: 12px; animation: rise 0.5s ease both; }
#screen-video .empty { font-size: 13.5px; line-height: 1.5; color: var(--text-dim); }
#screen-video .setting { gap: 0; }
#kResult, #kHistory { display: flex; flex-direction: column; gap: 10px; }

/* Режимы «одно фото / два фото»: длинная подпись переносится на вторую строку */
#kMode .seg-btn { font-size: 13px; line-height: 1.3; padding: 10px 8px; }

/* Слоты загрузки: один на всю ширину или два рядом */
.video-slots { display: grid; grid-template-columns: 1fr; gap: 12px; }
.video-slots:has(#kSlotEnd:not([hidden])) { grid-template-columns: 1fr 1fr; }
.video-slot { display: flex; flex-direction: column; min-width: 0; }
.video-drop { position: relative; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; }
.video-drop-btn {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; color: var(--gold); background: var(--bg-card); border: 1px dashed var(--gold-soft); border-radius: 16px; transition: all 0.2s;
}
.video-drop-btn:hover { background: var(--bg-card-hover); }
.video-drop-btn:active { transform: scale(0.98); }
.video-drop-btn.is-loading { opacity: 0.6; cursor: default; animation: rec-pulse 1.2s ease-in-out infinite; }
.video-drop-plus { font-size: 28px; font-weight: 300; line-height: 1; }
.video-drop-text { font-size: 13px; letter-spacing: 0.08em; }
.video-preview { position: absolute; inset: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--bg-deep); }
.video-preview img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.video-preview .thumb-del { top: 6px; right: 6px; width: 24px; height: 24px; font-size: 16px; line-height: 24px; }

/* Формат кадра: 5 компактных кнопок в один ряд */
.seg-compact { gap: 6px; }
.seg-compact .seg-btn { min-width: 0; padding: 10px 2px; font-size: 13px; letter-spacing: 0.02em; }

/* Плеер MP4 и бейджи формата / длительности */
.video-player {
  display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; background: #000; border: 1px solid var(--line);
}
.video-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.v-badge.v-badge-meta { color: var(--text); border-color: var(--line); letter-spacing: 0.08em; }
.video-meta-text { font-size: 11.5px; letter-spacing: 0.06em; color: var(--text-dim); }

/* «Скачать MP4»: ссылка в виде кнопки; после скачивания — «✓ Скачано MP4» с золотой рамкой */
#screen-video .v-card-actions { flex-wrap: wrap; align-items: center; }
#screen-video a.v-btn { text-decoration: none; display: inline-block; }
#screen-video .v-btn.is-downloaded { border-color: var(--gold); background: rgba(217, 154, 91, 0.12); }

@media (max-width: 380px) {
  #kMode .seg-btn { font-size: 12px; }
}

