/* ============================================================
   Resize Image Tool — style.css
   Classes  : ri-resize-*
   Approach : Mobile-first (base = mobile, @media min-width = desktop)
   Brand    : #42B5A4 (teal) — same system as Circle Crop tool
   ============================================================ */


/* ══════════════════════════════════════════
   0. BASE / RESET / BRAND TOKENS
   ══════════════════════════════════════════ */
html, body {
  overflow-x: hidden; /* safety net: the real fix is min-width:0 on grid
                          items below, this just guards against any
                          residual sub-pixel/scrollbar reflow rounding */
  max-width: 100%;
}

.ri-resize-wrap,
.ri-resize-wrap * {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.ri-resize-wrap {
  /* ── Brand color — single source of truth, never hardcoded elsewhere ── */
  --ri-brand: #42B5A4;
  --ri-brand-dark: #2E8577;
  --ri-brand-soft: #E8F8F6;

  --ri-ink: #1a1a22;
  --ri-ink-soft: #55555f;
  --ri-line: #e4e4ee;
  --ri-line-strong: #c4c4d4;
  --ri-bg: #f5f5fa;
  --ri-error: #c0392b;
  --ri-error-soft: #fbebe9;

  font-family: var(--font-primary);
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 16px 56px;
  touch-action: manipulation;
  overscroll-behavior-y: contain;
}


/* ══════════════════════════════════════════
   1. HEADER
   ══════════════════════════════════════════ */
.ri-resize-header {
  text-align: center;
  margin-bottom: 24px;
}

.ri-resize-header__title {
  font-weight: 800;
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  letter-spacing: -0.8px;
  color: var(--ri-ink);
  margin: 0 0 8px;
}

.ri-resize-header__title strong {
  font-weight: 900;
  color: var(--ri-brand);
}

.ri-resize-header__subtitle {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ri-ink-soft);
  line-height: 1.6;
  margin: 0;
}

.ri-resize-header__subtitle a {
  color: var(--ri-brand-dark);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ri-resize-header__subtitle a:hover,
.ri-resize-header__subtitle a:focus-visible {
  color: var(--ri-brand);
}

.ri-resize-header__note {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ri-ink-soft);
  opacity: 0.85;
  line-height: 1.5;
  margin: 8px 0 0;
}


/* ══════════════════════════════════════════
   2. STEPPER
   ══════════════════════════════════════════ */
.ri-resize-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 28px;
}

.ri-resize-stepper__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.ri-resize-stepper__dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #9999a2;
  background: #fff;
  border: 1.5px solid var(--ri-line);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ri-resize-stepper__step.is-active .ri-resize-stepper__dot {
  background: var(--ri-brand);
  border-color: var(--ri-brand);
  color: #fff;
}

.ri-resize-stepper__step.is-done .ri-resize-stepper__dot {
  background: var(--ri-brand-soft);
  border-color: var(--ri-brand);
  color: var(--ri-brand);
}

.ri-resize-stepper__dot--export {
  width: auto;
  border-radius: 9999px;
  padding: 0 16px;
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.ri-resize-stepper__label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ri-ink-soft);
}

.ri-resize-stepper__line {
  width: 28px;
  height: 2px;
  background: var(--ri-line);
  margin-top: -18px;
}


/* ══════════════════════════════════════════
   3. PANELS
   ══════════════════════════════════════════ */
.ri-resize-panel {
  display: none;
}

.ri-resize-panel.is-active {
  display: block;
  animation: riFadeIn 0.28s ease both;
}

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


/* ══════════════════════════════════════════
   4. STEP 1 — UPLOAD DROPZONE
   ══════════════════════════════════════════ */
.ri-resize-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 480px;
  margin: 8px auto 0;
  padding: 40px 24px;
  border-radius: 24px;
  cursor: pointer;
}

.ri-resize-dropzone__ring {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  border: 1.5px dashed transparent;
  box-shadow: 0 0 0 0 rgba(66, 181, 164, 0);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
  pointer-events: none;
}

.ri-resize-dropzone.is-dragover .ri-resize-dropzone__ring {
  border-color: rgba(66, 181, 164, 0.45);
  box-shadow: 0 0 0 8px rgba(66, 181, 164, 0.08);
}

