/*
  YouCast UI — светлая тема с переключением на темную.
  Вдохновлено компоновкой YouTube, но с голубым акцентом.
*/

:root {
    --color-primary: #2f7ee6;
    --color-primary-contrast: #ffffff;
    --color-secondary: #0f766e;
    --color-danger: #dc2626;
    --color-success: #15803d;
    --color-warning: #d97706;
    --color-info: #0284c7;
    --color-bg: #f6f8fc;
    --color-surface: #ffffff;
    --color-surface-2: #eef3fb;
    --color-surface-3: #e3ebf6;
    --color-border: #d5dfed;
    --color-text: #111827;
    --color-muted: #5f6f86;
    --font-size-xs: 12px;
    --font-size-sm: 13px;
    --font-size-md: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 20px;
    --font-size-2xl: 28px;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --line-height-tight: 1.2;
    --line-height-normal: 1.45;
    --line-height-relaxed: 1.6;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 999px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.1);
    --shadow-md: 0 8px 18px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 16px 32px rgba(15, 23, 42, 0.14);
    --shadow-xl: 0 28px 52px rgba(15, 23, 42, 0.2);
    --duration-fast: 120ms;
    --duration-base: 220ms;
    --duration-slow: 360ms;
    --easing-standard: cubic-bezier(0.2, 0, 0, 1);
    --easing-emphasized: cubic-bezier(0.2, 0.9, 0.1, 1);
    --bg: var(--color-bg);
    --surface: var(--color-surface);
    --surface-2: var(--color-surface-2);
    --surface-3: var(--color-surface-3);
    --border: var(--color-border);
    --text: var(--color-text);
    --muted: var(--color-muted);
    --accent: var(--color-primary);
    --accent-strong: #1d4fa8;
    --accent-weak: rgba(47, 126, 230, 0.16);
    --accent-2: #6eb0ff;
    --accent-warm: #d97706;
    --accent-rose: var(--color-danger);
    --accent-grad: linear-gradient(135deg, #2f7ee6 0%, #4d9df8 100%);
    --accent-grad-soft: linear-gradient(135deg, rgba(47,126,230,0.12) 0%, rgba(15,118,110,0.12) 100%);
    --shadow: var(--shadow-sm);
    --shadow-soft: var(--shadow-md);
    --shadow-strong: var(--shadow-lg);
    --radius: var(--radius-md);
    --timeline-bg: linear-gradient(180deg, #f8fafc 0%, #e6edf6 100%);
    --timeline-border: rgba(148, 163, 184, 0.35);
    --timeline-grid: rgba(148, 163, 184, 0.18);
    --timeline-grid-soft: rgba(148, 163, 184, 0.12);
    --timeline-row: rgba(148, 163, 184, 0.16);
}

[data-theme="dark"] {
    --color-primary: #5fa8ff;
    --color-secondary: #2dd4bf;
    --color-danger: #f87171;
    --color-success: #34d399;
    --color-warning: #fbbf24;
    --color-info: #38bdf8;
    --color-bg: #0f1218;
    --color-surface: #171b24;
    --color-surface-2: #1f2633;
    --color-surface-3: #262e3d;
    --color-border: #2d384d;
    --color-text: #e8eef8;
    --color-muted: #a2b0c6;
    --bg: var(--color-bg);
    --surface: var(--color-surface);
    --surface-2: var(--color-surface-2);
    --surface-3: var(--color-surface-3);
    --border: var(--color-border);
    --text: var(--color-text);
    --muted: var(--color-muted);
    --accent: var(--color-primary);
    --accent-strong: #9acbff;
    --accent-weak: rgba(95, 168, 255, 0.22);
    --accent-2: #9acbff;
    --accent-warm: var(--color-warning);
    --accent-rose: var(--color-danger);
    --accent-grad: linear-gradient(135deg, #4e96ef 0%, #67b3ff 100%);
    --accent-grad-soft: linear-gradient(135deg, rgba(95,168,255,0.2) 0%, rgba(45,212,191,0.14) 100%);
    --shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.45);
    --shadow-md: 0 10px 24px rgba(2, 6, 23, 0.45);
    --shadow-lg: 0 18px 36px rgba(2, 6, 23, 0.56);
    --shadow-xl: 0 30px 60px rgba(2, 6, 23, 0.66);
    --shadow: var(--shadow-sm);
    --shadow-soft: var(--shadow-md);
    --shadow-strong: var(--shadow-lg);
    --radius: var(--radius-md);
    --timeline-bg: linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
    --timeline-border: rgba(148, 163, 184, 0.2);
    --timeline-grid: rgba(148, 163, 184, 0.18);
    --timeline-grid-soft: rgba(148, 163, 184, 0.12);
    --timeline-row: rgba(148, 163, 184, 0.16);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: linear-gradient(180deg, var(--bg) 0%, var(--surface-2) 100%);
    color: var(--text);
    font-family: "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Верхняя панель */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 56px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    gap: 16px;
}

.topbar .left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.icon-btn:hover {
    background: var(--surface-2);
    border-color: var(--border);
    box-shadow: var(--shadow);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 18px;
}

.logo-mark {
    width: 28px;
    height: 20px;
    background: var(--accent-grad);
    border-radius: 6px;
    position: relative;
}

.logo-mark::after {
    content: "";
    position: absolute;
    left: 10px;
    top: 5px;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid white;
}

.search-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 640px;
    position: relative;
}

.search-bar input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 18px 0 0 18px;
    background: var(--surface);
    color: var(--text);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.search-bar button {
    height: 38px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 18px 18px 0;
    background: var(--surface-2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: rgba(72, 152, 234, 0.55);
    box-shadow: 0 0 0 3px rgba(72, 152, 234, 0.15);
}

.search-suggest {
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: none;
    z-index: 50;
    max-height: 300px;
    overflow: auto;
}

.search-suggest a {
    display: block;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.search-suggest a:hover {
    background: var(--surface-2);
}

.search-bar .mic {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 220px;
    justify-content: flex-end;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    background: var(--accent-grad);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.2px;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease, background 0.2s ease;
}

.btn.outline {
    background: var(--surface);
    border: 1px solid rgba(72, 152, 234, 0.35);
    color: var(--text);
    box-shadow: none;
}

.btn.danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #dc2626;
    box-shadow: none;
}

.btn.disabled {
    background: #aab7c9;
    cursor: not-allowed;
}

.btn:hover {
    filter: brightness(1.02);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.btn.outline:hover {
    background: var(--accent-grad-soft);
    border-color: rgba(72, 152, 234, 0.55);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.7;
    pointer-events: none;
}

.btn.ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn.ghost:hover {
    background: var(--surface-2);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-weak);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--accent);
}

.avatar-btn {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.profile-menu {
    position: relative;
}

.profile-dropdown {
    position: absolute;
    top: 44px;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-strong);
    min-width: 200px;
    display: none;
    z-index: 60;
    overflow: hidden;
}

.profile-dropdown a {
    display: block;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.profile-dropdown a:hover {
    background: var(--accent-grad-soft);
}

/* Основной каркас */
.layout {
    display: grid;
    grid-template-columns: 240px 1fr;
}

.layout.no-sidebar {
    grid-template-columns: 1fr;
}

.layout.no-sidebar .sidebar {
    display: none;
}

.sidebar {
    padding: 16px 12px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-3) 100%);
    border-right: 1px solid var(--border);
    min-height: calc(100vh - 56px);
}

.sidebar .section-title {
    margin: 18px 8px 8px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--muted);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: var(--surface-2);
    border-color: var(--border);
    transform: translateX(2px);
}

.nav-item.active {
    background: var(--accent-grad-soft);
    border-color: rgba(72, 152, 234, 0.4);
    color: var(--text);
}

.nav-item .icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.nav-item:hover .icon {
    color: var(--text);
}

.content {
    padding: 16px 24px;
}

/* Чипсы категорий */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 16px;
}

.chips--sticky {
    position: sticky;
    top: 56px;
    z-index: 900;
    padding: 10px 0 14px;
    margin: 0 0 18px;
    background: linear-gradient(180deg, rgba(246,247,249,0.92) 0%, rgba(246,247,249,0.86) 100%);
    backdrop-filter: blur(6px);
}

[data-theme="dark"] .chips--sticky {
    background: linear-gradient(180deg, rgba(15,17,21,0.88) 0%, rgba(15,17,21,0.8) 100%);
}

.filters {
    margin: 12px 0 20px;
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    align-items: end;
}

.filter-form label {
    margin-top: 0;
}

.chip {
    background: var(--surface-2);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 14px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    position: relative;
}

.chip.active {
    background: var(--accent-grad);
    color: #ffffff;
    border-color: transparent;
    box-shadow: var(--shadow);
}

.chip:hover {
    background: var(--surface-3);
}

.chip.active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -6px;
    height: 2px;
    border-radius: 999px;
    background: var(--accent);
    opacity: 0.9;
}

.scroll-section {
    scroll-margin-top: 120px;
    min-height: 1px;
}

