/* ═══════════════════════════════════════════════════════════
   画像サイズ最適化ツール — styles
   prefix: ir-
═══════════════════════════════════════════════════════════ */

.ir-container {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    max-width: 680px;
    margin: 0 auto;
    padding: 0 16px 40px;
    color: #1f2937;
}

/* ── Step Labels ── */
.ir-step-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 800;
    color: #7c3aed;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.ir-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #7c3aed;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}

/* ── Category Tabs ── */
.ir-cat-tabs {
    display: flex;
    gap: 0;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 14px;
}

.ir-cat-tab {
    flex: 1;
    padding: 10px 8px;
    border: none;
    background: transparent;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    color: #6b7280;
    transition: all 0.2s;
    text-align: center;
}

.ir-cat-tab.active {
    background: #fff;
    color: #7c3aed;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ── Category Panel ── */
.ir-cat-panel {
    margin-bottom: 16px;
}

/* ── Platform Accordion ── */
.ir-platform {
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 8px;
    overflow: hidden;
}

.ir-platform-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f9fafb;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    transition: background 0.15s;
    user-select: none;
    -webkit-user-select: none;
}

.ir-platform-header:hover {
    background: #f3f4f6;
}

.ir-platform-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.ir-platform-name {
    flex: 1;
}

.ir-platform-chevron {
    font-size: 12px;
    color: #9ca3af;
    transition: transform 0.2s;
}

.ir-platform.open .ir-platform-chevron {
    transform: rotate(180deg);
}

.ir-platform-body {
    display: none;
    padding: 10px 14px 14px;
    background: #fff;
}

.ir-platform.open .ir-platform-body {
    display: block;
}

/* ── Preset Buttons ── */
.ir-preset-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ir-preset-btn {
    padding: 8px 12px;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    color: #374151;
    transition: all 0.15s;
    text-align: left;
    line-height: 1.3;
}

.ir-preset-btn:hover {
    border-color: #c4b5fd;
    color: #7c3aed;
    background: #faf5ff;
}

.ir-preset-btn.active {
    background: #ede9fe;
    border-color: #8b5cf6;
    color: #6d28d9;
}

.ir-preset-name {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: inherit;
}

.ir-preset-size {
    display: block;
    font-size: 10px;
    color: #9ca3af;
    margin-top: 1px;
    font-weight: 600;
}

.ir-preset-btn.active .ir-preset-size {
    color: #8b5cf6;
}

/* ── Custom Size Inputs ── */
.ir-custom-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ir-custom-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ir-custom-input-wrap label {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    flex-shrink: 0;
}

.ir-custom-input {
    width: 90px;
    padding: 10px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #1f2937;
    text-align: center;
}

.ir-custom-input:focus {
    outline: none;
    border-color: #8b5cf6;
}

.ir-custom-unit {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 600;
}

.ir-custom-sep {
    font-size: 18px;
    color: #d1d5db;
    font-weight: 300;
}

.ir-selected-label {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #ede9fe;
    border: 1.5px solid #8b5cf6;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 700;
    color: #6d28d9;
}

.ir-selected-label.visible {
    display: flex;
}

/* ── Fit Mode ── */
.ir-fit-section {
    margin-bottom: 16px;
}

.ir-fit-label {
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 8px;
    display: block;
}

.ir-fit-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ir-fit-btn {
    flex: 1;
    min-width: 90px;
    padding: 10px 8px;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    color: #6b7280;
    transition: all 0.15s;
    text-align: center;
}

.ir-fit-btn:hover {
    border-color: #c4b5fd;
    color: #7c3aed;
}

.ir-fit-btn.active {
    background: #ede9fe;
    border-color: #8b5cf6;
    color: #6d28d9;
}

