/* ===== /song: редизайн формы (16.09.2026).
   Компактный кастомный селект стиля (порт il-select с /image, без иконок), liquid-капсула вокала,
   плавное схлопывание блока текста, модалка «Написать текст с ИИ», меню шестерёнки (формат файла).
   Всё локально для страницы песен; общих модулей не заводим (решение владельца). ===== */

/* ---------- заголовки-строки с кнопками справа ---------- */
.sg-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.sg-row-head > label { margin: 0; }

/* ---------- компактный селект стиля ---------- */
#song-form select#preset-select { display: none; }

.sg-select { position: relative; display: inline-block; max-width: 100%; }

.sg-select-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 190px;
    border: 1px solid rgba(18, 38, 63, 0.10);
    border-radius: .85rem;
    background: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 2px 12px rgba(18, 38, 63, 0.10);
    padding: 7px 12px;
    font-size: 14px;
    line-height: 1.3;
    color: #1f2937;
    cursor: pointer;
    text-align: left;
    transition: border-color .2s ease, box-shadow .25s ease;
}
.sg-select-btn:hover { border-color: rgba(13, 110, 253, 0.35); }
.sg-select.open .sg-select-btn,
.sg-select-btn:focus-visible {
    border-color: #0d6efd;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12);
    outline: none;
}
.sg-select-current {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sg-select-caret {
    flex-shrink: 0;
    color: #6b7280;
    font-size: 11px;
    transition: transform .3s cubic-bezier(.22, 1, .36, 1);
}
.sg-select.open .sg-select-caret { transform: rotate(180deg); }

.sg-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    min-width: 100%;
    width: max-content;
    max-width: min(300px, calc(100vw - 32px));
    border-radius: .85rem;
    background: rgba(255, 255, 255, 0.99);
    -webkit-backdrop-filter: saturate(150%) blur(20px);
    backdrop-filter: saturate(150%) blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 18px 48px rgba(18, 38, 63, 0.12);
    padding: 5px;
    max-height: 320px;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-6px) scale(.985);
    transition: opacity .25s ease, transform .3s cubic-bezier(.22, 1, .36, 1);
    pointer-events: none;
}
.sg-select-menu.align-right { left: auto; right: 0; }
.sg-select.open .sg-select-menu { opacity: 1; transform: none; pointer-events: auto; }

