/* Video editor — full-viewport workspace */
.video-editor-page {
    margin: 0;
    min-height: 100vh;
    background: #0f172a;
}

.video-editor-page.editor-shell-active {
    overflow: hidden;
}

.video-editor-page.editor-shell-active .page-sub-outer,
.video-editor-page.editor-shell-active .page-sub-main,
.video-editor-page.editor-shell-active .container {
    max-width: none;
    width: 100%;
    padding: 0;
    margin: 0;
}

.video-editor-page.editor-shell-active .top-nav,
.video-editor-page.editor-shell-active .site-footer {
    display: none !important;
}

.video-editor-page.editor-shell-active .editor-projects-home[hidden],
.video-editor-page.editor-active #editorApp[hidden] {
    display: none !important;
    pointer-events: none !important;
}

.video-editor-page.editor-shell-active .editor-projects-home:not([hidden]) {
    position: fixed;
    inset: 58px 0 0 0; /* leave room for Editor 1/2 toggle bar */
    z-index: 1500;
    max-width: none;
    width: 100%;
    height: auto;
    margin: 0;
    border-radius: 0;
    border: none;
    overflow: auto;
    background: #0f172a;
    padding: 24px;
    box-sizing: border-box;
}

.editor-projects-dropzone {
    border: 2px dashed #475569;
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    background: #0b1220;
    margin-bottom: 20px;
    transition: border-color 0.15s, background 0.15s;
}

.editor-projects-dropzone.is-dragover {
    border-color: #60a5fa;
    background: #172554;
}

.editor-projects-dropzone p {
    margin: 0 0 6px;
    font-weight: 700;
}

.editor-projects-dropzone small {
    display: block;
    margin-top: 8px;
    color: #94a3b8;
    font-size: 0.72rem;
}

.video-editor-page.editor-active {
    overflow: hidden;
}

.video-editor-page.editor-active .page-sub-outer,
.video-editor-page.editor-active .page-sub-main,
.video-editor-page.editor-active .container {
    max-width: none;
    width: 100%;
    padding: 0;
    margin: 0;
}

.video-editor-page.editor-active .top-nav,
.video-editor-page.editor-active .site-footer {
    display: none !important;
}

.video-editor-page .editor-gate {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
}

.video-editor-page .editor-gate[hidden] {
    display: none !important;
    pointer-events: none !important;
}

.video-editor-page.editor-shell-active .editor-gate:not([hidden]) {
    position: fixed;
    inset: 58px 0 0 0;
    z-index: 1600;
    max-width: none;
    width: 100%;
    height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    border: none;
    background: #0f172a;
    color: #e2e8f0;
    pointer-events: auto;
}

.video-editor-page .editor-gate-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.editor-tier-badge {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}

.video-editor-page.editor-active #editorApp {
    position: fixed;
    inset: 58px 0 0 0; /* leave room for Editor 1/2 toggle bar */
    z-index: 1500;
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #0f172a;
    border: none;
    box-shadow: none;
}

.editor-workspace {
    padding: 0 !important;
    overflow: hidden;
    margin-bottom: 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #1f2937;
    background: #111827;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.editor-toolbar-title h1 {
    margin: 0;
    font-size: 1.05rem;
    color: #f8fafc;
}

.editor-toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.kapwing-main {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr) 280px;
    grid-template-rows: minmax(0, 1fr);
    flex: 1;
    min-height: 0;
    background: #0f172a;
    color: #e2e8f0;
    overflow: hidden;
}

.kapwing-media,
.kapwing-inspector {
    background: #111827;
    border-inline-end: 1px solid #1f2937;
    padding: 10px;
    overflow: auto;
    min-height: 0;
}

.kapwing-inspector {
    border-inline-end: none;
    border-inline-start: 1px solid #1f2937;
}

.kapwing-media h3,
.kapwing-panel h4 {
    margin: 0 0 10px;
    font-size: 0.9rem;
}

.kapwing-panel label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.82rem;
    color: #cbd5e1;
}

.kapwing-panel select,
.kapwing-panel textarea,
.kapwing-panel input[type="number"] {
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #0b1220;
    color: #f8fafc;
}

.kapwing-dropzone {
    border: 2px dashed #475569;
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
    background: #0b1220;
    margin-bottom: 12px;
    transition: border-color 0.15s, background 0.15s;
}