/* Карточки */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.grid--recommended {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--popular {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid--new {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.grid--category {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: transparent;
    transition: transform 0.2s ease;
}

.thumb {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-2);
    box-shadow: var(--shadow-soft);
    aspect-ratio: 16/9;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    isolation: isolate;
}

.card:hover {
    transform: translateY(-2px) scale(1.02);
}

.card:hover .thumb {
    box-shadow: var(--shadow-strong);
}

.placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 13px;
    background: var(--surface-2);
}

.placeholder.cat {
    align-items: flex-end;
    justify-content: space-between;
    padding: 12px;
    flex-direction: column;
    gap: 8px;
    background: var(--accent-grad);
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.placeholder .cat-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(0,0,0,0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.placeholder .cat-label {
    font-size: 13px;
    font-weight: 600;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.4);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.card:hover .thumb-overlay {
    opacity: 1;
}

.thumb-action {
    background: rgba(255,255,255,0.9);
    color: #111827;
    padding: 8px 18px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    box-shadow: var(--shadow);
}

.thumb-duration {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(0,0,0,0.75);
    color: #ffffff;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 3;
}

.thumb-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: rgba(0,0,0,0.2);
    z-index: 3;
}

.thumb-progress span {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: 0 6px 6px 0;
}

.cat-learning { background: linear-gradient(135deg, #6d28d9 0%, #3b82f6 100%); }
.cat-tech { background: linear-gradient(135deg, #0ea5e9 0%, #22d3ee 100%); }
.cat-business { background: linear-gradient(135deg, #f97316 0%, #ef4444 100%); }
.cat-travel { background: linear-gradient(135deg, #22c55e 0%, #3b82f6 100%); }
.cat-podcasts { background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%); }
.cat-music { background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%); }
.cat-hobby { background: linear-gradient(135deg, #ec4899 0%, #f97316 100%); }
.cat-auto { background: linear-gradient(135deg, #0f172a 0%, #334155 100%); }
.cat-home { background: linear-gradient(135deg, #4b5563 0%, #9ca3af 100%); }
.cat-health { background: linear-gradient(135deg, #16a34a 0%, #4ade80 100%); }
.cat-lang { background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%); }
.cat-kids { background: linear-gradient(135deg, #f59e0b 0%, #facc15 100%); }
.cat-science { background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%); }
.cat-finance { background: linear-gradient(135deg, #0f766e 0%, #34d399 100%); }
.cat-self { background: linear-gradient(135deg, #7c3aed 0%, #c084fc 100%); }
.cat-culture { background: linear-gradient(135deg, #9333ea 0%, #f472b6 100%); }
.cat-generic { background: var(--accent-grad); }

.card-meta {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 8px;
}

.card-meta .avatar {
    width: 36px;
    height: 36px;
}

.card-title {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.3;
}

.card-desc {
    color: var(--muted);
    font-size: 12px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 24px 0 12px;
}

.empty-state {
    padding: 16px 18px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
}

@media (max-width: 1024px) {
    .grid--recommended {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .grid--popular {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .grid--new {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .grid--recommended,
    .grid--popular,
    .grid--new,
    .grid--category {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

/* Страница подкаста */
.podcast-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
}

.recommendations .rec-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.recommendations .rec-thumb {
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-2);
    aspect-ratio: 16/9;
    box-shadow: var(--shadow);
}

.slide-viewer {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow-soft);
    flex: 1;
}

.slide-layer {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: radial-gradient(circle at top, #1f2937, #0f172a 65%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-layer img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    display: block;
    transition: opacity 0.3s ease;
    transform-origin: center;
    object-fit: contain;
}

.slide-fade {
    opacity: 0;
}

.slide-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.player-card:fullscreen,
.player-card:-webkit-full-screen {
    width: 100%;
    height: 100%;
    border-radius: 0;
    padding: 16px;
    box-shadow: none;
}

.player-card:fullscreen .slide-viewer,
.player-card:-webkit-full-screen .slide-viewer {
    padding: 0;
    border: none;
    box-shadow: none;
}

.player-card:fullscreen .slide-layer,
.player-card:-webkit-full-screen .slide-layer {
    height: 100%;
    aspect-ratio: 16 / 9;
}

.slide-counter {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    z-index: 5;
}

.subtitle-panel {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 56px;
    max-height: 40%;
    background: rgba(15, 23, 42, 0.75);
    color: #fff;
    border-radius: 12px;
    padding: 10px 12px;
    overflow: auto;
    z-index: 5;
}

.subtitle-scroll {
    font-size: 13px;
    line-height: 1.4;
}

.overlay-text {
    position: absolute;
    color: #fff;
    background: rgba(0,0,0,0.45);
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 600;
}

.overlay-item {
    position: absolute;
    pointer-events: auto;
    z-index: 6;
    cursor: move;
}

.overlay-item.text {
    background: rgba(15, 23, 42, 0.6);
    color: #fff;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 600;
}

.overlay-item.is-active {
    outline: 2px solid rgba(72, 152, 234, 0.6);
    outline-offset: 2px;
}

.overlay-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #ffffff;
    border: 2px solid #4898ea;
    box-shadow: 0 2px 6px rgba(15,23,42,0.35);
    display: none;
}

.overlay-handle.resize {
    right: -8px;
    bottom: -8px;
    cursor: nwse-resize;
}

.overlay-handle.rotate {
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    cursor: grab;
}

.overlay-item.is-active .overlay-handle {
    display: block;
}

.crop-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.overlay-rect {
    position: absolute;
    border: 2px solid #4898ea;
    width: 120px;
    height: 80px;
}

.overlay-arrow {
    position: absolute;
    width: 120px;
    height: 2px;
    background: #4898ea;
}

.overlay-arrow::after {
    content: "";
    position: absolute;
    right: -6px;
    top: -4px;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid #4898ea;
}

.player-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow-soft);
    outline: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-card:focus {
    box-shadow: 0 0 0 3px rgba(72, 152, 234, 0.2);
}

.timeline {
    position: relative;
    height: 8px;
    background: var(--surface-2);
    border-radius: 999px;
    margin: 12px 0 8px;
    cursor: pointer;
    overflow: hidden;
}

.timeline.player {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    margin: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
}

.timeline-progress {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background: #06B6D4;
}

.timeline-marker {
    position: absolute;
    top: -4px;
    width: 2px;
    height: 16px;
    background: var(--accent);
    opacity: 0.8;
}

.timeline-marker::after {
    content: attr(data-title);
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    font-size: 11px;
    padding: 4px 6px;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.timeline-marker:hover::after {
    opacity: 1;
}

.timeline.player .timeline-marker {
    background: #ffffff;
}

.timeline-hover {
    position: absolute;
    bottom: 18px;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    box-shadow: var(--shadow);
    z-index: 6;
    pointer-events: none;
}

.timeline-hover img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.timeline-hover span {
    font-size: 11px;
    color: var(--muted);
}

.player-bar {
    margin-top: 10px;
    width: 100%;
    background: var(--surface-2);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.player-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.player-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.player-btn .icon-pause {
    display: none;
}

.player-btn.is-playing .icon-play {
    display: none;
}

.player-btn.is-playing .icon-pause {
    display: inline-flex;
}

.time-label {
    font-size: 13px;
    color: var(--muted);
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
}

.speed-control select {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.slides-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 6px 0;
}

.slides-strip-wrap {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 36px 1fr 36px;
    gap: 8px;
    align-items: center;
}

.strip-nav {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s ease;
}

.strip-nav:hover {
    background: var(--surface-2);
}

.slide-thumb {
    flex: 0 0 140px;
}

.slide-thumb.active {
    outline: 2px solid #06B6D4;
    transform: translateY(-2px);
}

.action-bar {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    justify-content: space-between;
}

.action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.action-bar form {
    display: inline-flex;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.action-btn:hover {
    background: var(--surface-2);
    transform: translateY(-1px);
}

.action-menu {
    position: relative;
}

.action-menu-dropdown {
    position: absolute;
    right: 0;
    top: 42px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow-soft);
    z-index: 20;
    min-width: 200px;
}

.action-btn.danger {
    border-color: rgba(239, 68, 68, 0.3);
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.08);
}

.like-btn .heart {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.like-btn.is-liked .heart {
    fill: #ef4444;
    stroke: #ef4444;
    animation: heartBeat 0.35s ease;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.like-count {
    margin-left: 6px;
    font-weight: 700;
}

.focus-mode .topbar,
.focus-mode .sidebar,
.focus-mode .action-bar,
.focus-mode .description,
.focus-mode .slides-strip-wrap,
.focus-mode .comments,
.focus-mode .recommendations {
    display: none !important;
}

.focus-mode .content {
    padding: 16px;
}

.focus-mode .player-card {
    width: 100%;
}

.action-bar select {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.share-panel {
    margin-top: 12px;
}

.share-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow-soft);
}

.share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.share-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.share-row input {
    flex: 1;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.share-row img {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.share-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.share-links a {
    color: var(--accent);
    font-weight: 600;
}

.editor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.timeline-panel, .slides-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow-soft);
}

.slides-list .slide-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    align-items: start;
    margin-bottom: 12px;
}

.slides-list img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.slide-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 8px;
}

/* Новый редактор слайдов */
.slides-editor {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) minmax(320px, 1fr);
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "head head head"
        "left main right"
        "bottom bottom bottom";
    gap: 16px;
    align-items: start;
    max-width: 100%;
}

.editor-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 12px;
}

.editor-topbar .topbar-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.record-btn {
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.record-btn.is-active {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    color: #fff;
    border-color: transparent;
}

.help-btn {
    width: 34px;
    height: 34px;
    font-weight: 700;
}

.editor-topbar .topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.editor-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.editor-left,
.editor-right {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: static;
    max-height: 82vh;
    overflow: auto;
}

.editor-left {
    grid-area: left;
    gap: 12px;
}

.editor-right {
    grid-area: right;
    gap: 8px;
}

.editor-main {
    grid-area: main;
}

.editor-bottom {
    grid-area: bottom;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.editor-head {
    grid-area: head;
}

.side-title {
    font-weight: 700;
    font-size: 14px;
}

.side-subtitle {
    font-size: 12px;
    color: var(--muted);
    margin-top: -4px;
}

.bg-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    background: var(--surface-2);
    display: grid;
    gap: 10px;
}

.bg-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
}

.bg-row input[type="color"] {
    width: 42px;
    height: 28px;
    border: none;
    padding: 0;
    background: transparent;
}

.bg-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.bg-swatch {
    height: 46px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    background: var(--surface);
    color: var(--muted);
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.bg-swatch.is-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(72, 152, 234, 0.2);
}

.bg-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px dashed var(--border);
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
    background: var(--surface);
}

.bg-upload input {
    display: none;
}

.preview-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow-soft);
}

.preview-screen {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: radial-gradient(circle at top, #1f2937, #0f172a 65%);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.preview-screen img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: center;
}

#drawCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    touch-action: none;
}

.stroke-box {
    position: absolute;
    border: 1px dashed rgba(72, 152, 234, 0.9);
    border-radius: 8px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.6) inset;
    pointer-events: auto;
    z-index: 6;
}

.stroke-handle {
    position: absolute;
    right: -6px;
    bottom: -6px;
    width: 12px;
    height: 12px;
    border-radius: 6px;
    background: #38bdf8;
    border: 2px solid #0f172a;
    cursor: nwse-resize;
}

.cropper-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.cropper-frame::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px dashed rgba(72, 152, 234, 0.6);
    border-radius: 10px;
    pointer-events: none;
}

.cropper-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: grab;
    transform-origin: center;
}

.preview-screen .slide-overlay {
    pointer-events: auto;
    z-index: 4;
}

.preview-controls {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.preview-time {
    font-size: 13px;
    color: var(--muted);
}

.preview-speed {
    margin-left: auto;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.preview-progress {
    margin-top: 8px;
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    overflow: hidden;
    cursor: pointer;
}

.editor-page .preview-progress {
    width: max-content;
    max-width: 100%;
}

.preview-progress > div {
    height: 100%;
    width: 0%;
    background: var(--accent-grad);
}

#editorAudio {
    display: none;
}

.mini-ruler {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden;
}

.mini-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent);
    opacity: 0.8;
    pointer-events: none;
}

.audio-meta {
    margin-top: 10px;
}

.audio-meta input {
    width: 140px;
}

.slides-library {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: auto;
    overflow-x: hidden;
    padding-right: 6px;
    flex: 1;
    min-height: 0;
}

.slide-item {
    display: grid;
    grid-template-columns: 68px 1fr;
    gap: 8px;
    align-items: center;
    padding: 6px 8px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid transparent;
    cursor: pointer;
    position: relative;
}

.slide-item.is-active {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.slide-item img {
    width: 68px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
}

.slide-item.is-disabled {
    opacity: 0.6;
}

.slide-item.dragging {
    opacity: 0.5;
}

.slide-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.slide-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.slide-title {
    font-weight: 600;
    font-size: 13px;
}

.slide-meta .slide-top {
    display: none;
}

.slides-library.is-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 6px;
    padding-right: 2px;
}

.slides-library.is-compact .slide-meta {
    display: none;
}

.slides-library.is-compact .slide-dot {
    bottom: 2px;
    width: 4px;
    height: 4px;
}

.slides-library.is-compact .slide-item {
    grid-template-columns: 1fr;
    padding: 0;
    border-radius: 10px;
}

.slides-library.is-compact .slide-item img {
    width: 100%;
    height: 38px;
}

.slides-library.is-compact .slide-actions {
    display: none;
}

.slides-library.is-compact .icon-btn.sm {
    width: 20px;
    height: 20px;
}

.slides-library.is-compact .icon-toggle {
    width: 16px;
    height: 16px;
}

.slides-library.is-compact .slide-buttons {
    display: none;
}

.mini-toggle {
    margin-bottom: 4px;
    font-size: 12px;
}

.slide-time {
    font-size: 11px;
    color: var(--muted);
}

.slide-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.slide-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.slide-buttons.compact {
    gap: 4px;
}

.slide-top {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toggle.small {
    font-size: 11px;
}

.icon-btn.sm {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 12px;
}

.icon-btn.sm svg {
    width: 14px;
    height: 14px;
}

.icon-toggle {
    width: 26px;
    height: 26px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-toggle input {
    display: none;
}

.icon-toggle span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #94a3b8;
    box-shadow: inset 0 0 0 2px rgba(148, 163, 184, 0.3);
}

.icon-toggle input:checked + span {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
}

.timeline-editor {
    background: var(--timeline-bg);
    border: 1px solid var(--timeline-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 12px 12px 18px;
    overflow: auto;
    position: relative;
    min-width: 0;
    max-width: 100%;
    flex: 1;
    width: auto;
    height: clamp(250px, 38vh, 520px);
}

.timeline-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    box-shadow: var(--shadow-soft);
}

.timeline-toolbar label {
    font-size: 12px;
    color: var(--muted);
}

.timeline-toolbar input[type="range"] {
    width: 160px;
}

.timeline-workspace {
    display: flex;
    gap: 12px;
    align-items: stretch;
    min-width: 0;
}

.timeline-tools {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.92);
    color: #e2e8f0;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translate(-50%, -2px);
}

.context-menu {
    position: fixed;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-strong);
    padding: 6px;
    z-index: 3000;
    gap: 4px;
}

.context-menu button {
    border: none;
    background: transparent;
    text-align: left;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
}

.context-menu button:hover {
    background: var(--surface-2);
}

.tools-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    padding: 10px;
    display: grid;
    gap: 8px;
}

.tools-title {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.tools-panel .tool-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 13px;
}

.tool-btn:hover {
    background: var(--accent-grad-soft);
    border-color: rgba(72, 152, 234, 0.55);
}

.tool-btn.is-active {
    background: var(--accent-grad);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow);
}

.draw-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
}

#drawColor {
    width: 100%;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
}

#drawWidth {
    width: 100%;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-group.toggles label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text);
}

.grid-hint {
    font-size: 12px;
    color: var(--muted);
    background: var(--surface-2);
    padding: 4px 8px;
    border-radius: 999px;
}

.timeline-content {
    position: relative;
    min-width: 100%;
    min-height: 100%;
}

.timeline-ruler {
    position: relative;
    height: 30px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    margin-bottom: 8px;
}

.ruler-tick {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    font-size: 11px;
    color: #94a3b8;
}

.timeline-track {
    position: relative;
    height: 320px;
    border-radius: 12px;
    background: repeating-linear-gradient(90deg, var(--timeline-grid) 0 1px, transparent 1px 56px),
                repeating-linear-gradient(0deg, var(--timeline-grid-soft) 0 1px, transparent 1px 28px);
    overflow: visible;
    min-width: 100%;
}

.timeline-track::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        var(--timeline-row) 0 1px,
        transparent 1px 64px
    );
    pointer-events: none;
    opacity: 0.6;
}

.timeline-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #38bdf8 0%, #0ea5e9 100%);
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.6);
    z-index: 5;
    pointer-events: none;
}

.timeline-playhead::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #38bdf8;
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
}

.timeline-playhead span {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.8);
    color: #e2e8f0;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 6px;
    white-space: nowrap;
}

.playhead-preview {
    position: absolute;
    top: -120px;
    width: 160px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 14px 28px rgba(2,6,23,0.55);
    display: flex;
    flex-direction: column;
    z-index: 6;
}

.playhead-preview img {
    width: 100%;
    height: 90px;
    object-fit: cover;
}

.playhead-preview-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    font-size: 11px;
    color: #e2e8f0;
}

