/**
 * public/css/tools/web/image-compressor.css
 * Image Compressor — 3-Page Premium SaaS Workflow
 * Follows the site design system (style.css variables + Sora/DM Sans fonts)
 * NO inline styles. All styles live here.
 */

/* ================================================================
   STEP INDICATOR
================================================================ */
.ic-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 24px 20px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  gap: 0;
}

.ic-step {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.ic-step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 800;
  font-family: 'Sora', sans-serif;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 2px solid var(--border);
  transition: all .3s ease;
  flex-shrink: 0;
}

.ic-step-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  transition: color .3s ease;
  white-space: nowrap;
}

.ic-step--active .ic-step-num {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(30,136,229,.15);
}
.ic-step--active .ic-step-label { color: var(--primary); font-weight: 700; }

.ic-step--done .ic-step-num {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}
.ic-step--done .ic-step-label { color: #10b981; }

.ic-step-sep {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 10px;
  border-radius: 2px;
  max-width: 80px;
  transition: background .3s ease;
}
.ic-step-sep--done { background: #10b981; }
.ic-step-sep--active { background: var(--primary); }

/* ================================================================
   PAGES WRAPPER
================================================================ */
.ic-pages {
  position: relative;
  overflow: hidden;
}

.ic-page {
  display: none;
  animation: icFadeIn .3s ease;
}
.ic-page--active { display: block; }

@keyframes icFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   PAGE 1 — UPLOAD
================================================================ */
.ic-upload-body {
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Drop zone */
.ic-dz {
  border: 2px dashed #93c5fd;
  border-radius: 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  padding: 52px 28px 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: center;
  transition: border-color .2s, background .2s, transform .2s;
  position: relative;
  overflow: hidden;
}

.ic-dz::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(30,136,229,.06) 0%, transparent 70%);
  pointer-events: none;
}

.ic-dz:hover,
.ic-dz.ic-dz--over {
  border-color: var(--primary);
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  transform: scale(1.005);
}

.ic-dz-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(30,136,229,.35);
  margin-bottom: 4px;
  transition: transform .2s, box-shadow .2s;
}

.ic-dz:hover .ic-dz-icon {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 32px rgba(30,136,229,.45);
}

.ic-dz-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'Sora', sans-serif;
  margin: 0;
  line-height: 1.3;
}

.ic-dz-sub {
  font-size: .88rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Format badges */
.ic-fmt-badges {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2px;
}

.ic-fmt-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px 5px 8px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .01em;
  font-family: 'Sora', sans-serif;
}

.ic-fmt-badge--jpg {
  background: #fef3c7;
  color: #92400e;
  border: 1.5px solid #fde68a;
}
.ic-fmt-badge--png {
  background: #dbeafe;
  color: #1e40af;
  border: 1.5px solid #bfdbfe;
}
.ic-fmt-badge--webp {
  background: #d1fae5;
  color: #065f46;
  border: 1.5px solid #a7f3d0;
}

.ic-fmt-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.ic-fmt-badge--jpg  .ic-fmt-badge-dot { background: #f59e0b; }
.ic-fmt-badge--png  .ic-fmt-badge-dot { background: #3b82f6; }
.ic-fmt-badge--webp .ic-fmt-badge-dot { background: #10b981; }

/* Browse button */
.ic-browse-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 28px;
  font-size: .92rem;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background .15s, transform .15s, box-shadow .15s;
  white-space: nowrap;
  margin-top: 6px;
}
.ic-browse-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(30,136,229,.35);
}
.ic-browse-btn:active { transform: translateY(0); }

.ic-dz-notice {
  font-size: .76rem;
  color: var(--text-muted);
  margin: 0;
}

/* Uploaded thumbnails strip (Page 1 after files added) */
.ic-thumbstrip {
  display: none;
  flex-direction: column;
  gap: 14px;
}
.ic-thumbstrip--visible { display: flex; }

.ic-thumbstrip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.ic-thumbstrip-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Sora', sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ic-file-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  font-family: 'Sora', sans-serif;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.ic-thumbstrip-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Thumbnail grid */
.ic-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.ic-thumb-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  aspect-ratio: 1;
  cursor: grab;
  transition: box-shadow .2s, transform .2s;
}
.ic-thumb-item:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  transform: scale(1.03);
}
.ic-thumb-item.ic-drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,136,229,.2);
}
.ic-thumb-item.ic-dragging {
  opacity: .5;
  cursor: grabbing;
}

.ic-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.ic-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,.65);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  opacity: 0;
  transition: opacity .15s;
  z-index: 2;
}
.ic-thumb-item:hover .ic-thumb-remove { opacity: 1; }

