/* =========================================
   ПЕРЕМЕННЫЕ И БАЗА
   ========================================= */
:root {
    --bg: #0a0713;
    --card: rgba(28, 20, 48, 0.6);
    --card-border: rgba(140, 100, 255, 0.16);
    --text: #ede9ff;
    --muted: #9a92bd;
    --accent: #a06bff;
    --accent-2: #7c4dff;
    --radius: 20px;
    --radius-sm: 12px;
    --danger: #ff6b6b;
    --success: #4ade80;
    --sidebar-w: 240px;
    --topbar-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
}

/* =========================================
   ОБЩИЙ КАРКАС (СЕТКА)
   ========================================= */
.app {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: rgba(15, 10, 25, 0.7);
    border-right: 1px solid var(--card-border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
}

.app-main {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.content {
    flex-grow: 1;
    padding: 32px 24px 0;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* =========================================
   САЙДБАР
   ========================================= */
.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 32px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(160, 107, 255, 0.1);
}
.brand-logo { width: 48px; height: 48px; object-fit: contain; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-label {
    font-size: 11px; text-transform: uppercase; color: var(--muted);
    letter-spacing: 1px; padding: 8px;
}
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--muted); text-decoration: none; font-size: 14px;
    transition: all .2s;
}
.nav-item:hover { background: rgba(160,107,255,0.08); color: var(--text); }
.nav-item.is-active { background: rgba(160,107,255,0.15); color: var(--accent); }
.nav-item i { font-size: 20px; }

.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--card-border); }

/* =========================================
   ТОПБАР (ШАПКА)
   ========================================= */
.topbar {
    height: var(--topbar-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--card-border);
    background: rgba(10, 7, 19, 0.6);
    backdrop-filter: blur(20px);
    position: sticky; top: 0; z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-title { font-size: 15px; font-weight: 500; color: var(--text); display: flex; align-items: center; }
.breadcrumb-link { color: var(--muted); text-decoration: none; font-weight: 400; transition: color 0.2s; }
.breadcrumb-link:hover { color: var(--accent); }

.topbar-right { display: flex; align-items: center; gap: 16px; }
.balance {
    display: flex; align-items: center; gap: 6px; text-decoration: none; color: var(--accent);
    background: rgba(160,107,255,0.1); padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 14px;
    transition: all .2s;
}
.balance:hover { background: rgba(160,107,255,0.2); }

/* Дропдаун юзера */
.user-drop { position: relative; cursor: pointer; }
.user-drop .avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(160,107,255,0.3); }
.user-drop .avatar-empty { display: grid; place-items: center; background: var(--accent-2); color: #fff; font-weight: 600; }
.user-menu {
    position: absolute; right: 0; top: 100%; margin-top: 8px;
    background: #1a1030; border: 1px solid var(--card-border); border-radius: var(--radius-sm);
    min-width: 160px; display: none; flex-direction: column; padding: 6px; z-index: 50;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.user-drop.open .user-menu { display: flex; }
.user-menu a, .user-menu .link-btn {
    padding: 8px 12px; color: var(--text); text-decoration: none; border-radius: 6px;
    font-size: 14px; transition: background .2s; text-align: left;
    background: transparent; border: none; cursor: pointer; font-family: inherit;
}
.user-menu a:hover, .user-menu .link-btn:hover { background: rgba(160,107,255,0.15); }
.hidden { display: none !important; }
/* =========================================
   КНОПКИ И КАРТОЧКИ
   ========================================= */
.btn { display: inline-flex; align-items: center; gap: 8px; border: none; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; text-decoration: none; transition: all .2s; }
.btn-primary { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; font-weight: 600; padding: 10px 18px; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(124,77,255,0.4); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-ghost { background: transparent; border: 1px solid var(--card-border); color: var(--muted); padding: 6px 12px; border-radius: 8px; font-size: 12px; cursor: pointer; transition: all .2s; }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }

.card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); backdrop-filter: blur(20px); overflow: hidden; }
.module-card { padding: 28px; }