.slide-block {
    position: absolute;
    top: 24px;
    height: 60px;
    border-radius: 9px;
    background: var(--surface);
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.2);
    cursor: grab;
    min-width: 24px;
    overflow: hidden;
    z-index: 1;
}

.slide-block.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(72, 152, 234, 0.25);
    z-index: 3;
}

.slide-block.has-cover {
    background-size: cover;
    background-position: center;
}

.slide-block.has-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15,23,42,0.2) 0%, rgba(2,6,23,0.65) 100%);
    z-index: 0;
}

.block-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.block-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.block-label {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
    background: rgba(15, 23, 42, 0.6);
    padding: 2px 6px;
    border-radius: 6px;
}

.block-badge {
    position: absolute;
    left: 8px;
    top: 8px;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.block-badge svg {
    width: 14px;
    height: 14px;
    stroke: #e2e8f0;
    fill: none;
    stroke-width: 2;
}

.slide-block:active {
    cursor: grabbing;
}

.resize-handle {
    position: absolute;
    right: -2px;
    top: 6px;
    bottom: 6px;
    width: 10px;
    border-radius: 6px;
    background: rgba(72, 152, 234, 0.6);
    cursor: ew-resize;
    z-index: 2;
}

.slide-block.is-tiny .block-thumb,
.slide-block.is-tiny .block-label {
    display: none;
}

.tiny-preview {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 6px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
    z-index: 10;
}

.tiny-preview img {
    width: 90px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.tiny-preview span {
    font-size: 11px;
    color: var(--muted);
}

.slide-block.is-tiny:hover .tiny-preview {
    display: flex;
}

.element-block {
    position: absolute;
    height: 36px;
    border-radius: 8px;
    background: rgba(72, 152, 234, 0.25);
    border: 1px dashed rgba(72, 152, 234, 0.7);
    color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    cursor: grab;
    z-index: 2;
}

.element-block.is-active {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
}

.element-block.stroke-block {
    background: rgba(56, 189, 248, 0.2);
    border-style: solid;
}

.element-block:active {
    cursor: grabbing;
}

.element-handle {
    position: absolute;
    right: -4px;
    top: 6px;
    bottom: 6px;
    width: 8px;
    border-radius: 6px;
    background: rgba(72, 152, 234, 0.8);
    cursor: ew-resize;
}

.lane-guide {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(56, 189, 248, 0.7);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
    z-index: 1;
}

.fx-in-fade { animation: fxFadeIn 0.3s ease; }
.fx-out-fade { animation: fxFadeOut 0.3s ease; }
.fx-in-slide-left { animation: fxSlideInLeft 0.3s ease; }
.fx-out-slide-left { animation: fxSlideOutLeft 0.3s ease; }
.fx-in-slide-right { animation: fxSlideInRight 0.3s ease; }
.fx-out-slide-right { animation: fxSlideOutRight 0.3s ease; }
.fx-in-slide-up { animation: fxSlideInUp 0.3s ease; }
.fx-out-slide-up { animation: fxSlideOutUp 0.3s ease; }
.fx-in-slide-down { animation: fxSlideInDown 0.3s ease; }
.fx-out-slide-down { animation: fxSlideOutDown 0.3s ease; }
.fx-in-zoom { animation: fxZoomIn 0.3s ease; }
.fx-out-zoom { animation: fxZoomOut 0.3s ease; }

@keyframes fxFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fxFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes fxSlideInLeft {
    from { opacity: 0; transform: translateX(-6%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fxSlideOutLeft {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-6%); }
}

@keyframes fxSlideInRight {
    from { opacity: 0; transform: translateX(6%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fxSlideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(6%); }
}

@keyframes fxSlideInUp {
    from { opacity: 0; transform: translateY(-6%); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fxSlideOutUp {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-6%); }
}

@keyframes fxSlideInDown {
    from { opacity: 0; transform: translateY(6%); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fxSlideOutDown {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(6%); }
}

@keyframes fxZoomIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fxZoomOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(1.02); }
}

.autosave-status {
    margin-left: 12px;
    font-size: 12px;
    color: var(--muted);
}

.slide-save {
    max-width: none;
    display: none;
}

.btn.small {
    height: 30px;
    padding: 0 12px;
    font-size: 12px;
}

.no-select {
    user-select: none;
}

/* Модальное окно */
.modal[hidden] { display: none; }

.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
}

.modal-card {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    width: 520px;
    max-width: 90vw;
    box-shadow: var(--shadow-strong);
}

.modal-card.modal-wide {
    width: 920px;
    max-width: 95vw;
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.modal-body {
    display: grid;
    gap: 10px;
}

.modal-body.modal-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 16px;
    max-height: 70vh;
    overflow: auto;
    padding-right: 6px;
}

#elementText {
    min-height: 140px;
    resize: vertical;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 15px;
    line-height: 1.5;
    background: var(--surface-2);
}

.range-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
}

.range-row span:last-child {
    color: var(--text);
    font-weight: 600;
}

.position-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: var(--surface-2);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.position-grid button {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s ease;
}

.position-grid button.is-active {
    background: var(--accent-grad);
    border-color: transparent;
    box-shadow: var(--shadow);
}

@media (max-width: 900px) {
    .modal-body.modal-grid {
        grid-template-columns: 1fr;
        max-height: 75vh;
    }
}

.modal-col {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.cropper-controls {
    display: grid;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
}

.bg-panel.compact {
    padding: 10px;
}

.modal-body img {
    width: 100%;
    border-radius: 12px;
    max-height: 260px;
    object-fit: cover;
}

.modal-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.help-text {
    font-size: 14px;
    color: var(--text);
}

.help-text ul {
    padding-left: 18px;
    margin: 6px 0 14px;
    color: var(--muted);
}

.help-text li {
    margin-bottom: 6px;
}

/* Единая страница редактирования подкаста */
.podcast-edit-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 20px;
    align-items: start;
}

.edit-right {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 80px;
}

.edit-right .form {
    max-width: none;
    border: none;
    box-shadow: none;
    padding: 0;
    background: transparent;
}

.edit-right .form label {
    font-weight: 600;
    color: var(--text);
}

.edit-right .form input,
.edit-right .form textarea,
.edit-right .form select {
    background: var(--surface-2);
}