.ic-thumb-drag-handle {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.8);
  font-size: 10px;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
  white-space: nowrap;
  font-family: 'DM Sans', sans-serif;
  font-size: .65rem;
  font-weight: 600;
  background: rgba(0,0,0,.5);
  padding: 2px 6px;
  border-radius: 4px;
}
.ic-thumb-item:hover .ic-thumb-drag-handle { opacity: 1; }

/* Upload page footer */
.ic-upload-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 20px 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.ic-upload-footer-info {
  font-size: .82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ================================================================
   PAGE 2 — SETTINGS
================================================================ */
.ic-settings-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 520px;
}

.ic-settings-panel {
  padding: 24px 24px 28px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--surface-2);
  overflow-y: auto;
  max-height: 680px;
}

.ic-settings-title {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  font-family: 'Sora', sans-serif;
  margin-bottom: 2px;
}

/* Format selector */
.ic-format-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ic-fmt-selector {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.ic-fmt-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all .15s;
  border-right: 1.5px solid var(--border);
}
.ic-fmt-btn:last-child { border-right: none; }
.ic-fmt-btn:not(.ic-fmt-btn--active):hover { background: #f8fafc; color: var(--text-primary); }
.ic-fmt-btn--active {
  background: var(--primary);
  color: #fff;
}

.ic-fmt-btn-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-bottom: 2px;
}
.ic-fmt-btn[data-fmt="jpeg"]  .ic-fmt-btn-dot { background: #f59e0b; }
.ic-fmt-btn[data-fmt="png"]   .ic-fmt-btn-dot { background: #3b82f6; }
.ic-fmt-btn[data-fmt="webp"]  .ic-fmt-btn-dot { background: #10b981; }
.ic-fmt-btn--active .ic-fmt-btn-dot { background: rgba(255,255,255,.8); }

.ic-fmt-hint {
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.4;
  padding: 6px 10px;
  background: var(--primary-light);
  border-radius: 7px;
  min-height: 36px;
}

/* Quality slider */
.ic-quality-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ic-quality-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ic-quality-badge {
  font-size: .8rem;
  font-weight: 800;
  font-family: 'Sora', sans-serif;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 10px;
  border-radius: 20px;
  min-width: 48px;
  text-align: center;
}

.ic-range-wrap {
  position: relative;
  padding: 4px 0;
}

.ic-range {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  accent-color: var(--primary);
  cursor: pointer;
  display: block;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(to right, var(--primary) var(--range-pct, 80%), var(--border) var(--range-pct, 80%));
  transition: background .1s;
}

.ic-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--primary);
  box-shadow: 0 2px 8px rgba(30,136,229,.3);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.ic-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(30,136,229,.4);
}

.ic-range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
}

.ic-range-label {
  font-size: .7rem;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
}

/* Quality presets */
.ic-quality-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ic-q-preset {
  flex: 1;
  min-width: 0;
  padding: 5px 4px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  background: #fff;
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}
.ic-q-preset:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.ic-q-preset--active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* Max width select */
.ic-select-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ic-select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: .88rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-primary);
  background: #fff;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239AA3B2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  transition: border-color .15s;
}
.ic-select:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }

/* Divider */
.ic-divider {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

/* Settings label */
.ic-set-lbl {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
}

/* ================================================================
   PAGE 2 — PREVIEW CARDS PANEL
================================================================ */
.ic-preview-panel {
  display: flex;
  flex-direction: column;
  background: #fafbfc;
  max-height: 680px;
  overflow: hidden;
}

.ic-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 8px;
}

.ic-preview-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Sora', sans-serif;
}

