/* --- Мини-студия: карточки, шапка, статистика --- */
.studio-page .main-content {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 20px 24px 40px;
    overflow-x: hidden;
}

.studio-root {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1180px;
    margin: 0 auto;
    width: 100%;
}

/* Шапка как на «Истории»: тёмный блок */
.studio-shell-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    background: linear-gradient(165deg, #1f1f22 0%, #18181a 100%);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.studio-shell-title {
    margin: 0 0 6px 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary, #f1f1f1);
}

.studio-shell-desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-secondary, #aaa);
    max-width: 52ch;
}

.studio-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary, #f1f1f1);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.studio-back-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
}

.studio-back-btn:active {
    transform: translateY(1px);
}

.studio-back-btn-icon {
    opacity: 0.85;
    font-size: 16px;
}

/* Вкладки */
.studio-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.studio-tab {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary, #aaa);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.studio-tab.is-active {
    background: rgba(62, 166, 255, 0.16);
    border-color: rgba(62, 166, 255, 0.35);
    color: #e8f4ff;
    cursor: default;
}

.studio-tab:focus-visible {
    outline: 2px solid rgba(62, 166, 255, 0.45);
    outline-offset: 2px;
}

.studio-tab--muted {
    opacity: 0.45;
    cursor: not-allowed;
}

.studio-tab-panel {
    min-width: 0;
}

.studio-analytics-preview {
    padding: 22px 24px 20px;
    border-radius: 16px;
    background: linear-gradient(165deg, #25252c 0%, #18181d 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.studio-analytics-preview-head {
    max-width: 52ch;
}

.studio-analytics-preview-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #f2f2f2);
}

.studio-analytics-preview-sub {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary, #a8a8a8);
}

.studio-analytics-chart-fake {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    height: 132px;
    margin: 22px 0 18px;
    padding: 12px 14px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.studio-analytics-chart-fake span {
    flex: 1 1 0;
    max-width: 40px;
    margin: 0 auto;
    border-radius: 6px 6px 3px 3px;
    background: linear-gradient(180deg, rgba(62, 166, 255, 0.55), rgba(62, 166, 255, 0.08));
    box-shadow: 0 0 20px rgba(62, 166, 255, 0.12);
}

.studio-analytics-chart-fake span:nth-child(1) { height: 38%; }
.studio-analytics-chart-fake span:nth-child(2) { height: 62%; }
.studio-analytics-chart-fake span:nth-child(3) { height: 48%; }
.studio-analytics-chart-fake span:nth-child(4) { height: 78%; }
.studio-analytics-chart-fake span:nth-child(5) { height: 55%; }
.studio-analytics-chart-fake span:nth-child(6) { height: 88%; }
.studio-analytics-chart-fake span:nth-child(7) { height: 42%; }

.studio-analytics-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px 0;
    padding: 0;
    list-style: none;
}

.studio-analytics-chips li {
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #c9dce8;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.studio-analytics-footnote {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: #7a8088;
    font-style: italic;
}