/* Вкладки редактора подкаста */
.edit-tabs {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tab-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab-nav.compact {
    justify-content: flex-end;
    gap: 6px;
}

.tab-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: var(--accent-grad);
    color: #ffffff;
    border-color: transparent;
    box-shadow: var(--shadow);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Полноэкранный редактор */
.editor-page .content {
    height: calc(100vh - 56px);
    overflow: hidden;
}

.editor-page .edit-tabs {
    height: 100%;
    min-height: 0;
}

.editor-page .tab-panel.editor-panel.active {
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.editor-page .slides-editor {
    flex: 1;
    min-height: 0;
}

.editor-page .editor-main {
    min-height: 0;
}

.editor-page .timeline-workspace {
    flex: 1;
    min-height: 250px;
}

.editor-page .timeline-editor {
    height: 100%;
}

.cover-picker {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.cover-preview {
    width: 140px;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.cover-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-placeholder {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    padding: 12px;
}

.cover-change {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cover-preview:hover .cover-change {
    opacity: 1;
}

.cover-input {
    display: none;
}

/* Страница аккаунта */
.account-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.account-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    position: sticky;
    top: 80px;
}

.account-cover {
    height: 80px;
    background: linear-gradient(135deg, rgba(72,152,234,0.9), rgba(16,185,129,0.75));
}

.account-avatar {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: var(--surface);
    border: 4px solid var(--surface);
    margin: -36px 16px 8px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-weight: 700;
    color: var(--accent);
    font-size: 22px;
}

.account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-meta {
    padding: 0 16px 12px;
}

.account-meta h2 {
    margin: 0;
    font-size: 18px;
}

.account-role {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
}

.account-email {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
}

.account-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 16px 4px;
}

.account-stats div {
    background: var(--surface-2);
    border-radius: 12px;
    padding: 8px 6px;
    text-align: center;
    font-size: 11px;
    color: var(--muted);
}

.account-stats strong {
    display: block;
    font-size: 14px;
    color: var(--text);
}

.account-nav {
    padding: 12px 12px 16px;
    display: grid;
    gap: 6px;
}

.account-nav a {
    padding: 8px 10px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text);
    font-size: 13px;
    transition: all 0.2s ease;
}

.account-nav a:hover {
    background: var(--surface-2);
    border-color: var(--border);
}

.account-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 18px;
}

.account-panel h1 {
    margin-top: 0;
    margin-bottom: 12px;
}

.account-panel .form {
    max-width: none;
    border: none;
    box-shadow: none;
    padding: 0;
    background: transparent;
}

@media (max-width: 1024px) {
    .account-layout {
        grid-template-columns: 1fr;
    }
    .account-card {
        position: static;
    }
}

@media (max-width: 1024px) {
    .slides-editor {
        grid-template-columns: 1fr;
    }
    .editor-left {
        order: 2;
        position: static;
        max-height: none;
    }
    .editor-right {
        order: 3;
        position: static;
        max-height: none;
    }

    .podcast-edit-layout {
        grid-template-columns: 1fr;
    }

    .edit-right {
        position: static;
    }
}

.slide-thumb {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.slide-thumb img {
    width: 100%;
    height: 70px;
    object-fit: cover;
    display: block;
}

.slide-thumb:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.slide-thumb .time {
    display: block;
    padding: 6px 8px;
    font-size: 12px;
    color: var(--muted);
}

.transcript summary {
    cursor: pointer;
    color: var(--accent);
}

.transcript-text {
    margin-top: 8px;
    color: var(--muted);
}

.actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.actions form {
    margin: 0;
    display: inline-flex;
}

.actions details summary {
    list-style: none;
    cursor: pointer;
}

.actions details summary::-webkit-details-marker {
    display: none;
}

.comments, .description {
    margin-top: 16px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow-soft);
}

.description p {
    font-size: 14px;
    color: var(--muted);
}

.manage-panel {
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.comments {
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.banner {
    width: 100%;
    border-radius: var(--radius);
    margin-top: 12px;
    box-shadow: var(--shadow-soft);
}

.comment {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.comment-replies {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 12px;
    border-left: 2px solid var(--border);
}

.comment-reply {
    background: var(--surface-2);
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
}

/* Комментарии — современный стиль */
.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.comments-count {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.comment-toolbar {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.comment-sort-label {
    font-size: 12px;
    color: var(--muted);
    margin-right: 8px;
}

.comment-sort {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.comment-form textarea {
    min-height: 90px;
}

.comments-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-item {
    margin-left: calc(var(--level) * 18px);
}

.comment-item.is-child {
    padding-left: 12px;
}

.comment-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 6px 0;
    box-shadow: none;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-grad);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.comment-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.comment-author {
    font-weight: 700;
    font-size: 14px;
}

.comment-date {
    font-size: 12px;
    color: var(--muted);
}

.comment-body {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.comment-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.comment-inline {
    margin-top: 10px;
}

.comment-inline .form.compact {
    box-shadow: none;
    border: none;
    background: var(--surface-2);
}

.comment-action {
    padding: 6px 10px;
    border-radius: 999px;
    border: none;
    background: var(--surface-2);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comment-action:hover {
    background: var(--accent-grad-soft);
    border-color: rgba(72, 152, 234, 0.3);
}

.comment-action.like {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.comment-action.like.active {
    background: var(--accent-grad);
    color: #ffffff;
    border-color: transparent;
}

.comment-action.danger {
    border-color: rgba(239, 68, 68, 0.35);
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.08);
}

.comment-details summary {
    list-style: none;
}

.comment-details summary::-webkit-details-marker {
    display: none;
}

.comment-details .form.compact {
    margin-top: 8px;
    padding: 12px;
}

.form.compact textarea {
    min-height: 60px;
}

/* Формы */
.form {
    max-width: 720px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-soft);
}

/* Комментарии без рамок */
.form.comment-form {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.form.comment-form textarea {
    background: var(--surface);
    border: none;
    box-shadow: inset 0 0 0 1px var(--border);
    border-radius: 14px;
    padding: 12px;
}

.comment-inline .form.compact {
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

.comment-inline .form.compact textarea {
    background: var(--surface-2);
    border: none;
    box-shadow: inset 0 0 0 1px var(--border);
    border-radius: 12px;
    padding: 10px 12px;
}

.form label {
    display: block;
    margin-top: 12px;
    margin-bottom: 6px;
    color: var(--muted);
}

.form input, .form textarea, .form select {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.form button {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    background: var(--accent-grad);
    color: white;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.form button:hover {
    filter: brightness(1.02);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.form input:focus, .form textarea:focus, .form select:focus {
    outline: none;
    border-color: rgba(72, 152, 234, 0.55);
    box-shadow: 0 0 0 3px rgba(72, 152, 234, 0.15);
}

.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    background: var(--surface-2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.editor-side .dropzone {
    padding: 12px;
    font-size: 13px;
}

.dropzone.drag {
    border-color: var(--accent);
    background: var(--accent-weak);
}

.dropzone.done {
    border-color: #34a853;
    background: #e9f7ef;
}

.dropzone input[type="file"] {
    display: none;
}

.progress {
    width: 100%;
    height: 8px;
    background: var(--surface-2);
    border-radius: 999px;
    margin-top: 8px;
    overflow: hidden;
}

.progress > div {
    height: 100%;
    width: 0%;
    background: var(--accent-grad);
}

.auth-hint {
    margin-top: 16px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.oauth-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

/* Футер */
.footer {
    padding: 24px;
    text-align: center;
    color: var(--muted);
}

/* Адаптив */
@media (max-width: 1100px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .podcast-layout { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .topbar { flex-wrap: wrap; height: auto; padding: 8px; }
    .search-bar { order: 3; max-width: 100%; }
    .top-actions { min-width: auto; }
}
.slide-dot {
    position: absolute;
    bottom: 6px;
    left: var(--dot-pos, 0%);
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--accent);
    transform: translateX(-50%);
    opacity: 0.8;
}

.slide-item.is-active .slide-dot {
    background: #22c55e;
    opacity: 1;
}

/* Дашборд подкаста */
.dashboard-page .content {
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.dashboard-header .muted {
    color: var(--muted);
    font-size: 13px;
}

.dashboard-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-soft);
}

.dashboard-section h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
}

.stat-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.stat-row {
    font-size: 13px;
    color: var(--text);
}

.chart-panel {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.chart-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chart-tab {
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
}

.chart-tab.active {
    background: var(--accent-weak);
    border-color: var(--accent);
    color: var(--accent-strong);
}

.chart-wrap {
    width: 100%;
    height: 180px;
}

.comment-row {
    padding: 10px 12px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
    margin-bottom: 8px;
}

.comment-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
}

.comment-body {
    margin-top: 6px;
    font-size: 14px;
}

.comment-actions {
    margin-top: 8px;
}

.report-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
    margin-bottom: 8px;
}

.badge {
    background: var(--accent-weak);
    color: var(--accent-strong);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
}

.paywall-card {
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.paywall-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(7, 10, 20, 0.55);
    backdrop-filter: blur(4px);
    z-index: 5;
}

.paywall-box {
    background: var(--surface);
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
    max-width: 320px;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

@media (max-width: 900px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Полноэкранный темный редактор */
/* Theme-aware editor palette */
:root {
    --editor-bg: #eceff1;
    --editor-panel: #f7f8fa;
    --editor-panel-2: #e5e7eb;
    --editor-border: rgba(17, 24, 39, 0.14);
    --editor-text: #111827;
    --editor-muted: #6b7280;
    --editor-accent: #111827;
}

[data-theme="dark"] {
    --editor-bg: #151515;
    --editor-panel: #1d1d1d;
    --editor-panel-2: #262626;
    --editor-border: rgba(255, 255, 255, 0.14);
    --editor-text: #f5f5f5;
    --editor-muted: #c4c4c4;
    --editor-accent: #ffffff;
}

.editor-page {
    background: var(--editor-bg);
    color: var(--editor-text);
    overflow: hidden;
}

.editor-page .topbar,
.editor-page .footer {
    display: none;
}

.editor-page .editor-header {
    display: none;
}

.editor-page .layout {
    grid-template-columns: 1fr;
    height: 100vh;
}

.editor-page .content {
    padding: 0;
    height: 100vh;
    max-width: 100%;
}

.editor-page .slides-editor {
    --timeline-height: 40vh;
    grid-template-columns: 120px max-content 1fr;
    grid-template-rows: auto 1fr var(--timeline-height);
    gap: 0;
    height: 100vh;
    background: var(--editor-bg);
}

.editor-page .editor-left,
.editor-page .editor-right,
.editor-page .editor-main,
.editor-page .editor-bottom,
.editor-page .editor-head {
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: var(--editor-panel);
}

.editor-page .editor-head {
    background: var(--editor-bg);
    padding: 8px 12px;
    grid-column: 2 / 4;
    grid-row: 1 / 2;
}

.editor-page .editor-left {
    padding: 10px 8px;
    height: 100%;
    overflow-y: auto;
    border-right: 1px solid var(--editor-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    grid-row: 2 / 4;
    grid-column: 1 / 2;
    align-items: stretch;
}

.editor-page .editor-left::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.editor-page .editor-left {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.editor-page .editor-left .tools-panel {
    flex: 0 0 auto;
}

.editor-page .editor-right {
    padding: 12px;
    height: 100%;
    overflow: hidden;
    border-left: 1px solid var(--editor-border);
    grid-row: 2 / 3;
}

.editor-page .editor-right .slides-library {
    height: auto;
}

.editor-page .editor-main {
    background: var(--editor-bg);
    padding: 6px 12px 10px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    --player-h: clamp(360px, 52vh, 720px);
    --player-w: calc(var(--player-h) * 16 / 9);
    grid-row: 2 / 3;
}

.editor-page .editor-bottom {
    padding: 10px 12px 14px;
    height: var(--timeline-height);
    background: var(--editor-panel);
    grid-column: 2 / 4;
    grid-row: 3 / 4;
}

.editor-page .slides-library {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    align-content: start;
}

.editor-page .editor-right .dropzone,
.editor-page .editor-right .progress {
    flex: 0 0 auto;
}

.editor-page .editor-links {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin-right: 12px;
}

.editor-page .editor-topbar .btn.small {
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

.editor-page .editor-topbar {
    background: var(--editor-panel);
    border: 1px solid var(--editor-border);
    border-radius: 10px;
    padding: 6px 10px;
    box-shadow: none;
}

.editor-page .side-title,
.editor-page .side-subtitle {
    color: var(--editor-muted);
}

.editor-page .tools-panel {
    background: var(--editor-panel-2);
    border: 1px solid var(--editor-border);
    border-radius: 12px;
    width: 100%;
    max-width: 92px;
}

.editor-page .tools-grid {
    grid-template-columns: 1fr;
    gap: 6px;
    justify-items: center;
}

.editor-page .tool-btn {
    width: 44px;
    height: 44px;
    background: var(--editor-panel);
    border-color: var(--editor-border);
    color: var(--editor-text);
    font-weight: 600;
    border-radius: 8px;
}

.editor-page .draw-row.compact {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.editor-page .draw-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.editor-page .draw-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--editor-muted);
}

.editor-page .draw-row.compact input[type="color"] {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--editor-border);
    background: var(--editor-panel);
    padding: 0;
}

.editor-page .thickness-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.editor-page .thickness-btn.dot {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    position: relative;
}

.editor-page .thickness-btn.dot::after {
    content: "";
    display: block;
    margin: 0 auto;
    border-radius: 999px;
    background: var(--editor-text);
}

.editor-page .thickness-btn.dot.sm::after { width: 6px; height: 6px; }
.editor-page .thickness-btn.dot.md::after { width: 10px; height: 10px; }
.editor-page .thickness-btn.dot.lg::after { width: 14px; height: 14px; }

.editor-page .thickness-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 6px;
}

.editor-page .thickness-btn {
    border: 1px solid var(--editor-border);
    background: var(--editor-panel);
    color: var(--editor-text);
    border-radius: 6px;
    padding: 0;
    font-size: 10px;
    cursor: pointer;
}

.editor-page .thickness-btn.active {
    border-color: var(--editor-accent);
    color: var(--editor-accent);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.hidden-range {
    display: none;
}

.editor-page .tool-icon {
    font-size: 18px;
    line-height: 1;
}

.editor-page .tools-panel {
    padding: 10px;
}

.editor-page .tools-title {
    text-align: center;
    font-size: 11px;
}

.editor-page .side-title {
    font-size: 13px;
    text-align: center;
}

.editor-page .side-subtitle {
    font-size: 11px;
    text-align: center;
}

.editor-page .tool-btn:hover {
    border-color: var(--editor-accent);
    color: var(--editor-accent);
}

.editor-page .preview-panel {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    flex: 0 0 auto;
    min-height: 0;
    padding: 0;
    width: var(--player-w);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.editor-page .preview-screen {
    height: var(--player-h);
    width: var(--player-w);
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    background: radial-gradient(circle at top, #1f2937, #0b0f1a 65%);
    border: 1px solid var(--editor-border);
}

[data-theme="light"] .editor-page .preview-screen {
    background: radial-gradient(circle at top, #e3e9f3, #f9fbff 65%);
}

.editor-page .preview-controls {
    margin-top: 6px;
    width: var(--player-w);
}

.editor-page .preview-progress,
.editor-page .mini-ruler {
    width: var(--player-w);
}

.editor-page .preview-controls,
.editor-page .preview-progress,
.editor-page .mini-ruler {
    max-width: 100%;
}

.editor-page .preview-controls,
.editor-page .preview-progress,
.editor-page .mini-ruler {
    max-width: 100%;
}

.editor-page .preview-time {
    color: var(--editor-muted);
}

.editor-page .preview-speed {
    background: var(--editor-panel);
    border-color: var(--editor-border);
    color: var(--editor-text);
}

.editor-page .timeline-toolbar {
    background: var(--editor-panel);
    border: 1px solid var(--editor-border);
    border-radius: 10px;
    padding: 8px 10px;
}

.editor-page .timeline-toolbar label {
    color: var(--editor-muted);
}

.editor-page .timeline-workspace {
    gap: 8px;
    flex: 1;
    min-height: 40%;
}

.editor-page .timeline-editor {
    background: var(--editor-bg);
    border: 1px solid var(--editor-border);
    box-shadow: none;
    height: 100%;
}

.editor-page .timeline-toolbar input[type="range"] {
    width: 220px;
}

.editor-page .timeline-content {
    background: radial-gradient(circle at top, #0f172a, #0b0f1a 70%);
}

[data-theme="light"] .editor-page .timeline-content {
    background: radial-gradient(circle at top, #e6edf7, #fbfdff 70%);
}

.editor-page .slides-library {
    gap: 6px;
}

.editor-page .slide-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    border-radius: 12px;
    background: var(--editor-panel-2);
    border: 1px solid var(--editor-border);
}

.editor-page .slide-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
}

.editor-page .slide-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.editor-page .slide-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-page .slide-title {
    font-size: 13px;
    font-weight: 600;
}

.editor-page .slide-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.editor-page .slide-buttons.compact {
    display: inline-flex;
    gap: 6px;
}

.editor-page .slide-dot {
    display: none;
}

.editor-page .dropzone {
    background: var(--editor-panel-2);
    border-color: var(--editor-border);
    color: var(--editor-muted);
}

.editor-page .dropzone.drag {
    border-color: var(--editor-accent);
    color: var(--editor-text);
}

/* ========= Design System v2 ========= */
body {
    font-size: var(--font-size-md);
    line-height: var(--line-height-normal);
}

h1,
h2,
h3 {
    letter-spacing: -0.01em;
    line-height: var(--line-height-tight);
}

h1 {
    margin: 0 0 var(--space-4);
    font-size: clamp(24px, 4vw, 34px);
}

h2 {
    margin: 0 0 var(--space-3);
    font-size: clamp(20px, 3vw, 28px);
}

h3 {
    margin: 0 0 var(--space-2);
    font-size: clamp(16px, 2.4vw, 20px);
}

:focus-visible {
    outline: 3px solid rgba(47, 126, 230, 0.55);
    outline-offset: 2px;
}

[data-theme="dark"] :focus-visible {
    outline-color: rgba(111, 184, 255, 0.7);
}

.btn,
.action-btn,
.form button {
    border-radius: var(--radius-full);
    font-weight: var(--font-weight-semibold);
    transition: transform var(--duration-fast) var(--easing-standard),
        box-shadow var(--duration-base) var(--easing-standard),
        background var(--duration-base) var(--easing-standard),
        border-color var(--duration-base) var(--easing-standard),
        color var(--duration-base) var(--easing-standard);
}

.btn.btn-secondary,
.action-btn.secondary {
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
    color: #ffffff;
    border-color: transparent;
}

.btn.btn-outline,
.btn.outline {
    background: var(--surface);
    border: 1px solid rgba(72, 152, 234, 0.45);
    color: var(--text);
}

.btn.btn-ghost,
.btn.ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn.btn-danger,
.btn.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    border-color: transparent;
}

.btn.btn-sm,
.btn.small {
    height: 30px;
    padding: 0 var(--space-3);
    font-size: var(--font-size-xs);
}

.btn.btn-lg {
    height: 42px;
    padding: 0 var(--space-5);
    font-size: var(--font-size-md);
}

.btn.is-loading,
.action-btn.is-loading {
    pointer-events: none;
    opacity: 0.9;
}

.btn-spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: rgba(255, 255, 255, 1);
    animation: spin 0.8s linear infinite;
    display: inline-flex;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.card,
.description,
.comments,
.form,
.account-panel,
.account-card,
.dashboard-section,
.stat-card,
.chart-panel {
    border-radius: var(--radius-lg);
}

.card {
    gap: var(--space-2);
}

.card-title {
    font-size: var(--font-size-md);
}

.card-desc {
    font-size: var(--font-size-xs);
    line-height: var(--line-height-normal);
}

.ui-card {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: var(--space-4);
}

.ui-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.ui-card-title {
    font-size: 18px;
    font-weight: var(--font-weight-bold);
}

.field {
    display: grid;
    gap: 6px;
    margin-top: var(--space-3);
}

.field:first-child {
    margin-top: 0;
}

.field-label {
    font-size: var(--font-size-sm);
    color: var(--muted);
}

.field-help {
    font-size: var(--font-size-xs);
    color: var(--muted);
}

.field-error {
    color: var(--color-danger);
    font-size: var(--font-size-xs);
}

.field-success {
    color: var(--color-success);
    font-size: var(--font-size-xs);
}

.form input,
.form textarea,
.form select,
.field-input {
    font-size: var(--font-size-md);
    min-height: 40px;
    border-radius: var(--radius-md);
}

.field-input[aria-invalid="true"],
.form input[aria-invalid="true"],
.form textarea[aria-invalid="true"],
.form select[aria-invalid="true"] {
    border-color: rgba(220, 38, 38, 0.68);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16);
}

.field-input.is-valid,
.form input.is-valid,
.form textarea.is-valid,
.form select.is-valid {
    border-color: rgba(21, 128, 61, 0.65);
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.16);
}

.choice-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.choice {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--text);
}

.file-upload {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    background: var(--surface-2);
}

.file-upload input[type="file"] {
    max-width: 100%;
}

.skeleton {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--surface-2);
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.38) 45%,
        transparent 100%
    );
    animation: skeleton-wave 1.5s infinite;
}

[data-theme="dark"] .skeleton::after {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.16) 45%,
        transparent 100%
    );
}

@keyframes skeleton-wave {
    100% {
        transform: translateX(100%);
    }
}

.skeleton-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    display: grid;
    gap: var(--space-3);
    background: var(--surface);
}

.skeleton-thumb {
    height: 160px;
}

.skeleton-line {
    height: 12px;
}

.spinner {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(72, 152, 234, 0.25);
    border-top-color: var(--accent);
    animation: spin 0.8s linear infinite;
}

.progress-inline {
    width: 100%;
    height: 8px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.progress-inline > span {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--accent-grad);
    transition: width var(--duration-base) var(--easing-standard);
}

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    font-size: var(--font-size-sm);
    color: var(--muted);
}

.breadcrumbs a {
    color: var(--muted);
}

.breadcrumbs a:hover {
    color: var(--text);
}

.tabs {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-4);
}

.tab-link {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-full);
    padding: 8px 14px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--muted);
}

.tab-link:hover {
    color: var(--text);
    border-color: rgba(72, 152, 234, 0.4);
}

.tab-link.active {
    background: var(--accent-grad);
    color: #ffffff;
    border-color: transparent;
}

.table-shell {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.table-toolbar .search-bar {
    max-width: 360px;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    font-size: var(--font-size-sm);
}

.data-table th {
    color: var(--muted);
    font-weight: var(--font-weight-semibold);
    background: var(--surface-2);
}

.data-table tbody tr:hover {
    background: rgba(72, 152, 234, 0.08);
}

.sort-btn {
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.table-actions {
    display: inline-flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
}

.pagination .page-link {
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: var(--font-size-sm);
}

.pagination .page-link.active {
    background: var(--accent-grad);
    color: #ffffff;
    border-color: transparent;
}

.toast-stack {
    position: fixed;
    right: var(--space-4);
    bottom: var(--space-4);
    z-index: 3000;
    display: grid;
    gap: var(--space-2);
    width: min(360px, calc(100vw - 32px));
}

.toast {
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 10px 12px;
    background: var(--surface);
    color: var(--text);
    display: grid;
    gap: 4px;
    animation: toast-enter var(--duration-base) var(--easing-emphasized);
}

.toast-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

.toast-message {
    font-size: var(--font-size-xs);
    color: var(--muted);
}

.toast.success {
    border-color: rgba(21, 128, 61, 0.4);
}

.toast.error {
    border-color: rgba(220, 38, 38, 0.44);
}

.toast.warning {
    border-color: rgba(217, 119, 6, 0.44);
}

.toast.info {
    border-color: rgba(2, 132, 199, 0.44);
}

@keyframes toast-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.confirm-dialog .modal-card {
    width: 460px;
}

.confirm-dialog .modal-body {
    gap: var(--space-4);
}

.confirm-dialog .modal-actions {
    margin-top: 0;
}

.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 4000;
    background: transparent;
    pointer-events: none;
}

.global-loader::before {
    content: "";
    display: block;
    width: 0%;
    height: 100%;
    background: var(--accent-grad);
    transition: width var(--duration-slow) var(--easing-standard);
}

.global-loader.is-active::before {
    width: 88%;
}

.studio-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: var(--space-5);
    align-items: start;
}

.studio-sidebar {
    position: sticky;
    top: 72px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    padding: var(--space-3);
    display: grid;
    gap: var(--space-2);
}

.channel-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.channel-switcher .tab-link {
    margin: 0;
    text-decoration: none;
}

.asset-avatar-120 {
    width: 120px;
    height: 120px;
    border-radius: 999px;
    object-fit: cover;
    object-position: center;
    border: 1px solid var(--border);
    display: block;
    margin-top: 8px;
}

.studio-nav-link {
    padding: 9px 11px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    color: var(--muted);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.studio-nav-link:hover {
    color: var(--text);
    border-color: var(--border);
    background: var(--surface-2);
}

.studio-nav-link.active {
    background: var(--accent-grad-soft);
    border-color: rgba(72, 152, 234, 0.45);
    color: var(--text);
}

.studio-main {
    display: grid;
    gap: var(--space-5);
}

.studio-stat-grid {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    padding: var(--space-4);
    display: grid;
    gap: var(--space-1);
}

.kpi-label {
    color: var(--muted);
    font-size: var(--font-size-xs);
}

.kpi-value {
    font-size: clamp(22px, 2.5vw, 30px);
    font-weight: var(--font-weight-bold);
}

.kpi-delta {
    color: var(--color-success);
    font-size: var(--font-size-xs);
}

.studio-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--space-4);
}

.studio-grid > .span-8 {
    grid-column: span 8;
}

.studio-grid > .span-4 {
    grid-column: span 4;
}

.studio-grid > .span-12 {
    grid-column: span 12;
}

.podcast-row-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-2);
    background: var(--surface);
}

