.advanced-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0 0 1rem;
}

.advanced-toolbar label,
.advanced-split-editor > label {
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.advanced-toolbar input[type="number"] {
    width: 88px;
}

.advanced-toolbar input[type="range"] {
    width: 150px;
    accent-color: #aaa;
}

.advanced-split-editor {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.advanced-split-editor textarea {
    min-height: 420px;
    margin-top: 0.4rem;
    font-family: Consolas, "Cascadia Code", monospace;
    tab-size: 4;
    letter-spacing: 0;
}

.advanced-compact-result {
    min-height: 48px;
    max-height: 160px;
}

.advanced-protected-panel {
    position: relative;
    min-height: 230px;
}

.advanced-file-summary {
    min-width: 220px;
    max-width: min(480px, 100%);
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.crop-conditional {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-muted);
    opacity: 0.45;
}

.crop-conditional:has(input:not(:disabled)) {
    opacity: 1;
}

.crop-conditional input[type="number"] {
    width: 84px;
}

.crop-canvas-shell,
.noise-canvas-shell {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 360px;
    max-height: 620px;
    margin: 0 0 1rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: #101014;
    background-image:
        linear-gradient(45deg, #17171c 25%, transparent 25%),
        linear-gradient(-45deg, #17171c 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #17171c 75%),
        linear-gradient(-45deg, transparent 75%, #17171c 75%);
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
}

.crop-canvas-shell canvas,
.noise-canvas-shell canvas {
    display: block;
    width: 100%;
    height: 520px;
    max-width: 100%;
    touch-action: none;
}

#cropStatus[data-state="error"],
#noiseStatus[data-state="error"] { color: #f88; }

#cropStatus[data-state="working"],
#noiseStatus[data-state="working"] { color: #ff8; }

#cropStatus[data-state="success"],
#noiseStatus[data-state="success"] { color: #8f8; }

.crop-canvas-shell canvas {
    cursor: grab;
}

.crop-canvas-shell canvas:active {
    cursor: grabbing;
}

.ai-yolo-graph {
    margin: 1rem 0 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.18);
}

.ai-yolo-graph-header {
    display: flex;
    min-height: 54px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.ai-yolo-graph-header h3 {
    margin: 0 0 0.15rem;
    color: var(--text-heading);
    font-size: 0.92rem;
    font-weight: 400;
    letter-spacing: 0;
}

.ai-yolo-graph-header span {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.ai-yolo-graph-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.ai-yolo-graph-controls button {
    display: inline-grid;
    min-width: 34px;
    height: 32px;
    place-items: center;
    padding: 0 0.55rem;
    border-radius: 6px;
    font-size: 0.78rem;
    letter-spacing: 0;
}

.ai-yolo-graph-controls button:first-child,
.ai-yolo-graph-controls button:nth-child(2) {
    width: 34px;
    padding: 0;
    font-size: 1.1rem;
}

.ai-yolo-graph-viewport {
    position: relative;
    width: 100%;
    height: 520px;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    background: #111116;
}

.ai-yolo-graph-viewport:active {
    cursor: grabbing;
}

.ai-yolo-graph-viewport canvas {
    display: block;
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .advanced-split-editor {
        grid-template-columns: 1fr;
    }

    .advanced-split-editor textarea {
        min-height: 260px;
    }

    .advanced-toolbar {
        align-items: stretch;
    }

    .crop-canvas-shell,
    .noise-canvas-shell {
        min-height: 260px;
        max-height: 440px;
    }

    .crop-canvas-shell canvas,
    .noise-canvas-shell canvas {
        height: 400px;
    }

    .ai-yolo-graph-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .ai-yolo-graph-viewport {
        height: 400px;
    }
}
