/* Add Watermark page. Reuses /compress/compress-page.css (workspace, gallery frame, buttons, status
   line, results bar and cards); only watermark-specific parts live here. */

/* ===== Big preview inside the Shared Gallery (gallery `preview` extension) ===== */
.wm-page [data-lovepdfi-gallery] .lp-gallery__main--custom { display: block; overflow: visible; }
.wm-preview { width: 100%; min-width: 0; }
.wm-stage {
  position: relative; display: flex; justify-content: center; align-items: center; width: 100%; min-height: 160px;
  line-height: 0; background: #eef1f6; border-radius: 10px;
}
.wm-stage-canvas { display: block; max-width: 100%; }
.wm-stage.is-busy { opacity: .7; }
.wm-stage-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0;
  color: #5d6878; font: 700 13px/1.4 Roboto, system-ui, sans-serif; pointer-events: none;
}
.wm-stage-loading[hidden] { display: none; }
.wm-preview-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 0; }
.wm-preview-nav[hidden] { display: none; }
.wm-preview-count { font: 800 14px Roboto, system-ui, sans-serif; color: #1d2947; }
.wm-nav-btn {
  width: 44px; height: 40px; border: 1px solid #dfe5f1; border-radius: 10px; background: #fff;
  color: #315cf5; font: 800 22px/1 Roboto, system-ui, sans-serif; cursor: pointer;
}
.wm-nav-btn:disabled { opacity: .35; cursor: default; }

/* ===== Settings ===== */
.wm-settings .settings-title { display: flex; margin-bottom: 12px; }
.wm-controls { display: flex; flex-direction: column; gap: 12px; max-width: 640px; margin: 0 auto; }
.wm-controls [hidden] { display: none !important; }
.wm-seg, .wm-positions, .wm-swatches, .wm-shield-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.wm-chip {
  min-height: 42px; padding: 8px 16px; border: 1px solid #d5ddeb; border-radius: 999px; background: #f4f6fb;
  color: #1f2a44; font: 600 14px/1.2 Roboto, system-ui, sans-serif; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.wm-chip:hover { border-color: #9db5ff; }
.wm-chip[aria-pressed="true"] { background: #2f6bf0; border-color: #2f6bf0; color: #fff; box-shadow: 0 4px 12px rgba(47, 107, 240, .25); }
.wm-chip:focus-visible, .wm-swatch:focus-visible { outline: 3px solid rgba(49, 92, 245, .4); outline-offset: 2px; }
.wm-text-row { display: flex; align-items: center; gap: 10px; }
.wm-text {
  flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 10px 14px; border: 1px solid #cfd8e8; border-radius: 12px;
  background: #fff; color: #111a35; font: 500 16px/1.3 Roboto, system-ui, sans-serif;   /* 16 px: no zoom on iPhone */
}
.wm-text:focus { outline: 3px solid rgba(49, 92, 245, .3); border-color: #315cf5; }
.wm-color { display: inline-flex; align-items: center; gap: 8px; font: 600 14px Roboto, system-ui, sans-serif; color: #263451; white-space: nowrap; cursor: pointer; }
.wm-color input { width: 56px; height: 40px; padding: 2px; border: 1px solid #cfd8e8; border-radius: 8px; background: #fff; cursor: pointer; }
.wm-logo-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; text-align: center; }
.wm-logo-name { color: #4b5875; font: 500 13px/1.4 Roboto, system-ui, sans-serif; }
.wm-range { display: grid; grid-template-columns: 70px minmax(0, 1fr) 48px; align-items: center; gap: 10px; font: 600 14px Roboto, system-ui, sans-serif; color: #263451; }
.wm-range input { width: 100%; height: 30px; margin: 0; accent-color: #2f6bf0; }
.wm-range output { text-align: right; font-weight: 700; }
.wm-swatch { width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #b8c2d6; cursor: pointer; opacity: .45; }
.wm-swatch[aria-pressed="true"] { opacity: 1; box-shadow: 0 0 0 3px #2f6bf0; }
.wm-shield { display: flex; flex-direction: column; gap: 10px; }
.wm-check { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; font: 600 14px Roboto, system-ui, sans-serif; color: #263451; cursor: pointer; }
.wm-check input { width: 20px; height: 20px; margin: 0; accent-color: #2f6bf0; }
.wm-history { display: flex; justify-content: center; gap: 8px; margin: 14px 0 6px; }
.wm-small-btn { min-height: 42px; padding: 8px 14px; font-size: 13.5px; }
.wm-settings .process-actions { margin-top: 8px; }
.wm-settings .compress-cancel-btn[hidden] { display: none; }
.wm-hint { margin: 16px 0 0; text-align: center; }
#wmApply.is-waiting { opacity: .8; }
@keyframes wm-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 63, 69, 0); } 40% { box-shadow: 0 0 0 5px rgba(220, 63, 69, .45); } }
.wm-pulse { animation: wm-pulse .9s ease 2; border-color: #dc3f45 !important; }

@media (max-width: 600px) {
  .wm-chip { min-height: 40px; padding: 8px 13px; font-size: 13.5px; }
  .wm-positions { gap: 6px; }
  .wm-range { grid-template-columns: 62px minmax(0, 1fr) 44px; gap: 8px; font-size: 13.5px; }
  .wm-color { font-size: 13px; }
  .wm-color input { width: 46px; }
}

/* ===== Same look as the Compress page ===== */
.wm-page #wmClearAll{background:#dc3f45!important;border:1px solid #dc3f45!important;color:#fff!important;box-shadow:0 5px 14px rgba(220,63,69,.16)}
.wm-page #wmClearAll:disabled{background:#dc3f45!important;color:#fff!important;opacity:.55}
.wm-page .trust-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
@media (max-width:700px){.wm-page .trust-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
.wm-page .wm-help, .wm-page .wm-faq{max-width:760px;margin:28px auto;text-align:left}
.wm-page .wm-help li{margin:8px 0}

/* ===== Full window (dark editor: Done + Undo / Redo / Reset on top, picture, ‹ N / M › under it, settings) ===== */
.wm-fw {
  width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0;
  background: #0f172a; color: #fff; overflow: hidden;
}
.wm-fw[open] { display: flex; flex-direction: column; }
.wm-fw::backdrop { background: #0f172a; }
.wm-fw-top {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
  border-bottom: 1px solid #1e293b;
}
.wm-fw-spacer { flex: 1; }
.wm-fw-btn {
  flex: 0 0 auto; min-height: 44px; padding: 10px 14px; border: 1px solid #334155; border-radius: 12px;
  background: #1e293b; color: #fff; font: 600 15px/1.2 Roboto, system-ui, sans-serif; cursor: pointer;
}
.wm-fw-btn:disabled { opacity: .4; cursor: default; }
.wm-fw-btn:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.wm-fw-done { background: #16a34a; border-color: #16a34a; font-size: 17px; padding: 10px 18px; }
.wm-fw-icon { width: 52px; padding: 8px 0; font-size: 20px; }
.wm-fw-stage { flex: 1 1 auto; min-height: 120px; display: flex; align-items: center; justify-content: center; padding: 8px; overflow: hidden; touch-action: pan-y; }
.wm-fw-stage .wm-preview { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.wm-fw-stage .wm-stage { background: transparent; min-height: 0; }
.wm-fw-stage .wm-stage-canvas { box-shadow: 0 2px 14px rgba(0, 0, 0, .5); }
.wm-fw-stage .wm-stage-loading { color: #cbd5e1; }
.wm-fw-nav { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 2px 12px 6px; }
.wm-fw-nav[hidden] { display: none; }
.wm-fw-arrow { width: 56px; padding: 6px 0; font-size: 22px; }
.wm-fw-count { min-width: 120px; text-align: center; font: 700 15px Roboto, system-ui, sans-serif; }
.wm-fw-panel {
  flex: 0 0 auto; max-height: 48dvh; overflow-y: auto; padding: 12px 14px; padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: #111c34; border-top: 1px solid #1e293b; border-radius: 18px 18px 0 0;
}
.wm-fw-panel .wm-controls { gap: 10px; }
.wm-fw-panel .wm-chip { background: #f1f4fa; border-color: #f1f4fa; color: #1f2a44; }
.wm-fw-panel .wm-chip[aria-pressed="true"] { background: #2f6bf0; border-color: #2f6bf0; color: #fff; box-shadow: none; }
.wm-fw-panel .wm-range, .wm-fw-panel .wm-color, .wm-fw-panel .wm-check { color: #e2e8f0; }
.wm-fw-panel .wm-range input { accent-color: #3b82f6; }
.wm-fw-panel .wm-logo-name { color: #cbd5e1; }
.wm-fw-panel .wm-text { border-color: #fff; }
.wm-fw-panel .wm-swatch { border-color: #111c34; }
@media (max-width: 600px) {
  .wm-fw-top { padding: 8px 10px; gap: 6px; }
  .wm-fw-icon { width: 46px; }
  .wm-fw-panel { padding: 10px 12px; }
}
@media (max-height: 640px) { .wm-fw-panel { max-height: 54dvh; } }