.podcast-row-card .thumb {
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-md);
}

.podcast-status {
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-full);
    padding: 2px 8px;
    font-size: var(--font-size-xs);
    border: 1px solid var(--border);
    color: var(--muted);
}

.podcast-status.published {
    border-color: rgba(21, 128, 61, 0.45);
    color: var(--color-success);
}

.podcast-status.draft {
    border-color: rgba(217, 119, 6, 0.45);
    color: var(--color-warning);
}

.podcast-status.active,
.podcast-status.approved,
.podcast-status.resolved {
    border-color: rgba(21, 128, 61, 0.45);
    color: var(--color-success);
}

.podcast-status.pending,
.podcast-status.warning {
    border-color: rgba(217, 119, 6, 0.45);
    color: var(--color-warning);
}

.podcast-status.rejected,
.podcast-status.error,
.podcast-status.blocked {
    border-color: rgba(220, 38, 38, 0.45);
    color: var(--color-danger);
}

.podcast-status.ignored {
    border-color: rgba(2, 132, 199, 0.45);
    color: var(--color-info);
}

.podcast-quick-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dnd-list {
    display: grid;
    gap: var(--space-2);
}

.dnd-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    background: var(--surface);
    display: grid;
    grid-template-columns: 30px 56px minmax(0, 1fr) auto;
    gap: var(--space-2);
    align-items: center;
}

