.file-upload-group.sunset-badges-layout-only > label,
.file-upload-group.sunset-badges-layout-only #image-upload-wrapper,
.file-upload-group.sunset-badges-layout-only #file-info,
.file-upload-group.sunset-badges-layout-only #duplicate-check-result {
    display: none !important;
}

.file-upload-group.badge-layout-editor-active {
    margin-top: 20px;
}

.badge-layout-editor-root {
    width: 100%;
}

.badge-layout-stage-upload {
    position: relative;
    margin-top: 0;
}

.badge-layout-stage-upload.uploading .file-upload-content,
.badge-layout-stage-upload.badge-layout-stage-upload--loading .file-upload-content {
    display: none;
}

.badge-layout-uploading-overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(250, 250, 250, 0.85);
    border-radius: 15px;
    z-index: 5;
}

.badge-layout-uploading-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #5521c4;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
}

.badge-layout-uploading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(85, 33, 196, 0.2);
    border-top-color: #5521c4;
    border-radius: 50%;
    animation: badge-layout-spin 0.8s linear infinite;
}

@keyframes badge-layout-spin {
    to {
        transform: rotate(360deg);
    }
}

.badge-layout-stage-work {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.badge-layout-work-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.badge-layout-editor-canvas-wrap {
    position: relative;
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: #e8e8e8;
    border: 1px solid #e0ddeb;
}

.badge-layout-editor-canvas-wrap--confirmed {
    border-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
}

.badge-layout-work-sidebar {
    flex: 1 1 220px;
    min-width: 200px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.badge-layout-interaction-hint {
    margin: 0;
    font-size: 13px;
    color: #555;
    line-height: 1.45;
}

.badge-layout-legend-wrap {
    position: relative;
}

.badge-layout-legend-trigger {
    padding: 0;
    border: none;
    background: none;
    color: #5521c4;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.badge-layout-legend-trigger:hover,
.badge-layout-legend-trigger:focus-visible {
    color: #3c1690;
}

.badge-layout-legend-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 20;
    min-width: 260px;
    max-width: 340px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #e0ddeb;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.badge-layout-legend {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 12px;
    color: #444;
    line-height: 1.45;
}

.badge-layout-legend li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.badge-layout-legend-swatch {
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-top: 3px;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

#badge-layout-editor-canvas {
    display: block;
    max-width: 100%;
    cursor: grab;
    touch-action: none;
}

#badge-layout-editor-canvas:active {
    cursor: grabbing;
}

.badge-layout-preview-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    user-select: none;
}

.badge-layout-preview-toggle input {
    margin: 0;
    cursor: pointer;
}

.badge-layout-scale-controls {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 2;
    display: flex;
    gap: 6px;
}

.badge-layout-scale-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    font-family: inherit;
    font-size: 18px;
    line-height: 1;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: background 0.2s ease;
}

.badge-layout-scale-btn:hover {
    background: rgba(255, 255, 255, 0.95);
}

.badge-layout-editor-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.badge-layout-action-btn {
    display: block;
    width: 100%;
    margin: 0;
    padding: 14px 20px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    text-align: center;
    box-sizing: border-box;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}

.badge-layout-action-btn--neutral {
    background: #fafafa;
    color: #333;
    border: 2px solid #e0ddeb;
}

.badge-layout-action-btn--neutral:hover {
    border-color: #c5c0d8;
    background: #f0eef5;
}

.badge-layout-action-btn--confirm {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    border: 2px solid transparent;
}

.badge-layout-action-btn--confirm:hover:not(:disabled) {
    opacity: 0.92;
    transform: translateY(-1px);
}

.badge-layout-action-btn--confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.badge-layout-editor-status {
    font-size: 13px;
    color: #444;
    min-height: 1.2em;
    line-height: 1.45;
}

@media (max-width: 640px) {
    .badge-layout-work-row {
        flex-direction: column;
    }

    .badge-layout-editor-canvas-wrap {
        width: 100% !important;
        max-width: 100%;
    }

    .badge-layout-work-sidebar {
        flex: 1 1 auto;
        max-width: none;
        width: 100%;
    }

    .badge-layout-legend-popover {
        position: static;
        margin-top: 8px;
        max-width: none;
        box-shadow: none;
    }
}

.badge-layout-rotation-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #e8e4f0;
    border-radius: 12px;
    background: #faf9fc;
}

.badge-layout-rotation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.badge-layout-rotation-label,
.badge-layout-rotation-value {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.badge-layout-rotation-actions {
    display: flex;
    gap: 8px;
}

.badge-layout-rotation-btn {
    flex: 1;
    min-height: 36px;
    border: 1px solid #d8d2e6;
    border-radius: 8px;
    background: #fff;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.badge-layout-rotation-btn:hover {
    border-color: #5521c4;
    color: #5521c4;
}

.badge-layout-rotation-slider {
    width: 100%;
    min-height: 28px;
    accent-color: #5521c4;
}

.badge-layout-rotation-input {
    width: 100%;
    min-height: 40px;
    border: 1px solid #d8d2e6;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
}

@media (max-width: 640px) {
    .badge-layout-rotation-slider {
        min-height: 44px;
    }
}