.ic-preview-cards {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Preview card */
.ic-pcard {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  transition: box-shadow .15s, border-color .15s;
  cursor: grab;
}
.ic-pcard:hover { box-shadow: var(--shadow-sm); border-color: #c7d9f0; }
.ic-pcard.ic-dragging { opacity: .5; cursor: grabbing; }
.ic-pcard.ic-drag-over { border-color: var(--primary); background: #eff6ff; }

.ic-pcard-drag {
  color: var(--text-muted);
  cursor: grab;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px 2px;
}
.ic-pcard-drag span {
  display: block;
  width: 14px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.ic-pcard-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ic-pcard-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ic-pcard-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ic-pcard-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ic-pcard-sizes {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
}

.ic-pcard-orig { color: var(--text-muted); text-decoration: line-through; }
.ic-pcard-arrow { color: var(--text-muted); font-size: .65rem; }
.ic-pcard-est {
  color: #10b981;
  font-weight: 700;
  font-family: 'Sora', sans-serif;
}

.ic-pcard-est-badge {
  font-size: .68rem;
  font-weight: 700;
  background: #ecfdf5;
  color: #059669;
  padding: 1px 6px;
  border-radius: 20px;
  font-family: 'Sora', sans-serif;
}

.ic-pcard-del {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 7px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: all .15s;
}
.ic-pcard-del:hover { background: #fef2f2; color: #dc2626; border-color: #fca5a5; }

/* Settings footer */
.ic-settings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: #fff;
  flex-wrap: wrap;
  gap: 12px;
  flex-shrink: 0;
}

.ic-settings-footer-info {
  font-size: .82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ================================================================
   PROGRESS BAR
================================================================ */
.ic-progress-wrap {
  padding: 14px 20px;
  background: var(--primary-light);
  border-top: 1px solid var(--border);
  display: none;
}
.ic-progress-wrap--visible { display: block; }

.ic-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ic-progress-label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--primary);
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ic-progress-pct {
  font-size: .8rem;
  font-weight: 800;
  color: var(--primary);
  font-family: 'Sora', sans-serif;
}

.ic-progress-bar-track {
  height: 8px;
  background: rgba(30,136,229,.15);
  border-radius: 4px;
  overflow: hidden;
}

.ic-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  border-radius: 4px;
  width: 0%;
  transition: width .3s ease;
  position: relative;
  overflow: hidden;
}

.ic-progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.4) 50%, transparent 100%);
  animation: icShimmer 1.2s infinite;
}

@keyframes icShimmer {
  0%   { transform: translateX(-50%); }
  100% { transform: translateX(100%); }
}

/* Compress spinner (per card) */
.ic-spin {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: icspin .65s linear infinite;
  flex-shrink: 0;
}

@keyframes icspin { to { transform: rotate(360deg); } }

/* ================================================================
   PAGE 3 — RESULTS
================================================================ */
.ic-results-body {
  padding: 24px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Summary card */
.ic-summary-card {
  background: linear-gradient(135deg, #1e3a5f 0%, #1e5fa1 100%);
  border-radius: 16px;
  padding: 24px 28px;
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr 1px 1fr;
  gap: 0;
  align-items: center;
  color: #fff;
  box-shadow: 0 8px 32px rgba(30,136,229,.4);
  position: relative;
  overflow: hidden;
}

.ic-summary-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 70%);
  pointer-events: none;
}

.ic-summary-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,.2);
  justify-self: center;
}

.ic-summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  text-align: center;
}

.ic-summary-value {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: 'Sora', sans-serif;
  line-height: 1.1;
  color: #fff;
}

.ic-summary-value--green { color: #6ee7b7; }
.ic-summary-value--yellow { color: #fde68a; }

.ic-summary-label {
  font-size: .72rem;
  font-weight: 600;
  color: rgba(255,255,255,.65);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-family: 'DM Sans', sans-serif;
}

/* Before/After slider */
.ic-ba-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ic-ba-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.ic-ba-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Sora', sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ic-ba-img-select {
  font-size: .8rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  cursor: pointer;
  max-width: 220px;
}

.ic-ba-container {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  min-height: 200px;
  max-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.ic-ba-before,
.ic-ba-after {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ic-ba-before img,
.ic-ba-after img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.ic-ba-after {
  clip-path: inset(0 50% 0 0);
  transition: clip-path 0s;
}

.ic-ba-divider-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 8px rgba(0,0,0,.4);
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
}

.ic-ba-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ew-resize;
  border: 3px solid var(--primary);
  color: var(--primary);
}

.ic-ba-label {
  position: absolute;
  top: 12px;
  font-size: .7rem;
  font-weight: 800;
  font-family: 'Sora', sans-serif;
  padding: 4px 10px;
  border-radius: 6px;
  z-index: 5;
  pointer-events: none;
}
.ic-ba-label--before {
  left: 12px;
  background: rgba(0,0,0,.55);
  color: #fff;
}
.ic-ba-label--after {
  right: 12px;
  background: rgba(30,136,229,.85);
  color: #fff;
}

.ic-ba-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: .85rem;
  font-family: 'DM Sans', sans-serif;
  padding: 40px;
}

/* Result cards grid */
.ic-result-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ic-result-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.ic-result-section-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Sora', sans-serif;
}

.ic-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.ic-rcard {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, border-color .2s, transform .2s;
}
.ic-rcard:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.09);
  border-color: #c7d9f0;
  transform: translateY(-2px);
}