.dnd-handle {
    font-size: 18px;
    color: var(--muted);
    cursor: grab;
}

.dnd-item.is-dragging {
    opacity: 0.65;
}

.admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--space-3);
}

.admin-event-list,
.attention-list {
    display: grid;
    gap: var(--space-2);
}

.event-row,
.attention-row {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.auth-card {
    width: min(520px, 100%);
    margin: 0 auto;
}

.auth-grid {
    display: grid;
    gap: var(--space-5);
}

.oauth-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
}

.mobile-menu {
    display: none;
}

.desktop-only {
    display: inline-flex;
}

.mobile-only {
    display: none;
}

@media (max-width: 1279px) {
    .studio-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-dashboard-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1023px) {
    .studio-shell {
        grid-template-columns: 1fr;
    }

    .studio-sidebar {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .studio-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .studio-grid > .span-8,
    .studio-grid > .span-4,
    .studio-grid > .span-12 {
        grid-column: span 1;
    }

    .admin-dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .podcast-row-card {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .podcast-quick-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .oauth-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .topbar {
        gap: var(--space-2);
        padding: 8px;
    }

    .topbar .left {
        min-width: auto;
    }

    .search-bar {
        order: 3;
        flex: 1 1 100%;
        max-width: 100%;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: inline-flex;
    }

    .mobile-menu {
        display: grid;
        gap: var(--space-2);
        padding: var(--space-3);
        border-bottom: 1px solid var(--border);
        background: var(--surface);
    }

    .mobile-menu[hidden] {
        display: none;
    }

    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .content {
        padding: var(--space-3);
    }

    .grid,
    .grid--recommended,
    .grid--popular,
    .grid--new,
    .grid--category {
        grid-template-columns: 1fr;
    }

    .chip {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
    }

    .action-btn,
    .btn,
    .icon-btn,
    .tab-link,
    .page-link,
    .nav-item,
    .studio-nav-link {
        min-height: 44px;
    }

    .admin-dashboard-grid,
    .studio-stat-grid {
        grid-template-columns: 1fr;
    }

    .dnd-item {
        grid-template-columns: 30px 44px minmax(0, 1fr);
    }

    .dnd-item .table-actions {
        grid-column: 1 / -1;
    }
}

/* ===== Editor UI Refresh (2026) ===== */
.editor-page .content,
.editor-page .tab-panel.editor-panel.active,
.editor-page .slides-editor,
.editor-page .editor-main,
.editor-page .editor-right,
.editor-page .editor-bottom,
.editor-page .timeline-workspace,
.editor-page .timeline-editor {
    min-width: 0;
    min-height: 0;
}

.editor-page .slides-editor {
    grid-template-columns: 132px minmax(0, 1fr) minmax(360px, 34vw);
    grid-template-rows: auto minmax(0, 1fr) minmax(220px, 34vh);
    height: 100vh;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.04) 0%, transparent 28%),
        var(--editor-bg);
}

[data-theme="dark"] .editor-page .slides-editor {
    background:
        linear-gradient(180deg, rgba(148, 163, 184, 0.08) 0%, transparent 28%),
        var(--editor-bg);
}

.editor-page .editor-head {
    grid-column: 2 / 4;
    grid-row: 1 / 2;
    padding: 10px 14px;
    border-bottom: 1px solid var(--editor-border);
}

.editor-page .editor-topbar {
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    background: transparent;
}

.editor-page .editor-links {
    margin-right: 0;
    flex-wrap: wrap;
    gap: 6px;
}

.editor-page .editor-topbar .btn.small {
    height: 32px;
    border-radius: 0;
}

.editor-page .editor-left {
    grid-column: 1 / 2;
    grid-row: 1 / 4;
    height: 100%;
    max-height: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 10px;
    gap: 10px;
    border-right: 1px solid var(--editor-border);
    background: var(--editor-panel);
}

.editor-page .editor-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--editor-text);
    border-bottom: 1px solid var(--editor-border);
    padding: 4px 2px 10px;
}

.editor-page .editor-brand .logo-mark {
    width: 24px;
    height: 16px;
}

.editor-page .side-title {
    margin: 0;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--editor-muted);
}

.editor-page .side-subtitle {
    margin: -2px 0 0;
    text-align: left;
}

.editor-page .tools-panel {
    width: 100%;
    max-width: none;
    border: 1px solid var(--editor-border);
    border-radius: 0;
    background: transparent;
    padding: 8px;
}

.editor-page .editor-left .tools-panel:last-of-type {
    flex: 1 1 auto;
}

.editor-page .tools-title {
    text-align: left;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.editor-page .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    justify-items: stretch;
}

.editor-page .tool-btn {
    width: 100%;
    height: 40px;
    border-radius: 0;
    border: 1px solid var(--editor-border);
    background: transparent;
}

.editor-page .tool-btn:hover,
.editor-page .tool-btn.is-active {
    border-color: var(--editor-accent);
    color: var(--editor-accent);
    background: rgba(56, 189, 248, 0.08);
}

.editor-page .tool-icon {
    font-size: 16px;
}

.editor-page .draw-row.compact {
    align-items: stretch;
    gap: 8px;
}

.editor-page .draw-group {
    width: 100%;
    align-items: stretch;
}

.editor-page .draw-label {
    text-align: left;
}

.editor-page .draw-row.compact input[type="color"] {
    width: 100%;
    height: 28px;
    border-radius: 0;
}

.editor-page .thickness-group {
    width: 100%;
}

.editor-page .thickness-btn.dot,
.editor-page .thickness-btn {
    border-radius: 0;
}

.editor-page .thickness-btn.dot {
    width: 100%;
}

.editor-page .editor-main {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    align-items: stretch;
    justify-content: flex-start;
    padding: 8px 12px;
    overflow: hidden;
    background: transparent;
}

.editor-page .preview-panel {
    width: min(100%, 920px);
    height: 100%;
    min-height: 0;
    margin: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: stretch;
}

