/* Новый интерфейс AlphaHit (v2) — страницы песни и альбома (templates/v2/song.html, album.html;
 * поведение — static/js/v2/pages.js). Шапка как у стриминговых сервисов: обложка слева, над ней
 * размытая та же обложка, крупное название; ниже строка действий с большой кнопкой «играть».
 * Токены — из app.css; группы .pgroup/.prow и .switch — из profile.css и music.css.
 */
@import url('profile.css');
.pg__hero { position: relative; overflow: hidden; margin: -8px 0 0; padding: 44px 0 28px; }
.pg__bg { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 30%, transparent), transparent); }
.pg__bg img { position: absolute; inset: -20%; width: 140%; height: 140%; object-fit: cover; filter: blur(60px) saturate(1.4); opacity: 0.55; }
.pg__bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, var(--panel)); }
[data-skin="cassette"] .pg__bg::after { background: linear-gradient(180deg, transparent 30%, var(--app)); }
.pg__hero-in { position: relative; display: flex; align-items: flex-end; gap: 28px; }
.pg__cover { flex: none; width: clamp(150px, 20vw, 232px); aspect-ratio: 1; border-radius: var(--r-cover); overflow: hidden; box-shadow: 0 24px 50px -18px rgb(0 0 0 / 0.6); }
.pg__cover img { width: 100%; height: 100%; object-fit: cover; }
.pg__ph { display: grid; place-items: center; width: 100%; height: 100%; background: var(--c, var(--raise)); color: #fff; font: 800 72px/1 var(--f-head); }
.pg__ph .ic { width: 42%; height: 42%; }
.pg__who { min-width: 0; padding-bottom: 4px; }
.pg__title { margin: 0; font: 800 clamp(30px, 5.4vw, 76px)/1.02 var(--f-head); font-stretch: var(--head-stretch); letter-spacing: var(--head-track); overflow-wrap: anywhere; text-wrap: balance; }
.pg__desc { margin: 10px 0 0; max-width: 64ch; color: var(--ink-2); }
.pg__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 14px 0 0; font-size: 14px; color: var(--ink-2); }
.pg__meta > span + span::before, .pg__meta > .pg__author + span::before { content: '•'; margin-right: 14px; opacity: 0.6; }
.pg__author { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.pg__author img { border-radius: 50%; object-fit: cover; }
@media (hover: hover) and (pointer: fine) { a.pg__author:hover b { text-decoration: underline; } }

.pg__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 8px 0 24px; }
.pg__play { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--on-accent); box-shadow: 0 12px 26px -10px var(--accent); transition: transform 120ms ease; touch-action: manipulation; }
.pg__play:active { transform: scale(0.94); }
.pg__play:disabled { opacity: 0.4; box-shadow: none; }
.pg__play .ic { width: 26px; height: 26px; }
@media (hover: hover) and (pointer: fine) { .pg__play:not(:disabled):hover { transform: scale(1.05); } }
.pg__icon { min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; border-radius: 999px; color: var(--ink-2); font-weight: 700; transition: color 150ms ease, background-color 150ms ease; }
.pg__icon .ic { width: 24px; height: 24px; }
@media (hover: hover) and (pointer: fine) { .pg__icon:hover { color: var(--ink); background: var(--raise); } }
.pg__icon[aria-pressed="true"] { color: var(--accent); }
.pg__icon .ic--on, .pg__icon[aria-pressed="true"] .ic--off { display: none; }
.pg__icon[aria-pressed="true"] .ic--on { display: block; }
.pg__icon:disabled { opacity: 0.4; }
.pg__edit { margin-left: auto; }

.pg__cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 28px; align-items: start; margin-bottom: 40px; }
.pg__lyrics .h2 { margin-bottom: 12px; }
.pg__caption { margin: 0 0 14px; padding: 14px 16px; border-radius: var(--r); background: var(--raise); }
.pg__lyrics pre { margin: 0; white-space: pre-wrap; font: 700 clamp(17px, 1.6vw, 21px)/1.6 var(--f); color: var(--ink); }
.pg__inp { width: 100%; min-height: 40px; margin-top: 4px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); color: var(--ink); font: 400 16px var(--f); }