.sg-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: none;
    border-radius: calc(.85rem - 5px);
    padding: 6px 10px;
    font-size: 13.5px;
    color: #1f2937;
    cursor: pointer;
    text-align: left;
    transition: background .15s ease;
}
.sg-option:hover { background: rgba(13, 110, 253, 0.10); }
.sg-option-label { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-option-check {
    flex-shrink: 0;
    margin-left: auto;
    font-size: 11px;
    color: #0d6efd;
    opacity: 0;
    transform: scale(.6);
    transition: opacity .2s ease, transform .25s cubic-bezier(.22, 1, .36, 1);
}
.sg-option.is-selected { background: rgba(13, 110, 253, 0.12); font-weight: 600; }
.sg-option.is-selected .sg-option-check { opacity: 1; transform: scale(1); }
.sg-option.is-locked { color: #9ca3af; }
.sg-option-lock { flex-shrink: 0; margin-left: auto; font-size: 11px; color: #9ca3af; }
.sg-sep { height: 1px; margin: 4px 8px; background: rgba(18, 38, 63, 0.10); }
.sg-menu-title {
    padding: 6px 10px 2px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #6b7280;
}

/* ---------- шестерёнка (формат файла) ---------- */
.sg-gear {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(18, 38, 63, 0.10);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.78);
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease, transform .4s cubic-bezier(.22, 1, .36, 1), box-shadow .25s ease;
}
.sg-gear:hover { color: #0d6efd; border-color: rgba(13, 110, 253, 0.35); }
.sg-select.open .sg-gear { color: #0d6efd; transform: rotate(60deg); box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12); }
.sg-gear-hint { font-size: 10.5px; color: #6b7280; padding: 0 10px 6px; text-align: right; }

/* ---------- капсула вокала ---------- */
.sg-seg {
    position: relative;
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, auto);
    gap: 2px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(18, 38, 63, 0.035);          /* светло-серый (было 0.06) */
    max-width: 100%;
}
.sg-seg-thumb {
    position: absolute;
    top: 4px;
    left: 0;
    height: calc(100% - 8px);
    width: 0;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(18, 38, 63, 0.12), 0 0 0 1px rgba(13, 110, 253, 0.10);
    transition: transform .38s cubic-bezier(.22, 1, .36, 1), width .38s cubic-bezier(.22, 1, .36, 1);
    pointer-events: none;
    opacity: 0;
}
.sg-seg.is-ready .sg-seg-thumb { opacity: 1; }
.sg-seg .btn-check { position: absolute; opacity: 0; pointer-events: none; }
.sg-seg-opt {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: color .3s ease;
}
.sg-seg-opt:hover { color: #1f2937; }
.sg-seg .btn-check:checked + .sg-seg-opt { color: #0d6efd; }
.sg-seg .btn-check:focus-visible + .sg-seg-opt { outline: 2px solid rgba(13, 110, 253, .4); outline-offset: 2px; }

@media (max-width: 575.98px) {
    .sg-seg { grid-auto-flow: row; grid-template-columns: 1fr 1fr; width: 100%; border-radius: 14px; }
    .sg-seg-thumb, .sg-seg-opt { border-radius: 10px; }
    .sg-seg-opt { text-align: center; padding: 8px 10px; font-size: 13.5px; }
}

/* ---------- плавное схлопывание блока текста ---------- */
.sg-collapse {
    display: grid;
    grid-template-rows: 1fr;
    opacity: 1;
    transition: grid-template-rows .45s cubic-bezier(.22, 1, .36, 1), opacity .3s ease .1s, margin .45s cubic-bezier(.22, 1, .36, 1);
}
.sg-collapse > .sg-collapse-inner { min-height: 0; }
/* overflow режем только во время анимации и в схлопнутом виде — иначе тени кнопок обрезаются */
.sg-collapse.is-collapsed > .sg-collapse-inner,
.sg-collapse.is-animating > .sg-collapse-inner { overflow: hidden; }
.sg-collapse.is-collapsed {
    grid-template-rows: 0fr;
    opacity: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    pointer-events: none;
    transition: grid-template-rows .45s cubic-bezier(.22, 1, .36, 1), opacity .2s ease, margin .45s cubic-bezier(.22, 1, .36, 1);
}
/* внутренний паддинг схлопывается вместе с блоком — иначе остаётся полоска */
.sg-collapse.is-collapsed > .sg-collapse-inner > * { margin-bottom: 0; }

/* ---------- кнопка «Написать текст с ИИ» ---------- */
.sg-ai-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    border: 1px solid rgba(13, 110, 253, 0.35);
    background: rgba(13, 110, 253, 0.06);
    color: #0d6efd;
    cursor: pointer;
    transition: background .2s ease, box-shadow .25s ease, transform .25s ease;
    white-space: nowrap;
}
.sg-ai-btn:hover { background: rgba(13, 110, 253, 0.12); box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.10); }
.sg-ai-btn:active { transform: scale(.97); }
.sg-ai-btn:disabled { opacity: .55; cursor: default; box-shadow: none; }

/* ---------- модалка «Написать текст с ИИ» ---------- */
.sg-modal {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.sg-modal[hidden] { display: none; }
.sg-modal-backdrop {
    position: absolute;
    inset: -2px;
    background: rgba(15, 23, 42, .45);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: sg-fade-in .25s ease;
}
.sg-modal-card {
    position: relative;
    width: min(560px, 96vw);
    max-height: 92vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 18px;
    box-shadow: 0 18px 48px rgba(18, 38, 63, 0.14);
    padding: 20px 20px 18px;
    animation: sg-pop-in .38s cubic-bezier(.22, 1, .36, 1);
}
.sg-modal.is-closing .sg-modal-backdrop { animation: sg-fade-out .25s ease forwards; }
.sg-modal.is-closing .sg-modal-card { animation: sg-pop-out .28s cubic-bezier(.4, 0, 1, 1) forwards; }
.sg-modal-x {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(17, 24, 39, .08);
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
    z-index: 2;
}
.sg-modal-x:hover { background: rgba(17, 24, 39, .16); }
.sg-modal-title { font-weight: 700; font-size: 1.08rem; color: #1f2937; padding-right: 36px; }
.sg-modal-sub { font-size: 13.5px; color: #6b7280; margin: 4px 0 12px; }
.sg-modal-taw { position: relative; }
.sg-modal textarea {
    width: 100%;
    border: 1px solid rgba(18, 38, 63, 0.12);
    border-radius: 12px;
    padding: 10px 12px 26px;
    font-size: 14.5px;
    color: #1f2937;
    min-height: 120px;
    resize: vertical;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.sg-modal textarea:focus { border-color: #0d6efd; box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12); }
.sg-modal-count { position: absolute; right: 12px; bottom: 10px; font-size: 12px; color: #6b7280; pointer-events: none; }
.sg-modal-hint { font-size: 12.5px; color: #6b7280; min-height: 18px; margin: 6px 0 10px; }
.sg-modal-hint.is-error { color: #dc3545; }
.sg-modal-go { width: 100%; }

@keyframes sg-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sg-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes sg-pop-in { from { opacity: 0; transform: translateY(22px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes sg-pop-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ---------- прогресс: плавный бар (rt-bar из notice.js), без ступенек ---------- */
#ping_data .rt-bar-fill { transition: width .35s linear; }

/* ---------- тёмная тема ---------- */
[data-bs-theme="dark"] .sg-select-btn,
[data-bs-theme="dark"] .sg-gear {
    background: var(--rt-glass-bg);
    border-color: var(--rt-border);
    color: var(--rt-text);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .4);
}
[data-bs-theme="dark"] .sg-select-btn:hover,
[data-bs-theme="dark"] .sg-gear:hover { border-color: var(--rt-accent); color: var(--rt-accent); }
[data-bs-theme="dark"] .sg-select.open .sg-select-btn,
[data-bs-theme="dark"] .sg-select-btn:focus-visible {
    border-color: var(--rt-accent);
    box-shadow: 0 0 0 4px rgba(91, 157, 255, .18);
}
[data-bs-theme="dark"] .sg-select-caret { color: var(--rt-muted); }
[data-bs-theme="dark"] .sg-select-menu {
    background: rgba(31, 36, 45, 0.985);
    border-color: var(--rt-border);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .55);
}
[data-bs-theme="dark"] .sg-option { color: var(--rt-text); }
[data-bs-theme="dark"] .sg-option:hover { background: var(--rt-glass-item-hover); }
[data-bs-theme="dark"] .sg-option-check { color: var(--rt-accent); }
[data-bs-theme="dark"] .sg-option.is-selected { background: var(--rt-glass-item-hover); }
[data-bs-theme="dark"] .sg-option.is-locked,
[data-bs-theme="dark"] .sg-option-lock,
[data-bs-theme="dark"] .sg-menu-title,
[data-bs-theme="dark"] .sg-gear-hint { color: var(--rt-muted); }
[data-bs-theme="dark"] .sg-sep { background: var(--rt-border); }
[data-bs-theme="dark"] .sg-seg { background: rgba(255, 255, 255, .05); }
[data-bs-theme="dark"] .sg-seg-thumb { background: var(--rt-acc-surface); box-shadow: inset 0 0 0 1px var(--rt-acc-border); }
[data-bs-theme="dark"] .sg-seg-opt { color: var(--rt-muted); }
[data-bs-theme="dark"] .sg-seg .btn-check:checked + .sg-seg-opt { color: var(--rt-text); }
[data-bs-theme="dark"] .sg-ai-btn { background: rgba(91, 157, 255, .10); border-color: var(--rt-acc-border); color: var(--rt-accent); }
[data-bs-theme="dark"] .sg-modal-card { background: var(--rt-elevated); border-color: var(--rt-border); }
[data-bs-theme="dark"] .sg-modal-title { color: var(--rt-text); }
[data-bs-theme="dark"] .sg-modal-sub, [data-bs-theme="dark"] .sg-modal-hint, [data-bs-theme="dark"] .sg-modal-count { color: var(--rt-muted); }
[data-bs-theme="dark"] .sg-modal textarea { background: var(--rt-surface); border-color: var(--rt-border); color: var(--rt-text); }
[data-bs-theme="dark"] .sg-modal-x { background: rgba(255, 255, 255, .08); color: var(--rt-text); }

/* ---------- пилл модели перед h1 (вместо эмодзи): градиент как у кнопки PRO ---------- */
.sg-model-pill {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    height: 30px;                     /* по высоте строки h1 (34px), решение владельца 17.09 */
    padding: 0 14px;
    margin-bottom: 15px;              /* как margin-bottom у .write-page-title — выравнивание по центру строки */
    border-radius: 999px;
    background: linear-gradient(90deg, #0d6efd 0%, #000 100%);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1;
    white-space: nowrap;
    user-select: none;
}
.sg-model-pill b { font-weight: 800; }
@media (max-width: 576px) {
    /* на узком экране заголовок в 2–3 строки — пилл ставим над ним по центру */
    .write-page-heading:has(.sg-model-pill) { flex-direction: column; align-items: center; gap: 0; }
    .sg-model-pill { height: 22px; font-size: 11.5px; padding: 0 9px; margin: 0 0 10px; }
}

/* =====================================================================
   /song: промо-хиро для анонимов (22.09.2026, files/docs/song_promo_dev.md)
   Первый экран: H1 + описание + CTA + статистика слева, 4 тезиса справа,
   лента примеров у нижней кромки (с отступом). Разделитель «·» не используем.
   Без теней и бордеров на плитках — только лёгкие градиенты.
   ===================================================================== */
.sg-promo {
    --sg-header: 88px;
    --sg-grad-a: #0d6efd;
    --sg-grad-b: #6a3df5;
    --sg-ink: #16233b;
    --sg-muted: #5b6b85;
    display: flex;
    flex-direction: column;
    margin: 0 0 1.75rem;
}
/* горизонтальный скролл от полноширинной ленты гасим на секции, а не на body */
.write-page-section:has(.sg-promo) { overflow-x: clip; }

/* «прибито к низу»: первый экран = хиро + лента, лента последняя, снизу небольшой отступ */
.sg-promo-screen { display: flex; flex-direction: column; padding-bottom: 22px; }
@media (min-height: 640px) {
    .sg-promo-screen { min-height: calc(100svh - var(--sg-header) - var(--sg-crumbs, 0px)); }
    .sg-promo-hero { flex: 1 1 auto; }
}

.sg-promo-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 32px 56px;
    align-items: center;
    padding: 28px 0 36px;
}
.sg-promo-main { min-width: 0; }

.sg-promo-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}
.sg-promo-heading .sg-model-pill { margin: 0; }
.sg-promo-title {
    margin: 0;
    font-size: 40px;
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--sg-ink);
    background: linear-gradient(92deg, var(--sg-ink) 0%, var(--sg-grad-a) 55%, var(--sg-grad-b) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.sg-promo-lead {
    max-width: 560px;
    margin: 0 0 28px;
    font-size: 17px;
    line-height: 1.65;
    color: var(--sg-muted);
}

/* кнопки: воздух между ними и вокруг */
.sg-promo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 30px; }
.sg-promo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 28px;
    border-radius: 999px;
    font-size: 15.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.sg-promo-btn:active { transform: translateY(1px); }
.sg-promo-btn-primary {
    border: 0;
    color: #fff;
    background: linear-gradient(115deg, #46a3ff 0%, #0d6efd 45%, #0a3573 100%);
    box-shadow: 0 10px 24px rgba(13, 110, 253, 0.28);
}
.sg-promo-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(13, 110, 253, 0.36); }
.sg-promo-btn-ghost {
    border: 1.5px solid rgba(13, 110, 253, 0.30);
    color: #1f3b66;
    background: rgba(255, 255, 255, 0.7);
}
.sg-promo-btn-ghost:hover { border-color: #0d6efd; background: #fff; }

/* статистика: три плитки на лёгких градиентах, без бордера и тени */
.sg-promo-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.sg-promo-stats li {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 132px;
    padding: 14px 18px 13px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.12) 0%, rgba(106, 61, 245, 0.06) 100%);
}
.sg-promo-stats b { font-size: 21px; line-height: 1.15; font-weight: 800; color: var(--sg-ink); font-variant-numeric: tabular-nums; }
.sg-promo-stats span { font-size: 12px; line-height: 1.3; color: var(--sg-muted); }

/* тезисы: плитка на градиенте, иконка в одной строке с заголовком */
.sg-promo-points {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.sg-promo-points li {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 18px 17px;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(13, 110, 253, 0.10) 0%, rgba(255, 255, 255, 0.55) 60%, rgba(106, 61, 245, 0.08) 100%);
}
.sg-point-head { display: flex; align-items: center; gap: 10px; }
.sg-promo-ico {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #46a3ff, #0d6efd);
}
.sg-promo-points b { font-size: 14.5px; line-height: 1.3; color: var(--sg-ink); }
.sg-promo-points p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--sg-muted); }

/* ---------- лента примеров ---------- */
.sg-ribbon {
    position: relative;
    margin: 0 calc(50% - 50vw);
    padding: 8px 0 6px;
    overflow: hidden;
}
.sg-ribbon-track {
    display: flex;
    width: max-content;
    will-change: transform;
    backface-visibility: hidden;
    animation: sgRibbon 110s linear infinite;    /* медленно, чтобы не отвлекать */
    animation-direction: reverse;           /* слева направо */
}
.sg-ribbon:hover .sg-ribbon-track,
.sg-ribbon.is-playing .sg-ribbon-track,
.sg-ribbon.is-focus .sg-ribbon-track { animation-play-state: paused; }
@keyframes sgRibbon { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
@media (prefers-reduced-motion: reduce) { .sg-ribbon-track { animation: none; } }

.sg-ribbon-list { display: flex; gap: 16px; margin: 0; padding: 0 8px; list-style: none; }
.sg-card { width: 148px; flex: 0 0 auto; display: flex; flex-direction: column; gap: 7px; }
.sg-card-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.sg-card-cover {
    position: relative;
    display: block;
    width: 148px;
    height: 148px;
    padding: 0;
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.85);
    transition: transform .2s ease;
}
.sg-card-cover:hover { transform: translateY(-2px); }
.sg-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sg-card-note { position: absolute; inset: 0; width: 46%; height: 46%; margin: auto; opacity: .55; }
.sg-tone-1 .sg-card-cover { background: linear-gradient(135deg, #2b5cff, #7a3cff); }
.sg-tone-2 .sg-card-cover { background: linear-gradient(135deg, #1b2a49, #4a6cf7); }
.sg-tone-3 .sg-card-cover { background: linear-gradient(135deg, #ff6b8b, #ff9f68); }
.sg-tone-4 .sg-card-cover { background: linear-gradient(135deg, #14b8a6, #3b82f6); }
.sg-tone-5 .sg-card-cover { background: linear-gradient(135deg, #6b4423, #c98a4b); }
.sg-tone-6 .sg-card-cover { background: linear-gradient(135deg, #111827, #6d28d9); }
.sg-tone-7 .sg-card-cover { background: linear-gradient(135deg, #d4a5ff, #7c3aed); }
.sg-tone-8 .sg-card-cover { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.sg-tone-9 .sg-card-cover { background: linear-gradient(135deg, #60a5fa, #a78bfa); }
.sg-tone-10 .sg-card-cover { background: linear-gradient(135deg, #16a34a, #84cc16); }

.sg-card-play {
    position: absolute;
    left: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #16233b;
    background: rgba(255, 255, 255, 0.92);
    transition: transform .2s ease, background .2s ease;
}
.sg-card-play .sg-ic-pause { display: none; }
.sg-card.is-playing .sg-card-play .sg-ic-play { display: none; }
.sg-card.is-playing .sg-card-play .sg-ic-pause { display: block; }
.sg-card-cover:hover .sg-card-play { transform: scale(1.06); }
.sg-ribbon.is-focus .sg-card-play { animation: sgPulse 1.4s ease-in-out infinite; background: #fff; }
@keyframes sgPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.55); }
    60% { box-shadow: 0 0 0 10px rgba(13, 110, 253, 0); }
}
.sg-card-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.25); opacity: 0; transition: opacity .2s; }
.sg-card-bar i { display: block; height: 100%; width: 0; background: #fff; }
.sg-card.is-playing .sg-card-bar { opacity: 1; }
.sg-card-title { font-size: 13px; font-weight: 700; line-height: 1.25; color: var(--sg-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-card-style { font-size: 11.5px; line-height: 1.25; color: var(--sg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* десктоп: горизонтальная карточка — обложка слева, название и стиль справа; хватает 8 примеров */
@media (min-width: 768px) {
    .sg-card { width: 250px; flex-direction: row; align-items: center; gap: 14px; }
    .sg-card:nth-child(n+9) { display: none; }
    .sg-card-cover { width: 96px; height: 96px; border-radius: 14px; flex: 0 0 auto; }
    .sg-card-note { width: 44%; height: 44%; }
    .sg-card-play { width: 32px; height: 32px; left: 8px; bottom: 8px; }
    .sg-card-meta { flex: 1 1 auto; }
    .sg-card-title { font-size: 14px; white-space: normal; text-overflow: clip; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .sg-card-style { font-size: 12px; }
}
/* повторный CTA под лентой: только на мобильном (владелец, 22.09) */
.sg-promo-cta { display: none; justify-content: center; padding: 26px 0 10px; }

/* заголовок над формой в промо-режиме */
.sg-form-heading { margin: 1rem 0 1.1rem; font-size: 24px; font-weight: 800; letter-spacing: -0.01em; color: var(--sg-ink); text-align: center; scroll-margin-top: 92px; }

/* ---------- мобильный (ориентир 360×800): порядок main → лента → CTA → тезисы ---------- */
@media (max-width: 767.98px) {
    .sg-promo { --sg-header: 96px; }
    .sg-promo-screen, .sg-promo-hero { display: contents; }
    /* три блока (пилл+H1+описание, кнопки, чипы) и 4 равных пропуска: space-evenly внутри первого экрана */
    .sg-promo-main { order: 1; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; text-align: center; padding: 0; }
    .sg-promo-stats { margin: 0; padding: 0; }
    .sg-ribbon { order: 2; margin: 0 -16px; }
    .sg-promo-cta { order: 3; display: flex; padding: 44px 0 6px; }
    .sg-promo-points { order: 4; margin: 36px 0 30px; grid-template-columns: 1fr 1fr; gap: 10px; }
    .sg-promo-heading { align-items: center; gap: 12px; margin-bottom: 14px; }
    .sg-promo-block { display: flex; flex-direction: column; align-items: center; }
    .sg-promo-title { font-size: 28px; line-height: 1.15; }
    .sg-promo-lead { font-size: 14.5px; line-height: 1.55; margin-bottom: 0; }
    .sg-promo-actions { justify-content: center; gap: 10px; margin-bottom: 0; width: 100%; }
    .sg-promo-actions .sg-promo-btn { flex: 1 1 0; min-width: 0; min-height: 46px; padding: 0 12px; font-size: 13.5px; gap: 6px; white-space: nowrap; }
    .sg-promo-actions .sg-promo-btn-ghost svg { display: none; }
    .sg-promo-stats { gap: 8px; width: 100%; }
    .sg-promo-stats li { flex: 1 1 0; min-width: 0; padding: 10px 8px 9px; border-radius: 13px; align-items: center; text-align: center; }
    .sg-promo-stats b { font-size: 15.5px; }
    .sg-promo-stats span { font-size: 10.5px; }
    .sg-promo-points li { padding: 13px 12px 12px; gap: 8px; border-radius: 15px; }
    .sg-promo-ico { width: 28px; height: 28px; border-radius: 8px; }
    .sg-promo-points b { font-size: 12.5px; }
    .sg-promo-points p { font-size: 11.5px; line-height: 1.45; }
    .sg-card, .sg-card-cover { width: 124px; }
    .sg-card-cover { height: 124px; border-radius: 14px; }
    .sg-card-play { width: 32px; height: 32px; left: 8px; bottom: 8px; }
    .sg-form-heading { font-size: 21px; scroll-margin-top: 104px; }
}
@media (max-width: 767.98px) and (min-height: 640px) {
    /* первый экран: main растянут так, чтобы лента (≈190px) встала у нижней кромки с отступом */
    .sg-promo-main { min-height: calc(100svh - var(--sg-header) - 176px); }   /* лента ≈180px + отступ снизу */
}

/* ---------- тёмная тема ---------- */
[data-bs-theme="dark"] .sg-promo {
    --sg-ink: var(--rt-text, #e6ecf5);
    --sg-muted: var(--rt-text-2, #a3b1c6);
}
[data-bs-theme="dark"] .sg-promo-title { background: linear-gradient(92deg, #e6ecf5 0%, #7db4ff 55%, #b39cff 100%); -webkit-background-clip: text; background-clip: text; }
[data-bs-theme="dark"] .sg-promo-btn-ghost { color: #cfe0ff; background: rgba(255, 255, 255, 0.05); border-color: rgba(125, 180, 255, 0.35); }
[data-bs-theme="dark"] .sg-promo-stats li { background: linear-gradient(135deg, rgba(125, 180, 255, 0.16), rgba(179, 156, 255, 0.08)); }
[data-bs-theme="dark"] .sg-promo-points li { background: linear-gradient(145deg, rgba(125, 180, 255, 0.14), rgba(255, 255, 255, 0.04) 60%, rgba(179, 156, 255, 0.10)); }
[data-bs-theme="dark"] .sg-form-heading { color: var(--rt-text, #e6ecf5); }

/* ---------- чипы-примеры в попапе «Написать текст с ИИ» (только /songs/*) ---------- */
.sg-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.sg-chip {
    border: 0; border-radius: 999px; padding: 7px 12px; font-size: 12.5px; line-height: 1.3; text-align: left;
    color: #1f3b66; background: linear-gradient(135deg, rgba(13, 110, 253, 0.12), rgba(106, 61, 245, 0.08));
    cursor: pointer; transition: background .15s ease, transform .15s ease; font-family: inherit;
}
.sg-chip:hover { background: linear-gradient(135deg, rgba(13, 110, 253, 0.2), rgba(106, 61, 245, 0.14)); transform: translateY(-1px); }

/* ---------- блок «Песня по поводу и жанру» на /song ---------- */
.sg-topics-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0 0; padding: 0; list-style: none; }
.sg-topics-list a {
    display: flex; flex-direction: column; gap: 5px; height: 100%; padding: 14px 15px; border-radius: 16px; text-decoration: none;
    background: linear-gradient(145deg, rgba(13, 110, 253, 0.10) 0%, rgba(255, 255, 255, 0.55) 60%, rgba(106, 61, 245, 0.08) 100%);
    transition: transform .15s ease;
}
.sg-topics-list a:hover { transform: translateY(-2px); }
.sg-topics-list b { font-size: 14px; color: #16233b; }
.sg-topics-list span { font-size: 12.5px; line-height: 1.4; color: #5b6b85; }
@media (max-width: 991.98px) { .sg-topics-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* посадочные: соседние темы категории и категории каталога — чипы */
.sg-related { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.sg-related a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: #16233b; text-decoration: none; background: #fff; border: 1px solid #dfe6f2; box-shadow: 0 1px 2px rgba(22, 35, 59, 0.05); transition: transform .15s, border-color .15s; }
.sg-related a:hover { transform: translateY(-1px); border-color: #9db8ff; color: #0d4fd6; }
/* специфичность выше, чем у .write-seo-section h3 из common.css */
.write-seo-section .sg-related-sub { margin: 30px 0 14px; font-size: 16px; font-weight: 700; line-height: 1.3; color: #16233b; }
.write-seo-section .sg-related-sub:first-of-type { margin-top: 10px; }
.sg-related { margin: 0; }
[data-bs-theme="dark"] .sg-related-sub { color: var(--rt-text, #e6ecf5); }
.sg-related-cats a { background: linear-gradient(145deg, rgba(13, 110, 253, 0.08), rgba(124, 77, 255, 0.08)); border-color: transparent; }
.sg-related-emoji { font-size: 16px; line-height: 1; }
[data-bs-theme="dark"] .sg-related a { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.12); color: var(--rt-text, #e6ecf5); }
[data-bs-theme="dark"] .sg-related-cats a { background: linear-gradient(145deg, rgba(125, 180, 255, 0.14), rgba(179, 156, 255, 0.12)); }

/* ---------- хаб /songs/: каталог, витрина ---------- */
.sg-catalog { margin: 44px 0 16px; }
.sg-catalog-section { margin-bottom: 56px; }
.sg-catalog-section h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; color: #16233b; margin: 0 0 24px; }
.sg-catalog-section { scroll-margin-top: 96px; }
.sg-catalog-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.sg-catalog-card a {
    display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 16px 16px 15px; border-radius: 16px; text-decoration: none;
    background: linear-gradient(145deg, rgba(13, 110, 253, 0.10) 0%, rgba(255, 255, 255, 0.55) 60%, rgba(106, 61, 245, 0.08) 100%);
    transition: transform .15s ease;
}
.sg-catalog-card a:hover { transform: translateY(-2px); }
.sg-catalog-card b { font-size: 15px; line-height: 1.3; color: #16233b; display: flex; align-items: center; gap: 8px; }
.sg-catalog-emoji { font-size: 18px; line-height: 1; flex: 0 0 auto; }
.sg-catalog-card span { font-size: 12.5px; line-height: 1.45; color: #5b6b85; }
.sg-catalog-card-any a { background: linear-gradient(115deg, #46a3ff 0%, #0d6efd 45%, #0a3573 100%); }
.sg-catalog-card-any b, .sg-catalog-card-any span { color: #fff; }
.sg-catalog-card-any span { color: rgba(255, 255, 255, 0.82); }
.sg-listen { margin: 16px 0 56px; }
.sg-listen h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; color: #16233b; margin: 0 0 24px; }
.sg-hub-seo .write-seo-section h2 { margin: 0 0 1.5rem; }
.sg-listen-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.sg-listen-grid .sg-card { width: auto; flex-direction: row; align-items: center; gap: 12px; }
.sg-listen-grid .sg-card-cover { width: 84px; height: 84px; border-radius: 14px; flex: 0 0 auto; }
.sg-listen-grid .sg-card-note { width: 44%; height: 44%; }
.sg-listen-grid .sg-card-play { width: 30px; height: 30px; left: 7px; bottom: 7px; }
.sg-listen-grid .sg-card-meta { flex: 1 1 auto; min-width: 0; }
.sg-listen-grid .sg-card-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sg-hub-cta { padding: 10px 0 40px; }
@media (max-width: 991.98px) { .sg-catalog-grid, .sg-listen-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) {
    .sg-catalog { margin-top: 32px; }
    .sg-catalog-section { margin-bottom: 40px; }
    .sg-catalog-section h2, .sg-listen h2 { margin-bottom: 18px; }
    .sg-listen { margin-bottom: 40px; }
    .sg-catalog-section h2, .sg-listen h2 { font-size: 20px; }
    .sg-catalog-grid { gap: 14px; }
    .sg-catalog-card a { padding: 13px 13px 12px; border-radius: 14px; }
    .sg-catalog-card b { font-size: 14px; }
    .sg-catalog-card span { font-size: 12px; }
    .sg-listen-grid { grid-template-columns: 1fr; gap: 12px; }
    .sg-listen-grid .sg-card { width: auto; }
    .sg-listen-grid .sg-card-cover { width: 76px; height: 76px; }
}
[data-bs-theme="dark"] .sg-topics-list a, [data-bs-theme="dark"] .sg-catalog-card a { background: linear-gradient(145deg, rgba(125, 180, 255, 0.14), rgba(255, 255, 255, 0.04) 60%, rgba(179, 156, 255, 0.10)); }
[data-bs-theme="dark"] .sg-topics-list b, [data-bs-theme="dark"] .sg-catalog-card b, [data-bs-theme="dark"] .sg-catalog-section h2, [data-bs-theme="dark"] .sg-listen h2 { color: var(--rt-text, #e6ecf5); }
[data-bs-theme="dark"] .sg-topics-list span, [data-bs-theme="dark"] .sg-catalog-card span { color: var(--rt-text-2, #a3b1c6); }
[data-bs-theme="dark"] .sg-chip { color: #cfe0ff; }

/* ---------- хлебные крошки /song и /songs/<slug> (образец /video/<slug>, imgedit.css) ---------- */
.sg-crumbs { margin: 0 0 10px; }
.sg-crumbs + .sg-promo { --sg-crumbs: 44px; } /* крошки над хиро: первый экран короче на их высоту, лента остаётся видна */
@media (max-width: 575.98px) { .sg-crumbs + .sg-promo { --sg-crumbs: 0px; } }
.sg-crumbs-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.sg-crumb { display: flex; align-items: center; gap: 2px; }
.sg-crumb + .sg-crumb::before { content: "›"; margin-right: 6px; color: #b6bec9; font-size: 15px; line-height: 1; }
.sg-crumb-link { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid transparent; color: #5b6b85; background: rgba(255, 255, 255, 0.5); text-decoration: none; white-space: nowrap; transition: color .18s ease, background .18s ease, border-color .18s ease; }
.sg-crumb-link:hover { color: #0d6efd; background: rgba(13, 110, 253, 0.12); border-color: rgba(22, 35, 59, 0.08); }
.sg-crumb-emoji { font-size: 14px; line-height: 1; }
.sg-crumb-drop { position: relative; }
.sg-crumb-pill { display: inline-flex; align-items: center; gap: 3px; padding: 5px 11px; border-radius: 999px; border: 1px solid transparent; background: rgba(255, 255, 255, 0.5); cursor: pointer; transition: color .18s ease, background .18s ease, border-color .18s ease; }
.sg-crumb-pill:hover { color: #0d6efd; background: rgba(13, 110, 253, 0.12); border-color: rgba(22, 35, 59, 0.08); }
.sg-crumb-pill .sg-crumb-link, .sg-crumb-pill .sg-crumb-link:hover { padding: 0; background: none; border-color: transparent; color: inherit; }
.sg-crumb-pill .sg-crumb-toggle { pointer-events: none; }
.sg-crumb-link-static { color: #1f2937; font-weight: 600; }
.sg-crumb-toggle { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 18px; padding: 0; border: 0; color: #5b6b85; background: transparent; cursor: pointer; transition: color .18s ease, transform .18s ease; }
.sg-crumb-drop.is-open .sg-crumb-toggle { color: #0d6efd; transform: rotate(180deg); }
.sg-crumb-menu { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; min-width: 248px; max-height: 60vh; overflow: auto; padding: 8px; border-radius: 14px; border: 1px solid rgba(22, 35, 59, 0.08); background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 14px 36px rgba(22, 35, 59, 0.14); animation: sg-crumb-in .16s ease; }
@keyframes sg-crumb-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.sg-crumb-menu-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px; color: #1f2937; font-size: 13.5px; text-decoration: none; white-space: nowrap; }
.sg-crumb-menu-item:hover { color: #0d6efd; background: rgba(13, 110, 253, 0.12); }
.sg-crumb-menu-item.is-current { color: #0d6efd; background: rgba(13, 110, 253, 0.12); font-weight: 600; }
@media (max-width: 575.98px) { .sg-crumbs { display: none; } }
[data-bs-theme="dark"] .sg-crumb-link-static, [data-bs-theme="dark"] .sg-crumb-menu-item { color: var(--rt-text, #e6ecf5); }
[data-bs-theme="dark"] .sg-crumb + .sg-crumb::before { color: var(--rt-muted, #8a99b3); }
[data-bs-theme="dark"] .sg-crumb-link, [data-bs-theme="dark"] .sg-crumb-pill { background: var(--rt-glass-bg, rgba(255, 255, 255, 0.06)); }
[data-bs-theme="dark"] .sg-crumb-menu { background: var(--rt-glass-bg-strong, #1b2230); border-color: rgba(255, 255, 255, 0.1); }



/* авторизованные (без промо): общий .write-page-hero из common.css ограничен 900px, из-за чего H1 посадочных ложился в 2 строки.
   На страницах песен ограничение снимаем (владелец, 23.09), подзаголовок оставляем на 900px ради читаемости. */
.write-page-shell .write-page-hero { max-width: none; }               /* специфичность выше common.css, порядок подключения не важен */
.write-page-shell .write-page-hero .write-page-subtitle { max-width: 900px; }
/* пилл RoboMix остаётся рядом с H1 (владелец, 23.09); заголовок 32px, чтобы длинные H1 реже переносились */
@media (min-width: 768px) {
    .write-page-shell .write-page-title { font-size: 32px; text-wrap: pretty; } /* первая строка полная (пилл вплотную к тексту), без хвоста из одного слова */
}

/* невысокий десктоп (ноутбук 720–780px): ужимаем воздух хиро, чтобы лента с обложками оставалась на первом экране (в самом конце файла, чтобы перекрыть остальные правила) */
@media (min-width: 768px) and (max-height: 780px) {
    .sg-promo-screen { padding-bottom: 12px; }
    .sg-promo-hero { padding: 10px 0 18px; gap: 24px 48px; }
    .sg-promo-actions { margin-bottom: 20px; }
}