.editor-page .preview-screen {
    width: min(100%, 920px);
    height: min(100%, 64vh);
    aspect-ratio: 16 / 9;
    max-width: 100%;
    max-height: 100%;
    justify-self: center;
    align-self: center;
    border: 1px solid var(--editor-border);
    border-radius: 0;
    background: #0a0f18;
}

[data-theme="light"] .editor-page .preview-screen {
    background: #dfe7f2;
}

.editor-page .preview-dock {
    width: min(100%, 980px);
    justify-self: center;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
    display: grid;
    gap: 10px;
}

.editor-page .preview-controls {
    width: 100%;
    margin-top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: var(--editor-panel);
    border: 1px solid var(--editor-border);
    padding: 8px 10px;
    border-radius: 0;
}

.editor-page .preview-controls .player-left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.editor-page .preview-controls .player-right {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.editor-page #previewPlay {
    width: 38px;
    min-width: 38px;
    height: 38px;
    justify-content: center;
}

.editor-page .preview-time {
    text-align: left;
    font-variant-numeric: tabular-nums;
}

.editor-page .preview-speed {
    margin-left: 0;
    border-radius: 0;
}

.editor-page .preview-progress,
.editor-page .mini-ruler {
    width: 100%;
    max-width: none;
    border-radius: 0;
}

.editor-page .preview-progress {
    margin-top: 0;
    height: 8px;
    background: var(--editor-panel-2);
    border: 1px solid var(--editor-border);
    cursor: pointer;
    overflow: hidden;
}

.editor-page .preview-progress > div {
    background: linear-gradient(90deg, #38bdf8 0%, #0ea5e9 100%);
}

.editor-page .mini-ruler {
    height: 4px;
    background: rgba(148, 163, 184, 0.2);
}

.editor-page .editor-right {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
    max-height: none;
    border-left: 1px solid var(--editor-border);
    padding: 12px;
}

.editor-page .slides-library {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    align-content: start;
    gap: 8px;
}

.editor-page .slide-item,
.editor-page .dropzone {
    border-radius: 0;
}

.editor-page .slide-item {
    position: relative;
    display: grid;
    gap: 6px;
    align-content: start;
    padding: 8px;
    background: var(--editor-panel);
    border: 1px solid var(--editor-border);
}

.editor-page .slide-item.is-active {
    border-color: var(--editor-accent);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.4);
}

.editor-page .slide-media {
    position: relative;
    width: 100%;
    min-height: 124px;
    display: grid;
    place-items: center;
    background: var(--editor-panel-2);
    border: 1px dashed var(--editor-border);
}

.editor-page .slide-item img {
    width: auto;
    height: auto;
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
    border-radius: 0;
}

.editor-page .slide-overlay-controls {
    position: absolute;
    top: 6px;
    right: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.editor-page .slide-overlay-controls .icon-btn.sm {
    width: 24px;
    height: 24px;
    border-radius: 0;
    border: 1px solid rgba(148, 163, 184, 0.42);
    background: rgba(15, 23, 42, 0.66);
    color: #e2e8f0;
}

[data-theme="light"] .editor-page .slide-overlay-controls .icon-btn.sm {
    background: rgba(255, 255, 255, 0.88);
    color: #0f172a;
}

.editor-page .slide-library-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.editor-page .slide-library-meta .slide-title,
.editor-page .slide-library-meta .slide-time {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 6px;
    background: transparent;
    color: var(--editor-muted);
    border-radius: 0;
    font-size: 11px;
    border: 1px solid var(--editor-border);
}

.editor-page .slide-dot {
    display: none;
}

.editor-page .slides-library.is-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.editor-page .slides-library.is-compact .slide-item img {
    max-width: 100px;
    max-height: 100px;
}

.editor-page .dropzone {
    background: transparent;
}

.editor-page .editor-bottom {
    grid-column: 2 / 4;
    grid-row: 3 / 4;
    border-top: 1px solid var(--editor-border);
    padding: 10px 12px 12px;
}

.editor-page .timeline-toolbar {
    border: 1px solid var(--editor-border);
    border-radius: 0;
    background: transparent;
}

.editor-page .timeline-editor {
    border: 1px solid var(--editor-border);
    border-radius: 0;
    overflow: auto;
    background: var(--editor-bg);
}

.editor-page .timeline-content {
    border-radius: 0;
    background: transparent;
}

.editor-page .timeline-track {
    border-radius: 0;
    border: 1px solid var(--editor-border);
    background:
        repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.2) 0 1px, transparent 1px 56px),
        repeating-linear-gradient(0deg, rgba(148, 163, 184, 0.14) 0 1px, transparent 1px 28px);
}

.editor-page .timeline-track::after {
    opacity: 0.45;
}

.editor-page .timeline-ruler {
    border-bottom-color: var(--editor-border);
}

.editor-page .timeline-playhead,
.editor-page .timeline-playhead::before,
.editor-page .timeline-playhead span,
.editor-page .playhead-preview,
.editor-page .block-thumb,
.editor-page .slide-block,
.editor-page .resize-handle,
.editor-page .tiny-preview,
.editor-page .element-block {
    border-radius: 0;
    box-shadow: none;
}

.editor-page .timeline-playhead {
    width: 2px;
    background: var(--editor-accent);
}

.editor-page .timeline-playhead::before {
    width: 9px;
    height: 9px;
    background: var(--editor-accent);
}

.editor-page .timeline-playhead span {
    border: 1px solid var(--editor-border);
}

.timeline-playhead.at-start span {
    left: 0;
    transform: none;
}

.timeline-playhead.at-end span {
    left: auto;
    right: 0;
    transform: none;
}

.editor-page .playhead-preview {
    border-color: var(--editor-border);
}

.editor-page .slide-block {
    border-color: var(--editor-border);
    background: var(--editor-panel);
}

