/* Paper tickets and ink outlines. Mobile canvas: viewport - 2 x 16px;
   two columns share (canvas - 12px) / 2. No change to financial calculations. */
:root{--ink:#263b32;--green:#27684e;--muted:#58675d;--line:#cdd4c8;--paper:#fffefa;--ground:#f4f5ef;--yellow:#f8d679;--mint:#e2eee3;background:var(--ground);color:var(--ink);font-family:"Segoe UI","PingFang SC","Microsoft YaHei",Arial,sans-serif;font-size:14px;line-height:1.5}
body{background:var(--ground)}h1,h2,h3{color:var(--ink);letter-spacing:0}h1{font-size:28px;font-weight:800}h2{font-size:21px;font-weight:750}h3{font-size:16px;font-weight:750}.muted{color:var(--muted);font-size:13px;line-height:1.65}.green{color:#226448}.red{color:#a3342e}.amber{color:#88520d}
button,select,input,textarea{border-radius:10px;transition:border-color .12s,box-shadow .12s,transform .12s}button,select{min-height:44px}button{font-weight:600;border:1.5px solid var(--ink);background:var(--paper)}button:active:not(:disabled){transform:translate(1px,1px)}button:disabled{opacity:1;color:#657365;background:#e5e9df;cursor:wait;border-color:#aebbad}.primary{background:var(--green);border:2px solid var(--ink);box-shadow:3px 3px 0 var(--ink);font-weight:750}.primary:active{box-shadow:1px 1px 0 var(--ink)}button svg{stroke-width:1.9}.icon-button{border:1.5px solid var(--ink);background:var(--paper);flex:none}.text-button{min-height:44px;font-size:13px;font-weight:700;border:0}.primary:disabled{box-shadow:none}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid #d4a52e;outline-offset:3px}input::placeholder,textarea::placeholder{color:#667167}
.sidebar{width:224px;padding:28px 20px;background:var(--paper);border-right:2px solid var(--ink)}.brand{gap:10px;margin-bottom:32px}.brand svg{width:36px;height:36px;stroke-width:2}.brand strong{font-size:19px;font-weight:800}.brand small{font-size:12px}.sidebar nav{gap:10px}.sidebar nav button{border:1.5px solid transparent;border-radius:11px;color:var(--ink);font-size:14px;min-height:48px}.sidebar nav button.active{border-color:var(--ink);background:var(--yellow);box-shadow:3px 3px 0 var(--ink);font-weight:750}.sidebar-foot{font-size:13px}.main-area{margin-left:224px}
.app-header{height:76px;background:var(--paper);border-bottom:2px solid var(--ink);padding:0 32px}.app-identity{display:flex;align-items:center;gap:10px;min-width:0}.header-mark{width:32px;height:32px;fill:none;stroke:var(--ink);stroke-width:2}.header-wordmark{font-weight:800;font-size:17px;line-height:1.2}.header-wordmark small{display:block;color:var(--muted);font-weight:500;font-size:11px;margin-top:4px}.preferences{gap:8px}.preferences select{border:1.5px solid var(--ink);background:var(--paper);font-weight:600;font-size:13px}main{max-width:1200px;padding:28px 32px}.page-heading{margin-bottom:22px;align-items:center}.date-line{font-size:12px;margin-bottom:4px}.page-heading .muted{margin-top:6px}.page-heading>.primary{min-height:46px;padding:10px 16px}.page-heading>div{min-width:0}
.metrics{border:2px solid var(--ink);border-radius:14px;background:var(--paper);padding:20px 0;box-shadow:4px 4px 0 #dce2d4;margin-bottom:22px;overflow:hidden}.metric{padding:0 22px}.metric+.metric{border-color:#bdc9bc}.metric>span{font-size:13px;margin-bottom:7px;color:#4d6153}.metric strong{font-size:29px;font-weight:750;letter-spacing:-.5px;overflow-wrap:anywhere}.metric small{font-size:12px;margin-top:5px}.metric strong:not(.red){color:var(--ink)}
.toolbar{gap:12px;margin:20px 0 16px}.search{max-width:420px}.search input{border:1.5px solid var(--ink);border-radius:10px;min-height:46px;background:var(--paper);font-size:14px;padding:10px 13px}.toolbar select,.toolbar input[type=month]{border:1.5px solid var(--ink);background:var(--paper);font-size:14px;min-height:44px}.toolbar-right{flex-wrap:wrap}.toolbar button{font-size:13px}.order-list{gap:14px}.order-card{border:1.5px solid var(--ink);border-radius:13px;padding:20px 22px;box-shadow:3px 3px 0 #dce2d4;background:var(--paper)}.order-card:hover{border-color:var(--green);box-shadow:3px 3px 0 #b7d1ba}.order-number{color:var(--ink);font-size:12px;font-weight:600}.status{font-size:12px;border:1px solid #9c9f8f;padding:3px 8px;background:#f5f0df;color:#64512f;white-space:nowrap;flex:none}.status.done{border-color:#9db79d;color:#24583c;background:#e4eee2}.route{gap:12px;font-size:17px;font-weight:750}.order-bottom{border-top:1px dashed #a5b4a5;margin-top:16px;padding-top:14px;gap:14px}.order-bottom span{font-size:12px}.order-bottom strong{font-size:16px;font-weight:700}.order-bottom>div:last-child strong{color:var(--green)}.order-bottom>div:last-child strong.red{color:#a3342e}
.empty{border:2px solid var(--ink);border-radius:15px;background:var(--paper);padding:24px;box-shadow:4px 4px 0 #dce2d4}.empty .scene-art{display:block;width:220px;max-width:70%;height:auto;margin:0 auto 14px}.empty h3{font-size:19px;margin-bottom:8px}.empty p{max-width:340px}.empty .primary{margin-top:18px}.empty>svg{width:68px;height:54px}.table-panel{border:1.5px solid var(--ink);border-radius:12px;background:var(--paper)}th{font-size:12px;color:var(--muted)}td{font-size:14px}th,td{padding:14px 18px}.mini{font-size:12px}.void{opacity:.65}.panel{border:1.5px solid var(--ink);border-radius:13px;background:var(--paper);padding:22px}.panel h3{margin-bottom:16px}.summary-grid{gap:16px}.balance-row{font-size:14px;padding:13px 0;align-items:center}.balance-row strong{overflow-wrap:anywhere}.balance-row span{min-width:0}.flow-strip{border:1px solid var(--ink);height:13px;border-radius:4px}.flow-strip i:nth-child(1){background:#c6d7b8}.flow-strip i:nth-child(2){background:#a8bea0}.flow-strip i:nth-child(3){background:#7b9b79}.flow-strip i:nth-child(4){background:#29694d}
.contact-groups{gap:20px}.contact-card{border:1.5px solid var(--ink);border-radius:12px;background:var(--paper);box-shadow:3px 3px 0 #dce2d4;padding:16px 18px}.contact-top strong{font-size:16px;overflow-wrap:anywhere}.contact-price{font-size:15px;font-weight:750;background:#edf3e8;display:inline-block;padding:5px 9px;border-radius:5px;margin:7px 0}.contact-list{gap:12px}.contact-card .muted{font-size:13px}.contact-groups .toolbar h3{font-size:18px}.contact-groups .toolbar{margin-top:10px}
footer{font-size:12px;gap:14px;margin-top:24px}footer button{font-size:12px;min-height:44px;text-decoration:underline;text-underline-offset:3px}.notice,.access-note{border:1px solid #ba9b4c;background:#fff4d3;color:#694a10;font-size:13px;line-height:1.6;border-radius:9px}.access-note{margin-bottom:18px}.error{font-size:14px;line-height:1.6}.error:empty{display:none}#toast{background:var(--ink);border:1px solid var(--ink);border-radius:10px;box-shadow:3px 3px 0 #a6b7a0;font-size:14px}
/* Forms keep the invoice's reading order: supplier, weight, price, total. */
dialog{border:2px solid var(--ink);border-radius:17px;box-shadow:6px 6px 0 #263b3240;max-height:92dvh;max-width:700px;background:var(--paper);padding:0;overscroll-behavior:contain}dialog::backdrop{background:#172e2766}.dialog-heading{border-bottom:1.5px solid var(--ink);background:var(--paper);padding:15px 22px;z-index:3;min-height:65px}.dialog-heading h2{font-size:20px}.dialog-heading .icon-button{width:44px;min-height:44px;border:1px solid var(--ink);font-size:27px}#modal-body,#contact-body{padding:20px 22px}.form-grid{gap:16px 14px}.form-grid label,.contact-chooser>label{font-size:13px}.form-grid label>span,.contact-chooser>label>span{color:#40564a;font-weight:600;margin-bottom:7px;line-height:1.5}.form-grid input,.form-grid select,.form-grid textarea,.login-form input{border:1.5px solid #789080;border-radius:9px;background:#fff;font-size:16px;min-height:48px;padding:11px 12px;line-height:1.5;min-width:0}.form-grid input[type=number]{appearance:textfield;font-weight:650}.form-grid input::-webkit-inner-spin-button,.form-grid input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.form-grid textarea{font-size:15px}.field-unit{display:block;font-weight:500;color:var(--muted);font-size:12px;margin-top:2px}.form-grid .money-field>span{min-height:42px}.form-block{margin:0 0 20px;border:0;padding:0;min-width:0}.form-block legend{font-size:16px;font-weight:750;padding:0;margin:0 0 14px;display:flex;align-items:center;gap:8px}.form-block legend svg{width:21px;height:21px;stroke:var(--green)}.form-block+.form-block{border-top:1px dashed #a4b3a3;padding-top:20px}.form-actions{position:sticky;bottom:-20px;margin:20px -22px -20px;padding:14px 22px;background:var(--paper);border-top:1.5px solid var(--ink);z-index:2;gap:12px}.form-actions button{min-height:48px}.form-actions .primary{min-width:140px}.contact-controls{gap:8px;align-items:stretch;margin:0 0 8px}.contact-controls select{font-size:14px;min-width:0}.contact-controls button{min-height:48px;padding:8px 11px;font-size:12px;flex:none}.contact-chooser{padding:0}.contact-chooser>label>span{display:flex;align-items:center;gap:6px}.contact-chooser input{width:100%}.recalc-wrap{align-items:end;padding-bottom:1px}.recalc-wrap button{min-height:48px;font-size:13px;box-shadow:none;background:#eef3e8}.fold-section{border:1.5px solid var(--ink);border-radius:10px;margin:16px 0;background:#f1f5ec}.fold-section>summary{list-style:none;cursor:pointer;padding:14px;font-weight:700;display:flex;gap:10px;align-items:center;justify-content:space-between;min-height:48px}.fold-section>summary::-webkit-details-marker{display:none}.fold-section>summary::after{content:'+';font-size:22px;line-height:1}.fold-section[open]>summary::after{content:'−'}.fold-section>summary small{font-size:12px;color:var(--muted);font-weight:500;margin-left:auto}.fold-content{padding:4px 14px 16px}.fold-content>.muted{margin-bottom:14px}.note-field{display:block;margin-top:16px}.form-section{font-size:14px}.detail-meta{gap:18px 14px}.detail-meta span{font-size:13px}.detail-meta strong{font-size:16px}.detail-actions{gap:10px}.detail-actions button{min-height:46px}.photo-button{min-height:44px;font-size:14px;gap:8px}.photos img{border:1.5px solid var(--ink)}
/* A compact illustrated cover for the two-person ledger. */
.login-layout{max-width:1060px;gap:70px;padding:42px 32px}.login-story{padding:20px}.login-story h1{font-size:34px;font-weight:800}.login-story p{font-size:16px}.paper-mark{stroke:var(--ink)}.paper-art img{width:100%;height:auto;display:block}.login-form{border:2px solid var(--ink);border-radius:18px;box-shadow:6px 6px 0 var(--yellow);padding:28px;background:var(--paper)}.login-language{margin-bottom:18px}.login-language select{border:1.5px solid var(--ink);font-size:14px}.login-form h2{font-size:23px}.login-form .muted{margin:8px 0 20px}.people-picker{gap:14px;margin-bottom:20px}.person-choice{border:1.5px solid var(--ink);background:#f8faf2;padding:15px 10px;min-height:144px;border-radius:12px;gap:5px}.person-choice:hover{border-color:var(--green);background:#edf4e8}.person-choice[aria-pressed=true]{background:var(--yellow);border-color:var(--ink);box-shadow:3px 3px 0 var(--ink)}.person-choice strong{font-size:17px}.person-choice small{font-size:12px;color:var(--muted)}.avatar,.avatar svg{width:60px;height:60px}.avatar{border:1.5px solid var(--ink);border-radius:50%;overflow:hidden}.enter-button{min-height:49px;margin:12px 0 20px}.password-label{font-size:14px}.login-form .password-label input{font-size:18px;letter-spacing:2px}.entry-links{gap:18px;justify-content:space-between}.entry-links a,.install-link{font-size:13px}.install-link{min-height:44px}.login-form label{margin-bottom:0}
@media(max-width:1100px){.sidebar{width:190px;padding:24px 16px}.main-area{margin-left:190px}.brand strong{font-size:17px}main{padding:24px}.app-header{padding:0 24px}.metric{padding:0 16px}.metric strong{font-size:26px}.contact-groups{grid-template-columns:1fr}.summary-grid{grid-template-columns:1fr}}
@media(max-width:760px){
 body{padding-bottom:calc(86px + env(safe-area-inset-bottom,0px))}body:has(dialog[open]){overflow:hidden}
 .sidebar{width:100%;height:auto;inset:auto 0 0;padding:7px 12px calc(7px + env(safe-area-inset-bottom,0px));border-right:0;border-top:2px solid var(--ink);background:var(--paper);z-index:10}.sidebar .brand,.sidebar-foot{display:none}.sidebar nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}.sidebar nav button{min-height:56px;display:flex;flex-direction:column;justify-content:center;padding:6px 2px;gap:3px;font-size:12px;border-radius:9px;white-space:nowrap}.sidebar nav button.active{box-shadow:2px 2px 0 var(--ink)}.sidebar nav button svg{width:21px;height:21px}.main-area{margin:0}
 .app-header{height:68px;padding:0 16px;gap:8px}.app-identity{gap:7px}.header-mark{width:27px;height:30px;flex:none}.header-wordmark{font-size:15px}.header-wordmark small{font-size:11px}.preferences{gap:5px}.preferences select{font-size:12px;min-height:42px;padding:7px 5px;max-width:92px}.preferences select#lang{max-width:80px}.preferences .icon-button{width:40px;min-height:42px;padding:8px}.preferences .icon-button svg{width:18px}
 main{padding:20px 16px 12px}.page-heading{gap:12px;margin-bottom:18px}.page-heading h1{font-size:26px;line-height:1.3}.page-heading>.primary{font-size:13px;padding:10px 13px;min-height:46px}.page-heading .muted{font-size:12px;line-height:1.55;max-width:240px}.date-line{font-size:12px;margin-bottom:3px}
 .metrics{grid-template-columns:repeat(2,minmax(0,1fr));padding:0;border-radius:12px;gap:0;margin-bottom:18px}.metric{padding:14px 16px}.metric:first-child{grid-column:1/-1;background:var(--mint);display:grid;grid-template-columns:minmax(0,1fr) auto;gap:1px 10px;align-items:center;border-bottom:1.5px solid var(--ink)}.metric:first-child>span{margin:0;min-height:0;font-weight:600;font-size:13px}.metric:first-child strong{grid-column:2;grid-row:1/3;font-size:29px;max-width:220px;text-align:right}.metric:first-child small{margin:1px 0 0;grid-column:1;font-size:11px}.metric:nth-child(2){border-left:0}.metric:nth-child(3){border-left:1px solid #bcc9b8}.metric>span{font-size:12px;min-height:0;margin-bottom:6px}.metric strong{font-size:24px;font-weight:750}.metric small{font-size:11px}.toolbar{margin:16px 0 12px;gap:8px}.search{min-width:160px;max-width:none}.search input{font-size:14px;min-height:46px}.toolbar select{font-size:13px;min-height:46px;max-width:140px}.toolbar button{font-size:12px}.toolbar-right{gap:8px}.order-card{padding:15px 16px;border-radius:12px}.order-top{gap:8px;margin-bottom:13px}.order-number{font-size:11px}.status{font-size:11px;padding:3px 6px}.route{font-size:16px;gap:9px;line-height:1.5}.route span{flex:1}.route svg{width:18px}.order-bottom{grid-template-columns:1fr 1fr;gap:14px;margin-top:14px;padding-top:13px}.order-bottom span{font-size:12px}.order-bottom strong{font-size:17px}.order-bottom>div:nth-child(even){text-align:right}.empty{padding:20px 18px}.empty .scene-art{width:190px;max-width:80%;margin-bottom:10px}.empty h3{font-size:18px}.empty p{font-size:13px}.empty .primary{font-size:14px}.contact-card{padding:14px 16px}.contact-top strong{font-size:16px}.contact-price{font-size:14px}.contact-groups{gap:18px}.contact-groups .toolbar{margin-top:4px}.contact-groups .toolbar h3{font-size:17px}.panel{padding:18px}.balance-row{font-size:13px;gap:10px}.balance-row strong{max-width:58%}.summary-grid{gap:14px;margin-top:18px}
 .cash-table,.cash-table tbody{display:block;white-space:normal}.cash-table thead{display:none}.cash-table tr{display:grid;grid-template-columns:1fr auto;gap:7px 12px;padding:16px;border-bottom:1px dashed #a8b7a4;align-items:center}.cash-table tr:last-child{border:0}.cash-table td{display:block;border:0;padding:0;min-width:0;font-size:13px}.cash-table td:nth-child(2){grid-column:1;grid-row:1;font-weight:750;font-size:15px}.cash-table td:nth-child(4){grid-column:2;grid-row:1/3;font-weight:750;font-size:22px;text-align:right;overflow-wrap:anywhere}.cash-table td:nth-child(4) small{display:block;font-size:11px;font-weight:500;color:var(--muted)}.cash-table td:nth-child(3){grid-column:1;grid-row:2}.cash-table td:nth-child(3) button{padding:0;min-height:28px;font-size:12px}.cash-table td:nth-child(1){grid-column:1;grid-row:3;color:var(--muted);font-size:12px}.cash-table td:nth-child(5){grid-column:2;grid-row:3;text-align:right;color:var(--muted);font-size:12px}.cash-table td:nth-child(6){grid-column:1/-1;grid-row:4;text-align:right}.cash-table td:nth-child(6) button{min-height:32px;padding:2px 0;color:#8b4036;font-size:12px}.cash-table .mini{font-size:12px;font-weight:400;overflow-wrap:anywhere}.table-panel{box-shadow:3px 3px 0 #dce2d4}
 footer{font-size:11px;gap:14px;margin-top:18px}footer #sync-state{flex-basis:100%}footer button{font-size:12px}#toast{bottom:calc(90px + env(safe-area-inset-bottom,0px));font-size:13px}
 dialog{width:100%;max-width:none;max-height:100dvh;height:100dvh;margin:0;border:0;border-radius:0;box-shadow:none}.dialog-heading{padding:12px 16px;min-height:66px;position:sticky;top:0}.dialog-heading h2{font-size:20px}.dialog-heading .icon-button{min-height:42px;width:42px}#modal-body,#contact-body{padding:18px 16px 20px}.form-grid{gap:15px 12px}.form-grid label,.contact-chooser>label{font-size:13px}.form-grid input,.form-grid select,.form-grid textarea{font-size:16px;min-height:48px;padding:11px 10px}.form-grid .money-field>span{min-height:44px}.field-unit{font-size:11px;line-height:1.4}.form-block{margin-bottom:20px}.form-block legend{font-size:16px}.form-actions{bottom:0;margin:20px -16px -20px;padding:12px 16px calc(12px + env(safe-area-inset-bottom,0px));gap:12px}.form-actions button{flex:1;font-size:15px;min-height:49px}.form-actions .primary{flex:2;min-width:0}.contact-controls select{font-size:14px}.contact-controls button{font-size:12px;padding:8px;min-height:48px}.contact-chooser>label>span{margin:0 0 8px}.recalc-wrap button{font-size:12px;padding:8px}.fold-content{padding:2px 12px 15px}.fold-section>summary{padding:13px 12px}.fold-section>summary small{font-size:11px}.detail-meta{gap:16px 12px}.detail-meta strong{font-size:16px}.detail-actions button{font-size:14px}.photos img{height:96px}
 .login-layout{display:block;min-height:100dvh;padding:24px 20px 40px}.login-story{display:flex;align-items:center;gap:10px;padding:0 0 19px;flex-wrap:wrap}.login-story .paper-mark{width:35px;height:35px;margin:0}.login-story h1{font-size:25px}.login-story p{font-size:13px;margin:0;width:100%;max-width:none}.paper-art{display:none}.login-form{padding:22px;border-radius:16px;box-shadow:5px 5px 0 var(--yellow)}.login-language{margin-bottom:14px}.login-language select{min-height:40px;font-size:13px}.login-form h2{font-size:22px}.login-form .muted{font-size:13px;margin:7px 0 18px}.people-picker{gap:12px;margin-bottom:16px}.person-choice{min-height:136px;padding:13px 8px}.login-form .password-label input{min-height:48px}.access-note{font-size:12px;padding:10px 12px}.entry-links{gap:12px}.entry-links a,.install-link{font-size:12px}.entry-links .install-link{padding:0}
}
@media(max-width:374px){.app-header{padding:0 12px}.header-mark{width:24px}.app-identity{gap:5px}.header-wordmark{font-size:14px}.preferences{gap:4px}.preferences select{max-width:82px;font-size:11px;padding:6px 3px}.preferences select#lang{max-width:69px}.preferences .icon-button{width:36px}.page-heading>.primary{padding:10px;font-size:12px}.metric{padding:13px 12px}.metric strong{font-size:22px}.metric:first-child strong{font-size:27px;max-width:185px}.form-grid{gap:14px 10px}.contact-controls button{font-size:11px}.sidebar nav button{font-size:11px}.login-layout{padding:20px 16px}.login-form{padding:20px}.person-choice{min-height:128px}.avatar,.avatar svg{width:54px;height:54px}}
@media(prefers-reduced-motion:reduce){button,select,input,textarea{transition:none}button:active:not(:disabled){transform:none}}

/* Preserve full language names while the wordmark wraps on narrow phones. */
@media(max-width:760px){.preferences select#lang{max-width:none;width:94px}.preferences select#currency{max-width:88px}.header-wordmark{overflow-wrap:anywhere}.cash-table{min-width:0!important}.fold-section>summary small{max-width:65%}}
@media(max-width:374px){.preferences select#lang{width:89px}.preferences select#currency{max-width:78px}}
.cash-table td>small{display:block;font-size:11px;font-weight:400}

/* Refined paper, ink and forest palette; interaction feedback stays immediate. */
:root{--ink:#263b35;--green:#25694f;--muted:#50675c;--paper:#fffef9;--ground:#f3f5ef;--yellow:#f5d47b;--mint:#e5f0e8;--focus:#a86f08}
::selection{background:#f5d47b;color:#263b35}
input,textarea{caret-color:var(--green)}
button,select,input,textarea{transition:background-color 140ms ease,border-color 140ms ease,color 140ms ease,box-shadow 140ms ease,transform 100ms ease}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
button svg{flex:none;stroke-width:1.9}
.primary{background:var(--green);color:#fff;box-shadow:3px 3px 0 var(--ink)}
.primary:active:not(:disabled){background:#1c543e;box-shadow:1px 1px 0 var(--ink);transform:translate(2px,2px)}
.sidebar nav button.active{background:var(--yellow)}
.sidebar nav button.active svg{stroke-width:2.2}
.person-choice[aria-pressed=true]{background:var(--yellow)}
.icon-button:active:not(:disabled),.sidebar nav button:active:not(:disabled),.person-choice:active:not(:disabled){background:#e5f0e8}
@media(hover:hover){button:not(:disabled):not(.primary):not(.text-button):hover{background:#edf4ea;border-color:var(--green)}.primary:not(:disabled):hover{background:#1e5a43}.text-button:hover{color:#164f38;text-decoration:underline;text-underline-offset:3px}.sidebar nav button.active:hover{background:#f1ca66}}
button:disabled,.primary:disabled{background:#e6ebe3;color:#5e6a61;border-color:#aab7aa;box-shadow:none}
h1,h2,h3{text-wrap:balance}.muted,.access-note,.notice{text-wrap:pretty}
.header-wordmark>span{white-space:nowrap}
.page-heading>.primary,.toolbar button,.contact-controls button,.form-actions button{white-space:nowrap}
.fold-section>summary{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 10px;align-items:center}
.fold-section>summary .fold-title{font-weight:750;min-width:0}
.fold-section>summary small{grid-column:1;grid-row:2;max-width:none;margin:0;line-height:1.5}
.fold-section>summary::after{grid-column:2;grid-row:1/3;align-self:center}
.order-card{transition:border-color 140ms ease,box-shadow 140ms ease,background-color 140ms ease}
.order-card:active{background:#f3f8ef}
#toast{width:max-content;max-width:calc(100vw - 32px);text-wrap:balance}
@media(max-width:760px){
 .header-mark{display:none}
 .app-header{height:auto;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px;gap:5px 8px;padding:8px 16px 10px}
 .app-identity{grid-column:1/3;grid-row:1}
 .header-wordmark{display:flex;align-items:baseline;gap:9px;font-size:15px;overflow-wrap:normal}
 .header-wordmark small{display:inline;margin:0;font-size:12px}
 .preferences{display:contents}
 .preferences select#lang{grid-column:1;grid-row:2;width:100%;max-width:none}
 .preferences select#currency{grid-column:2/4;grid-row:2;width:100%;max-width:none}
 .preferences .icon-button{grid-column:3;grid-row:1;width:44px;min-height:44px}
 .page-heading>div{flex:1}
 .page-heading>.primary{flex:none}
 .fold-section>summary small{max-width:none}
 html[lang=vi] .form-grid label:has([name=purchaseTons]),html[lang=vi] .form-grid label:has([name=saleTons]){grid-column:1/-1}
}
@media(max-width:374px){.app-header{padding-inline:12px}.header-wordmark{font-size:14px}.sidebar nav button{font-size:11px}}
@media(prefers-reduced-motion:reduce){button,select,input,textarea,.order-card{transition:none}button:active:not(:disabled){transform:none}.primary:active:not(:disabled){transform:none}}

/* Stretch the caption, not the control, so fields in each grid row align even
   when one caption has an extra unit or a translated label wraps. */
.form-grid>label{display:flex;flex-direction:column;min-width:0}
.form-grid>label>span{flex:1 0 auto}
.form-grid>label>input,.form-grid>label>select,.form-grid>label>textarea{flex:none}
.form-grid input:not([type=hidden]),.form-grid select{height:48px}
.contact-controls{margin:10px 0 8px}
.recalc-wrap{padding-bottom:0}
/* In Vietnamese, keep the calculation button beside its own total after
   the longer weight captions take a full row. */
@media(max-width:760px){html[lang=vi] .form-grid label:has([name=purchaseUnit]),html[lang=vi] .form-grid label:has([name=saleUnit]){grid-column:1/-1}}

/* Compact top bar: native selectors keep a 44px touch target. */
@media(max-width:760px){
 .app-header{height:64px;display:flex;gap:8px;padding:8px 12px}
 .app-identity{flex:1;min-width:0}
 .header-wordmark>span{display:none}
 .header-wordmark small{font-size:14px;font-weight:700;color:var(--ink);white-space:nowrap}
 .preferences{display:flex;gap:5px;align-items:center;flex:none}
 .preferences select#lang{width:100px;max-width:none;min-height:44px;font-size:12px;padding:6px 4px}
 .preferences select#currency{width:78px;max-width:none;min-height:44px;font-size:12px;padding:6px 4px}
 .preferences .icon-button{width:44px;min-height:44px}
 html[lang=vi] .contact-controls{flex-wrap:wrap}
 html[lang=vi] .contact-controls select{flex:1 1 100%;width:100%}
 html[lang=vi] .contact-controls button{margin-left:auto}
 html[lang=vi] #contact-form label:has([name=price]){grid-column:1/-1}
}

/* Give the date and hint their own full-width lines. Align secondary metric
   labels, numbers and units on shared rows, even when a label wraps. */
@media(max-width:760px){
 .page-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 10px;align-items:center}
 .page-heading>div{display:contents}
 .page-heading .date-line{grid-column:1/-1;grid-row:1;margin:0;white-space:nowrap}
 .page-heading h1{grid-column:1;grid-row:2;min-width:0;font-size:clamp(21px,6vw,26px);text-wrap:normal}
 .page-heading>.primary{grid-column:2;grid-row:2}
 .page-heading .muted{grid-column:1/-1;grid-row:3;max-width:none;margin-top:2px}
 .metric:nth-child(2)>span,.metric:nth-child(3)>span{min-height:3em}
 @supports(grid-template-rows:subgrid){
  .metrics{grid-template-rows:auto auto auto auto}
  .metric:first-child{grid-row:1}
  .metric:nth-child(2),.metric:nth-child(3){grid-row:2/span 3;display:grid;grid-template-rows:subgrid;align-items:start}
  .metric:nth-child(2)>span,.metric:nth-child(3)>span{grid-row:1;min-height:0}
  .metric:nth-child(2)>strong,.metric:nth-child(3)>strong{grid-row:2}
  .metric:nth-child(2)>small,.metric:nth-child(3)>small{grid-row:3}
 }
}

/* Familiar portraits and small functional icons for people and settings. */
.header-avatar{width:34px;height:34px;border:1.5px solid var(--ink);border-radius:50%;overflow:hidden;flex:none;display:grid;place-items:center;background:#e3efe6}
.header-avatar svg{width:100%;height:100%;display:block}
.header-mark{display:none}
.settings-profile{display:flex;align-items:center;gap:13px;padding:14px 16px;border:1.5px solid var(--ink);border-radius:12px;background:var(--mint);margin-bottom:18px}
.settings-profile .avatar,.settings-profile .avatar svg{width:48px;height:48px;flex:none}
.settings-profile span:not(.avatar){display:block;color:var(--muted);font-size:12px}
.settings-profile strong{display:block;font-size:17px;margin-top:2px}
.settings-section{border:1.5px solid var(--ink);border-radius:12px;padding:16px;background:var(--paper)}
.settings-section-title{display:flex;gap:10px;align-items:center;margin-bottom:16px;font-size:15px}
.settings-symbol{width:36px;height:36px;border:1px solid var(--ink);border-radius:9px;display:grid;place-items:center;background:var(--yellow);flex:none}
.settings-symbol svg,.settings-actions svg{width:19px;height:19px;stroke:currentColor;flex:none}
.settings-section .form-grid{gap:12px}
.settings-section .form-grid label>span{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.settings-save{margin-top:16px;width:100%}
.settings-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:16px}
.settings-actions button{display:flex;align-items:center;justify-content:center;gap:8px;text-align:center;min-width:0}
.settings-note{margin-top:16px}
.partner-form .form-grid label>span>svg{width:16px;height:16px;vertical-align:-3px;margin-right:7px;color:var(--green);stroke-width:1.8}
.partner-form .field-unit{padding-left:23px}
@media(max-width:760px){
 .header-avatar{width:30px;height:30px}
 .app-identity{gap:6px}
 .settings-section{padding:14px}
 .settings-actions button{font-size:13px;padding:9px 6px}
}
@media(max-width:374px){.app-header{gap:5px;padding-inline:10px}.app-identity{gap:4px}.header-avatar{width:28px;height:28px}.header-wordmark small{font-size:12px}.preferences{gap:3px}.preferences select#lang{width:94px}.preferences select#currency{width:72px}}

/* The orders home keeps all three metrics and the full 44px controls while
   reducing the empty space between the first-screen sections. */
@media(max-width:760px){
 #app:has(#nav [data-tab="orders"].active) main{padding-top:12px}
 #app:has(#nav [data-tab="orders"].active) .page-heading{gap:2px 10px;margin-bottom:12px}
 #app:has(#nav [data-tab="orders"].active) .page-heading .muted{margin-top:0;line-height:1.45}
 #app:has(#nav [data-tab="orders"].active) .metrics{margin-bottom:12px}
 #app:has(#nav [data-tab="orders"].active) .metric{padding:10px 12px}
 #app:has(#nav [data-tab="orders"].active) .metric:first-child strong{font-size:27px}
 #app:has(#nav [data-tab="orders"].active) .metric:not(:first-child) strong{font-size:22px}
 #app:has(#nav [data-tab="orders"].active) .metric>span{margin-bottom:4px}
 #app:has(#nav [data-tab="orders"].active) .metric small{margin-top:3px}
 #app:has(#nav [data-tab="orders"].active) .toolbar{flex-wrap:nowrap;gap:8px;margin:12px 0}
 #app:has(#nav [data-tab="orders"].active) .toolbar .search{min-width:0;flex:1}
 #app:has(#nav [data-tab="orders"].active) .toolbar #filter{width:110px;max-width:110px;flex:none}
}
.contact-volume{display:flex;align-items:center;gap:7px;color:var(--ink);font-size:13px;font-weight:600;margin:7px 0}
.contact-volume svg{width:16px;height:16px;flex:none;color:var(--green)}
.order-statuses{display:flex;align-items:center;justify-content:flex-end;gap:5px;flex-wrap:wrap}
.invoice-list-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid var(--line)}
.invoice-list-row:last-child{border-bottom:0}.invoice-list-row>button{text-align:left;min-width:0;overflow-wrap:anywhere}.invoice-list-row>div{text-align:right;min-width:0}.invoice-list-row .mini{line-height:1.5}.invoice-help{margin:0 0 16px}
.due-alert{display:flex;align-items:center;gap:8px;width:100%;margin:0 0 14px;padding:10px 12px;text-align:left;border:1.5px solid #9a7029;background:#fff4d8;color:#694a10;font-size:13px;line-height:1.5}.due-alert svg{width:19px;height:19px;flex:none}.term-help{margin-top:-5px}
@media(max-width:760px){.invoice-list-row{gap:8px}.invoice-list-row>div{max-width:60%}.order-statuses .status{font-size:10px}.detail-actions button svg{width:16px;height:16px}}
@media(max-width:760px){#invoice-form .money-field{grid-column:1/-1}html[lang=vi] .form-grid label:has([name=term_days]),html[lang=vi] .form-grid label:has([name=term_basis]),html[lang=vi] .form-grid label:has([name=buyerTermDays]),html[lang=vi] .form-grid label:has([name=buyerTermBasis]),html[lang=vi] .form-grid label:has([name=supplierTermDays]),html[lang=vi] .form-grid label:has([name=supplierTermBasis]){grid-column:1/-1}}

/* Prioritize the transaction and keep a live, readable estimate. */
#order-form .weight-hint{margin:-6px 0 0;font-size:12px;line-height:1.4}
#order-form .amount-actions{display:flex;flex-wrap:wrap;gap:8px}
#order-form .amount-actions button{font-size:12px;min-height:40px;flex:1}
#order-form .profit-preview{display:flex;flex-direction:column;gap:5px;padding:15px;border-radius:12px;background:#e3f0e8;color:#183e2d}
#order-form .profit-preview span{font-size:13px;font-weight:700}
#order-form .profit-preview strong{font-size:23px;line-height:1.2;overflow-wrap:anywhere}
#order-form .profit-preview strong.negative{color:#a72a26}
#order-form .profit-preview small{font-size:12px;line-height:1.5}
#order-form .tax-preview,#order-form #freight-total{font-size:13px;line-height:1.5;overflow-wrap:anywhere}
#order-form .extra-order{margin-top:14px}

.invoice-files{display:grid;gap:10px}.invoice-file{display:flex;align-items:center;justify-content:space-between;gap:12px;background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:15px}.invoice-file>div{min-width:0;overflow-wrap:anywhere}.invoice-file a{flex:none;color:var(--green);font-weight:700;font-size:13px}.invoice-file .mini{margin-top:5px}.profit-preview #cash-difference{font-size:18px}
/* Four equal mobile destinations; keep the existing active color and icon weight. */
@media(max-width:760px){
 body{padding-bottom:calc(96px + env(safe-area-inset-bottom,0px))}
 .sidebar{padding:8px max(8px,env(safe-area-inset-right,0px)) calc(8px + env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px))}
 .sidebar nav{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;align-items:stretch}
 .sidebar nav button{min-width:0;min-height:68px;padding:6px 3px;gap:4px;font-size:13px;line-height:1.35;letter-spacing:normal;white-space:normal;overflow-wrap:anywhere;text-align:center}
 .sidebar nav button svg{width:22px;height:22px;flex:none}
 #toast{bottom:calc(100px + env(safe-area-inset-bottom,0px))}
}

.flow-strip i:nth-child(4){background:#94b599}.flow-strip i:nth-child(5){background:#29694d}

.purchase-invoice-list{margin:20px 0}.purchase-invoice-list h3{margin-bottom:10px}.purchase-invoice-list .invoice-file{margin-bottom:8px}.purchase-invoice-list .invoice-file strong{overflow-wrap:anywhere;min-width:0}

.detail-meta strong .detail-unit{font-size:12px;font-weight:500;line-height:1.4;color:var(--muted);white-space:nowrap}

.ytd-panel{margin-top:18px}
.ytd-head{display:flex;align-items:center;justify-content:space-between;gap:16px}
.ytd-head h3{margin:0;font-size:16px}
.ytd-range{margin:4px 0 0;color:var(--muted);font-size:12px;white-space:nowrap;font-variant-numeric:tabular-nums}
.ytd-result{display:flex;flex-direction:column;align-items:flex-end;gap:3px;min-width:0}
.ytd-result strong{font-size:28px;line-height:1.2;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.ytd-result>span,.ytd-totals dd>span{font-size:12px;color:var(--muted);white-space:nowrap}
.ytd-totals{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:16px 0 0;padding-top:14px;border-top:1px solid var(--line)}
.ytd-totals>div{min-width:0;display:grid;grid-template-rows:1fr auto;gap:5px}
.ytd-totals dt{font-size:12px;line-height:1.5;color:var(--muted)}
.ytd-totals dd{display:flex;align-items:baseline;gap:5px;flex-wrap:wrap;margin:0}
.ytd-totals dd strong{font-size:18px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere;min-width:0}
.ytd-help{margin:12px 0 0;font-size:12px;line-height:1.6}
@media(max-width:480px){.ytd-head{align-items:flex-start;flex-direction:column;gap:12px}.ytd-result{align-items:baseline;flex-direction:row;flex-wrap:wrap;gap:6px 8px}.ytd-totals{gap:12px}.ytd-head h3{font-size:15px}}

.statement-entry{display:flex;align-items:center;gap:12px;margin:0 0 12px}
.statement-entry button{display:inline-flex;align-items:center;gap:7px;flex:none;font-size:13px}
.statement-entry button svg{width:18px;height:18px}
.statement-entry>.muted{font-size:12px;line-height:1.5}
.statement-form>p:first-child{margin:0 0 16px}
.statement-selection-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:18px 0 8px}
.statement-selection-heading h3{font-size:14px;margin:0}
.statement-selection-heading>div{display:flex;gap:4px}
.statement-options{display:grid;gap:8px;max-height:42dvh;overflow:auto}
.statement-option{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:10px;padding:12px;cursor:pointer}
.statement-option:has(input:checked){background:var(--mint);border-color:var(--green)}
.statement-option input{width:20px;height:20px;flex:none;accent-color:var(--green)}
.statement-option>span{display:flex;flex-direction:column;gap:4px;min-width:0}
.statement-option strong{font-size:14px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.statement-option small{font-size:12px;color:var(--muted)}
.statement-option-money{margin-left:auto;text-align:right}
.statement-unavailable{background:#f0f1ec;cursor:default}
.statement-selection-total{margin-top:14px;font-weight:600;font-size:13px;line-height:1.6;font-variant-numeric:tabular-nums}
.statement-help{margin:12px 0 0;font-size:12px;line-height:1.6}
.statement-form .form-actions button,.statement-preview .form-actions button{display:inline-flex;align-items:center;justify-content:center;gap:6px}
.statement-form .form-actions svg,.statement-preview .form-actions svg{width:17px;height:17px;flex:none}
.statement-preview h3{font-size:18px;margin:0 0 8px;line-height:1.45}
.statement-buyer-name{font-size:15px;font-weight:650;overflow-wrap:anywhere;margin:0 0 6px}
.statement-table{margin-top:18px;border:1px solid var(--line);border-radius:10px}
.statement-table th,.statement-table td{padding:10px 12px;font-size:12px;font-variant-numeric:tabular-nums}
.statement-table th{background:var(--mint);font-size:11px}
.statement-scroll-hint{font-size:11px;margin:6px 0 0}
@media(min-width:681px){.statement-scroll-hint{display:none}}
.statement-preview-totals{display:grid;gap:0;margin:14px 0 0}
.statement-preview-totals>div{display:flex;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid var(--line)}
.statement-preview-totals dt{font-size:13px;min-width:0}
.statement-preview-totals dd{font-size:16px;font-weight:650;font-variant-numeric:tabular-nums;text-align:right;margin:0;overflow-wrap:anywhere}
.statement-preview-totals small{font-size:11px;font-weight:400;color:var(--muted);white-space:nowrap}
@media(max-width:480px){.statement-entry{align-items:flex-start;gap:10px}.statement-entry>.muted{padding-top:3px}.statement-option{padding:10px;gap:8px}.statement-option strong{font-size:13px}.statement-option small{font-size:11px}.statement-form .form-actions,.statement-preview .form-actions{gap:8px}.statement-form .form-actions button,.statement-preview .form-actions button{font-size:12px;padding:10px 12px}.statement-form .form-grid{gap:14px 10px}.statement-selection-total{font-size:12px}}

.cash-paid-option{display:flex;gap:12px;align-items:flex-start;padding:14px;border:1.5px solid #aabdb0;border-radius:10px;background:#eef5ec;cursor:pointer}.form-grid .cash-paid-option input[type=checkbox]{appearance:auto;width:20px;height:20px;min-height:20px;margin:2px 0 0;flex:0 0 20px;accent-color:#24674f}.cash-paid-option span{margin:0!important}.cash-paid-option strong{display:block;font-size:14px}.cash-paid-option small{display:block;margin-top:4px;font-size:12px;font-weight:400;line-height:1.5;color:#4d6153}
.form-grid label.cash-paid-option{display:flex;align-items:flex-start;gap:12px}

/* Monthly profit stands out without affecting the other summary metrics. */
.metrics .summary-profit{background:#e0f1e1;border-radius:8px;padding-top:10px;padding-bottom:10px}
.metrics .summary-profit strong.green{color:#176449}
.metrics .summary-profit strong.red{color:#a43930}
.profit-history{margin-top:18px}
.profit-history-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.profit-history-head h3{margin:0;font-size:16px}
.profit-history-head p{max-width:58ch;margin-top:6px;font-size:12px;line-height:1.55}
.profit-history-head label{display:flex;align-items:center;gap:8px;flex:none;font-size:12px;color:var(--muted)}
.profit-history-head select{min-height:42px;max-width:120px}
.profit-history-rows{margin-top:14px;max-height:520px;overflow:auto}
.profit-history-row{display:grid;grid-template-columns:minmax(85px,1fr) minmax(42px,2fr) minmax(90px,1fr);align-items:center;gap:12px;padding:11px 0;border-top:1px solid var(--line)}
.profit-history-date,.profit-history-amount{display:flex;flex-direction:column;gap:3px;min-width:0;font-variant-numeric:tabular-nums}
.profit-history-date strong{font-size:14px}.profit-history-date small,.profit-history-amount small{font-size:11px;color:var(--muted);line-height:1.35}
.profit-history-amount{text-align:right}.profit-history-amount strong{font-size:16px;overflow-wrap:anywhere}
.profit-history-bar{height:6px;background:#e4ebe1;border-radius:4px;overflow:hidden}.profit-history-bar i{height:100%;display:block;background:#237252;border-radius:4px}.profit-history-bar i.loss{background:#a94235}
.profit-chart-controls{display:flex;gap:6px;align-items:center;margin-top:18px}.profit-chart-controls button{min-height:38px;padding:7px 12px;font-size:13px}.profit-chart-controls button[aria-pressed=true]{background:#d8eddb;border-color:#387b58;font-weight:700}.profit-chart-controls>span{margin-left:auto;color:var(--muted);font-size:12px}.profit-chart-scroll{overflow-x:auto;max-width:100%;margin-top:12px}.profit-chart{display:block;max-width:none}.chart-tick{fill:#5e7164;font:11px system-ui,sans-serif}.profit-chart-empty{padding:22px 0}.profit-history-row{grid-template-columns:minmax(100px,1fr) minmax(100px,1fr)}.profit-ai{border-top:1px solid var(--line);padding-top:16px;margin-top:8px}.profit-ai>button{min-height:44px;font-weight:700}.profit-ai>p{margin-top:8px;font-size:12px;line-height:1.55}.profit-ai-result{margin-top:14px;padding:14px;border-radius:9px;background:#eef5ec}.profit-ai-result p{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.7;margin-top:8px}
@media(max-width:600px){.metrics .summary-profit{border-radius:0;background:#d8eddb}.profit-history-head{flex-wrap:wrap;gap:10px}.profit-history-head label{width:100%;justify-content:space-between}.profit-history-row{grid-template-columns:minmax(78px,1fr) minmax(85px,1fr);gap:8px}.profit-history-amount strong{font-size:14px}}

/* Desktop keeps the familiar paper ledger, with a shorter path to the data. */
@media(min-width:1024px){
 .app-header{height:62px;padding-inline:28px}
 html[lang=vi] .sidebar .brand{gap:7px}
 html[lang=vi] .sidebar .brand svg{width:28px;flex:none}
 html[lang=vi] .sidebar .brand strong{font-size:15px;white-space:nowrap}
 main{padding:18px 28px 24px}
 .page-heading{margin-bottom:14px}
 .page-heading>div{display:grid;grid-template-columns:auto 1fr;align-items:baseline;column-gap:14px;row-gap:3px}
 .page-heading h1{grid-column:1;grid-row:1;font-size:24px;line-height:1.25}
 .page-heading .date-line{grid-column:2;grid-row:1;margin:0}
 .page-heading .muted{grid-column:1/-1;grid-row:2;margin:0;line-height:1.4}
 .metrics{padding:12px 0;margin-bottom:14px}
 .metric strong{font-size:25px}.metric>span{margin-bottom:5px}.metric small{margin-top:3px}
 .toolbar{margin:12px 0;gap:10px}.toolbar input[type=month],.toolbar select,.search input{min-height:42px}
 .order-list{gap:12px}.order-card{padding:15px 18px}.order-top{margin-bottom:9px}.order-bottom{margin-top:10px;padding-top:10px}
 .table-panel th,.table-panel td{padding:10px 14px}
 .panel{padding:18px}.balance-row{padding:10px 0}
 .ytd-panel,.profit-history{margin-top:14px}
 .ytd-totals{margin-top:12px;padding-top:10px}.ytd-help{margin-top:9px}
}
@media(min-width:1024px) and (max-width:1100px){html[lang=vi] .sidebar .brand strong{font-size:13px}}
@media(min-width:1280px){
 #app:has(#nav [data-tab=orders].active) .order-list{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
 #app:has(#nav [data-tab=orders].active) .order-bottom{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px}
 #app:has(#nav [data-tab=orders].active) .order-bottom>div:nth-child(even){text-align:right}
 #app:has(#nav [data-tab=summary].active) #page{display:grid;grid-template-columns:minmax(310px,0.85fr) minmax(0,1.15fr);column-gap:16px;align-items:start}
 #app:has(#nav [data-tab=summary].active) #page>*{grid-column:1/-1;min-width:0}
 #app:has(#nav [data-tab=summary].active) #page>.toolbar{grid-row:1}
 #app:has(#nav [data-tab=summary].active) #page>.metrics{grid-row:2}
 #app:has(#nav [data-tab=summary].active) #page>.metrics+p{grid-row:3}
 #app:has(#nav [data-tab=summary].active) #page>.ytd-panel{grid-column:1;grid-row:4}
 #app:has(#nav [data-tab=summary].active) #page>.profit-history{grid-column:2;grid-row:4 / span 2}
 #app:has(#nav [data-tab=summary].active) #page>.summary-grid{grid-column:1;grid-row:5;grid-template-columns:1fr;margin-top:14px;gap:14px}
}
.capital-card-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}
#new-action[hidden]{display:none!important}
.workflow-tabs{display:flex;gap:8px;margin:14px 0}
.workflow-tabs button{min-height:44px;font-size:13px;white-space:nowrap}
.workflow-tabs button[aria-pressed=true]{background:var(--mint);border-color:var(--green);font-weight:700}
.workflow-scope,.cash-scope,.summary-scope{font-size:12px;line-height:1.65}
.followup-summary{display:flex;flex-wrap:wrap;gap:10px 24px;margin:12px 0 16px;font-size:14px}
.followup-grid{display:grid;gap:14px;margin-top:14px;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr))}
.summary-month-toolbar label{display:flex;align-items:center;gap:10px;min-width:0}
.summary-month-toolbar label>span{font-size:13px;white-space:nowrap}
.summary-month-toolbar button{font-size:13px}
.summary-scope .text-button{display:block;margin-top:6px;line-height:1.5;text-align:left}
.payment-date-filters{display:flex;align-items:end;gap:10px;margin-bottom:12px}
.payment-date-filters label{display:grid;gap:5px;min-width:0}
.payment-date-filters label>span{font-size:12px;color:var(--muted)}
.payment-date-filters input{min-width:0;min-height:42px;width:180px;max-width:100%;font-size:14px}
.payment-date-filters button{min-height:42px;font-size:12px}
.payment-filter-summary{padding:12px 16px;border:1px solid var(--line);border-radius:10px;background:#fffef7;margin:12px 0}
.payment-filter-summary>div{display:flex;justify-content:space-between;gap:10px;font-size:12px;color:var(--muted)}
.payment-filter-summary dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:10px 0 4px}
.payment-filter-summary dt{font-size:12px;color:var(--muted)}
.payment-filter-summary dd{margin:5px 0 0;font-weight:700;font-size:18px;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.payment-filter-summary dd small{display:block;font-size:11px;font-weight:400;color:var(--muted)}
.payment-filter-summary>p{margin:8px 0 0;font-size:11px;color:var(--muted)}
.payment-ledger-toolbar h3{font-size:15px;margin:0}.payment-ledger-toolbar .toolbar-right{display:flex;flex-wrap:wrap;gap:8px}.payment-ledger-toolbar button{font-size:12px;min-height:42px;padding-inline:12px}
@media(max-width:600px){.summary-month-toolbar{align-items:stretch;flex-direction:column}.summary-month-toolbar label{justify-content:space-between}.summary-month-toolbar input{max-width:190px;min-width:0}.summary-month-toolbar button{align-self:flex-end;min-height:40px}.payment-date-filters{display:grid;grid-template-columns:1fr 1fr;gap:8px}.payment-date-filters input{width:100%;box-sizing:border-box}.payment-date-filters button{grid-column:1/-1;justify-self:end;min-height:36px;padding-block:4px}.payment-filter-summary{padding:12px}.payment-filter-summary dl{gap:8px}.payment-filter-summary dd{font-size:16px}.payment-filter-summary>div{flex-wrap:wrap}.payment-ledger-toolbar{align-items:stretch;flex-direction:column}.payment-ledger-toolbar .toolbar-right{display:grid;grid-template-columns:1fr 1fr}.payment-ledger-toolbar [data-action=export]{grid-column:1/-1}.workflow-tabs button{flex:1;padding-inline:8px;font-size:12px}}
.capital-card-actions button{display:inline-flex;align-items:center;justify-content:center;gap:6px;font-size:13px;min-height:44px;white-space:nowrap}
.payment-filters{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:16px 0 12px}
.payment-filters>div{display:flex;gap:6px;min-width:0}
.payment-filters button{min-height:44px;font-size:13px;white-space:nowrap}
.payment-filters button[aria-pressed=true]{background:var(--mint);border-color:var(--green);font-weight:700}
.payment-filters select{min-height:44px;font-size:13px;max-width:190px}
.capital-overview{padding:14px 16px;border:1px solid #b9cbbd;border-radius:10px;background:#eef5ec}
.capital-overview-totals{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.capital-overview-totals>div{min-width:0}
.capital-overview-totals span{font-size:13px;color:var(--muted)}
.capital-overview-totals strong{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px;font-size:20px;margin-top:4px;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.capital-overview-totals small{font-size:11px;font-weight:400;color:var(--muted)}
.capital-overview>p{margin:10px 0 0;font-size:12px;line-height:1.5}
@media(max-width:600px){.payment-filters{align-items:stretch;flex-direction:column;gap:8px}.payment-filters>div{display:grid;grid-template-columns:1fr 1fr}.payment-filters button{padding-inline:8px;font-size:12px}.payment-filters select{max-width:none;width:100%}.capital-card-actions button{font-size:12px;padding-inline:10px}}

/* Task actions remain visible across transaction and follow-up views. */
.business-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:12px 0}
.business-actions .workflow-tabs{margin:0}.statement-launch{display:flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap;background:#f8dc86;font-weight:700;font-size:13px;min-height:44px}.statement-launch svg{width:18px;height:18px}
.cash-help{font-size:12px;margin:4px 0 12px;color:var(--muted)}.cash-help summary,.payment-advanced summary{cursor:pointer;min-height:32px;display:flex;align-items:center;gap:6px}.cash-help summary::before,.payment-advanced summary::before{content:'+';font-weight:700}.cash-help[open] summary::before,.payment-advanced[open] summary::before{content:'−'}
.payment-advanced{font-size:12px;margin:0 0 8px}.payment-advanced .payment-date-filters{margin-top:8px}.payment-advanced summary{color:var(--green);font-weight:600}
.cash-compact .metric strong{font-size:23px}.cash-compact{margin-bottom:4px}.payment-ledger-toolbar{margin-top:8px}.payment-ledger-toolbar .toolbar-right{gap:6px}.payment-ledger-toolbar button{padding-inline:10px}
.collection-overview{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:14px;border-radius:12px;border:1px solid #b9cbbd;background:#edf4ed;margin:14px 0}
.collection-overview>div{min-width:0}.collection-overview span{display:block;font-size:12px;color:var(--muted)}.collection-overview strong{display:block;font-size:19px;margin-top:4px;overflow-wrap:anywhere}.collection-overview .collection-due{grid-column:1/-1;display:flex;align-items:baseline;justify-content:space-between;border-top:1px solid #b9cbbd;padding-top:10px}.collection-due strong{font-size:26px;color:var(--green)}.collection-overview .detail-unit{font-size:11px;font-weight:500}
.detail-status-line{display:flex;align-items:center;flex-wrap:wrap;gap:6px;font-size:12px;color:var(--muted);margin:10px 0}
.detail-action-bar{display:flex;gap:8px;position:sticky;top:66px;z-index:2;background:var(--paper);padding:10px 0;margin-bottom:12px}.detail-action-bar button{font-size:13px;min-height:44px;display:flex;gap:5px;align-items:center;justify-content:center;white-space:nowrap}.detail-action-bar button svg{width:16px;height:16px}.detail-action-bar .primary{flex:1}.detail-action-bar button:disabled{opacity:.55;cursor:default;box-shadow:none;transform:none}
.detail-breakdown{border-block:1px solid var(--line);margin:14px 0}.detail-breakdown>summary{padding:14px 0;cursor:pointer;font-size:14px;font-weight:700}.detail-breakdown .detail-meta{padding-bottom:16px}
.amount-warning,.payment-attention{padding:12px;border-radius:9px;background:#fff3d6;color:#694a19;font-size:13px;line-height:1.65;margin:12px 0;border:1px solid #d8c69b}.amount-warning p{margin:0}.amount-warning p+p{margin-top:6px}.payment-attention{display:flex;align-items:center;justify-content:space-between;gap:10px}.payment-attention button{white-space:nowrap;min-height:42px;font-size:12px}
.attachment-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:18px 0 10px}.attachment-heading h3{font-size:14px;margin:0}.attachment-heading button{font-size:12px;min-height:40px;display:flex;align-items:center;gap:5px}.attachment-heading svg{width:16px;height:16px}.statement-brand{font-size:26px;font-weight:800;color:var(--green);margin-bottom:12px}
@media(max-width:600px){
 .business-actions{gap:6px}.business-actions .workflow-tabs{gap:4px;flex:1}.business-actions .workflow-tabs button{padding-inline:7px;font-size:12px}.statement-launch{padding-inline:9px;font-size:12px;gap:4px}.statement-launch svg{width:16px;height:16px}
 .metrics.cash-compact{display:grid;grid-template-columns:1fr 1fr;padding:0;margin-bottom:4px}.cash-compact .metric:first-child{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid var(--line)}.cash-compact .metric:first-child strong{font-size:26px}.cash-compact .metric:first-child small{margin-left:8px}.cash-compact .metric{padding:9px 14px}.cash-compact .metric>span{font-size:11px}.cash-compact .metric strong{font-size:18px}.cash-compact .metric small{font-size:10px;margin-top:2px}
 .payment-filters>div{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:5px}.payment-filters{margin:10px 0 3px}.payment-filters button{min-height:40px;padding-inline:4px;font-size:12px}.payment-ledger-toolbar .toolbar-right{display:flex;flex-wrap:wrap}.payment-ledger-toolbar h3{display:none}.payment-ledger-toolbar button{min-height:36px;padding:5px 8px;font-size:11px}.payment-ledger-toolbar [data-action=export]{margin-left:auto}
 .cash-table{min-width:0!important;width:100%}.cash-table thead{display:none}.cash-table tbody,.cash-table tr{display:block}.cash-table tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(90px,auto);gap:4px 12px;padding:12px 14px;border-bottom:1px solid var(--line)}.cash-table td{padding:0!important;border:0!important;min-width:0}.cash-table td:nth-child(1){grid-column:1;grid-row:1;font-size:11px;color:var(--muted)}.cash-table td:nth-child(2){grid-column:1;grid-row:2;font-size:13px;font-weight:700;overflow-wrap:anywhere}.cash-table td:nth-child(2) .mini{font-weight:400;font-size:11px}.cash-table td:nth-child(3){grid-column:1;grid-row:3}.cash-table td:nth-child(4){grid-column:2;grid-row:1 / span 3;align-self:center;font-size:20px;white-space:normal;overflow-wrap:anywhere}.cash-table td:nth-child(5){grid-column:1;grid-row:4;font-size:11px;color:var(--muted)}.cash-table td:nth-child(5)::before{content:'记录人 · ';}html[lang=vi] .cash-table td:nth-child(5)::before{content:'Người ghi · ';}.cash-table td:nth-child(6){grid-column:2;grid-row:4;text-align:right}.cash-table td:nth-child(6) button{min-height:32px;font-size:11px}.cash-table td:nth-child(4) small{font-size:10px}
 .detail-action-bar{top:66px;gap:6px}.detail-action-bar button{padding-inline:9px;font-size:12px}.collection-overview{padding:12px}.collection-overview strong{font-size:18px}.collection-overview .collection-due{gap:12px}.collection-due strong{font-size:24px}.detail-action-bar~.amount-warning{margin-top:0}
}

.photo-button{white-space:nowrap}.photo-button svg{width:20px;height:20px;flex:none}
@media(max-width:380px){.detail-action-bar{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.detail-action-bar .primary{grid-column:1/-1}.detail-action-bar button{min-width:0}.collection-overview .collection-due{flex-wrap:wrap;gap:4px}.attachment-heading{align-items:flex-start;flex-wrap:wrap}}
/* Customer receivables: compact summary and expandable transaction rows. */
.business-actions .customer-balances-launch{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;min-height:40px}.customer-balances-launch svg{width:18px;height:18px}.customer-balance-hint{color:var(--muted);font-size:12px;line-height:1.55;margin:0 0 14px}.customer-balance-totals{display:grid;grid-template-columns:1fr 1fr;gap:10px;background:var(--mint);border-radius:10px;padding:14px;margin-bottom:12px}.customer-balance-totals>div{min-width:0}.customer-balance-totals span,.customer-balance-totals strong,.customer-balance-name small,.customer-balance-value small{display:block}.customer-balance-totals span{font-size:12px;color:var(--muted)}.customer-balance-totals strong{font-size:18px;line-height:1.35;margin-top:4px;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}.customer-balance-totals strong small{font-size:11px;font-weight:500}.customer-unconfirmed{font-size:12px;color:var(--muted)}.customer-balance-group{border-bottom:1px solid var(--line)}.customer-balance-group summary{list-style:none;display:flex;align-items:center;gap:10px;padding:14px 0;min-height:65px;cursor:pointer}.customer-balance-group summary::-webkit-details-marker{display:none}.customer-balance-group summary:focus-visible{outline:3px solid var(--green);outline-offset:2px}.customer-balance-name{min-width:0;flex:1}.customer-balance-name strong{font-size:14px;overflow-wrap:anywhere}.customer-balance-name small,.customer-balance-value small{font-size:11px;color:var(--muted);margin-top:3px}.customer-balance-value{text-align:right;flex-shrink:0;font-variant-numeric:tabular-nums}.customer-balance-value strong{font-size:16px;color:var(--green)}.customer-chevron{font-size:22px;color:var(--muted);transform:rotate(90deg)}.customer-balance-group[open] .customer-chevron{transform:rotate(-90deg)}.customer-balance-orders{padding:0 0 9px}.customer-balance-order{display:flex;justify-content:space-between;gap:10px;align-items:center;text-align:left;width:100%;padding:10px 12px;margin:3px 0;min-height:60px;border:0;border-radius:8px;box-shadow:none;background:#f1f5ec}.customer-balance-order:hover{box-shadow:none;transform:none;background:#e3eee4}.customer-balance-order>span:first-child{min-width:0}.customer-balance-order strong,.customer-balance-order small{display:block}.customer-balance-order small{font-size:11px;color:var(--muted);margin-top:3px}.customer-order-amount{flex-shrink:0;text-align:right}.customer-zero{font-size:13px;color:var(--muted);margin:10px 0}.customer-balance-order:focus-visible{outline:3px solid var(--green);outline-offset:2px}@media(max-width:440px){.business-actions{flex-wrap:wrap}.business-actions .customer-balances-launch,.business-actions .statement-launch{font-size:12px;padding:8px 10px;min-height:40px}.customer-balance-totals{gap:8px;padding:12px}.customer-balance-totals strong{font-size:16px}}

/* Current task layout and touch rules. */
.business-tools{display:flex;align-items:center;gap:8px;min-width:0}
.business-tools button{min-height:44px}
.customer-controls{display:grid;gap:8px;margin:14px 0 10px}
.customer-controls input{width:100%;min-width:0;min-height:44px}
.customer-select-label{display:grid;gap:4px;font-size:12px;color:var(--muted)}
.customer-select-label select{width:100%;min-width:0;min-height:44px;color:var(--ink)}
.customer-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.customer-filters button{min-height:44px;font-size:13px;padding:8px;white-space:nowrap}
.customer-filters button[aria-pressed=true]{background:var(--mint);border-color:var(--green);font-weight:700}
.customer-balances .customer-overdue{color:#96362c;line-height:1.45}
.customer-balances .customer-balance-hint{margin:18px 0 0;padding-top:12px;border-top:1px solid var(--line)}
.customer-back{display:inline-flex;align-items:center;gap:8px;min-height:44px;margin-bottom:12px;font-size:13px;color:var(--green);border:0;box-shadow:none;background:transparent;padding:6px 0}
.customer-back svg{width:18px;height:18px;transform:rotate(180deg)}
.payment-system-note{font-size:11px;line-height:1.5;font-weight:400;color:var(--muted);max-width:36ch;margin-top:3px}
.payment-system-note summary{cursor:pointer;list-style:none;min-height:28px;display:flex;align-items:center;gap:5px}
.payment-system-note summary::-webkit-details-marker{display:none}
.payment-system-note summary::after{content:'+';font-size:12px}
.payment-system-note[open] summary::after{content:'−'}
.payment-system-note p{margin:4px 0 0;overflow-wrap:anywhere;white-space:normal}
.payment-system-note summary:focus-visible{outline:2px solid var(--green);outline-offset:2px}
.order-card-units{display:flex;justify-content:space-between;flex-wrap:wrap;gap:4px 12px;margin-top:10px;font-size:11px;line-height:1.5;color:var(--muted)}
.order-bottom>div>strong small{font-size:11px;font-weight:500}
@media(max-width:600px){
 .business-actions{display:grid;grid-template-columns:1fr;gap:8px;margin:12px 0}
 .business-actions .workflow-tabs{display:grid;grid-template-columns:1fr 1fr;width:100%;gap:6px}
 .business-tools{display:grid;grid-template-columns:1fr 1fr;gap:6px}
 .business-actions .workflow-tabs button,.business-tools .customer-balances-launch,.business-tools .statement-launch{width:100%;min-height:44px;padding:8px;font-size:12px;justify-content:center;white-space:nowrap}
 .business-tools .statement-launch{background:var(--paper);font-weight:600}
 .order-bottom{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px}
 .order-bottom>div{min-width:0}
 .order-bottom>div>span{display:block;font-size:12px;line-height:1.5;white-space:nowrap}
 .order-bottom>div>strong{line-height:1.4;margin-top:3px;font-variant-numeric:tabular-nums}
 .order-bottom>div:nth-child(even){text-align:right}
 .order-card .route>span{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;line-height:1.5}
 .payment-ledger-toolbar button,.payment-filters button,.payment-date-filters button,.cash-table td:nth-child(6) button{min-height:44px}
 .payment-ledger-toolbar .toolbar-right{display:grid;grid-template-columns:1fr 1fr auto;width:100%;gap:6px}
 .payment-ledger-toolbar [data-action=export]{grid-column:auto;margin-left:0}
 .payment-ledger-toolbar [data-record-payment]{display:inline-flex;align-items:center;justify-content:center}
 .cash-table tr{grid-template-columns:minmax(0,1fr) minmax(112px,auto);gap:3px 12px;padding:10px 12px}
 .cash-table td:nth-child(4){font-size:18px;font-variant-numeric:tabular-nums;white-space:nowrap}
 .cash-table td:nth-child(6) button{padding-block:6px}
 .cash-table td:nth-child(5){align-self:center}
 .payment-system-note summary{min-height:44px}
 .customer-balance-order{flex-wrap:wrap}
 .customer-order-amount{margin-left:auto}
 .customer-filters button{font-size:12px}
 .dialog-heading .icon-button{min-height:44px;width:44px}
 .payment-filter-summary dl{grid-template-columns:1fr;gap:8px}
 .payment-filter-summary dl>div{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
 .payment-filter-summary dd{margin:0;text-align:right}
 .payment-filter-summary dd small{display:inline;margin-left:4px}
}
@media(max-width:350px){.cash-table td:nth-child(4){font-size:16px}.customer-balance-totals{grid-template-columns:1fr}.payment-filter-summary dl{grid-template-columns:1fr}.payment-filter-summary dl>div{display:flex;justify-content:space-between;align-items:baseline;gap:8px}.payment-filter-summary dd{margin:0}.payment-filter-summary dd small{display:inline;margin-left:4px}}

/* Stable paper page heading across all four tabs. */
#app[data-business="paper"] .page-heading{min-height:46px}
@media(max-width:760px){
 #app[data-business="paper"] main{padding-top:12px}
 #app[data-business="paper"] #page{display:flow-root}
 #app[data-business="paper"] .page-heading{gap:2px 10px;margin-bottom:12px;grid-template-rows:auto 46px}
}

/* Compact monthly summary controls and metrics on phones. */
@media(max-width:600px){
 #app[data-business="paper"] .summary-month-toolbar{display:flex;flex-direction:row;align-items:center;gap:8px;margin:0 0 10px}
 #app[data-business="paper"] .summary-month-toolbar label{flex:1;min-width:0}
 #app[data-business="paper"] .summary-month-toolbar label>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 #app[data-business="paper"] .summary-month-toolbar input{width:100%;max-width:190px;min-height:44px}
 #app[data-business="paper"] .summary-month-toolbar button{align-self:auto;min-height:44px;white-space:nowrap}
 #app[data-business="paper"]:has(#nav [data-tab="summary"].active) .metrics{margin-bottom:10px}
 #app[data-business="paper"]:has(#nav [data-tab="summary"].active) .metric{padding:10px 12px}
 #app[data-business="paper"]:has(#nav [data-tab="summary"].active) .metric>span{margin-bottom:4px}
 #app[data-business="paper"]:has(#nav [data-tab="summary"].active) .metric small{margin-top:3px}
 #app[data-business="paper"] .summary-scope{font-size:12px;line-height:1.5}
}

/* Share the label and value rows so both yearly totals stay aligned. */
.ytd-totals{grid-template-rows:auto auto;row-gap:5px}
.ytd-totals>div{display:contents}
.ytd-totals>div:first-child dt,.ytd-totals>div:first-child dd{grid-column:1}
.ytd-totals>div:last-child dt,.ytd-totals>div:last-child dd{grid-column:2}
.ytd-totals dt{grid-row:1}
.ytd-totals dd{grid-row:2;align-self:start}
.business-actions button{font-family:inherit}
#page .business-actions button{font-size:14px;font-weight:600;line-height:1.4;min-height:48px;padding:10px 12px;display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:normal}
#page .business-actions button svg{width:18px;height:18px;flex:none}
@media(max-width:680px){#page .business-actions button{font-size:13px}}

/* Settings: compact categories, separate full-width action rows. */
.settings-page .settings-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:0 0 20px;border-bottom:1px solid var(--line);padding-bottom:10px}
.settings-tabs [role=tab]{min-width:0;min-height:44px;font-size:14px;padding:10px 6px;box-shadow:none}
.settings-tabs [aria-selected=true]{background:var(--green);color:white;border-color:var(--green)}
.settings-panel[hidden]{display:none!important}
.settings-panel>.settings-section+.settings-section{margin-top:16px}
.settings-links{display:grid;gap:12px}
.settings-page .settings-link{width:100%;min-width:0;min-height:60px;display:flex;align-items:center;gap:12px;padding:15px;text-align:left;box-shadow:none}
.settings-link span{flex:1;min-width:0;overflow-wrap:anywhere;font-size:15px;line-height:1.5}
.settings-link svg{flex:none;width:20px;height:20px}
.settings-page .settings-panel{min-width:0}

#receipt-feedback{position:fixed;z-index:10000;left:50%;top:90px;transform:translateX(-50%);display:flex;align-items:center;gap:14px;padding:20px;max-width:calc(100vw - 32px);width:350px;background:#edf5ef;color:#173f30;border:2px solid #276b53;border-radius:16px;box-shadow:0 8px 24px #173f3020;animation:receipt-arrive .22s ease-out}
#receipt-feedback[hidden]{display:none}#receipt-feedback .receipt-check{display:grid;place-items:center;width:44px;height:44px;flex-shrink:0;border-radius:50%;background:#276b53;color:white;font-size:28px}#receipt-feedback div{display:grid;gap:6px;min-width:0}#receipt-feedback b{font-size:22px;overflow-wrap:anywhere}#receipt-feedback small{font-size:14px}#receipt-feedback button{margin-left:auto;align-self:flex-start;min-width:36px;min-height:36px;padding:0;background:transparent;border:0;font-size:24px;box-shadow:none}
@keyframes receipt-arrive{from{opacity:0;translate:0 -8px}to{opacity:1;translate:0 0}}
@media(prefers-reduced-motion:reduce){#receipt-feedback{animation:none}}

#receipt-feedback .receipt-wallet{position:relative;width:64px;height:76px;flex-shrink:0;overflow:hidden}#receipt-feedback .receipt-wallet svg{position:absolute;bottom:0;left:0;width:64px;height:64px}#receipt-feedback .receipt-wallet i{position:absolute;z-index:1;top:0;left:18px;display:grid;place-items:center;width:24px;height:24px;border:2px solid #996c20;border-radius:50%;background:#f2cb66;color:#5b4214;font:700 16px sans-serif;animation:receipt-coin .8s ease-in both}#receipt-feedback .receipt-wallet i:nth-child(2){left:28px;animation-delay:.18s}#receipt-feedback .receipt-wallet i:nth-child(3){left:12px;animation-delay:.36s}
@keyframes receipt-coin{0%{transform:translateY(-25px) rotate(-20deg);opacity:0}15%{opacity:1}80%{opacity:1}100%{transform:translateY(53px) rotate(15deg);opacity:0}}
@media(prefers-reduced-motion:reduce){#receipt-feedback .receipt-wallet i{animation:none;top:6px}#receipt-feedback .receipt-wallet i:nth-child(n+2){display:none}}

.login-day-weather{padding:16px;margin:0 0 22px;border:1px solid #b6cdbf;border-radius:12px;background:#edf5ef;color:#173f30;display:grid;gap:8px}.login-day{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap}.login-day strong{font-size:26px;line-height:1.2;text-transform:capitalize}.login-day time{font-size:15px;font-variant-numeric:tabular-nums}.login-weather{display:grid;gap:4px}.login-weather strong{font-size:20px}.login-weather span{font-size:14px}.login-day-weather small{font-size:12px;line-height:1.5}.login-day-weather button{justify-self:start;padding:7px 12px;min-height:40px;font-size:13px}.login-day-weather .weather-source{font-size:11px;color:#526c5d;justify-self:end}.login-weather:has(strong:empty){display:none}

.login-layout{position:relative;padding-top:76px;gap:48px}.login-layout>.login-language{position:absolute;top:20px;right:32px;margin:0}.login-form{padding:22px}.login-day-weather{padding:13px 14px;margin-bottom:16px;gap:5px}.login-day strong{font-size:24px}.login-weather strong{font-size:19px}.login-form .people-picker{margin-bottom:14px;gap:12px}.login-form .person-choice{min-height:112px;padding:10px 8px;gap:3px}.login-form .avatar,.login-form .avatar svg{width:50px;height:50px}.login-form .enter-button{margin:10px 0 12px;min-height:46px}.login-form .entry-links{gap:10px}.login-form h2{font-size:20px;margin-bottom:8px}.settings-weather-credit{margin-top:12px}
@media(max-width:760px){.login-layout{padding:16px 16px 24px}.login-layout>.login-language{top:16px;right:16px}.login-layout>.login-language select{min-height:38px;max-width:112px;padding:6px 9px}.login-story{padding:0 120px 12px 0;min-height:60px}.login-company-brand{min-width:0}.login-story .login-company-brand img{width:150px;max-width:100%;height:auto}.login-form{padding:16px}.login-day-weather{margin-bottom:14px;padding:11px 12px}.login-day{gap:6px}.login-day strong{font-size:23px}.login-day time{font-size:13px}.login-day-weather small{font-size:11px}.login-form .person-choice{min-height:105px}.login-form .password-label input{min-height:44px}}

.order-card .route .card-route-truck{display:inline-flex;align-items:center;flex:0 0 27px;width:27px;height:20px}.order-card .route .card-route-truck svg{display:block;width:27px;height:20px;fill:none;stroke:none}

/* Supplier classification sits beside the short name as a quiet optional flag. */
#contact-form .form-grid label.outsourcer-option{display:flex;flex-direction:row;align-items:center;align-self:end;gap:10px;min-height:46px;margin:0;padding:8px 0;cursor:pointer}
#contact-form .form-grid .outsourcer-option input[type=checkbox]{appearance:auto;width:18px;height:18px;min-height:18px;padding:0;margin:0;flex:0 0 18px;box-shadow:none;border-radius:3px;accent-color:var(--green)}
#contact-form .form-grid .outsourcer-option>span{display:block;margin:0;font-size:13px;font-weight:500;line-height:1.5;color:var(--ink)}

.summary-month-selects{display:flex;gap:8px}.summary-month-selects select{min-width:0;min-height:44px}

/* Align the logo with the language selector; retain the original avatars. */
.login-company-brand{transform:translateY(-10px)}

/* Daily first-visit greeting: a route marker arrives once, without sound. */
.login-delight{display:flex;align-items:center;gap:8px;margin-top:8px;padding-top:8px;border-top:1px solid #c7dacc;color:#275841;font-size:13px;line-height:1.5}
.login-delight[hidden]{display:none}
.login-delight svg{width:40px;height:28px;flex:none;fill:var(--paper);stroke:#477d63;stroke-width:1.5}
.login-delight .daily-route-dot{fill:#e4b953;stroke:#7b601b}
.login-delight.with-motion .daily-route-dot{animation:daily-route-arrive 800ms cubic-bezier(.16,1,.3,1) both}
@keyframes daily-route-arrive{from{transform:translateX(-20px)}to{transform:translateX(0)}}
@media(prefers-reduced-motion:reduce){.login-delight.with-motion .daily-route-dot{animation:none}}

/* Unslop polish: paper ledger, quiet controls, readable amounts.
   Review method: unslop by Damir Sokolovsky, https://github.com/heydamir/unslop
   (CC BY 4.0). Brand, route illustration and business behavior are preserved. */
:root{--ground:#f5f6f4;--paper:#fffefb;--line:#d4dcd6}
h1,h2,h3,.brand strong,.header-wordmark,.route,.contact-top strong{font-weight:600}
button,input,select,textarea{font-family:inherit}
button{border-width:1px;border-color:#8b9e92;font-weight:500}
.primary{border:1px solid var(--green);box-shadow:none;font-weight:600}
.primary:active:not(:disabled){box-shadow:none;transform:translateY(1px)}
.icon-button,.preferences select,.login-language select{border-width:1px;border-color:#8b9e92}
.sidebar,.app-header{border-width:1px;border-color:var(--line)}
.sidebar nav{gap:8px}
.sidebar nav button{font-weight:500;border-radius:8px}
.sidebar nav button.active,.sidebar nav button.active:hover{background:var(--mint);color:#1b503c;border-color:transparent;box-shadow:none;font-weight:600}
.metrics,.order-card,.contact-card,.panel,.table-panel,.empty,.settings-section{border:1px solid var(--line);box-shadow:none;border-radius:12px}
.order-card:hover{border-color:#789383;box-shadow:0 2px 8px #263b350a}
.metrics{margin-bottom:16px}
.metric strong{font-weight:600;letter-spacing:0;font-variant-numeric:tabular-nums}
.order-list{gap:12px}.order-card{padding:16px}
.order-bottom{gap:12px;margin-top:16px;padding-top:12px;border-top-style:solid;border-color:var(--line)}
.order-bottom strong,.contact-price,.detail-meta strong,.collection-overview strong,.balance-row strong{font-weight:600;font-variant-numeric:tabular-nums}
.status{border-radius:4px;padding:2px 6px}
.search input,.toolbar select,.toolbar input[type=month]{border-width:1px;border-color:#8b9e92}
.statement-launch{background:var(--paper);font-weight:500}
.workflow-tabs button[aria-pressed=true]{font-weight:600}
.business-actions{gap:12px}
.contact-card{padding:16px}.contact-price{padding:4px 8px;margin:8px 0}
.settings-section{padding:16px}.settings-section-title{gap:8px;font-weight:600}
.settings-page .settings-tabs{gap:8px;margin-bottom:16px;padding-bottom:12px}
.settings-page .settings-link{padding:16px;border-color:var(--line);border-radius:10px}
.settings-links{gap:12px}
dialog{border:1px solid var(--line);box-shadow:0 16px 48px #172e2726;border-radius:16px}
.dialog-heading,.form-actions{border-color:var(--line);border-width:1px}
.dialog-heading{padding:16px 24px;gap:12px}
.dialog-heading h2{font-weight:600;line-height:1.4;min-width:0}
.dialog-heading .icon-button{min-height:44px;height:44px;width:44px;padding:0;border-color:#8b9e92;font-size:24px}
#modal-body,#contact-body{padding:24px}
.form-grid{gap:16px}.form-grid input,.form-grid select,.form-grid textarea,.login-form input{border-width:1px;padding:12px}
.form-grid input[type=number]{font-weight:500;font-variant-numeric:tabular-nums}
.form-block legend,.fold-section>summary,.fold-section>summary .fold-title{font-weight:600}
.fold-section{border:1px solid var(--line);background:#f6f8f4}
.form-actions{margin:24px -24px -24px;padding:16px 24px;bottom:-24px}
.detail-action-bar{gap:8px;min-width:0}
.detail-action-bar button{min-width:0;white-space:normal;overflow-wrap:anywhere;line-height:1.4;font-weight:500}
.detail-action-bar .primary{font-weight:600}
.login-form{border:1px solid var(--line);box-shadow:0 8px 24px #263b350a}
.person-choice{border-width:1px;background:#f6f8f5}
.person-choice[aria-pressed=true]{background:var(--mint);border-color:var(--green);box-shadow:none}
.login-form .person-choice strong,.login-day strong,.login-weather strong{font-weight:600}
html[lang|=zh] .sales-types tbody th,html[lang|=zh] .sales-types tbody td{font-size:13px}
html[lang|=zh] .sales-types thead th{font-size:11px}
html[lang|=zh] .sales-types tbody td{white-space:nowrap;overflow-wrap:normal}
@media(max-width:600px){html[lang|=zh] .sales-types table{min-width:300px}html[lang|=zh] .sales-types thead th{font-size:10px}}
.login-day strong{font-size:22px}.login-weather strong{font-size:17px}.login-weather span{font-size:13px}.login-form h2{font-size:18px}
@media(max-width:760px){.login-day strong{font-size:21px}}
#toast{box-shadow:0 4px 16px #263b3520}
@media(max-width:760px){
 .sidebar nav button.active{box-shadow:none}
 .order-card{padding:16px}.route{font-size:16px;gap:8px}
 dialog{border:0;border-radius:0;box-shadow:none}
 .dialog-heading{padding:12px 16px;min-height:68px}.dialog-heading h2{font-size:18px}
 #modal-body,#contact-body{padding:16px}
 .form-actions{bottom:0;margin:24px -16px -16px;padding:12px 16px calc(12px + env(safe-area-inset-bottom,0px))}
 .detail-action-bar{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
 .detail-action-bar>.primary{grid-column:1/-1;min-height:48px}
 .detail-action-bar button{min-height:44px;padding:10px 8px}
 .business-actions{gap:8px}
 .login-form{padding:16px}
}

/* Annual company celebration stays clear of login controls. */
.company-anniversary{position:fixed;inset:0;z-index:2000;pointer-events:none;overflow:hidden}
.anniversary-message{position:absolute;top:18px;left:50%;transform:translateX(-50%);width:min(420px,calc(100% - 32px));box-sizing:border-box;padding:18px 22px;background:#f8f4e7;color:#244d3f;border:1px solid #c5ab6c;border-radius:12px;text-align:center;}
.anniversary-message strong{display:block;font-size:22px;line-height:1.35;margin-bottom:8px}
.anniversary-message span{display:block;font-size:14px;line-height:1.65}
.company-anniversary i{position:absolute;top:-16px;width:7px;height:12px;animation:anniversary-paper 2.8s var(--delay) cubic-bezier(.2,.6,.4,1) both}
@keyframes anniversary-paper{from{transform:translate3d(0,-20px,0) rotate(var(--turn));opacity:1}to{transform:translate3d(var(--drift),90vh,0) rotate(calc(var(--turn) + 360deg));opacity:0}}

@media(prefers-reduced-motion:reduce){.anniversary-message{animation:none}.company-anniversary i{display:none}}

/* Compact cash overview and controls above the transaction list. */

.payments-head dl.cash-compact{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:0 0 4px;padding:0;overflow:hidden;border:1px solid var(--line);border-radius:10px;background:var(--paper)}
.payments-head .cash-compact>div{padding:9px 12px;min-width:0;overflow-wrap:anywhere}
.payments-head .cash-compact>div:first-child{background:#e7f0ea}
.payments-head .cash-compact>div+div{border-inline-start:1px solid var(--line)}
.payments-head .cash-compact dt,.payments-head .cash-compact small{font-size:12px;line-height:1.35}
.payments-head .cash-compact dd{margin:3px 0 0;font-size:clamp(18px,2vw,24px);font-weight:700;line-height:1.2;font-variant-numeric:tabular-nums}
html[lang="zh-CN"] .payments-head .cash-compact dd{font-size:clamp(16px,calc(2vw - 2px),22px)}
.payments-tools,.payments-list-controls{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:4px 10px}
.payments-tools{justify-content:flex-start;border-bottom:1px solid var(--line);padding-bottom:3px}
.payments-tools details{margin:0;min-width:0}
.payments-tools summary,.payments-tools button{min-height:44px}
.payments-tools details[open]{flex:1 0 100%}
.payments-tools>button{font-size:13px;padding:4px 10px}
.payments-list-controls{padding:6px 0}
.payments-list-controls .payment-filters,.payments-list-controls .payment-ledger-toolbar{margin:0}
.payments-list-controls .payment-ledger-toolbar button{min-height:44px}
@media(max-width:700px){
 .payments-head .cash-compact>div{padding:8px}
 .payments-tools{gap:0 8px}
 .payments-list-controls{display:grid;grid-template-columns:minmax(0,1fr);gap:5px}
 .payments-list-controls .payment-filters button{white-space:normal;min-height:44px}
 .payments-list-controls .toolbar-right{display:grid;grid-template-columns:1fr 1fr auto;width:100%}
}
