/* ===== Общие стили чата ===== */
.chat-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

/* Хедер чата */
.chat-header-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}
.char-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top;
    border: 2px solid var(--accent);
    flex-shrink: 0;
}
.char-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.char-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.char-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.char-messages-left {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(214, 51, 132, 0.08);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    white-space: nowrap;
}
.char-messages-left i { font-size: 1rem; }
.char-messages-left .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.desktop-only { display: flex; }
.mobile-only { display: none; }

/* Область сообщений */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.message {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.message p { margin: 0; word-break: break-word; white-space: pre-wrap; }
.message.user {
    align-self: flex-end;
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 4px;
}
.message.partner {
    align-self: flex-start;
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-bottom-left-radius: 4px;
}
.msg-time {
    font-size: 0.65rem;
    color: inherit;
    opacity: 0.6;
    margin-top: 4px;
    text-align: right;
}

.typing-indicator {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--card-bg);
    border-radius: 18px;
    border: 1px solid var(--border-light);
}
.typing-indicator span {
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

.story-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.action-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.action-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }
.action-btn i { font-size: 0.9rem; }

.audio-progress-panel {
    margin-top: 10px;
    background: rgba(214, 51, 132, 0.05);
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid rgba(214, 51, 132, 0.15);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.audio-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.audio-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(214, 51, 132, 0.1);
    border-radius: 3px;
    overflow: hidden;
}
.audio-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}
.inline-audio-player { display: flex; align-items: center; gap: 8px; }
.inline-audio-player audio { flex: 1; height: 32px; }

/* ===== Панель настроек ===== */
.settings-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(214, 51, 132, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0;
}
.setting-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 0;
    border-bottom: 1px solid rgba(214, 51, 132, 0.08);
}
.setting-block:first-child { padding-top: 0; }
.setting-block:last-child { border-bottom: none; padding-bottom: 0; }
.setting-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}
.setting-label { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.setting-value { font-size: 1rem; font-weight: 700; color: var(--accent); }

.clean-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(214, 51, 132, 0.1);
    -webkit-appearance: none; appearance: none;
    outline: none; cursor: pointer;
}
.clean-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--accent);
    box-shadow: 0 2px 6px rgba(214, 51, 132, 0.2);
}

.mode-switch-row { display: flex; gap: 8px; }
.mode-option {
    flex: 1;
    padding: 8px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    background: rgba(214, 51, 132, 0.05);
    border: 1px solid transparent;
    color: var(--text-secondary);
    transition: all 0.2s;
    text-align: center;
}
.mode-option.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(214, 51, 132, 0.2);
}