.ic-rcard-thumb {
  position: relative;
  height: 140px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.ic-rcard-thumb img {
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
  display: block;
}

.ic-rcard-pct {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #10b981;
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  font-family: 'Sora', sans-serif;
  padding: 3px 8px;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(16,185,129,.35);
}

.ic-rcard-pct--warn {
  background: #f59e0b;
}

.ic-rcard-preview-btn {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: .68rem;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  padding: 4px 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
  white-space: nowrap;
}
.ic-rcard:hover .ic-rcard-preview-btn { opacity: 1; }

.ic-rcard-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.ic-rcard-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ic-rcard-sizes {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  flex-wrap: wrap;
}

.ic-rcard-orig { color: var(--text-muted); text-decoration: line-through; }
.ic-rcard-arrow { color: var(--text-muted); }
.ic-rcard-comp { color: #10b981; font-weight: 700; font-family: 'Sora', sans-serif; }

.ic-rcard-dl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1.5px solid #bfdbfe;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all .15s;
  margin-top: 4px;
}
.ic-rcard-dl-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(30,136,229,.3);
}

/* Results footer */
.ic-results-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 20px 20px;
  flex-wrap: wrap;
  gap: 12px;
}

/* ================================================================
   SHARED BUTTONS
================================================================ */
.ic-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 24px;
  font-size: .88rem;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.ic-btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(30,136,229,.35);
}
.ic-btn-primary:active { transform: translateY(0); }
.ic-btn-primary:disabled { background: var(--text-muted); cursor: not-allowed; transform: none; box-shadow: none; }

.ic-btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 24px;
  font-size: .88rem;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.ic-btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16,185,129,.35);
}

.ic-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #fff;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: .85rem;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.ic-btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.ic-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #fff;
  color: #dc2626;
  border: 1.5px solid #fca5a5;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: .85rem;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.ic-btn-danger:hover { background: #fef2f2; }

.ic-btn-sm {
  padding: 7px 14px;
  font-size: .78rem;
  border-radius: 8px;
}

/* ================================================================
   EMPTY STATE
================================================================ */
.ic-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 24px;
  color: var(--text-muted);
  text-align: center;
  font-family: 'DM Sans', sans-serif;
}

.ic-empty-icon {
  width: 56px;
  height: 56px;
  background: var(--surface-2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.ic-empty-title {
  font-size: .92rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.ic-empty-sub {
  font-size: .8rem;
  color: var(--text-muted);
  max-width: 240px;
  line-height: 1.5;
}

/* ================================================================
   TOAST NOTIFICATION
================================================================ */
.ic-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1a1f2e;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(8px);
  opacity: 0;
  transition: all .25s ease;
  max-width: 360px;
}
.ic-toast--visible {
  transform: translateY(0);
  opacity: 1;
}
.ic-toast--success { border-left: 4px solid #10b981; }
.ic-toast--error   { border-left: 4px solid #ef4444; }
.ic-toast--info    { border-left: 4px solid var(--primary); }

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 900px) {
  .ic-settings-layout {
    grid-template-columns: 1fr;
  }
  .ic-settings-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: none;
  }
  .ic-preview-panel { max-height: none; }
  .ic-summary-card {
    grid-template-columns: 1fr 1px 1fr;
    grid-template-rows: auto auto;
    row-gap: 16px;
  }
  .ic-summary-card > .ic-summary-divider:nth-child(6),
  .ic-summary-card > .ic-summary-divider:nth-child(4) { display: none; }
}

@media (max-width: 640px) {
  .ic-stepper { padding: 16px 12px; gap: 0; }
  .ic-step-label { display: none; }
  .ic-step-sep { max-width: 40px; }
  .ic-upload-body { padding: 20px 16px; }
  .ic-dz { padding: 36px 16px 32px; }
  .ic-thumb-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
  .ic-results-body { padding: 16px; }
  .ic-summary-card {
    grid-template-columns: 1fr 1px 1fr;
    padding: 18px 14px;
  }
  .ic-summary-value { font-size: 1.25rem; }
  .ic-result-grid { grid-template-columns: 1fr 1fr; }
  .ic-results-footer { flex-direction: column; align-items: stretch; }
  .ic-results-footer .ic-btn-success,
  .ic-results-footer .ic-btn-ghost { width: 100%; justify-content: center; }
  .ic-ba-container { min-height: 160px; }
  .ic-settings-footer { flex-direction: column; align-items: stretch; }
  .ic-settings-footer .ic-btn-primary { width: 100%; justify-content: center; }
  .ic-upload-footer { flex-direction: column; align-items: stretch; }
  .ic-upload-footer .ic-btn-primary { width: 100%; justify-content: center; }
}

@media (max-width: 400px) {
  .ic-result-grid { grid-template-columns: 1fr; }
  .ic-summary-card { grid-template-columns: 1fr; }
  .ic-summary-divider { display: none; }
}
