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

.media-editor-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, 0.72);
    padding: 16px;
}

.media-editor-dialog {
    width: min(920px, 100%);
    max-height: calc(100vh - 32px);
    overflow: auto;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.35);
}

.media-editor-header,
.media-editor-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
}

.media-editor-header {
    border-bottom: 1px solid #e5e7eb;
}

.media-editor-title {
    margin: 0;
    color: #111827;
    font-size: 18px;
    font-weight: 700;
}

.media-editor-body {
    padding: 16px;
}

.media-editor-stage {
    position: relative;
    height: min(58vh, 520px);
    min-height: 300px;
    overflow: hidden;
    border-radius: 8px;
    background: #111827;
    touch-action: none;
}

.media-editor-stage canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

.media-editor-stage canvas:active {
    cursor: grabbing;
}

.media-editor-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding-top: 14px;
}

.media-editor-range-row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
}

.media-editor-range-row input[type='range'] {
    width: 100%;
}

.media-editor-hint {
    color: #6b7280;
    font-size: 13px;
}

.media-editor-actions {
    border-top: 1px solid #e5e7eb;
}

.media-editor-button {
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    padding: 9px 14px;
    color: #111827;
    font-size: 14px;
    font-weight: 700;
}

.media-editor-button:hover {
    background: #f9fafb;
}

.media-editor-button-primary {
    border-color: #4338ca;
    background: #4338ca;
    color: #fff;
}

.media-editor-button-primary:hover {
    background: #3730a3;
}

.media-editor-status {
    margin-top: 8px;
    color: #047857;
    font-size: 13px;
    font-weight: 600;
}

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

.short-video-editor {
    display: grid;
    gap: 14px;
}

.short-video-crop-stage {
    position: relative;
    width: min(100%, 520px);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

.short-video-preview {
    width: 100%;
    height: 100%;
    background: #000;
    object-fit: cover;
    object-position: 50% 50%;
}

.short-video-crop-frame {
    pointer-events: none;
    position: absolute;
    inset: 0;
    border: 4px solid rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.95);
}

.short-video-crop-controls {
    display: grid;
    gap: 10px;
}

.short-video-crop-controls label {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
}

.short-video-crop-controls input[type='range'] {
    width: 100%;
}

.short-video-timeline {
    position: relative;
    height: 46px;
    border-radius: 8px;
    background: #eef2ff;
}

.short-video-selected-range {
    position: absolute;
    top: 17px;
    height: 12px;
    border-radius: 999px;
    background: #4f46e5;
}

.short-video-timeline input[type='range'] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 46px;
    margin: 0;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.short-video-timeline input[type='range']::-webkit-slider-thumb {
    width: 18px;
    height: 28px;
    border: 2px solid #312e81;
    border-radius: 999px;
    background: #fff;
    cursor: ew-resize;
    pointer-events: auto;
    -webkit-appearance: none;
    appearance: none;
}

.short-video-timeline input[type='range']::-moz-range-thumb {
    width: 18px;
    height: 28px;
    border: 2px solid #312e81;
    border-radius: 999px;
    background: #fff;
    cursor: ew-resize;
    pointer-events: auto;
}

.short-video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #4b5563;
    font-size: 13px;
}

.short-video-meta span {
    border-radius: 999px;
    background: #f3f4f6;
    padding: 4px 10px;
}