.ri-resize-dropzone__button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 32px;
  border-radius: 9999px;
  background: var(--ri-brand);
  border: 1.5px solid var(--ri-brand);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.1px;
  box-shadow: 0 2px 10px rgba(66,181,164,0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.ri-resize-dropzone__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #fff;
}

.ri-resize-dropzone:hover .ri-resize-dropzone__button {
  transform: translateY(-2px);
  background: var(--ri-brand-dark);
  border-color: var(--ri-brand-dark);
  box-shadow: 0 14px 32px rgba(66,181,164,0.28);
}

.ri-resize-dropzone:active .ri-resize-dropzone__button {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 6px 16px rgba(66,181,164,0.24);
}

.ri-resize-dropzone:focus-visible {
  outline: none;
}

.ri-resize-dropzone:focus-visible .ri-resize-dropzone__button {
  box-shadow: 0 0 0 4px var(--ri-brand-soft), 0 8px 24px rgba(66,181,164,0.28);
}

.ri-resize-dropzone.is-dragover .ri-resize-dropzone__button {
  transform: translateY(-2px);
  background: var(--ri-brand-dark);
  border-color: var(--ri-brand-dark);
  box-shadow: 0 14px 32px rgba(66,181,164,0.32);
}

.ri-resize-dropzone__divider {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 320px;
  margin-top: 28px;
  color: #a3a3ae;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.ri-resize-dropzone__divider::before,
.ri-resize-dropzone__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--ri-line-strong));
}

.ri-resize-dropzone__divider::after {
  background: linear-gradient(to left, transparent, var(--ri-line-strong));
}

.ri-resize-dropzone__hint {
  margin: 16px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #a3a3ae;
  text-align: center;
  line-height: 1.5;
}

.ri-resize-dropzone__trust {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 16px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ri-ink-soft);
}

.ri-resize-dropzone__trust svg {
  width: 15px;
  height: 15px;
  color: var(--ri-brand);
  flex-shrink: 0;
}


/* ══════════════════════════════════════════
   5. STEP 2 — TOOLBAR
   ══════════════════════════════════════════ */
.ri-resize-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.ri-resize-toolbar__count {
  font-size: 13px;
  font-weight: 700;
  color: var(--ri-ink-soft);
}

.ri-resize-toolbar__actions {
  display: flex;
  gap: 8px;
}

.ri-resize-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 9999px;
  border: 1.5px solid var(--ri-line);
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--ri-ink-soft);
  cursor: pointer;
  touch-action: manipulation;
}

.ri-resize-chip svg {
  width: 16px;
  height: 16px;
}

.ri-resize-chip:active {
  background: var(--ri-bg);
}

.ri-resize-chip--danger {
  color: var(--ri-error);
}

.ri-resize-chip--danger:active {
  background: var(--ri-error-soft);
}


/* ══════════════════════════════════════════
   6. STEP 2 — IMAGE GRID + CARD
   ══════════════════════════════════════════ */
.ri-resize-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

@media (min-width: 480px) {
  .ri-resize-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

.ri-resize-card {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--ri-line);
  border-radius: 16px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0; /* critical: grid items default to min-width:auto, which
                   refuses to shrink below content size and silently pushes
                   the whole grid (and page) wider than the viewport */
}

.ri-resize-card.is-dragging {
  opacity: 0.4;
}

.ri-resize-card__drag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.92);
  color: var(--ri-ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  box-shadow: 0 1px 4px rgba(26,26,34,0.15);
}

.ri-resize-card__drag svg {
  width: 15px;
  height: 15px;
}

.ri-resize-card__remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.92);
  color: var(--ri-error);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(26,26,34,0.15);
}

.ri-resize-card__remove svg {
  width: 14px;
  height: 14px;
}

