/* Image crop & resize — external styles (no inline CSS) */

.icr-tool .icr-secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    background: #ecfdf5;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.icr-drop-zone {
    border: 2px dashed #dbeafe;
    border-radius: 1.25rem;
    background: linear-gradient(180deg, #fafafa 0%, #f8fafc 100%);
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}
.icr-drop-zone:hover,
.icr-drop-zone.drag-over {
    border-color: #93c5fd;
    background: #eff6ff;
}
.icr-drop-emoji { font-size: 3rem; line-height: 1; margin-bottom: 0.75rem; }

.icr-sub-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1.25rem;
}
.icr-sub-tab {
    padding: 0.65rem 1.1rem;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: #6b7280;
    background: transparent;
    border-radius: 0.5rem 0.5rem 0 0;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.icr-sub-tab:hover { color: #374151; background: #f9fafb; }
.icr-sub-tab.active {
    color: #2563eb;
    border-bottom-color: #3b82f6;
    background: #eff6ff;
}

.icr-aspect-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}
.icr-aspect-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #6b7280;
}
.icr-aspect-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}
.icr-aspect-btn {
    padding: 0.4rem 0.7rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
}
.icr-aspect-btn:hover { border-color: #93c5fd; background: #eff6ff; }
.icr-aspect-btn.active {
    border-color: #3b82f6;
    background: #dbeafe;
    color: #1e40af;
}

.icr-crop-stage {
    position: relative;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    min-height: 240px;
    max-height: min(70vh, 560px);
}
.icr-crop-wrap {
    width: 100%;
    min-height: 240px;
    max-height: min(70vh, 560px);
}
.icr-crop-wrap .cropper-container {
    min-height: 240px;
    max-height: min(70vh, 560px);
}
.icr-crop-wrap .cropper-bg { background: #f3f4f6; }
.icr-crop-wrap .cropper-view-box {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}
.icr-crop-wrap .cropper-face { background: transparent; }
.icr-crop-wrap .cropper-line {
    background-color: #3b82f6;
    opacity: 0.55;
}
.icr-crop-wrap .cropper-point {
    width: 11px;
    height: 11px;
    background: #fff;
    border: 2px solid #3b82f6;
    opacity: 1;
    border-radius: 50%;
}
.icr-crop-wrap .cropper-point.point-se { width: 13px; height: 13px; }
.icr-crop-wrap .cropper-modal { background: rgba(17, 24, 39, 0.55); }

.icr-crop-badge {
    position: absolute;
    z-index: 20;
    pointer-events: none;
    background: #3b82f6;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 0.35rem;
    line-height: 1.3;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translate(4px, 4px);
}

.icr-crop-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    padding: 0.65rem 0.25rem;
}
.icr-btn-clear {
    border: 0;
    background: transparent;
    color: #ef4444;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}
.icr-btn-clear:hover { color: #dc2626; text-decoration: underline; }
.icr-btn-select {
    border: 0;
    background: transparent;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}
.icr-btn-select:hover { color: #2563eb; }

.icr-export-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1rem 1.15rem;
    margin-top: 0.5rem;
}
.icr-crop-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 0.65rem;
    padding: 0.9rem 1.75rem;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: filter 0.15s, transform 0.15s;
    min-width: 11rem;
}
.icr-crop-download-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}
.icr-export-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.85rem;
}
.icr-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.icr-field-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #6b7280;
}
.icr-field-input {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    min-width: 5.5rem;
}
.icr-field-input--num {
    width: 5.5rem;
    text-align: center;
}
.icr-field-select {
    min-width: 6.5rem;
    cursor: pointer;
}

.icr-control-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1rem 1.15rem;
}
.icr-format-btn.format-btn {
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
}
.icr-format-btn.format-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.icr-dimensions-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.5rem;
    align-items: end;
}
.icr-aspect-lock {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}
.icr-aspect-lock.active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #2563eb;
}
.icr-preset-btn {
    padding: 0.45rem 0.7rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}
.icr-preset-btn.active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1e40af;
}
.icr-preview-box {
    background: repeating-conic-gradient(#e5e7eb 0% 25%, #f9fafb 0% 50%) 50% / 16px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.icr-preview-box img {
    max-width: 100%;
    max-height: min(50vh, 360px);
    border-radius: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}
.icr-preview-dims {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 600;
}
.icr-action-btn {
    width: 100%;
    padding: 0.85rem 1.25rem;
    border-radius: 0.85rem;
    font-weight: 800;
    font-size: 1rem;
}
.icr-change-btn {
    margin-top: 1rem;
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.85rem;
    border: 2px solid #e5e7eb;
    background: #fff;
    font-weight: 700;
    color: #374151;
    cursor: pointer;
}
.icr-change-btn:hover { background: #f9fafb; }

@media (max-width: 639px) {
    .icr-export-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .icr-crop-download-btn {
        width: 100%;
        min-width: 0;
    }
    .icr-export-fields {
        width: 100%;
        justify-content: space-between;
    }
    .icr-dimensions-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .icr-aspect-lock {
        justify-self: center;
        margin: 0;
    }
}