.kapwing-dropzone.is-dragover {
    border-color: #60a5fa;
    background: #172554;
}

.kapwing-dropzone p {
    margin: 0 0 6px;
    font-weight: 700;
    font-size: 0.85rem;
}

.kapwing-dropzone small {
    display: block;
    margin-top: 8px;
    color: #94a3b8;
    font-size: 0.72rem;
}

/* Library — 2 column grid, truncated names, full on hover */
.kapwing-clips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.kapwing-clip {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border-radius: 10px;
    background: #1e293b;
    cursor: pointer;
    border: 1px solid transparent;
    min-width: 0;
}

.kapwing-clip.active {
    border-color: #3b82f6;
    background: #172554;
}

.kapwing-clip-thumb {
    width: 100%;
    height: 52px;
    border-radius: 6px;
    background: #334155;
    flex-shrink: 0;
    overflow: hidden;
}

.kapwing-clip-meta {
    min-width: 0;
}

.kapwing-clip-meta strong {
    display: block;
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.kapwing-clip:hover .kapwing-clip-meta strong,
.kapwing-clip:focus-within .kapwing-clip-meta strong {
    white-space: normal;
    word-break: break-word;
    overflow: visible;
}

.kapwing-clip-meta span {
    font-size: 0.68rem;
    color: #94a3b8;
}

.editor-checkbox {
    display: flex !important;
    align-items: flex-start;
    gap: 8px;
}

.editor-checkbox input {
    width: auto !important;
    margin-top: 3px;
}

.kapwing-center {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: #020617;
    padding: 6px 8px 4px;
    overflow: hidden;
}

.kapwing-preview-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.kapwing-preview-toolbar label {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
}

.kapwing-preview-toolbar select {
    width: auto;
    margin: 0;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #0b1220;
    color: #f8fafc;
}

.kapwing-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(45deg, #111827 25%, transparent 25%),
        linear-gradient(-45deg, #111827 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #111827 75%),
        linear-gradient(-45deg, transparent 75%, #111827 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
    background-color: #0b1220;
    border-radius: 10px;
    overflow: hidden;
}

.kapwing-canvas {
    position: relative;
    background: #000;
    width: min(100%, 920px);
    aspect-ratio: 16 / 9;
    max-height: 100%;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.kapwing-stage.aspect-9-16 .kapwing-canvas { aspect-ratio: 9 / 16; width: min(42%, 420px); }
.kapwing-stage.aspect-1-1 .kapwing-canvas { aspect-ratio: 1 / 1; width: min(70%, 560px); }
.kapwing-stage.aspect-4-5 .kapwing-canvas { aspect-ratio: 4 / 5; width: min(52%, 480px); }
.kapwing-stage.aspect-16-9 .kapwing-canvas { aspect-ratio: 16 / 9; }

.editor-video-wrap {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    cursor: default;
    touch-action: none;
}

.editor-video-wrap.is-transforming {
    cursor: grab;
    outline: 2px dashed #60a5fa;
    outline-offset: -2px;
}

.editor-video-wrap.is-dragging {
    cursor: grabbing;
}

.editor-player {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
    pointer-events: none;
}

.editor-subtitle-overlay {
    position: absolute;
    left: 50%;
    top: 88%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    padding: 6px 12px;
    border-radius: 8px;
    color: #fff;
    background: rgba(0, 0, 0, 0.65);
    /* font-size set by JS in design units scaled to canvas — never hardcode px here */
    font-size: inherit;
    line-height: 1.25;
    text-align: center;
    cursor: grab;
    user-select: none;
    white-space: pre-wrap;
    touch-action: none;
    border: 1px dashed transparent;
    z-index: 5;
}

.editor-subtitle-overlay:hover,
.editor-subtitle-overlay.is-dragging {
    border-color: #60a5fa;
}

.kapwing-transport {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.kapwing-tools {
    display: flex;
    gap: 6px;
    margin-inline-start: auto;
    flex-wrap: wrap;
    align-items: center;
}

.editor-zoom-label {
    font-size: 0.78rem;
    color: #94a3b8;
    min-width: 42px;
    text-align: center;
}

.kapwing-tools .tool-active {
    outline: 2px solid #60a5fa;
    background: #1d4ed8;
    color: #fff;
}

.kapwing-center {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: #020617;
    padding: 6px 8px 4px;
    overflow: hidden;
}

.kapwing-stage {
    flex: 1 1 auto;
    min-height: 220px;
    max-height: none;
}

.kapwing-timeline-wrap {
    background: #0b1220;
    border: 1px solid #1f2937;
    border-radius: 10px;
    padding: 6px 8px;
    user-select: none;
    flex: 1 1 280px;
    min-height: 220px;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.kapwing-timeline-scroll {
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
    min-height: 160px;
    max-height: none;
    scrollbar-gutter: stable;
}

.kapwing-timeline-inner {
    position: relative;
    min-width: 100%;
    direction: ltr;
}

.kapwing-timeline-wrap.tool-cut {
    cursor: crosshair;
}

.kapwing-timeline-ruler {
    height: 22px;
    margin-bottom: 4px;
    padding-inline-start: 72px;
    color: #94a3b8;
    font-size: 0.68rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 5;
    background: #0b1220;
    cursor: pointer;
}

.editor-timeline-scrub {
    display: none !important;
}

.kapwing-layer.is-drop-target .kapwing-layer-track {
    outline: 2px dashed #60a5fa;
    outline-offset: -2px;
    background: rgba(37, 99, 235, 0.18);
}

.kapwing-layer.is-drop-target .kapwing-layer-label {
    color: #93c5fd;
}

.editor-video-clip.is-dragging {
    opacity: 0.75;
    box-shadow: 0 0 0 2px #60a5fa;
}

.editor-video-clip.has-fade-edge::before,
.editor-video-clip.has-fade-edge::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 14px;
    pointer-events: none;
    opacity: 0.85;
}

.editor-video-clip.has-fade-in::before {
    inset-inline-start: 0;
    background: linear-gradient(90deg, rgba(15,23,42,0.9), transparent);
}

.editor-video-clip.has-fade-out::after {
    inset-inline-end: 0;
    background: linear-gradient(270deg, rgba(15,23,42,0.9), transparent);
}

.editor-inspector-hint {
    margin: 0 0 8px;
    font-size: 0.75rem;
    color: #94a3b8;
}

.kapwing-timeline-ticks {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.kapwing-timeline-body {
    position: relative;
    padding-bottom: 4px;
    cursor: pointer;
}

.kapwing-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ef4444;
    z-index: 10;
    pointer-events: auto;
    cursor: ew-resize;
    left: 72px;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.kapwing-playhead::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -6px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 9px solid #ef4444;
}

.kapwing-layer {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.kapwing-layer-label {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 600;
}

.kapwing-layer-track {
    position: relative;
    height: 40px;
    border-radius: 8px;
    background: #1e293b;
    overflow: hidden;
    border: 1px solid #334155;
}

.kapwing-video-tracks {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 6px;
}

.kapwing-layer-subtitles {
    margin-top: 2px;
}

.kapwing-layer-track.is-drop-target {
    outline: 2px dashed #60a5fa;
    background: #172554;
}

.editor-video-clip {
    position: absolute;
    top: 3px;
    bottom: 3px;
    border-radius: 6px;
    background: linear-gradient(90deg, #1e3a8a, #2563eb 45%, #3b82f6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    min-width: 12px;
    cursor: grab;
    user-select: none;
    touch-action: none;
    box-sizing: border-box;
}

.editor-video-clip.layer-1 {
    background: linear-gradient(90deg, #065f46, #059669 45%, #10b981);
}

.editor-video-clip.layer-2 {
    background: linear-gradient(90deg, #7c2d12, #c2410c 45%, #ea580c);
}

.editor-video-clip.is-selected {
    outline: 2px solid #fde68a;
    z-index: 4;
}

.editor-video-clip.is-dragging {
    cursor: grabbing;
    opacity: 0.88;
    z-index: 5;
}

.editor-video-clip.is-resizing {
    z-index: 5;
}

.editor-video-clip-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.92);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    pointer-events: none;
}

.editor-video-clip-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 10px;
    z-index: 2;
    cursor: ew-resize;
}

.editor-video-clip-handle.left {
    left: 0;
    border-radius: 6px 0 0 6px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.35), transparent);
}

.editor-video-clip-handle.right {
    right: 0;
    border-radius: 0 6px 6px 0;
    background: linear-gradient(270deg, rgba(255, 255, 255, 0.35), transparent);
}

.editor-video-clip-handle:hover,
.editor-video-clip-handle.is-active {
    background: rgba(253, 224, 71, 0.45);
}

.kapwing-timeline-wrap.tool-cut .editor-video-clip,
.kapwing-timeline-wrap.tool-cut .kapwing-layer-track {
    cursor: crosshair;
}

.kapwing-timeline-wrap.tool-cut .editor-video-clip-handle {
    cursor: crosshair;
}

.kapwing-clip-thumb video,
.kapwing-clip-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.editor-cue-block {
    position: absolute;
    top: 4px;
    bottom: 4px;
    border-radius: 6px;
    background: linear-gradient(180deg, #c084fc, #9333ea);
    opacity: 0.95;
    cursor: grab;
    min-width: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    touch-action: none;
}

.editor-cue-block.is-dragging {
    cursor: grabbing;
    opacity: 0.85;
    z-index: 3;
}

.editor-cue-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    z-index: 2;
    cursor: ew-resize;
}

.editor-cue-handle.left {
    left: 0;
    border-radius: 6px 0 0 6px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.4), transparent);
}

.editor-cue-handle.right {
    right: 0;
    border-radius: 0 6px 6px 0;
    background: linear-gradient(270deg, rgba(255, 255, 255, 0.4), transparent);
}

.editor-cue-block.active {
    outline: 2px solid #fde68a;
    z-index: 2;
}

.editor-timeline-scrub {
    display: none !important;
    width: 100%;
    margin-top: 4px;
    accent-color: #ef4444;
    height: 5px;
}

.editor-status {
    font-size: 0.82rem;
    color: #93c5fd;
}

.editor-status.is-success { color: #86efac; }
.editor-status.is-error { color: #fca5a5; }

.kapwing-inline-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.editor-export-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.editor-render-jobs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.editor-render-job {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
}

.kapwing-cues-list-panel {
    max-height: 180px;
    overflow: auto;
}

.editor-cues-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.editor-cue-row {
    padding: 8px;
    border-radius: 8px;
    background: #1e293b;
    cursor: pointer;
    font-size: 0.82rem;
    border: 1px solid transparent;
}

.editor-cue-row.active {
    border-color: #60a5fa;
    background: #172554;
}

.editor-cue-row .cue-time {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-bottom: 2px;
}

/* Projects home */
.editor-projects-home {
    max-width: 960px;
    margin: 24px auto 40px;
    padding: 24px;
}

.editor-projects-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.editor-projects-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.editor-projects-header h1 {
    margin: 0 0 6px;
    color: #f8fafc;
}

.editor-projects-header p {
    margin: 0;
    color: #94a3b8;
    font-size: 0.9rem;
}

.editor-projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.editor-project-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.editor-project-card:hover {
    border-color: #60a5fa;
    background: #172554;
}

.editor-project-card strong {
    display: block;
    color: #f8fafc;
    font-size: 0.9rem;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-project-card span {
    font-size: 0.75rem;
    color: #94a3b8;
}

.editor-back-btn {
    margin-inline-end: 8px;
}

.editor-toolbar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Gap / black between clips */
.editor-gap-overlay {
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 1;
}

.editor-video-wrap.is-gap-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Library clip actions */
.kapwing-clip {
    position: relative;
}

.kapwing-clip-actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.kapwing-clip-actions button {
    flex: 1;
    padding: 4px 6px;
    border: none;
    border-radius: 6px;
    font-size: 0.72rem;
    cursor: pointer;
    background: #334155;
    color: #f8fafc;
}

.kapwing-clip-actions button:hover {
    background: #475569;
}

.kapwing-clip-actions .clip-add-btn {
    background: #1d4ed8;
}

.kapwing-clip-actions .clip-delete-btn {
    background: #7f1d1d;
}

/* FX panel tabs */
.editor-fx-panel {
    margin-top: 8px;
}

.editor-fx-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.editor-fx-tab {
    flex: 1;
    padding: 6px 4px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #1e293b;
    color: #cbd5e1;
    font-size: 0.72rem;
    cursor: pointer;
}

.editor-fx-tab.active {
    background: #1d4ed8;
    border-color: #60a5fa;
    color: #fff;
}

.editor-fx-target {
    display: flex;
    gap: 10px;
    font-size: 0.72rem;
    color: #94a3b8;
    margin-bottom: 8px;
}

.editor-fx-target label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.editor-fx-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.editor-fx-item {
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    background: #0b1220;
    text-align: center;
    transition: border-color 0.15s;
}

.editor-fx-item:hover,
.editor-fx-item.is-applied {
    border-color: #60a5fa;
}

.editor-fx-preview {
    height: 36px;
    border-radius: 6px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.editor-fx-item span {
    font-size: 0.62rem;
    color: #cbd5e1;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-stickers-layer {
    position: absolute;
    inset: 0;
    pointer-events: auto;
    z-index: 4;
}

.editor-sticker-on-canvas {
    position: absolute;
    font-size: 2rem;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    cursor: move;
    user-select: none;
    touch-action: none;
    padding: 4px;
}

.editor-sticker-on-canvas.is-selected {
    outline: 2px solid #60a5fa;
    outline-offset: 4px;
    border-radius: 6px;
}

.editor-sticker-on-canvas .sticker-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #60a5fa;
    border: 2px solid #fff;
    border-radius: 2px;
    right: -6px;
    bottom: -6px;
    cursor: nwse-resize;
    display: none;
}

.editor-sticker-on-canvas.is-selected .sticker-handle {
    display: block;
}

.editor-overlay-clip {
    position: absolute;
    top: 4px;
    bottom: 4px;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    cursor: grab;
    z-index: 2;
}

.editor-overlay-clip.is-selected {
    outline: 2px solid #fbbf24;
}

.kapwing-overlay-layer .kapwing-layer-label {
    color: #c4b5fd;
}

.clip-fx-badge {
    display: inline-block;
    margin-inline-start: 4px;
    font-size: 0.58rem;
    font-style: normal;
    background: #312e81;
    padding: 1px 5px;
    border-radius: 4px;
    color: #c7d2fe;
}

.editor-video-wrap.effect-vignette::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle, transparent 45%, rgba(0,0,0,0.55) 100%);
    z-index: 2;
}

/* Context menu */
.editor-context-menu {
    position: fixed;
    z-index: 5000;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 4px;
    min-width: 140px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.editor-context-menu button {
    display: block;
    width: 100%;
    text-align: start;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #f8fafc;
    font-size: 0.82rem;
    cursor: pointer;
    border-radius: 6px;
}

.editor-context-menu button:hover {
    background: #334155;
}

.editor-render-job .render-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-render-job .render-meta {
    font-size: 0.68rem;
    color: #94a3b8;
}

@media (max-width: 900px) {
    .kapwing-main {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    .kapwing-media,
    .kapwing-inspector {
        border: none;
        border-bottom: 1px solid #1f2937;
        max-height: 200px;
    }
}

/* —— Editor 1 / Editor 2 toggle (always on top of the classic shell) —— */
.editor-version-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    padding: 10px 16px;
    margin: 8px 12px 0;
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    position: relative;
    z-index: 1700;
}

.video-editor-page.editor-shell-active .editor-version-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    z-index: 1700;
}


.editor-version-bar__label {
    font-weight: 700;
    font-size: 0.9rem;
    color: #e2e8f0;
}

.editor-version-bar__toggle {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    background: #0b1220;
    border-radius: 10px;
    border: 1px solid #243044;
}

.editor-version-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 8px;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1.15;
}

.editor-version-btn small {
    font-weight: 500;
    font-size: 0.65rem;
    opacity: 0.8;
}

.editor-version-btn.is-active {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.editor-version-bar__hint {
    margin: 0;
    margin-inline-start: auto;
    font-size: 0.72rem;
    color: #94a3b8;
    max-width: 420px;
}

.editor-v2-shell {
    margin: 0 12px 12px;
    padding: 0;
    overflow: hidden;
    min-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
}

.video-editor-page.editor-shell-active.editor-v2-active .editor-v2-shell,
.video-editor-page.editor-v2-active .editor-v2-shell {
    position: fixed;
    inset: 58px 0 0 0;
    margin: 0;
    border-radius: 0;
    border: none;
    min-height: 0;
    height: auto;
    z-index: 1500;
}

.editor-v2-shell iframe {
    width: 100%;
    height: 100%;
    min-height: inherit;
    border: 0;
    background: #0a0a0c;
    flex: 1;
}

.video-editor-page.editor-v2-active .site-footer {
    display: none !important;
}