.ri-resize-card__thumbwrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background:
    linear-gradient(45deg, #e9e9ef 25%, transparent 25%) -10px 0/ 16px 16px,
    linear-gradient(-45deg, #e9e9ef 25%, transparent 25%) -10px 0/ 16px 16px,
    linear-gradient(45deg, transparent 75%, #e9e9ef 75%) -10px 0/ 16px 16px,
    linear-gradient(-45deg, transparent 75%, #e9e9ef 75%) -10px 0/ 16px 16px,
    #fafafd;
}

.ri-resize-card__thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ri-resize-card__custom-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  padding: 3px 9px;
  border-radius: 9999px;
  background: var(--ri-brand);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.ri-resize-card__custom-badge.is-hidden {
  display: none;
}

.ri-resize-card__transform {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.ri-resize-iconbtn {
  flex: 1;
  height: 32px;
  border-radius: 9px;
  border: 1.5px solid var(--ri-line);
  background: #fff;
  color: var(--ri-ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
}

.ri-resize-iconbtn svg {
  width: 15px;
  height: 15px;
}

.ri-resize-iconbtn:active {
  background: var(--ri-bg);
}

.ri-resize-card__meta {
  min-width: 0;
}

.ri-resize-card__name {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ri-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ri-resize-card__info {
  margin: 2px 0 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ri-ink-soft);
}

.ri-resize-card__customize {
  height: 32px;
  border-radius: 9999px;
  border: 1.5px dashed var(--ri-line-strong);
  background: transparent;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ri-ink-soft);
  cursor: pointer;
}

.ri-resize-card__customize.is-active {
  border-style: solid;
  border-color: var(--ri-brand);
  color: var(--ri-brand);
  background: var(--ri-brand-soft);
}


/* ══════════════════════════════════════════
   7. STEP 2 — GLOBAL SETTINGS
   ══════════════════════════════════════════ */
.ri-resize-settings {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  border-radius: 18px;
  background: var(--ri-bg);
  margin-bottom: 20px;
}

.ri-resize-settings__row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ri-resize-settings__row.is-hidden {
  display: none;
}

.ri-resize-settings__row--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.ri-resize-settings__row--toggle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.ri-resize-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 9999px;
  background: var(--ri-brand-soft);
  color: var(--ri-brand-dark);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-left: 6px;
}

.ri-resize-switch {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  flex-shrink: 0;
}

.ri-resize-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.ri-resize-switch__track {
  width: 44px;
  height: 26px;
  border-radius: 9999px;
  background: var(--ri-line-strong);
  display: block;
  position: relative;
  transition: background 0.2s ease;
}

.ri-resize-switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.24);
  transition: transform 0.2s ease;
}

.ri-resize-switch input:checked + .ri-resize-switch__track {
  background: var(--ri-brand);
}

.ri-resize-switch input:checked + .ri-resize-switch__track .ri-resize-switch__thumb {
  transform: translateX(18px);
}

.ri-resize-settings__col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.ri-resize-settings__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ri-ink);
}

.ri-resize-settings__val {
  font-weight: 700;
  color: var(--ri-brand);
  margin-left: 4px;
}

.ri-resize-settings__note {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--ri-ink-soft);
  line-height: 1.5;
}

.ri-resize-settings__note strong {
  color: var(--ri-brand-dark);
}

/* ── Segmented tabs (resize-by / quality) ── */
.ri-resize-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ri-resize-tabs__btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 9999px;
  border: 1.5px solid var(--ri-line);
  background: #fff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ri-ink-soft);
  cursor: pointer;
  touch-action: manipulation;
}

.ri-resize-tabs__btn.is-active {
  border-color: var(--ri-brand);
  color: var(--ri-brand);
  background: var(--ri-brand-soft);
}

/* ── Slider (percentage) ── */
.ri-resize-slider {
  width: 100%;
  height: 40px;
  accent-color: var(--ri-brand);
  touch-action: manipulation;
}

/* ── Number inputs ── */
.ri-resize-input {
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--ri-line);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ri-ink);
  width: 100%;
}

.ri-resize-input:focus-visible {
  outline: none;
  border-color: var(--ri-brand);
}

