.stepper-wrapper {
  --capture-blue: #087cf0;
  --capture-cyan: #16b7cc;
  --capture-ink: #17263a;
  --capture-muted: #68798e;
  gap: 14px;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 0 110px;
}

.stepper-wrapper .card {
  margin: 0;
  border: 1px solid rgba(24, 55, 87, .09);
  border-radius: 22px;
  box-shadow: 0 16px 40px rgba(32, 65, 96, .08);
}

.capture-status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.capture-status-line > strong {
  flex: 0 0 auto;
  color: var(--capture-blue);
  font-size: .9rem;
  letter-spacing: .02em;
}

.capture-progress {
  width: 100%;
  height: 7px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef5;
}

.capture-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--capture-blue), var(--capture-cyan));
  transition: width .35s ease;
}

.capture-lane {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
  padding: 8px 10px;
  border-radius: 10px;
  text-align: left;
  font-size: .66rem;
}

.capture-lane.is-ebay { color: #176da9; background: #edf7ff; }
.capture-lane.is-ai { color: #6b4b9a; background: #f5efff; }
.capture-lane.is-document { color: #176da9; background: #edf7ff; }
.capture-lane span { color: #6f8090; }

.photo-guide-card {
  padding: 18px;
  text-align: center;
  overflow: hidden;
}

.photo-guide-card h3 {
  margin: 0 0 14px;
  color: var(--capture-ink);
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.photo-guide {
  position: relative;
  width: min(100%, 430px);
  margin: 0 auto 14px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 32%, rgba(79, 173, 255, .24), transparent 42%),
    linear-gradient(145deg, #12263d, #071421);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}

.guide-stage {
  position: relative;
  height: 210px;
  overflow: hidden;
}

.guide-stage::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 16px;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 32px 32px;
}

.guide-object {
  position: absolute;
  left: 50%;
  top: 51%;
  width: 132px;
  height: 92px;
  color: #e5f5ff;
  transform: translate(-50%, -50%) rotateX(58deg) rotateZ(-5deg);
  transform-style: preserve-3d;
  animation: guide-float 3.4s ease-in-out infinite;
}

.guide-object i {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 5.8rem;
  filter: drop-shadow(0 18px 20px rgba(0,0,0,.35));
}

.guide-object-top,
.guide-object-front,
.guide-object-side {
  position: absolute;
  border: 1px solid rgba(155, 225, 255, .4);
  background: rgba(73, 170, 235, .13);
}

.guide-object-top { inset: 12px 20px 44px; transform: translateZ(12px); }
.guide-object-front { left: 20px; right: 20px; bottom: 4px; height: 42px; }
.guide-object-side { right: 8px; bottom: 12px; width: 28px; height: 52px; transform: skewY(-25deg); }

.guide-step-2 .guide-object { transform: translate(-50%, -50%) rotateX(10deg) rotateY(-10deg); }
.guide-step-3 .guide-object { transform: translate(-50%, -50%) rotateX(8deg) rotateY(16deg) rotateZ(2deg); }
.guide-step-4 .guide-object { transform: translate(-50%, -50%) scale(1.28) rotateZ(-2deg); }
.guide-step-5 .guide-object { transform: translate(-50%, -50%) scale(.92) rotateX(18deg) rotateY(-18deg); }

.guide-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  z-index: 3;
  border-color: #66d8ff;
  border-style: solid;
  filter: drop-shadow(0 0 7px rgba(102, 216, 255, .55));
}

.corner-tl { left: 30px; top: 25px; border-width: 2px 0 0 2px; border-radius: 8px 0 0; }
.corner-tr { right: 30px; top: 25px; border-width: 2px 2px 0 0; border-radius: 0 8px 0 0; }
.corner-bl { left: 30px; bottom: 25px; border-width: 0 0 2px 2px; border-radius: 0 0 0 8px; }
.corner-br { right: 30px; bottom: 25px; border-width: 0 2px 2px 0; border-radius: 0 0 8px; }

.guide-scanline {
  position: absolute;
  z-index: 2;
  left: 32px;
  right: 32px;
  top: 30px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #49d5ff 20%, #b8f4ff 50%, #49d5ff 80%, transparent);
  box-shadow: 0 0 16px rgba(73, 213, 255, .8);
  animation: guide-scan 2.8s ease-in-out infinite;
}

.guide-focus-dot {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 8px rgba(255,255,255,.08);
  animation: guide-focus 1.8s ease-out infinite;
}

.task-description {
  max-width: 520px;
  margin: 0 auto;
  color: var(--capture-ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
}

.guide-tips {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.guide-tips span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 9px;
  background: #eef6fd;
  color: #36536f;
  font-size: .68rem;
  font-weight: 700;
  white-space: nowrap;
}

.guide-tips i { color: var(--capture-blue); }

.camera-card {
  min-height: 230px;
  padding: 22px;
}

.wait-state {
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.capture-source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 430px);
}

.capture-source-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 118px;
  padding: 16px;
  border: 1px solid rgba(8, 124, 240, .18);
  border-radius: 17px;
  color: var(--capture-ink);
  background: linear-gradient(180deg, #f9fcff, #eef7ff);
  font-size: .76rem;
  font-weight: 800;
  text-align: center;
}

.capture-source-btn input { display: none; }
.capture-source-btn i {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, var(--capture-blue), var(--capture-cyan));
  box-shadow: 0 10px 20px rgba(8, 124, 240, .2);
  font-size: 1.35rem;
}

.capture-source-btn.file-source i { background: linear-gradient(145deg, #7457c8, #9a70e5); }
.capture-source-btn:active { transform: scale(.985); }
.capture-file-hint { margin-top: 10px; color: #8393a3; font-size: .64rem; font-weight: 700; }

.document-guide-card { padding-bottom: 16px; }
.document-capture-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 9px;
  color: var(--capture-ink);
  font-size: 1.05rem;
  font-weight: 900;
}
.document-capture-title i { color: var(--capture-blue); }
.document-guide {
  position: relative;
  width: min(100%, 310px);
  height: 132px;
  margin: 0 auto 14px;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(145deg, #102a45, #071522);
}
.document-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 86px;
  height: 104px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(0,0,0,.28);
}
.document-sheet.sheet-back { transform: translate(-42%, -50%) rotate(7deg); opacity: .55; }
.document-sheet.sheet-front { transform: translate(-57%, -50%) rotate(-2deg); }
.document-sheet.sheet-front i {
  display: block;
  height: 5px;
  margin: 14px 13px -6px;
  border-radius: 999px;
  background: #b7ccdc;
}
.document-sheet.sheet-front i:first-child { width: 37px; height: 9px; background: #3d91d5; }
.document-scanline {
  position: absolute;
  z-index: 3;
  left: 32px;
  right: 32px;
  top: 22px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #53dfff 20%, #fff 50%, #53dfff 80%, transparent);
  box-shadow: 0 0 14px #53dfff;
  animation: document-scan 2.6s ease-in-out infinite;
}
.document-preview { aspect-ratio: 3 / 4 !important; background: #f2f5f8; }
.document-pdf-preview {
  display: flex;
  width: min(100%, 430px);
  min-height: 220px;
  padding: 28px 20px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(226, 56, 71, .16);
  border-radius: 22px;
  color: var(--capture-ink);
  background: linear-gradient(160deg, #fff, #fff5f5);
  box-shadow: 0 16px 32px rgba(86, 38, 45, .08);
  text-align: center;
  text-decoration: none;
}
.document-pdf-preview > i {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(145deg, #e93f50, #be2135);
  box-shadow: 0 14px 28px rgba(190, 33, 53, .24);
  font-size: 2.1rem;
}
.document-pdf-preview strong { font-size: 1rem; font-weight: 900; }
.document-pdf-preview span { color: #748293; font-size: .72rem; font-weight: 750; }
.document-pdf-preview { cursor: default; }
.document-capture .camera-card { flex-grow: 0; min-height: 245px; }
.document-next-actions { display: grid; gap: 10px; width: min(100%, 430px); }
.document-action-button {
  display: flex;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 13px;
  font-size: .78rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}
.document-next-actions .btn-secondary.document-action-button {
  min-height: 58px;
  border: 2px solid rgba(8, 124, 240, .22);
  color: #087cf0;
  background: linear-gradient(180deg, #f8fcff, #eaf5ff);
  box-shadow: 0 9px 20px rgba(8, 124, 240, .10);
  font-size: .9rem;
}
.document-next-actions .btn-secondary.document-action-button i { font-size: 1rem; }
.document-next-actions .btn-secondary.document-action-button:active { transform: scale(.988); }
.document-limit {
  padding: 10px;
  border-radius: 12px;
  color: #187748;
  background: #eaf8f0;
  font-size: .72rem;
  font-weight: 800;
  text-align: center;
}
.document-pdf-lock {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #6f4c0c;
  background: #fff5d8;
}
@keyframes document-scan {
  0%,100% { top: 22px; opacity: .45; }
  50% { top: calc(100% - 22px); opacity: 1; }
}

.icon-cam-btn {
  width: min(100%, 360px);
  min-height: 150px;
  padding: 24px;
  border: 2px dashed rgba(8, 124, 240, .28);
  border-radius: 20px;
  background: linear-gradient(180deg, #f8fcff, #eef7ff);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.icon-cam-btn:active {
  transform: scale(.985);
  border-color: var(--capture-blue);
}

.camera-button-icon {
  display: grid;
  width: 74px;
  height: 74px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(145deg, var(--capture-blue), var(--capture-cyan));
  box-shadow: 0 14px 28px rgba(8, 124, 240, .26);
}

.icon-cam-btn .camera-button-icon i {
  margin: 0;
  color: inherit;
  font-size: 2rem;
}

.icon-cam-btn > span:last-child {
  color: var(--capture-ink);
  font-size: .95rem;
  font-weight: 800;
}

@keyframes guide-float {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -7px; }
}

@keyframes guide-scan {
  0%, 100% { top: 32px; opacity: .45; }
  50% { top: calc(100% - 34px); opacity: 1; }
}

@keyframes guide-focus {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,.32); }
  75%, 100% { box-shadow: 0 0 0 18px rgba(255,255,255,0); }
}

@media (max-width: 540px) {
  .stepper-wrapper { gap: 10px; }
  .stepper-wrapper .card { border-radius: 18px; }
  .photo-guide-card { padding: 14px; }
  .guide-stage { height: 174px; }
  .guide-object { transform-origin: center; }
  .guide-tips { display: grid; grid-template-columns: 1fr 1fr; }
  .guide-tips span { justify-content: center; }
  .guide-tips span:last-child { grid-column: 1 / -1; }
  .camera-card { min-height: 210px; margin-top: 0; padding: 14px; }
  .icon-cam-btn { min-height: 132px; padding: 18px; }
  .camera-button-icon { width: 64px; height: 64px; border-radius: 20px; }
  .capture-lane { grid-template-columns: auto 1fr; }
  .capture-lane span { grid-column: 1 / -1; padding-left: 21px; }
  .capture-source-btn { min-height: 104px; padding: 12px 8px; font-size: .69rem; }
  .capture-source-btn i { width: 46px; height: 46px; border-radius: 14px; font-size: 1.15rem; }
  .document-guide { height: 116px; }
  .document-sheet { width: 74px; height: 90px; }
}

@media (prefers-reduced-motion: reduce) {
  .guide-object,
  .guide-scanline,
  .guide-focus-dot,
  .document-scanline,
  .ai-pulse {
    animation: none !important;
  }
}
body.document-scanner-open { overflow: hidden !important; }
.document-scanner[hidden] { display: none !important; }
.document-scanner {
    background: #050b14;
    color: #fff;
    display: flex;
    flex-direction: column;
    inset: 0;
    height: 100dvh;
    max-height: 100dvh;
    width: 100vw;
    position: fixed;
    z-index: 2147483000;
}
.document-scanner-head {
    align-items: center;
    background: linear-gradient(135deg,#07172f,#102a4b);
    display: flex;
    justify-content: space-between;
    min-height: 76px;
    padding: max(12px,env(safe-area-inset-top)) 18px 12px;
}
.document-scanner-head div { display:flex; flex-direction:column; gap:2px; }
.document-scanner-head small { color:#65b7ff; font-size:.65rem; font-weight:900; letter-spacing:.13em; }
.scanner-auto-badge { background:#19c37d; border-radius:999px; color:#fff; font-style:normal; letter-spacing:.06em; margin-left:6px; padding:3px 7px; }
.document-scanner-head strong { font-size:1.05rem; }
.document-scanner-head button {
    align-items:center; background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.2);
    border-radius:11px; color:#fff; display:flex; font-size:1.25rem; height:42px; justify-content:center; width:42px;
}
.document-scanner-stage { flex:1; min-height:0; overflow:hidden; position:relative; }
.document-scanner-stage video { height:100%; object-fit:cover; width:100%; }
.document-scanner-stage::after { background:rgba(0,0,0,.22); content:""; inset:0; pointer-events:none; position:absolute; }
.document-scanner-stage p {
    background:rgba(3,14,28,.76); border-radius:999px; bottom:22px; font-size:.78rem; font-weight:800;
    left:50%; margin:0; padding:8px 13px; position:absolute; transform:translateX(-50%); white-space:nowrap; z-index:3;
}
.document-scanner-stage p.is-ready { background:#087cf0; box-shadow:0 0 0 5px rgba(8,124,240,.2); }
.document-scanner-shutter {
    align-items:center; background:#fff; border:4px solid rgba(255,255,255,.48); border-radius:50%;
    bottom:66px; box-shadow:0 5px 22px rgba(0,0,0,.38); display:flex; height:70px; justify-content:center;
    left:50%; padding:0; position:absolute; transform:translateX(-50%); width:70px; z-index:4;
}
.document-scanner-shutter span { background:#087cf0; border-radius:50%; display:block; height:52px; width:52px; }
.document-scanner-shutter:active span { transform:scale(.88); }
.document-scanner-frame { height:min(68vh,620px); left:50%; position:absolute; top:50%; transform:translate(-50%,-50%); width:min(88vw,520px); z-index:2; }
.document-scanner-frame span { border-color:#58c8ff; border-style:solid; height:54px; position:absolute; width:54px; }
.document-scanner-frame span:nth-child(1){border-width:4px 0 0 4px;left:0;top:0}
.document-scanner-frame span:nth-child(2){border-width:4px 4px 0 0;right:0;top:0}
.document-scanner-frame span:nth-child(3){border-width:0 0 4px 4px;bottom:0;left:0}
.document-scanner-frame span:nth-child(4){border-width:0 4px 4px 0;bottom:0;right:0}
.document-scanner-scanline {
    animation:documentScannerSweep 2.2s ease-in-out infinite alternate; background:linear-gradient(90deg,transparent,#58c8ff 12%,#fff 50%,#58c8ff 88%,transparent);
    box-shadow:0 0 16px rgba(88,200,255,.9); height:3px; left:4%; position:absolute; top:4%; width:92%;
}
@keyframes documentScannerSweep { from { top:4%; } to { top:96%; } }
.document-scanner-actions {
    align-items:center; background:#07172f; display:flex; gap:14px; justify-content:center;
    flex:0 0 auto; min-height:104px;
    padding:12px 16px calc(14px + env(safe-area-inset-bottom));
    position:relative; z-index:5;
}
.document-scanner-actions button { border:0; border-radius:13px; font-weight:850; min-height:52px; }
.document-scanner-cancel { background:#e7edf5; color:#31465f; padding:0 18px; }
.document-scanner-capture { align-items:center; background:#087cf0; color:#fff; display:flex; gap:10px; justify-content:center; padding:0 28px; }
.document-scanner-capture i { font-size:1.2rem; }
@supports not (height: 100dvh) {
    .document-scanner { height: -webkit-fill-available; max-height: -webkit-fill-available; }
}
