.linxi-mobile-photo-scan-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3600;
  display: grid;
  place-items: stretch;
  background: #f1f5f2;
}

.linxi-mobile-photo-scan {
  --mps-emerald: #138b6f;
  --mps-ink: #17392f;
  display: grid;
  width: 100%;
  min-height: 100%;
  background: #f1f5f2;
  color: #f5fffb;
}

.linxi-mobile-photo-scan-stage { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; min-height: 100svh; min-height: 100dvh; height: 100dvh; max-height: 100dvh; overflow: hidden; }
.linxi-mobile-photo-scan-stage[hidden] { display: none; }
.linxi-mobile-photo-scan-head,
.linxi-mobile-photo-scan-review-head {
  display: grid;
  grid-template-columns: clamp(50px, 16vw, 64px) minmax(0, 1fr) clamp(50px, 16vw, 64px);
  align-items: center;
  min-height: clamp(54px, 8svh, 72px);
  padding: max(8px, env(safe-area-inset-top)) clamp(10px, 3.2vw, 18px) clamp(7px, 1.5vw, 12px);
  background: var(--mps-emerald);
}

.linxi-mobile-photo-scan-head h2,
.linxi-mobile-photo-scan-review-head h2 { margin: 0; font-size: clamp(16px, 4.8vw, 19px); text-align: center; }
.linxi-mobile-photo-scan-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.linxi-mobile-photo-scan-head > button,
.linxi-mobile-photo-scan-review-head > button,
.linxi-mobile-photo-scan-review-head > span {
  justify-self: center;
  min-width: 42px;
  min-height: 36px;
  padding: 0 9px;
  border: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, .16);
  color: #f5fffb;
  font: inherit;
  font-size: 13px;
}

