/* B) CSS Code */
.image-border-radius {
    --primary: #F97316;
    --primary-dark: #C2410C;
    --black: #1A1A1A;
    --gray-border: #E5E5E5;
    --bg-light: #FFFFFF;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-light);
    border-radius: 28px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
    padding: 2rem 1.8rem;
    transition: all 0.2s ease;
    border: 1px solid #f0f0f0;
}

.tool-heading {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--black);
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.tool-heading::after {
    content: '';
    display: block;
    width: 70px;
    height: 4px;
    background: var(--primary);
    border-radius: 4px;
    margin-top: 8px;
}

.tool-description {
    font-size: 1rem;
    color: #4B5563;
    margin-bottom: 1.75rem;
}

/* upload area */
.upload-section {
    border: 2px dashed var(--gray-border);
    border-radius: 24px;
    background: #FAFAFA;
    padding: 2.8rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border 0.2s, background 0.2s;
    margin-bottom: 1.5rem;
    position: relative;
}
.upload-section:hover {
    border-color: var(--primary);
    background: #FFF8F0;
}
.upload-icon svg {
    stroke: var(--primary);
    margin-bottom: 0.5rem;
}
.upload-text {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--black);
    margin: 0.5rem 0 0.25rem;
}
.orange-text {
    color: var(--primary);
    font-weight: 600;
}
.upload-hint {
    font-size: 0.85rem;
    color: #6B7280;
}
.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* border panel */
.border-panel {
    background: #FFFFFF;
    border-radius: 24px;
    padding: 1.5rem;
    margin: 1rem 0 1.8rem;
    border: 1px solid #EEEEEE;
    box-shadow: 0 8px 20px rgba(0,0,0,0.02);
}
.border-panel.hidden {
    display: none;
}

/* preview section */
.preview-section {
    margin-bottom: 2rem;
}
.preview-box {
    background: #F9FAFB;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid #F0F0F0;
}
.box-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--black);
    margin: 0 0 1rem 0;
    text-align: center;
}
.preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    background: repeating-conic-gradient(#E5E5E5 0% 25%, #FFFFFF 0% 50%) 50% / 20px 20px;
    border-radius: 12px;
    padding: 1rem;
}
#previewImage {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 0;
    transition: all 0.1s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* radius controls */
.radius-controls {
    background: #F9FAFB;
    border-radius: 16px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-border);
}
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--black);
    margin: 0 0 1rem 0;
}

.control-group {
    margin-bottom: 1.2rem;
}
.control-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4B5563;
    margin-bottom: 0.5rem;
}
.radius-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.type-btn {
    background: white;
    border: 1.5px solid var(--gray-border);
    color: #4B5563;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.type-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #FFF8F0;
}
.type-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.control-row:last-child {
    margin-bottom: 0;
}
.control-row label {
    width: 120px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4B5563;
}
.control-row input[type="range"] {
    flex: 1;
    height: 6px;
    background: #E0E0E0;
    border-radius: 10px;
    -webkit-appearance: none;
}
.control-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(249,115,22,0.4);
}
.control-row input[type="color"] {
    width: 50px;
    height: 40px;
    border: 2px solid var(--gray-border);
    border-radius: 8px;
    cursor: pointer;
}
.control-row span {
    min-width: 50px;
    font-weight: 600;
    color: var(--primary);
    text-align: right;
}

.individual-corners {
    margin: 1rem 0;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-border);
}
.individual-corners.hidden {
    display: none;
}

/* border options */
.border-options {
    margin: 1rem 0;
    padding: 0.5rem;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-border);
}
.border-options summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary);
    padding: 0.5rem;
}
.border-options summary:hover {
    color: var(--primary-dark);
}
.border-options .control-row {
    margin-top: 0.5rem;
}

.size-select {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1.5px solid var(--gray-border);
    border-radius: 30px;
    font-size: 0.9rem;
    outline: none;
    transition: border 0.2s;
}
.size-select:focus {
    border-color: var(--primary);
}

.reset-btn {
    background: white;
    border: 1.5px solid var(--gray-border);
    color: #4B5563;
    font-weight: 500;
    padding: 0.5rem 2rem;
    border-radius: 30px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}
.reset-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #FFF8F0;
}

/* action buttons */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 1rem 0;
}
.btn {
    background: white;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    min-width: 220px;
}
.btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 8px 18px rgba(249,115,22,0.25);
    transform: translateY(-1px);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.download-btn {
    background: var(--black);
    border-color: var(--black);
    color: white;
}
.download-btn:hover:not(:disabled) {
    background: #000;
    border-color: #000;
}

/* processing indicator */
.processing-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background: #FEF3C7;
    border-radius: 50px;
    color: #92400E;
}
.processing-indicator.hidden {
    display: none;
}
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #FCD34D;
    border-top-color: #F97316;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.disclaimer {
    font-size: 0.75rem;
    color: #9CA3AF;
    margin-top: 0.75rem;
    text-align: center;
}

/* feature grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 2rem;
    border-top: 1px solid var(--gray-border);
    padding-top: 1.5rem;
}
.feature-item {
    text-align: center;
    background: #FEFCF9;
    padding: 0.9rem 0.2rem;
    border-radius: 32px;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.feature-item:hover {
    border-color: var(--primary);
    background: white;
    transform: scale(1.02);
}
.feature-icon {
    font-size: 1.7rem;
    display: block;
    line-height: 1.2;
    color: var(--primary);
}
.feature-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--black);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* responsive */
@media (max-width: 700px) {
    .image-border-radius { padding: 1.5rem 1rem; }
    .tool-heading { font-size: 1.9rem; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
    .control-row { flex-wrap: wrap; }
    .control-row label { width: 100%; }
    .radius-types { justify-content: center; }
}
@media (max-width: 380px) {
    .feature-grid { grid-template-columns: 1fr; }
}