/* --- Вкладка «Аналитика» --- */
.studio-analytics-dash {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.studio-analytics-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border-radius: 16px;
    background: linear-gradient(155deg, #2a2a32 0%, #1a1a20 55%, #141418 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.studio-analytics-eyebrow {
    margin: 0 0 6px 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(62, 166, 255, 0.85);
}

.studio-analytics-hero-title {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary, #f2f2f2);
}

.studio-analytics-hero-sub {
    margin: 0;
    max-width: 52ch;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary, #a8a8a8);
}

.studio-analytics-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.studio-analytics-badge {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #c8d4de;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.studio-analytics-badge--plus {
    color: #ffe9b8;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.18), rgba(255, 152, 0, 0.1));
    border-color: rgba(255, 193, 7, 0.35);
}

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

@media (min-width: 720px) {
    .studio-analytics-kpi {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.studio-analytics-kpi-card {
    padding: 16px 14px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(0, 0, 0, 0.25) 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    text-align: center;
}

.studio-analytics-kpi-value {
    display: block;
    font-size: clamp(18px, 2.5vw, 26px);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #fff;
    line-height: 1.15;
}

.studio-analytics-kpi-label {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(180, 186, 198, 0.9);
}

.studio-analytics-kpi-hint {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #7a8088;
}

.studio-analytics-grid {
    display: grid;
    gap: 14px;
}

.studio-analytics-grid--base {
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .studio-analytics-grid--base {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    }

    .studio-analytics-card--wide {
        grid-column: 1 / -1;
    }
}

.studio-analytics-grid--plus {
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .studio-analytics-grid--plus {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .studio-analytics-grid--plus .studio-analytics-card--wide {
        grid-column: 1 / -1;
    }
}

.studio-analytics-card {
    padding: 18px 20px;
    border-radius: 14px;
    background: linear-gradient(165deg, #25252c 0%, #18181d 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.studio-analytics-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.studio-analytics-card-title {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #eee);
}

.studio-analytics-card-desc {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: #8a9098;
}

.studio-analytics-card-empty {
    margin: 0;
    font-size: 13px;
    color: #888;
}

.studio-analytics-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    min-height: 140px;
    padding: 12px 10px 8px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.studio-analytics-bar-col {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    height: 120px;
    justify-content: flex-end;
    gap: 8px;
}

.studio-analytics-bar {
    width: 100%;
    max-width: 44px;
    height: var(--h, 40%);
    min-height: 8px;
    border-radius: 6px 6px 3px 3px;
    background: linear-gradient(180deg, rgba(62, 166, 255, 0.75), rgba(62, 166, 255, 0.12));
    box-shadow: 0 0 18px rgba(62, 166, 255, 0.15);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
    transition: height 0.35s ease;
}

.studio-analytics-bar-value {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.studio-analytics-bar-label {
    font-size: 10px;
    font-weight: 600;
    color: #9aa0a8;
    text-align: center;
    white-space: nowrap;
}

.studio-analytics-vis-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.studio-analytics-vis-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
    gap: 10px;
    align-items: center;
    font-size: 13px;
}

.studio-analytics-vis-name--public { color: #8fd4ff; }
.studio-analytics-vis-name--unlisted { color: #d4b8ff; }
.studio-analytics-vis-name--private { color: #ffb4a8; }

.studio-analytics-vis-track,
.studio-analytics-top-bar span,
.studio-analytics-donut-track span,
.studio-analytics-geo-bar span {
    display: block;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.studio-analytics-vis-track span,
.studio-analytics-top-bar span,
.studio-analytics-donut-track span,
.studio-analytics-geo-bar span {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(62, 166, 255, 0.5), rgba(62, 166, 255, 0.95));
}

.studio-analytics-vis-num {
    font-size: 12px;
    font-weight: 600;
    color: #b8bec8;
    white-space: nowrap;
}

.studio-analytics-top-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.studio-analytics-top-item {
    display: grid;
    grid-template-columns: auto 80px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.studio-analytics-top-rank {
    width: 22px;
    font-size: 13px;
    font-weight: 800;
    color: rgba(62, 166, 255, 0.9);
    text-align: center;
}

.studio-analytics-top-thumb {
    width: 80px;
    height: 45px;
    object-fit: cover;
    border-radius: 8px;
    background: #111;
}

.studio-analytics-top-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.studio-analytics-top-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #eee);
    text-decoration: none;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.studio-analytics-top-title:hover {
    color: #8fd4ff;
}

.studio-analytics-top-views {
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #d0d6de;
    white-space: nowrap;
}

.studio-analytics-plus-zone {
    position: relative;
    margin-top: 4px;
}

.studio-analytics-dash:not(.studio-analytics-dash--plus):not(.studio-analytics-dash--preview-plus) .studio-analytics-grid--plus {
    filter: blur(7px);
    opacity: 0.55;
    pointer-events: none;
    user-select: none;
}

.studio-analytics-plus-lock {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(12, 12, 16, 0.55);
    border-radius: 16px;
    backdrop-filter: blur(2px);
}

.studio-analytics-dash--plus .studio-analytics-plus-lock,
.studio-analytics-dash--preview-plus .studio-analytics-plus-lock {
    display: none;
}

.studio-analytics-plus-lock-inner {
    max-width: 360px;
    padding: 22px 24px;
    text-align: center;
    border-radius: 16px;
    background: linear-gradient(165deg, #2c2c34 0%, #1e1e26 100%);
    border: 1px solid rgba(255, 193, 7, 0.25);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.studio-analytics-plus-lock-icon {
    margin-bottom: 10px;
}

.studio-analytics-plus-lock-title {
    margin: 0 0 8px 0;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}

.studio-analytics-plus-lock-inner p {
    margin: 0 0 14px 0;
    font-size: 13px;
    line-height: 1.5;
    color: #a8aeb6;
}

.studio-analytics-plus-lock-inner .studio-btn {
    margin: 4px;
}

.studio-analytics-period {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.studio-analytics-period-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #9aa0a8;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.studio-analytics-period-btn.is-active {
    background: rgba(62, 166, 255, 0.2);
    color: #e8f4ff;
}

.studio-analytics-retention-chart {
    width: 100%;
    height: 120px;
    display: block;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
}

.studio-analytics-retention-line {
    stroke: #3ea6ff;
    stroke-width: 2.5px;
    transition: opacity 0.25s ease;
}

.studio-analytics-retention-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 10px;
    color: #7a8088;
}

.studio-analytics-donut-list,
.studio-analytics-geo-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.studio-analytics-donut-list li,
.studio-analytics-geo-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
    gap: 10px;
    align-items: center;
    font-size: 13px;
}

.studio-analytics-donut-label,
.studio-analytics-geo-name {
    color: #c8ced6;
}

.studio-analytics-donut-pct,
.studio-analytics-geo-pct {
    font-weight: 700;
    color: #e0e6ee;
    font-variant-numeric: tabular-nums;
}

.studio-analytics-geo-row {
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto;
}

.studio-analytics-geo-code {
    font-size: 11px;
    font-weight: 800;
    color: rgba(62, 166, 255, 0.85);
    letter-spacing: 0.06em;
}

.studio-analytics-device-grid {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.studio-analytics-device-tile {
    padding: 14px 12px;
    border-radius: 12px;
    text-align: center;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.studio-analytics-device-icon {
    display: block;
    font-size: 22px;
    margin-bottom: 6px;
}

.studio-analytics-device-label {
    display: block;
    font-size: 12px;
    color: #a8aeb6;
    margin-bottom: 4px;
}

.studio-analytics-device-pct {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.studio-analytics-empty {
    text-align: center;
    padding: 36px 20px;
    border-radius: 16px;
    background: linear-gradient(165deg, #25252c 0%, #18181d 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.studio-analytics-empty-img {
    max-width: 100%;
    height: auto;
    margin-bottom: 14px;
    opacity: 0.88;
}

.studio-analytics-empty p {
    margin: 0 0 16px 0;
    color: #9aa0a8;
    font-size: 14px;
}

.studio-analytics-dash .studio-analytics-footnote {
    padding: 0 4px;
}

.studio-tab-panel--analytics .studio-analytics-upgrade {
    white-space: nowrap;
}

/* Аналитика: компактная шапка и таблицы метрик */
.studio-analytics-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 16px;
}

.studio-analytics-head-title {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary, #f1f1f1);
}

.studio-analytics-head-desc {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary, #aaa);
}

.studio-analytics-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.studio-stats-slab--analytics {
    display: block;
    margin: 0;
}

.studio-analytics-metric-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.studio-analytics-metric-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
    gap: 10px;
    align-items: center;
    font-size: 13px;
}

.studio-analytics-metric-row--stack {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
}

.studio-analytics-metric-label {
    color: var(--text-secondary, #b5b5b5);
}

.studio-analytics-metric-label--clip {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.studio-analytics-metric-track {
    display: block;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.studio-analytics-metric-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: rgba(62, 166, 255, 0.85);
}

.studio-analytics-metric-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #e8e8e8;
    white-space: nowrap;
}

.studio-analytics-top-meta {
    display: block;
    font-size: 12px;
    color: #9a9a9a;
}

.studio-analytics-card-note {
    margin: 10px 0 0 0;
    font-size: 12px;
    color: #888;
    line-height: 1.45;
}

.studio-analytics-plus-lock-inner {
    max-width: 340px;
    padding: 18px 20px;
    text-align: center;
    border-radius: 14px;
    background: #1e1e22;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.studio-analytics-plus-lock-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 700;
    color: #f1f1f1;
}

.studio-analytics-plus-lock-text {
    margin: 0 0 14px 0;
    font-size: 13px;
    line-height: 1.45;
    color: #9a9a9a;
}

.studio-analytics-dash:not(.studio-analytics-dash--plus):not(.studio-analytics-dash--preview-plus) .studio-analytics-grid--plus {
    filter: blur(3px);
    opacity: 0.65;
}

.studio-analytics-empty {
    padding: 28px 20px;
    border-radius: 14px;
    background: #1e1e22;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.studio-analytics-bar {
    background: linear-gradient(180deg, rgba(62, 166, 255, 0.65), rgba(62, 166, 255, 0.15));
    box-shadow: none;
}

/* Панель статистики */
.studio-stats-slab {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 20px;
    padding: 20px 22px;
    background: linear-gradient(155deg, #26262b 0%, #1a1a1f 52%, #17171c 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

@media (max-width: 820px) {
    .studio-stats-slab {
        grid-template-columns: 1fr;
    }
}

.studio-stats-slab-inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 640px) {
    .studio-stats-slab-inner {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.studio-stat-block {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 92px;
    min-width: 0;
    padding: 16px 10px 14px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(0, 0, 0, 0.28) 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    box-sizing: border-box;
}

.studio-stat-block::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    opacity: 0.85;
}

.studio-stat-value {
    display: block;
    max-width: 100%;
    font-size: clamp(15px, 2.4vw, 24px);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text-primary, #fff);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.studio-stat-value--num {
    font-size: clamp(14px, 2.1vw, 22px);
}

.studio-stat-value--meta {
    font-size: clamp(13px, 1.8vw, 16px);
    font-weight: 700;
    white-space: normal;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.studio-stat-label {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: rgba(180, 186, 198, 0.88);
    line-height: 1.35;
    white-space: normal;
    max-width: 100%;
}

.studio-stats-detail {
    padding: 6px 6px 6px 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 1px 0 0 rgba(62, 166, 255, 0.12);
}

.studio-stats-detail-title {
    margin: 0 0 10px 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary, #eee);
}

.studio-stats-detail-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: var(--text-secondary, #b5b5b5);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.studio-stats-detail-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: none;
}

.studio-stats-detail-list li span {
    min-width: 0;
    flex: 1 1 auto;
}

.studio-stats-detail-list li:last-child {
    margin-bottom: 0;
}

.studio-stats-detail-list li span,
.studio-stats-detail-list li strong {
    border: none;
    text-decoration: none;
}

.studio-stats-detail-list strong {
    color: #e0e0e0;
    font-weight: 600;
    text-align: right;
    flex-shrink: 0;
}

.studio-stats-note {
    display: block;
    margin-top: 10px;
    font-size: 12px;
    color: #888;
    line-height: 1.45;
    font-style: italic;
}

#studio-panel-videos > .studio-stats-slab {
    margin-bottom: 24px;
}

/* Сетка карточек */
.studio-video-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.studio-video-card {
    display: grid;
    grid-template-columns: minmax(0, 168px) minmax(0, 1fr) auto;
    gap: 20px;
    align-items: stretch;
    padding: 16px 18px;
    background: linear-gradient(160deg, #242428 0%, #1c1c20 100%);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.studio-video-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

@media (max-width: 900px) {
    .studio-video-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .studio-card-thumb-wrap {
        max-width: none;
        width: 100%;
        justify-self: stretch;
    }

    .studio-card-actions {
        width: 100%;
        min-width: 0;
        justify-self: stretch;
    }
}

@media (max-width: 720px) {
    .studio-video-card {
        grid-template-columns: 1fr;
    }

    .studio-card-thumb-wrap {
        max-width: none;
        width: 100%;
    }
}

.studio-card-thumb-wrap {
    position: relative;
    display: block;
    width: 100%;
    max-width: 168px;
    min-width: 0;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #111;
    justify-self: start;
}

.studio-card-thumb {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    display: block;
}

.studio-card-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.studio-card-thumb-wrap:hover .studio-card-play {
    opacity: 1;
}

.studio-card-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.studio-card-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary, #f5f5f5);
    word-break: break-word;
}

.studio-card-meta {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary, #aaa);
}

.studio-card-dot {
    margin: 0 4px;
    opacity: 0.6;
}

.studio-card-privacy {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.28);
    border-radius: 10px;
    width: fit-content;
    max-width: 100%;
}

.studio-privacy-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary, #aaa);
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.studio-privacy-btn:hover {
    color: var(--text-primary, #fff);
}

.studio-privacy-btn.is-active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary, #fff);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.studio-card-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    min-width: 152px;
}

@media (max-width: 720px) {
    .studio-card-actions {
        flex-direction: row;
        flex-wrap: wrap;
        min-width: 0;
    }
}

.studio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #f1f1f1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.studio-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.studio-btn-edit {
    background: rgba(62, 166, 255, 0.14);
    border-color: rgba(62, 166, 255, 0.35);
    color: #dbefff;
}

.studio-btn-edit:hover {
    background: rgba(62, 166, 255, 0.22);
}

.studio-btn-danger {
    background: rgba(244, 67, 54, 0.12);
    border-color: rgba(244, 67, 54, 0.35);
    color: #ff8a80;
}

.studio-btn-danger:hover {
    background: rgba(244, 67, 54, 0.2);
}

.studio-btn-ghost {
    background: transparent;
}

.studio-btn-primary {
    background: rgba(62, 166, 255, 0.25);
    border-color: rgba(62, 166, 255, 0.45);
    color: #fff;
}

.studio-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary, #aaa);
}

.studio-empty a {
    color: var(--accent-color, #3ea6ff);
}

/* Пустое состояние «Ваши видео» */
.studio-videos-empty {
    display: flex;
    justify-content: center;
    padding: 8px 0 24px;
}

.studio-videos-empty-card {
    width: 100%;
    max-width: 520px;
    text-align: center;
    padding: 36px 28px 32px;
    border-radius: 16px;
    background: linear-gradient(165deg, #26262c 0%, #18181d 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.studio-videos-empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(62, 166, 255, 0.12);
    border: 1px solid rgba(62, 166, 255, 0.28);
    box-shadow: 0 8px 24px rgba(62, 166, 255, 0.08);
}

.studio-videos-empty-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    opacity: 0.92;
    /* mini-studio.png — тёмная; на синем бейдже делаем светлой */
    filter: brightness(0) invert(1);
}

.studio-videos-empty-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary, #f2f2f2);
}

.studio-videos-empty-desc {
    margin: 0 auto 22px;
    max-width: 38ch;
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-secondary, #9aa0a8);
}

.studio-videos-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.studio-videos-empty-cta {
    min-width: 168px;
}

.studio-videos-empty--analytics {
    padding-top: 4px;
}

.studio-videos-empty-desc--solo {
    margin-bottom: 18px;
}

/* Модалка удаления */
.studio-dialog {
    background: #1e1e22;
    color: #f1f1f1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0;
    max-width: 440px;
    width: calc(100vw - 32px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.studio-dialog::backdrop {
    background: rgba(0, 0, 0, 0.72);
}

.studio-dialog-form {
    padding: 22px 22px 18px;
}

.studio-dialog-title {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 700;
}

.studio-dialog-body {
    margin-bottom: 18px;
}

.studio-dialog-lead {
    margin: 0 0 12px 0;
    font-size: 14px;
    line-height: 1.55;
    color: #c8c8c8;
}

.studio-dialog-warn-list {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: #b0b0b0;
    line-height: 1.5;
}

.studio-dialog-warn-list li {
    margin-bottom: 6px;
}

.studio-dialog-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

/* --- Редактор (studio_edit) --- */
.studio-edit-page .studio-shell-header {
    margin-bottom: 0;
}

.studio-edit-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 20px;
    align-items: start;
}

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

.studio-edit-preview-panel {
    padding: 18px;
    border-radius: 14px;
    background: linear-gradient(160deg, #242428 0%, #1a1a1e 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.studio-edit-preview-panel h2,
.studio-edit-side-panel h2 {
    margin: 0 0 14px 0;
    font-size: 16px;
    font-weight: 700;
}

.studio-edit-preview-box {
    border-radius: 12px;
    overflow: hidden;
    background: #0d0d0f;
    aspect-ratio: 16 / 9;
}

.studio-edit-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.studio-edit-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.studio-edit-side-panel {
    padding: 18px;
    border-radius: 14px;
    background: #1a1a1e;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.studio-edit-hint {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #9a9a9a;
    line-height: 1.45;
}

.studio-edit-hint--note {
    margin-top: 0;
    margin-bottom: 14px;
    font-size: 12px;
    color: #8a8a8a;
}

.studio-edit-inline-link {
    color: #3ea6ff;
    font-weight: 600;
    text-decoration: none;
}

.studio-edit-inline-link:hover {
    color: #6bbcff;
    text-decoration: none;
}

.studio-edit-file {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

/* --- Шапка редактора: без боковой полоски, выравнивание как у «Раздел Вы» --- */
.studio-shell-header.studio-edit-header-banner {
    align-items: flex-end;
}

.studio-edit-breadcrumb {
    margin: 0 0 10px 0;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: lowercase;
    color: rgba(140, 145, 155, 0.95);
}

.studio-edit-video-title {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--text-primary, #f1f1f1);
    max-width: 56ch;
    word-break: break-word;
}

.studio-edit-video-meta {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary, #9a9a9a);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
}

.studio-edit-meta-label {
    color: #7a7f88;
    font-weight: 500;
}

.studio-edit-video-meta time {
    color: #b0b5bd;
    font-weight: 500;
}

/* --- Модалка кропа (мини-студия): вкладки «отлипли», шапка аккуратнее --- */
body.studio-edit-page #crop-image-modal .studio-crop-editor-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    padding: 14px 18px 12px;
    background: linear-gradient(180deg, #252830 0%, #1e2128 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.studio-edit-page #crop-image-modal .studio-crop-editor-head h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #f4f7ff;
    flex: 1 1 200px;
    min-width: 0;
}

body.studio-edit-page #crop-image-modal .studio-crop-editor-tabs {
    display: inline-flex !important;
    flex-wrap: wrap;
    gap: 10px !important;
    justify-content: flex-end;
    align-items: center;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
}

body.studio-edit-page #crop-image-modal .studio-crop-editor-tabs .crop-tab-btn {
    margin: 0;
    min-width: 132px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid rgba(90, 140, 180, 0.45);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.studio-edit-page #crop-image-modal .studio-crop-editor-tabs .crop-tab-btn.active {
    border-color: rgba(62, 224, 255, 0.65);
    box-shadow: 0 0 0 1px rgba(62, 224, 255, 0.25), 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* Диалог статистики по одному ролику */
.studio-dialog--stat {
    max-width: 420px;
    width: min(420px, calc(100vw - 24px));
}

.studio-dialog--stat .studio-dialog-form {
    padding: 16px 18px 12px;
}

.studio-stat-dialog-body {
    margin: 0;
    overflow: hidden;
}

.studio-stats-slab--mini {
    display: block;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.studio-stats-slab-inner--mini {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 6px;
}

@media (min-width: 400px) {
    .studio-stats-slab-inner--mini {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .studio-stats-slab-inner--mini .studio-stat-block:nth-child(4) {
        grid-column: 1 / 2;
    }

    .studio-stats-slab-inner--mini .studio-stat-block:nth-child(5) {
        grid-column: 2 / 4;
    }
}

@media (min-width: 520px) {
    .studio-stats-slab-inner--mini {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .studio-stats-slab-inner--mini .studio-stat-block:nth-child(4),
    .studio-stats-slab-inner--mini .studio-stat-block:nth-child(5) {
        grid-column: auto;
    }
}

.studio-stats-slab--mini .studio-stat-block {
    min-height: 62px;
    padding: 8px 4px 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.studio-stats-slab--mini .studio-stat-label {
    font-size: 9px;
    line-height: 1.25;
    letter-spacing: 0.04em;
    margin-top: 5px;
    padding: 0 2px;
    word-break: break-word;
    hyphens: auto;
}

.studio-stats-slab--mini .studio-stat-value {
    background: transparent;
    border: none;
    font-size: clamp(13px, 2.2vw, 17px);
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.2;
    word-break: break-word;
}

.studio-stats-slab--mini .studio-stat-value--meta {
    font-size: clamp(11px, 1.9vw, 14px);
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.studio-stats-detail--mini {
    padding: 12px 0 0 0;
    margin-top: 8px;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.studio-stats-detail--mini .studio-stats-detail-title {
    font-size: 14px;
    margin-bottom: 10px;
}

.studio-dialog--stat .studio-dialog-title {
    font-size: 15px;
    line-height: 1.35;
    word-break: break-word;
    margin-bottom: 4px;
}

/* Мобилка: карточки роликов в студии */
@media (max-width: 900px) {
    body.studio-page .studio-video-card {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px;
    }

    body.studio-page .studio-card-thumb-wrap {
        width: 100%;
        max-width: none;
        justify-self: stretch;
    }

    body.studio-page .studio-card-main {
        gap: 8px;
    }

    body.studio-page .studio-card-title {
        font-size: 15px;
    }

    body.studio-page .studio-card-privacy {
        width: 100%;
        justify-content: stretch;
    }

    body.studio-page .studio-privacy-btn {
        flex: 1 1 0;
        text-align: center;
        padding: 7px 8px;
        font-size: 11px;
    }

    body.studio-page .studio-card-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-rows: auto auto;
        gap: 8px;
        width: 100%;
        min-width: 0;
        align-self: stretch;
    }

    body.studio-page .studio-card-actions .studio-btn {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding: 9px 10px;
        font-size: 12px;
        box-sizing: border-box;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.studio-page .studio-card-actions .studio-btn-edit {
        grid-column: 1;
        grid-row: 1;
    }

    body.studio-page .studio-card-actions .js-studio-stat {
        grid-column: 2;
        grid-row: 1;
    }

    body.studio-page .studio-card-actions .studio-btn-danger {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    body.studio-page .studio-dialog--stat {
        max-width: min(400px, calc(100vw - 20px));
    }

    body.studio-page .studio-stats-slab-inner--mini {
        gap: 6px;
    }

    body.studio-page .studio-stats-slab--mini .studio-stat-block {
        min-height: 56px;
        padding: 6px 4px 5px;
    }

    body.studio-page .studio-stats-slab--mini .studio-stat-value {
        font-size: clamp(12px, 3.5vw, 15px);
    }

    body.studio-page .studio-stats-slab--mini .studio-stat-label {
        font-size: 8px;
        margin-top: 4px;
    }
}

/* Редактор превью: компактные модалки */
body.studio-edit-page #crop-image-modal .crop-editor-modal-inner {
    max-width: min(540px, calc(100vw - 20px));
    width: calc(100vw - 20px);
    max-height: min(90vh, 680px);
}

body.studio-edit-page #frame-thumb-modal .frame-thumb-modal-inner {
    max-width: min(460px, calc(100vw - 20px));
    width: calc(100vw - 20px);
    max-height: min(88vh, 620px);
}

body.studio-edit-page #crop-image-modal .image-crop-container {
    height: min(34vh, 260px);
    min-height: 160px;
    max-height: 260px;
    margin-top: 8px;
    width: 100%;
}

body.studio-edit-page #crop-image-modal .image-crop-container img {
    max-width: 100%;
    max-height: 100%;
}

body.studio-edit-page #crop-image-modal .editor-toolbar-inline {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding: 8px 12px 6px;
    scrollbar-width: thin;
}

body.studio-edit-page #crop-image-modal .editor-toolbar-inline .toolbar-label {
    flex-shrink: 0;
    font-size: 12px;
}

body.studio-edit-page #crop-image-modal .ratio-btn {
    flex: 0 0 auto;
    padding: 6px 10px;
    font-size: 11px;
    white-space: nowrap;
}

body.studio-edit-page #crop-image-modal .studio-crop-editor-tabs .crop-tab-btn {
    min-width: 0;
    flex: 1 1 0;
    padding: 8px 12px;
    font-size: 12px;
}

body.studio-edit-page #frame-thumb-modal .frame-thumb-preview-wrap {
    max-height: min(38vh, 240px);
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.studio-edit-page #frame-thumb-modal .frame-thumb-preview-wrap video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

body.studio-edit-page #crop-image-modal .modal-editor-scroll,
body.studio-edit-page #frame-thumb-modal .modal-editor-scroll {
    overflow-x: hidden;
}
