.clean-ui #scan-note-sheet { width:min(100%,600px); }
.clean-ui #scan-note-sheet[open] { max-height:calc(100dvh - var(--safe-t,0px) - var(--safe-b,0px) - 16px); }
.scan-camera-controls { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:8px; }
.scan-camera-controls select,.scan-camera-controls button,.scan-camera-controls label { min-height:42px; border:1px solid var(--line,#dce4ed); border-radius:9px; background:var(--surface,#fff); color:var(--ink,#152539); padding:7px 10px; font:inherit; }
.scan-camera-controls label { display:flex; align-items:center; gap:8px; flex:1 1 180px; }
.scan-camera-controls input[type=range] { min-width:90px; flex:1; }
.scan-camera-controls [hidden] { display:none!important; }
.scan-modes { display:flex; gap:4px; padding:4px; background:var(--bg,#f4f7fa); border-radius:12px; margin:8px 0 12px; }
.scan-modes button { flex:1; min-height:44px; border:0; background:transparent; color:var(--muted,#52647a); border-radius:9px; font:inherit; font-size:13px; cursor:pointer; }
.scan-modes button[aria-pressed=true] { background:var(--brand,#087cf0); color:#fff; }
.scan-camera-stage { position:relative; height:clamp(220px,37dvh,370px); background:#102131; border-radius:14px; overflow:hidden; }
.scan-camera-stage video { display:block; width:100%; height:100%; object-fit:contain; }
.scan-camera-stage video.is-selfie { transform:scaleX(-1); }
.scan-frame { position:absolute; inset:13% 20% 22%; border:2px solid #fff; border-radius:14px; box-shadow:0 0 0 120px #0003; pointer-events:none; }
[data-camera-mode=qr] .scan-frame { inset:14% max(18%,30px) 22%; aspect-ratio:1; max-height:70%; margin:auto; }
.scan-camera-stage span { position:absolute; bottom:10px; left:12px; right:12px; text-align:center; color:#fff; font-size:12px; padding:8px; background:#102131df; border-radius:8px; }
.scan-live-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.scan-live-actions button { flex:1 1 130px; min-height:46px; }
#scan-status { padding:10px 12px; border-radius:9px; background:var(--sky-pale,#eaf5ff); color:var(--ink,#152539); line-height:1.5; }
#scan-list:empty { display:none; }
#scan-list { display:flex; gap:8px; overflow-x:auto; padding:8px 0; list-style:none; }
#scan-list .stitch-item { display:grid; grid-template-columns:1fr 32px; flex:0 0 98px; gap:4px; font-size:11px; align-items:center; }
#scan-list .stitch-item img { grid-column:1/-1; width:98px; height:88px; object-fit:cover; border:1px solid var(--line,#dce4ed); border-radius:8px; }
#scan-list .stitch-item button { min-height:32px; min-width:32px; width:32px; height:32px; }
.clean-ui #scan-prompt { display:none; }
.receipt-draft-preview { background:var(--sky-pale,#edf6ff); padding:12px; border-radius:12px; margin-bottom:12px; }
.receipt-draft-preview p { margin:0 0 8px; font-size:13px; color:var(--muted,#52647a); }
.receipt-draft-preview .receipt-draft-pages { display:flex; gap:8px; overflow:auto; }
.receipt-draft-preview a { display:flex; flex-direction:column; gap:4px; text-decoration:none; color:var(--brand,#087cf0); font-size:12px; flex:0 0 100px; }
.receipt-draft-preview img { width:100px; height:126px; object-fit:cover; object-position:top; border-radius:6px; background:white; }
.voice-guide { padding:12px; margin:10px 0 14px; border:1px solid var(--line,#dce4ed); border-radius:12px; background:var(--sky-pale,#edf6ff); color:var(--ink,#152539); font-size:13px; line-height:1.5; }
.voice-guide p { margin:6px 0; }
.voice-guide small { display:block; color:var(--muted,#52647a); }
.clean-ui #recent-list .tx,.clean-ui .list-tx-row { border-inline-start:4px solid var(--category-color,#087cf0); border-radius:10px; background:var(--category-bg,#f0f7ff); padding-inline:10px; margin-block:5px; }
.clean-ui #recent-list .cat-ico { box-shadow:inset 0 0 0 1px currentColor; }
.receipt-viewer { padding:0; width:min(100vw,960px); height:calc(100dvh - var(--safe-t,0px) - var(--safe-b,0px) - 16px); max-height:calc(100dvh - var(--safe-t,0px) - var(--safe-b,0px) - 16px); max-width:100vw; margin:auto; border:1px solid var(--line,#dce4ed); border-radius:14px; background:var(--surface,#fff); color:var(--ink,#152539); overflow:hidden; }
.receipt-viewer[open] { display:flex; flex-direction:column; }
.receipt-viewer::backdrop { background:#0b1729bf; }
.receipt-viewer header,.receipt-viewer nav { display:flex; align-items:center; gap:8px; padding:8px 12px; border-bottom:1px solid var(--line,#dce4ed); flex-shrink:0; }
.receipt-viewer header strong { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
.receipt-viewer button,.receipt-viewer nav a { min-width:44px; min-height:44px; border:1px solid var(--line,#dce4ed); border-radius:8px; background:var(--surface,#fff); color:var(--ink,#152539); cursor:pointer; padding:8px 12px; font:inherit; text-align:center; text-decoration:none; }
.receipt-viewer nav a { margin-left:auto; }
.receipt-viewer button:focus-visible,.receipt-viewer a:focus-visible { outline:3px solid #087cf0; outline-offset:1px; }
.receipt-viewport { overflow:auto; flex:1; min-height:0; padding:12px; background:var(--bg,#f3f6f9); overscroll-behavior:contain; touch-action:pan-x pan-y pinch-zoom; }
.receipt-viewport img { display:block; max-width:none; height:auto; margin:0 auto; }
.receipt-viewport iframe { width:100%; height:calc(100% - 56px); min-height:250px; border:0; background:white; }
.receipt-viewport p { font-size:13px; padding:10px; }
.receipt-viewer [hidden],#scan-note-sheet [hidden],.voice-guide[hidden],.receipt-draft-preview[hidden] { display:none!important; }
@media (max-width:700px) {
  #scan-note-sheet[open] { position:fixed; inset:var(--safe-t,0px) 0 var(--safe-b,0px); width:100vw; height:calc(100dvh - var(--safe-t,0px) - var(--safe-b,0px)); max-width:100vw; max-height:none; margin:0; border:0; border-radius:0; overflow:auto; }
  #scan-note-sheet[open] > form { min-height:100%; padding-bottom:max(16px,env(safe-area-inset-bottom)); }
  #scan-note-sheet[open] .scan-camera-stage { height:clamp(240px,44dvh,520px); }
}
