/* Resize page. The page reuses /compress/compress-page.css (same workspace, gallery, tabs,
   chips, buttons and result cards); only Resize-specific parts live here. */

/* ===== Size chips: four per row, size on top, use below ===== */
.resize-settings .rz-size-presets {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.resize-settings .rz-size-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 50px;
  padding: 6px 4px;
  border-radius: 14px;
  line-height: 1.15;
}
.resize-settings .rz-size-chip b { font-size: 14px; font-weight: 800; white-space: nowrap; }
.resize-settings .rz-size-chip small { font-size: 11px; font-weight: 600; color: #5d6878; white-space: nowrap; }
.resize-settings .rz-size-chip.active small { color: rgba(255, 255, 255, .92); }

/* ===== Custom width × height ===== */
.resize-settings .rz-custom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 4px;
}
.resize-settings .rz-dim { grid-column: auto; flex: 0 1 auto; }
.resize-settings .rz-dim input { width: 92px !important; font-weight: 800 !important; font-size: 17px !important; text-align: center; }
.resize-settings .rz-swap {
  width: 40px; height: 40px; flex: 0 0 40px;
  border: 1px solid #dfe5f1; border-radius: 50%;
  background: #fff; color: #315cf5; font: 800 17px/1 Roboto, system-ui, sans-serif; cursor: pointer;
}
.resize-settings .rz-swap:hover:not(:disabled) { background: #edf2ff; }
.resize-settings .rz-unit { color: #5d6878; font-size: 13px; font-weight: 700; }
.resize-settings .rz-size-error { margin: 6px 0 0; text-align: center; color: #b42335; font-size: 13px; font-weight: 700; }
.resize-settings .setting-hint { font-size: 12.5px; line-height: 1.45; color: #5d6878; text-align: center; margin: 10px 0 0; }

/* ===== Crop / Fit tabs with the round "?" at the right end (same height as the tabs) ===== */
.resize-settings .rz-mode-row { display: flex; align-items: stretch; justify-content: center; gap: 8px; margin: 0 auto 18px; }
.resize-settings .rz-mode-row .mode-switch { flex: 0 1 374px; min-width: 0; width: auto; margin: 0; }
/* Same height as the tab row (stretch); width matches it so it stays round. */
.resize-settings .rz-help-btn {
  flex: 0 0 52px; width: 52px; height: auto; padding: 0;
  border: 1px solid #475569; border-radius: 50%; background: #fff;
  color: #315cf5; font: 900 20px/1 Roboto, system-ui, sans-serif; cursor: pointer;
}
.resize-settings .rz-help-btn:hover { background: #edf2ff; }
@media (max-width: 600px) { .resize-settings .rz-help-btn { flex-basis: 50px; width: 50px; } }
.resize-settings .rz-help-btn:focus-visible { outline: 3px solid #315cf5; outline-offset: 2px; }

/* ===== Fit: three background swatches ===== */
.resize-settings .rz-swatches { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 0 0 4px; }
.resize-settings .rz-swatch-btn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 6px 12px;
  border: 1px solid #e4e8f0; border-radius: 999px; background: #f7f8fb;
  color: #344054; font: 700 13px Roboto, system-ui, sans-serif; cursor: pointer;
}
.resize-settings .rz-swatch-btn.active { border-color: #315cf5; box-shadow: 0 0 0 2px #315cf5 inset; color: #1d2947; background: #fff; }
.rz-swatch { width: 18px; height: 18px; flex: 0 0 18px; border-radius: 50%; border: 1px solid #c7cfdd; }
.rz-white { background: #fff; }
.rz-grey { background: #e5e7eb; }
.rz-black { background: #000; border-color: #000; }

/* ===== Big preview inside the Shared Gallery (Resize only: .lp-gallery__main--custom) ===== */
.resize-page [data-lovepdfi-gallery] .lp-gallery__main--custom { display: block; overflow: visible; }
.rz-preview { width: 100%; min-width: 0; }
.rz-preview-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.rz-preview-count { font: 800 14px Roboto, system-ui, sans-serif; color: #1d2947; }
.rz-nav-btn {
  width: 44px; height: 38px; border: 1px solid #dfe5f1; border-radius: 10px; background: #fff;
  color: #315cf5; font: 800 22px/1 Roboto, system-ui, sans-serif; cursor: pointer;
}
.rz-nav-btn:disabled { opacity: .35; cursor: default; }
.rz-preview-box { display: flex; justify-content: center; width: 100%; min-width: 0; }
.rz-stage {
  position: relative; overflow: hidden; border-radius: 8px; line-height: 0;
  background: #eef1f6; touch-action: pan-y;               /* vertical page scroll still works; sideways swipes switch images */
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.rz-stage[hidden] { display: none; }
.rz-stage:not(.is-crop) { box-shadow: 0 0 0 1px #cfd6e2; }   /* shows the edge of a white Fit frame */
.rz-stage-canvas { display: block; }
.rz-frame {
  position: absolute; box-sizing: border-box; z-index: 1;
  border: 2px dashed #fff; outline: 1px solid rgba(15, 23, 42, .55);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, .58);       /* darkens everything outside the frame */
  cursor: move; touch-action: none;                        /* the page does not scroll while dragging */
}
.rz-frame.is-saved { border-style: solid; }
.rz-frame.is-dragging { border-color: #9bb4ff; }
.rz-frame[hidden] { display: none; }
.rz-frame:focus-visible { outline: 3px solid #315cf5; }
.rz-frame::before, .rz-frame::after { content: ""; position: absolute; inset: 0; pointer-events: none; border: 1px solid rgba(255, 255, 255, .35); }
.rz-frame::before { left: 33.33%; right: 33.33%; border-top: 0; border-bottom: 0; }
.rz-frame::after { top: 33.33%; bottom: 33.33%; border-left: 0; border-right: 0; }
.rz-frame-label {
  position: absolute; left: 4px; top: 4px; padding: 3px 6px; border-radius: 6px;
  background: rgba(15, 23, 42, .75); color: #fff; font: 700 11px/1.2 Roboto, system-ui, sans-serif; white-space: nowrap; pointer-events: none;
}
.rz-preview-tools { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; }
.rz-preview-tools[hidden] { display: none; }
.rz-zoom { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-width: 0; font: 700 13px Roboto, system-ui, sans-serif; color: #344054; }
.rz-zoom input { flex: 1 1 auto; min-width: 0; accent-color: #315cf5; }
.rz-zoom-value { flex: 0 0 30px; text-align: right; color: #315cf5; }
.rz-center {
  flex: 0 0 auto; min-height: 36px; padding: 6px 14px; border: 1px solid #dfe5f1; border-radius: 999px;
  background: #fff; color: #315cf5; font: 700 13px Roboto, system-ui, sans-serif; cursor: pointer;
}
.rz-frame-status { margin: 8px 0 0; text-align: center; font: 600 12.5px/1.4 Roboto, system-ui, sans-serif; color: #8a5a00; }
.rz-frame-status.is-saved { color: #16764a; }
.rz-frame-status[hidden] { display: none; }
.rz-preview-note { margin: 6px auto 0; width: fit-content; padding: 4px 10px; border-radius: 999px; background: #fff4e5; color: #8a5a00; font: 700 12px/1.3 Roboto, system-ui, sans-serif; }
.rz-preview-note[hidden] { display: none; }

/* ===== Thumbnail badges ===== */
.resize-page [data-lovepdfi-gallery] .rz-badge {
  position: absolute; left: 3px; right: 3px; bottom: 3px; z-index: 2;
  padding: 2px 3px; border-radius: 5px; background: rgba(15, 23, 42, .78); color: #fff;
  font: 700 9.5px/1.15 Roboto, system-ui, sans-serif; text-align: center; white-space: nowrap; overflow: hidden; pointer-events: none;
}
.resize-page [data-lovepdfi-gallery] .rz-badge b, .resize-page [data-lovepdfi-gallery] .rz-badge span { display: block; overflow: hidden; text-overflow: ellipsis; }
.resize-page [data-lovepdfi-gallery] .rz-badge span { font-weight: 600; font-size: 9px; }
.resize-page [data-lovepdfi-gallery] .rz-badge.is-done { background: rgba(22, 118, 74, .9); }
.resize-page [data-lovepdfi-gallery] .rz-badge.is-missing { background: rgba(180, 83, 9, .9); }

/* ===== Final button summary + popup buttons ===== */
.resize-settings .rz-group-summary { margin: 8px 0 0; text-align: center; font: 700 13px/1.4 Roboto, system-ui, sans-serif; color: #344054; }
.rz-sheet-actions { display: grid; gap: 8px; margin-top: 6px; }
.rz-sheet-btn {
  width: 100%; min-height: 46px; border: 1px solid #c9d3e6; border-radius: 12px; background: #fff;
  color: #1f2a44; font: 800 15px Roboto, system-ui, sans-serif; cursor: pointer;
}
.rz-sheet .lp-sheet-list p { font-size: 14px; }

/* The Resize page has no Full window button: the main button uses the full width. */
.resize-settings .process-actions { display: grid; grid-template-columns: 1fr; }
.resize-settings .process-btn { width: 100%; }

@media (max-width: 420px) {
  .resize-settings .rz-size-presets { gap: 6px; }
  .resize-settings .rz-size-chip { min-height: 46px; padding: 5px 2px; }
  .resize-settings .rz-size-chip b { font-size: 12.5px; }
  .resize-settings .rz-size-chip small { font-size: 10.5px; }
  .resize-settings .rz-dim input { width: 76px !important; font-size: 16px !important; }
  .resize-settings .rz-custom { gap: 5px; }
  .resize-settings .mode-btn { font-size: 14px; }
}
@media (max-width: 370px) {
  .resize-settings .rz-size-presets { gap: 5px; }
  .resize-settings .rz-size-chip b { font-size: 11.5px; letter-spacing: -.2px; }
  .resize-settings .rz-size-chip small { font-size: 10px; }
}
@media (max-width: 340px) {
  .resize-settings .rz-size-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resize-settings .rz-custom .custom-size-label { display: none; }
}

/* Result cards: the file name stays on one line (… when long); the pixel change is the key line. */
.resize-page .compress-result-info strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resize-page .compress-result-info .compress-result-size { font-weight: 800; color: #1d2947; }