/* Альбом: ручка перетаскивания и строки в движении */
.tr-head--al { grid-template-columns: 32px minmax(0, 4fr) minmax(0, 2fr) 96px 36px; }
.row--drag { grid-template-columns: 28px minmax(0, 1fr) 36px; }
.row__grip { display: grid; align-content: center; gap: 3px; width: 28px; height: 44px; padding: 0 8px; cursor: grab; touch-action: none; opacity: 0.45; }
.row__grip i { display: block; height: 2px; border-radius: 1px; background: var(--ink); }
@media (hover: hover) and (pointer: fine) { .row--drag:hover .row__grip { opacity: 1; } }
.row.is-drag { position: relative; z-index: 2; background: var(--raise); box-shadow: var(--shadow); cursor: grabbing; }
.row.is-moving { transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1); }

/* Окно «Добавить песни» */
.addbox { display: grid; gap: 12px; }
.addbox .lib__search { max-width: none; }
.addbox__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 50vh; overflow-y: auto; overscroll-behavior: contain; }
.addbox__list .muted { padding: 12px 4px; }
.addbox__row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; text-align: left; }
.addbox__row img, .addbox__row .tr__ph { flex: none; width: 40px; height: 40px; border-radius: 4px; object-fit: cover; }
.addbox__row span { flex: 1; min-width: 0; display: grid; }
.addbox__row b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addbox__row small { color: var(--ink-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addbox__row em { flex: none; font-style: normal; font-size: 13px; font-weight: 800; color: var(--accent); }
.addbox__row:disabled em { color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .addbox__row:not(:disabled):hover { background: var(--raise); } }

@media (max-width: 900px) {
  .pg__hero { padding: 24px 0 16px; }
  .pg__hero-in { flex-direction: column; align-items: flex-start; gap: 18px; }
  .pg__cover { width: min(62vw, 260px); align-self: center; }
  .pg__cols { grid-template-columns: minmax(0, 1fr); }
  .pg__edit { margin-left: 0; }
  .row--drag .tr { grid-template-columns: minmax(0, 1fr); }
}
.tr-head--grip { padding-left: 40px; }   /* место под ручку перетаскивания в своём альбоме */

/* ── Радио (templates/v2/radio.html) ── */
.radio__h1 { margin: 12px 0 6px; }
.radio__cover { position: relative; }
.radio__cover img { position: absolute; inset: 0; }
.radio__live { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #d02f1b; color: #fff; font-size: 12px; font-weight: 800; }
.radio__live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: live 1.4s ease-in-out infinite; }
@keyframes live { 50% { opacity: 0.25; } }
.radio__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.rst { position: relative; display: grid; align-content: start; gap: 6px; min-height: 132px; padding: 18px 110px 18px 18px; border-radius: calc(var(--r) + 6px); overflow: hidden; background: var(--c); color: #fff;
  transition: transform 150ms ease, box-shadow 150ms ease; }
.rst:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .rst:hover { box-shadow: 0 14px 30px -14px rgb(0 0 0 / 0.5); } .rst:hover .rst__play { opacity: 1; transform: none; } }
.rst__name { font: 800 22px/1.1 var(--f-head); font-stretch: var(--head-stretch); }
.rst__now { font-size: 13px; opacity: 0.85; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rst__art { position: absolute; right: -10px; bottom: -10px; width: 110px; height: 110px; transform: rotate(14deg); border-radius: 8px; overflow: hidden; box-shadow: 0 8px 20px rgb(0 0 0 / 0.35); }
.rst__art:empty { display: none; }
.rst__art img { width: 100%; height: 100%; object-fit: cover; }
.rst__play { position: absolute; left: 18px; bottom: 16px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: #111; opacity: 0; transform: translateY(6px); transition: opacity 180ms ease, transform 180ms ease; }
.rst__play .ic { width: 18px; height: 18px; }
@media (hover: none) { .rst__play { opacity: 1; transform: none; } }
.rst.is-cur { box-shadow: inset 0 0 0 3px #fff; }
.rst.is-on .rst__play { opacity: 1; transform: none; background: var(--accent); color: var(--on-accent); }
@media (prefers-reduced-motion: reduce) { .radio__live::before { animation: none; } }

/* ── Топ песен (templates/v2/top.html) ── */
.top__head { padding: 16px 0 8px; }
/* Поток треков: пояснение под заголовком (templates/v2/feed.html) */
.feed__note { max-width: 64ch; margin: 6px 0 12px; font-size: 14px; }
.feed__note a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.top__tabs { margin: 16px 0 8px; }
.podium { list-style: none; margin: 16px 0 24px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.podium__c { position: relative; width: 100%; display: grid; gap: 6px; padding: 14px; border-radius: calc(var(--r) + 6px); background: var(--raise); text-align: left; transition: background-color 180ms ease; }
@media (hover: hover) and (pointer: fine) { .podium__c:hover { background: var(--hover); } .podium__c:hover .card__play { opacity: 1; transform: none; } }
.podium__c[aria-pressed="true"] .card__play { opacity: 1; transform: none; }
.podium__n { position: absolute; top: 4px; left: 12px; z-index: 2; font: 800 64px/1 var(--f-head); font-stretch: var(--head-stretch); color: #fff; text-shadow: 0 4px 18px rgb(0 0 0 / 0.55); }
.podium__c--1 .podium__n { color: #ffd166; }
.podium__art { position: relative; display: block; aspect-ratio: 1; margin-bottom: 6px; border-radius: var(--r-cover); overflow: hidden; box-shadow: var(--shadow); }
.podium__art img, .podium__art .card__ph { width: 100%; height: 100%; object-fit: cover; display: grid; }
.podium__c b { font: 800 18px/1.2 var(--f-title); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.podium__c small { color: var(--ink-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium__stat { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.podium__stat .ic { width: 14px; height: 14px; }
.podium__stat .ic + .ic, .podium__stat .ic:nth-of-type(2) { margin-left: 8px; }
@media (max-width: 700px) {
  .podium { grid-template-columns: 1fr 1fr; gap: 10px; }
  .podium > li:first-child { grid-column: 1 / -1; }
  .podium__n { font-size: 48px; }
}

/* «Песня создаётся» (templates/v2/generating.html, GeneratingPage): карточка хода с эквалайзером и полосой */
.gen { padding-top: 24px; padding-bottom: 40px; }
.gen__card { display: grid; justify-items: center; gap: 10px; max-width: 620px; margin: 0 auto 28px; padding: 32px 24px; text-align: center;
  border-radius: calc(var(--r) + 8px); background: var(--raise); }
.gen__title { margin: 0; }
.gen__text { margin: 0; min-height: 1.4em; }
.gen__note { margin: 4px 0 0; font-size: 13px; max-width: 460px; }
.gen__bar { width: 100%; max-width: 420px; height: 6px; border-radius: 3px; overflow: hidden; background: color-mix(in srgb, var(--ink) 12%, transparent); }
.gen__bar i { display: block; height: 100%; background: var(--accent); transform: scaleX(0.03); transform-origin: left; transition: transform 600ms ease-out; }
.gen__eq { display: flex; align-items: flex-end; gap: 5px; height: 40px; }
.gen__eq i { width: 6px; height: 100%; border-radius: 3px; background: var(--accent); transform-origin: bottom; animation: gen-eq 1s ease-in-out infinite; }
.gen__eq i:nth-child(2) { animation-delay: -0.2s; } .gen__eq i:nth-child(3) { animation-delay: -0.4s; }
.gen__eq i:nth-child(4) { animation-delay: -0.6s; } .gen__eq i:nth-child(5) { animation-delay: -0.8s; }
@keyframes gen-eq { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
.gen__card[data-gen-state="done"] .gen__eq, .gen__card[data-gen-state="fail"] .gen__eq { display: none; }
.gen__card[data-gen-state="fail"] .gen__bar { display: none; }
.gen__acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 20px 0; }
.gen__acts[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .gen__eq i { animation: none; transform: scaleY(0.7); } .gen__bar i { transition: none; } }

/* «Авторы» (templates/v2/authors.html): ряд авторов с лайками — прокручивается вбок, как полка */
.au-row { list-style: none; margin: 8px 0 24px; padding: 4px 2px 8px; display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; }
.au-row::-webkit-scrollbar { display: none; }
.au { display: grid; justify-items: center; gap: 4px; width: 104px; text-align: center; color: var(--ink); }
.au__av { width: 72px; height: 72px; font-size: 26px; }
.au b { font-size: 13px; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au small { font-size: 12px; color: var(--ink-2); }

/* ── Страница «Приложение AlphaHit» (templates/v2/app.html, адрес /app): значок, карточки платформ, подсказки ── */
.appdl { padding-top: 28px; padding-bottom: 40px; }
.appdl__head { display: flex; align-items: center; gap: 22px; margin-bottom: 28px; }
.appdl__icon { flex: none; width: 112px; height: 112px; border-radius: 24px; box-shadow: 0 18px 36px -18px rgb(0 0 0 / 0.55); }
.appdl__head .h1 { margin: 0; }
.appdl__lead { margin: 8px 0 0; max-width: 60ch; }
.appdl__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.appdl__card { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--r); background: var(--raise); }
.appdl__card.is-mine { grid-column: 1 / -1; box-shadow: inset 0 0 0 2px var(--accent); }
.appdl__mine { display: none; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }
.appdl__card.is-mine .appdl__mine { display: block; }
.appdl__name { font: 800 20px/1.2 var(--f-head); font-stretch: var(--head-stretch); }
.appdl__go { align-self: flex-start; margin-top: 12px; }
.appdl__help { margin-top: 36px; }
.appdl__help dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 12px 0 0; max-width: 80ch; }
.appdl__help dt { font-weight: 800; }
.appdl__help dd { margin: 0; color: var(--ink-2); }
@media (max-width: 560px) {
  .appdl__head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .appdl__icon { width: 84px; height: 84px; border-radius: 19px; }
  .appdl__help dl { grid-template-columns: 1fr; gap: 2px; }
  .appdl__help dd { margin-bottom: 10px; }
}

/* Полоска «Приложение AlphaHit» внизу Главной (templates/v2/home.html) — ведёт на /download */
.appstrip { display: flex; align-items: center; gap: 16px; margin: 36px 0 8px; padding: 16px 18px; border-radius: var(--r); background: var(--raise); color: var(--ink); }
.appstrip img { flex: none; width: 52px; height: 52px; border-radius: 12px; }
.appstrip__t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.appstrip small { color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .appstrip:hover { background: var(--hover); } }
@media (max-width: 560px) { .appstrip .btn { display: none; } }
.appdl__cli { margin-top: 36px; }
.appdl__cli p { margin: 8px 0 12px; max-width: 70ch; }
.appdl__cmd { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: var(--r); background: var(--raise); max-width: 640px; }
.appdl__cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font: 600 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.appdl__alts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.appdl__alts .appdl__go { margin-top: 0; }
.appdl__hint { margin-top: 8px; font-size: 12px; }
.appdl__cmd--multi { align-items: flex-start; max-width: 900px; }
.appdl__cmd--multi code { white-space: pre; }

/* ── «Добавить песню из Suno» (templates/v2/suno_import.html, SunoImportPage) ── */
.simp { max-width: 760px; padding-top: 20px; padding-bottom: 48px; }
.simp__lead { margin: 8px 0 22px; max-width: 62ch; }
.simp__find { display: flex; gap: 10px; }
.simp__field { flex: 1; min-width: 0; }
.simp__field input { width: 100%; min-height: 48px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--field); color: var(--ink); font: inherit; }
.simp__err { margin: 12px 0 0; color: #e5484d; font-weight: 600; }
.simp__card { margin-top: 22px; padding: 20px; border-radius: var(--r); background: var(--raise); }
.simp__song { display: flex; gap: 16px; align-items: center; }
.simp__song img { flex: none; width: 96px; height: 96px; border-radius: var(--r-cover); object-fit: cover; background: var(--hover); }
.simp__song b { display: block; font: 800 22px/1.2 var(--f-head); font-stretch: var(--head-stretch); }
.simp__steps { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 14px; }
.simp__steps li { display: flex; gap: 12px; align-items: flex-start; }
.simp__steps small { display: block; margin-top: 4px; line-height: 1.45; }
.simp__steps code { padding: 2px 8px; border-radius: 6px; background: var(--panel); font: 800 16px ui-monospace, Menlo, monospace; letter-spacing: .06em; }
.simp__mark { flex: none; display: grid; place-items: center; width: 30px; height: 30px; margin-top: -2px; border-radius: 50%; border: 2px solid var(--ink-2);
  background: transparent; color: var(--ink); font-weight: 800; font-size: 14px; cursor: pointer; padding: 0; }
.simp__mark .ic { display: none; width: 18px; height: 18px; }
.simp__steps li.is-ok .simp__mark { border-color: #1a9f5b; background: #1a9f5b; color: #fff; }
.simp__steps li.is-ok .simp__mark span { display: none; }
.simp__steps li.is-ok .simp__mark .ic { display: block; }
.simp__acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.simp__note { margin: 14px 0 0; font-size: 13px; }
.simp__done { margin-top: 22px; padding: 24px; border-radius: var(--r); background: var(--raise); display: grid; gap: 8px; justify-items: start; }
.simp__done b { font: 800 22px/1.2 var(--f-head); }
@media (max-width: 560px) { .simp__find { flex-direction: column; } .simp__song img { width: 72px; height: 72px; } }
.libp__acts { display: flex; gap: 8px; flex-wrap: wrap; }
.simp__pick { margin-top: 10px; cursor: pointer; }
.simp__prog { align-self: center; font-size: 14px; }
.simp__acts .btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.simp__warn { margin-top: 6px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, #f5a623 18%, transparent); border: 1px solid #f5a623; font-size: 14px; }
.simp__warn p { margin: 4px 0 0; }
.simp__drop { display: grid; justify-items: center; gap: 6px; padding: 30px 20px; border: 2px dashed var(--ink-2); border-radius: var(--r); text-align: center; cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease; }
.simp__drop .ic { width: 34px; height: 34px; color: var(--accent); }
.simp__drop b { font-size: 17px; overflow-wrap: anywhere; }
.simp__drop.is-over, .simp__drop:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.simp__drop.is-ok { border-style: solid; border-color: #1a9f5b; }
.simp__alt { margin-top: 14px; }
.simp__alt summary { cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.simp__alt .simp__find { margin-top: 10px; }
.simp__match { margin: 14px 0 0; font-weight: 600; color: #1a9f5b; }
.simp__list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.simp__row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--raise); }
.simp__row img, .simp__ph { flex: none; width: 56px; height: 56px; border-radius: var(--r-cover); object-fit: cover; background: var(--hover); display: grid; place-items: center; color: var(--ink-2); }
.simp__rt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.simp__rt b { overflow-wrap: anywhere; }
.simp__st { font-weight: 600; }
.simp__st--ok { color: #1a9f5b; } .simp__st--err { color: #e5484d; } .simp__st--warn { color: #c77700; }
.simp__find--row { margin-top: 6px; } .simp__find--row input { flex: 1; min-width: 0; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--field); color: var(--ink); font: inherit; }
.simp__x { flex: none; }
.simp__row[data-state="added"] { box-shadow: inset 3px 0 0 #1a9f5b; } .simp__row[data-state="failed"], .simp__row[data-state="bad"] { box-shadow: inset 3px 0 0 #e5484d; }
.simp > .simp__acts { margin-top: 16px; }
.simp__retry { justify-self: start; margin-top: 6px; }

/* ═══ Правовые документы AlphaHit (templates/v2/legal.html, blueprints/legal.AlphaHitLegal) ═══
   Режим чтения: на компьютере — оглавление слева (липнет), документ справа строкой до 72 знаков;
   на телефоне — оглавление строкой-лентой сверху, документ ниже. */
.legal { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 40px; padding-top: 24px; padding-bottom: 56px; }
.legal__toc { position: sticky; top: 84px; align-self: start; display: grid; gap: 4px; }
.legal__toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.legal__toc a { display: block; padding: 8px 12px; border-radius: 10px; color: var(--ink-2); font-size: 14px; line-height: 1.3; text-decoration: none; }
.legal__toc a:hover { color: var(--ink); background: var(--hover); }
.legal__toc a.is-on { color: var(--ink); background: var(--raise); font-weight: 700; }
.legal__home { font-weight: 800; color: var(--ink) !important; }
.legal__main { min-width: 0; max-width: 72ch; }
.legal__lead { margin: 10px 0 24px; line-height: 1.55; }
.legal__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.legal__list a { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r); background: var(--raise); color: var(--ink); text-decoration: none; }
.legal__list a:hover { background: var(--hover); }
.legal__list b { grid-column: 1; font-size: 16px; }
.legal__list span { grid-column: 1; font-size: 13px; margin-top: 2px; }
.legal__list .ic { grid-column: 2; grid-row: 1 / span 2; width: 16px; height: 16px; color: var(--ink-2); }
.legal__doc { font-size: 15px; line-height: 1.65; color: var(--ink); overflow-wrap: anywhere; }
.legal__doc h1 { font-family: var(--font-head, inherit); font-size: clamp(26px, 4vw, 36px); line-height: 1.15; margin: 0 0 8px; }
.legal__doc h2 { font-size: 20px; line-height: 1.3; margin: 32px 0 8px; }
.legal__doc h3 { font-size: 16px; margin: 20px 0 6px; }
.legal__doc p { margin: 0 0 10px; }
.legal__doc ul { margin: 0 0 12px; padding-left: 22px; }
.legal__doc li { margin: 4px 0; }
.legal__doc hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.legal__owner { margin-top: 40px; padding: 18px 20px; border-radius: var(--r); background: var(--raise); font-size: 14px; line-height: 1.6; }
.legal__owner h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); margin: 0 0 8px; }
.legal__owner p { margin: 0 0 6px; }
.legal__owner a { color: var(--accent); }
@media (max-width: 900px) {
  .legal { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 12px; }
  .legal__toc { position: static; }
  .legal__toc ol { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .legal__toc li { flex: none; }
  .legal__toc ol a { background: var(--raise); border-radius: 999px; white-space: nowrap; font-size: 13px; }
  .legal__home { padding-left: 0 !important; }
}

/* ═══ Раздел «Жалобы» (templates/v2/complaints.html, ComplaintsPage в js/v2/complaints.js) ═══ */
.cmpl { max-width: 760px; padding-top: 20px; padding-bottom: 56px; }
.cmpl__lead { margin: 8px 0 22px; line-height: 1.55; }
.cmpl__lead a, .cmpl__fine a { color: var(--accent); }
.cmpl__form { display: grid; gap: 16px; padding: 20px; border-radius: calc(var(--r) + 4px); background: var(--raise); }
.cmpl__form fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.cmpl__form legend { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.cmpl__target { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r); background: var(--app); }
.cmpl__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cmpl__chip input, .cmpl__reason input { position: absolute; opacity: 0; pointer-events: none; }
.cmpl__chip span { display: inline-block; padding: 8px 14px; border-radius: 999px; background: var(--app); font-weight: 700; font-size: 14px; cursor: pointer; }
.cmpl__chip input:checked + span { background: var(--ink); color: var(--app); }
.cmpl__chip input:focus-visible + span, .cmpl__reason input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.cmpl__reasons { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cmpl__reason span { display: block; padding: 10px 12px; border-radius: var(--r); background: var(--app); font-size: 14px; line-height: 1.35; cursor: pointer; border: 2px solid transparent; }
.cmpl__reason input:checked + span { border-color: var(--accent); font-weight: 700; }
.cmpl__who { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmpl__fine { margin: 0; font-size: 12px; }
.cmpl__form .btn--main { justify-self: start; }
.cmpl__mine { margin-top: 36px; }
.cmpl__list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.cmpl__item { padding: 14px 16px; border-radius: var(--r); background: var(--raise); display: grid; gap: 4px; overflow-wrap: anywhere; }
.cmpl__item p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; }
.cmpl__row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.cmpl__st { flex: none; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--app); }
.cmpl__item--done .cmpl__st { background: color-mix(in srgb, #16a34a 18%, transparent); color: #16a34a; }
.cmpl__item--rejected .cmpl__st { color: var(--ink-2); }
.cmpl__ans { padding: 10px 12px; border-radius: 10px; background: var(--app); display: grid; gap: 2px; }
@media (max-width: 560px) { .cmpl__who { grid-template-columns: 1fr; } .cmpl__form { padding: 16px; } .cmpl__form .btn--main { justify-self: stretch; } }

/* Снимки магазина листаются внутри галереи: на телефоне страница не становится шире экрана. */
.appdl__screens { margin-top: 40px; min-width: 0; }
.appdl__screens h3 { margin: 24px 0 12px; }
.appdl__gallery { display: flex; gap: 16px; overflow-x: auto; padding: 4px 4px 16px; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.appdl__gallery a { flex: 0 0 auto; scroll-snap-align: start; }
.appdl__gallery img { display: block; width: auto; height: 400px; border-radius: 18px; }
.appdl__gallery--tablet img { height: 280px; }
@media (max-width: 600px) {
  .appdl__gallery img { height: 340px; }
  .appdl__gallery--tablet img { height: auto; width: min(78vw, 480px); }
}

/* Вкладки разделяют приложения с разными проектами и каналами обновлений. */
.appdl__tabs { display: flex; gap: 8px; margin: 0 0 28px; }
.appdl__tabs a { padding: 10px 24px; border: 1px solid var(--line); border-radius: 999px; font-weight: 700; }
.appdl__tabs a[aria-current="page"] { background: var(--ink); color: var(--app); }