/* ── Resize by: Pixels / Percentage tabs (iLoveIMG-style, simplified) ── */
.ri-resize-resizeby {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1.5px solid var(--ri-line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.ri-resize-resizeby__tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 10px;
  background: #fff;
  border: none;
  border-right: 1.5px solid var(--ri-line);
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.ri-resize-resizeby__tab:last-child {
  border-right: none;
}

.ri-resize-resizeby__check {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ri-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.ri-resize-resizeby__check svg {
  width: 13px;
  height: 13px;
}

.ri-resize-resizeby__tab.is-active .ri-resize-resizeby__check {
  opacity: 1;
  transform: scale(1);
}

.ri-resize-resizeby__icon {
  width: 32px;
  height: 32px;
  color: #c4c4d4;
}

.ri-resize-resizeby__tab.is-active .ri-resize-resizeby__icon {
  color: var(--ri-brand-dark);
}

.ri-resize-resizeby__label {
  font-size: 13px;
  font-weight: 700;
  color: #a3a3ae;
}

.ri-resize-resizeby__tab.is-active .ri-resize-resizeby__label {
  color: var(--ri-ink);
}

/* ── By pixels panel ── */
.ri-resize-bypixels {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ri-resize-bypixels.is-hidden {
  display: none;
}

.ri-resize-bypixels__label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ri-ink-soft);
}

.ri-resize-bypixels__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ri-resize-bypixels__row label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ri-ink);
}

.ri-resize-bypixels__row .ri-resize-input {
  max-width: 130px;
  text-align: right;
}

.ri-resize-checkrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ri-line);
  font-size: 13px;
  font-weight: 600;
  color: var(--ri-ink);
  cursor: pointer;
  touch-action: manipulation;
}

.ri-resize-checkrow input[type="checkbox"] {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  accent-color: var(--ri-brand);
  cursor: pointer;
}

.ri-resize-checkrow__hint {
  font-weight: 500;
  color: var(--ri-ink-soft);
}

/* ── By percentage panel ── */
.ri-resize-bypercent {
  display: flex;
  flex-direction: column;
}

.ri-resize-bypercent.is-hidden {
  display: none;
}

.ri-resize-quickpct {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 10px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--ri-line);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--ri-brand-dark);
  cursor: pointer;
  border-radius: 10px;
  touch-action: manipulation;
}

.ri-resize-quickpct.is-active {
  background: var(--ri-brand-soft);
}

.ri-resize-quickpct__badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ri-brand);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ri-resize-quickpct__badge svg {
  width: 13px;
  height: 13px;
}

.ri-resize-quickpct.is-active .ri-resize-quickpct__badge {
  display: flex;
}

.ri-resize-pctslider-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 14px;
  margin-top: 8px;
  border-top: 1px solid var(--ri-line);
}

.ri-resize-pctslider-row__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ri-ink-soft);
}

.ri-resize-pctslider-row__control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ri-resize-pctslider-row__control input[type="range"] {
  flex: 1;
  height: 40px;
  accent-color: var(--ri-brand);
  touch-action: manipulation;
}

.ri-resize-pctslider-row__control span {
  min-width: 46px;
  text-align: right;
  font-weight: 700;
  color: var(--ri-brand);
}

/* ── Select dropdowns ── */
.ri-resize-select {
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--ri-line);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ri-ink);
  width: 100%;
}

/* ── Presets ── */
.ri-resize-presets {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.ri-resize-presets[hidden] {
  display: none;
}

.ri-resize-presets::-webkit-scrollbar {
  height: 4px;
}

.ri-resize-presets::-webkit-scrollbar-thumb {
  background: var(--ri-line-strong);
  border-radius: 9999px;
}

.ri-resize-preset {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--ri-line);
  background: #fff;
  cursor: pointer;
  touch-action: manipulation;
}

.ri-resize-preset.is-active {
  border-color: var(--ri-brand);
  background: var(--ri-brand-soft);
}

.ri-resize-preset__name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ri-ink);
  white-space: nowrap;
}

.ri-resize-preset__dims {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ri-ink-soft);
  white-space: nowrap;
}


/* ══════════════════════════════════════════
   8. STEP 3 — EXPORT
   ══════════════════════════════════════════ */
.ri-resize-progress {
  margin-bottom: 20px;
}

.ri-resize-progress[aria-hidden="true"] {
  display: none;
}

.ri-resize-progress__bar {
  height: 8px;
  border-radius: 9999px;
  background: var(--ri-line);
  overflow: hidden;
  position: relative;
}