/* =========================================
   ГЛАВНАЯ (ВИТРИНА)
   ========================================= */
.hero { text-align: center; margin-bottom: 48px; padding-top: 20px; }
.hero h1 { font-size: clamp(28px, 5vw, 48px); line-height: 1.1; font-weight: 800; letter-spacing: -1px; margin-bottom: 16px; }
.grad { background: linear-gradient(120deg, #b07dff 0%, #ff6bd6 50%, #6bc4ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { color: var(--muted); font-size: 16px; max-width: 500px; margin: 0 auto; line-height: 1.55; }

.modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.module-card-link { text-decoration: none; color: inherit; display: block; }
.module-tile { padding: 24px; height: 100%; display: flex; flex-direction: column; transition: all .3s; border: 1px solid var(--card-border); }
.module-card-link:hover .module-tile { border-color: rgba(160,107,255,0.4); transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,0.3); background: rgba(28,20,48,0.8); }
.tile-icon { width: 48px; height: 48px; border-radius: 12px; background: rgba(160,107,255,0.1); display: grid; place-items: center; font-size: 24px; color: var(--accent); margin-bottom: 16px; }
.tile-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.tile-desc { color: var(--muted); font-size: 14px; line-height: 1.5; margin-bottom: 24px; flex-grow: 1; }
.tile-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.badge { background: rgba(160,107,255,0.1); color: var(--accent); padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.badge-free { background: rgba(74,222,128,0.1); color: var(--success); }
.tile-arrow { color: var(--muted); transition: transform .2s; }
.module-card-link:hover .tile-arrow { transform: translateX(4px); color: var(--accent); }

/* =========================================
   МОДУЛИ (ОБЩЕЕ)
   ========================================= */
.module-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.module-head i { font-size: 32px; color: var(--accent); }
.module-title { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.module-desc { color: var(--muted); font-size: 14px; }

.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    border: 2px dashed rgba(160,107,255,0.3); border-radius: var(--radius);
    padding: 40px 20px; background: rgba(10,7,19,0.3); cursor: pointer; transition: all .2s;
    margin-bottom: 24px; text-align: center;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: rgba(160,107,255,0.05); }
.dropzone input[type=file] { display: none; }
.dz-icon { font-size: 32px; color: var(--accent); }
.dz-text { font-weight: 500; font-size: 15px; }
.dz-hint { font-size: 12px; color: var(--muted); }

.cost-bar {
    display: flex; justify-content: space-between; align-items: center; padding-top: 16px;
    border-top: 1px solid var(--card-border); gap: 16px; flex-wrap: wrap;
}
.cost-bar b { color: var(--accent); }

.btn-generate {
    padding: 14px 24px; background: linear-gradient(135deg, var(--accent-2), var(--accent));
    border: none; border-radius: var(--radius-sm); color: #fff; font-family: inherit;
    font-size: 15px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
    box-shadow: 0 4px 24px rgba(124,77,255,0.4); transition: all .2s;
}
.btn-generate:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(124,77,255,0.6); }
.btn-generate:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* =========================================
   МОДУЛЬ SPEECH (ФОРМА)
   ========================================= */
.text-input {
    width: 100%; min-height: 160px; max-height: 400px;
    background: rgba(10, 7, 19, 0.5); border: 1px solid rgba(160,107,255,0.15);
    border-radius: 14px; color: var(--text); padding: 16px;
    font-family: inherit; font-size: 15px; line-height: 1.55;
    resize: vertical; outline: none; transition: border-color .2s; margin-bottom: 10px;
}
.text-input:focus { border-color: var(--accent); }
.text-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 12px; color: var(--muted); }
.char-counter { font-variant-numeric: tabular-nums; }

