/* ============================================================
   Star Greeting — каталог-центричный редизайн (scoped к странице)
   Стиль: токены Fish TTS (фиолетово-фуксиевый градиент).
   Загружается только на /ai-tools/tools/star-greeting/
   Все .icon-svg имеют явные размеры в каждом контексте.
   ============================================================ */

:root {
    --sg-grad: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
    --sg-grad-cta: linear-gradient(100deg, #8b50f4 0%, #b74de8 48%, #e83f99 100%);
    --sg-grad-soft: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(217, 70, 239, 0.18));
    --sg-card-bg: linear-gradient(145deg, rgba(24, 19, 51, 0.97), rgba(16, 13, 35, 0.97));
    --sg-card-border: rgba(150, 106, 245, 0.18);
    --sg-input-bg: rgba(13, 8, 28, 0.62);
    --sg-text: #f5f1ff;
    --sg-muted: rgba(245, 241, 255, 0.55);
    --sg-faint: rgba(245, 241, 255, 0.38);
}

.sg-wrap {
    width: min(1400px, calc(100% - 48px));
    margin: 0 auto;
    animation: sgPageEnter 350ms ease-out both;
}
@keyframes sgPageEnter {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================= Хлебные крошки ================= */
.sg-breadcrumbs { margin: 20px 0 0; font-size: 0.82rem; }
.sg-breadcrumbs a { color: #a78bfa; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: color 0.15s; }
.sg-breadcrumbs a:hover { color: #ec4899; }
.sg-breadcrumbs .icon-svg { width: 13px; height: 13px; }

/* ================= Hero (компактный) ================= */
.sg-hero {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 20px 24px;
    margin-top: 14px;
    background:
        radial-gradient(circle at 90% 10%, rgba(217, 70, 239, 0.38), transparent 42%),
        radial-gradient(circle at 60% 95%, rgba(139, 92, 246, 0.28), transparent 45%),
        linear-gradient(120deg, #4c1d95 0%, #6d28d9 45%, #86198f 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 46px rgba(109, 40, 217, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.sg-hero h1 { margin: 0 0 6px; font-size: 1.55rem; font-weight: 800; color: #fff; line-height: 1.15; letter-spacing: -0.01em; }
.sg-hero-sub { margin: 0 0 12px; color: rgba(250, 245, 255, 0.85); font-size: 0.88rem; max-width: 560px; }
.sg-hero-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.sg-hero-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(20, 8, 40, 0.30);
    color: rgba(250, 245, 255, 0.88);
    font-size: 0.76rem; font-weight: 500;
}
.sg-hero-pill .icon-svg { width: 13px; height: 13px; }
.sg-hero-deco {
    position: absolute; right: 22px; top: 50%;
    transform: translateY(-50%);
    width: 84px; height: 84px;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    filter: drop-shadow(0 10px 26px rgba(217, 70, 239, 0.55));
}
.sg-hero-deco .icon-svg { width: 100%; height: 100%; stroke-width: 1.6; }

/* ================= Гостевой баннер ================= */
.guest-cta-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    background: var(--sg-grad-soft);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 16px; padding: 18px 22px;
    margin-bottom: 14px;
}
.guest-cta-content { display: flex; align-items: center; gap: 14px; }
.guest-cta-content .icon-svg { width: 28px; height: 28px; opacity: 0.8; }
.guest-cta-content strong { display: block; color: #f3efff; font-size: 15px; }
.guest-cta-content span { color: var(--sg-muted); font-size: 13px; }

/* ================= Раскладка: форма + заказы ================= */
.sg-main-stack { margin-top: 16px; }
.sg-cols { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.sg-cols.no-orders { grid-template-columns: 1fr; }

.sg-panel {
    background: var(--sg-card-bg);
    border: 1px solid var(--sg-card-border);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.025);
    padding: 18px 20px;
    margin-bottom: 14px;
}
.sg-panel-title {
    display: flex; align-items: center; gap: 9px;
    font-size: 18px; font-weight: 650; color: var(--sg-text);
    margin-bottom: 4px;
}
.sg-panel-title .icon-svg { width: 20px; height: 20px; color: #c4b5fd; }
.sg-panel-title .sg-count {
    font-size: 0.72rem; font-weight: 600;
    padding: 2px 9px; border-radius: 12px;
    background: rgba(139, 92, 246, 0.2); color: #d8b4fe;
}
.sg-panel-sub { font-size: 13px; color: var(--sg-faint); margin: 0 0 14px; }

/* ================= Липкая панель фильтров ================= */
.sg-filterbar {
    position: sticky;
    top: 10px;
    z-index: 30;
    background: linear-gradient(145deg, rgba(24, 19, 51, 0.98), rgba(16, 13, 35, 0.98));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(150, 106, 245, 0.22);
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}
.sg-search { position: relative; margin-bottom: 10px; }
.sg-search .icon-svg {
    position: absolute; left: 13px; top: 50%;
    transform: translateY(-50%);
    width: 17px; height: 17px;
    color: var(--sg-faint);
    pointer-events: none;
}
.sg-search input {
    width: 100%;
    padding: 11px 38px 11px 40px;
    background: var(--sg-input-bg);
    border: 1px solid rgba(139, 92, 246, 0.45);
    border-radius: 12px;
    color: #fff;
    font-size: 0.92rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.sg-search input:focus {
    outline: none;
    border-color: rgba(217, 70, 239, 0.75);
    box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.16);
}
.sg-search input::placeholder { color: var(--sg-faint); }
.sg-search .sg-search-clear {
    position: absolute; right: 6px; top: 50%;
    transform: translateY(-50%);
    width: 26px; height: 26px;
    border: none; border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    display: none; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1rem; line-height: 1;
}
.sg-search .sg-search-clear.visible { display: flex; }

.sg-cats { display: flex; flex-wrap: wrap; gap: 7px; }
.sg-cat {
    display: inline-flex; align-items: center; gap: 5px;
    height: 32px; padding: 0 13px; border-radius: 20px;
    background: rgba(24, 15, 46, 0.5);
    border: 1px solid rgba(178, 142, 255, 0.22);
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.78rem; font-weight: 500;
    cursor: pointer; white-space: nowrap;
    transition: border-color 0.18s, background 0.18s, color 0.18s;
}
.sg-cat .icon-svg { width: 13px; height: 13px; flex-shrink: 0; }
.sg-cat:hover { border-color: rgba(217, 70, 239, 0.55); color: #fff; }
.sg-cat.active {
    background: var(--sg-grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 3px 10px rgba(139, 92, 246, 0.35);
}

/* ================= Сетка каталога ================= */
.sg-select-grid { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; align-items: start; }

.sg-chars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sg-char-card {
    position: relative; overflow: hidden; min-width: 0;
    aspect-ratio: 4/5;
    border-radius: 13px; background: #100d22;
    border: 1px solid rgba(153, 112, 235, 0.16);
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
    content-visibility: auto;
    contain-intrinsic-size: 260px;
}
.sg-char-card:hover { transform: translateY(-3px); border-color: rgba(182, 113, 255, 0.42); box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3); }
.sg-char-card.selected {
    border: 2px solid #a95fff;
    box-shadow: 0 0 0 3px rgba(169, 95, 255, 0.12), 0 12px 34px rgba(134, 55, 232, 0.28);
}
/* Превью — на всю карточку, целиком (contain), без обрезки сверху/снизу */
.sg-char-media { position: absolute; inset: 0; }
.sg-char-video {
    width: 100%; height: 100%; object-fit: contain; display: block;
    background: radial-gradient(circle at 50% 30%, #1a1430, #0a0716 75%);
}
.sg-char-ph {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.1));
    display: flex; align-items: center; justify-content: center;
    color: #fff;
}
.sg-char-ph svg { width: 40px; height: 40px; opacity: 0.3; }
/* Имя и описание — оверлей поверх медиа на градиентной подложке */
.sg-char-info {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    padding: 34px 11px 11px;
    background: linear-gradient(to bottom, transparent, rgba(9, 6, 20, 0.92) 55%);
    pointer-events: none;
}
.sg-char-name { font-weight: 650; font-size: 14px; line-height: 1.25; color: #f6f3ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-char-desc {
    font-size: 11px; line-height: 1.35; color: #b3a8cc; margin-top: 3px;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.sg-char-check {
    position: absolute; top: 9px; right: 9px; width: 22px; height: 22px; border-radius: 50%; z-index: 2;
    background: linear-gradient(135deg, #a965ff, #7656ff);
    display: none; align-items: center; justify-content: center;
}
.sg-char-check .icon-svg { width: 12px; height: 12px; color: #fff; }
.sg-char-card.selected .sg-char-check { display: flex; }
/* Статус каталога + пагинация */
.sg-catalog-status { font-size: 0.76rem; color: var(--sg-faint); margin-top: 12px; text-align: center; }

/* ── SEO-каталог звёзд (/star-greeting/stars/) ─────────────────────────── */
.sg-cat-section { margin-top: 26px; }
.sg-cat-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.sg-cat-title { font-size: 19px; font-weight: 700; color: #f4efff; margin: 0; }
.sg-cat-count {
    font-size: 12px; font-weight: 600; color: #b79bf5;
    background: rgba(169, 95, 255, 0.12); border: 1px solid rgba(169, 95, 255, 0.25);
    border-radius: 999px; padding: 2px 10px;
}
a.sg-char-link { text-decoration: none; display: block; }
.sg-seo-block { margin-top: 26px; }
.sg-seo-h2 { font-size: 19px; font-weight: 700; color: #f4efff; margin: 0 0 12px; }
.sg-seo-h3 { font-size: 15px; font-weight: 650; color: #e8dfff; margin: 16px 0 8px; }
.sg-seo-block p { font-size: 13.5px; line-height: 1.65; color: #b3a8cc; margin: 0 0 10px; }
.sg-seo-block p strong { color: #ddd3f5; font-weight: 600; }
.sg-seo-cta { margin-top: 16px; }
.sg-faq-item { border-top: 1px solid rgba(255, 255, 255, 0.06); padding: 12px 0; }
.sg-faq-item:first-of-type { border-top: none; padding-top: 0; }
.sg-faq-q { font-size: 14px; font-weight: 650; color: #ede6ff; margin-bottom: 5px; }
.sg-faq-a { font-size: 13px; line-height: 1.6; color: #b3a8cc; }
.sg-pager { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.sg-pager-btn {
    min-width: 36px; height: 36px; padding: 0 10px; border-radius: 9px;
    background: rgba(24, 15, 46, 0.5);
    border: 1px solid rgba(178, 142, 255, 0.22);
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.82rem; font-weight: 500;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, color 0.18s;
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.sg-pager-btn:hover:not(:disabled):not(.active) { border-color: rgba(217, 70, 239, 0.55); color: #fff; }
.sg-pager-btn.active { background: var(--sg-grad); border-color: transparent; color: #fff; box-shadow: 0 3px 10px rgba(139, 92, 246, 0.35); }
.sg-pager-btn:disabled { opacity: 0.35; cursor: default; }
.sg-pager-dots { color: var(--sg-faint); padding: 0 3px; font-size: 0.82rem; user-select: none; }
.sg-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.4rem 1rem;
    color: var(--sg-muted);
    font-size: 0.9rem;
}
.sg-empty .icon-svg { width: 34px; height: 34px; opacity: 0.4; margin-bottom: 8px; }

/* ================= Превью выбранной звезды ================= */
.sg-preview-col { min-width: 0; position: sticky; top: 16px; }
.sg-preview-label { font-size: 13px; font-weight: 600; color: var(--sg-muted); margin-bottom: 9px; }
.sg-preview-card {
    background: rgba(255, 255, 255, 0.022);
    border: 1px solid rgba(159, 118, 255, 0.17);
    border-radius: 14px; padding: 14px;
}
.sg-preview-media { position: relative; border-radius: 10px; overflow: hidden; }
.sg-preview-media video, .sg-preview-media img { width: 100%; aspect-ratio: 4/5; object-fit: cover; display: block; background: #100d22; border-radius: 11px; }
.sg-preview-empty {
    width: 100%; aspect-ratio: 4/5; border-radius: 10px;
    background: rgba(255, 255, 255, 0.03); border: 1px dashed rgba(159, 118, 255, 0.25);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    color: #887e9f; font-size: 12.5px; text-align: center; padding: 14px;
}
.sg-preview-empty .icon-svg { width: 34px; height: 34px; opacity: 0.25; }
.sg-preview-play {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(12, 9, 25, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: 180ms ease;
    padding: 0;
}
.sg-preview-play:hover { transform: translate(-50%, -50%) scale(1.06); background: rgba(144, 75, 237, 0.72); }
.sg-preview-play .icon-svg { width: 22px; height: 22px; margin-left: 3px; color: #fff; }
.sg-preview-name { font-size: 17px; font-weight: 700; color: #f6f3ff; margin-top: 13px; }
.sg-preview-desc {
    font-size: 12px; line-height: 1.45; color: #968ba8; margin-top: 6px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ================= Нативный плеер превью ================= */
.sg-preview-media video.sg-preview-player {
    width: 100%; aspect-ratio: 4/5; object-fit: contain;
    background: radial-gradient(circle at 50% 30%, #1a1430, #0a0716 75%);
    display: block; border-radius: 11px;
}

/* ================= Страница звезды (SEO-лендинг /star-greeting/<slug>/) ================= */
.sg-bc-sep { color: var(--sg-faint); margin: 0 7px; }
.sg-bc-current { color: var(--sg-muted); }
.sg-star-hero {
    display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 28px;
    align-items: start;
    margin-top: 16px;
    background: var(--sg-card-bg);
    border: 1px solid var(--sg-card-border);
    border-radius: 18px;
    padding: 22px;
}
.sg-star-media video, .sg-star-media img {
    width: 100%; aspect-ratio: 4/5; object-fit: contain;
    background: radial-gradient(circle at 50% 30%, #1a1430, #0a0716 75%);
    border-radius: 14px; display: block;
}
.sg-star-media-ph {
    width: 100%; aspect-ratio: 4/5; border-radius: 14px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.1));
    display: flex; align-items: center; justify-content: center; color: #fff;
}
.sg-star-media-ph .icon-svg { width: 56px; height: 56px; opacity: 0.3; }
.sg-star-cat {
    display: inline-block; padding: 4px 12px; border-radius: 999px;
    background: var(--sg-grad); color: #fff;
    font-size: 0.74rem; font-weight: 600; margin-bottom: 10px;
}
.sg-star-info h1 { font-size: 1.7rem; font-weight: 800; color: #fff; margin: 0 0 8px; line-height: 1.2; }
.sg-star-desc { color: var(--sg-muted); font-size: 0.9rem; margin: 0 0 10px; }
.sg-star-lead { color: var(--sg-text); font-size: 0.95rem; line-height: 1.55; margin: 0 0 18px; }
.sg-star-cta-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sg-star-cta { width: auto !important; padding: 0 26px; text-decoration: none; }
.sg-star-price { font-size: 1.35rem; font-weight: 750; color: #cc71ff; display: inline-flex; align-items: center; gap: 7px; }
.sg-pill-dark { background: rgba(20, 8, 40, 0.55); border-color: rgba(150, 106, 245, 0.25); color: var(--sg-muted); }
.sg-star-examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.sg-star-example video {
    width: 100%; aspect-ratio: 4/5; object-fit: contain;
    background: radial-gradient(circle at 50% 30%, #1a1430, #0a0716 75%);
    border-radius: 12px; display: block;
}
.sg-star-example-cap { font-size: 0.78rem; color: var(--sg-muted); margin-top: 7px; }
.sg-star-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 6px 0 18px; }
.sg-star-step {
    display: flex; gap: 12px; align-items: flex-start;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(159, 118, 255, 0.14);
    border-radius: 12px; padding: 14px;
}
.sg-star-step-num {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    background: var(--sg-grad); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem;
}
.sg-star-step strong { color: var(--sg-text); font-size: 0.9rem; }
.sg-star-step p { color: var(--sg-muted); font-size: 0.8rem; line-height: 1.45; margin: 4px 0 0; }
.sg-star-seo h2 { font-size: 1.25rem; font-weight: 750; color: var(--sg-text); margin: 0 0 12px; }
.sg-star-seo h3 { font-size: 1rem; font-weight: 700; color: var(--sg-text); margin: 18px 0 8px; }
.sg-star-seo p { color: var(--sg-muted); font-size: 0.88rem; line-height: 1.65; margin: 0 0 10px; }
@media (max-width: 900px) {
    .sg-star-hero { grid-template-columns: 1fr; padding: 16px; gap: 18px; }
    .sg-star-media { max-width: 340px; }
    .sg-star-info h1 { font-size: 1.35rem; }
    .sg-star-steps { grid-template-columns: 1fr; }
}

/* ================= Текст поздравления ================= */
.sg-textarea {
    width: 100%; min-height: 132px; resize: vertical;
    border-radius: 12px; padding: 15px;
    background: var(--sg-input-bg);
    border: 1px solid rgba(178, 142, 255, 0.2);
    color: #f2edff; font-size: 14px; line-height: 1.55; font-family: inherit;
    outline: none; transition: 180ms ease;
}
.sg-textarea::placeholder { color: rgba(191, 178, 214, 0.48); }
.sg-textarea:focus {
    border-color: rgba(217, 70, 239, 0.6);
    box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.12);
}
.sg-text-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; flex-wrap: wrap; }
.sg-char-count { font-size: 12px; color: var(--sg-faint); }
.sg-btn-sec {
    height: 32px; padding: 0 12px; border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(157, 119, 228, 0.17);
    color: #bdb1d3; font-size: 12px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: 180ms ease;
}
.sg-btn-sec:hover { background: rgba(145, 90, 244, 0.1); border-color: rgba(169, 113, 255, 0.35); }
.sg-btn-sec .icon-svg { width: 13px; height: 13px; opacity: 0.7; }

/* ================= Блок заказа ================= */
.sg-order-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 150px minmax(330px, 1.35fr);
    gap: 22px; align-items: center; margin-top: 16px;
    padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.06);
    min-height: 118px;
}
.sg-order-price-col { padding-left: 22px; border-left: 1px solid rgba(255, 255, 255, 0.06); }
.sg-order-cta-col { padding-left: 22px; border-left: 1px solid rgba(255, 255, 255, 0.06); }
.sg-order-star { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sg-order-star-img { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; background: #100d22; flex-shrink: 0; }
.sg-order-star-ph {
    width: 54px; height: 54px; border-radius: 10px; flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04); border: 1px dashed rgba(159, 118, 255, 0.3);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
}
.sg-order-star-ph .icon-svg { width: 20px; height: 20px; opacity: 0.3; }
.sg-order-star-label { font-size: 11.5px; color: var(--sg-faint); }
.sg-order-star-name { font-size: 15px; font-weight: 650; color: #f6f3ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-order-star-desc { font-size: 12px; color: var(--sg-faint); }
.sg-order-price-label { font-size: 12px; color: var(--sg-faint); }
.sg-order-price { font-size: 29px; font-weight: 750; color: #cc71ff; display: flex; align-items: center; gap: 7px; }
.sg-cta {
    width: 100%; height: 54px; border-radius: 10px; border: none;
    background: var(--sg-grad-cta);
    box-shadow: 0 10px 28px rgba(169, 65, 220, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-size: 15px; font-weight: 650;
    color: #fff !important; -webkit-text-fill-color: #fff !important;
    background-clip: padding-box; -webkit-background-clip: padding-box;
    cursor: pointer; transition: 180ms ease;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.sg-cta:hover:not(:disabled) {
    transform: translateY(-2px); filter: brightness(1.07);
    box-shadow: 0 14px 34px rgba(192, 62, 217, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
.sg-cta:active:not(:disabled) { transform: translateY(0) scale(0.99); }
.sg-cta:disabled {
    background: linear-gradient(100deg, rgba(112, 79, 156, 0.55), rgba(139, 69, 128, 0.5));
    color: rgba(255, 255, 255, 0.46) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.46) !important;
    box-shadow: none; cursor: not-allowed;
}
.sg-cta .icon-svg { width: 17px; height: 17px; }
.sg-cta:disabled .icon-svg { opacity: 0.45; }
.sg-cta-note { font-size: 11px; color: #6f6684; text-align: center; margin-top: 8px; }
.sg-cta-note a { color: #8f82ad; }

/* ================= Результат / прогресс ================= */
.sg-result {
    background: var(--sg-card-bg);
    border: 1px solid var(--sg-card-border); border-radius: 16px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
    padding: 22px; text-align: center; display: none; margin-bottom: 14px;
}
.sg-result video { width: 100%; max-width: 420px; border-radius: 14px; margin: 16px auto; display: block; object-fit: contain; }
.sg-result-status { padding: 8px 0 16px; }
.sg-steps-progress { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 20px; text-align: left; }
.sg-step-progress { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.06); background: rgba(255, 255, 255, 0.02); transition: all 0.4s; }
.sg-step-progress.active { border-color: rgba(139, 92, 246, 0.4); background: rgba(139, 92, 246, 0.08); }
.sg-step-progress.done { border-color: rgba(16, 185, 129, 0.3); background: rgba(16, 185, 129, 0.06); }
.sg-step-icon { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.06); }
.sg-step-icon .icon-svg { width: 16px; height: 16px; color: #6b7280; }
.sg-step-progress.active .sg-step-icon { background: rgba(139, 92, 246, 0.2); }
.sg-step-progress.active .sg-step-icon .icon-svg { color: #a78bfa; }
.sg-step-progress.done .sg-step-icon { background: rgba(16, 185, 129, 0.15); }
.sg-step-progress.done .sg-step-icon .icon-svg { color: #6ee7b7; }
.sg-step-body { flex: 1; min-width: 0; }
.sg-step-label { font-size: 0.88rem; font-weight: 600; color: var(--text-secondary); }
.sg-step-progress.active .sg-step-label { color: var(--text-primary); }
.sg-step-progress.done .sg-step-label { color: #6ee7b7; }
.sg-step-sub { font-size: 0.76rem; color: var(--text-secondary); margin-top: 2px; }
.sg-step-spinner { width: 16px; height: 16px; border: 2px solid rgba(139, 92, 246, 0.25); border-top-color: #8b5cf6; border-radius: 50%; animation: spin 1s linear infinite; flex-shrink: 0; }
.sg-done-check .icon-svg { width: 16px; height: 16px; color: #6ee7b7; }
/* Блок «Поздравление готово»: галочка и иконка скачивания — иначе SVG без размеров растягиваются на весь экран */
#sgResultActions .icon-svg { width: 16px; height: 16px; flex-shrink: 0; }
.sg-timer { display: inline-flex; align-items: center; gap: 8px; background: rgba(139, 92, 246, 0.1); border: 1px solid rgba(139, 92, 246, 0.25); border-radius: 20px; padding: 7px 14px; font-size: 0.85rem; color: #c4b5fd; margin-top: 4px; }
.sg-timer-dot { width: 7px; height: 7px; border-radius: 50%; background: #8b5cf6; animation: pulse-dot 1.5s ease-in-out infinite; }
@keyframes pulse-dot { 0%,100% { opacity: 0.4; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= Заказы (сайдбар) ================= */
.sg-orders-col { position: sticky; top: 16px; }
.sg-order-card {
    border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    padding: 12px; margin-bottom: 10px;
}
.sg-order-card video {
    width: 100%; aspect-ratio: 4/5; max-height: 240px; object-fit: contain;
    border-radius: 9px; background: #100d22; display: block; margin-bottom: 10px;
}
.sg-order-char-name { font-size: 13px; font-weight: 600; color: #f4efff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-order-text {
    font-size: 12px; color: #a99ebc; line-height: 1.4; margin-top: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sg-order-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 7px; }
.sg-order-date { font-size: 11.5px; color: var(--sg-faint); }
.sg-order-status { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 600; width: fit-content; }
.sg-order-status.completed { background: rgba(50, 198, 104, 0.1); color: #61df89; border: 1px solid rgba(57, 205, 110, 0.12); }
.sg-order-status.failed { background: rgba(231, 70, 91, 0.1); color: #ff6b7d; border: 1px solid rgba(231, 70, 91, 0.12); }
.sg-order-status.pending, .sg-order-status.audio_generating, .sg-order-status.video_generating, .sg-order-status.audio_done { background: rgba(235, 178, 51, 0.1); color: #f2bd52; border: 1px solid rgba(235, 178, 51, 0.12); }
.sg-order-actions { display: flex; gap: 6px; justify-content: flex-end; }
.sg-action-btn {
    width: 34px; height: 34px; border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(156, 120, 229, 0.12);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: 160ms ease; text-decoration: none;
    padding: 0;
}
.sg-action-btn:hover { background: rgba(145, 90, 244, 0.14); border-color: rgba(169, 113, 255, 0.4); }
.sg-action-btn .icon-svg { width: 15px; height: 15px; opacity: 0.8; }

/* ================= Адаптив ================= */
@media (max-width: 1180px) {
    .sg-cols { grid-template-columns: 1fr; }
    .sg-orders-col { position: static; }
    .sg-orders-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
}
@media (max-width: 1024px) {
    .sg-wrap { width: calc(100% - 32px); }
    .sg-chars { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .sg-select-grid { grid-template-columns: 1fr; }
    .sg-preview-col { position: static; max-width: 340px; }
    .sg-order-grid { grid-template-columns: 1fr 1fr; }
    .sg-order-cta-col { grid-column: 1 / -1; padding-left: 0; border-left: none; }
}
@media (max-width: 768px) {
    .sg-wrap { width: calc(100% - 24px); }
    .sg-hero { padding: 16px 18px; border-radius: 16px; }
    .sg-hero h1 { font-size: 1.25rem; }
    .sg-hero-sub { font-size: 0.8rem; margin-bottom: 10px; }
    .sg-hero-deco { width: 56px; height: 56px; right: 14px; }
    .sg-panel { padding: 15px; }

    .sg-filterbar { top: 8px; padding: 9px 10px; }
    .sg-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
    .sg-cats::-webkit-scrollbar { display: none; }

    /* Сетка 2 колонки — без горизонтального скролла карточек */
    .sg-chars { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

    /* Превью на мобильном появляется после выбора звезды (класс sg-shown из JS) */
    .sg-preview-col { display: none; }
    .sg-preview-col.sg-shown { display: block; max-width: 100%; margin-top: 16px; }

    .sg-order-grid { grid-template-columns: 1fr; gap: 14px; min-height: 0; }
    .sg-order-price-col { display: flex; align-items: center; justify-content: space-between; padding-left: 0; border-left: none; }
    .sg-order-star-ph { display: flex; }
    .sg-cta { height: 52px; }

    .sg-orders-list { grid-template-columns: 1fr 1fr; gap: 8px; }
    .sg-order-card video { max-height: 200px; }
    .sg-order-actions { justify-content: flex-start; }

    /* Отступ снизу, чтобы липкая панель не перекрывала контент */
    .sg-main-stack { padding-bottom: 20px; }
}
@media (max-width: 576px) {
    .sg-hero-deco { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .sg-char-card { transition: none; }
    .sg-char-card:hover { transform: none; }
    .sg-wrap { animation: none; }
}