.editor-page .slide-block.is-active {
    border-color: var(--editor-accent);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.editor-page .block-thumb {
    border-color: var(--editor-border);
}

.editor-page .block-label {
    border-radius: 0;
}

.editor-page .resize-handle {
    right: 0;
    width: 8px;
}

.editor-page .element-block {
    border-style: solid;
    background: rgba(56, 189, 248, 0.14);
}

.library-preview-frame {
    width: min(76vw, 940px);
    max-width: 100%;
    min-height: 280px;
    max-height: 72vh;
    display: grid;
    place-items: center;
    border: 1px solid var(--editor-border);
    background: var(--editor-panel-2);
}

.library-preview-frame img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

@media (max-width: 1340px) {
    .editor-page .slides-editor {
        grid-template-columns: 118px minmax(0, 1fr) minmax(320px, 32vw);
    }
}

@media (max-width: 1160px) {
    .editor-page .slides-editor {
        grid-template-columns: 104px minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr) minmax(0, 28vh) minmax(220px, 34vh);
    }

    .editor-page .editor-head {
        grid-column: 2 / 3;
    }

    .editor-page .editor-left {
        grid-column: 1 / 2;
        grid-row: 1 / 5;
    }

    .editor-page .editor-main {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
    }

    .editor-page .editor-right {
        grid-column: 2 / 3;
        grid-row: 3 / 4;
        border-left: none;
        border-top: 1px solid var(--editor-border);
    }

    .editor-page .editor-bottom {
        grid-column: 1 / 3;
        grid-row: 4 / 5;
    }

    .editor-page .slides-library {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1023px) {
    .editor-page {
        overflow: auto;
    }

    .editor-page .layout,
    .editor-page .content {
        height: auto;
        min-height: 100vh;
    }

    .editor-page .slides-editor {
        height: auto;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        overflow: visible;
    }

    .editor-page .editor-head,
    .editor-page .editor-left,
    .editor-page .editor-main,
    .editor-page .editor-right,
    .editor-page .editor-bottom {
        grid-column: 1 / -1;
        grid-row: auto;
        border-left: none;
        border-right: none;
    }

    .editor-page .editor-left {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        max-height: none;
        overflow: visible;
        border-top: 1px solid var(--editor-border);
    }

    .editor-page .side-title,
    .editor-page .side-subtitle {
        grid-column: 1 / -1;
    }

    .editor-page .editor-right {
        border-top: 1px solid var(--editor-border);
        max-height: none;
    }

    .editor-page .editor-bottom {
        height: 340px;
    }
}

@media (max-width: 767px) {
    .editor-page .editor-topbar {
        display: grid;
        gap: 8px;
    }

    .editor-page .editor-topbar .topbar-left,
    .editor-page .editor-topbar .topbar-right {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .editor-page .editor-left {
        grid-template-columns: 1fr;
    }

    .editor-page .tools-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .editor-page .preview-controls {
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
    }

    .editor-page .preview-time {
        text-align: left;
    }

    .editor-page .slides-library {
        grid-template-columns: 1fr;
    }

    .editor-page .editor-bottom {
        height: 300px;
    }
}

/* ===== Editor Final Pass ===== */
.editor-page {
    --editor-bg: #ffffff;
    --editor-panel: #ffffff;
    --editor-panel-2: #f5f7fb;
    --editor-border: rgba(17, 24, 39, 0.22);
    --editor-text: #0f172a;
    --editor-muted: #475569;
    --editor-accent: #111827;
}

[data-theme="dark"] .editor-page {
    --editor-bg: #151515;
    --editor-panel: #1d1d1d;
    --editor-panel-2: #262626;
    --editor-border: rgba(255, 255, 255, 0.16);
    --editor-text: #f5f5f5;
    --editor-muted: #c4c4c4;
    --editor-accent: #ffffff;
}

.editor-page .slides-editor {
    grid-template-columns: 132px minmax(460px, 1fr) minmax(420px, 1.4fr);
    grid-template-rows: auto minmax(0, 1fr) minmax(240px, 36vh);
    gap: 8px;
}

.editor-page .editor-head,
.editor-page .editor-left,
.editor-page .editor-main,
.editor-page .editor-right,
.editor-page .editor-bottom,
.editor-page .preview-screen,
.editor-page .preview-controls,
.editor-page .preview-progress,
.editor-page .timeline-editor,
.editor-page .timeline-track,
.editor-page .timeline-toolbar,
.editor-page .tools-panel,
.editor-page .slide-item,
.editor-page .dropzone {
    border: none !important;
    box-shadow: none !important;
}

.editor-page .editor-main {
    padding: 6px 10px;
    justify-self: start;
    align-items: stretch;
}

.editor-page .editor-left {
    padding-bottom: 18px;
}

.editor-page .editor-left .tools-panel:last-of-type {
    min-height: 0;
    display: grid;
    align-content: start;
}

.editor-page .editor-right {
    border-left: none;
    padding: 10px 10px 10px 6px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 8px;
}

.editor-page .editor-right .slides-library {
    flex: 1;
    min-height: 0;
}

.editor-page .editor-bottom .timeline-toolbar {
    margin: 0;
    padding: 8px 10px;
    background: var(--editor-panel-2);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.editor-page .editor-bottom .timeline-workspace {
    margin-top: 0;
}

.editor-page .editor-bottom .timeline-editor {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.editor-page .editor-bottom {
    grid-column: 2 / 4;
    grid-row: 3 / 4;
    padding: 6px 10px 10px;
    border-top: none;
}

.editor-page .timeline-workspace {
    height: 100%;
}

.editor-page .timeline-editor {
    padding: 24px 10px 10px;
    background: var(--editor-panel-2);
}

.editor-page .timeline-content {
    background: transparent;
}

.editor-page .timeline-track {
    background:
        repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.2) 0 1px, transparent 1px 56px),
        repeating-linear-gradient(0deg, rgba(148, 163, 184, 0.14) 0 1px, transparent 1px 46px);
}

.editor-page .timeline-playhead span {
    top: -20px;
    background: rgba(17, 24, 39, 0.88);
    color: #f8fafc;
    border: none;
}

.editor-page .preview-screen {
    background: #ffffff;
    width: 100% !important;
    max-width: none;
    height: auto;
    justify-self: stretch;
    align-self: start;
    border: 1px solid var(--editor-border) !important;
    border-radius: 8px !important;
}

.editor-page .preview-panel {
    width: 100%;
    max-width: none;
    margin: 0;
}

[data-theme="dark"] .editor-page .preview-screen {
    background: #1f1f1f;
}

.editor-page .preview-dock {
    gap: 8px;
}

.editor-page .preview-controls {
    padding: 8px 10px;
    background: var(--editor-panel-2);
}

.editor-page .preview-controls .player-left,
.editor-page .preview-controls .player-right {
    gap: 8px;
}

.editor-page .preview-speed {
    border: none;
    background: var(--editor-panel);
}

.editor-page .preview-progress {
    height: 7px;
    background: rgba(148, 163, 184, 0.24);
}

.editor-page .preview-progress > div {
    background: linear-gradient(90deg, #4b5563 0%, #111827 100%);
}

[data-theme="dark"] .editor-page .preview-progress > div {
    background: linear-gradient(90deg, #d1d5db 0%, #ffffff 100%);
}

.editor-page .slides-library {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
}

.editor-page .slide-item {
    position: relative;
    display: inline-block;
    width: 100%;
    padding: 0;
    background: var(--editor-panel-2);
    cursor: pointer;
    overflow: hidden;
}

.editor-page .slide-item.is-active {
    box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.28);
}

[data-theme="dark"] .editor-page .slide-item.is-active {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.editor-page .slide-media {
    position: relative;
    min-height: 0;
    display: block;
    background: transparent;
    overflow: hidden;
}

.editor-page .slide-item img {
    width: 100%;
    height: auto;
    max-width: none;
    max-height: none;
    object-fit: contain;
    display: block;
}

.editor-page .slide-overlay-controls,
.editor-page .slide-library-meta {
    display: none !important;
}

.editor-page .slide-card-actions {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0) 0%, rgba(17, 24, 39, 0.82) 72%);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

.editor-page .slide-card-actions .icon-btn.sm {
    width: 100%;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
}

[data-theme="dark"] .editor-page .slide-card-actions .icon-btn.sm {
    background: rgba(17, 24, 39, 0.9);
    color: #f3f4f6;
}

.editor-page .slide-item:hover .slide-card-actions,
.editor-page .slide-item:focus-within .slide-card-actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.editor-page .slides-library.is-drop-target {
    outline: 2px dashed rgba(72, 152, 234, 0.7);
    outline-offset: -6px;
}

.editor-page .slide-dot {
    display: none;
}

.editor-page .slides-library.is-compact {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.editor-page .library-preview-card {
    width: min(960px, 92vw);
    max-width: 92vw;
}

.editor-page .library-preview-card .modal-body {
    max-height: calc(100vh - 220px);
    overflow: auto;
}

.editor-page .library-preview-frame {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    aspect-ratio: 16 / 9;
    max-height: min(72vh, calc(100vh - 280px));
    background: var(--editor-panel-2);
    border: none;
}

.editor-page .library-preview-frame img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.editor-page .preview-screen.is-placement-target,
.editor-page .preview-screen.is-placement-target * {
    cursor: crosshair;
}

.editor-page .slide-overlay.is-placement-target {
    pointer-events: none;
}

.editor-page .record-status {
    margin-left: 0;
}

.editor-page .record-status.is-error {
    color: #dc2626;
}

[data-theme="dark"] .editor-page .record-status.is-error {
    color: #f87171;
}

@media (max-width: 1340px) {
    .editor-page .slides-editor {
        grid-template-columns: 118px minmax(0, 1.5fr) minmax(280px, 1fr);
    }
}

@media (max-width: 1160px) {
    .editor-page .slides-editor {
        grid-template-columns: 104px minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr) minmax(0, 34vh) minmax(220px, 34vh);
    }
}

/* ===== Admin Flat Refresh (2026) ===== */
body.admin-page {
    --admin-border: rgba(15, 23, 42, 0.1);
    --admin-border-soft: rgba(15, 23, 42, 0.06);
    --admin-hover: rgba(15, 98, 254, 0.06);
    --admin-accent: #0f62fe;
    background: linear-gradient(180deg, #f4f6f9 0%, #eef2f7 100%);
}

[data-theme="dark"] body.admin-page {
    --admin-border: rgba(148, 163, 184, 0.26);
    --admin-border-soft: rgba(148, 163, 184, 0.18);
    --admin-hover: rgba(95, 168, 255, 0.12);
    --admin-accent: #78adff;
    background: linear-gradient(180deg, #0e131b 0%, #111827 100%);
}

body.admin-page .topbar {
    border-bottom: 1px solid var(--admin-border);
    box-shadow: none;
    background: rgba(248, 251, 255, 0.9);
    backdrop-filter: blur(8px);
}

[data-theme="dark"] body.admin-page .topbar {
    background: rgba(17, 24, 39, 0.86);
}

body.admin-page .content {
    max-width: 1460px;
    margin: 0 auto;
    padding: 24px 28px 36px;
}

body.admin-page .content > .breadcrumbs {
    margin-bottom: 12px;
}

body.admin-page .content > .tabs {
    gap: 6px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--admin-border-soft);
}

body.admin-page .tab-link {
    border-radius: 0;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    box-shadow: none;
}

body.admin-page .tab-link:hover {
    border-color: var(--admin-border);
    background: transparent;
}

body.admin-page .tab-link.active {
    background: transparent;
    color: var(--text);
    border-color: var(--admin-border);
}

body.admin-page .ui-card,
body.admin-page .table-shell,
body.admin-page .kpi-card,
body.admin-page .event-row,
body.admin-page .attention-row,
body.admin-page .table-toolbar,
body.admin-page .podcast-row-card,
body.admin-page .dnd-item {
    border-radius: 0;
    box-shadow: none;
    border: 1px solid var(--admin-border-soft);
}

body.admin-page .ui-card {
    padding: 18px;
}

body.admin-page .ui-card .ui-card {
    padding: 14px;
}

body.admin-page .table-toolbar {
    background: transparent;
    border-bottom: 1px solid var(--admin-border-soft);
}

body.admin-page .data-table th,
body.admin-page .data-table td {
    border-bottom: 1px solid var(--admin-border-soft);
}

body.admin-page .data-table th {
    background: transparent;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

body.admin-page .data-table tbody tr:hover {
    background: var(--admin-hover);
}

body.admin-page .kpi-card {
    gap: 6px;
}

body.admin-page .kpi-label {
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

body.admin-page .event-row,
body.admin-page .attention-row {
    align-items: flex-start;
    padding: 12px 14px;
}

body.admin-page .btn,
body.admin-page .icon-btn,
body.admin-page .pagination .page-link,
body.admin-page .podcast-status,
body.admin-page input,
body.admin-page select,
body.admin-page textarea {
    border-radius: 0;
    box-shadow: none;
}

body.admin-page .btn {
    height: 34px;
    transform: none;
}

body.admin-page .btn:hover {
    transform: none;
    filter: none;
    box-shadow: none;
}

body.admin-page .btn.outline,
body.admin-page .btn.btn-outline,
body.admin-page .btn.ghost,
body.admin-page .btn.btn-ghost {
    background: transparent;
    border-color: var(--admin-border);
}

body.admin-page .btn.danger,
body.admin-page .btn.btn-danger {
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.28);
}

[data-theme="dark"] body.admin-page .btn.danger,
[data-theme="dark"] body.admin-page .btn.btn-danger {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.34);
}

body.admin-page input,
body.admin-page select,
body.admin-page textarea {
    border: 1px solid var(--admin-border);
}

body.admin-page input:focus,
body.admin-page select:focus,
body.admin-page textarea:focus {
    border-color: var(--admin-accent);
    box-shadow: none;
}

body.admin-page .pagination .page-link.active {
    background: var(--admin-accent);
    border-color: var(--admin-accent);
    color: #fff;
}

@media (max-width: 1023px) {
    body.admin-page .content {
        padding: 16px 16px 24px;
    }
}

@media (max-width: 767px) {
    body.admin-page .content > .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
    }

    body.admin-page .ui-card {
        padding: 14px;
    }
}

/* ===== Slides Editor Final Override ===== */
.editor-page {
    --editor-bg: #ffffff;
    --editor-panel: #ffffff;
    --editor-panel-2: #f5f7fb;
    --editor-border: rgba(17, 24, 39, 0.22);
    --editor-text: #0f172a;
    --editor-muted: #475569;
}

.editor-page .slides-editor {
    grid-template-columns: 132px minmax(0, 1fr) minmax(420px, 1.2fr);
    gap: 8px;
}

.editor-page .editor-main {
    padding: 8px 12px;
    justify-self: stretch;
    align-items: stretch;
}

.editor-page .preview-panel {
    width: 100%;
    max-width: none;
    margin: 0;
}

.editor-page .preview-screen {
    width: 100% !important;
    max-width: none;
    justify-self: stretch;
    border: 1px solid var(--editor-border) !important;
    border-radius: 8px !important;
    background: #ffffff;
}

[data-theme="dark"] .editor-page .preview-screen {
    background: #1f1f1f;
}

.editor-page .editor-right {
    padding: 10px 12px;
}

.editor-page .slides-library {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
    align-content: start;
}

.editor-page .slides-library.is-drop-target {
    outline: 2px dashed rgba(72, 152, 234, 0.7);
    outline-offset: -6px;
}

.editor-page .slide-item {
    position: relative;
    width: 100%;
    padding: 6px;
    background: #fff;
    border: 1px solid rgba(17, 24, 39, 0.18) !important;
    border-radius: 8px;
    overflow: hidden;
}

.editor-page .slide-media {
    position: relative;
    display: block;
    background: var(--editor-panel-2);
    border-radius: 6px;
    overflow: hidden;
}

.editor-page .slide-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.editor-page .slide-card-actions {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 6px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.78) 100%);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    pointer-events: none;
}

.editor-page .slide-item:hover .slide-card-actions,
.editor-page .slide-item:focus-within .slide-card-actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.editor-page .slide-card-actions .icon-btn.sm {
    width: 100%;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    color: #111827;
}

[data-theme="dark"] .editor-page .slide-card-actions .icon-btn.sm {
    background: rgba(17, 24, 39, 0.92);
    color: #f3f4f6;
}