.ri-resize-progress__bar::after {
  content: '';
  position: absolute;
  inset: 0;
  width: var(--ri-progress, 0%);
  background: var(--ri-brand);
  border-radius: 9999px;
  transition: width 0.2s ease;
}

.ri-resize-progress__label {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ri-ink-soft);
  text-align: center;
}

.ri-resize-summary {
  text-align: center;
  margin-bottom: 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ri-ink-soft);
}

.ri-resize-summary strong {
  color: var(--ri-brand-dark);
}

.ri-resize-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.ri-resize-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 14px;
  border: 1.5px solid var(--ri-line);
  background: #fff;
}

.ri-resize-result__thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--ri-bg);
}

.ri-resize-result__meta {
  flex: 1;
  min-width: 0;
}

.ri-resize-result__name {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ri-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ri-resize-result__info {
  margin: 2px 0 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ri-ink-soft);
}

.ri-resize-result__download {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--ri-line);
  background: #fff;
  color: var(--ri-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ri-resize-result__download svg {
  width: 17px;
  height: 17px;
}


/* ══════════════════════════════════════════
   9. ACTION BUTTONS
   ══════════════════════════════════════════ */
.ri-resize-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.ri-resize-btn {
  flex: 1;
  height: 48px;
  border-radius: 9999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  border: 1.5px solid transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.ri-resize-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ri-resize-btn--primary {
  background: var(--ri-brand);
  color: #fff;
  box-shadow: 0 2px 10px rgba(66,181,164,0.28);
}

.ri-resize-btn--primary:active {
  transform: scale(0.98);
}

.ri-resize-btn--ghost {
  background: #fff;
  border-color: var(--ri-line);
  color: var(--ri-ink);
}

.ri-resize-btn--ghost:active {
  background: var(--ri-bg);
}


/* ══════════════════════════════════════════
   10. TOAST
   ══════════════════════════════════════════ */
.ri-resize-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--ri-ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: 9999px;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  max-width: 90vw;
  text-align: center;
}

.ri-resize-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.ri-resize-toast.is-error {
  background: var(--ri-error);
}


/* ══════════════════════════════════════════
   11. DESKTOP ENHANCEMENTS (≥768px)
   ══════════════════════════════════════════ */
@media (min-width: 768px) {
  .ri-resize-wrap {
    padding: 40px 24px 72px;
  }

  .ri-resize-header__subtitle {
    font-size: 16px;
  }

  .ri-resize-stepper {
    gap: 10px;
    margin-bottom: 36px;
  }

  .ri-resize-stepper__line {
    width: 56px;
  }

  .ri-resize-dropzone {
    max-width: 520px;
    padding: 56px 24px;
  }

  .ri-resize-dropzone__button {
    height: 60px;
    padding: 0 36px;
    font-size: 16.5px;
  }

  .ri-resize-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
  }

  .ri-resize-settings {
    padding: 24px;
  }

  .ri-resize-chip:hover {
    border-color: var(--ri-brand);
    color: var(--ri-brand);
  }

  .ri-resize-chip--danger:hover {
    border-color: var(--ri-error);
    color: var(--ri-error);
  }

  .ri-resize-tabs__btn:hover {
    border-color: var(--ri-brand);
    color: var(--ri-brand);
  }

  .ri-resize-preset:hover {
    border-color: var(--ri-brand);
  }

  .ri-resize-iconbtn:hover {
    border-color: var(--ri-brand);
    color: var(--ri-brand);
  }

  .ri-resize-result__download:hover {
    border-color: var(--ri-brand);
  }

  .ri-resize-btn--ghost:hover {
    border-color: var(--ri-ink);
  }

  .ri-resize-btn--primary:hover {
    box-shadow: 0 4px 16px rgba(66,181,164,0.36);
  }

  .ri-resize-actions {
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }
}


/* ══════════════════════════════════════════
   12. ACCESSIBILITY
   ══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .ri-resize-panel.is-active {
    animation: none;
  }

  .ri-resize-dropzone__button {
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
  }

  .ri-resize-dropzone:hover .ri-resize-dropzone__button,
  .ri-resize-dropzone:active .ri-resize-dropzone__button,
  .ri-resize-dropzone.is-dragover .ri-resize-dropzone__button {
    transform: none;
  }
}
