.editor-panel {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.editor-panel[hidden] {
    display: none;
}

.editor-preview-shell {
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
    border-radius: var(--radius-panel-lg);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(15, 15, 15, 0.18)),
        rgba(255, 255, 255, 0.022);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.05),
        0 18px 40px rgba(0, 0, 0, 0.14);
}

.editor-preview-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.95fr) auto;
    align-items: center;
    gap: 0.9rem;
}

.editor-menu-bar {
    display: flex;
    align-items: center;
    gap: 0.16rem;
    min-width: 0;
    flex-wrap: wrap;
}

.editor-menu-heading,
.editor-file-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.9rem;
    padding: 0.22rem 0.5rem;
    border: 0;
    border-radius: var(--radius-panel-sm);
    background: transparent;
    color: rgba(255, 255, 255, 0.84);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 400;
    line-height: 1.2;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.editor-menu-heading {
    opacity: 0.88;
}

.editor-menu-heading[disabled] {
    cursor: default;
}

.editor-menu-heading:hover,
.editor-file-menu-button:hover {
    background: rgba(255, 255, 255, 0.08);
}

.editor-file-menu {
    position: relative;
    min-width: 0;
}

.editor-file-menu[open] {
    z-index: 4;
}

.editor-file-menu-button::-webkit-details-marker {
    display: none;
}

.editor-file-menu-panel {
    position: absolute;
    top: calc(100% + 0.2rem);
    left: 0;
    display: grid;
    min-width: 14.5rem;
    padding: 0.36rem;
    border-radius: var(--radius-panel-sm);
    background: rgba(18, 19, 23, 0.98);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.05),
        0 18px 38px rgba(0, 0, 0, 0.28);
}

.editor-file-menu-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 2rem;
    width: 100%;
    padding: 0.46rem 0.62rem;
    border: 0;
    border-radius: calc(var(--radius-panel-sm) - 0.14rem);
    background: transparent;
    color: rgba(255, 255, 255, 0.86);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 400;
    text-align: left;
    cursor: pointer;
}

.editor-file-menu-item:hover,
.editor-file-menu-item:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.editor-file-submenu {
    position: relative;
}

.editor-file-submenu-trigger {
    padding-right: 1.5rem;
}

.editor-file-submenu-trigger::after {
    content: "";
    position: absolute;
    right: 0.68rem;
    top: 50%;
    width: 0.34rem;
    height: 0.34rem;
    border-top: 1.5px solid rgba(255, 255, 255, 0.68);
    border-right: 1.5px solid rgba(255, 255, 255, 0.68);
    transform: translateY(-50%) rotate(45deg);
}

.editor-file-submenu-panel {
    position: absolute;
    top: -0.36rem;
    left: calc(100% - 0.12rem);
    display: none;
    min-width: 16rem;
    padding: 0.36rem;
    border-radius: var(--radius-panel-sm);
    background: rgba(18, 19, 23, 0.98);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.05),
        0 18px 38px rgba(0, 0, 0, 0.28);
}

.editor-file-submenu:hover .editor-file-submenu-panel,
.editor-file-submenu:focus-within .editor-file-submenu-panel {
    display: grid;
    gap: 0.55rem;
}

.editor-file-browser {
    display: grid;
    gap: 0.72rem;
    margin-top: 0.42rem;
    padding-top: 0.7rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.editor-file-browser-section {
    display: grid;
    gap: 0.55rem;
}

.editor-file-browser-header {
    display: grid;
    gap: 0.14rem;
}

.editor-file-browser-header strong {
    color: var(--pure-white);
    font-size: 0.82rem;
    font-weight: 700;
}

.editor-file-browser-header span {
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.74rem;
}

.editor-file-browser-list {
    display: grid;
    gap: 0.34rem;
}

.editor-file-browser-entry,
.editor-file-browser-empty {
    display: grid;
    gap: 0.18rem;
    padding: 0.62rem 0.72rem;
    border-radius: var(--radius-panel-sm);
}

.editor-file-browser-entry {
    border: 0;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.88);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.editor-file-browser-entry:hover,
.editor-file-browser-entry:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.editor-file-browser-entry strong {
    color: var(--pure-white);
    font-size: 0.82rem;
    font-weight: 700;
}

.editor-file-browser-entry span,
.editor-file-browser-empty {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.75rem;
}

.editor-playhead-control {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.editor-playhead-control span {
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.editor-playhead-control input {
    width: 100%;
    accent-color: var(--loop-accent);
}

.editor-preview-meta {
    display: grid;
    justify-items: end;
    gap: 0.35rem;
    min-width: 6rem;
}

.editor-panel-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.85rem;
    padding: 0.4rem 0.72rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.editor-playhead-readout {
    min-width: 5.5rem;
    color: var(--pure-white);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: right;
}

.editor-preview-stage {
    position: relative;
    min-height: 280px;
    border-radius: var(--radius-panel-md);
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(16, 16, 16, 0.2)),
        rgba(11, 11, 11, 0.92);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.editor-preview-canvas {
    display: block;
    width: 100%;
    min-height: 280px;
    height: 280px;
    cursor: crosshair;
}

@media (max-width: 720px) {
    .editor-preview-toolbar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .editor-menu-bar {
        flex-wrap: wrap;
        align-items: stretch;
    }

    .editor-file-submenu-panel {
        position: static;
        margin-top: 0.24rem;
        margin-left: 0.24rem;
    }

    .editor-preview-meta {
        justify-items: start;
        min-width: 0;
    }

    .editor-playhead-readout {
        min-width: 0;
        text-align: left;
    }
}