.tags-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; padding: 12px 14px; background: rgba(10, 7, 19, 0.35); border: 1px solid rgba(160,107,255,0.1); border-radius: 12px; }
.tags-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-right: 4px; }
.tag-btn { background: rgba(160,107,255,0.1); border: 1px solid rgba(160,107,255,0.2); color: var(--text); padding: 6px 12px; border-radius: 8px; font-family: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: all .2s; }
.tag-btn:hover { background: rgba(160,107,255,0.22); border-color: var(--accent); transform: translateY(-1px); }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.setting { display: flex; flex-direction: column; gap: 6px; }
.setting-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.select { width: 100%; background: rgba(10,7,19,0.5); border: 1px solid rgba(160,107,255,0.15); border-radius: var(--radius-sm); color: var(--text); padding: 10px 12px; font-family: inherit; font-size: 14px; outline: none; transition: border-color .2s; }
.select:focus { border-color: var(--accent); }

.voice-picker { display: flex; gap: 8px; }
.voice-picker .select { flex: 1; }
.preview-btn { width: 42px; height: 42px; background: rgba(160,107,255,0.12); border: 1px solid rgba(160,107,255,0.25); border-radius: 10px; color: var(--text); cursor: pointer; font-size: 14px; transition: all .2s; flex-shrink: 0; display: grid; place-items: center; }
.preview-btn:hover { background: rgba(160,107,255,0.25); border-color: var(--accent); }
.preview-btn.playing { background: linear-gradient(135deg, var(--accent-2), var(--accent)); border-color: var(--accent); box-shadow: 0 0 20px rgba(160,107,255,0.5); }

.advanced-settings { margin-bottom: 20px; border-top: 1px solid rgba(160,107,255,0.1); padding-top: 16px; }
.advanced-settings summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 500; padding: 6px 0; user-select: none; list-style: none; }
.advanced-settings summary::-webkit-details-marker { display: none; }
.advanced-settings summary::before { content: '▸ '; display: inline-block; transition: transform .2s; }
.advanced-settings[open] summary::before { transform: rotate(90deg); }

.sliders { display: grid; gap: 14px; margin-top: 14px; }
.slider-row label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.slider-row .val { color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 600; }
.slider-row input[type=range] { width: 100%; height: 4px; border-radius: 999px; background: rgba(160,107,255,0.15); appearance: none; -webkit-appearance: none; outline: none; cursor: pointer; }
.slider-row input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 0 0 12px rgba(160,107,255,0.7); cursor: pointer; }

.checkbox-row label { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); cursor: pointer; }
.checkbox-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

/* =========================================
   ИСТОРИЯ
   ========================================= */
.history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; margin-top: 40px; }
.history-head h2 { font-size: 20px; font-weight: 700; }
.history-list { display: flex; flex-direction: column; gap: 16px; }
.history-item { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 20px; transition: border-color .3s; overflow: hidden; }
.history-item:hover { border-color: rgba(160,107,255,0.35); }

.history-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.history-item-info { flex: 1; min-width: 0; }
.history-item-text { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.history-item-meta { font-size: 13px; color: var(--muted); }
.history-item-actions { display: flex; gap: 8px; }

.history-item-actions a, .history-item-actions button { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: rgba(160,107,255,0.1); border: 1px solid rgba(160,107,255,0.2); border-radius: 8px; color: var(--text); text-decoration: none; transition: all .2s; cursor: pointer; }
.history-item-actions a:hover, .history-item-actions button:hover { background: rgba(160,107,255,0.25); border-color: var(--accent); }
.history-item-actions i { font-size: 18px; }

.history-wave { height: 56px; background: rgba(10, 7, 19, 0.45); border-radius: 10px; overflow: hidden; position: relative; cursor: pointer; }

/* =========================================
   ПРОЧЕЕ (ПРОФИЛЬ, ТАБЛИЦЫ, ФУТЕР)
   ========================================= */
.profile-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 32px; background: var(--card); padding: 24px; border-radius: var(--radius); border: 1px solid var(--card-border); }
.profile-info { display: flex; align-items: center; gap: 20px; }
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(160,107,255,0.4); }
.profile-info h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.muted { color: var(--muted); font-size: 14px; }
.profile-balance-box { background: rgba(10,7,19,0.4); padding: 16px 24px; border-radius: var(--radius-sm); border: 1px solid rgba(160,107,255,0.15); text-align: center; min-width: 200px; }
.balance-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.balance-value { font-size: 32px; font-weight: 800; color: var(--accent); }
.tokens-label { font-size: 14px; font-weight: 500; color: var(--muted); }

