.ycstudio-app {
    --ycstudio-ink: var(--text-color, #222);
    --ycstudio-bg: var(--bg-color, #fff);
    --ycstudio-panel: var(--content-bg, #f4f4f4);
    --ycstudio-line: rgba(120, 130, 150, 0.28);
    --ycstudio-muted: #667085;
    --ycstudio-accent: var(--accent-blue, #0073e6);
    --ycstudio-good: #4caf50;
    --ycstudio-dark: #070b12;
    --ycstudio-dark-text: #fff;
    --ycstudio-track-row-height: 132px;
    --ycstudio-track-wave-height: 90px;
    color: var(--ycstudio-ink);
    min-height: calc(100vh - 100px);
}

body.dark-mode .ycstudio-app {
    --ycstudio-muted: #a5adba;
    --ycstudio-line: rgba(220, 225, 235, 0.14);
    --ycstudio-panel: #1e1e1e;
}

.ycstudio-app button,
.ycstudio-app input {
    font-family: Arial, sans-serif;
}

.ycstudio-hero,
.ycstudio-login {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid var(--ycstudio-line);
    border-radius: 8px;
    background: var(--ycstudio-panel);
    padding: 22px;
    margin: 0 0 14px;
}

.ycstudio-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ycstudio-accent);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.ycstudio-hero h1,
.ycstudio-login h1 {
    margin: 8px 0 8px;
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.04;
    letter-spacing: 0;
}

.ycstudio-hero p,
.ycstudio-login p {
    max-width: 760px;
    color: var(--ycstudio-muted);
    font-size: 15px;
    line-height: 1.45;
}

.ycstudio-balance {
    min-width: 150px;
    display: grid;
    gap: 4px;
    justify-items: end;
}

.ycstudio-balance span {
    color: var(--ycstudio-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.ycstudio-balance strong {
    font-size: 36px;
    line-height: 1;
}

.ycstudio-balance a {
    color: var(--ycstudio-accent);
    font-size: 13px;
    font-weight: 800;
}

.ycstudio-shell {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 14px;
    min-height: 680px;
}

.ycstudio-sidebar {
    display: grid;
    align-content: start;
    gap: 12px;
}

.ycstudio-panel {
    border: 1px solid var(--ycstudio-line);
    border-radius: 8px;
    background: var(--ycstudio-panel);
    overflow: hidden;
}

.ycstudio-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 48px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--ycstudio-line);
}

.ycstudio-panel-head h2 {
    margin: 0;
    font-size: 16px;
    line-height: 1.15;
}

.ycstudio-panel-head span {
    color: var(--ycstudio-muted);
    font-size: 12px;
    font-weight: 900;
}

.ycstudio-panel-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ycstudio-project-list {
    display: grid;
    max-height: 210px;
    overflow: auto;
    scrollbar-color: var(--ycstudio-line) transparent;
}

.ycstudio-project {
    width: 100%;
    display: grid;
    gap: 4px;
    border: 0;
    border-bottom: 1px solid var(--ycstudio-line);
    background: transparent;
    color: var(--ycstudio-ink);
    cursor: pointer;
    padding: 11px 14px;
    text-align: left;
}

.ycstudio-project:last-child {
    border-bottom: 0;
}

.ycstudio-project:hover,
.ycstudio-project.is-active {
    background: rgba(0, 115, 230, 0.1);
}

.ycstudio-project strong {
    display: block;
    overflow: hidden;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ycstudio-project span,
.ycstudio-project em {
    display: block;
    overflow: hidden;
    color: var(--ycstudio-muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ycstudio-upload {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.ycstudio-upload label {
    font-size: 13px;
    font-weight: 900;
}

.ycstudio-upload input[type="file"] {
    width: 100%;
    border: 1px dashed var(--ycstudio-line);
    border-radius: 8px;
    padding: 12px;
    background: var(--ycstudio-bg);
    color: var(--ycstudio-ink);
}

.ycstudio-upload small {
    color: var(--ycstudio-muted);
    font-size: 12px;
    line-height: 1.35;
}

.ycstudio-asset-list {
    display: grid;
    max-height: 230px;
    overflow: auto;
    scrollbar-color: var(--ycstudio-line) transparent;
}

.ycstudio-asset {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--ycstudio-line);
}

.ycstudio-asset:last-child {
    border-bottom: 0;
}

.ycstudio-asset.is-active {
    background: rgba(37, 99, 235, 0.11);
    box-shadow: inset 4px 0 0 var(--ycstudio-accent);
}

.ycstudio-asset-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--ycstudio-dark);
    color: #fff;
}

.ycstudio-asset-body {
    min-width: 0;
}

.ycstudio-asset-name {
    display: block;
    overflow: hidden;
    color: var(--ycstudio-ink);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ycstudio-asset-meta {
    display: block;
    overflow: hidden;
    color: var(--ycstudio-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ycstudio-empty {
    padding: 18px 14px;
    color: var(--ycstudio-muted);
    font-size: 13px;
    line-height: 1.4;
}

.ycstudio-workspace {
    min-width: 0;
    border: 1px solid var(--ycstudio-line);
    border-radius: 8px;
    background: var(--ycstudio-panel);
    overflow: hidden;
}

.ycstudio-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    padding: 14px;
    border-bottom: 1px solid var(--ycstudio-line);
}

.ycstudio-title-group {
    flex: 1 1 260px;
    min-width: 230px;
    display: grid;
    gap: 6px;
}

.ycstudio-title-group label {
    color: var(--ycstudio-muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.ycstudio-title-group input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--ycstudio-line);
    border-radius: 8px;
    padding: 0 12px;
    background: var(--ycstudio-bg);
    color: var(--ycstudio-ink);
    font-size: 15px;
    font-weight: 800;
}

.ycstudio-controls {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.ycstudio-recorder {
    display: grid;
    grid-template-columns: auto minmax(150px, 210px) 42px auto;
    gap: 6px;
    align-items: center;
    min-height: 42px;
}

.ycstudio-recorder label {
    color: var(--ycstudio-muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.ycstudio-recorder select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--ycstudio-line);
    border-radius: 8px;
    background: var(--ycstudio-bg);
    color: var(--ycstudio-ink);
    font-size: 12px;
    font-weight: 800;
    padding: 0 10px;
}

.ycstudio-record-status {
    min-width: 58px;
    color: var(--ycstudio-muted);
    font-size: 12px;
    font-weight: 900;
}

.ycstudio-actions {
    display: flex;
    flex: 1 1 260px;
    justify-content: flex-end;
    gap: 8px;
    min-width: 240px;
}

.ycstudio-size-control {
    flex: 0 1 180px;
    min-width: 160px;
    display: grid;
    gap: 6px;
    align-self: center;
    color: var(--ycstudio-muted);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.1;
    text-transform: uppercase;
}

.ycstudio-size-control span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ycstudio-size-control input[type="range"] {
    width: 100%;
    accent-color: var(--ycstudio-accent);
}

.ycstudio-btn,
.ycstudio-icon-btn {
    border: 1px solid var(--ycstudio-line);
    border-radius: 999px;
    min-height: 42px;
    background: var(--ycstudio-bg);
    color: var(--ycstudio-ink);
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.ycstudio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    text-align: center;
    white-space: nowrap;
}

.ycstudio-icon-btn {
    width: 42px;
    padding: 0;
}

.ycstudio-btn:hover,
.ycstudio-icon-btn:hover {
    transform: translateY(-1px);
}

.ycstudio-btn:disabled,
.ycstudio-icon-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

.ycstudio-btn-primary {
    border-color: var(--ycstudio-accent);
    background: var(--ycstudio-accent);
    color: #fff;
}

.ycstudio-btn-dark {
    border-color: var(--ycstudio-dark);
    background: var(--ycstudio-dark);
    color: var(--ycstudio-dark-text);
}

.ycstudio-btn-light {
    background: var(--ycstudio-bg);
}

.ycstudio-btn-danger {
    border-color: #b42318;
    background: #b42318;
    color: #fff;
}

.ycstudio-icon-btn.is-active,
.ycstudio-record-btn.is-recording {
    border-color: var(--ycstudio-accent);
    background: var(--ycstudio-accent);
    color: #fff;
}

.ycstudio-record-btn {
    color: #d92d20;
}

.ycstudio-record-btn.is-recording {
    animation: ycstudio-record-pulse 1.1s ease-in-out infinite;
}

@keyframes ycstudio-record-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(217, 45, 32, 0.32);
    }

    50% {
        box-shadow: 0 0 0 7px rgba(217, 45, 32, 0);
    }
}

.ycstudio-status {
    min-height: 42px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--ycstudio-line);
    color: var(--ycstudio-muted);
    font-size: 13px;
    font-weight: 800;
}

.ycstudio-status.is-error {
    color: #d92d20;
}

.ycstudio-status.is-ok {
    color: var(--ycstudio-good);
    display: none;
}

.ycstudio-playlist-wrap {
    min-height: 560px;
    overflow: auto;
    background: #030712;
    scrollbar-color: #8a8f98 #2f3338;
    scrollbar-width: thin;
}

.ycstudio-playlist-wrap::-webkit-scrollbar,
.ycstudio-playlist .playlist-tracks::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.ycstudio-playlist-wrap::-webkit-scrollbar-track,
.ycstudio-playlist .playlist-tracks::-webkit-scrollbar-track {
    background: #2f3338;
}

.ycstudio-playlist-wrap::-webkit-scrollbar-thumb,
.ycstudio-playlist .playlist-tracks::-webkit-scrollbar-thumb {
    border: 2px solid #2f3338;
    border-radius: 8px;
    background: #8a8f98;
}

.ycstudio-playlist-wrap::-webkit-scrollbar-thumb:hover,
.ycstudio-playlist .playlist-tracks::-webkit-scrollbar-thumb:hover {
    background: #b0b5bd;
}

.ycstudio-playlist {
    min-height: 560px;
    min-width: 780px;
}

.ycstudio-playlist .playlist {
    position: relative;
    background: #030712;
    color: #f8fafc;
    font-family: Arial, sans-serif;
}

.ycstudio-playlist .playlist-tracks {
    min-height: 520px;
    background: #030712;
}

.ycstudio-playlist .channel-wrapper {
    height: var(--ycstudio-track-row-height);
    min-height: 117px;
    max-height: 170px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
    background: #050b0f;
}

.ycstudio-playlist .controls {
    width: 220px;
    min-width: 220px;
    height: var(--ycstudio-track-row-height);
    min-height: 117px;
    max-height: 170px;
    display: grid;
    align-content: start;
    gap: 6px;
    border-right: 1px solid rgba(148, 163, 184, 0.28);
    background: #111827;
    color: #f8fafc;
    overflow: auto;
    padding: 8px 10px;
}

.ycstudio-playlist .controls header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    min-height: 26px;
}

.ycstudio-playlist .controls header span,
.ycstudio-playlist .controls .track-header span {
    display: block;
    overflow: hidden;
    color: #f8fafc;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ycstudio-playlist .controls label,
.ycstudio-playlist .controls span {
    color: #e5e7eb;
}

.ycstudio-playlist .controls button,
.ycstudio-playlist .controls .btn {
    min-height: 28px;
    border: 1px solid rgba(148, 163, 184, 0.38);
    border-radius: 999px;
    background: #030712;
    color: #f8fafc;
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    padding: 0 9px;
}

.ycstudio-playlist .controls button:hover,
.ycstudio-playlist .controls .btn:hover {
    border-color: #22c55e;
    color: #86efac;
}

.ycstudio-playlist .controls input[type="range"] {
    width: 100%;
    accent-color: var(--ycstudio-accent);
}

.ycstudio-playlist .controls label {
    display: grid;
    gap: 4px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.ycstudio-playlist .waveform,
.ycstudio-playlist .waveform-container,
.ycstudio-playlist .track {
    min-width: 0;
    height: var(--ycstudio-track-row-height) !important;
    min-height: 117px;
    max-height: 170px;
    background:
        repeating-linear-gradient(90deg, rgba(56, 189, 248, 0.18) 0, rgba(56, 189, 248, 0.18) 1px, transparent 1px, transparent 78px),
        repeating-linear-gradient(0deg, rgba(148, 163, 184, 0.16) 0, rgba(148, 163, 184, 0.16) 1px, transparent 1px, transparent 48px),
        #050b0f;
    overflow: visible;
}

.ycstudio-playlist .playlist-time-scale {
    min-height: 40px;
    height: 40px;
    background: #030712;
    border-bottom: 1px solid rgba(148, 163, 184, 0.34);
    color: #f8fafc;
    overflow: hidden;
}

.ycstudio-playlist .playlist-time-scale .time {
    top: 6px;
    color: #f8fafc;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.ycstudio-playlist .playlist-time-scale canvas {
    top: 12px !important;
    height: 28px !important;
}

.ycstudio-playlist .channel {
    background: rgba(22, 101, 52, 0.28);
    border-top: 1px solid rgba(34, 197, 94, 0.28);
    border-bottom: 1px solid rgba(34, 197, 94, 0.28);
}

.ycstudio-playlist .channel-progress {
    background: rgba(34, 197, 94, 0.16);
}

.ycstudio-playlist canvas {
    display: block;
    height: var(--ycstudio-track-wave-height) !important;
    max-width: none;
    min-height: 0;
    max-height: var(--ycstudio-track-row-height);
    filter: none;
}

.ycstudio-playlist .cursor {
    pointer-events: none;
}

.ycstudio-playlist .playlist-overlay {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    cursor: crosshair;
    pointer-events: auto;
}

.ycstudio-playlist .cursor {
    width: 3px !important;
    background: #facc15 !important;
    opacity: 1 !important;
    z-index: 40 !important;
    box-shadow: 0 0 0 1px rgba(3, 7, 18, 0.95), 0 0 12px rgba(250, 204, 21, 0.72);
}

.ycstudio-playlist .selection {
    background: rgba(147, 197, 253, 0.42) !important;
    border-left: 2px solid #bfdbfe;
    border-right: 2px solid #bfdbfe;
    box-shadow: inset 0 0 0 1px rgba(219, 234, 254, 0.75);
    z-index: 30 !important;
}

.ycstudio-playlist .selection.point {
    min-width: 3px;
    background: #bfdbfe !important;
}

.ycstudio-playlist .selection.segment {
    min-width: 8px;
}

body.dark-mode .ycstudio-playlist .waveform,
body.dark-mode .ycstudio-playlist .waveform-container,
body.dark-mode .ycstudio-playlist .track {
    background:
        repeating-linear-gradient(90deg, rgba(56, 189, 248, 0.18) 0, rgba(56, 189, 248, 0.18) 1px, transparent 1px, transparent 78px),
        repeating-linear-gradient(0deg, rgba(148, 163, 184, 0.16) 0, rgba(148, 163, 184, 0.16) 1px, transparent 1px, transparent 48px),
        #050b0f;
}

body.dark-mode .ycstudio-asset.is-active {
    background: rgba(130, 170, 255, 0.16);
}

body.dark-mode .ycstudio-playlist .selection {
    background: rgba(147, 197, 253, 0.42) !important;
    box-shadow: inset 0 0 0 1px rgba(219, 234, 254, 0.75);
}

.ycstudio-mobile-modal,
.ycstudio-delete-modal,
.ycstudio-export-modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.64);
    z-index: 100000;
}

.ycstudio-mobile-modal[hidden],
.ycstudio-delete-modal[hidden],
.ycstudio-export-modal[hidden] {
    display: none;
}

.ycstudio-modal-card {
    width: min(520px, 100%);
    border: 1px solid var(--ycstudio-line);
    border-radius: 8px;
    background: var(--ycstudio-bg);
    color: var(--ycstudio-ink);
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

.ycstudio-modal-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    margin: 0 0 14px;
    background: var(--ycstudio-dark);
    color: #fff;
    font-size: 22px;
}

.ycstudio-modal-danger {
    background: #b42318;
}

.ycstudio-modal-card h2 {
    margin: 0 0 10px;
    font-size: 24px;
    line-height: 1.15;
}

.ycstudio-modal-card p {
    margin: 0 0 18px;
    color: var(--ycstudio-muted);
    line-height: 1.45;
}

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

.ycstudio-app.ycstudio-mobile-locked .ycstudio-shell {
    filter: blur(2px);
    pointer-events: none;
}

@media (max-width: 1180px) {
    .ycstudio-shell {
        grid-template-columns: 300px minmax(0, 1fr);
    }

    .ycstudio-toolbar {
        align-items: flex-start;
    }

    .ycstudio-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 920px) {
    .ycstudio-hero,
    .ycstudio-login {
        align-items: flex-start;
        flex-direction: column;
    }

    .ycstudio-balance {
        justify-items: start;
    }

    .ycstudio-shell {
        grid-template-columns: 1fr;
    }

    .ycstudio-title-group,
    .ycstudio-size-control,
    .ycstudio-recorder,
    .ycstudio-actions {
        min-width: 100%;
    }

    .ycstudio-recorder {
        grid-template-columns: auto minmax(0, 1fr) 42px auto;
    }

    .ycstudio-actions {
        flex-direction: column;
    }

    .ycstudio-actions .ycstudio-btn {
        width: 100%;
    }

    .ycstudio-playlist {
        min-width: 760px;
    }
}
