:root{
  color-scheme:light;
  --ink:#0f1f3d;--action:#1a4db5;--action-hover:#153d91;--action-soft:#e8eef9;
  --muted:#5a6372;--line:#d7d9dd;--paper:#f7f5f2;--card:#ffffff;--danger:#a83422;--danger-soft:#fff1ed;
  --focus:#b85c00;--warn:#7a4a00;--warn-soft:#fff6e6
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;color:var(--ink);background:var(--paper);
  font:17px/1.5 system-ui,-apple-system,sans-serif;
  min-height:100vh;min-height:100dvh;
  display:flex;flex-direction:column
}
[hidden]{display:none!important}
.visually-hidden{position:fixed!important;top:0;left:0;width:1px;height:1px;opacity:0;pointer-events:none}
a{color:var(--action)}
button,a,input{touch-action:manipulation}
button{font:inherit;cursor:pointer}
button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
button:disabled{opacity:.55;cursor:wait}
.brand{max-width:640px;margin:0 auto;padding:14px 24px 6px;width:100%}
.brand a{font-size:15px;font-weight:750;text-decoration:none;color:var(--muted)}
main{
  max-width:640px;width:100%;margin:0 auto;padding:22px 24px calc(26px + env(safe-area-inset-bottom, 0px));
  background:var(--card);border:1px solid var(--line);border-radius:20px;
  flex:1 0 auto;display:flex;flex-direction:column
}
h1{font-size:clamp(28px,7vw,36px);line-height:1.2;margin:4px 0 10px;letter-spacing:-.02em}h1:focus{outline:none}
#instruction{color:var(--muted);margin:0 0 16px}
#purpose{color:var(--ink);font-size:22px;line-height:1.45;margin:0 0 18px}
#purpose p{margin:0 0 12px}
#purpose p:last-child{margin-bottom:0}
.amount{
  position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:10px;
  margin:0 0 14px;padding:8px 12px;background:var(--action-soft);border-radius:10px;font-weight:750
}
.amount .quiet{min-height:36px;padding:4px 8px;font-size:14px;font-weight:600;color:var(--action)}
p{margin:10px 0}
button{min-height:48px;border-radius:12px;padding:11px 16px;border:1px solid var(--line);background:var(--card);color:var(--ink)}
.primary{background:var(--action);border-color:var(--action);color:#fff;font-weight:700;width:100%;font-size:18px;min-height:56px}
.primary:hover,.primary:active{background:var(--action-hover);border-color:var(--action-hover)}
.secondary{color:var(--action);background:var(--card);font-weight:600}
.quiet{border:0;background:none;color:var(--action);text-decoration:underline;text-underline-offset:3px;padding:8px 6px;min-height:44px;font-size:15px}
.quiet.danger{color:var(--danger)}
#actions{display:grid;gap:10px;margin-top:auto;padding-top:16px}#actions .row{justify-content:center}
.row{display:flex;gap:8px;flex-wrap:wrap}.row>button{flex:1}.row>.quiet{flex:0 1 auto}
#actions .quiet{justify-self:center;width:auto}
.choices{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:6px 0 4px}
.choices button{font-size:30px;font-weight:750;min-height:88px;color:var(--action);border-width:2px;border-color:var(--line);background:var(--card)}
.choices button:hover,.choices button:active{background:var(--action-soft);border-color:var(--action)}
.choices button:last-child{grid-column:1/-1}
/* Home: the denomination grid is the only action, so pin it to the bottom and let the text breathe. */
.home-mode main{min-height:0}
.home-mode #body{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
.home-mode .choices{margin-top:auto;padding-top:8px}
.home-mode .hero{margin:auto 0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:8px 0;min-height:0}
.home-mode .hero svg{width:min(100%,220px);height:auto;max-height:18vh}
.home-mode #purpose{margin-bottom:12px}
.home-mode .choices button{min-height:80px}
.home-mode .hero figcaption{font-size:14px;color:var(--muted);text-align:center;max-width:46ch}
.home-mode #actions{display:none}
.section-label{font-size:13px;font-weight:700;letter-spacing:.035em;text-transform:uppercase;color:var(--muted);margin:18px 0 6px}
.handoff{font-size:16px;background:var(--warn-soft);border-radius:10px;padding:12px 14px;margin:0 0 4px}
.handoff + button{margin:0 0 14px}
.saved-note{
  display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:left;width:100%;
  margin:6px 0;padding:12px 14px;border-color:var(--action);border-width:2px;background:var(--action-soft)
}
.saved-note strong{font-size:19px}.saved-note small{color:var(--muted);font-size:14px}.saved-note::after{content:"›";font-size:26px;color:var(--action);line-height:1}
details .saved-note{border-color:var(--line);border-width:1px;background:var(--card)}
.muted{font-size:14px;color:var(--muted)}.storage-note{font-size:14px;color:var(--warn);background:var(--warn-soft);border-radius:8px;padding:8px 12px;margin:0 0 12px}
.error{border-left:4px solid var(--danger);background:var(--danger-soft);padding:12px 14px;margin:12px 0;border-radius:0 8px 8px 0}
#status{font-weight:650;margin:8px 0}#status:empty{display:none}
.steps{display:flex;gap:10px;margin:0 0 12px}
.steps .step{flex:1;text-align:center;padding:10px 8px;border-radius:10px;border:2px solid var(--line);color:var(--muted);font-weight:700;font-size:16px}
.steps .step.current{border-color:var(--action);color:var(--action);background:var(--action-soft)}
.steps .step.done{border-color:var(--action);background:var(--action);color:#fff}
#camera-panel{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;gap:12px}
.camera-frame{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;gap:8px;position:relative}
/* Which note the burst is shooting, always on the feed itself: a resumed or
   interrupted run must never have to guess which bill it belongs to. */
.camera-note{position:absolute;top:8px;left:8px;z-index:2;margin:0;padding:6px 10px;border-radius:8px;
  background:#0b1220e0;color:#fff;font-size:16px;font-weight:700;letter-spacing:.01em;
  font-variant-numeric:tabular-nums;pointer-events:none;max-width:calc(100% - 16px);white-space:nowrap}
.camera-note .tally{opacity:.8;font-size:14px;font-weight:600;margin-left:7px}
#camera-panel video{display:block;width:100%;flex:1 1 auto;min-height:160px;max-height:min(52vh,520px);background:#0b1220;object-fit:contain;border-radius:12px}
.camera-controls{display:grid;gap:10px;margin-top:auto}
#camera-panel .camera-controls button{display:block;width:100%;margin:0}
#camera-status{font-size:14px;color:var(--muted);margin:0}
.capture-mode .brand{display:none}
.capture-mode main{padding:16px 18px calc(20px + env(safe-area-inset-bottom, 0px));border-radius:0;border-width:1px 0;min-height:100svh;min-height:100dvh}
.capture-mode h1{font-size:24px;margin:4px 0 6px}
.capture-mode #instruction{margin-bottom:10px;font-size:15px}
.capture-mode #camera-panel video{max-height:min(46vh,420px)}
.photos{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:4px}
.photo{border:1px solid var(--line);border-radius:12px;padding:8px;min-width:0;background:var(--card)}
.photo h2{font-size:13px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.03em;margin:0 0 6px}
.photo p{font-size:13px;color:var(--danger);margin:6px 0}
.thumbnail{padding:0;border:0;background:#e8eaef;width:100%;display:block;border-radius:8px;overflow:hidden;min-height:0}.thumbnail img{display:block;width:100%;height:130px;object-fit:contain}
.photo-actions{display:flex;gap:6px;margin-top:6px}.photo-actions button{flex:1;min-height:38px;padding:6px 4px;font-size:14px}
.consent{font-size:14px;color:var(--muted);margin:14px 0 0}
.auto-send{display:flex;gap:10px;align-items:flex-start;font-size:15px;font-weight:600;margin:14px 0 0;cursor:pointer}
.auto-send input{width:22px;height:22px;margin:0;flex:none;accent-color:var(--action)}
.auto-send + .consent{margin-top:6px}
.notify{margin:16px 0 4px;border-top:1px solid var(--line);padding-top:14px}
.notify h2{font-size:19px;margin:0 0 2px}
.notify label{display:block;font-size:15px;font-weight:650;margin:12px 0 4px}
.notify input{font:inherit;width:100%;min-height:48px;border-radius:12px;border:1px solid var(--line);padding:11px 14px;background:var(--card);color:var(--ink)}
.notify button{width:100%;margin-top:12px}
details{margin:6px 0 0;font-size:14px;color:var(--muted)}summary{cursor:pointer;min-height:40px;padding:6px 0;color:var(--action);font-weight:600}
footer{max-width:640px;margin:16px auto 0;padding:0 24px 30px;font-size:13px;color:var(--muted);text-align:center}
.modal{position:fixed;inset:0;background:#0a1428f5;z-index:10;padding:20px;padding-bottom:calc(20px + env(safe-area-inset-bottom, 0px));display:flex;flex-direction:column;gap:18px}
.modal button{align-self:flex-end}.modal img{min-height:0;flex:1;width:100%;object-fit:contain}
@media(max-width:680px){
  .brand{padding:10px 18px 4px}
  main{border-radius:0;border-width:1px 0;margin:0;padding:20px 18px calc(24px + env(safe-area-inset-bottom, 0px));min-height:100svh;min-height:100dvh}
  footer{padding:0 18px calc(24px + env(safe-area-inset-bottom, 0px))}
}
@media(max-width:420px){
  .choices button{min-height:76px;font-size:26px}
  #purpose{font-size:19px}
  h1{font-size:clamp(24px,7vw,30px)}
  .thumbnail img{height:110px}
  .photo{padding:6px}
  .photo h2{font-size:12px}
  .consent{font-size:13px;margin:10px 0 0}
  #actions{padding-top:12px}
  .primary{min-height:52px;font-size:17px}
}
@media(max-height:680px) and (orientation:portrait){
  .thumbnail img{height:100px}
  .photo{padding:6px}
}
@media(max-height:520px) and (orientation:landscape){
  .brand{display:none}
  main{padding:10px 16px calc(12px + env(safe-area-inset-bottom, 0px))}
  h1{font-size:18px;margin:2px 0 3px}
  #instruction{font-size:13px;margin-bottom:4px}
  #purpose{font-size:15px;margin-bottom:6px}
  .amount{padding:6px 10px;margin-bottom:8px}
  .capture-mode h1{font-size:18px;margin:2px 0 3px}
  .capture-mode #instruction{font-size:13px;margin-bottom:4px}
  .steps{margin-bottom:6px}
  .steps .step{padding:4px;font-size:12px;min-height:0}
  #camera-panel video{max-height:min(62vh,300px)}
  body.capture-mode #camera-panel video{max-height:min(40vh,200px)}
  .thumbnail img{height:60px}
  .photo{padding:5px}
  .photo h2{font-size:10px;margin-bottom:4px}
  .photo-actions button{min-height:30px;font-size:12px}
  .consent{font-size:11px;margin:4px 0 0}
  details summary{font-size:12px;min-height:32px}
  .primary{min-height:40px;font-size:14px}
  #actions{padding-top:6px;gap:5px}
  .choices button{min-height:52px;font-size:16px}
}
@media(min-width:681px){
  body{padding:12px 0}
  main{border-radius:20px;min-height:auto;flex:0 1 auto}
  .capture-mode main{min-height:auto}
  .capture-mode #camera-panel video{max-height:min(50vh,420px)}
}
@media(prefers-reduced-motion:no-preference){button{transition:background-color .12s,border-color .12s}}
