.editor-body {
    min-height: 100vh;
    background: var(--bg);
    overflow-x: hidden;
}

.editor-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.separator {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 4px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 18px;
    transition: var(--trans);
}

.icon-btn:hover:not(:disabled) {
    background: var(--surface-2);
    border-color: var(--primary);
    color: var(--primary);
}

.icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.editor {
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
}

/* TOP - two panes */
.editor__top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
    min-height: 500px;
}

.editor__pane {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-alt);
}

.pane-header h3 {
    font-size: 14px;
    font-weight: 600;
}

.pane-header__meta {
    font-size: 12px;
    color: var(--text-muted);
}

.drop-zone {
    position: relative;
    flex: 1;
    min-height: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(var(--bg-alt), var(--bg-alt)),
        repeating-conic-gradient(#1a1e2e 0 25%, #14182a 0 50%) 50% / 24px 24px;
    padding: 20px;
    overflow: hidden;
    transition: var(--trans);
}

.drop-zone.dragover {
    background: rgba(99, 102, 241, 0.1);
    box-shadow: inset 0 0 0 2px var(--primary);
}

.drop-zone__empty {
    text-align: center;
    padding: 40px;
}

.drop-zone__icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.drop-zone__empty h2 {
    font-size: 20px;
    margin-bottom: 8px;
    font-weight: 600;
}

.drop-zone__empty p {
    color: var(--text-muted);
    margin-bottom: 6px;
}

.link {
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
}

.link:hover {
    color: var(--primary-hover);
}

.drop-zone__canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    display: block;
}

/* Crop overlay */
.crop-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.crop-box {
    position: absolute;
    border: 2px dashed #fff;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    cursor: move;
}

.crop-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border: 2px solid white;
    border-radius: 50%;
    pointer-events: auto;
}

.crop-handle--nw {
    top: -7px;
    left: -7px;
    cursor: nwse-resize;
}

.crop-handle--ne {
    top: -7px;
    right: -7px;
    cursor: nesw-resize;
}

.crop-handle--sw {
    bottom: -7px;
    left: -7px;
    cursor: nesw-resize;
}

.crop-handle--se {
    bottom: -7px;
    right: -7px;
    cursor: nwse-resize;
}

/* BOTTOM - controls */
.editor__bottom {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tabs {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-alt);
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    transition: var(--trans);
}

.tab:hover {
    color: var(--text);
    background: var(--surface);
}

.tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.2);
}

.tab-content {
    padding: 24px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}

.control-group h4 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chip-row,
.btn-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
    transition: var(--trans);
}

.chip:hover {
    color: var(--text);
    border-color: var(--primary);
}

.chip.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-color: transparent;
}

/* SLIDERS */
.slider-ctrl {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-ctrl label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
}

.slider-val {
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.slider-ctrl input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--surface-2);
    border-radius: 3px;
    outline: none;
}

.slider-ctrl input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--primary-glow);
    transition: transform var(--trans);
}

.slider-ctrl input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-ctrl input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

/* PRESETS */
.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
}

.preset-card {
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: var(--trans);
    background: var(--surface-2);
}

.preset-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.preset-card.active {
    border-color: var(--primary);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.preset-card__preview {
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
}

.preset-card__name {
    padding: 8px 10px;
    font-size: 12px;
    text-align: center;
    font-weight: 500;
}

/* AI cards */
.ai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.ai-card {
    padding: 22px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    transition: var(--trans);
    position: relative;
}

.ai-card--soon::after {
    content: 'Скоро';
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ai-card__icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.ai-card h4 {
    font-size: 15px;
    margin-bottom: 6px;
}

.ai-card p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
    min-height: 36px;
}

/* RESPONSIVE */
@media (max-width: 1000px) {
    .editor__top {
        grid-template-columns: 1fr;
    }

    .drop-zone {
        min-height: 300px;
    }
}

@media (max-width: 600px) {
    .editor {
        padding: 12px;
    }

    .editor-topbar .btn {
        display: none;
    }
}