.cagh-personalize-btn {
    background: #dc1212 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 12px 22px !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
}

.cagh-personalize-btn:hover {
    background: #b91c1c !important;
}

.cagh-personalize-btn.is-primary-only {
    flex: 1 1 auto;
}

body.cagh-modal-open {
    overflow: hidden;
}

.cagh-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    z-index: 100100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.cagh-modal-backdrop.is-open {
    display: flex;
}

.cagh-modal-sheet {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.cagh-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
}

.cagh-modal-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}

.cagh-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #334155;
}

.cagh-modal-body {
    padding: 16px 18px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.cagh-preview-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.cagh-preview-stage {
    position: relative;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    user-select: none;
}

.cagh-preview-mockup {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
}

.cagh-preview-window {
    position: absolute;
    border: 2px dashed rgba(220, 18, 18, 0.75);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    touch-action: none;
    background: rgba(15, 23, 42, 0.08);
}

.cagh-preview-window img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    transform-origin: center center;
}

.cagh-preview-placeholder {
    font-size: 12px;
    font-weight: 700;
    color: #dc1212;
    background: rgba(255, 255, 255, 0.85);
    padding: 4px 10px;
    border-radius: 999px;
}

.cagh-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.cagh-controls-row label {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}

.cagh-controls-row input[type="range"] {
    flex: 1 1 auto;
}

.cagh-reset-pos-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.cagh-upload-section {
    margin-top: 16px;
}

.cagh-upload-heading {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.cagh-upload-tile {
    position: relative;
    width: 96px;
    height: 112px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
    padding: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cagh-upload-tile-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
}

.cagh-upload-icon {
    font-size: 24px;
    line-height: 1;
}

.cagh-upload-tile-filled {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
    height: 100%;
}

.cagh-upload-tile-filled img {
    width: 100%;
    height: 76px;
    object-fit: cover;
    border-radius: 6px;
}

.cagh-tile-dims {
    font-size: 10.5px;
    color: #64748b;
    font-weight: 600;
}

.cagh-tile-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #334155;
    color: #ffffff;
    font-size: 14px;
    line-height: 22px;
    text-align: center;
}

.cagh-upload-status {
    margin-top: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: #15803d;
}

.cagh-upload-status.is-warn {
    color: #b45309;
}

.cagh-upload-status.is-error {
    color: #dc2626;
}

.cagh-upload-note {
    margin: 8px 0 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.45;
}

.cagh-modal-footer {
    padding: 14px 18px;
    border-top: 1px solid #e2e8f0;
}

.cagh-confirm-atc-btn {
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-radius: 999px;
    background: #dc1212;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.cagh-confirm-atc-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

/* Temu-style Direct Drag & 4-Corner Resize Box */
.cagh-user-box {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border: 1.5px dashed #f97316;
    box-sizing: border-box;
    cursor: move;
    touch-action: none;
}

.cagh-user-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.cagh-corner-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid #f97316;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 3px;
    z-index: 5;
    box-sizing: border-box;
}

.cagh-corner-handle.is-nw { top: -7px; left: -7px; cursor: nwse-resize; }
.cagh-corner-handle.is-ne { top: -7px; right: -7px; cursor: nesw-resize; }
.cagh-corner-handle.is-sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.cagh-corner-handle.is-se { bottom: -7px; right: -7px; cursor: nwse-resize; }
