.receipt-scanner{position:fixed;inset:0;z-index:20000;background:#000;color:#fff;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;overscroll-behavior:contain;overflow:auto;color-scheme:dark}
.receipt-scanner *{box-sizing:border-box}.receipt-scanner [hidden]{display:none!important}
.receipt-scanner__shell{width:min(100%,760px);min-height:100%;min-height:100dvh;margin:0 auto;display:flex;flex-direction:column;padding:max(env(safe-area-inset-top),10px) 14px max(env(safe-area-inset-bottom),14px)}
.receipt-scanner button{font:inherit;cursor:pointer;border:0;color:inherit;min-height:44px;touch-action:manipulation}.receipt-scanner button:disabled{opacity:.45;cursor:default}.receipt-scanner button:focus-visible{outline:3px solid #f6c865;outline-offset:4px}
.receipt-scanner__header{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px;padding:0 0 12px}.receipt-scanner__header>button{background:transparent;padding:6px 0;color:#bfe9cf;font-size:15px}.receipt-scanner__header h2{margin:0;font-size:18px;line-height:1.2;text-align:center;font-weight:650;letter-spacing:0}.receipt-scanner__project{max-width:300px;margin:4px auto 0;text-align:center;font-size:12px;color:#aebfb5;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.receipt-scanner__auto{font-size:11px;color:#bfe9cf}
.receipt-scanner__camera{position:relative;flex:1;min-height:230px;height:46dvh;max-height:600px;background:#18211c;border:1px solid #34453c;border-radius:18px;overflow:hidden;display:flex;align-items:center;justify-content:center}.receipt-scanner__camera video{width:100%;height:100%;object-fit:contain;display:block}.receipt-scanner__outline{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.receipt-scanner__outline polygon{fill:#8febae1a;stroke:#c8f9d9;stroke-width:.6;vector-effect:non-scaling-stroke;stroke-linejoin:round}.receipt-scanner__outline polygon.is-stable{fill:#8febae33;stroke:#78e69f;stroke-width:2}.receipt-scanner__camera-message{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:32px;text-align:center;font-size:15px;line-height:1.55;background:#142019dd}.receipt-scanner__camera-message button{background:#366b4c;padding:10px 20px;border-radius:10px}.receipt-scanner__mode{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);padding:6px 12px;border-radius:18px;background:#0a100bd9;font-size:12px;color:#e0efe5;white-space:nowrap}.receipt-scanner--flash .receipt-scanner__camera:after{content:"";position:absolute;inset:0;background:#ffffffa6;pointer-events:none}
.receipt-scanner__bottom{padding-top:12px}.receipt-scanner__status{font-size:13px;line-height:1.45;text-align:center;min-height:38px;max-width:550px;margin:0 auto 6px;color:#d9e7de}.receipt-scanner__status--error{color:#ffce9b}.receipt-scanner__capture-row{display:grid;grid-template-columns:1fr 74px 1fr;align-items:center;gap:12px;margin:7px 0 16px}.receipt-scanner__count{font-size:14px;color:#d6e2da;text-align:left}.receipt-scanner__shutter{width:70px;height:70px;padding:5px;border:3px solid #fff!important;border-radius:50%;background:transparent;justify-self:center}.receipt-scanner__shutter span{display:block;background:#fff;width:100%;height:100%;border-radius:50%}.receipt-scanner__save{justify-self:end;background:#326b4a;padding:10px 13px;border-radius:10px;font-weight:600!important;font-size:14px!important}.receipt-scanner__imports{display:grid;grid-template-columns:1fr 1fr;gap:12px}.receipt-scanner__imports button{display:flex;align-items:center;justify-content:center;gap:10px;min-height:62px;padding:14px 12px;border:1px solid #4c6255;border-radius:14px;background:#223c2d;font-size:16px;font-weight:650}.receipt-scanner__imports svg{width:25px;height:25px;flex:none}.receipt-scanner__hint{margin:10px 2px 0;color:#9eafa5;font-size:11px;line-height:1.45;text-align:center}.receipt-scanner__pages{display:flex;gap:8px;overflow-x:auto;max-height:78px;padding:3px 0}.receipt-scanner__pages:empty{display:none}.receipt-scanner__page{position:relative;flex:0 0 50px;height:70px;background:#fff;border-radius:5px;overflow:hidden}.receipt-scanner__page img{width:100%;height:100%;object-fit:contain}.receipt-scanner__page button{position:absolute;top:0;right:0;min-height:28px;width:28px;line-height:1;background:#000b;color:#fff;font-size:22px}
@media(min-width:700px){.receipt-scanner__shell{max-width:660px;padding-inline:24px}.receipt-scanner__camera{min-height:300px}.receipt-scanner__header h2{font-size:21px}.receipt-scanner__imports button{min-height:66px}.receipt-scanner__status{min-height:24px}}
@media(max-width:390px){.receipt-scanner__shell{padding-inline:11px}.receipt-scanner__header{gap:7px}.receipt-scanner__header h2{font-size:17px}.receipt-scanner__auto{font-size:10px}.receipt-scanner__project{max-width:160px}.receipt-scanner__imports{gap:8px}.receipt-scanner__imports button{gap:8px;padding-inline:8px;font-size:15px}}
@media(max-height:650px){.receipt-scanner__camera{min-height:180px}.receipt-scanner__shutter{width:60px;height:60px}.receipt-scanner__capture-row{margin:6px 0 10px}.receipt-scanner__imports button{min-height:52px}.receipt-scanner__bottom{padding-top:8px}}
.receipt-scanner__import-page{position:relative;flex:0 0 110px;height:70px;background:#263e30;border-radius:5px;padding:8px 25px 8px 8px;display:flex;align-items:center}.receipt-scanner__import-page span{font-size:11px;line-height:1.3;overflow-wrap:anywhere;max-height:53px;overflow:hidden}.receipt-scanner__import-page button{position:absolute;top:0;right:0;min-height:28px;width:28px;background:#0008;color:#fff;font-size:22px}
/* Match the released iOS scanner's black camera and orange import shelf. */
.receipt-scanner__shell{padding-bottom:0}
.receipt-scanner__header>button{width:44px;height:44px;border:1px solid #303030;border-radius:50%;background:#171717;color:#fff;font-size:34px;font-weight:300;line-height:1;padding:0}
.receipt-scanner__auto{color:#ffa15e}.receipt-scanner__camera{background:#000;border-color:#202020;border-radius:12px}.receipt-scanner__camera-message{background:#090909ed}.receipt-scanner__camera-message button,.receipt-scanner__save{background:#443125;color:#ffa15e}.receipt-scanner__outline polygon{fill:#ffc7641a;stroke:#ffce75}.receipt-scanner__outline polygon.is-stable{fill:#ffc76433;stroke:#ffbb52}.receipt-scanner__mode{background:#151515dd;color:#e8e8e8}.receipt-scanner__status{color:#ddd}.receipt-scanner__status--error{color:#ffbf8e}.receipt-scanner__count{color:#d5d5d5}.receipt-scanner__import-page{background:#443125}
.receipt-scanner__imports-panel{margin:0 -14px;background:#202020;padding:12px 14px max(env(safe-area-inset-bottom),20px)}
.receipt-scanner__project{max-width:100%;margin:0 0 12px;color:#999;font-size:13px;font-weight:500;line-height:1.3}.receipt-scanner__imports button{min-height:70px;border:0;border-radius:16px;background:#443125;color:#ffa15e;font-size:17px;font-weight:650}
@media(min-width:700px){.receipt-scanner__imports-panel{margin-inline:-24px;padding-inline:24px}}
@media(max-width:390px){.receipt-scanner__imports-panel{margin-inline:-11px;padding-inline:11px}.receipt-scanner__project{max-width:100%}.receipt-scanner__imports button{font-size:16px}}
@media(max-height:650px){.receipt-scanner__imports button{min-height:58px}.receipt-scanner__imports-panel{padding-top:8px}.receipt-scanner__project{margin-bottom:8px}}
/* Bound the flex layout to the viewport. Intrinsic video dimensions must never
   enlarge the camera or push the shutter/import shelf below the screen. */
.receipt-scanner__shell{height:100vh;height:100dvh;min-height:0;overflow:hidden}
.receipt-scanner__header,.receipt-scanner__bottom{flex:0 0 auto}
.receipt-scanner__camera{flex:1 1 0;min-width:0;min-height:0;height:auto;max-height:none}
.receipt-scanner__camera video{position:absolute;inset:0;width:100%;height:100%;min-height:0;object-fit:contain}
@media(orientation:landscape) and (max-height:520px){
  .receipt-scanner__shell{width:100%;max-width:1100px;display:grid;grid-template-columns:minmax(0,1fr) minmax(290px,.65fr);grid-template-rows:auto minmax(0,1fr);gap:0 14px;padding:8px 14px max(env(safe-area-inset-bottom),8px)}
  .receipt-scanner__header{grid-column:1/-1;padding-bottom:8px}.receipt-scanner__header>button{width:36px;height:36px;min-height:36px;font-size:29px}.receipt-scanner__header h2{font-size:16px}
  .receipt-scanner__camera{grid-column:1;grid-row:2;height:100%;min-height:0}
  .receipt-scanner__bottom{grid-column:2;grid-row:2;display:flex;flex-direction:column;min-width:0;min-height:0;padding-top:0}
  .receipt-scanner__status{font-size:12px;line-height:1.35;min-height:0;margin:0 0 4px}
  .receipt-scanner__pages{max-height:54px;flex-shrink:0;padding:2px 0}.receipt-scanner__page{height:50px;flex-basis:36px}.receipt-scanner__import-page{height:50px}
  .receipt-scanner__capture-row{grid-template-columns:1fr 58px 1fr;gap:8px;margin:5px 0 8px}.receipt-scanner__shutter{width:54px;height:54px}.receipt-scanner__count{font-size:12px}.receipt-scanner__save{padding:8px;font-size:12px!important}
  .receipt-scanner__imports-panel{margin:auto 0 0;padding:8px;border-radius:12px}.receipt-scanner__project{margin:0 0 7px;font-size:12px}.receipt-scanner__imports{gap:8px}.receipt-scanner__imports button{min-height:48px;padding:10px 6px;font-size:14px;gap:6px;border-radius:10px}.receipt-scanner__imports svg{width:21px;height:21px}
  .receipt-scanner__camera-message{padding:18px;font-size:13px;gap:12px}.receipt-scanner__mode{font-size:10px;bottom:8px}
}