.ir-bgcolor-row {
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.ir-bgcolor-row.visible {
    display: flex;
}

.ir-color-input {
    width: 36px;
    height: 36px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
    background: transparent;
}

.ir-color-hex {
    font-size: 12px;
    font-family: monospace;
    color: #6b7280;
}

/* ── Drop Zone ── */
.ir-drop-zone {
    border: 2.5px dashed #c4b5fd;
    border-radius: 14px;
    background: #f5f3ff;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 16px;
}

.ir-drop-zone:hover {
    border-color: #a78bfa;
    background: #ede9fe;
}

.ir-drop-zone.dragover {
    border-color: #7c3aed;
    background: #ede9fe;
    transform: scale(1.01);
}

.ir-drop-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.ir-drop-text {
    font-size: 15px;
    font-weight: 700;
    color: #374151;
    margin: 0 0 6px;
}

.ir-drop-hint {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}

/* ── Output Format ── */
.ir-format-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.ir-format-label {
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    margin-right: 4px;
}

.ir-format-btn {
    padding: 8px 14px;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    color: #6b7280;
    transition: all 0.15s;
}

.ir-format-btn.active {
    background: #ede9fe;
    border-color: #8b5cf6;
    color: #6d28d9;
}

.ir-quality-wrap {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}

.ir-quality-wrap.visible {
    display: flex;
}

.ir-quality-input {
    width: 55px;
    padding: 6px 8px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    font-weight: 700;
    text-align: center;
}

/* ── Preview Grid ── */
.ir-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

@media (max-width: 520px) {
    .ir-preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.ir-preview-card {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.15s;
}

.ir-preview-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ir-preview-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: #f3f4f6;
    display: block;
}

.ir-preview-info {
    padding: 8px 10px;
}

.ir-preview-name {
    font-size: 11px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ir-preview-sizes {
    font-size: 10px;
    color: #9ca3af;
    margin: 0 0 6px;
    line-height: 1.4;
}

.ir-preview-arrow {
    color: #8b5cf6;
    font-weight: 700;
}

.ir-preview-dl {
    display: block;
    width: 100%;
    padding: 6px;
    background: #ede9fe;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #7c3aed;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    text-align: center;
    box-sizing: border-box;
}

.ir-preview-dl:hover {
    background: #ddd6fe;
}

/* ── Action Button ── */
.ir-btn-primary {
    display: block;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    text-align: center;
    box-sizing: border-box;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #fff;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
    margin-bottom: 12px;
}

.ir-btn-primary:not(:disabled):hover {
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.5);
}

.ir-btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Progress ── */
.ir-progress {
    display: none;
    margin-bottom: 16px;
}

.ir-progress.visible {
    display: block;
}

.ir-progress-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.ir-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s;
}

.ir-progress-fill.indeterminate {
    width: 40%;
    animation: ir-indeterminate 1.2s ease-in-out infinite;
}

@keyframes ir-indeterminate {
    0% {
        transform: translateX(-200%);
    }

    100% {
        transform: translateX(500%);
    }
}

.ir-progress-text {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    text-align: center;
    margin: 0;
}

/* ── Alerts ── */
.ir-alert {
    display: none;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
    line-height: 1.5;
}

.ir-alert.visible {
    display: block;
}

.ir-alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1.5px solid #6ee7b7;
}

.ir-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1.5px solid #fca5a5;
}

/* ── Security Banner ── */
.ir-security-banner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1.5px solid #c4b5fd;
    border-radius: 14px;
    padding: 16px;
    margin-top: 20px;
    margin-bottom: 24px;
}

.ir-security-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.ir-security-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1;
}

.ir-security-item strong {
    font-size: 11px;
    font-weight: 700;
    color: #5b21b6;
    display: block;
    margin-bottom: 2px;
}

.ir-security-item p {
    font-size: 10px;
    color: #7c3aed;
    margin: 0;
    line-height: 1.35;
}

@media (max-width: 520px) {
    .ir-security-banner {
        grid-template-columns: 1fr;
    }

    .ir-cat-tab {
        font-size: 12px;
        padding: 8px 4px;
    }
}

/* ── Section Divider ── */
.ir-section {
    margin-bottom: 22px;
}

.ir-divider {
    border: none;
    border-top: 1.5px solid #f3f4f6;
    margin: 20px 0;
}