:root{font-family:Inter,"Noto Sans SC","Hiragino Sans",system-ui,sans-serif;color:#18342d;background:#f2f5f0}*{box-sizing:border-box}body{margin:0}main{max-width:920px;margin:auto;padding:24px 20px 80px}button,input,select,textarea{font:inherit}button,.button{cursor:pointer;border:0;border-radius:12px;padding:12px 16px;background:#153d35;color:white;font-weight:650}button:disabled{opacity:.55;cursor:not-allowed}.secondary{background:#e4eee8;color:#153d35}.subtle{background:transparent;color:#536960;padding:8px}.top{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}.top small{color:#6d8e7b;letter-spacing:.14em;font-size:11px;font-weight:800}.top h1{margin:4px 0 0;font-size:32px;letter-spacing:-.04em}.card{background:white;border:1px solid #e3e9e1;border-radius:20px;padding:22px;box-shadow:0 8px 28px rgba(21,61,53,.04);margin-bottom:18px}h2{font-size:18px;margin:0 0 12px}p{line-height:1.55}.card p{color:#65756a;margin:0 0 18px}.login{max-width:460px;margin:50px auto}.login button{width:100%;margin-top:20px}.company-switch{display:flex;gap:8px;margin:0 0 18px}.company-switch button{flex:1;background:#e4ebe4;color:#53665a}.company-switch .selected{background:#153d35;color:white}.overview{background:#173f36;color:white}.overview small{color:#a6d2b6;font-weight:700}.overview h2{font-size:22px;margin-top:5px}.stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:22px 0}.stat-grid div{background:#ffffff13;padding:16px;border-radius:12px}.stat-grid span{display:block;color:#c6ded0;font-size:12px}.stat-grid strong{font-size:24px}.overview .note{color:#cee0d2;margin:0;font-size:13px}.capture h2{margin-bottom:8px}.capture .actions{display:flex;gap:10px;flex-wrap:wrap}.capture .button{display:inline-block}.tabs{display:flex;border-bottom:1px solid #d9e4d9;margin:24px 0 18px}.tabs button{border-radius:0;background:transparent;color:#68786d;border-bottom:3px solid transparent}.tabs .active{color:#153d35;border-color:#153d35}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.section-heading a{color:#12654a;font-size:13px}.list{display:grid;gap:10px}.row{background:#fff;border:1px solid #e1e8df;border-radius:14px;padding:14px;display:flex;justify-content:space-between;gap:12px;align-items:center}.row .main{min-width:0}.row .meta{font-size:12px;color:#75877b}.row .title{font-weight:700;margin:4px 0;overflow-wrap:anywhere}.row .amount{font-weight:800;white-space:nowrap}.row .amount.expense{color:#aa5142}.row .amount.income{color:#17805b}.row .mini{display:block;font-size:12px;color:#777}.row button{padding:8px 12px}.empty{background:white;border:1px dashed #cedbd0;padding:28px;text-align:center;border-radius:14px;color:#778c7a}.note{font-size:13px;color:#68796d}.status{font-size:13px;color:#806321;margin-top:12px}label{display:block;font-size:13px;font-weight:700;margin:13px 0 0}label input:not([type=checkbox]):not([type=file]),label select,label textarea{display:block;width:100%;border:1px solid #cbd9ce;border-radius:10px;padding:12px;margin-top:6px;background:white;color:#193a30;font-weight:400}input[hidden]{display:none!important}dialog{border:0;border-radius:20px;padding:22px;width:min(95vw,560px);max-height:90vh;overflow:auto;box-shadow:0 25px 100px #173e3555}dialog::backdrop{background:#102e27aa}.dialog-head{display:flex;justify-content:space-between;align-items:center}.two{display:grid;grid-template-columns:1fr 1fr;gap:10px}.photo-wrap{height:180px;background:#edf2ed;border-radius:12px;overflow:hidden;text-align:center}.photo-wrap img{height:100%;max-width:100%;object-fit:contain}.warning{color:#ac422f;font-size:13px}.confirm{display:flex;align-items:flex-start;gap:8px;font-weight:500;line-height:1.4}.confirm input{margin:2px 0}.dialog-actions{display:flex;gap:10px;margin-top:20px}.dialog-actions button{flex:1}#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#183f35;color:white;border-radius:10px;padding:11px 16px;display:none;max-width:90vw;box-shadow:0 8px 30px #0003}@media(max-width:540px){main{padding:20px 14px 80px}.card{padding:18px}.top h1{font-size:28px}.stat-grid{gap:6px}.stat-grid div{padding:12px 7px}.stat-grid strong{font-size:21px}.row{align-items:flex-start}.row .amount{text-align:right}.dialog-actions{flex-direction:column}}

/* Keep the review controls visible while the receipt fields scroll. */
[hidden]{display:none!important}
body{overflow-x:hidden}
button,.button{touch-action:manipulation}
#reviewDialog{width:min(95vw,560px);height:min(90dvh,760px);max-height:90dvh;padding:0;overflow:hidden}
#reviewForm{display:flex;flex-direction:column;height:100%;min-height:0}
.dialog-head{flex:none;padding:20px 22px 12px;border-bottom:1px solid #e3e9e1;background:#fff}
.dialog-head h2{margin:0}
.dialog-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 22px 20px}
.dialog-footer{flex:none;padding:12px 22px 20px;border-top:1px solid #e3e9e1;background:#fff;box-shadow:0 -5px 20px #173e350d}
.dialog-actions{display:grid;grid-template-columns:1fr 1.3fr;gap:10px;margin:0}
.dialog-actions button{min-height:50px;min-width:0;white-space:normal}
.dialog-footer .status{margin:8px 0 0}
.dialog-footer .status:empty{display:none}

@media(max-width:540px){
  main{padding:18px 14px calc(146px + env(safe-area-inset-bottom))}
  .top{margin-bottom:16px}
  .company-switch button{min-height:48px}
  .stat-grid strong{font-size:clamp(17px,5vw,21px)}
  .capture{position:fixed;left:0;right:0;bottom:0;z-index:20;margin:0;padding:12px 14px calc(12px + env(safe-area-inset-bottom));border-radius:18px 18px 0 0;box-shadow:0 -8px 30px #173e3522}
  .capture h2,.capture p{display:none}
  .capture .actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .capture .actions .button,.capture .actions button{display:flex;align-items:center;justify-content:center;min-height:50px;padding:10px 8px;text-align:center;font-size:14px;line-height:1.25}
  .capture .status{margin:7px 0 0;line-height:1.3}
  .capture .status:empty{display:none}
  .tabs{position:sticky;top:0;z-index:10;margin:0 0 16px;padding-top:6px;background:#f2f5f0}
  .tabs button{flex:1;min-height:46px;padding:9px 8px}
  .row button{min-height:44px}
  #reviewDialog{inset:auto 0 0;margin:0;width:100vw;max-width:100vw;height:calc(100dvh - env(safe-area-inset-top) - 8px);max-height:none;border-radius:18px 18px 0 0}
  .dialog-head{padding:14px 18px 10px}
  .dialog-scroll{padding:0 18px 18px}
  .dialog-footer{padding:10px 18px calc(10px + env(safe-area-inset-bottom))}
  .dialog-actions{grid-template-columns:1fr 1.25fr;gap:8px}
  .dialog-actions button{min-height:52px;padding:9px 7px;font-size:14px;line-height:1.25}
  label input:not([type=checkbox]):not([type=file]),label select,label textarea{font-size:16px;min-height:46px}
  .confirm{font-size:14px}
  #toast{bottom:calc(102px + env(safe-area-inset-bottom));z-index:30}
}