.mode-description {
    margin-top: 8px;
    background: rgba(214, 51, 132, 0.05);
    border: 1px solid rgba(214, 51, 132, 0.1);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.mode-description i { color: #FFD700; font-size: 1rem; margin-top: 2px; flex-shrink: 0; }
.mode-description span { flex: 1; }

/* ===== Кастомный селект (открывается вверх при нехватке места) ===== */
.custom-select-wrapper {
    width: 100%;
    position: relative;
}
.custom-select {
    position: relative;
    display: flex;
    flex-direction: column;
}
.custom-select__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--card-bg);
    border: 1px solid rgba(214, 51, 132, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-size: 0.9rem;
    color: var(--text-primary);
}
.custom-select__trigger:hover {
    border-color: var(--accent);
}
.custom-select.open .custom-select__trigger {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(214, 51, 132, 0.15);
}
.custom-select__trigger i {
    color: var(--accent);
    font-size: 0.8rem;
    transition: transform 0.2s;
}
.custom-select.open .custom-select__trigger i {
    transform: rotate(180deg);
}
.custom-options {
    position: absolute;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid rgba(214, 51, 132, 0.2);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(214, 51, 132, 0.1);
    display: none;
    flex-direction: column;
    z-index: 20;
    max-height: 220px;
    overflow-y: auto;
}
.custom-select.open .custom-options {
    display: flex;
}
.custom-options.open-down {
    top: calc(100% + 4px);
    bottom: auto;
}
.custom-options.open-up {
    bottom: calc(100% + 4px);
    top: auto;
}
.custom-option {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: background 0.15s;
    white-space: nowrap;
}
.custom-option:hover {
    background: rgba(214, 51, 132, 0.08);
}
.custom-option.selected {
    background: rgba(214, 51, 132, 0.12);
    font-weight: 600;
    color: var(--accent);
}

/* Поле ввода */
.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 16px 0 0;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}
.settings-btn {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(214, 51, 132, 0.1);
    border: none;
    color: var(--accent);
    font-size: 1.2rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.settings-btn:hover { background: var(--accent); color: white; }
.chat-input {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 12px 16px;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: "Inter", sans-serif;
    resize: none;
    max-height: 150px;
    outline: none;
    transition: border-color 0.2s;
    word-wrap: break-word;
}
.chat-input:focus { border-color: var(--accent); }
.send-btn {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.send-btn:hover { background: var(--accent-hover); }

/* ===== Адаптив ===== */
@media (max-width: 768px) {
    .desktop-only { display: none; }
    .mobile-only { display: flex; margin-top: 4px; align-self: flex-start; }
    .char-status { display: none; }
    .message { max-width: 85%; }
    .action-btn { padding: 6px 10px; font-size: 0.8rem; }
    .settings-panel { padding: 12px 16px; }
    .mode-option { font-size: 0.8rem; }
    .setting-label { font-size: 0.85rem; }
    .setting-block { padding: 14px 0; }
    .custom-select__trigger { font-size: 0.85rem; padding: 8px 12px; }
    .custom-option { font-size: 0.85rem; padding: 8px 12px; }
}
/* ===== Живая карточка генерации рассказа ===== */
.message.gen-card { max-width: 420px; padding: 16px 18px; }
.gen-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.gen-head b { display: block; font-size: 1rem; color: var(--text-primary); }
.gen-head small { color: var(--text-secondary); font-size: .8rem; font-variant-numeric: tabular-nums; }
.gen-pen { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff;
    background: linear-gradient(135deg, #ff5fa2, #D63384 55%, #8a2be2); animation: genWrite 1.2s ease-in-out infinite; }
@keyframes genWrite { 0%, 100% { transform: rotate(-8deg) translateY(0); } 50% { transform: rotate(8deg) translateY(-2px); } }
.gen-bar { height: 6px; border-radius: 99px; background: rgba(214,51,132,.15); overflow: hidden; margin-bottom: 12px; }
.gen-bar i { display: block; height: 100%; transform-origin: left; transform: scaleX(.04); transition: transform .25s linear;
    background: linear-gradient(90deg, #ff5fa2, #D63384, #8a2be2); }
.gen-stages { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.gen-stages li { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--text-secondary); opacity: .55; transition: opacity .3s; }
.gen-stages li.now { opacity: 1; color: var(--text-primary); font-weight: 600; }
.gen-stages li.done { opacity: .85; }
.gen-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(214,51,132,.5); flex: 0 0 16px; position: relative; }
.gen-stages li.now .gen-dot { border-color: #D63384; animation: genPulse 1s ease-in-out infinite; }
.gen-stages li.done .gen-dot { background: #D63384; border-color: #D63384; }
.gen-stages li.done .gen-dot::after { content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .6rem; color: #fff; font-weight: 900; }
@keyframes genPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
.gen-tease { margin: 6px 0 0; font-size: .9rem; font-style: italic; color: var(--text-primary); }
.gen-fade { animation: genFade .5s ease; }
@keyframes genFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .gen-pen, .gen-stages li.now .gen-dot { animation: none; } }
#styleOptions { max-height: min(50vh, 360px); overflow-y: auto; -webkit-overflow-scrolling: touch; }


/* 30.09 тест «обрыв на самом интересном» */
.message .story-lock { position: relative; margin-top: -8px; }
.story-lock-fade { height: 56px; margin-top: -56px; position: relative; pointer-events: none;
    background: linear-gradient(to bottom, transparent, var(--bg-message-partner, var(--card-bg, #221f29))); }
.story-lock-body { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
    padding: 14px 12px 12px; border: 1px dashed rgba(214, 51, 132, .45); border-radius: 16px; margin-top: 6px; }
.story-lock-body b { font-size: 16px; }
.story-lock-body span { font-size: 13px; opacity: .75; }
.story-unlock-btn { white-space: nowrap; max-width: 100%; margin-top: 4px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 40px; cursor: pointer;
    background: linear-gradient(135deg, #e0428f, #b02a74); color: #fff; font-weight: 700; font-size: 15px; }
.story-unlock-btn[disabled] { opacity: .6; }
.story-lock-sub { font-size: 13px; color: var(--accent, #D63384); text-decoration: none; }
.story-lock-msg { font-size: 12px; color: #ff7a9c; min-height: 14px; }
.custom-option .ero-svg, .custom-select__trigger-text .ero-svg { color: var(--accent); margin-right: 6px; }

/* 01.10: заголовок панели, «Готово» и строка текущих настроек над полем ввода */
.sp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sp-head b { font-size: 1rem; color: var(--text-primary); }
.sp-close { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border-light); background: transparent; color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sp-close:hover { color: var(--accent); border-color: var(--accent); }
.sp-done { display: block; width: 100%; margin-top: 14px; padding: 12px; border: 0; border-radius: 14px; font-weight: 800; font-size: 1rem; color: #fff; cursor: pointer;
    background: linear-gradient(135deg, #D63384, #E91E63); box-shadow: 0 8px 18px rgba(214, 51, 132, .3); font-family: inherit; }
.settings-summary { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; width: fit-content; max-width: 100%; margin: 0 0 8px; padding: 7px 14px; border-radius: 999px;
    border: 1px solid var(--border-light); background: var(--card-bg); color: var(--text-secondary); font-size: .85rem; cursor: pointer; font-family: inherit; text-align: left; }
.settings-summary:hover { border-color: var(--accent); color: var(--text-primary); }
.settings-summary i, .settings-summary .ero-svg { color: var(--accent); }
.settings-summary .ss-edit { color: var(--accent); font-weight: 700; margin-left: 4px; }
.settings-summary { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
@media (max-width: 600px) { .settings-summary { font-size: .78rem; padding: 6px 12px; gap: 5px; } .settings-summary .ss-edit { display: none; } }

/* 01.10: кнопка настроек — удобная для пальца высота */
.settings-summary { min-height: 34px; }

/* 06.10: пробный пакет в «обрыве» */
.story-trial-btn { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 18px; border-radius: 16px; text-decoration: none; font-weight: 800; font-size: 14px; color: #3d1d00 !important; background: linear-gradient(135deg, #fff1a8, #f2c14e 55%, #f59e0b); box-shadow: 0 10px 22px -12px rgba(242, 193, 78, .9); }
.story-trial-btn small { font-weight: 600; font-size: 11.5px; opacity: .8; }

/* 08.10: карточка новичка в генераторе — одно поле, одна кнопка, готовые идеи */
.gen-start { align-self: stretch; margin: 6px 0 4px; padding: 18px 16px 14px; border-radius: 20px;
    background: linear-gradient(160deg, rgba(214, 51, 132, .14), rgba(124, 58, 237, .08)); border: 1px solid rgba(214, 51, 132, .3);
    animation: gsIn .35s cubic-bezier(.2, 1.2, .4, 1) both; }
.gs-title { font-size: 20px; font-weight: 800; line-height: 1.25; margin: 0 0 12px; color: var(--text-primary, #fff); }
.gs-input { width: 100%; box-sizing: border-box; resize: none; min-height: 84px; padding: 13px 14px; border-radius: 14px;
    border: 1px solid var(--border-light, rgba(255, 255, 255, .14)); background: var(--input-bg, rgba(0, 0, 0, .25));
    color: var(--text-primary, #fff); font: inherit; font-size: 16px; line-height: 1.4; }
.gs-input:focus { outline: none; border-color: var(--accent, #d6337f); box-shadow: 0 0 0 3px rgba(214, 51, 132, .2); }
.gs-shake { animation: gsShake .35s; }
.gs-go { width: 100%; margin-top: 10px; min-height: 54px; border: 0; border-radius: 999px; cursor: pointer; color: #fff;
    font: inherit; font-size: 17px; font-weight: 800; background: linear-gradient(135deg, #ff4d9a, #d6337f 55%, #a855f7);
    box-shadow: 0 10px 28px rgba(214, 51, 132, .4); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.gs-go:active { transform: scale(.98); }
.gs-or { margin: 14px 2px 8px; font-size: 14px; color: var(--text-secondary, #a59aa8); text-align: center; }
.gs-chips { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.gs-chips .gen-idea { padding: 9px 13px; border-radius: 999px; cursor: pointer; border: 1px solid rgba(214, 51, 132, .4);
    background: rgba(214, 51, 132, .08); color: var(--text-primary, #fff); font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; }
.gs-chips .gen-idea:active { transform: scale(.96); }
.gs-note { margin-top: 12px; text-align: center; font-size: 13px; color: var(--text-secondary, #a59aa8); }
/* пока новичок не создал первый рассказ — одна форма: нижняя панель и «Режим» спрятаны */
body.gen-fresh .chat-input-area, body.gen-fresh .settings-summary { display: none !important; }
@keyframes gsIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes gsShake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* 08.10: режим новичка — без длинного приветствия (его заменяет карточка); на узком экране идеи по две в ряд */
body.gen-fresh #chatMessages > .message.partner:first-child { display: none; }
@media (max-width: 380px) {
    .gen-start { padding: 16px 12px 12px; }
    .gs-title { font-size: 18px; }
    .gs-chips .gen-idea { font-size: 13px; padding: 8px 10px; }
}
/* 08.10: надпись кнопки в одну строку */
.gs-go { white-space: nowrap; padding: 0 14px; }
@media (max-width: 380px) { .gs-go { font-size: 15px; gap: 6px; } }
/* 08.10: подсказка нижнего поля целиком на узком экране */
@media (max-width: 380px) { .chat-input-area .chat-input::placeholder { font-size: 14px; } }

/* 08.10: после рассказа — «Продолжить» главная, «Послушать голосом» вторая заметная, остальные обычные */
.story-actions .continue-btn { flex: 1 1 100%; justify-content: center; min-height: 46px; font-size: 15px; border: 0; color: #fff;
    background: linear-gradient(135deg, #ff4d9a, #d6337f 60%, #a855f7); box-shadow: 0 8px 22px rgba(214, 51, 132, .35); }
.story-actions .continue-btn:hover { color: #fff; filter: brightness(1.06); }
.story-actions .audio-btn { flex: 1 1 100%; justify-content: center; min-height: 44px; font-size: 14.5px;
    border-color: rgba(214, 51, 132, .55); color: var(--accent, #d6337f); background: rgba(214, 51, 132, .08); }
.story-actions .rewrite-btn, .story-actions .download-btn { flex: 1 1 calc(50% - 4px); justify-content: center; }

/* 08.10: «Обычный | Продвинутый» на виду */
.gen-mode-bar { display: flex; gap: 8px; margin: 0 0 8px; }
.gm-chip { flex: 1 1 0; min-height: 42px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border-light, rgba(255, 255, 255, .12));
    background: var(--card-bg, #26262c); color: var(--text-secondary, #a59aa8); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; }
.gm-chip.gm-adv:not(.active) { border-color: rgba(214, 51, 132, .55); color: var(--accent, #d6337f); }
.gm-chip.active { background: var(--accent, #d6337f); border-color: var(--accent, #d6337f); color: #fff; }
.gen-start .gen-mode-bar { margin: 10px 0 4px; }
.gs-modehint { text-align: center; font-size: 13px; color: var(--text-secondary, #a59aa8); margin: 0 0 2px; }
body.gen-fresh > .gen-mode-bar { display: none; }
@media (max-width: 380px) { .gm-chip { font-size: 13px; padding: 0 8px; } }
/* 08.10: порядок кнопок под рассказом и без задвоения режима */
.story-actions .continue-btn { order: 1; }
.story-actions .audio-btn { order: 2; }
.story-actions .rewrite-btn, .story-actions .download-btn { order: 3; flex: 1 1 40%; min-width: 0; box-sizing: border-box; }
.story-actions .action-btn { box-sizing: border-box; }
.gen-mode-bar ~ .settings-summary { display: none !important; }

/* 08.10: аудио готово — заметно */
.audio-progress-panel.audio-ready { border: 1px solid rgba(214, 51, 132, .5); border-radius: 14px; padding: 10px; background: rgba(214, 51, 132, .08);
    animation: arIn .4s ease both; }
.audio-ready-t { font-weight: 700; margin: 0 0 8px; color: var(--text-primary, #fff); display: flex; align-items: center; gap: 8px; }
.audio-ready-t i { color: var(--accent, #d6337f); }
.audio-progress-fill { transition: width .25s linear; }
@keyframes arIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 08.10: свой аудиоплеер в стиле сайта */
.ap { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 18px; background: var(--card-bg, #26262c);
    border: 1px solid var(--border-light, rgba(255, 255, 255, .1)); }
.ap audio { display: none; }
.ap-play { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; font-size: 18px;
    background: linear-gradient(135deg, #ff4d9a, #d6337f 60%, #a855f7); box-shadow: 0 8px 22px rgba(214, 51, 132, .4);
    display: inline-flex; align-items: center; justify-content: center; }
.ap-play .fa-play { margin-left: 3px; }
.ap-on .ap-play { animation: apPulse 1.6s ease-in-out infinite; }
.ap-mid { flex: 1 1 auto; min-width: 0; }
.ap-seek { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; cursor: pointer; outline: none;
    background: linear-gradient(90deg, var(--accent, #d6337f) var(--p, 0%), rgba(127, 127, 127, .3) var(--p, 0%)); }
.ap-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--accent, #d6337f); }
.ap-seek::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--accent, #d6337f); }
.ap-time { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--text-secondary, #a59aa8); font-variant-numeric: tabular-nums; }
.ap-speed, .ap-dl { flex: 0 0 auto; min-width: 40px; height: 36px; padding: 0 8px; border-radius: 12px; border: 1px solid var(--border-light, rgba(255, 255, 255, .12));
    background: transparent; color: var(--text-primary, #fff); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
@keyframes apPulse { 0%, 100% { box-shadow: 0 8px 22px rgba(214, 51, 132, .4); } 50% { box-shadow: 0 8px 30px rgba(214, 51, 132, .75); } }
@media (max-width: 360px) { .ap { gap: 8px; padding: 9px; } .ap-play { flex-basis: 46px; width: 46px; height: 46px; } .ap-speed { display: none; } }
/* 08.10: плеер без двойной рамки */
.audio-progress-panel .ap { background: transparent; border: 0; padding: 4px 2px; }

/* 08.10: длинный запрос — счётчик и цена под полем */
.lp-hint { margin: 6px 4px 0; font-size: 13px; line-height: 1.4; color: rgba(255, 255, 255, .62); }
.lp-hint.warn { color: #ffb4d0; }
.lp-hint .lp-on { margin-left: 6px; padding: 4px 12px; border: 0; border-radius: 999px; background: #e0337a; color: #fff;
  font: inherit; font-weight: 600; cursor: pointer; }

/* 11.10: подсказка про знаки и цену под полем промпта читается и в светлой теме */
html:not(.dark-theme) .lp-hint { color: #5b4352; }
html:not(.dark-theme) .lp-hint.warn { color: #b3135f; }

/* 11.10: подсказка под ползунком длины рассказа */
.length-hint { margin: 8px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--text-muted, #a89cb0); transition: color .2s, transform .2s; }
.length-hint.paid { color: #f6c978; font-weight: 600; }
