/* Scan Document to Image page. Reuses /compress/compress-page.css (workspace, gallery frame, buttons,
   status line, results bar and cards); only scan-specific parts live here. */

/* ===== Live scan preview inside the Shared Gallery (gallery `preview` extension) ===== */
.sc-page [data-lovepdfi-gallery] .lp-gallery__main--custom { display: block; overflow: visible; }
.sc-preview { width: 100%; min-width: 0; }
.sc-stage {
  position: relative; display: flex; justify-content: center; align-items: center; width: 100%; min-height: 200px;
  line-height: 0; background: #eef1f6; border-radius: 10px; overflow: hidden;
}
.sc-stage-img { display: block; max-width: 100%; max-height: min(60vh, 560px); object-fit: contain; box-shadow: 0 2px 10px rgba(15, 23, 42, .18); }
.sc-stage-img[hidden] { display: none; }
.sc-stage.is-busy { opacity: .7; }
.sc-stage-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0;
  color: #5d6878; background: rgba(238, 241, 246, .55); font: 700 13px/1.4 Roboto, system-ui, sans-serif; pointer-events: none;
}
.sc-stage-loading[hidden] { display: none; }
.sc-stage-badge { margin: 8px 0 0; min-height: 18px; text-align: center; color: #3b4863; font: 600 13px/1.4 Roboto, system-ui, sans-serif; }
.sc-preview-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 0; }
.sc-preview-nav[hidden] { display: none; }
.sc-preview-count { font: 800 14px Roboto, system-ui, sans-serif; color: #1d2947; }
.sc-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;
}
.sc-nav-btn:disabled { opacity: .35; cursor: default; }
.sc-page-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0 2px; }
.sc-tool-btn {
  min-height: 44px; padding: 8px 14px; border: 1px solid #d5ddeb; border-radius: 12px; background: #fff;
  color: #1f2a44; font: 700 14px/1.2 Roboto, system-ui, sans-serif; cursor: pointer;
}
.sc-tool-btn:disabled { opacity: .45; cursor: default; }
.sc-tool-main { border-color: #2f6bf0; color: #2f6bf0; }
.sc-tool-btn:focus-visible, .sc-chip:focus-visible, .sc-nav-btn:focus-visible { outline: 3px solid rgba(49, 92, 245, .4); outline-offset: 2px; }

/* ===== Settings ===== */
.sc-settings .settings-title { display: flex; margin-bottom: 12px; }
.sc-controls { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 640px; margin: 0 auto; }
.sc-controls [hidden] { display: none !important; }
.sc-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; }
.sc-label { min-width: 62px; font: 700 14px Roboto, system-ui, sans-serif; color: #263451; text-align: right; }
.sc-seg { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sc-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;
}
.sc-chip:hover { border-color: #9db5ff; }
.sc-chip[aria-pressed="true"] { background: #2f6bf0; border-color: #2f6bf0; color: #fff; box-shadow: 0 4px 12px rgba(47, 107, 240, .25); }
.sc-check { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; font: 700 14px Roboto, system-ui, sans-serif; color: #263451; cursor: pointer; }
.sc-check input { width: 20px; height: 20px; margin: 0; accent-color: #2f6bf0; }
.sc-link-btn { min-height: 36px; padding: 4px 10px; border: 0; background: none; color: #2f6bf0; font: 700 13.5px Roboto, system-ui, sans-serif; text-decoration: underline; cursor: pointer; }
.sc-link-btn:disabled { opacity: .45; }
.sc-settings .process-actions { margin-top: 14px; }
.sc-settings .compress-cancel-btn[hidden] { display: none; }
.sc-hint { margin: 16px 0 0; text-align: center; }

@media (max-width: 600px) {
  .sc-chip { min-height: 40px; padding: 8px 13px; font-size: 13.5px; }
  .sc-label { min-width: 0; width: 100%; text-align: center; }
  .sc-page-tools { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 6px; }
  .sc-tool-btn { padding: 8px 6px; font-size: 13px; white-space: nowrap; }
}
@media (max-width: 420px) {
  .sc-seg { gap: 6px; }
  .sc-chip { padding: 8px 11px; font-size: 13px; }
}

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

/* ===== Full window = the PDF scanner's page editor (dark, corners, ◀ N / M ▶, Auto / Full page / 90° lock / ↺ ↻, Preview, filters) ===== */
.sc-fw, .sc-cam {
  width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0;
  background: #0b0f14; color: #fff; overflow: hidden;
}
.sc-fw[open], .sc-cam[open] { display: flex; flex-direction: column; }
.sc-fw::backdrop, .sc-cam::backdrop { background: #0b0f14; }
.sc-fw-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px;
  padding-top: max(10px, env(safe-area-inset-top));
}
.sc-fw-title { font: 500 15px/1.3 Roboto, system-ui, sans-serif; color: #cbd5e1; }
.sc-fw-btn {
  flex: 0 0 auto; min-height: 44px; padding: 10px 14px; border: 1px solid #374151; border-radius: 10px;
  background: #1f2937; color: #fff; font: 500 15px/1.2 Roboto, system-ui, sans-serif; cursor: pointer;
}
.sc-fw-btn[aria-pressed="true"] { background: #1d7be0; border-color: #1d7be0; }
.sc-fw-btn:disabled { opacity: .3; cursor: default; }
.sc-fw-btn:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.sc-fw-done { background: #16a34a; border-color: #16a34a; font-weight: 700; font-size: 16px; padding: 10px 20px; }
.sc-fw-icon { width: 52px; padding: 8px 0; font-size: 18px; }
.sc-fw-stage { position: relative; flex: 1 1 auto; min-height: 120px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#scFwCanvas { display: block; touch-action: none; max-width: 100%; max-height: 100%; }
.sc-fw-nav { position: relative; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 8px 12px 4px; flex: 0 0 auto; }
.sc-fw-arrow { min-width: 64px; height: 44px; font-size: 18px; padding: 0 14px; }
.sc-fw-count { min-width: 64px; text-align: center; font: 500 17px Roboto, system-ui, sans-serif; color: #fff; }
.sc-fw-saved { min-width: 70px; font: 500 15px Roboto, system-ui, sans-serif; color: #fff; }
.sc-fw-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 6px 12px; flex: 0 0 auto; }
.sc-fw-filters { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
@media (max-width: 400px) {
  .sc-fw-btn { padding: 9px 11px; font-size: 14px; }
  .sc-fw-icon { width: 46px; }
  .sc-fw-bar { gap: 6px; padding: 5px 8px; }
  .sc-fw-title { font-size: 14px; }
}

/* ===== Camera (same as the PDF scanner camera) ===== */
.sc-cam { position: fixed; }
.sc-cam-stage { position: absolute; inset: 0; z-index: 0; background: #000; }
.sc-cam-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
#scCamFx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#scCamFlash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .08s; }
.sc-cam-top {
  position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px;
  padding-top: max(10px, env(safe-area-inset-top)); background: linear-gradient(rgba(0, 0, 0, .6), rgba(0, 0, 0, 0));
}
.sc-cam-count { font: 600 14px Roboto, system-ui, sans-serif; color: #fff; text-shadow: 0 1px 4px #000; }
.sc-cam-seg { display: flex; border: 1px solid #374151; border-radius: 10px; overflow: hidden; }
.sc-cam-seg button { min-height: 40px; padding: 8px 10px; border: 0; background: #1f2937; color: #fff; font: 500 13px Roboto, system-ui, sans-serif; cursor: pointer; }
.sc-cam-seg button[aria-pressed="true"] { background: #1d7be0; }
.sc-cam-info { position: relative; z-index: 3; margin: 0; padding: 2px 12px; text-align: center; color: #e2e8f0; font: 500 14px/1.4 Roboto, system-ui, sans-serif; text-shadow: 0 1px 4px #000; }
.sc-cam-hint { margin-top: auto; }
.sc-cam-bottom {
  position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom)); background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .65));
}
.sc-cam-shutter { position: relative; width: 72px; height: 72px; border-radius: 50%; border: 5px solid #fff; background: #ef4444; cursor: pointer; }
/* Timer running: the red button shows a white "stop" square. */
.sc-cam-shutter.is-auto::after { content: ''; position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; border-radius: 4px; background: #fff; }
.sc-cam-shutter:active { transform: scale(.94); }
.sc-cam-timer { min-width: 90px; }
.sc-cam-timer[aria-pressed="true"] { background: #1d7be0; border-color: #1d7be0; }
.sc-cam-countdown {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); min-width: 96px; padding: 8px 18px; border-radius: 20px;
  background: rgba(0, 0, 0, .45); color: #fff; font: 800 64px/1 Roboto, system-ui, sans-serif; text-align: center; pointer-events: none; text-shadow: 0 2px 8px #000;
}
.sc-cam-countdown[hidden] { display: none; }

/* ===== Scanning new pages (under the gallery): buttons locked, page still scrolls ===== */
.sc-scanning { margin: 12px 0 0; padding: 12px 14px; border: 1px solid #bcd0ff; border-radius: 12px; background: #eef3ff; }
.sc-scanning[hidden] { display: none; }
.sc-scanning-text { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; color: #1d3a8a; font: 800 15px/1.3 Roboto, system-ui, sans-serif; }
.sc-scanning-note { margin: 8px 0 0; text-align: center; color: #3b4863; font: 500 12.5px/1.4 Roboto, system-ui, sans-serif; }
.sc-scanning-bar { margin: 10px 0 0; }
.sc-spinner { width: 18px; height: 18px; border: 3px solid #bcd0ff; border-top-color: #2f6bf0; border-radius: 50%; animation: sc-spin .8s linear infinite; flex: 0 0 auto; }
@keyframes sc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sc-spinner { animation-duration: 2.4s; } }
.sc-workspace.is-scanning .lp-gallery__strip, .sc-workspace.is-scanning .lp-thumb-remove { pointer-events: none; opacity: .6; }

/* ===== Article: the strongest unique use, right under the tool ===== */
.sc-page .sc-unique { max-width: 760px; margin: 22px auto 0; padding: 14px 16px; border-left: 4px solid #2f6bf0; border-radius: 10px; background: #f4f7ff; color: #263451; font: 500 15px/1.55 Roboto, system-ui, sans-serif; }
.sc-page .sc-unique strong { color: #1d2947; }
.sc-page .intro + .intro { margin-top: -6px; }

/* ===== Share all (1 by 1) + Share all (ZIP) side by side ===== */
.sc-page .sc-share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sc-page .sc-share-row .share-all-btn { min-height: 46px; padding: 8px 4px; font-size: 13.5px !important; white-space: nowrap; }


/* ===== Compact controls under the gallery (owner's order, Update 42):
   Auto crop · Rotate · Edit corners / filters / Save as / Quality / Save · Full window — one line each ===== */
.sc-compact { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 2px; }
.sc-compact [hidden] { display: none !important; }
.sc-line { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: nowrap; min-width: 0; }
.sc-line .sc-chip { flex: 1 1 0; min-width: 0; min-height: 40px; padding: 6px 4px; font-size: 13.5px; white-space: nowrap; box-shadow: none; }
.sc-line .sc-label { flex: 0 0 auto; width: auto; min-width: 0; margin-right: 2px; text-align: left; font: 700 13px Roboto, system-ui, sans-serif; color: #263451; white-space: nowrap; }
.sc-line-tools .sc-check { flex: 0 0 auto; min-height: 40px; gap: 6px; font-size: 13.5px; white-space: nowrap; }
.sc-line-tools .sc-check input { width: 19px; height: 19px; }
.sc-line-tools .sc-tool-btn { flex: 1 1 0; min-width: 0; min-height: 40px; padding: 6px 4px; font-size: 13.5px; white-space: nowrap; }
.sc-compact .sc-link-btn { align-self: center; min-height: 28px; margin: -4px 0 -2px; padding: 2px 8px; font-size: 12.5px; }
.sc-line-final { gap: 8px; margin-top: 2px; }
.sc-line-final .page-btn { margin: 0; min-height: 50px; border-radius: 14px; font: 800 15px/1.2 Roboto, system-ui, sans-serif; white-space: nowrap; }
.sc-line-final .process-btn { flex: 1.5 1 0; min-width: 0; width: auto; background: linear-gradient(135deg, #315cf5, #624cf4); color: #fff; border: 0; }
.sc-line-final .process-btn:disabled { opacity: .5; }
.sc-line-final .full-window-btn { flex: 1 1 0; min-width: 0; width: auto; background: #fff; color: #21804c; border: 1.5px solid #25834f; }
.sc-page .sc-settings { margin-top: 12px; }
.sc-page .sc-settings .compress-status:empty { display: none; }
@media (max-width: 380px) {
  .sc-line { gap: 5px; }
  .sc-line .sc-chip, .sc-line-tools .sc-tool-btn, .sc-line-tools .sc-check { font-size: 12.5px; }
  .sc-line .sc-label { font-size: 12px; }
  .sc-line-final .page-btn { font-size: 14px; }
}

/* ===== Full window: Preview in the top bar; tools on one line ===== */
.sc-fw-title { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; line-height: 1.2; }
.sc-fw-title small { font-size: 12px; color: #94a3b8; }
.sc-fw-top { gap: 8px; }
.sc-fw-bar { flex-wrap: nowrap; gap: 6px; }
.sc-fw-bar .sc-fw-btn { flex: 1 1 auto; min-width: 0; padding: 9px 8px; font-size: 14px; white-space: nowrap; }
.sc-fw-bar .sc-fw-icon { flex: 0 0 44px; width: 44px; padding: 8px 0; }
@media (max-width: 380px) { .sc-fw-bar .sc-fw-btn { padding: 9px 5px; font-size: 13px; } .sc-fw-bar .sc-fw-icon { flex-basis: 40px; width: 40px; } }

/* ===== Gallery holds only the big preview + thumbnails; status line, page switch and all controls are the page's own panel ===== */
.sc-page .sc-panel { margin: 10px 0 0; padding: 12px; border: 1px solid #e3e8f2; border-radius: 16px; background: #fbfcff; }
.sc-page .sc-workspace.is-empty .sc-panel { display: none; }
.sc-page .sc-panel .sc-stage-badge { margin: 0 0 6px; }
.sc-page .sc-panel .sc-preview-nav { margin: 4px 0 0; }

@media (max-width: 400px) { .sc-page .sc-panel { padding: 10px 7px; } .sc-line-tools { gap: 4px; } }

/* ===== Update 48: the page shown big = the thumbnail with a clear blue frame; 🗑 in the Full window ===== */
.sc-workspace [data-lovepdfi-gallery] .lp-gallery__thumbnail[aria-current="true"] { border: 3px solid #2563eb; outline: 0; box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(37, 99, 235, .35); }
.sc-workspace [data-lovepdfi-gallery] .lp-gallery__strip { padding-left: 5px; padding-right: 5px; }
.sc-fw-del { position: absolute; right: 12px; top: 8px; min-width: 44px; min-height: 42px; font-size: 19px !important; color: #fecaca; border-color: rgba(248, 113, 113, .55); }
.sc-fw-del:active { background: rgba(220, 38, 38, .25); }