.card-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--card-border); }
.card-head h2 { font-size: 18px; font-weight: 600; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 14px 24px; text-align: left; border-bottom: 1px solid rgba(160,107,255,0.06); font-size: 14px; }
.table th { font-size: 12px; text-transform: uppercase; color: var(--muted); font-weight: 500; letter-spacing: 0.5px; }
.table tbody tr:hover { background: rgba(160,107,255,0.04); }
.table tbody tr:last-child td { border-bottom: none; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.site-footer { background: rgba(15, 10, 25, 0.4); border-top: 1px solid var(--card-border); padding: 48px 24px 24px; margin-top: 60px; }
.footer-content { max-width: 1000px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 40px; margin-bottom: 40px; }
.footer-brand { max-width: 250px; }
.footer-logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 18px; text-decoration: none; margin-bottom: 12px; }
.footer-desc { color: var(--muted); font-size: 13px; line-height: 1.6; }
.footer-links { display: flex; gap: 60px; }
.footer-col h4 { font-size: 14px; font-weight: 600; margin-bottom: 16px; color: var(--text); }
.footer-col a { display: block; color: var(--muted); font-size: 13px; text-decoration: none; margin-bottom: 10px; transition: color 0.2s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { max-width: 1000px; margin: 0 auto; padding-top: 24px; border-top: 1px solid rgba(160, 107, 255, 0.08); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 12px; }

/* =========================================
   МОДАЛЬНОЕ ОКНО И TOAST
   ========================================= */
.modal-overlay { position: fixed; inset: 0; background: rgba(5, 3, 10, 0.85); backdrop-filter: blur(8px); z-index: 10000; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.25s ease; pointer-events: none; }
.modal-overlay:not(.hidden) { opacity: 1; pointer-events: auto; }
.modal-box { background: #141024; border: 1px solid var(--card-border); border-radius: var(--radius); padding: 32px; max-width: 400px; width: 90%; text-align: center; transform: translateY(20px); transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.modal-overlay:not(.hidden) .modal-box { transform: translateY(0); }
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.modal-text { font-size: 15px; color: var(--muted); line-height: 1.5; margin-bottom: 28px; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }
.modal-actions button { padding: 10px 20px; font-size: 14px; font-weight: 600; border-radius: 10px; cursor: pointer; font-family: inherit; border: none; transition: all 0.2s; }
.btn-danger { background: linear-gradient(135deg, #e53e3e, #c53030); color: #fff; box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3); }
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(229, 62, 62, 0.5); }

/* Toast */
.toast {
    position: fixed; top: 24px; left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: linear-gradient(135deg, #2a8a4a, #1e6b38);
    color: #fff; padding: 12px 24px; border-radius: 12px;
    font-size: 14px; font-weight: 600; z-index: 10000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    max-width: 90vw; text-align: center;
    opacity: 0; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}
.toast:not(.hidden) { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: linear-gradient(135deg, #e53e3e, #c53030); }
.toast.info { background: linear-gradient(135deg, var(--accent-2), var(--accent)); }
.toast.hidden { display: block !important; opacity: 0; transform: translateX(-50%) translateY(-20px); }

/* =========================================
   АДАПТИВ (МОБИЛЬНАЯ ВЕРСИЯ)
   ========================================= */
.topbar-mobile-logo { display: none; }

@media (max-width: 900px) {
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform 0.3s ease; z-index: 1000; background: #0a0713; box-shadow: 4px 0 24px rgba(0,0,0,0.5); }
    .sidebar.open { transform: translateX(0); }
    .burger { display: flex; align-items: center; justify-content: center; background: transparent; border: none; color: var(--text); font-size: 24px; cursor: pointer; padding: 8px; margin-right: 8px; }
    .topbar-title { display: none; }
    .topbar-mobile-logo { display: flex; margin: 0 auto; }
    .topbar-right .btn-primary { padding: 6px 10px; font-size: 0; }
    .topbar-right .btn-primary i { font-size: 16px; margin: 0; }
    .topbar { padding: 0 16px; }
    .settings-grid { grid-template-columns: 1fr; }
    .footer-content { flex-direction: column; gap: 32px; }
    .footer-links { gap: 32px; flex-direction: column; }
    .footer-bottom { flex-direction: column; text-align: center; }
}
@media (min-width: 901px) {
    .burger { display: none; }
    .topbar-mobile-logo { display: none; }
}
/* =========================================
   ОБЩИЕ СТИЛИ ДЛЯ МОДУЛЕЙ (Convert, Extract)
   ========================================= */

.module-form {
    display: block;
}

.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    border: 2px dashed rgba(160,107,255,0.3); border-radius: var(--radius);
    padding: 40px 20px; background: rgba(10,7,19,0.3); cursor: pointer; transition: all .2s;
    margin-bottom: 24px; text-align: center;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: rgba(160,107,255,0.05); }
.dropzone input[type=file] { display: none; }
.dz-icon { font-size: 32px; color: var(--accent); }
.dz-text { font-weight: 500; font-size: 15px; }
.dz-hint { font-size: 12px; color: var(--muted); }

.cost-bar {
    display: flex; justify-content: space-between; align-items: center; padding-top: 16px;
    border-top: 1px solid var(--card-border); gap: 16px; flex-wrap: wrap;
}
.cost-bar b { color: var(--accent); }

.btn-generate {
    padding: 14px 24px; background: linear-gradient(135deg, var(--accent-2), var(--accent));
    border: none; border-radius: var(--radius-sm); color: #fff; font-family: inherit;
    font-size: 15px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
    box-shadow: 0 4px 24px rgba(124,77,255,0.4); transition: all .2s;
}
.btn-generate:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(124,77,255,0.6); }
.btn-generate:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* Прогресс бар */
.progress-card { padding: 28px; margin-top: 24px; }
.progress-head { display: flex; align-items: center; gap: 16px; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 3px solid rgba(160,107,255,0.15); border-top-color: var(--accent); animation: spin 1s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-title { font-weight: 600; font-size: 15px; }
.progress-note { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* Результат (конвертер/извлечение) */
.result {
    text-align: center;
    padding: 32px;
    background: rgba(160,107,255,0.05);
    border-radius: var(--radius-sm);
    margin-top: 24px;
    border: 1px solid var(--card-border);
}
.result-inner i {
    font-size: 48px;
    color: var(--success);
    margin-bottom: 12px;
    display: block;
}
.result-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Обязательно скрываем всё, что помечено .hidden */
.hidden { display: none !important; }
/* =========================================
   МИНУСОВКА (ТРЕКИ И ПЛЕЕРЫ)
   ========================================= */
.mode-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode-btn { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: rgba(10, 7, 19, 0.5); border: 1px solid rgba(160,107,255,0.15); border-radius: 12px; color: var(--muted); font-family: inherit; font-size: 14px; text-align: left; cursor: pointer; transition: all .2s; }
.mode-btn:hover { border-color: rgba(160,107,255,0.4); color: var(--text); }
.mode-btn.active { background: linear-gradient(135deg, rgba(124,77,255,0.25), rgba(160,107,255,0.15)); border-color: var(--accent); color: var(--text); box-shadow: 0 0 24px rgba(160,107,255,0.25); }
.mode-title { font-weight: 600; font-size: 14px; }
.mode-hint { font-size: 11px; color: var(--muted); line-height: 1.35; }
.mode-btn.active .mode-hint { color: rgba(237, 233, 255, 0.7); }
.badge { display: inline-block; margin-left: 4px; padding: 1px 6px; font-size: 10px; border-radius: 4px; background: rgba(255,107,214,0.2); color: #ff6bd6; font-weight: 500; vertical-align: middle; }

.tracks { display: flex; flex-direction: column; gap: 16px; }
.track { padding: 20px; transition: border-color .3s; }
.track:hover { border-color: rgba(160,107,255,0.35); }
.track-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.track-label { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 12px currentColor; }
.track-label .stem-name { color: var(--text); }

.dl-group { display: flex; gap: 8px; }
.btn-download { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; background: rgba(160,107,255,0.08); border: 1px solid rgba(160,107,255,0.2); color: var(--text); text-decoration: none; font-size: 12.5px; font-weight: 500; transition: all .2s; }
.btn-download.primary { background: rgba(160,107,255,0.16); border-color: rgba(160,107,255,0.45); }
.btn-download:hover { background: rgba(160,107,255,0.28); border-color: var(--accent); transform: translateY(-1px); }

.wave-container { position: relative; width: 100%; max-width: 100%; height: 80px; background: rgba(10, 7, 19, 0.45); border-radius: 12px; margin-bottom: 16px; overflow: hidden; border: 1px solid rgba(160,107,255,0.08); }
.wave-container canvas { width: 100% !important; display: block; }

.player-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.play-btn { width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: white; transition: transform .2s, box-shadow .3s; box-shadow: 0 4px 20px rgba(124,77,255,0.4); flex-shrink: 0; font-size: 16px; }
.play-btn:hover { transform: scale(1.06); box-shadow: 0 6px 26px rgba(124,77,255,0.6); }

.time { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); min-width: 92px; flex-shrink: 0; }
.volume-row { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 180px; }
.volume-row input[type=range] { flex: 1; height: 4px; border-radius: 999px; background: rgba(160,107,255,0.15); appearance: none; -webkit-appearance: none; outline: none; cursor: pointer; }
.volume-row input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 0 0 12px rgba(160,107,255,0.7); cursor: pointer; }
/* Плеер предпросмотра тональности */
.preview-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.preview-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-note {
    font-size: 11px;
    color: var(--muted);
}

.preview-wave-container {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(10,7,19,0.5);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
}

.preview-wave-container .play-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    color: white;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(124,77,255,0.3);
}

.preview-wave {
    flex: 1;
    min-width: 0;
    height: 64px;
    overflow: hidden;
    cursor: pointer;
}

.pitch-slider-wrap {
    background: rgba(10,7,19,0.3);
    border: 1px solid rgba(160,107,255,0.1);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.pitch-slider-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pitch-label {
    font-size: 13px;
    color: var(--muted);
}

.pitch-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
}

#pitch-slider {
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: rgba(160,107,255,0.15);
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    cursor: pointer;
}

#pitch-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    box-shadow: 0 0 12px rgba(160,107,255,0.7);
    cursor: pointer;
    transition: transform 0.1s;
}
#pitch-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}
/* =========================================
   АДМИНКА
   ========================================= */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--card-border);
}
.admin-title { font-size: 24px; font-weight: 700; }
.admin-tabs { display: flex; gap: 8px; margin-bottom: 24px; }
.admin-tab {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all .2s;
}
.admin-tab:hover { color: var(--text); background: rgba(160,107,255,0.1); }
.admin-tab.active { color: var(--accent); background: rgba(160,107,255,0.15); }

.admin-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.admin-table th, .admin-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(160,107,255,0.06); font-size: 14px; }
.admin-table th { font-size: 12px; text-transform: uppercase; color: var(--muted); font-weight: 600; letter-spacing: 0.5px; }
.admin-table tbody tr:hover { background: rgba(160,107,255,0.04); }
.admin-table input[type="text"], .admin-table input[type="number"] {
    background: rgba(10,7,19,0.5);
    border: 1px solid rgba(160,107,255,0.2);
    border-radius: 6px;
    color: var(--text);
    padding: 6px 10px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    width: 100%;
    max-width: 100px;
}
.admin-table input:focus { border-color: var(--accent); }
.admin-table .btn-sm { padding: 4px 12px; font-size: 12px; }
/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(160,107,255,0.1);
    border: 1px solid rgba(160,107,255,0.2);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all .2s;
}
.page-link:hover {
    background: rgba(160,107,255,0.25);
    border-color: var(--accent);
}
.page-link.active {
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(124,77,255,0.4);
}