.linxi-mobile-photo-scan-head > button:first-child,
.linxi-mobile-photo-scan-review-head > button { font-size: 30px; line-height: 1; }
.linxi-mobile-photo-scan-head > button:first-child { display: grid; place-items: center; padding: 0; }
.linxi-mobile-photo-scan-head > button:first-child svg { width: 24px; height: 24px; display: block; }
.linxi-mobile-photo-scan-review-head > button { display: grid; place-items: center; padding: 0; }
.linxi-mobile-photo-scan-review-head > button svg { width: 24px; height: 24px; display: block; }
.linxi-mobile-photo-scan-head > button.is-active { background: #fff; color: var(--mps-emerald); }
.linxi-mobile-photo-scan-flash { display: grid; place-items: center; width: clamp(40px, 12vw, 46px); min-width: clamp(40px, 12vw, 46px) !important; height: clamp(40px, 12vw, 46px); min-height: clamp(40px, 12vw, 46px) !important; padding: 0 !important; border: 1px solid rgba(255,255,255,.62) !important; border-radius: 50% !important; background: rgba(255,255,255,.14) !important; color: #fff !important; box-shadow: 0 5px 16px rgba(0,0,0,.14); }
.linxi-mobile-photo-scan-flash-icon { width: clamp(23px, 7vw, 27px); height: clamp(23px, 7vw, 27px); overflow: visible; }
.linxi-mobile-photo-scan-flash-beam { fill: currentColor; opacity: 0; transition: opacity 160ms ease, filter 160ms ease; }
.linxi-mobile-photo-scan-flash-body,
.linxi-mobile-photo-scan-flash-cap { fill: none; stroke: currentColor; stroke-linejoin: round; stroke-width: 1.9; }
.linxi-mobile-photo-scan-flash.is-active { background: #fff !important; color: var(--mps-emerald) !important; box-shadow: 0 0 0 4px rgba(255,255,255,.18), 0 0 22px rgba(255,255,255,.58); }
.linxi-mobile-photo-scan-flash.is-active .linxi-mobile-photo-scan-flash-beam { opacity: .9; filter: drop-shadow(0 0 4px rgba(255,255,255,.8)); }

.linxi-mobile-photo-scan-view {
  position: relative;
  display: grid;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  background: #020908;
}

.linxi-mobile-photo-scan-view video { position: absolute; inset: 0; display: block; width: 100%; max-width: none; height: 100%; max-height: none; object-fit: cover !important; object-position: center center; background: #020908; }
.linxi-mobile-photo-scan-grid { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent 33.2%, rgba(255,255,255,.35) 33.3%, transparent 33.5%, transparent 66.5%, rgba(255,255,255,.35) 66.7%, transparent 66.8%), linear-gradient(0deg, transparent 33.2%, rgba(255,255,255,.35) 33.3%, transparent 33.5%, transparent 66.5%, rgba(255,255,255,.35) 66.7%, transparent 66.8%); }
.linxi-mobile-photo-scan.is-camera-off video { opacity: 0; }

.linxi-mobile-photo-scan-capture-bar {
  position: relative;
  display: block;
  align-items: center;
  min-height: clamp(108px, 17svh, 144px);
  padding: clamp(8px, 2.5vw, 14px) clamp(10px, 3.2vw, 18px) max(8px, calc(10px + env(safe-area-inset-bottom)));
  background: var(--mps-emerald);
}

.linxi-mobile-photo-scan-capture-menu { position: absolute; inset: 0 clamp(10px, 3.2vw, 18px); display: grid; grid-template-columns: minmax(0, 1fr) clamp(76px, 22vw, 90px) minmax(0, 1fr); column-gap: clamp(8px, 2.5vw, 14px); align-items: center; min-height: inherit; }
.linxi-mobile-photo-scan-capture-pages { position: absolute; left: clamp(6px, 2vw, 12px); bottom: clamp(18px, 4vw, 24px); z-index: 3; width: clamp(48px, 14vw, 60px); height: clamp(62px, 18vw, 78px); padding: 0; border: 0; background: transparent; overflow: visible; }
.linxi-mobile-photo-scan-capture-pages[hidden] { display: none; }
.linxi-mobile-photo-scan-capture-pages:disabled { opacity: .55; }
.linxi-mobile-photo-scan-capture-count { position: absolute; left: clamp(6px, 2vw, 12px); bottom: clamp(3px, 1vw, 8px); z-index: 4; width: clamp(48px, 14vw, 60px); color: rgba(238,255,247,.88); font-size: clamp(11px, 3.2vw, 14px); font-weight: 750; line-height: 1.2; text-align: center; pointer-events: none; }
.linxi-mobile-photo-scan-capture-thumb { --stack-x: 0px; --stack-y: -3px; --stack-r: -4deg; position: absolute; left: 0; bottom: 3px; z-index: 1; width: clamp(30px, 10vw, 40px); height: clamp(48px, 15vw, 60px); flex: 0 0 auto; object-fit: cover; border: 2px solid rgba(255,255,255,.86); border-radius: 7px; background: #fff; box-shadow: 0 4px 10px rgba(0,0,0,.3); transform: translate3d(var(--stack-x), var(--stack-y), 0) rotate(var(--stack-r)); transform-origin: 50% 100%; transition: transform 160ms ease, box-shadow 160ms ease; }
.linxi-mobile-photo-scan-capture-thumb[data-stack-index="0"] { --stack-x: 0px; --stack-y: -3px; --stack-r: -4deg; }
.linxi-mobile-photo-scan-capture-thumb[data-stack-index="1"] { --stack-x: 5px; --stack-y: 0px; --stack-r: 2deg; }
.linxi-mobile-photo-scan-capture-thumb[data-stack-index="2"] { --stack-x: 10px; --stack-y: 3px; --stack-r: -1deg; }
.linxi-mobile-photo-scan-capture-thumb[data-stack-index="3"] { --stack-x: 15px; --stack-y: 6px; --stack-r: 2deg; }
.linxi-mobile-photo-scan-capture-thumb[data-stack-latest="true"] { z-index: 5; }
.linxi-mobile-photo-scan-capture-pages:active .linxi-mobile-photo-scan-capture-thumb[data-stack-latest="true"] { transform: translate3d(9px, -1px, 0) rotate(0deg) scale(1.04); }
.linxi-mobile-photo-scan-capture-pages.is-arriving .linxi-mobile-photo-scan-capture-thumb:last-child { animation: linxi-mobile-photo-scan-thumb-fly .5s cubic-bezier(.2,.8,.25,1) both; }
@keyframes linxi-mobile-photo-scan-thumb-fly {
  0% { opacity: 0; transform: translate3d(42vw, -48vh, 0) scale(1.35) rotate(-8deg); }
  58% { opacity: 1; transform: translate3d(calc(var(--stack-x) + 8px), calc(var(--stack-y) - 7px), 0) scale(1.08) rotate(var(--stack-r)); }
  100% { opacity: 1; transform: translate3d(var(--stack-x), var(--stack-y), 0) scale(1) rotate(var(--stack-r)); }
}
.linxi-mobile-photo-scan-album { grid-column: 1; justify-self: end; width: clamp(70px, 21vw, 86px); min-height: clamp(42px, 7svh, 50px); margin-right: 0; padding: 0 8px; border: 1px solid rgba(255,255,255,.78); border-radius: 12px; background: #f7fbf8; color: var(--mps-emerald); font: inherit; font-size: clamp(13px, 3.8vw, 16px); font-weight: 750; white-space: nowrap; }
.linxi-mobile-photo-scan-shutter { grid-column: 2; position: relative; display: block; justify-self: center; inline-size: clamp(68px, 21vw, 84px) !important; block-size: clamp(68px, 21vw, 84px) !important; min-inline-size: clamp(68px, 21vw, 84px) !important; min-block-size: clamp(68px, 21vw, 84px) !important; max-inline-size: clamp(68px, 21vw, 84px) !important; max-block-size: clamp(68px, 21vw, 84px) !important; aspect-ratio: 1 / 1; flex: 0 0 auto; padding: 0 !important; box-sizing: border-box; appearance: none; border: 0; border-radius: 50% !important; background: #fff; overflow: hidden; line-height: 0; font-size: 0; box-shadow: 0 0 0 2px rgba(255,255,255,.28), 0 5px 14px rgba(0,0,0,.18); }
.linxi-mobile-photo-scan-shutter::before { content: ""; position: absolute; inset: clamp(10px, 3vw, 12px); display: block; box-sizing: border-box; border: clamp(2px, .8vw, 3px) solid var(--mps-emerald); border-radius: 50%; background: transparent; pointer-events: none; }
.linxi-mobile-photo-scan-album:disabled,
.linxi-mobile-photo-scan-shutter:disabled { opacity: .4; }
.linxi-mobile-photo-scan-next,
.linxi-mobile-photo-scan-submit,
.linxi-mobile-photo-scan-continue {
  min-height: clamp(42px, 7svh, 50px);
  padding: 0 clamp(8px, 2.8vw, 14px);
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 11px;
  background: #f7fbf8;
  color: var(--mps-emerald);
  font: inherit;
  font-size: clamp(13px, 3.8vw, 16px);
  font-weight: 750;
  white-space: nowrap;
}
.linxi-mobile-photo-scan-next { grid-column: 3; justify-self: start; width: clamp(70px, 21vw, 86px); min-width: clamp(70px, 21vw, 86px); }

.linxi-mobile-photo-scan-next:disabled,
.linxi-mobile-photo-scan-submit:disabled { opacity: .42; }
.linxi-mobile-photo-scan-status { min-height: 20px; margin: 0; padding: 0 16px 10px; background: var(--mps-emerald); color: rgba(255,255,255,.9); font-size: 12px; text-align: center; }
.linxi-mobile-photo-scan-status.is-error { color: #ffd1cc; }

.linxi-mobile-photo-scan-review-head { background: var(--mps-emerald); color: #fff; }
.linxi-mobile-photo-scan-review-head > button,
.linxi-mobile-photo-scan-review-head > span { background: rgba(255,255,255,.1); color: #f5fffb; }
.linxi-mobile-photo-scan-review-pages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; gap: clamp(8px, 2.8vw, 14px); min-height: 0; overflow-x: hidden; overflow-y: auto; padding: clamp(10px, 4vw, 18px); background: #f1f5f2; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.linxi-mobile-photo-scan-review-page { position: relative; align-self: start; overflow: hidden; border: 2px solid #d9e4de; border-radius: 12px; background: #fff; box-shadow: 0 8px 20px rgba(15, 43, 32, .1); touch-action: pan-y; transition: transform 180ms ease, box-shadow 180ms ease; will-change: transform; }
.linxi-mobile-photo-scan-review-page.is-hold-ready { transform: translateY(-4px) scale(1.025); box-shadow: 0 15px 27px rgba(15, 43, 32, .2); }
.linxi-mobile-photo-scan-review-page.is-dragging { opacity: .96; box-shadow: 0 18px 34px rgba(15, 43, 32, .28); cursor: grabbing; touch-action: none; pointer-events: none; }
.linxi-mobile-photo-scan-review-page.is-drag-placeholder { border: 2px dashed #74a994; background: rgba(116,169,148,.18); box-shadow: none; }
.linxi-mobile-photo-scan-review-page.is-drag-placeholder::after { content: ""; position: absolute; inset: 0; border-radius: 10px; background: rgba(216,245,229,.22); }
.linxi-mobile-photo-scan-review-page img { display: block; width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; }
.linxi-mobile-photo-scan-review-page.is-dragging img { width: 100%; height: 100%; object-fit: contain; }
.linxi-mobile-photo-scan-number { position: absolute; left: 7px; bottom: 7px; min-width: 24px; padding: 3px 7px; border-radius: 8px; background: rgba(7,31,24,.78); color: #fff; font-size: 12px; text-align: center; }
.linxi-mobile-photo-scan-delete { position: absolute; top: 7px; right: 7px; z-index: 2; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(7,31,24,.72); color: #fff; font-size: 20px; line-height: 1; }
.linxi-mobile-photo-scan-review-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: clamp(8px, 4vw, 16px); padding: clamp(10px, 3.5vw, 14px) clamp(10px, 4vw, 16px) max(10px, calc(10px + env(safe-area-inset-bottom))); background: #f1f5f2; }
.linxi-mobile-photo-scan-review-actions > button { width: 100%; }
.linxi-mobile-photo-scan-continue { background: #e2ebe6; color: #15231e; }
.linxi-mobile-photo-scan-review-stage .linxi-mobile-photo-scan-status { background: #f1f5f2; color: #53655d; }

.linxi-mobile-photo-scan-stage.is-capture-flash .linxi-mobile-photo-scan-view::after { content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; background: #fff; animation: linxi-mobile-photo-scan-flash .2s ease-out both; }
@keyframes linxi-mobile-photo-scan-flash { 0% { opacity: .92; } 100% { opacity: 0; } }

.linxi-mobile-photo-scan-toast { position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); left: 16px; z-index: 3800; padding: 12px 15px; border-radius: 12px; background: #138b6f; color: #fff; box-shadow: 0 14px 34px rgba(0,0,0,.2); font-size: 13px; text-align: center; }
.linxi-mobile-photo-scan-toast.is-error { background: #8c2c28; }

@media (min-width: 768px) { .linxi-mobile-photo-scan-backdrop { display: none; } }
