/* Светлая и тёмная темы по макету (14 окт): чёрное и белое, серые карточки, стеклянные панели.
   Цвета — только через токены ниже; тёмная — по системе, пока человек сам не выбрал (кнопка темы в шапке). */
:root {
  --bg: #ffffff;
  --card: #f2f2f7;
  --card-2: #e5e5ea;
  --ink: #000000;
  --ink-2: #3c3c43;
  --muted: rgba(60, 60, 67, 0.6);
  --line: rgba(60, 60, 67, 0.18);
  --btn: #000000;
  --btn-ink: #ffffff;
  --ok: #1e8a3c;
  --warn: #b7791f;
  --danger: #d6342c;
  --stage: #0c0c10;
  --glass: rgba(255, 255, 255, 0.7);
  --glass-line: rgba(0, 0, 0, 0.06);
  --soft: rgba(118, 118, 128, 0.12);
  --track: rgba(0, 0, 0, 0.16);
  --nav: rgba(249, 249, 251, 0.86);
  --link: #3b3bef;
  --bg-op: 0.5;
  --font: Geist, -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --font-d: Geist, -apple-system, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --card: #1c1c1e; --card-2: #2c2c2e; --ink: #ffffff; --ink-2: #ebebf5;
    --muted: rgba(235, 235, 245, 0.6); --line: rgba(255, 255, 255, 0.12); --btn: #ffffff; --btn-ink: #000000;
    --ok: #30b550; --warn: #f0b35b; --danger: #ff6961; --stage: #050508;
    --glass: rgba(255, 255, 255, 0.09); --glass-line: rgba(255, 255, 255, 0.14); --soft: rgba(255, 255, 255, 0.14);
    --track: rgba(255, 255, 255, 0.3); --nav: rgba(40, 40, 44, 0.72); --link: #9da0ff; --bg-op: 0.85;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --card: #1c1c1e; --card-2: #2c2c2e; --ink: #ffffff; --ink-2: #ebebf5;
  --muted: rgba(235, 235, 245, 0.6); --line: rgba(255, 255, 255, 0.12); --btn: #ffffff; --btn-ink: #000000;
  --ok: #30b550; --warn: #f0b35b; --danger: #ff6961; --stage: #050508;
  --glass: rgba(255, 255, 255, 0.09); --glass-line: rgba(255, 255, 255, 0.14); --soft: rgba(255, 255, 255, 0.14);
  --track: rgba(255, 255, 255, 0.3); --nav: rgba(40, 40, 44, 0.72); --link: #9da0ff; --bg-op: 0.85;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.4 var(--font); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button, label[for] { cursor: pointer; }
button { -webkit-appearance: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* каркас */
.app { height: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; position: relative; background: var(--bg); overflow: hidden; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.nav { flex: none; height: calc(54px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 16px 0; display: flex; align-items: center; gap: 8px; position: relative; }
.nav h1 { flex: 1; margin: 0; font: 700 24px/1.1 var(--font-d); letter-spacing: -0.02em; }
.nav.centered h1 { position: absolute; left: 64px; right: 64px; bottom: 16px; text-align: center; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.nav-back { width: 36px; height: 36px; margin-left: 0; border: 0; background: var(--soft); border-radius: 50%; display: grid; place-items: center; z-index: 1; }
.nav-back svg { width: 16px; height: 16px; stroke-width: 2.2; grid-area: 1 / 1; }
.nav-back .i-close { width: 12px; height: 12px; display: none; }
.nav-back.is-close .i-back { display: none; }
.nav-back.is-close .i-close { display: block; }
.nav-back:active { background: var(--card); }
.nav-back:disabled { opacity: .3; }
.nav-right { margin-left: auto; display: flex; align-items: center; z-index: 1; }
.credits-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 14px; background: var(--card); font-size: 15px; font-variant-numeric: tabular-nums; }
.credits-chip svg { width: 18px; height: 18px; color: var(--ink-2); }
.counter { font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.screen { display: flex; flex-direction: column; gap: 14px; padding: 4px 16px 20px; }

.cta { flex: none; padding: 8px 16px 10px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.btn-main {
  width: 100%; height: 56px; border: 0; border-radius: 999px; background: var(--btn); color: var(--btn-ink);
  font: 700 17px/1 var(--font); display: flex; align-items: center; justify-content: center; position: relative; transition: transform .1s, opacity .15s;
}
.btn-main svg { position: absolute; right: 22px; width: 20px; height: 20px; stroke-width: 2.2; }
.btn-main:active:not(:disabled) { transform: scale(.985); }
.btn-main:disabled { opacity: .3; cursor: default; }
.cta-hint { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
.cta-hint:empty { display: none; }
.main-prog { height: 4px; }

/* плавающая стеклянная панель внизу (макет): поверх контента, поэтому у экранов с вкладками есть отступ снизу */
.tabbar { position: absolute; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); height: 64px; z-index: 20; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; border-radius: 32px; background: var(--nav); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%); border: 0.5px solid var(--glass-line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); }
.tabbar button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.tabbar svg { width: 22px; height: 22px; }
.tabbar button.on { color: var(--link); }
.app.tabs-on .tabspace, .app.tabs-on .home { padding-bottom: 104px; }
.tb-plus { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1.8px solid currentColor; }
.tb-plus svg { width: 16px; height: 16px; stroke-width: 2.4; }
.tabbar button.on .tb-plus { background: var(--ink); border-color: var(--ink); }
.tabbar button.on .tb-plus svg { color: var(--bg); }

/* мелочи */
.card { background: var(--card); border-radius: 18px; }
.card.pad { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card h3 { margin: 0; font-size: 16px; font-weight: 600; }
.link-sm { border: 0; background: none; padding: 0; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.link-sm.right { align-self: flex-end; }
.link-sm.strong { color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none; }
.link-sm.danger { color: var(--danger); align-self: center; }
.tlabel { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tsub { font-size: 13px; color: var(--muted); }
.tsub:empty { display: none; }
.center { text-align: center; justify-content: center; }
.status { margin: -4px 4px 0; font-size: 13px; color: var(--muted); }
.status:empty { display: none; }
.status.err { color: var(--danger); }
.status.good { color: var(--ok); }
.progress { height: 5px; background: var(--card-2); border-radius: 5px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--ink); transition: width .2s; }
.note { margin: -4px 4px 0; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.note svg { width: 16px; height: 16px; flex: none; }
.pill { border: 0; background: var(--card); border-radius: 99px; padding: 9px 14px; font-size: 14px; font-weight: 500; display: inline-flex; }
.pill:active { background: var(--card-2); }
/* настройка варианта на экране «Экспорт»: группы деталей, в каждой — ряд кнопок с прокруткой */
.tune { padding: 12px 0 6px; }
.tune-h { display: flex; justify-content: space-between; align-items: center; padding: 0 16px 6px; }
.tune-g { padding: 6px 0; }
.tune-g .tlabel { padding: 0 16px; display: block; margin-bottom: 6px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
/* настройка варианта: все пункты видны, переносятся на новую строку (13 окт, раньше уходили за край) */
.tune-g .chips { flex-wrap: wrap; overflow-x: visible; row-gap: 6px; }
.chip { border: 0; flex: none; background: var(--card-2); color: var(--ink-2); border-radius: 99px; padding: 8px 13px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }
.sw { display: inline-block; width: 16px; height: 16px; border-radius: 50%; margin-right: 8px; vertical-align: -3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.tune-g.color .chip { min-height: 44px; display: inline-flex; align-items: center; }
.colorPick { display: inline-flex; align-items: center; gap: 8px; background: var(--card-2); color: var(--ink-2); border-radius: 99px; padding: 5px 14px 5px 5px; font-size: 14px; font-weight: 500; }
.colorPick input[type=color] { width: 34px; height: 34px; border: 0; padding: 0; border-radius: 50%; background: none; cursor: pointer; }
.colorPick input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.colorPick input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.pill:disabled { opacity: .45; cursor: default; }
/* живая обложка: включена — тёмная, как выбранный вариант */
.pill.live { flex-direction: column; align-items: center; gap: 1px; padding: 6px 22px 8px; line-height: 1.15; min-width: 128px; }
.pill.live[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); } /* в тёмной теме --ink белый — текст пропадал (аудит 15 окт) */
.live-ico { font-size: 10px; letter-spacing: 3px; margin-right: -3px; }
.live-row { gap: 8px; }
.live-note { margin-top: -4px; text-align: center; }
.pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--bg)); }

/* 01: обложка-герой */
.hero { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 2px; }
.cover-big { width: 270px; max-width: 72vw; aspect-ratio: 1; border-radius: 16px; overflow: hidden; display: block; background: var(--card); box-shadow: 0 30px 70px var(--cover-glow, rgba(30, 40, 180, 0.32)), 0 0 0 0.5px rgba(255, 255, 255, 0.2); margin: 4px 0 12px; }
.cover-big canvas { width: 100%; height: 100%; display: block; }
.t-title, .t-artist { width: 100%; border: 0; background: none; text-align: center; padding: 2px 8px; border-radius: 8px; }
/* правило 9 окт: сверху артист, ниже название трека; как вписаны — без капса */
.t-artist { font: 600 16px/1.2 var(--font); color: var(--ink-2); }
.t-title { font: 800 26px/1.1 var(--font-d); letter-spacing: -0.03em; }
.rel-sub { font-size: 16px; color: var(--muted); text-align: center; }
.t-title:focus, .t-artist:focus { outline: none; background: var(--card); }
.t-title::placeholder, .t-artist::placeholder { color: var(--muted); opacity: .8; }
.hero .link-sm { margin-top: 6px; }

.track-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; border: 1px solid var(--line); border-radius: 18px; }
.tr-ic { width: 48px; height: 48px; flex: none; border: 0; border-radius: 12px; background: var(--card); display: grid; place-items: center; }
.tr-ic svg { width: 24px; height: 24px; }
.tr-ic .i-play { display: none; width: 0; height: 0; border-left: 13px solid var(--ink); border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 3px; }
.track-row.has .tr-ic .i-note { display: none; }
.track-row.has .tr-ic .i-play { display: block; }
.track-row.has .tr-ic.on .i-play { width: 13px; height: 15px; border: 0; margin: 0; background: linear-gradient(90deg, var(--ink) 0 35%, transparent 35% 65%, var(--ink) 65%); }
.tr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tr-main b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-sub { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tr-sub canvas { flex: 1; min-width: 0; height: 20px; }
.tr-check { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--card); }
.tr-check svg { width: 16px; height: 16px; stroke-width: 2.4; }
.track-row.has .tr-check { background: var(--btn); color: var(--btn-ink); }

.sec-h { display: flex; justify-content: space-between; align-items: baseline; margin: 2px 4px -6px; }
.sec-h h2 { margin: 0; font-size: 16px; font-weight: 600; }
.lyr { padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.lyr-prev { border: 0; background: none; text-align: left; padding: 10px 10px 8px; font-size: 15px; line-height: 1.5; color: var(--ink); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lyr-prev.empty { color: var(--muted); }
.row-btn { border: 0; background: var(--card-2); border-radius: 13px; padding: 10px 12px; display: flex; align-items: center; gap: 12px; text-align: left; }
.row-btn:active:not(:disabled) { background: #e2e2e8; }
.row-btn:disabled { opacity: .55; cursor: default; }
.rb-ic svg { width: 22px; height: 22px; display: block; }
.rb-txt { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rb-txt b { font-size: 15px; font-weight: 500; }
.rb-txt small { font-size: 12px; color: var(--muted); }
.rb-txt small:empty { display: none; }
.chev { width: 18px; height: 18px; color: var(--muted); flex: none; }
.lyr .progress { margin: 2px 6px 6px; }

/* 02: стиль */
.reel { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -16px; padding: 6px 20% 10px; scrollbar-width: none; }
.reel::-webkit-scrollbar { display: none; }
.card9 { position: relative; flex: 0 0 60%; scroll-snap-align: center; border: 0; padding: 0; background: none; border-radius: 22px; transition: transform .25s, opacity .25s; transform: scale(.9); opacity: .7; }
.card9.sel { transform: none; opacity: 1; }
.card9 canvas { width: 100%; aspect-ratio: var(--ar, 9 / 16); display: block; border-radius: 22px; background: var(--stage); box-shadow: 0 20px 40px -18px rgba(0,0,0,.45); }
.card9 .play-ov { opacity: 0; pointer-events: none; }
.card9.sel.paused .play-ov { opacity: 1; }
.play-ov { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.8); background: rgba(0,0,0,.28); backdrop-filter: blur(6px); display: grid; place-items: center; transition: opacity .2s; }
.play-ov span { width: 0; height: 0; border-left: 18px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 5px; }
/* «Не нравится» под превью: стиль больше не предлагаем */
.style-name { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: -2px; }
.style-name b { font-size: 17px; font-weight: 700; }
.style-name span { font-size: 13px; color: var(--muted); }
.pager { display: flex; justify-content: center; gap: 7px; }
.pager i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background .2s; }
.pager i.on { background: var(--ink); }
.thumbs { display: flex; gap: 10px; overflow-x: auto; margin-inline: -16px; padding: 4px 16px; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumb { flex: 0 0 31%; border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.thumb canvas { width: 100%; aspect-ratio: 16 / 10; display: block; border-radius: 12px; background: var(--stage); outline: 2px solid transparent; outline-offset: 2px; }
.thumb.sel { color: var(--ink); font-weight: 600; }
.thumb.sel canvas { outline-color: var(--ink); }
.meta-line { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }

/* 03: экспорт */
.preview { position: relative; border-radius: 20px; overflow: hidden; background: var(--stage); display: grid; place-items: center; }
.preview canvas { display: block; max-width: 100%; max-height: 42vh; width: auto; height: auto; }
.preview .play-ov { opacity: 1; }
.preview.playing .play-ov { opacity: 0; }
.rec-ov { position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 8px; padding: 6px 11px; border-radius: 99px; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rec-ov i { width: 9px; height: 9px; border-radius: 50%; background: #ff3b30; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); padding: 3px; gap: 2px; background: var(--card-2); border-radius: 12px; }
.seg button { border: 0; background: none; border-radius: 9px; padding: 8px 2px; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg button:disabled { opacity: .35; cursor: default; }
.ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: -6px; padding-inline: 2px; }
.list { display: flex; flex-direction: column; overflow: hidden; }
.list-row { border: 0; background: none; display: flex; align-items: center; gap: 12px; padding: 15px 16px; text-align: left; font-size: 15px; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row > svg:first-child { width: 22px; height: 22px; color: var(--ink-2); flex: none; }
.list-row span { flex: 1; font-weight: 500; }
.list-row em { font-style: normal; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.list-row:active:not(:disabled) { background: var(--card-2); }
.list-row:disabled { cursor: default; opacity: .6; }
.credits { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.credits svg { width: 28px; height: 28px; color: var(--ink-2); flex: none; }
.credits div { display: flex; flex-direction: column; }
.credits b { font: 700 19px/1.2 var(--font-d); }
.credits span { font-size: 13px; color: var(--muted); }
.credits.short b { color: var(--danger); }
.result { border-radius: 16px; padding: 14px 16px; background: var(--card); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.result b { font-size: 15px; }
.result.good b { color: var(--ok); }
.result.bad b { color: var(--danger); }
.result .link-sm { align-self: flex-start; color: var(--ink); }

/* волна с рамкой отрезка: окно с прямыми углами внутри, скругление снаружи, ручки по бокам */
.wave-box { padding: 38px 20px 6px; }
.wave-box.compact { padding: 30px 20px 2px; }
.rw { position: relative; height: 64px; touch-action: none; user-select: none; -webkit-user-select: none; --rw-in: var(--ink); --rw-out: color-mix(in srgb, var(--muted) 45%, transparent); }
.compact .rw { height: 40px; }
.rw canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rw-sel { position: absolute; top: -8px; bottom: -8px; border: solid var(--btn); border-width: 8px 16px; border-radius: 10px; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.rw-h { position: absolute; top: -8px; bottom: -8px; width: 34px; display: grid; place-items: center; cursor: ew-resize; }
.rw-h.l { left: -25px; } .rw-h.r { right: -25px; }
.rw-h::after { content: ""; width: 3px; height: 42%; min-height: 12px; border-radius: 2px; background: var(--btn-ink); }
.rw-lab { position: absolute; left: 50%; top: -34px; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--btn); color: var(--btn-ink); font-variant-numeric: tabular-nums; pointer-events: none; }
.rw-pos { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--danger); border-radius: 2px; pointer-events: none; }

/* шторки */
.sheet { position: absolute; inset: 0; z-index: 30; display: flex; align-items: flex-end; background: rgba(0,0,0,.32); animation: fade .2s; }
.sheet-card { width: 100%; max-height: 92%; overflow-y: auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 8px 16px calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; animation: up .25s cubic-bezier(.2,.8,.2,1); }
.sheet-card::before { content: ""; width: 38px; height: 5px; border-radius: 3px; background: var(--line); align-self: center; margin-bottom: 2px; flex: none; }
.sheet-card.tall { min-height: 78%; }
.sheet-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sheet-h b { font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.sheet-row.center { justify-content: center; }
.sheet textarea { flex: 1; min-height: 240px; resize: none; border: 0; border-radius: 14px; background: var(--card); padding: 14px; font-size: 16px; line-height: 1.55; }
.sheet textarea:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--ink); }
/* галочка прав на трек и текст на первом экране; правила — в шторке */
.rights { display: flex; gap: 10px; align-items: flex-start; padding: 2px 6px; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.rights input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--ink); }
.rights .link-sm { padding: 0; font-size: 13px; text-decoration: underline; }
.terms { display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.5; }
.terms p { margin: 0; }
/* каталог Deezer: поиск артиста, фото артистов лентой, его треки списком */
.dz-q { border: 0; border-radius: 14px; background: var(--card); padding: 13px 14px; font: inherit; font-size: 16px; color: var(--ink); width: 100%; box-sizing: border-box; }
.dz-q:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--ink); }
.dz-artists { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.dz-artists:empty { display: none; }
.dz-artist { flex: none; width: 76px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0; }
.dz-artist img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--soft); box-shadow: 0 0 0 2px transparent; }
.dz-artist[aria-pressed="true"] img { box-shadow: 0 0 0 2.5px var(--ink); }
.dz-artist span { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.dz-list { background: var(--card); }
.dz-list:empty { display: none; }
.dz-list .g-row img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; background: var(--soft); }
.dz-list .g-txt b, .dz-list .g-txt small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-list .g-txt { min-width: 0; flex: 1; }
.dz-list .dz-h { font-size: 13px; font-weight: 600; color: var(--muted); padding-top: 18px; padding-bottom: 8px; }
.dz-list .dz-dur { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.opts { display: flex; flex-direction: column; background: var(--card); border-radius: 16px; overflow: hidden; }
.opt { border: 0; background: none; display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-align: left; font-size: 15px; }
.opt + .opt { border-top: 1px solid var(--line); }
.opt .shape { width: 26px; display: grid; place-items: center; }
.opt .shape i { display: block; border: 2px solid var(--ink-2); border-radius: 3px; }
.opt span { flex: 1; display: flex; flex-direction: column; font-weight: 500; }
.opt small { color: var(--muted); font-size: 12px; font-weight: 400; }
.opt .tick { width: 20px; height: 20px; opacity: 0; stroke-width: 2.4; }
.opt[aria-pressed="true"] .tick { opacity: 1; }
.round-play { width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--btn); display: grid; place-items: center; }
.round-play span { width: 0; height: 0; border-left: 16px solid var(--btn-ink); border-top: 10px solid transparent; border-bottom: 10px solid transparent; margin-left: 4px; }
.round-play.on span { width: 15px; height: 18px; border: 0; margin: 0; background: linear-gradient(90deg, var(--btn-ink) 0 35%, transparent 35% 65%, var(--btn-ink) 65%); }
.sheet video { width: 100%; max-height: 52vh; border-radius: 16px; background: var(--stage); }




@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { background: rgba(0,0,0,0); } }

/* мои видео и профиль */
.vid { display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 6px 0; text-align: left; }
.vid img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; background: var(--card); flex: none; }
.vid span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vid b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vid small { font-size: 13px; color: var(--muted); }
.empty-state { text-align: center; color: var(--muted); padding: 60px 20px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.empty-state b { color: var(--ink); font-size: 17px; }
.balance { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.balance b { font: 700 30px/1.15 var(--font-d); letter-spacing: -0.02em; }

@media (prefers-reduced-motion: reduce) { *, .sheet, .sheet-card { transition: none !important; animation: none !important; } }

/* 02: проверка текста */
.bar { display: flex; align-items: center; gap: 12px; }
.play { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--btn); flex: none; display: grid; place-items: center; }
.play.sm { width: 40px; height: 40px; }
.play span { width: 0; height: 0; border-left: 13px solid var(--btn-ink); border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 3px; }
.play.on span { width: 12px; height: 14px; border: 0; margin: 0; background: linear-gradient(90deg, var(--btn-ink) 0 35%, transparent 35% 65%, var(--btn-ink) 65%); }
.now { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.now strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.banner { border-radius: 14px; padding: 11px 14px; background: var(--card); font-size: 13px; color: var(--ink-2); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner:empty { display: none; }
.banner.warn { background: color-mix(in srgb, var(--warn) 12%, var(--bg)); color: color-mix(in srgb, var(--warn) 70%, var(--ink)); }
.banner .pill { background: var(--bg); }
/* таймлайн слов на «Тексте»: закреплён сверху при прокрутке списка строк */
.tl { position: sticky; top: 0; z-index: 3; background: var(--bg); border-radius: 18px; padding: 8px 0 6px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 8px 18px -12px rgba(0,0,0,.5); }
.tl-box { height: 216px; border-radius: 14px; background: var(--card); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.tl-cv { width: 100%; height: 100%; display: block; cursor: grab; }
.tl-wrap { position: relative; }
.tl-zoom { position: absolute; right: 6px; top: 22px; display: flex; gap: 4px; }
.tl-zoom button { width: 30px; height: 30px; border: 0; border-radius: 9px; background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--ink); font: 600 16px var(--font); cursor: pointer; }
.tl-seek { display: flex; align-items: center; gap: 10px; padding: 0 4px; margin-top: 12px; /* 4 ноя: кнопки чуть ниже ленты */ font: 500 12px var(--font); color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-seek input { flex: 1; min-width: 0; height: 28px; accent-color: var(--ink); cursor: pointer; }
.tl-seek #tlNow { min-width: 52px; color: var(--ink); }
.tl-play { width: 46px; height: 46px; }
.tl-row { display: flex; gap: 6px; align-items: center; justify-content: center; }
#bTimeline[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }
.tl-b { flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--card); color: var(--ink); font: 600 16px var(--font); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tl-b:active { background: var(--card-2); }
.tl-b[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }
.tl-here { flex: 1; max-width: 120px; height: 42px; justify-content: center; font-weight: 600; }
.tl-edit input { flex: 1; min-width: 0; height: 40px; border: 0; border-radius: 12px; background: var(--card); color: var(--ink); padding: 0 12px; font: 500 16px var(--font); }
.tl-edit input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--ink); }
.tl-edit .pill { flex: none; }
.tl-edit-wrap { display: flex; flex-direction: column; gap: 4px; }
.tl-edit-wrap[hidden] { display: none; }
.tl-del svg { width: 18px; height: 18px; fill: none; stroke: var(--danger, #ff453a); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tl-all { align-self: flex-start; padding: 2px 4px; font-size: 13px; }
.tl-undo { align-self: center; }
.tl-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tl-tools .pill { justify-content: center; padding: 9px 4px; font-size: 13px; min-width: 0; white-space: nowrap; }
.tl-tools .pill:disabled { opacity: .4; }
.tl-marks-clear { align-self: center; }
.tl-marks-clear[hidden] { display: none; }
.tl-hint.say { color: var(--ink); font-weight: 600; }
.tl-hint { margin: 0 4px; font-size: 12px; color: var(--muted); text-align: center; }
.tl-hint:not(.say) { display: none; } /* 3 ноя: длинная подсказка под лентой мешает — показываем только короткие сообщения (tlSay) */
.tl-speed { width: auto; min-width: 42px; padding: 0 10px; font: 700 14px var(--font); } /* скорость звука: 1× ⅔× ½× */
.lyr-list { display: flex; flex-direction: column; gap: 2px; }
/* экран «Текст» (20 окт) — только переключатель «по словам / по строкам» и таймлайн: всё правится на ленте. Шапка с
   кнопкой, плашка, «Расставить самому», список строк и подсказка под ним — скрыты (код на месте) */
#s2 > .bar, #s2 > .banner, #s2 > .tap-row, #s2 > .script-row, #s2 > .lyr-list, #s2 > .note { display: none; }
.by-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.by-note { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
.ll { display: flex; align-items: center; gap: 6px; border-radius: 14px; padding: 4px 4px 4px 6px; transition: background .15s; }
.ll.cur { background: var(--card); }
.ll-time { flex: none; width: 52px; border: 0; background: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: left; padding: 10px 0; }
.ll-text { flex: 1; min-width: 0; border: 0; background: none; text-align: left; font-size: 16px; line-height: 1.4; padding: 8px 2px; color: var(--muted); }
.ll.cur .ll-text { color: var(--ink-2); }
.ll-text i { font-style: normal; transition: color .1s; }
.ll-text i.on { color: var(--ink); }
.ll-text i.now { color: var(--ink); font-weight: 700; }
.ll-text small { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 600; color: var(--warn); vertical-align: 1px; }
.ll-shift { display: flex; flex: none; }
.ll-shift button, .fine button { width: 44px; height: 44px; border: 0; background: none; border-radius: 12px; font-size: 22px; line-height: 1; color: var(--ink-2); }
.ll-shift button:active, .fine button:active { background: var(--card-2); }

/* 03: фрагмент */
.frag-h { display: flex; justify-content: space-between; align-items: center; }
.seg.five { grid-template-columns: repeat(5, 1fr); }
.seg button { min-height: 40px; }
.fine { display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 16px; }
.fine + .fine { border-top: 1px solid var(--line); }
.fine span { flex: 1; font-weight: 500; }
.fine b { min-width: 72px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.script-row { display: flex; flex-direction: column; gap: 6px; }
#s4 .script-row { margin: 4px 0 12px; }
.ll-text .ll-read { display: block; font-size: 13px; line-height: 1.35; color: var(--muted); opacity: .8; margin-top: 2px; }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.seg.two { grid-template-columns: repeat(2, 1fr); }
/* расставить самому: кнопка под палец, текущая строка крупно, следующее слово подсвечено */
.tap-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.tap-view { background: var(--stage); color: #fff; border-radius: 18px; padding: 18px 16px; min-height: 190px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.tap-side { font-size: 14px; line-height: 1.35; color: rgba(255,255,255,.38); min-height: 19px; }
.tap-cur { font-size: 24px; font-weight: 700; line-height: 1.35; color: rgba(255,255,255,.42); }
.tap-cur i { font-style: normal; border-radius: 6px; padding: 0 2px; transition: color .1s, background .1s; }
.tap-cur i.done { color: #fff; }
.tap-cur i.next { color: #111114; background: #f5d33b; }
.tap-cur.whole { color: #111114; background: #f5d33b; border-radius: 10px; padding: 2px 8px; align-self: flex-start; }
.tap-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tap-btn { flex: none; height: 128px; border: 0; border-radius: 28px; background: var(--btn); color: var(--btn-ink); font-size: 20px; font-weight: 700;
  user-select: none; -webkit-user-select: none; touch-action: none; transition: transform .06s, background .06s; }
.tap-btn.down { transform: scale(.97); background: #2c2c34; }
.tap-tools { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.mismatch { border-radius: 16px; padding: 14px; background: color-mix(in srgb, var(--warn) 10%, var(--bg)); display: flex; flex-direction: column; gap: 8px; }
.mismatch b { font-size: 15px; }
.mm-heard { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--bg); font-size: 14px; line-height: 1.5; white-space: pre-line; color: var(--ink-2); }
.pill.dark { background: var(--btn); color: var(--btn-ink); }

/* адрес сервера в «Профиле» */
.srv-in { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: var(--bg); font-size: 15px; margin: 8px 0; }

/* ===== 14 окт: перенос макета (студия, новый релиз, идея, примерка, оплата, готово, кабинет) ===== */
.view { position: relative; }
.view > .scroll, .cta { position: relative; z-index: 1; }
.nav h1:empty { display: none; }
.nav-right { gap: 8px; }
.step-dots { display: flex; gap: 6px; margin: 0 auto; }
.step-dots i { width: 22px; height: 4px; border-radius: 2px; background: var(--track); }
.step-dots i.on { background: var(--ink); }
.nav .counter { font-size: 14px; }

/* переключатель темы: луна — на светлой, солнце — на тёмной; без явного выбора — по системе */
.theme-btn { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--soft); color: var(--ink); display: grid; place-items: center; flex: none; padding: 0; }
.theme-btn svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.8; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; }
}

.bg-cover { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 420px; z-index: 0; pointer-events: none; opacity: var(--bg-op); object-fit: cover;
  -webkit-mask-image: linear-gradient(#000 15%, transparent 100%); mask-image: linear-gradient(#000 15%, transparent 100%); }

/* стеклянные группы: одна рамка на несколько строк, между строками — тонкая линия */
.glass { background: var(--glass); backdrop-filter: blur(30px) saturate(160%); -webkit-backdrop-filter: blur(30px) saturate(160%); border: 0.5px solid var(--glass-line); }
.group { border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; }
.group > * + * { border-top: 0.5px solid var(--line); }
.g-row { width: 100%; border: 0; background: transparent; color: var(--ink); padding: 14px 16px; display: flex; align-items: center; gap: 12px; text-align: left; font: inherit; }
.g-row:active:not(:disabled) { background: var(--soft); }
.g-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--soft); display: flex; align-items: center; justify-content: center; flex: none; }
.g-ic svg { width: 16px; height: 16px; }
.g-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.g-txt b { font: 600 16px var(--font); }
.g-txt small { font: 500 13px var(--font); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-txt small:empty { display: none; }
.g-link { font: 600 15px var(--font); font-style: normal; color: var(--link); flex: none; }
.g-thumb { width: 34px; height: 34px; border-radius: 8px; flex: none; object-fit: cover; background: var(--card); }
.g-prog { margin: 0 16px 12px; }
.group .track-row { border: 0; border-radius: 0; padding: 12px 16px; }
.group .tr-ic { width: 40px; height: 40px; }
.group .tr-main b { font: 600 16px var(--font); }
.group .chev { color: var(--muted); }

/* Студия: главный экран */
.home { padding: 6px 20px 28px; display: flex; flex-direction: column; gap: 18px; }
.home-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.home-date { display: block; font: 600 13px var(--font); color: var(--muted); letter-spacing: 0.02em; margin-bottom: 2px; }
.home-title h2 { margin: 0; font: 800 34px/1.05 var(--font-d); letter-spacing: -0.035em; }
.home-acts { display: flex; align-items: center; gap: 8px; }
.home-chip { height: 36px; padding: 0 12px 0 8px; border-radius: 999px; background: var(--soft); display: inline-flex; align-items: center; gap: 6px; font: 600 14px var(--font); }
.home-chip svg { width: 18px; height: 18px; color: var(--link); }
.home-chip b { font-weight: 700; }
.hero-card { position: relative; width: 100%; height: 430px; border: 0; border-radius: 28px; overflow: hidden; padding: 20px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; text-align: left; color: #fff;
  background: var(--hero-bg); box-shadow: var(--hero-shadow); }
.hero-tag { position: absolute; top: 16px; left: 16px; height: 26px; padding: 0 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); display: inline-flex; align-items: center; gap: 6px; font: 600 12px var(--font); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.hero-tag i { width: 6px; height: 6px; border-radius: 50%; background: #ff4fd8; }
.hero-title { font: 800 30px/1.02 var(--font-d); letter-spacing: -0.035em; }
.hero-sub { font: 500 15px/1.35 var(--font); color: rgba(255, 255, 255, 0.78); }
.hero-cta { margin-top: 10px; align-self: flex-start; height: 44px; padding: 0 20px; border-radius: 999px; background: var(--hero-cta); color: var(--hero-cta-ink); display: inline-flex; align-items: center; gap: 8px; font: 700 16px var(--font); }
.hero-cta svg { width: 14px; height: 14px; stroke: var(--hero-cta-ink); stroke-width: 2.4; }

/* Твоя идея */
.idea { padding: 6px 20px 24px; display: flex; flex-direction: column; gap: 18px; }
.idea-h { margin: 4px 0 0; font: 800 32px/1.05 var(--font-d); letter-spacing: -0.035em; }
.idea-card { border-radius: 24px; padding: 16px; }
.idea-card textarea { width: 100%; min-height: 150px; border: 0; background: transparent; resize: none; padding: 0; font: 500 17px/1.45 var(--font); color: var(--ink); outline: none; }
.idea-card textarea::placeholder { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Готово: бейдж, предпросмотр и видео, подпись */
.done { gap: 14px; }
.done-head { display: flex; }
.badge { height: 30px; padding: 0 12px 0 9px; border-radius: 999px; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); display: inline-flex; align-items: center; gap: 6px; font: 600 13px var(--font); }
.badge i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.work { background: var(--soft); color: var(--ink-2); }
.badge.work i { animation: blink 1s infinite; }
.done-stage { border-radius: 22px; min-height: 260px; }
#doneVid { display: block; width: 100%; max-height: 52vh; border-radius: 22px; background: var(--stage); }
.done-stage #out { border-radius: 22px; }
.done-meta { display: flex; flex-direction: column; gap: 2px; }
.done-meta b { font: 800 26px/1.1 var(--font-d); letter-spacing: -0.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.done-meta span { font: 500 15px var(--font); color: var(--muted); }
/* название ролика: правится перед сохранением */
.name-row { display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 44px; border-radius: 12px; background: var(--card, rgba(127,127,127,.08)); border: 1px solid var(--line, rgba(127,127,127,.18)); cursor: text; }
.name-row:focus-within { border-color: var(--accent, currentColor); }
.name-row svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linejoin: round; }
.name-row input { flex: 1; min-width: 0; border: 0; background: none; color: inherit; font: 600 16px var(--font); padding: 10px 0; outline: none; }
.name-row em { flex: none; font: 500 14px var(--font); font-style: normal; color: var(--muted); }

/* Оплата: лист поверх «Примерки» */
.sheet-card.checkout { gap: 14px; }
.co-head { display: flex; align-items: center; gap: 12px; }
.co-cover { width: 50px; height: 50px; border-radius: 10px; object-fit: cover; background: var(--card); flex: none; }
.co-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.co-title b { font: 800 20px/1.15 var(--font-d); letter-spacing: -0.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-title span { font: 500 14px var(--font); color: var(--muted); }
.round-x { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--soft); color: var(--muted); display: grid; place-items: center; flex: none; padding: 0; }
.round-x svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 1.8; }
.checkout .note { margin: -6px 4px 0; }
.checkout .credits b { font: 700 19px/1.2 var(--font-d); }

/* Кабинет */
.cab { gap: 16px; padding-top: 6px; }
.acc { display: flex; align-items: center; gap: 14px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #4b4bff, #ff4fd8); color: #fff; font: 800 22px var(--font); display: flex; align-items: center; justify-content: center; flex: none; }
.acc div { display: flex; flex-direction: column; gap: 2px; }
.acc b { font: 700 17px var(--font); }
.acc span { font: 500 13px var(--font); color: var(--muted); }
.balance-card { border-radius: 24px; background: var(--btn); color: var(--btn-ink); padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.bal-l { font: 600 12px var(--font); opacity: 0.7; text-transform: uppercase; letter-spacing: 0.06em; }
.bal-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.bal-v { font: 600 16px var(--font); }
.bal-v b { font: 800 36px/1 var(--font); letter-spacing: -0.03em; margin-right: 4px; }
.bal-add { height: 36px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--soft); color: inherit; font: 600 13px var(--font); white-space: nowrap; }
.bal-add:disabled { opacity: 0.6; cursor: default; }
.bal-note { font: 500 12px/1.4 var(--font); opacity: 0.7; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat { padding: 14px; border-radius: 16px; background: var(--card); display: flex; flex-direction: column; gap: 4px; }
.stat span { font: 500 12px var(--font); color: var(--muted); }
.stat b { font: 800 24px var(--font); }
.op { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px; font: 500 14px/1.3 var(--font); }
.op + .op { border-top: 1px solid var(--line); }
.op span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op b { font-weight: 700; font-variant-numeric: tabular-nums; }
.op b.plus { color: var(--ok); }
.list > .vid { padding: 10px 16px; }
.list > .vid + .vid { border-top: 1px solid var(--line); }
.list > .vid img { width: 44px; height: 44px; border-radius: 10px; }

/* ===== 14 окт: «Твоя идея» — подсказки и понимание идеи режиссёром ===== */
.idea-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.idea-chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 0; background: transparent; color: var(--ink); font: 600 14px var(--font); box-shadow: inset 0 0 0 0.5px var(--line); }
.idea-chip[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); box-shadow: none; }
.idea-brief { display: flex; flex-direction: column; gap: 10px; }
.brief-h { display: flex; align-items: center; gap: 8px; font: 600 12px var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }
.brief-h svg { width: 14px; height: 14px; fill: var(--link); stroke: none; flex: none; }
.brief-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.brief-card { padding: 12px; border-radius: 16px; background: var(--card); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.brief-card span { font: 500 12px var(--font); color: var(--muted); }
.brief-card b { font: 600 14px/1.3 var(--font); }
.idea-status { margin: -8px 4px 0; font-size: 13px; color: var(--muted); }
.idea-status:empty { display: none; }

/* ===== 14 окт: шлифовка на телефоне — аватар, подписи стилей, строка «списано» ===== */
.acc .avatar { color: #fff; font: 800 22px var(--font); }
.thumb-name { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.done-note { font: 500 13px var(--font); color: var(--muted); }
.done-note:empty { display: none; }

/* ===== 14 окт: карточка «Новый релиз» — иллюстрация из макета, затемнение снизу, текст поверх ===== */
.hero-card > .hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; z-index: 0; filter: var(--hero-img); }
.hero-card > .hero-scrim { position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, var(--hero-scrim) 100%); }
.hero-card > .hero-tag, .hero-card > .hero-title, .hero-card > .hero-sub, .hero-card > .hero-cta { position: relative; z-index: 1; }
.hero-card > .hero-tag { position: absolute; z-index: 2; }

/* ===== 14 окт: «Твоя идея» — микрофон, «+ Референс», карточка референса ===== */
.idea-tools { display: flex; align-items: center; gap: 10px; }
.mic { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--soft); color: var(--ink); display: flex; align-items: center; justify-content: center; flex: none; padding: 0; position: relative; }
.mic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.mic svg rect { fill: currentColor; stroke: none; }
.mic:disabled { opacity: 0.6; }
.mic-bars { display: none; align-items: center; gap: 3px; height: 18px; }
.mic.rec { background: var(--link); color: #fff; box-shadow: 0 0 0 6px color-mix(in srgb, var(--link) 25%, transparent); }
.mic.rec svg { display: none; }
.mic.rec .mic-bars { display: flex; }
.mic-bars i { width: 3px; height: 18px; border-radius: 2px; background: #fff; animation: wv 0.9s ease-in-out infinite; }
.mic-bars i:nth-child(2) { animation-delay: 0.15s; }
.mic-bars i:nth-child(3) { animation-delay: 0.3s; }
.mic-bars i:nth-child(4) { animation-delay: 0.45s; }
@keyframes wv { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .mic-bars i { animation: none; } }
.mic-hint { flex: 1; min-width: 0; font: 500 14px var(--font); color: var(--muted); }
.ref-add { height: 40px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--soft); color: var(--ink); font: 600 14px var(--font); display: inline-flex; align-items: center; gap: 6px; flex: none; }
.ref-add svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
.ref-card { display: flex; align-items: center; gap: 12px; }
.ref-thumb { position: relative; width: 52px; height: 72px; border-radius: 10px; overflow: hidden; flex: none; background: var(--card); }
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.ref-play svg { width: 14px; height: 14px; fill: #fff; stroke: none; }
.ref-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ref-txt b { font: 600 15px var(--font); }
.ref-txt span { font: 500 13px var(--font); color: var(--muted); }
.ref-x { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--soft); color: var(--muted); display: flex; align-items: center; justify-content: center; flex: none; padding: 0; }
.ref-x svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 1.8; fill: none; }

/* ===== 14 окт: доделка по макету — трек, примерка, оплата, готово, кабинет ===== */
.tr-time { font: 500 13px 'Geist Mono', monospace; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.prev-bar { height: 3px; background: var(--card-2); border-radius: 2px; overflow: hidden; margin: -2px 4px 0; }
.prev-bar i { display: block; height: 100%; width: 0; background: var(--ink); }
.prev-time { display: flex; justify-content: space-between; font: 500 12px 'Geist Mono', monospace; color: var(--muted); margin: -8px 4px 0; font-variant-numeric: tabular-nums; }
.nav h1 small { display: block; font: 500 12px var(--font); color: var(--muted); letter-spacing: 0; margin-top: 2px; }
.cta-btns { display: flex; align-items: center; gap: 10px; }
.cta-btns .btn-main { flex: 1; min-width: 0; }
.round-btn { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--soft); color: var(--ink); display: flex; align-items: center; justify-content: center; flex: none; padding: 0; }
.round-btn[hidden] { display: none; }
.round-btn svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.btn-main.saved { background: var(--ok); color: #fff; }
.done-dur { position: absolute; right: 10px; bottom: 10px; padding: 3px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.45); color: #fff; font: 500 12px 'Geist Mono', monospace; z-index: 2; }
.fmt-chips { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.fmt-chip { height: 34px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--soft); color: var(--ink); font: 600 13px var(--font); }
.fmt-chip[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }
.fmt-chip:disabled { opacity: 0.45; cursor: default; }
.fmt-chip[aria-pressed="true"]:disabled { opacity: 1; }
.done-edit { align-self: center; }
.co-rows { border-radius: 18px; }
.co-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; font: 500 14px/1.3 var(--font); }
.co-row + .co-row { border-top: 1px solid var(--line); }
.co-row svg { width: 16px; height: 16px; stroke: var(--ok); stroke-width: 2.2; fill: none; flex: none; }
.co-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-row b { font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.pill-ok { height: 24px; padding: 0 9px; border-radius: 999px; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); font: 600 12px var(--font); display: inline-flex; align-items: center; flex: none; font-style: normal; }

/* ===== 14 окт: шлифовка по снимкам — надписи не налезают, длительность не перекрывает плеер ===== */
#mainLabel { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 34px; }
.co-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.done-dur { top: 10px; right: 10px; bottom: auto; }
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { padding: 12px; min-width: 0; }
.stat b { font: 800 22px var(--font); }
.group .tr-sub { flex-wrap: wrap; row-gap: 6px; }
.group .tr-sub canvas { flex: 1 1 100%; width: 100%; height: 26px; min-width: 0; }
/* дочерние блоки листа не сжимаются: при нехватке высоты прокручивается весь лист, а строки не схлопываются (14 окт) */
.sheet-card > * { flex-shrink: 0; }
/* ===== 14 окт: мелочи по макету — звёздочка на «Собрать», рамка ролика по формату ===== */
.btn-spark { width: 16px; height: 16px; fill: currentColor; stroke: none; margin-right: 8px; flex: none; }
.btn-spark[hidden] { display: none; }
.done-stage { width: min(100%, calc(52vh * var(--ar, 0.5625))); margin: 0 auto; aspect-ratio: var(--ar, 9 / 16); min-height: 0; }
.done-stage canvas, #doneVid { width: 100%; height: 100%; max-height: none; object-fit: cover; }
.btn-main .btn-spark { position: static; right: auto; width: 16px; height: 16px; }
/* ===== 14 окт: по макету — примерка (одна карточка и пять миниатюр), круглая кнопка трека ===== */
.reel { padding: 6px 0 10px; }
.card9 { flex: 0 0 62%; }
.card9:not(.sel) { opacity: 0; transform: none; }
.thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; overflow: visible; margin-inline: 0; padding: 4px 0; }
.thumb { flex: none; min-width: 0; font-size: 11px; line-height: 1.25; }
.thumb canvas { aspect-ratio: 9 / 16; }
.group .tr-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--bg); }
.group .tr-ic .i-play { border-left-color: var(--bg); }
.group .tr-ic.on .i-play { background: linear-gradient(90deg, var(--bg) 0 35%, transparent 35% 65%, var(--bg) 65%); }
.reel { padding: 6px 19% 10px; }
/* ===== 14 окт: на компьютере приложение — ровно как на скринах: колонка 390 × 844 по центру, на телефоне — на весь экран ===== */
@media (min-width: 600px) {
  html, body { background: #111114; }
  .app { width: 390px; height: 844px; max-width: none; margin: 24px auto; border-radius: 44px; box-shadow: 0 0 0 10px #1c1c20; }
}

/* ===== 14 окт: как в макете — размытая иллюстрация наверху «Студии» и кабинета, отступы, заголовок кабинета ===== */
.bg-home { position: absolute; left: 0; right: 0; top: 0; height: 420px; z-index: 0; pointer-events: none; background: url(../img/studio-hero.jpg) 50% 18% / cover no-repeat; opacity: var(--bg-op); -webkit-mask-image: linear-gradient(#000 15%, transparent 100%); mask-image: linear-gradient(#000 15%, transparent 100%); }
.bg-home[hidden] { display: none; }
.home { padding-top: calc(env(safe-area-inset-top, 0px) + 50px); }
#vProfile .nav { height: auto; padding: calc(env(safe-area-inset-top, 0px) + 50px) 16px 0; }
#vProfile .nav h1 { font: 800 34px/1.05 var(--font-d); letter-spacing: -0.035em; }
.bg-home { filter: blur(36px) var(--home-haze); transform: scale(1.2); opacity: calc(var(--bg-op) * 0.75); } /* в макете — мягкая дымка, а не сама картинка */
/* ===== 14 окт: мелочи по макету — синий акцент #4B4BFF, кружок баланса, стеклянные карточки кабинета ===== */
.home-chip .coin { width: 20px; height: 20px; border-radius: 50%; background: var(--brand); display: flex; align-items: center; justify-content: center; flex: none; }
.home-chip .coin svg { width: 10px; height: 10px; fill: var(--brand-ink); stroke: none; }
.tabbar button.on { color: var(--brand); }
#vProfile .stat, #cabVideos, #cabOps { background: var(--glass); border: 0.5px solid var(--glass-line); }

/* ===== 14 окт: экраны по макету, второй проход — релиз, идея, примерка, оплата, готово ===== */
/* кнопки — без стрелки, как в макете */
.btn-main .btn-chev { display: none !important; }
#mainLabel { padding: 0 8px; }
/* фон из обложки — размытый; на «Новом релизе» — на весь экран */
.bg-cover { filter: blur(36px) saturate(1.2); transform: scale(1.2); }
.bg-cover.full { height: 100%; -webkit-mask-image: none; mask-image: none; }
/* трек: волна отдельной строкой на всю ширину, без кружка с галочкой */
.group .track-row { flex-wrap: wrap; row-gap: 10px; }
.group .tr-wave { flex: 1 1 100%; width: 100%; height: 28px; min-width: 0; }
/* трек загружен — справа «Заменить», как у обложки (15 окт) */
.group .track-row.has .tr-check { display: inline-flex; width: auto; height: auto; padding: 0; border-radius: 0; background: none; color: var(--link); font: 600 15px var(--font); cursor: pointer; }
/* идея: поле на три строки */
.idea-card textarea { min-height: 76px; }
/* примерка: широкая карточка, поверх — название стиля сверху и полоска времени снизу */
.prev-wrap { position: relative; margin-inline: -16px; }
#s4 .reel { margin-inline: 0; padding: 0 20px; }
#s4 .card9 { flex: 0 0 100%; }
#s4 .card9 canvas { aspect-ratio: auto; height: 455px; object-fit: cover; border-radius: 26px; }
.prev-badge { position: absolute; top: 14px; left: 34px; height: 28px; padding: 0 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); color: #fff; font: 600 12px var(--font); display: inline-flex; align-items: center; gap: 6px; pointer-events: none; z-index: 2; }
.prev-badge svg { width: 11px; height: 11px; fill: #ff4fd8; stroke: none; }
.prev-badge:has(#prevBadge:empty) { display: none; }
/* водяной знак в верхнем углу (19 ноя): плашка стиля уходит (имя и так на «Выбрать «…»»), кнопка «на весь экран» — вниз над полоской */
#s4.wm-tl .prev-badge { display: none; }
#s4.wm-tr .prev-full { top: auto; bottom: 46px; }
.prev-over { position: absolute; left: 36px; right: 36px; bottom: 14px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; z-index: 2; }
.prev-over .prev-bar { margin: 0; background: rgba(255, 255, 255, 0.25); }
.prev-over .prev-bar i { background: #fff; }
.prev-over .prev-time { margin: 0; color: rgba(255, 255, 255, 0.75); font-size: 11px; }
/* оплата: вертикальная обложка, крупный заголовок, строки со значком формата и зелёной галочкой, стоимость строкой */
.co-cover { width: 54px; height: 72px; }
.co-title b { font-size: 22px; }
.co-head .co-theme { width: 30px; height: 30px; align-self: flex-start; }
.co-head .co-theme svg { width: 15px; height: 15px; }
.co-head .round-x { align-self: flex-start; }
.co-row .co-fmt { width: 18px; height: 30px; border: 1.8px solid var(--ink); border-radius: 4px; box-sizing: border-box; margin: 0 6px; flex: none; }
.co-row .co-fmt.wide { width: 30px; height: 18px; margin: 0; }
.co-row b svg { width: 16px; height: 16px; stroke: #30b550; stroke-width: 2.2; fill: none; display: block; }
.co-row span { white-space: normal; font-weight: 600; font-size: 15px; }
#coCost { background: none; padding: 0; justify-content: center; }
#coCost > svg, #costTitle { display: none; }
#costSub { font: 500 13px var(--font); color: var(--muted); text-align: center; }
/* готово: бейдж в шапке по центру, кнопка «Играть» поверх ролика, длительность снизу справа */
.nav-badge { margin: 0 auto; }
.nav-badge[hidden] { display: none; }
.done-note { display: none !important; }
.done-dur { top: auto; bottom: 10px; right: 10px; }
.done-stage .play-ov { width: 54px; height: 54px; margin: -27px 0 0 -27px; border: 0; background: rgba(255, 255, 255, 0.24); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); z-index: 2; }
.fmt-chip { background: transparent; box-shadow: inset 0 0 0 0.5px var(--line); }
.fmt-chip[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); box-shadow: none; }
.fmt-chip:disabled { opacity: 1; }
.done-edit { color: var(--link); font: 600 15px var(--font); text-decoration: none; }
#bShare { order: 2; }
.cta { background: transparent; } /* кнопка лежит на фоне экрана, без белой плашки — как в макете */
#doneEdit { color: var(--brand); } /* как в макете — синяя ссылка */
.prev-wrap::after { content: ""; position: absolute; left: 20px; right: 20px; top: 0; height: 455px; border-radius: 26px; pointer-events: none; z-index: 1; background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.45) 100%); } /* затемнение карточки, как в макете: полоска и название читаются */

/* ===== 14 окт: кнопки и отступы как в макете — верхний ряд на 72 px (после статус-бара), нижняя кнопка в 34 px от низа, поля по 20 px ===== */
:root { --top: max(env(safe-area-inset-top, 0px), 44px); }
html.in-tg { --top: 6px; } /* 12 ноя (владелец: «подними всё повыше»): в Telegram над приложением уже его шапка — 44 px пустоты под статус-бар не нужны */
.nav { height: calc(56px + var(--top)); padding: var(--top) 20px 0; }
.home { padding-top: calc(var(--top) + 8px); }
#vProfile .nav { height: auto; padding: calc(var(--top) + 6px) 20px 0; }
.screen { padding-left: 20px; padding-right: 20px; }
.prev-wrap { margin-inline: -20px; }
.cta { padding: 8px 20px max(env(safe-area-inset-bottom, 0px), 34px); }
#vCreate.bg-on .nav-back, #vCreate.bg-on .theme-btn { background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
:root[data-theme="dark"] #vCreate.bg-on .nav-back, :root[data-theme="dark"] #vCreate.bg-on .theme-btn { background: rgba(255, 255, 255, 0.14); }
.scroll { scrollbar-width: none; } .scroll::-webkit-scrollbar { display: none; } /* как в макете: без полосы прокрутки, листается так же */
#mainSpark:not([hidden]) + #mainLabel { padding-left: 0; } /* звёздочка вплотную к тексту, как в макете */

/* ===== 14 окт: только три цвета — белый, чёрный и фиолетовый #4B4BFF; красный — лишь для ошибок и удаления ===== */
:root { --ok: #087a52; --warn: #087a52; --link: #087a52; } /* 16 ноя: светлая тема — тёмная мята вместо синего */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ok: #9da0ff; --warn: #9da0ff; --link: #9da0ff; } }
:root[data-theme="dark"] { --ok: #9da0ff; --warn: #9da0ff; --link: #9da0ff; }
.hero-tag i { background: var(--brand); }
.prev-badge svg { fill: var(--brand); }
.avatar { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); }
.co-row b svg { stroke: var(--link); }
.bg-home.full { height: 100%; -webkit-mask-image: none; mask-image: none; }

/* ===== 14 окт: отрывок трека — на «Твоей идее», после референса: стеклянная карточка в духе макета ===== */
.frag-card { border-radius: 22px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.frag-card .frag-h { display: flex; align-items: center; gap: 10px; }
.frag-card .frag-h b { font: 600 16px var(--font); }
.frag-val { flex: 1; font: 500 13px var(--font); color: var(--muted); font-variant-numeric: tabular-nums; }
.frag-card .play.sm { width: 36px; height: 36px; }
.frag-card .wave-box.compact { padding: 30px 16px 2px; }
.fine-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fine-row .fine { padding: 2px 4px 2px 10px; background: var(--soft); border-radius: 12px; }
.fine-row .fine + .fine { border-top: 0; }
.fine-row .fine span { font-size: 13px; }
.fine-row .fine b { min-width: 52px; font-size: 13px; }
.fine-row .fine button { width: 32px; height: 36px; font-size: 18px; }

/* ===== 14 окт: «Не нравится», «Движение / Живая» и «Ещё варианты» — на «Примерке» под миниатюрами ===== */
.var-tools { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding-bottom: 8px; }
.var-tools .live-row { display: flex; gap: 8px; margin: 0; }
.var-tools .pill.live { flex: 1; min-width: 0; }
.var-tools .live-note { margin: 0; }
.var-row { display: flex; flex-wrap: wrap; gap: 8px; row-gap: 6px; justify-content: center; align-items: center; } /* подпись «… больше не предлагаем · Вернуть» — своей строкой, «Ещё варианты» не ломается (аудит 15 окт) */
.var-row .pill { white-space: nowrap; }
.var-row .trow { margin: 0; }

/* ===== 14 окт: формат на «Примерке» сверху; карточка превью — в пропорциях выбранного формата, без обрезки кадра ===== */
#s4 #varFmts { margin-top: -4px; }
#s4 .card9 canvas { width: 100%; height: auto; aspect-ratio: var(--ar, 9 / 16); max-height: 455px; object-fit: contain; background: var(--stage); }
.prev-wrap::after { height: auto; bottom: 0; }
.thumb canvas { aspect-ratio: auto; width: 100%; height: auto; } /* пропорции задаёт сам холст — по формату */
.thumbs { align-items: start; }

/* ===== 15 окт: шрифт строк на «Примерке» — лента плашек, на каждой слово из песни этим шрифтом ===== */
/* «Текст» на «Примерке»: свёрнутая строка со сводкой, открывается вниз (шрифт, цвет букв, фон) */
.text-sec { margin: 12px 0 4px; border-radius: 20px; background: var(--soft); overflow: hidden; }
/* быстрые кнопки «Примерки» (11 ноя): каждая настройка — одна кнопка, нажал — следующий вариант, «‹» — предыдущий.
   Разделы «Текст», «Стиль» и «Следующий» скрыты — их работу делают кнопки */
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 10px 0 2px; }
.quick:empty { display: none; }
#s4.quick-on #fontSec, #s4.quick-on #tuneSec, #s4.quick-on .var-row { display: none !important; }
/* формат, водяной знак, паблик, «Ролик» — тоже кнопками; списки и карточки скрыты (владелец: «та же механика для всех») */
#s4.quick-on #varTabs, #s4.quick-on #varFmts, #s4.quick-on .wm-card, #s4.quick-on .brand-card, #s4.quick-on #clipSec, #s4.quick-on #liveNote { display: none !important; }
/* 12 ноя (владелец: «кнопки топорно выглядят — посимпатичнее»): плитки-«стёкла» со значком, вариант — цветной, нажатая плитка
   вспыхивает, новое значение въезжает снизу */
.qk { display: flex; min-width: 0; border-radius: 16px; overflow: hidden; position: relative;
  background: color-mix(in srgb, var(--card) 86%, transparent); box-shadow: inset 0 0 0 0.5px var(--glass-line), 0 1px 2px rgba(0, 0, 0, 0.06);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); transition: transform 0.16s cubic-bezier(.2, .8, .2, 1); }
.qk:active { transform: scale(0.96); }
.qk-var { background: var(--qk-bg); color: var(--qk-ink); box-shadow: var(--qk-shadow); }
.qk button { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.qk-prev { flex: none; width: 28px; font-size: 20px; line-height: 1; color: var(--muted); }
.qk-var .qk-prev { color: inherit; opacity: 0.7; }
.qk-next { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: baseline; column-gap: 4px; row-gap: 1px; padding: 8px 10px 8px 0; text-align: left; }
/* 19 ноя: подпись и значение — блоком, а не flex: у flex-контейнера многоточие не работает, длинное («Стеклянная карточка»,
   «Водяной знак») резалось посреди буквы без «…»; значок и кружок цвета — в строке текста */
.qk-l { grid-column: 1; grid-row: 1; display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qk-i { display: inline-block; vertical-align: -2px; margin-right: 4px; width: 12px; height: 12px; fill: none; stroke: var(--link); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.qk-i .f { fill: currentColor; stroke: none; }
.qk-var .qk-l { color: inherit; opacity: 0.85; }
.qk-var .qk-i { stroke: #fff; color: #fff; }
.qk-v { grid-column: 1; grid-row: 2; display: block; font-size: 14px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.qk-sw { display: inline-block; vertical-align: 0; margin-right: 5px; width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.45); }
.qk-sw.auto { background: conic-gradient(#ff5e5e, #ffd25e, #5eff8a, #5ec8ff, #b65eff, #ff5e5e) !important; }
.qk-n { grid-column: 2; grid-row: 2; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.qk-var .qk-n { color: inherit; opacity: 0.75; }
.qk-next::after { content: "›"; grid-column: 2; grid-row: 1; justify-self: end; font-size: 15px; color: var(--muted); line-height: 1; }
.qk-var .qk-next::after { color: inherit; opacity: 0.8; }
.qk button:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; border-radius: 16px; }
.qk-hit::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: var(--link); opacity: 0; animation: qk-hit 0.5s ease-out; }
.qk-var.qk-hit::before { background: #fff; }
@keyframes qk-hit { 0% { opacity: 0.22; } 100% { opacity: 0; } }
.qk-pop { animation: qk-pop 0.26s cubic-bezier(.2, .8, .2, 1); }
@keyframes qk-pop { 0% { transform: translateY(6px); opacity: 0.2; } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .qk, .qk-pop, .qk-hit::before { animation: none; transition: none; } .qk:active { transform: none; } }
.qk-reset { grid-column: 1 / -1; border: 0; background: none; color: var(--muted); font: 600 13px var(--font); padding: 8px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 600px) { .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { html:not(.in-tg) #s4 .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } } /* средняя колонка узкая — по две, чтобы значения не обрезались */
/* телефон и планшет: превью высотой ровно с остаток экрана над кнопками (--pvh считает fitPreview) — превью, все кнопки и
   «Выбрать» видны сразу, без прокрутки (на компьютере превью и так слева, кнопки справа) */
@media (max-width: 1099px) {
  #s4.quick-on .card9 canvas { max-height: var(--pvh, min(455px, 46vh)); }
  #s4.quick-on { padding-bottom: 6px; } /* под кнопками — сразу «Выбрать», без пустой полосы */
}
/* телефон: по четыре маленькие кнопки в ряд; «‹» не помещается — шаг назад долгим нажатием */
@media (max-width: 599px) {
  .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 6px 0 0; }
  .qk { border-radius: 12px; }
  .qk-var { grid-column: auto; } /* одна клетка: имя стиля и так видно на превью и на «Выбрать «…»», а превью остаётся крупнее */
  .qk-prev, .qk-n, .qk-next::after { display: none; }
  .qk-next { grid-template-columns: minmax(0, 1fr); padding: 4px 7px; line-height: 1.2; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .qk-l { font-size: 10px; }
  .qk-i { width: 11px; height: 11px; margin-right: 3px; }
  .qk-v { font-size: 12.5px; }
  .qk-sw { width: 9px; height: 9px; margin-right: 4px; }
  .qk-reset { padding: 4px; font-size: 12px; }
  #s4.quick-on .var-tools { padding-bottom: 0; gap: 4px; }
  #s4.quick-on .var-tools .pill.live { padding-block: 4px; min-height: 0; font-size: 12px; }
}
.text-h { width: 100%; border: 0; background: transparent; color: var(--ink); display: flex; align-items: center; gap: 12px; padding: 12px 14px; font: inherit; text-align: left; cursor: pointer; }
.text-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--bg); display: flex; align-items: center; justify-content: center; font: 700 15px var(--font); flex: none; }
.text-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.text-t b { font-size: 15px; font-weight: 600; }
.text-t small { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.text-t small .sw { width: 12px; height: 12px; margin: 0 0 0 4px; flex: none; }
.text-h .chev { transition: transform .2s ease; }
.text-h[aria-expanded="true"] .chev { transform: rotate(90deg); }
.text-body { padding: 0 0 14px 14px; display: flex; flex-direction: column; gap: 8px; animation: fade .2s; }
.text-l { font: 600 12px var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.text-sec .font-strip { margin-right: 0; padding-right: 14px; }
.text-sec .font-tile { background: var(--bg); }
.text-sec .font-tile[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }
.ink-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 14px 2px 2px; scrollbar-width: none; }
.ink-row::-webkit-scrollbar { display: none; }
.ink-dot { flex: none; width: 52px; border: 0; background: none; padding: 0; color: var(--muted); font: 500 11px var(--font); display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.ink-dot i { width: 36px; height: 36px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18), 0 0 0 2px transparent; display: block; position: relative; }
.ink-dot[aria-pressed="true"] { color: var(--ink); }
.ink-dot[aria-pressed="true"] i { box-shadow: inset 0 0 0 1px rgba(0,0,0,.18), 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.ink-dot.auto i { background: conic-gradient(#fff 0 50%, #111214 50% 100%); }
.ink-dot.own i { background: conic-gradient(#ff4d6d, #ffb84d, #f5f05a, #4de38a, #4dc3ff, #8a5cff, #ff4d6d); }
.ink-dot.own input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.bgc-seg { margin-right: 14px; }
.bg-row .ink-dot { width: auto; min-width: 52px; white-space: nowrap; } /* фон (3 ноя): «Как в стиле» — одной строкой */
/* разделы под превью (20 окт): «Текст» — и появление/движение/уход у шрифтовых стилей, «Стиль» — ручки сцены, «Ролик» — формат,
   отрывок, качество, пачка, кнопки, запись текста. Всё сворачивается */
.text-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kit { display: flex; flex-direction: column; gap: 8px; }
.kit[hidden], .font-strip[hidden], .ink-row[hidden], .text-l[hidden] { display: none; }
.kit-g { display: flex; flex-direction: column; gap: 6px; }
.kit .chips, .sec-body .tune-g .chips { flex-wrap: nowrap; overflow-x: auto; padding: 0 14px 2px 0; } /* ряд — вбок, как шрифты: разделы короче */
.kit .chip, .sec-body .tune .chip { background: var(--bg); }
.kit .chip[aria-pressed="true"], .sec-body .tune .chip[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }
.sec-body .tune { padding: 0; }
.sec-body .tune-h { padding: 0 14px 0 0; justify-content: flex-end; }
.sec-body .tune-g { padding: 2px 0; }
.sec-body .tune-g .tlabel { padding: 0; margin-bottom: 6px; font: 600 12px var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sec-body .clip-list { margin: 0 14px 0 0; background: var(--bg); }
.sec-body .script-row { padding-right: 14px; }
.text-body .link-sm { align-self: flex-start; padding: 2px 0; }
.font-strip { display: flex; gap: 8px; overflow-x: auto; margin-right: -20px; padding-right: 20px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.font-strip::-webkit-scrollbar { display: none; }
.font-tile { flex: none; min-width: 92px; border: 0; border-radius: 16px; background: var(--soft); color: var(--ink); padding: 10px 12px 8px; text-align: center; cursor: pointer; }
.font-tile .w { display: block; font-size: 19px; line-height: 26px; white-space: nowrap; }
.font-tile .n { display: block; margin-top: 3px; font: 500 11px var(--font); color: var(--muted); }
.font-tile[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }
.font-tile[aria-pressed="true"] .n { color: inherit; opacity: 0.7; }

/* аудит 15 окт: название в шапке «Примерки» — одной строкой с многоточием; отрывок длиннее трека — неактивен */
.nav h1 { min-width: 0; }
.nav h1 .nt1 { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#lengths button:disabled { opacity: 0.35; }

/* ===== 3 ноя: студия на компьютере — окно от 1100 px (не в Telegram): на весь экран, превью крупно слева, управление справа.
   На телефоне и в Telegram всё как было: обёртки .fit-l («Примерка») и .idea-side («Идея») там «прозрачные» ===== */
.fit-l, .idea-side { display: contents; }
#s4 #nowMood { order: 1; } /* 4 ноя: «Не нравится», «Движение», «Ещё варианты» — сразу под превью и миниатюрами, а не в самом низу */
/* «Текст» вкладками (4 ноя): ряд вкладок, одна видна; плитки эффектов с живым превью; шрифты — сеткой */
.kit-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; padding: 2px 14px 2px 0; } /* 4 ноя: все вкладки видны сразу — переносом, без прокрутки (мышью её не сдвинуть) */
.kit-tabs::-webkit-scrollbar { display: none; }
.kit-tabs[hidden] { display: none; }
.kit-tab { position: relative; flex: none; border: 0; border-radius: 99px; padding: 9px 14px; background: var(--bg); color: var(--ink-2, var(--ink)); font: 600 14px var(--font); cursor: pointer; }
.kit-tab[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }
.kit-tab.set::after { content: ""; position: absolute; top: 6px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent, #6A5CFF); }
.kt-off { display: none !important; }
.text-body.tabbed > .text-l[data-kt="font"] { display: none; }
.text-body.tabbed .kit-g[data-kt="in"] > .text-l, .text-body.tabbed .kit-g[data-kt="mid"] > .text-l, .text-body.tabbed .kit-g[data-kt="out"] > .text-l { display: none; }
.text-body.tabbed .font-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; overflow: visible; margin-right: 14px; padding-right: 0; }
.text-body.tabbed .font-strip[hidden] { display: none; }
.text-body.tabbed .font-tile { min-width: 0; padding: 12px 6px 9px; border-radius: 14px; }
.text-body.tabbed .font-tile .w { font-size: 20px; line-height: 30px; overflow: hidden; text-overflow: clip; }
.text-body.tabbed .font-tile .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-body.tabbed .ink-row { flex-wrap: wrap; overflow: visible; row-gap: 10px; margin-right: 14px; padding-right: 0; } /* цвета и фоны во вкладке — все сразу, без прокрутки */
.text-body.tabbed .kit-weight .chips { flex-wrap: wrap; overflow: visible; row-gap: 6px; padding: 0 14px 2px 0; }
.kit-weight { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.kit-weight .chip { background: var(--bg); }
.kit-weight .chip[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); } /* толщина — все 5 ступеней видны */
.anim-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-right: 14px; }
.anim-tile { min-width: 0; border: 0; border-radius: 14px; background: var(--bg); color: var(--ink); padding: 5px 5px 7px; display: flex; flex-direction: column; align-items: stretch; gap: 6px; cursor: pointer; transition: transform .12s ease; }
.anim-tile:active { transform: scale(.96); }
.anim-tile canvas { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; background: #141418; }
.anim-tile .n { font: 500 12px var(--font); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.anim-tile[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }
.anim-tile[aria-pressed="true"] .n { color: inherit; font-weight: 600; }
@media (min-width: 600px) { .anim-grid, .text-body.tabbed .font-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1100px) {
  html:not(.in-tg) {
    --top: 14px; /* статус-бара телефона нет */
    --padx: max(32px, calc((100vw - 1480px) / 2 + 32px)); /* поля по бокам: контент не шире ~1420 px */
    --rcol: clamp(340px, 30vw, 440px); /* правая колонка с управлением; кнопка внизу — той же ширины */
    --gapx: clamp(28px, 3vw, 48px);
  }
  html:not(.in-tg), html:not(.in-tg) body { background: var(--bg); }
  html:not(.in-tg) .app { width: 100%; height: 100%; max-width: none; margin: 0; border-radius: 0; box-shadow: none; }
  html:not(.in-tg) .nav, html:not(.in-tg) .screen { padding-left: var(--padx); padding-right: var(--padx); }
  html:not(.in-tg) .tabbar { left: calc(50% - 210px); right: calc(50% - 210px); }
  /* шторки — карточкой по центру, а не во всю ширину снизу */
  html:not(.in-tg) .sheet { align-items: center; justify-content: center; }
  html:not(.in-tg) .sheet-card { width: min(560px, 100% - 48px); max-height: 88%; border-radius: 24px; }
  /* кнопка внизу — справа, над правой колонкой */
  html:not(.in-tg) .cta { padding: 10px var(--padx) 20px; align-items: flex-end; }
  html:not(.in-tg) .cta > * { width: var(--rcol); }
  html:not(.in-tg) .cta > .done-edit { align-self: flex-end; }
  html:not(.in-tg) #vCreate:has(#s5:not([hidden])) .cta { align-items: center; }
  html:not(.in-tg) #vCreate:has(#s1:not([hidden]), #sIdea:not([hidden])) .cta { padding-left: max(32px, calc((100% - 1180px) / 2)); padding-right: max(32px, calc((100% - 1180px) / 2)); } /* кнопка — по правому краю колонок */
  /* Студия, проекты, кабинет, готовый ролик — колонкой по центру */
  html:not(.in-tg) .home { padding-left: max(32px, calc((100% - 1180px) / 2)); padding-right: max(32px, calc((100% - 1180px) / 2)); }
  html:not(.in-tg) .tabspace .screen, html:not(.in-tg) #vVideos .nav, html:not(.in-tg) #vProfile .nav, html:not(.in-tg) #s5 { padding-left: max(32px, calc((100% - 760px) / 2)); padding-right: max(32px, calc((100% - 760px) / 2)); }
  html:not(.in-tg) .done-stage { width: min(100%, calc((100vh - 360px) * var(--ar, 0.5625))); }

  /* Новый релиз: обложка с названием слева, трек / текст / обложка / Deezer и галочка прав — справа */
  html:not(.in-tg) #s1 { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-rows: auto auto auto 1fr; column-gap: var(--gapx); row-gap: 14px; align-content: start; padding: 28px max(32px, calc((100% - 1180px) / 2)) 24px; }
  html:not(.in-tg) #s1 > * { grid-column: 2; }
  html:not(.in-tg) #s1 > .hero { grid-column: 1; grid-row: 1 / -1; align-self: start; }
  html:not(.in-tg) #s1 .cover-big { width: min(100%, 400px); max-width: none; }

  /* Идея: заголовок, поле идеи и подсказки слева; отрывок трека и «Вот что я понял» — справа */
  html:not(.in-tg) #sIdea { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: repeat(5, auto) 1fr; column-gap: var(--gapx); row-gap: 18px; align-content: start; padding: 24px max(32px, calc((100% - 1180px) / 2)) 28px; }
  html:not(.in-tg) #sIdea > * { grid-column: 1; }
  html:not(.in-tg) #sIdea > .idea-side { grid-column: 2; grid-row: 2 / -1; display: flex; flex-direction: column; gap: 18px; }

  /* Текст: лента на всю ширину и выше; кнопки под ней — двумя колонками (слева проигрывание и доли, справа правка слова) */
  html:not(.in-tg) #s2 .by-row { flex-direction: row; align-items: center; gap: 16px; }
  html:not(.in-tg) #s2 .by-row .seg { width: 340px; flex: none; }
  html:not(.in-tg) #s2 .by-note { text-align: left; }
  html:not(.in-tg) #s2 .tl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 40px; row-gap: 10px; align-items: start; padding: 10px 12px 12px; }
  html:not(.in-tg) #s2 .tl-box { height: 260px; }
  html:not(.in-tg) #s2 .tl > .tl-wrap { grid-column: 1 / -1; grid-row: 1; }
  html:not(.in-tg) #s2 .tl > .tl-seek { grid-column: 1 / -1; grid-row: 2; }
  html:not(.in-tg) #s2 .tl > .tl-row:not(.tl-add) { grid-column: 1; grid-row: 3; }
  html:not(.in-tg) #s2 .tl > .tl-tools { grid-column: 1; grid-row: 4; }
  html:not(.in-tg) #s2 .tl > .tl-marks-clear { grid-column: 1; grid-row: 5; }
  html:not(.in-tg) #s2 .tl > .tl-add { grid-column: 2; grid-row: 3; }
  html:not(.in-tg) #s2 .tl > .tl-edit-wrap { grid-column: 2; grid-row: 4; }
  html:not(.in-tg) #s2 .tl > .tl-undo { grid-column: 2; grid-row: 5; }
  html:not(.in-tg) #s2 .tl > .tl-hint { grid-column: 1 / -1; grid-row: 6; }

  /* Примерка: слева — превью (липкое, по высоте окна) и миниатюры с кнопками рядом; справа — формат и разделы «Текст», «Стиль», «Ролик».
     --ar (пропорции кадра) ставит app.js; --pw — ширина превью: по высоте окна, но не шире места слева */
  html:not(.in-tg) #s4 {
    --ph: max(380px, calc(100vh - 190px));
    --lw: calc(100vw - 2 * var(--padx) - var(--rcol) - var(--gapx));
    --pwmax: calc(var(--lw) - 24px - 210px);
    --pw: min(calc(var(--ph) * var(--ar, 9 / 16)), var(--pwmax));
    display: grid; grid-template-columns: minmax(0, 1fr) var(--rcol); grid-template-rows: repeat(8, auto) 1fr; column-gap: var(--gapx); row-gap: 14px; align-items: start; padding-top: 8px;
  }
  html:not(.in-tg) #s4 > * { grid-column: 2; }
  html:not(.in-tg) #s4 > .fit-l { grid-column: 1; grid-row: 1 / -1; position: sticky; top: 8px; z-index: 2; display: grid; grid-template-columns: var(--pw) minmax(0, 1fr); grid-template-rows: repeat(4, auto) 1fr; column-gap: 24px; row-gap: 16px; align-content: start; }
  html:not(.in-tg) #s4 .fit-l > * { grid-column: 2; }
  html:not(.in-tg) #s4 .fit-l > .prev-wrap { grid-column: 1; grid-row: 1 / -1; margin: 0; }
  html:not(.in-tg) #s4 .reel { padding: 0; }
  html:not(.in-tg) #s4 .card9 canvas { width: 100%; height: auto; max-height: none; aspect-ratio: var(--ar, 9 / 16); box-shadow: none; } /* тень обрезалась лентой — серые углы под скруглением */
  html:not(.in-tg) #s4 .prev-wrap::after { left: 0; right: 0; }
  html:not(.in-tg) #s4 .prev-badge { left: 14px; }
  html:not(.in-tg) #s4 .prev-over { left: 18px; right: 18px; }
  html:not(.in-tg) #s4 .thumbs { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px 10px; }
  html:not(.in-tg) #s4 .thumb { cursor: pointer; }
  html:not(.in-tg) #s4 .var-tools { padding-bottom: 0; }
  /* ряды шрифтов, кружков цвета и фона, кнопок появления — на компьютере в несколько строк: вбок мышью не листается */
  html:not(.in-tg) #s4 .font-strip, html:not(.in-tg) #s4 .ink-row, html:not(.in-tg) #s4 .kit .chips, html:not(.in-tg) #s4 .sec-body .tune-g .chips { flex-wrap: wrap; overflow: visible; }
  html:not(.in-tg) #s4 .ink-row { row-gap: 8px; }
  /* YouTube (широкий кадр): превью на всю ширину слева, миниатюры — рядом под ним */
  html:not(.in-tg) #s4:has(#varTabs [data-tab="yt"][aria-pressed="true"]) { --ph: max(260px, calc(100vh - 440px)); --pwmax: var(--lw); }
  html:not(.in-tg) #s4:has(#varTabs [data-tab="yt"][aria-pressed="true"]) > .fit-l { grid-template-columns: var(--pw); grid-template-rows: none; justify-content: center; }
  html:not(.in-tg) #s4:has(#varTabs [data-tab="yt"][aria-pressed="true"]) .fit-l > * { grid-column: 1; grid-row: auto; }
  html:not(.in-tg) #s4:has(#varTabs [data-tab="yt"][aria-pressed="true"]) .thumbs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* «Где текст» (5 ноя): 9 мест в кадре — сетка мини-кадров, размер, как идёт текст, шрифт */
.place-sec { margin: 12px 0 4px; border-radius: 20px; background: var(--soft); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.place-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.place-h b { font-size: 15px; font-weight: 600; }
.place-h small { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-row { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.place-grid { --ar: 9 / 16; flex: none; align-self: center; width: 240px; max-width: 100%; aspect-ratio: var(--ar); display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); gap: 3px; padding: 3px; border-radius: 14px; background: var(--bg); }
.place-cell { position: relative; border: 0; padding: 0; border-radius: 9px; background: var(--card-2); cursor: pointer; transition: background .15s, transform .1s; }
.place-cell:active { transform: scale(.94); }
.place-cell i { position: absolute; left: 22%; right: 22%; top: 50%; height: 5px; margin-top: -2.5px; border-radius: 3px; background: var(--muted); opacity: .55; }
.place-cell[data-p$="l"] i { left: 12%; right: 38%; }
.place-cell[data-p$="r"] i { left: 38%; right: 12%; }
.place-cell[aria-pressed="true"] { background: var(--btn); }
.place-cell[aria-pressed="true"] i { background: var(--btn-ink); opacity: 1; }
.place-opts { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.place-opts .text-l { margin-top: 0; }
.place-opts .chips.wrap { flex-wrap: wrap; overflow: visible; padding: 0; row-gap: 6px; }
.place-sec .chip { background: var(--bg); }
.place-sec .chip[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }
/* «Где текст» (5 ноя): своё место — тащить текст пальцем в превью; размер ползунком */
.place-free { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 10px 0 2px; }
.place-free small { color: var(--muted, #9a9aa5); font-size: 12px; text-align: center; }
.place-range { width: 100%; margin: 10px 0 4px; accent-color: var(--btn, #fff); }
.reel.free .card9.sel canvas { touch-action: none; cursor: grab; }
.reel.free .card9.sel canvas:active { cursor: grabbing; }
/* водяной знак (6 ноя): сетка мест под строкой «Водяной знак», знак в превью тащится пальцем */
.wm-box { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 14px 14px; }
.wm-grid { width: 150px; }
.wm-grid .place-cell i { left: 30%; right: 30%; height: 7px; margin-top: -3.5px; border-radius: 4px; }
.wm-grid .place-cell[data-p$="l"] i { left: 10%; right: 50%; }
.wm-grid .place-cell[data-p$="r"] i { left: 50%; right: 10%; }
.wm-grid .place-cell[data-p="free"] { outline: 2px dashed var(--btn); }
.wm-hint { color: var(--muted); font-size: 13px; text-align: center; }
/* водяной знак — своей карточкой над «Роликом» (7 ноя) */
.wm-card { margin: 10px 0; }
/* по одному варианту (7 ноя): миниатюры под превью не нужны */
#thumbs { display: none; }
/* шаблоны пабликов (7 ноя) */
.brand-card { margin: 10px 0; }
.brand-box { padding: 4px 16px 12px; display: grid; gap: 8px; }
.brand-ed { padding: 0 16px 24px; display: grid; gap: 6px; }
.brand-ed .text-l { margin-top: 8px; }
.brand-prev { display: flex; gap: 10px; justify-content: center; align-items: flex-end; margin: 4px 0 6px; }
.brand-prev figure { margin: 0; text-align: center; }
.brand-prev canvas { display: block; height: 220px; width: auto; border-radius: 12px; background: #000; }
.brand-prev figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.brand-row .sw { width: 22px; height: 22px; }
.link-sm.danger { color: #e5484d; justify-self: start; margin-top: 12px; }
/* «Место» — вкладка внутри «Aa Текст» (7 ноя): без своей подложки и заголовка */
#textBody .place-sec { margin: 0; padding: 0; background: none; }
#textBody .place-h { display: none; }
.kit-g > .text-l { display: block; margin: 10px 0 6px; }
/* паблик как проект (7 ноя): оформление паблика и сортировка роликов по пабликам */
.brand-look { display: grid; gap: 8px; }
.vid-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.vid-tabs .chip { flex: none; }
.brand-look .chips { flex-wrap: wrap; overflow: visible; }
/* личный кабинет (9 ноя): строка входа и выход */
.acc-row { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; border: 0; padding: 0; background: none; color: inherit; text-align: left; font: inherit; }
.acc-row div { display: flex; flex-direction: column; gap: 2px; }
.login-err { min-height: 1.2em; margin: 4px 0 0; color: var(--danger); font-size: 14px; }
#loginGo { justify-self: start; margin-top: 4px; }
/* пресеты пабликов на «Новом релизе» (9 ноя) */
.preset-box .chips { flex-wrap: wrap; overflow: visible; padding: 0 16px 12px; row-gap: 6px; }
.preset-box .chip .sw { width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; }

/* «Предварительный просмотр» (12 ноя): кнопка в правом верхнем углу превью; раскрытое превью — слой во весь экран */
.prev-full { position: absolute; top: 14px; right: 34px; z-index: 3; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: rgba(0, 0, 0, 0.32); box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.22); color: #fff; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); -webkit-tap-highlight-color: transparent; transition: transform 0.16s cubic-bezier(.2, .8, .2, 1), background 0.16s; }
.prev-full:active { transform: scale(0.9); background: rgba(0, 0, 0, 0.5); }
.prev-full svg { grid-area: 1 / 1; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.prev-full .i-shut, .pv-full .prev-full .i-open { display: none; }
.pv-full .prev-full .i-shut { display: block; }
.prev-full-t { display: none; }
#s4:not(.quick-on) .prev-full { display: none; }
.prev-wrap.pv-full { position: fixed; inset: 0; z-index: 300; margin: 0 !important; display: flex; align-items: center; justify-content: center; background: #000;
  padding: calc(env(safe-area-inset-top, 0px) + 52px) 0 calc(env(safe-area-inset-bottom, 0px) + 16px); animation: pv-in 0.22s cubic-bezier(.2, .8, .2, 1); }
@keyframes pv-in { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
.pv-full::after { display: none; }
.pv-full .reel { width: 100%; height: 100%; padding: 0 !important; margin: 0 !important; align-items: center; }
.pv-full .card9 { height: 100%; display: flex; align-items: center; justify-content: center; }
html .pv-full .card9 canvas, html #s4.quick-on .pv-full .card9 canvas { width: auto !important; height: auto !important; max-width: 100% !important; max-height: 100% !important; aspect-ratio: var(--ar, 9 / 16); border-radius: 14px; box-shadow: none; }
/* крестик, подпись и полоска — внутри самого слоя (absolute), а не fixed: на компьютере слой сидит в «приклеенной» колонке
   (.fit-l, sticky), и в Safari на Mac вложенный fixed с ней терял крестик — выйти можно было только «Назад» браузера (15 ноя) */
html.pv-full-on #s4 > .fit-l { position: static; z-index: auto; }
.pv-full .prev-full { position: absolute; z-index: 5; top: calc(env(safe-area-inset-top, 0px) + 10px); right: 14px; width: 36px; height: 36px; background: rgba(255, 255, 255, 0.14); }
.pv-full .prev-full-t { display: block; position: absolute; top: calc(env(safe-area-inset-top, 0px) + 18px); left: 60px; right: 60px; text-align: center; color: #fff; font: 600 15px var(--font); z-index: 3; }
.pv-full .prev-badge { display: none; }
.pv-full .prev-over { position: absolute; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); z-index: 3; }
html.pv-full-on, html.pv-full-on body { overflow: hidden; }
html.pv-full-on .cta, html.pv-full-on .tabbar, html.pv-full-on .nav { visibility: hidden; } /* «Выбрать» и шапка — под слоем, не поверх */
@media (prefers-reduced-motion: reduce) { .prev-wrap.pv-full { animation: none; } }

/* ===== 17 ноя: чёрный + лайм (владелец: «черный лайм давай», «нужно все переделать, весь дизайн теперь, чтобы красиво было,
   можно понасыщеннее сделать цвета»). Было (16 ноя): графит + мята #57FFBB. Лайм #C6FF33 — кнопки, выделение, волна лого;
   фон — чистый чёрный без зелени; в светлой теме текст и значки — тёмный насыщенный лайм #3D7A00 (читается на белом),
   крупные заливки — лайм с чёрными буквами. Все цвета — в переменных --brand, --hero-…, --qk-… ===== */
:root {
  --brand: #3d7a00; --brand-2: #2c5900; --brand-ink: #ffffff;
  --qk-bg: linear-gradient(135deg, #d4ff4d, #a8f000); --qk-ink: #0a0a0a; --qk-shadow: 0 6px 18px -6px rgba(140, 220, 0, 0.6);
  --hero-bg: radial-gradient(120% 90% at 15% 0%, #2b3a0c 0%, #141a07 45%, #0a0a0a 100%); --hero-shadow: 0 24px 50px rgba(110, 170, 0, 0.22);
  --hero-scrim: rgba(8, 10, 4, 0.85); --hero-cta: #c6ff33; --hero-cta-ink: #0a0a0a; --hero-img: grayscale(1) brightness(0.75) contrast(1.1); --home-haze: grayscale(1) brightness(1.1); --cover-glow: rgba(120, 190, 0, 0.28);
  --ok: #3d7a00; --warn: #3d7a00; --link: #3d7a00; --accent: #3d7a00;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
    --bg: #0a0a0a; --card: #161616; --card-2: #222222; --line: rgba(255, 255, 255, 0.10); --muted: rgba(255, 255, 255, 0.58);
    --btn: #c6ff33; --btn-ink: #0a0a0a; --accent: #c6ff33; --link: #c6ff33; --ok: #c6ff33; --warn: #c6ff33;
    --nav: rgba(24, 24, 24, 0.82); --glass: rgba(198, 255, 51, 0.06); --glass-line: rgba(198, 255, 51, 0.16); --soft: rgba(198, 255, 51, 0.11);
    --brand: #c6ff33; --brand-2: #a8f000; --brand-ink: #0a0a0a;
    --qk-bg: linear-gradient(135deg, #d4ff4d, #a8f000); --qk-ink: #0a0a0a; --qk-shadow: 0 6px 22px -6px rgba(198, 255, 51, 0.55);
    --hero-bg: radial-gradient(120% 90% at 15% 0%, #2b3a0c 0%, #141a07 45%, #0a0a0a 100%); --hero-shadow: 0 24px 50px rgba(198, 255, 51, 0.14);
    --hero-scrim: rgba(8, 10, 4, 0.85); --hero-cta: #c6ff33; --hero-cta-ink: #0a0a0a; --hero-img: grayscale(1) brightness(0.75) contrast(1.1); --home-haze: grayscale(1) brightness(0.8);
    --cover-glow: rgba(198, 255, 51, 0.2);
} }
:root[data-theme="dark"] {
    --bg: #0a0a0a; --card: #161616; --card-2: #222222; --line: rgba(255, 255, 255, 0.10); --muted: rgba(255, 255, 255, 0.58);
    --btn: #c6ff33; --btn-ink: #0a0a0a; --accent: #c6ff33; --link: #c6ff33; --ok: #c6ff33; --warn: #c6ff33;
    --nav: rgba(24, 24, 24, 0.82); --glass: rgba(198, 255, 51, 0.06); --glass-line: rgba(198, 255, 51, 0.16); --soft: rgba(198, 255, 51, 0.11);
    --brand: #c6ff33; --brand-2: #a8f000; --brand-ink: #0a0a0a;
    --qk-bg: linear-gradient(135deg, #d4ff4d, #a8f000); --qk-ink: #0a0a0a; --qk-shadow: 0 6px 22px -6px rgba(198, 255, 51, 0.55);
    --hero-bg: radial-gradient(120% 90% at 15% 0%, #2b3a0c 0%, #141a07 45%, #0a0a0a 100%); --hero-shadow: 0 24px 50px rgba(198, 255, 51, 0.14);
    --hero-scrim: rgba(8, 10, 4, 0.85); --hero-cta: #c6ff33; --hero-cta-ink: #0a0a0a; --hero-img: grayscale(1) brightness(0.75) contrast(1.1); --home-haze: grayscale(1) brightness(0.8);
    --cover-glow: rgba(198, 255, 51, 0.2);
}
.avatar { background: linear-gradient(135deg, #d4ff4d, #7ccf00); color: #0a0a0a; }

/* ===== 18 ноя: вход в «Субтитры на видео» на главном экране ===== */
.home-tool { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 13px 14px; border-radius: 20px; background: var(--card); color: var(--ink); text-decoration: none; }
.home-tool:active { background: var(--card-2); }
.home-tool-ic { flex: none; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--soft); color: var(--brand); }
.home-tool-ic svg { width: 23px; height: 23px; }
.home-tool-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.home-tool-t b { font-size: 15.5px; font-weight: 700; }
.home-tool-t small { color: var(--muted); font-size: 13px; }
.home-tool .chev { flex: none; width: 18px; height: 18px; color: var(--muted); }
