/* Shared responsive shell. Loaded last so all screens use the same sizing scale. */
:root{--app-width:760px;--app-gutter:24px;--brand-width:210px;--app-blue:#0867d6;--app-ink:#102b52;--app-muted:#607493;--app-border:#dce5ef}
body.app-shell{font-size:16px;line-height:1.5;color:var(--app-ink);background-color:#f9fcff;overflow-wrap:break-word}
body.app-shell>header{width:100%;max-width:var(--app-width);padding:14px var(--app-gutter) 10px!important;border-bottom:1px solid var(--app-border)!important;margin:0 auto}
body.app-shell header .brand-mark,body.app-shell.receipt-editor header .brand-mark{gap:6px}
body.app-shell header .brand-mark img,body.app-shell.receipt-editor header .brand-mark img{width:var(--brand-width);max-width:100%;height:auto}
body.app-shell header .brand-mark small,body.app-shell.receipt-editor header .brand-mark small{font-size:12px;line-height:1.3;font-weight:800;letter-spacing:4px;padding-left:4px;color:#282f39}
.app-nav{width:100%;max-width:var(--app-width);margin:0 auto;padding:4px var(--app-gutter);display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid var(--app-border)}
.app-nav a{display:inline-flex;align-items:center;min-height:44px;padding:8px 12px;border-radius:8px;font-size:14px;font-weight:600;text-decoration:none;color:#47658d}
.app-nav a[aria-current=page]{background:#eaf3ff;color:#075abb}
body.app-shell main,body.app-shell.receipt-editor main{max-width:var(--app-width);width:100%;margin:24px auto 0;padding:0 var(--app-gutter) 28px;min-width:0}
body.app-shell h1,body.app-shell .capture-title,body.app-shell.receipt-editor .editor-title{font-size:clamp(26px,4vw,34px);line-height:1.2;letter-spacing:-.6px}
body.app-shell .card{border-color:var(--app-border)}
body.app-shell a:focus-visible,body.app-shell button:focus-visible{outline:3px solid #6aa9ed;outline-offset:3px}
/* One normal-flow footer avoids covering fields and respects iPhone safe areas. */
body.app-shell .app-footer,body.app-shell.receipt-editor .app-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;max-width:var(--app-width);margin:auto auto 0;padding:16px var(--app-gutter) max(16px,env(safe-area-inset-bottom));border-top:1px solid var(--app-border);font-size:12px;color:var(--app-muted);background:#fff}
.app-footer .footer-version{flex:1;text-align:center}
.app-footer .profile-avatar{width:44px;height:44px;flex-shrink:0;font-size:15px}
.app-footer form{margin:0}
body.app-shell .app-footer button{min-height:44px;width:auto;padding:8px;background:transparent;border:0;color:#47658d;font-size:14px;box-shadow:none}
body.app-shell.login-page .app-footer{flex-direction:column;gap:3px;text-align:center}
body.app-shell.login-page .app-footer p{font-size:13px;margin:0}
/* Navigation is rendered once by the shared shell. Bottom back actions remain. */
body.app-shell .capture-top-back,body.app-shell .editor-top-back{display:none}
body.app-shell.is-authenticated main>a:first-child[href="/"]{display:none}
body.app-shell .dashboard-footer{display:none}
body.app-shell .dashboard-capture button{font-size:21px;padding:16px;min-height:58px;gap:14px;border-radius:12px}
body.app-shell .dashboard-welcome h1{font-size:clamp(27px,5vw,36px)}
body.app-shell .dashboard-welcome>p:last-child{font-size:19px}
body.app-shell .dashboard-list-title{flex-wrap:wrap;align-items:center}
body.app-shell .dashboard-list-title h2{font-size:25px}
body.app-shell .dashboard-subtitle{font-size:16px}
body.app-shell .draft-count{font-size:12px;white-space:normal}
body.app-shell .receipt-status{font-size:12px;white-space:normal;max-width:125px;line-height:1.4;text-align:center}
body.app-shell .capture-description{font-size:18px;line-height:1.5}
body.app-shell .capture-art{max-width:350px;max-height:255px;object-fit:contain;margin:10px auto 18px}
body.app-shell .capture-choices button{min-height:92px;padding:16px 18px;gap:16px;border-radius:12px}
body.app-shell .capture-choices .capture-choice-icon{width:54px;height:54px;font-size:34px;border-radius:10px}
body.app-shell .capture-choices .capture-choice-copy{font-size:20px;gap:6px;line-height:1.3}
body.app-shell .capture-choice-copy small{font-size:14px;line-height:1.4}
body.app-shell .capture-choices .capture-choice-arrow{font-size:30px}
body.app-shell .bottom-back{margin:24px 0 0}
body.app-shell .bottom-back a{min-height:44px;font-size:14px;padding:12px}
body.app-shell .login-help{position:relative;top:auto;right:auto;display:flex;justify-content:flex-end;margin:10px 0 0}
body.app-shell .login-help summary{width:44px;height:44px;line-height:39px;font-size:24px}
body.app-shell .login-help p{top:40px;z-index:2}
body.app-shell .login-art{max-width:440px;max-height:300px;object-fit:contain}
body.app-shell .login-copy h1{font-size:clamp(30px,5vw,46px);line-height:1.15;letter-spacing:-1px}
body.app-shell .login-description{font-size:19px}
body.app-shell .microsoft-login{min-height:54px;font-size:18px;padding:15px 18px;gap:14px;border-radius:12px}
body.app-shell .login-form{margin:26px 0}
/* Scanner uses the same logo and type scale as the page shell. */
body.app-shell #document-scanner{padding:max(18px,env(safe-area-inset-top)) max(var(--app-gutter),calc((100vw - 712px)/2)) max(18px,env(safe-area-inset-bottom))}
body.app-shell .scanner-brand{padding:0 0 10px;margin-bottom:8px;border-color:var(--app-border)}
body.app-shell .scanner-brand img{width:var(--brand-width);max-width:100%;height:auto}
body.app-shell .scanner-brand strong{font-size:12px;letter-spacing:4px;padding-left:4px;margin-top:6px;line-height:1.3}
body.app-shell .scanner-top-back{min-width:44px;min-height:44px;font-size:25px;padding:6px;margin:0 0 8px}
body.app-shell #document-scanner h2{font-size:28px;line-height:1.2;margin-bottom:10px}
body.app-shell .scanner-description{font-size:16px;line-height:1.5;margin-bottom:14px}
body.app-shell #document-scanner .scan-stage canvas,body.app-shell #document-scanner .scan-stage img{max-height:52dvh}
body.app-shell #document-scanner :is(button,[data-scan-crop],[data-scan-accept],.scan-cancel){min-height:44px;font-size:16px;padding:11px;border-radius:10px}
body.app-shell #document-scanner .scan-corners button{font-size:14px}
body.app-shell #document-scanner .scan-tools button{font-size:13px;padding:10px 4px}
body.app-shell #document-scanner .scan-nudges button{font-size:24px}
body.app-shell #document-scanner .scan-tools button span{font-size:25px}
body.app-shell .scanner-footer{font-size:12px;color:var(--app-muted);border-top:1px solid var(--app-border);padding:16px 0 0;margin-top:20px}
@media(max-width:600px){
 :root{--app-gutter:16px;--brand-width:170px}
 body.app-shell>header{padding-top:max(10px,env(safe-area-inset-top))!important;padding-bottom:10px!important}
 body.app-shell main,body.app-shell.receipt-editor main{margin-top:20px;padding-bottom:24px}
 body.app-shell button,body.app-shell .button{min-height:44px;font-size:16px;padding:11px 14px;line-height:1.35}
 body.app-shell input,body.app-shell select,body.app-shell textarea,body.app-shell.receipt-editor:not(.capture-only) input,body.app-shell.receipt-editor:not(.capture-only) select,body.app-shell.receipt-editor:not(.capture-only) textarea{font-size:16px;min-height:44px;line-height:1.45;padding:11px 12px;max-width:100%}
 body.app-shell.receipt-editor:not(.capture-only) label{font-size:14px;line-height:1.5}
 body.app-shell.receipt-editor:not(.capture-only) h2{font-size:20px}
 body.app-shell.receipt-editor:not(.capture-only) .editor-title{font-size:26px}
 body.app-shell.receipt-editor:not(.capture-only) h3{font-size:17px}
 body.app-shell.receipt-editor:not(.capture-only) .card{padding:16px;margin:14px 0}
 body.app-shell.receipt-editor:not(.capture-only) .internal-employee{min-height:44px;font-size:14px;gap:10px}
 body.app-shell input[type=checkbox],body.app-shell.receipt-editor:not(.capture-only) input[type=checkbox]{width:20px;height:20px;min-height:20px;padding:0;flex-shrink:0}
 body.app-shell.receipt-editor:not(.capture-only) .participant-row{padding:12px;margin:14px 0}
 body.app-shell.receipt-editor:not(.capture-only) .participant-row .field-grid>label{grid-template-columns:1fr;gap:4px;margin:8px 0}
 body.app-shell.receipt-editor:not(.capture-only) :is([data-participant-remove],[data-participant-add],[data-add-page],[data-purpose-generate]){min-height:44px;font-size:14px;padding:10px 12px}
 body.app-shell .purpose-ai{margin:10px 0 12px;position:static}
 body.app-shell.receipt-editor:not(.capture-only) [name=purpose]{padding-bottom:12px;min-height:120px}
 body.app-shell .purpose-ai button{width:auto}
 body.app-shell.receipt-editor:not(.capture-only) .page-actions :is(button,a){display:inline-flex;align-items:center;min-height:44px;padding:9px;font-size:13px;margin:0}
 body.app-shell.receipt-editor:not(.capture-only) .page-actions{gap:8px}
 body.app-shell.receipt-editor:not(.capture-only) .page-description .hint{font-size:12px}
 body.app-shell.receipt-editor:not(.capture-only) .receipt-submit-actions button{min-height:48px;font-size:16px;padding:13px}
 body.app-shell.receipt-editor:not(.capture-only) .recognition-banner [data-ocr-start]{min-height:44px;padding:8px;font-size:13px;margin-left:0}
 body.app-shell .recognition-banner>div{min-width:0;flex-basis:calc(100% - 48px)}
 body.app-shell .recognition-badge{white-space:normal;text-align:center}
 body.app-shell.receipt-editor:not(.capture-only) .payment-summary input{font-size:20px;padding:0;min-height:32px;width:110px}
 body.app-shell .payment-summary{flex-wrap:wrap}
 body.app-shell .dashboard-receipt{grid-template-columns:44px minmax(0,1fr) 12px;gap:10px;padding:14px 12px}
 body.app-shell .receipt-symbol{grid-row:1 / span 2;width:44px;height:54px;font-size:28px}
 body.app-shell .receipt-content{grid-column:2;grid-row:1}
 body.app-shell .receipt-content strong{font-size:18px}
 body.app-shell .receipt-content>span{font-size:14px}
 body.app-shell .receipt-content small{font-size:12px}
 body.app-shell .receipt-status{grid-column:2;grid-row:2;justify-self:start;max-width:100%;font-size:12px}
 body.app-shell .receipt-chevron{grid-column:3;grid-row:1 / span 2;font-size:25px}
 body.app-shell .dashboard-steps{font-size:14px;margin-bottom:26px}
 body.app-shell .capture-art{max-height:200px;margin:8px auto 16px}
 body.app-shell .capture-title{margin-bottom:12px}
 body.app-shell .capture-description{font-size:16px}
 body.app-shell .capture-choices button{min-height:84px;padding:14px;gap:12px}
 body.app-shell .capture-choices .capture-choice-copy{font-size:18px}
 body.app-shell .capture-choice-copy small{font-size:14px}
 body.app-shell .capture-choices .capture-choice-icon{width:46px;height:46px;font-size:30px}
 body.app-shell .login-art{max-height:230px}
 body.app-shell .login-copy .login-eyebrow{font-size:11px;letter-spacing:1.5px}
 body.app-shell .login-description{font-size:17px}
 body.app-shell .microsoft-login{font-size:16px;gap:10px;padding:14px}
 body.app-shell .microsoft-symbol{grid-template-columns:repeat(2,12px)}
 body.app-shell .microsoft-symbol i{height:12px}
 body.app-shell .login-arrow{font-size:26px}
 body.app-shell .recognition-main{grid-template-columns:72px minmax(0,1fr);gap:14px}
 body.app-shell .recognition-main p,body.app-shell .recognition-phases li{font-size:14px}
 body.app-shell .recognition-image img{height:142px}
 body.app-shell .scan-review-actions{display:grid;grid-template-columns:1fr;gap:10px}
 body.app-shell #document-scanner .scan-review-actions button{font-size:14px;min-height:44px}
}
@media(max-width:359px){:root{--app-gutter:12px;--brand-width:160px}.app-nav{gap:6px}.app-nav a{padding:8px}.app-footer{gap:8px}body.app-shell .app-footer button{font-size:13px}body.app-shell .capture-choices .capture-choice-icon{width:40px;height:44px}body.app-shell #document-scanner .scan-tools{gap:6px}}

body.app-shell #document-scanner .scanner-top-back{font-size:25px;background:transparent;color:#607493}

/* Destructive confirmation follows the supplied reference and shared shell. */
.delete-page main{text-align:left}
.delete-page main>h1{display:none}
.delete-back{display:inline-flex;align-items:center;gap:10px;min-height:44px;margin:0 0 20px;text-decoration:none;color:#0871d9;font-size:16px;font-weight:600}
.delete-back svg{width:22px;height:22px}
body.app-shell .delete-panel{padding:28px;text-align:left;border:1px solid #dbe5ef;border-radius:18px;box-shadow:0 5px 20px #234d7610;margin:0 0 24px}
.delete-emblem{display:flex;align-items:center;justify-content:center;width:64px;height:64px;background:#fdebec;color:#c53032;border-radius:50%;margin-bottom:20px}
.delete-emblem svg{width:34px;height:34px}
.delete-panel h2{font-size:32px;line-height:1.2;letter-spacing:-.7px;margin:0 0 12px;color:#0a2450}
.delete-panel .delete-question{font-size:18px;line-height:1.5;color:#66768b;margin:0 0 20px}
.delete-includes{background:#f1f6fb;border-radius:12px;padding:18px;margin:0 0 16px}
.delete-includes p{margin:0 0 14px;color:#687991;font-size:16px}
.delete-includes ul{list-style:none;margin:0;padding:0;display:grid;gap:16px}
.delete-includes li{display:flex;align-items:center;gap:14px;color:#142b52;font-size:17px}
.delete-includes svg{width:25px;height:25px;flex-shrink:0}
.delete-panel .delete-warning{display:flex;align-items:center;gap:14px;background:#fff3f3;border-radius:12px;padding:16px;color:#bf2c2f;font-size:15px;line-height:1.5;margin:0 0 22px}
.delete-warning svg{width:28px;height:28px;flex-shrink:0}
.delete-actions{display:grid;gap:12px}
.delete-actions form{margin:0}
body.app-shell .delete-actions :is(button,a){display:flex;align-items:center;justify-content:center;gap:12px;width:100%;min-height:48px;padding:13px 16px;font-size:16px;font-weight:600;border-radius:10px;text-decoration:none;line-height:1.4}
.delete-actions svg{width:23px;height:23px;flex-shrink:0}
body.app-shell .delete-actions .delete-confirm{background:linear-gradient(110deg,#cc3236,#bd292e);color:white;border:1px solid #c12d31}
body.app-shell .delete-actions .delete-cancel{background:white;color:#112d56;border:1px solid #9db7d5}
@media(max-width:600px){body.app-shell .delete-panel{padding:20px;border-radius:15px}.delete-panel h2{font-size:28px}.delete-panel .delete-question{font-size:16px}.delete-emblem{width:56px;height:56px;margin-bottom:18px}.delete-emblem svg{width:30px;height:30px}.delete-includes{padding:16px}.delete-includes li{font-size:16px;gap:12px}.delete-panel .delete-warning{padding:14px;font-size:14px;gap:12px}.delete-back{margin-bottom:16px}}

/* Native date inputs must match ordinary single-line fields, including iOS Safari. */
body.app-shell.receipt-editor:not(.capture-only) input:is([type=text],[type=date]):not([data-payment-total]){height:44px;min-width:0;box-sizing:border-box}
body.app-shell.receipt-editor:not(.capture-only) input[type=date]{appearance:none;-webkit-appearance:none;width:100%;max-width:100%}
body.app-shell.receipt-editor:not(.capture-only) input[type=date]::-webkit-datetime-edit{padding:0;min-width:0}
body.app-shell.receipt-editor:not(.capture-only) input[type=date]::-webkit-date-and-time-value{text-align:left}
@media(max-width:600px){body.app-shell.receipt-editor:not(.capture-only) input:is([type=text],[type=date]):not([data-payment-total]){height:48px}}

/* All receipt deletion actions share one visible destructive style. */
body.app-shell .danger-action,body.app-shell.receipt-editor .danger-action{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:48px;padding:13px 16px;margin:0;border:1px solid #c12d31;border-radius:10px;background:linear-gradient(110deg,#cc3236,#bd292e);color:#fff;font:600 16px/1.4 system-ui,-apple-system,sans-serif;text-align:center;text-decoration:none}
body.app-shell .danger-action svg{width:22px;height:22px;flex-shrink:0}
body.app-shell .danger-action:focus-visible{outline:3px solid #f19a9d;outline-offset:3px}
@media(hover:hover) and (pointer:fine){body.app-shell .danger-action:hover{filter:brightness(.94)}}


.receipt-page-range{text-align:center;color:#607493}
.receipt-pagination{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;margin:20px 0 8px;font-size:14px;text-align:center}
.receipt-pagination :is(a,span){display:flex;align-items:center;justify-content:center;min-height:44px;padding:10px 8px;border-radius:9px}
.receipt-pagination a{color:#075fc7;background:#eaf3ff;text-decoration:none;font-weight:600}
.receipt-pagination [aria-disabled=true]{color:#8c99ad}
@media(max-width:359px){.receipt-pagination{font-size:13px;gap:4px}.receipt-pagination :is(a,span){padding:10px 5px}}

.dashboard-receipt-entry{margin:14px 0;border:1px solid #dce4ef;border-radius:14px;background:#fff;overflow:hidden}
body.app-shell .dashboard-receipt-entry>.dashboard-receipt{margin:0;border:0;border-radius:0;box-shadow:none}
body.app-shell .dashboard-receipt-entry .dashboard-delete{width:calc(100% - 24px);margin:0 12px 12px}

body.app-shell #document-scanner .scanner-bottom-nav{display:flex;justify-content:flex-start;margin-top:16px}body.app-shell #document-scanner .scanner-bottom-nav .scanner-top-back{width:auto;min-width:44px;flex:none;margin:0;font-size:16px;white-space:nowrap}

body.app-shell.receipt-editor:not(.capture-only) .participant-row [data-participant-remove]{display:inline-flex;align-items:center;justify-content:center;width:auto;max-width:100%;min-height:44px;padding:10px 14px;margin:8px 0 4px;border:1px solid #97bdf0;border-radius:8px;background:#fff;color:#286bc0;white-space:normal;overflow-wrap:anywhere;line-height:1.4}
